# -*- Mode: HTML -*- # This Source Code Form is subject to the terms of the Mozilla Public # License, v. 2.0. If a copy of the MPL was not distributed with this # file, You can obtain one at http://mozilla.org/MPL/2.0/. %notificationDTD; %browserDTD; %brandDTD; ]> "" true true { [url, postData, mayInheritPrincipal] = response; if (url) { matchLastLocationChange = (lastLocationChange == gBrowser.selectedBrowser.lastLocationChange); continueOperation.call(this); } }); } function continueOperation() { this.value = url; gBrowser.userTypedValue = url; try { addToUrlbarHistory(url); } catch (ex) { // Things may go wrong when adding url to session history, // but don't let that interfere with the loading of the url. Cu.reportError(ex); } function loadCurrent() { openUILinkIn(url, "current", { allowThirdPartyFixup: true, disallowInheritPrincipal: !mayInheritPrincipal, allowPinnedTabHostChange: true, postData: postData }); } // Focus the content area before triggering loads, since if the load // occurs in a new tab, we want focus to be restored to the content // area when the current tab is re-selected. gBrowser.selectedBrowser.focus(); let isMouseEvent = aTriggeringEvent instanceof MouseEvent; let altEnter = !isMouseEvent && aTriggeringEvent && aTriggeringEvent.altKey; if (altEnter) { // XXX This was added a long time ago, and I'm not sure why it is // necessary. Alt+Enter's default action might cause a system beep, // or something like that? aTriggeringEvent.preventDefault(); aTriggeringEvent.stopPropagation(); } // If the current tab is empty, ignore Alt+Enter (just reuse this tab) altEnter = altEnter && !isTabEmpty(gBrowser.selectedTab); if (isMouseEvent || altEnter) { // Use the standard UI link behaviors for clicks or Alt+Enter let where = "tab"; if (isMouseEvent) where = whereToOpenLink(aTriggeringEvent, false, false); if (where == "current") { if (matchLastLocationChange) { loadCurrent(); } } else { this.handleRevert(); let params = { allowThirdPartyFixup: true, postData: postData, initiatingDoc: document }; openUILinkIn(url, where, params); } } else { if (matchLastLocationChange) { loadCurrent(); } } } ]]> = 0) { url = url.substring(0, firstSlash) + suffix + url.substring(firstSlash + 1); } else { url = url + suffix; } url = "http://www." + url; } } getShortcutOrURIAndPostData(url, data => { aCallback([data.url, data.postData, data.mayInheritPrincipal]); }); ]]> false var types = aEvent.dataTransfer.types; if (types.contains("application/x-moz-file") || types.contains("text/x-moz-url") || types.contains("text/uri-list") || types.contains("text/unicode")) aEvent.preventDefault(); 0 || this.valueIsTyped) return selectedVal; // The selection doesn't span the full domain if it doesn't contain a slash and is // followed by some character other than a slash. if (!selectedVal.contains("/")) { let remainder = inputVal.replace(selectedVal, ""); if (remainder != "" && remainder[0] != "/") return selectedVal; } let uriFixup = Cc["@mozilla.org/docshell/urifixup;1"].getService(Ci.nsIURIFixup); let uri; try { uri = uriFixup.createFixupURI(inputVal, Ci.nsIURIFixup.FIXUP_FLAG_NONE); } catch (e) {} if (!uri) return selectedVal; // Only copy exposable URIs try { uri = uriFixup.createExposableURI(uri); } catch (ex) {} // If the entire URL is selected, just use the actual loaded URI. if (inputVal == selectedVal) { // ... but only if isn't a javascript: or data: URI, since those // are hard to read when encoded if (!uri.schemeIs("javascript") && !uri.schemeIs("data")) { // Parentheses are known to confuse third-party applications (bug 458565). selectedVal = uri.spec.replace(/[()]/g, function (c) escape(c)); } return selectedVal; } // Just the beginning of the URL is selected, check for a trimmed // value let spec = uri.spec; let trimmedSpec = this.trimValue(spec); if (spec != trimmedSpec) { // Prepend the portion that trimValue removed from the beginning. // This assumes trimValue will only truncate the URL at // the beginning or end (or both). let trimmedSegments = spec.split(trimmedSpec); selectedVal = trimmedSegments[0] + selectedVal; } return selectedVal; ]]> = 0 && !this._noActionsKeys.has(event.keyCode)) { if (this._noActionsKeys.size == 0) { this.popup.setAttribute("noactions", "true"); this.removeAttribute("actiontype"); } this._noActionsKeys.add(event.keyCode); } ]]> " + urlString + ""; var dt = event.dataTransfer; dt.setData("text/x-moz-url", urlString + "\n" + title); dt.setData("text/unicode", urlString); dt.setData("text/html", htmlString); dt.effectAllowed = "copyLink"; event.stopPropagation(); ]]> with:" header. let headerSearchText = document.getAnonymousElementByAttribute(this, "anonid", "searchbar-oneoffheader-searchtext"); let textbox = searchbar.textbox; let self = this; let keyPressHandler = function() { headerSearchText.setAttribute("value", textbox.value); if (textbox.value) self.removeAttribute("showonlysettings"); }; textbox.addEventListener("keyup", keyPressHandler); this.addEventListener("popuphiding", function hiding() { textbox.removeEventListener("keyup", keyPressHandler); this.removeEventListener("popuphiding", hiding); }); keyPressHandler(); // Handle opensearch items. This needs to be done before building the // list of one off providers, as that code will return early if all the // alternative engines are hidden. let addEngineList = document.getAnonymousElementByAttribute(this, "anonid", "add-engines"); while (addEngineList.firstChild) addEngineList.firstChild.remove(); const kXULNS = "http://www.mozilla.org/keymaster/gatekeeper/there.is.only.xul"; let addEngines = getBrowser().mCurrentBrowser.engines; if (addEngines && addEngines.length > 0) { const kBundleURI = "chrome://browser/locale/search.properties"; let bundle = Services.strings.createBundle(kBundleURI); for (let engine of addEngines) { let button = document.createElementNS(kXULNS, "button"); let label = bundle.formatStringFromName("cmd_addFoundEngine", [engine.title], 1); button.setAttribute("class", "addengine-item"); button.setAttribute("label", label); button.setAttribute("pack", "start"); button.setAttribute("crop", "end"); button.setAttribute("tooltiptext", engine.uri); button.setAttribute("uri", engine.uri); if (engine.icon) { let uri = PlacesUtils.getImageURLForResolution(window, engine.icon); button.setAttribute("image", uri); } button.setAttribute("title", engine.title); addEngineList.appendChild(button); } } // Finally, build the list of one-off buttons. let list = document.getAnonymousElementByAttribute(this, "anonid", "search-panel-one-offs") while (list.firstChild) list.firstChild.remove(); let hiddenList; try { let pref = Services.prefs.getCharPref("browser.search.hiddenOneOffs"); hiddenList = pref ? pref.split(",") : []; } catch(e) { hiddenList = []; } let engines = Services.search.getVisibleEngines() .filter(e => e.name != currentEngine.name && hiddenList.indexOf(e.name) == -1); let header = document.getAnonymousElementByAttribute(this, "anonid", "search-panel-one-offs-header") header.collapsed = list.collapsed = !engines.length; if (!engines.length) return; let panel = document.getElementById("PopupSearchAutoComplete"); let minWidth = parseInt(panel.width) + 23; panel.setAttribute("style", "min-width: " + minWidth + "px"); // 49px is the min-width of each search engine button, // adapt this const when changing the css. // It's actually 48px + 1px of right border. // The + 1 is because the last button doesn't have a right border. let panelWidth = parseInt(panel.clientWidth); let enginesPerRow = Math.floor((panelWidth + 1) / 49); let buttonWidth = Math.floor(panelWidth / enginesPerRow); // There will be an emtpy area of: // panelWidth - enginesPerRow * buttonWidth px // at the end of each row. // If the tag with the list of search engines doesn't have // a fixed height, the panel will be sized incorrectly, causing the bottom // of the suggestion to be hidden. let rowCount = Math.ceil(engines.length / enginesPerRow); let height = rowCount * 33; // 32px per row, 1px border. list.setAttribute("height", height + "px"); let dummyItems = enginesPerRow - (engines.length % enginesPerRow || enginesPerRow); for (let i = 0; i < engines.length; ++i) { let engine = engines[i]; let button = document.createElementNS(kXULNS, "button"); button.setAttribute("label", engine.name); let uri = "chrome://browser/skin/search-engine-placeholder.png"; if (engine.iconURI) { uri = PlacesUtils.getImageURLForResolution(window, engine.iconURI.spec); } button.setAttribute("image", uri); button.setAttribute("class", "searchbar-engine-one-off-item"); button.setAttribute("tooltiptext", engine.name); button.setAttribute("width", buttonWidth); button.engine = engine; if ((i + 1) % enginesPerRow == 0) button.classList.add("last-of-row"); if (i >= engines.length + dummyItems - enginesPerRow) button.classList.add("last-row"); list.appendChild(button); } while (dummyItems) { let button = document.createElementNS(kXULNS, "button"); button.setAttribute("class", "searchbar-engine-one-off-item dummy last-row"); button.setAttribute("width", buttonWidth); if (!--dummyItems) button.classList.add("last-of-row"); list.appendChild(button); } ]]> 0 Cc["@mozilla.org/intl/stringbundle;1"]. getService(Ci.nsIStringBundleService). createBundle("chrome://browser/locale/places/places.properties"); 0 ? 0 : maxRow; } else if (newIndex > maxRow) { newIndex = index < maxRow ? maxRow : 0; } return newIndex; ]]> ") to text to be spoke aloud // by screen readers. convert "tag" and "bookmark" to the localized versions, // but don't do anything for "favicon" (the default) try { label += " " + this._bundle.GetStringFromName(aType + "ResultLabel"); } catch (e) { // Undefined result label, do nothing. } return label; ]]> 0 && this.selectedIndex == -1) this.selectedIndex = 0; ]]> document.getAnonymousElementByAttribute(this, "anonid", "progressmeter"); document.getAnonymousElementByAttribute(this, "anonid", "progresstext"); document.getAnonymousElementByAttribute(this, "anonid", "cancel"); let utils = {}; Components.utils.import("resource://gre/modules/DownloadUtils.jsm", utils); utils.DownloadUtils; = 0) maxProgress += aInstall.maxProgress; if (aInstall.state < AddonManager.STATE_DOWNLOADED) downloadingCount++; }); if (downloadingCount == 0) { this.destroy(); PopupNotifications.remove(this.notification); } else { this.setProgress(progress, maxProgress); } ]]> let sitw = {}; Components.utils.import("resource:///modules/SignInToWebsite.jsm", sitw); sitw.SignInToWebsiteUX; document.getAnonymousElementByAttribute(this, "anonid", "newidentitydesc"); document.getAnonymousElementByAttribute(this, "anonid", "chooseidentitydesc"); document.getAnonymousElementByAttribute(this, "anonid", "identities"); document.getAnonymousElementByAttribute(this, "anonid", "email"); document.getAnonymousElementByAttribute(this, "anonid", "newemail"); document.getAnonymousElementByAttribute(this, "anonid", "chooseemail"); document.getAnonymousElementByAttribute(this, "anonid", "throbber"); this.notification.options.identity; return this.identity.step; return document.getAnonymousElementByAttribute(this, "anonid", "center-item-menulist").value; document.getAnonymousElementByAttribute(this, "anonid", "center-item-menulist").value = val; &badContentBlocked.moreinfo; document.getElementById("bundle_brand").getString("brandShortName") document.getAnonymousElementByAttribute(this, "anonid", "badContentBlocked.title") document.getAnonymousElementByAttribute(this, "anonid", "mixedContent") document.getAnonymousElementByAttribute(this, "anonid", "mixedContentAction.unblock") document.getAnonymousElementByAttribute(this, "anonid", "mixedContentAction.block"); document.getAnonymousElementByAttribute(this, "anonid", "mixedContent.helplink") document.getAnonymousElementByAttribute(this, "anonid", "trackingContent") document.getAnonymousElementByAttribute(this, "anonid", "trackingContentAction.unblock") document.getAnonymousElementByAttribute(this, "anonid", "trackingContentAction.block"); document.getAnonymousElementByAttribute(this, "anonid", "trackingContent.helplink") ({SINGLE: 0, MULTI_COLLAPSED: 1, MULTI_EXPANDED: 2}) document.getAnonymousElementByAttribute(this, "anonid", "primarybutton"); document.getAnonymousElementByAttribute(this, "anonid", "secondarybutton") document.getAnonymousElementByAttribute(this, "anonid", "button-container") document.getElementById("bundle_brand").getString("brandShortName") [] a.pluginName.localeCompare(b.pluginName)); for (let action of sortedActions) { let item = document.createElementNS(XUL_NS, "row"); item.setAttribute("class", "plugin-popupnotification-centeritem"); item.action = action; this.appendChild(item); this._items.push(item); } switch (this._items.length) { case 0: PopupNotifications._dismiss(); break; case 1: this._setState(this._states.SINGLE); break; default: if (this.notification.options.primaryPlugin) { this._setState(this._states.MULTI_COLLAPSED); } else { this._setState(this._states.MULTI_EXPANDED); } } ]]> document.getAnonymousElementByAttribute(this, "anonid", "menuitem"); document.getAnonymousElementByAttribute(this, "anonid", "menu"); 600 document.getAnonymousElementByAttribute(this, "anonid", "promo-message"); document.getAnonymousElementByAttribute(this, "anonid", "promo-link"); Services.strings.createBundle("chrome://branding/locale/brand.properties");