rem
stringlengths 0
126k
| add
stringlengths 0
441k
| context
stringlengths 15
136k
|
---|---|---|
if (mean != gLastComputedMean) { | if (gLastComputedMean == -1 || mean != gLastComputedMean) { | function onUpdateProgress(){ var numActiveDownloads = gActiveDownloads.length; if (numActiveDownloads == 0) { document.title = document.documentElement.getAttribute("statictitle"); gLastComputedMean = 0; return; } var mean = 0; for (var i = 0; i < numActiveDownloads; ++i) { var dl = gActiveDownloads[i]; var progress = dl.percentComplete; if (progress < 100) mean += progress; } mean = Math.round(mean / numActiveDownloads); // At the end of a download, progress is set from 100% to 0% for // some reason. We can identify this case because at this point the // mean progress will be zero but the last computed mean will be // greater than zero. if (mean == 0 && gLastComputedMean > 0) { document.title = document.documentElement.getAttribute("statictitle"); return; } if (mean != gLastComputedMean) { gLastComputedMean = mean; var strings = document.getElementById("downloadStrings"); var title; if (numActiveDownloads > 1) title = strings.getFormattedString("downloadsTitleMultiple", [mean, numActiveDownloads]); else title = strings.getFormattedString("downloadsTitle", [mean]); document.title = title; }} |
window.title = document.documentElement.getAttribute("statictitle"); | document.title = document.documentElement.getAttribute("statictitle"); | function onUpdateProgress(){ var numActiveDownloads = gActiveDownloads.length; if (numActiveDownloads == 0) { window.title = document.documentElement.getAttribute("statictitle"); gLastComputedMean = 0; return; } var mean = 0; for (var i = 0; i < numActiveDownloads; ++i) { var dl = gActiveDownloads[i]; var progress = dl.percentComplete; if (progress < 100) mean += progress; } mean = Math.round(mean / numActiveDownloads); // At the end of a download, progress is set from 100% to 0% for // some reason. We can identify this case because at this point the // mean progress will be zero but the last computed mean will be // greater than zero. if (mean == 0 && gLastComputedMean > 0) { window.title = document.documentElement.getAttribute("statictitle"); return; } if (mean != gLastComputedMean) { gLastComputedMean = mean; var strings = document.getElementById("downloadStrings"); var title; if (numActiveDownloads > 1) title = strings.getFormattedString("downloadsTitleMultiple", [mean, numActiveDownloads]); else title = strings.getFormattedString("downloadsTitle", [mean]); window.title = title; }} |
window.title = title; | document.title = title; | function onUpdateProgress(){ var numActiveDownloads = gActiveDownloads.length; if (numActiveDownloads == 0) { window.title = document.documentElement.getAttribute("statictitle"); gLastComputedMean = 0; return; } var mean = 0; for (var i = 0; i < numActiveDownloads; ++i) { var dl = gActiveDownloads[i]; var progress = dl.percentComplete; if (progress < 100) mean += progress; } mean = Math.round(mean / numActiveDownloads); // At the end of a download, progress is set from 100% to 0% for // some reason. We can identify this case because at this point the // mean progress will be zero but the last computed mean will be // greater than zero. if (mean == 0 && gLastComputedMean > 0) { window.title = document.documentElement.getAttribute("statictitle"); return; } if (mean != gLastComputedMean) { gLastComputedMean = mean; var strings = document.getElementById("downloadStrings"); var title; if (numActiveDownloads > 1) title = strings.getFormattedString("downloadsTitleMultiple", [mean, numActiveDownloads]); else title = strings.getFormattedString("downloadsTitle", [mean]); window.title = title; }} |
var i; | function onViewToolbarsPopupShowing(aEvent){ var popup = aEvent.target; // Empty the menu for (var i = popup.childNodes.length-1; i >= 0; --i) { var deadItem = popup.childNodes[i]; if (deadItem.hasAttribute("toolbarindex")) popup.removeChild(deadItem); } var firstMenuItem = popup.firstChild; var toolbox = document.getElementById("navigator-toolbox"); for (var i = 0; i < toolbox.childNodes.length; ++i) { var toolbar = toolbox.childNodes[i]; var toolbarName = toolbar.getAttribute("toolbarname"); if (toolbarName) { var menuItem = document.createElement("menuitem"); menuItem.setAttribute("toolbarindex", i); menuItem.setAttribute("type", "checkbox"); menuItem.setAttribute("label", toolbarName); menuItem.setAttribute("accesskey", toolbar.getAttribute("accesskey")); menuItem.setAttribute("checked", toolbar.getAttribute("collapsed") != "true"); popup.insertBefore(menuItem, firstMenuItem); menuItem.addEventListener("command", onViewToolbarCommand, false); } toolbar = toolbar.nextSibling; }} |
|
for (var i = popup.childNodes.length-1; i >= 0; --i) { | for (i = popup.childNodes.length-1; i >= 0; --i) { | function onViewToolbarsPopupShowing(aEvent){ var popup = aEvent.target; // Empty the menu for (var i = popup.childNodes.length-1; i >= 0; --i) { var deadItem = popup.childNodes[i]; if (deadItem.hasAttribute("toolbarindex")) popup.removeChild(deadItem); } var firstMenuItem = popup.firstChild; var toolbox = document.getElementById("navigator-toolbox"); for (var i = 0; i < toolbox.childNodes.length; ++i) { var toolbar = toolbox.childNodes[i]; var toolbarName = toolbar.getAttribute("toolbarname"); if (toolbarName) { var menuItem = document.createElement("menuitem"); menuItem.setAttribute("toolbarindex", i); menuItem.setAttribute("type", "checkbox"); menuItem.setAttribute("label", toolbarName); menuItem.setAttribute("accesskey", toolbar.getAttribute("accesskey")); menuItem.setAttribute("checked", toolbar.getAttribute("collapsed") != "true"); popup.insertBefore(menuItem, firstMenuItem); menuItem.addEventListener("command", onViewToolbarCommand, false); } toolbar = toolbar.nextSibling; }} |
for (var i = 0; i < toolbox.childNodes.length; ++i) { | for (i = 0; i < toolbox.childNodes.length; ++i) { | function onViewToolbarsPopupShowing(aEvent){ var popup = aEvent.target; // Empty the menu for (var i = popup.childNodes.length-1; i >= 0; --i) { var deadItem = popup.childNodes[i]; if (deadItem.hasAttribute("toolbarindex")) popup.removeChild(deadItem); } var firstMenuItem = popup.firstChild; var toolbox = document.getElementById("navigator-toolbox"); for (var i = 0; i < toolbox.childNodes.length; ++i) { var toolbar = toolbox.childNodes[i]; var toolbarName = toolbar.getAttribute("toolbarname"); if (toolbarName) { var menuItem = document.createElement("menuitem"); menuItem.setAttribute("toolbarindex", i); menuItem.setAttribute("type", "checkbox"); menuItem.setAttribute("label", toolbarName); menuItem.setAttribute("accesskey", toolbar.getAttribute("accesskey")); menuItem.setAttribute("checked", toolbar.getAttribute("collapsed") != "true"); popup.insertBefore(menuItem, firstMenuItem); menuItem.addEventListener("command", onViewToolbarCommand, false); } toolbar = toolbar.nextSibling; }} |
lastWhoCheckTime = new Date(); var checkNext = (lastWhoCheckChannel == null); | function checkWho() { var checkNext = (net.lastWhoCheckChannel == null); for (var c in net.primServ.channels) { var chan = net.primServ.channels[c]; if (checkNext && chan.active && chan.getUsersLength() < client.prefs["autoAwayCap"]) { net.primServ.LIGHTWEIGHT_WHO = true; net.primServ.sendData("WHO " + chan.encodedName + "\n"); net.lastWhoCheckChannel = chan; net.lastWhoCheckTime = Date.now(); return; } if (chan == net.lastWhoCheckChannel) checkNext = true; } if (net.lastWhoCheckChannel) { net.lastWhoCheckChannel = null; checkWho(); } }; | function onWhoTimeout(){ lastWhoCheckTime = new Date(); var checkNext = (lastWhoCheckChannel == null); for (var n in client.networks) { var net = client.networks[n]; if (net.isConnected()) { for (var c in net.primServ.channels) { var chan = net.primServ.channels[c]; if (checkNext && chan.active && chan.getUsersLength() < client.prefs["autoAwayCap"]) { net.primServ.LIGHTWEIGHT_WHO = true; net.primServ.sendData("WHO " + chan.encodedName + "\n"); lastWhoCheckChannel = chan; return; } if (chan == lastWhoCheckChannel) checkNext = true; } } } if (lastWhoCheckChannel) { lastWhoCheckChannel = null; onWhoTimeout(); }} |
if (net.isConnected()) { for (var c in net.primServ.channels) { var chan = net.primServ.channels[c]; if (checkNext && chan.active && chan.getUsersLength() < client.prefs["autoAwayCap"]) { net.primServ.LIGHTWEIGHT_WHO = true; net.primServ.sendData("WHO " + chan.encodedName + "\n"); lastWhoCheckChannel = chan; return; } if (chan == lastWhoCheckChannel) checkNext = true; } } } if (lastWhoCheckChannel) { lastWhoCheckChannel = null; onWhoTimeout(); | var period = net.prefs["autoAwayPeriod"]; var waited = Date.now() - net.lastWhoCheckTime + 5000; if (net.isConnected() && (period != 0) && (period * 60000 < waited)) checkWho(); | function onWhoTimeout(){ lastWhoCheckTime = new Date(); var checkNext = (lastWhoCheckChannel == null); for (var n in client.networks) { var net = client.networks[n]; if (net.isConnected()) { for (var c in net.primServ.channels) { var chan = net.primServ.channels[c]; if (checkNext && chan.active && chan.getUsersLength() < client.prefs["autoAwayCap"]) { net.primServ.LIGHTWEIGHT_WHO = true; net.primServ.sendData("WHO " + chan.encodedName + "\n"); lastWhoCheckChannel = chan; return; } if (chan == lastWhoCheckChannel) checkNext = true; } } } if (lastWhoCheckChannel) { lastWhoCheckChannel = null; onWhoTimeout(); }} |
case 9: e.preventDefault(); break; | function onWindowKeyPress (e){ var code = Number (e.keyCode) switch (code) { case 112: /* F1 */ case 113: /* ... */ case 114: case 115: case 116: case 117: case 118: case 119: case 120: case 121: /* F10 */ var idx = code - 112; if ((client.viewsArray[idx]) && (client.viewsArray[idx].source)) setCurrentObject(client.viewsArray[idx].source); return false; break; case 33: /* pgup */ var w = window.frames[0]; var newOfs = w.pageYOffset - (w.innerHeight / 2); if (newOfs > 0) w.scrollTo (w.pageXOffset, newOfs); else w.scrollTo (w.pageXOffset, 0); break; case 34: /* pgdn */ var w = window.frames[0]; var newOfs = w.pageYOffset + (w.innerHeight / 2); if (newOfs < (w.innerHeight + w.pageYOffset)) w.scrollTo (w.pageXOffset, newOfs); else w.scrollTo (w.pageXOffset, (w.innerHeight + w.pageYOffset)); break; default: }} |
|
if ((idx in client.viewsArray) && client.viewsArray[idx].source) dispatch("set-current-view", { view: client.viewsArray[idx].source }); | if (!modifier && (idx in client.viewsArray) && client.viewsArray[idx].source) { var newView = client.viewsArray[idx].source; dispatch("set-current-view", { view: newView }); e.preventDefault(); } | function onWindowKeyPress (e){ var code = Number(e.keyCode); var w; var newOfs; var userList = document.getElementById("user-list"); var elemFocused = document.commandDispatcher.focusedElement; switch (code) { case 9: /* tab */ if (e.ctrlKey || e.metaKey) { cycleView(e.shiftKey ? -1: 1); e.preventDefault(); } break; case 112: /* F1 */ case 113: /* ... */ case 114: case 115: case 116: case 117: case 118: case 119: case 120: case 121: /* F10 */ var idx = code - 112; if ((idx in client.viewsArray) && client.viewsArray[idx].source) dispatch("set-current-view", { view: client.viewsArray[idx].source }); break; case 33: /* pgup */ if (e.ctrlKey) { cycleView(-1); break; } if (elemFocused == userList) break; w = client.currentFrame; newOfs = w.pageYOffset - (w.innerHeight * 0.75); if (newOfs > 0) w.scrollTo (w.pageXOffset, newOfs); else w.scrollTo (w.pageXOffset, 0); e.preventDefault(); break; case 34: /* pgdn */ if (e.ctrlKey) { cycleView(1); break; } if (elemFocused == userList) break; w = client.currentFrame; newOfs = w.pageYOffset + (w.innerHeight * 0.75); if (newOfs < (w.innerHeight + w.pageYOffset)) w.scrollTo (w.pageXOffset, newOfs); else w.scrollTo (w.pageXOffset, (w.innerHeight + w.pageYOffset)); e.preventDefault(); break; }} |
e.preventDefault(); | function onWindowKeyPress (e){ var code = Number(e.keyCode); var w; var newOfs; var userList = document.getElementById("user-list"); var elemFocused = document.commandDispatcher.focusedElement; switch (code) { case 9: /* tab */ if (e.ctrlKey || e.metaKey) { cycleView(e.shiftKey ? -1: 1); e.preventDefault(); } break; case 112: /* F1 */ case 113: /* ... */ case 114: case 115: case 116: case 117: case 118: case 119: case 120: case 121: /* F10 */ var idx = code - 112; if ((idx in client.viewsArray) && client.viewsArray[idx].source) dispatch("set-current-view", { view: client.viewsArray[idx].source }); break; case 33: /* pgup */ if (e.ctrlKey) { cycleView(-1); break; } if (elemFocused == userList) break; w = client.currentFrame; newOfs = w.pageYOffset - (w.innerHeight * 0.75); if (newOfs > 0) w.scrollTo (w.pageXOffset, newOfs); else w.scrollTo (w.pageXOffset, 0); e.preventDefault(); break; case 34: /* pgdn */ if (e.ctrlKey) { cycleView(1); break; } if (elemFocused == userList) break; w = client.currentFrame; newOfs = w.pageYOffset + (w.innerHeight * 0.75); if (newOfs < (w.innerHeight + w.pageYOffset)) w.scrollTo (w.pageXOffset, newOfs); else w.scrollTo (w.pageXOffset, (w.innerHeight + w.pageYOffset)); e.preventDefault(); break; }} |
|
if ((client.viewsArray[idx]) && (client.viewsArray[idx].source)) | if ((idx in client.viewsArray) && (client.viewsArray[idx].source)) | function onWindowKeyPress (e){ var code = Number (e.keyCode); var w; var newOfs; switch (code) { case 112: /* F1 */ case 113: /* ... */ case 114: case 115: case 116: case 117: case 118: case 119: case 120: case 121: /* F10 */ var idx = code - 112; if ((client.viewsArray[idx]) && (client.viewsArray[idx].source)) setCurrentObject(client.viewsArray[idx].source); break; case 33: /* pgup */ w = window.frames[0]; newOfs = w.pageYOffset - (w.innerHeight / 2); if (newOfs > 0) w.scrollTo (w.pageXOffset, newOfs); else w.scrollTo (w.pageXOffset, 0); break; case 34: /* pgdn */ w = window.frames[0]; newOfs = w.pageYOffset + (w.innerHeight / 2); if (newOfs < (w.innerHeight + w.pageYOffset)) w.scrollTo (w.pageXOffset, newOfs); else w.scrollTo (w.pageXOffset, (w.innerHeight + w.pageYOffset)); break; case 9: /* tab */ e.preventDefault(); break; default: }} |
e.preventDefault(); | function onWindowKeyPress (e){ var code = Number (e.keyCode); var w; var newOfs; switch (code) { case 112: /* F1 */ case 113: /* ... */ case 114: case 115: case 116: case 117: case 118: case 119: case 120: case 121: /* F10 */ var idx = code - 112; if ((client.viewsArray[idx]) && (client.viewsArray[idx].source)) setCurrentObject(client.viewsArray[idx].source); break; case 33: /* pgup */ w = window.frames[0]; newOfs = w.pageYOffset - (w.innerHeight / 2); if (newOfs > 0) w.scrollTo (w.pageXOffset, newOfs); else w.scrollTo (w.pageXOffset, 0); break; case 34: /* pgdn */ w = window.frames[0]; newOfs = w.pageYOffset + (w.innerHeight / 2); if (newOfs < (w.innerHeight + w.pageYOffset)) w.scrollTo (w.pageXOffset, newOfs); else w.scrollTo (w.pageXOffset, (w.innerHeight + w.pageYOffset)); break; case 9: /* tab */ e.preventDefault(); break; default: }} |
|
$.fx.Opacity = function(a,b){ | $.fx.Opacity = function(a,b,sv){ | $.fx.Opacity = function(a,b){ var o = new $.fx(a,b,"opacity"); o.cur = function(){return parseFloat(o.el.style.opacity);}; o.a = function() { var e = o.el.style; if (o.now == 1) { o.now = 0.9999; } if (window.ActiveXObject) { e.filter = "alpha(opacity=" + o.now*100 + ")"; } e.opacity = o.now; }; o.io = o.now = 1; o.a(); return o;}; |
o.io = o.now = 1; | o.io = o.now = (sv || o.cur()); | $.fx.Opacity = function(a,b){ var o = new $.fx(a,b,"opacity"); o.cur = function(){return parseFloat(o.el.style.opacity);}; o.a = function() { var e = o.el.style; if (o.now == 1) { o.now = 0.9999; } if (window.ActiveXObject) { e.filter = "alpha(opacity=" + o.now*100 + ")"; } e.opacity = o.now; }; o.io = o.now = 1; o.a(); return o;}; |
if (aEvent.altKey) | if (aEvent && aEvent.altKey) | open: function (aEvent, aRDFNode) { var urlValue = LITERAL(this.db, aRDFNode, NC_NS + "URL"); // Ignore "NC:" and empty urls. if (urlValue.substring(0,3) == "NC:" || !urlValue) return; if (aEvent.altKey) this.showPropertiesForNode (aRDFNode); else if (this.openNewWindow) openDialog (getBrowserURL(), "_blank", "chrome,all,dialog=no", urlValue); else openTopWin (urlValue); aEvent.preventBubble(); }, |
aEvent.preventBubble(); | if (aEvent) aEvent.preventBubble(); | open: function (aEvent, aRDFNode) { var urlValue = LITERAL(this.db, aRDFNode, NC_NS + "URL"); // Ignore "NC:" and empty urls. if (urlValue.substring(0,3) == "NC:" || !urlValue) return; if (aEvent.altKey) this.showPropertiesForNode (aRDFNode); else if (this.openNewWindow) openDialog (getBrowserURL(), "_blank", "chrome,all,dialog=no", urlValue); else openTopWin (urlValue); aEvent.preventBubble(); }, |
url = browser.getShortcutOrURI(dialog.input.value); | url = browser.getShortcutOrURI(dialog.input.value, postData); | function open(){ var url; if (browser) url = browser.getShortcutOrURI(dialog.input.value); else url = dialog.input.value; try { switch (dialog.openWhereList.value) { case "0": browser.loadURI(url); break; case "1": window.opener.delayedOpenWindow(getBrowserURL(), "all,dialog=no", url); break; case "3": if (browser.getBrowser && browser.getBrowser().localName == "tabbrowser") browser.delayedOpenTab(url); else browser.loadURI(url); // Just do a normal load. break; } } catch(exception) { } if (pref) { var str = Components.classes["@mozilla.org/supports-string;1"] .createInstance(Components.interfaces.nsISupportsString); str.data = dialog.input.value; pref.setComplexValue("general.open_location.last_url", Components.interfaces.nsISupportsString, str); pref.setIntPref("general.open_location.last_window_choice", dialog.openWhereList.value); } // Delay closing slightly to avoid timing bug on Linux. window.close(); return false;} |
browser.loadURI(url); | browser.loadURI(url, null, postData.value); | function open(){ var url; if (browser) url = browser.getShortcutOrURI(dialog.input.value); else url = dialog.input.value; try { switch (dialog.openWhereList.value) { case "0": browser.loadURI(url); break; case "1": window.opener.delayedOpenWindow(getBrowserURL(), "all,dialog=no", url); break; case "3": if (browser.getBrowser && browser.getBrowser().localName == "tabbrowser") browser.delayedOpenTab(url); else browser.loadURI(url); // Just do a normal load. break; } } catch(exception) { } if (pref) { var str = Components.classes["@mozilla.org/supports-string;1"] .createInstance(Components.interfaces.nsISupportsString); str.data = dialog.input.value; pref.setComplexValue("general.open_location.last_url", Components.interfaces.nsISupportsString, str); pref.setIntPref("general.open_location.last_window_choice", dialog.openWhereList.value); } // Delay closing slightly to avoid timing bug on Linux. window.close(); return false;} |
window.opener.delayedOpenWindow(getBrowserURL(), "all,dialog=no", url); | window.opener.delayedOpenWindow(getBrowserURL(), "all,dialog=no", url, postData); | function open(){ var url; if (browser) url = browser.getShortcutOrURI(dialog.input.value); else url = dialog.input.value; try { switch (dialog.openWhereList.value) { case "0": browser.loadURI(url); break; case "1": window.opener.delayedOpenWindow(getBrowserURL(), "all,dialog=no", url); break; case "3": if (browser.getBrowser && browser.getBrowser().localName == "tabbrowser") browser.delayedOpenTab(url); else browser.loadURI(url); // Just do a normal load. break; } } catch(exception) { } if (pref) { var str = Components.classes["@mozilla.org/supports-string;1"] .createInstance(Components.interfaces.nsISupportsString); str.data = dialog.input.value; pref.setComplexValue("general.open_location.last_url", Components.interfaces.nsISupportsString, str); pref.setIntPref("general.open_location.last_window_choice", dialog.openWhereList.value); } // Delay closing slightly to avoid timing bug on Linux. window.close(); return false;} |
browser.delayedOpenTab(url); | browser.delayedOpenTab(url, null, null, postData.value); | function open(){ var url; if (browser) url = browser.getShortcutOrURI(dialog.input.value); else url = dialog.input.value; try { switch (dialog.openWhereList.value) { case "0": browser.loadURI(url); break; case "1": window.opener.delayedOpenWindow(getBrowserURL(), "all,dialog=no", url); break; case "3": if (browser.getBrowser && browser.getBrowser().localName == "tabbrowser") browser.delayedOpenTab(url); else browser.loadURI(url); // Just do a normal load. break; } } catch(exception) { } if (pref) { var str = Components.classes["@mozilla.org/supports-string;1"] .createInstance(Components.interfaces.nsISupportsString); str.data = dialog.input.value; pref.setComplexValue("general.open_location.last_url", Components.interfaces.nsISupportsString, str); pref.setIntPref("general.open_location.last_window_choice", dialog.openWhereList.value); } // Delay closing slightly to avoid timing bug on Linux. window.close(); return false;} |
window.opener.delayedOpenWindow( "chrome: | window.opener.delayedOpenWindow( getBrowserURL(), "all,dialog=no", dialog.input.value ); | function open() { try { switch ( dialog.openAppList.data ) { case "0": browser.loadUrl( dialog.input.value ); break; case "1": dump("*** foopy\n"); window.opener.delayedOpenWindow( "chrome://navigator/content/navigator.xul", "all,dialog=no", dialog.input.value ); break; case "2": window.opener.delayedOpenWindow( "chrome://editor/content", "chrome,all,dialog=no", dialog.input.value ); break; } } catch( exception ) { } // Delay closing slightly to avoid timing bug on Linux. window.close(); return false; } |
case "3": if (browser.getBrowser && browser.getBrowser().localName == "tabbrowser") browser.delayedOpenTab(url); else browser.loadURI(url); break; | function open(){ var url; if (browser) url = browser.getShortcutOrURI(dialog.input.value); else url = dialog.input.value; try { switch (dialog.openAppList.value) { case "0": browser.loadURI(url); break; case "1": window.opener.delayedOpenWindow(getBrowserURL(), "all,dialog=no", url); break; case "2": // editPage is in utilityOverlay.js (all editor openers with URL should use this) // 3rd param tells editPage to use "delayedOpenWindow" editPage(url, window.opener, true); break; } } catch(exception) { } if (pref) { pref.SetUnicharPref("general.open_location.last_url", dialog.input.value); pref.SetIntPref("general.open_location.last_window_choice", dialog.openAppList.value); } // Delay closing slightly to avoid timing bug on Linux. window.close(); return false;} |
|
"centerscreen,chrome,resizable=no, minimizable=no"); | "chrome, resizable=no, minimizable=no"); | function openAboutDialog(){#ifdef XP_MACOSX var wm = Components.classes["@mozilla.org/appshell/window-mediator;1"] .getService(Components.interfaces.nsIWindowMediator); var win = wm.getMostRecentWindow("Browser:About"); if (win) win.focus(); else { // XXXmano: define minimizable=no although it does nothing on OS X // (see Bug 287162); remove this comment once Bug 287162 is fixed... window.open("chrome://browser/content/aboutDialog.xul", "About", "centerscreen,chrome,resizable=no, minimizable=no"); }#else window.openDialog("chrome://browser/content/aboutDialog.xul", "About", "modal,centerscreen,chrome,resizable=no");#endif} |
var panels = document.getElementsByName("category_panel"); | var panels = document.getElementsByClassName("category_panel"); | function openAll() { var panels = document.getElementsByName("category_panel"); for(var i=0; i<panels.length; i++) { var fullId = panels[i].id; var index = fullId.lastIndexOf('_'); var catId = fullId.substring(0, index); showCategory(catId); } } |
aAttachment.messageUri); | aAttachment.messageUri, aAttachment.isExternalAttachment); | function openAttachment(aAttachment){ messenger.openAttachment(aAttachment.contentType, aAttachment.url, encodeURIComponent(aAttachment.displayName), aAttachment.messageUri);} |
this.uri); | this.uri, false); | createNewAttachmentInfo.prototype.openAttachment = function openAttachment(){ messenger.openAttachment(this.contentType, this.url, encodeURIComponent(this.displayName), this.uri);} |
var args = {dspname: displayName, opval: 0}; window.openDialog("chrome: "openSaveAttachment", "chrome,modal", args); if (args.opval == 1) messenger.openAttachment(contentType, url, displayName, messageUri); else if (args.opval == 2) messenger.saveAttachment(url, displayName, messageUri); | messenger.openAttachment(contentType, url, displayName, messageUri); | function OpenAttachURL(contentType, url, displayName, messageUri){ var args = {dspname: displayName, opval: 0}; window.openDialog("chrome://messenger/content/openSaveAttachment.xul", "openSaveAttachment", "chrome,modal", args); if (args.opval == 1) messenger.openAttachment(contentType, url, displayName, messageUri); else if (args.opval == 2) messenger.saveAttachment(url, displayName, messageUri);} |
openBookmark: function (aSelection, aTargetBrowser, aDS) | openBookmark: function (aSelection, aTargetBrowser, aDS, aEvent) | openBookmark: function (aSelection, aTargetBrowser, aDS) { if (!aTargetBrowser) return; for (var i=0; i<aSelection.length; ++i) { var type = aSelection.type[i]; if (type == "Bookmark" || type == "") this.openOneBookmark(aSelection.item[i].Value, aTargetBrowser, aDS); else if (type == "FolderGroup" || type == "Folder" || type == "PersonalToolbarFolder") this.openGroupBookmark(aSelection.item[i].Value, aTargetBrowser); } }, |
this.openOneBookmark(aSelection.item[i].Value, aTargetBrowser, aDS); | this.openOneBookmark(aSelection.item[i].Value, aTargetBrowser, aDS, aEvent); | openBookmark: function (aSelection, aTargetBrowser, aDS) { if (!aTargetBrowser) return; for (var i=0; i<aSelection.length; ++i) { var type = aSelection.type[i]; if (type == "Bookmark" || type == "") this.openOneBookmark(aSelection.item[i].Value, aTargetBrowser, aDS); else if (type == "FolderGroup" || type == "Folder" || type == "PersonalToolbarFolder") this.openGroupBookmark(aSelection.item[i].Value, aTargetBrowser); } }, |
this.openGroupBookmark(aSelection.item[i].Value, aTargetBrowser); | this.openGroupBookmark(aSelection.item[i].Value, aTargetBrowser, aEvent); | openBookmark: function (aSelection, aTargetBrowser, aDS) { if (!aTargetBrowser) return; for (var i=0; i<aSelection.length; ++i) { var type = aSelection.type[i]; if (type == "Bookmark" || type == "") this.openOneBookmark(aSelection.item[i].Value, aTargetBrowser, aDS); else if (type == "FolderGroup" || type == "Folder" || type == "PersonalToolbarFolder") this.openGroupBookmark(aSelection.item[i].Value, aTargetBrowser); } }, |
while (containerChildren.hasMoreElements()) { | for (; containerChildren.hasMoreElements(); ++index) { | function OpenBookmarkGroupFromResource(resource, datasource, rdf) { var urlResource = rdf.GetResource("http://home.netscape.com/NC-rdf#URL"); var rdfContainer = Components.classes["@mozilla.org/rdf/container;1"].getService(Components.interfaces.nsIRDFContainer); rdfContainer.Init(datasource, resource); var containerChildren = rdfContainer.GetElements(); var tabPanels = gBrowser.mPanelContainer.childNodes; var tabCount = tabPanels.length; var index = 0; while (containerChildren.hasMoreElements()) { var res = containerChildren.getNext().QueryInterface(Components.interfaces.nsIRDFResource); var target = datasource.GetTarget(res, urlResource, true); if (target) { var uri = target.QueryInterface(Components.interfaces.nsIRDFLiteral).Value; if (index < tabCount) tabPanels[index].loadURI(uri, null, nsIWebNavigation.LOAD_FLAGS_NONE); else gBrowser.addTab(uri); index++; } } if (index == 0) return; // If the bookmark group was completely invalid, just bail. // Select the first tab in the group. var tabs = gBrowser.mTabContainer.childNodes; gBrowser.selectedTab = tabs[0]; // Close any remaining open tabs that are left over. for (var i = tabCount-1; i >= index; i--) gBrowser.removeTab(tabs[i]);} |
if (index < tabCount) tabPanels[index].loadURI(uri, null, nsIWebNavigation.LOAD_FLAGS_NONE); else gBrowser.addTab(uri); index++; | gBrowser.addTab(uri); | function OpenBookmarkGroupFromResource(resource, datasource, rdf) { var urlResource = rdf.GetResource("http://home.netscape.com/NC-rdf#URL"); var rdfContainer = Components.classes["@mozilla.org/rdf/container;1"].getService(Components.interfaces.nsIRDFContainer); rdfContainer.Init(datasource, resource); var containerChildren = rdfContainer.GetElements(); var tabPanels = gBrowser.mPanelContainer.childNodes; var tabCount = tabPanels.length; var index = 0; while (containerChildren.hasMoreElements()) { var res = containerChildren.getNext().QueryInterface(Components.interfaces.nsIRDFResource); var target = datasource.GetTarget(res, urlResource, true); if (target) { var uri = target.QueryInterface(Components.interfaces.nsIRDFLiteral).Value; if (index < tabCount) tabPanels[index].loadURI(uri, null, nsIWebNavigation.LOAD_FLAGS_NONE); else gBrowser.addTab(uri); index++; } } if (index == 0) return; // If the bookmark group was completely invalid, just bail. // Select the first tab in the group. var tabs = gBrowser.mTabContainer.childNodes; gBrowser.selectedTab = tabs[0]; // Close any remaining open tabs that are left over. for (var i = tabCount-1; i >= index; i--) gBrowser.removeTab(tabs[i]);} |
gBrowser.selectedTab = tabs[0]; for (var i = tabCount-1; i >= index; i--) gBrowser.removeTab(tabs[i]); | gBrowser.selectedTab = tabs[tabCount]; | function OpenBookmarkGroupFromResource(resource, datasource, rdf) { var urlResource = rdf.GetResource("http://home.netscape.com/NC-rdf#URL"); var rdfContainer = Components.classes["@mozilla.org/rdf/container;1"].getService(Components.interfaces.nsIRDFContainer); rdfContainer.Init(datasource, resource); var containerChildren = rdfContainer.GetElements(); var tabPanels = gBrowser.mPanelContainer.childNodes; var tabCount = tabPanels.length; var index = 0; while (containerChildren.hasMoreElements()) { var res = containerChildren.getNext().QueryInterface(Components.interfaces.nsIRDFResource); var target = datasource.GetTarget(res, urlResource, true); if (target) { var uri = target.QueryInterface(Components.interfaces.nsIRDFLiteral).Value; if (index < tabCount) tabPanels[index].loadURI(uri, null, nsIWebNavigation.LOAD_FLAGS_NONE); else gBrowser.addTab(uri); index++; } } if (index == 0) return; // If the bookmark group was completely invalid, just bail. // Select the first tab in the group. var tabs = gBrowser.mTabContainer.childNodes; gBrowser.selectedTab = tabs[0]; // Close any remaining open tabs that are left over. for (var i = tabCount-1; i >= index; i--) gBrowser.removeTab(tabs[i]);} |
if (fp.show() == nsIFilePicker.returnOK) PREF.setCharPref("browser.bookmarks.file", fp.file.path); | if (fp.show() == nsIFilePicker.returnOK) { var path = Components.classes["@mozilla.org/supports-string;1"] .createInstance(Components.interfaces.nsISupportsString); path.data = fp.file.path; PREF.setComplexValue("browser.bookmarks.file", Components.interfaces.nsISupportsString, path); } | function OpenBookmarksFile(){ const nsIFilePicker = Components.interfaces.nsIFilePicker; var fp = Components.classes["@mozilla.org/filepicker;1"].createInstance(nsIFilePicker); fp.init(window, BookmarksUtils.getLocaleString("SelectOpen"), nsIFilePicker.modeOpen); fp.appendFilters(nsIFilePicker.filterHTML); if (fp.show() == nsIFilePicker.returnOK) PREF.setCharPref("browser.bookmarks.file", fp.file.path);} |
window.openDialog( "chrome: | window.openDialog( getBrowserURL(), "_blank", "chrome,all,dialog=no", url ); | function OpenBookmarkURL(node, datasources) { if (node.getAttribute('container') == "true") { return false; } var url = node.getAttribute('id'); try { // add support for IE favorites under Win32, and NetPositive URLs under BeOS var rdf = Components.classes["component://netscape/rdf/rdf-service"].getService(); if (rdf) rdf = rdf.QueryInterface(Components.interfaces.nsIRDFService); if (rdf && datasources) { var src = rdf.GetResource(url, true); var prop = rdf.GetResource("http://home.netscape.com/NC-rdf#URL", true); var target = datasources.GetTarget(src, prop, true); if (target) target = target.QueryInterface(Components.interfaces.nsIRDFLiteral); if (target) target = target.Value; if (target) url = target; } } catch(ex) { } // Ignore "NC:" urls. if (url.substring(0, 3) == "NC:") { return false; } // Check if we have a browser window if ( window.content == null ) { window.openDialog( "chrome://navigator/content/navigator.xul", "_blank", "chrome,all,dialog=no", url ); } else { window.content.location.href = url; RefreshUrlbar(); } } |
appCore.loadUrl(url); else { dump("BrowserAppCore is not initialised\n"); | { appCore.loadUrl(url); | function OpenBookmarkURL(node, datasources){ if (node.getAttribute("container") == "true") { return(false); } var url = node.getAttribute("id"); try { // add support for IE favorites under Win32, and NetPositive URLs under BeOS var rdf = Components.classes["component://netscape/rdf/rdf-service"].getService(); if (rdf) rdf = rdf.QueryInterface(Components.interfaces.nsIRDFService); if (rdf && datasources) { var src = rdf.GetResource(url, true); var prop = rdf.GetResource("http://home.netscape.com/NC-rdf#URL", true); var target = datasources.GetTarget(src, prop, true); if (target) target = target.QueryInterface(Components.interfaces.nsIRDFLiteral); if (target) target = target.Value; if (target) url = target; } } catch(ex) { } // Ignore "NC:" urls. if (url.substring(0, 3) == "NC:") { return(false); } // Check if we have a browser window if (window._content == null) { window.openDialog( getBrowserURL(), "_blank", "chrome,all,dialog=no", url ); } else { if(appCore) appCore.loadUrl(url); else { // May be it s'd look for a Browser window or create one // and redirect this to the browser. dump("BrowserAppCore is not initialised\n"); } }} |
else { window._content.location = url; } | function OpenBookmarkURL(node, datasources){ if (node.getAttribute("container") == "true") { return(false); } var url = node.getAttribute("id"); try { // add support for IE favorites under Win32, and NetPositive URLs under BeOS var rdf = Components.classes["component://netscape/rdf/rdf-service"].getService(); if (rdf) rdf = rdf.QueryInterface(Components.interfaces.nsIRDFService); if (rdf && datasources) { var src = rdf.GetResource(url, true); var prop = rdf.GetResource("http://home.netscape.com/NC-rdf#URL", true); var target = datasources.GetTarget(src, prop, true); if (target) target = target.QueryInterface(Components.interfaces.nsIRDFLiteral); if (target) target = target.Value; if (target) url = target; } } catch(ex) { } // Ignore "NC:" urls. if (url.substring(0, 3) == "NC:") { return(false); } // Check if we have a browser window if (window._content == null) { window.openDialog( getBrowserURL(), "_blank", "chrome,all,dialog=no", url ); } else { if(appCore) appCore.loadUrl(url); else { // May be it s'd look for a Browser window or create one // and redirect this to the browser. dump("BrowserAppCore is not initialised\n"); } }} |
|
if ( window.content == null ) | if ( window._content == null ) | function OpenBookmarkURL(node, datasources) { if (node.getAttribute('container') == "true") { return false; } var url = node.getAttribute('id'); try { // add support for IE favorites under Win32, and NetPositive URLs under BeOS var rdf = Components.classes["component://netscape/rdf/rdf-service"].getService(); if (rdf) rdf = rdf.QueryInterface(Components.interfaces.nsIRDFService); if (rdf && datasources) { var src = rdf.GetResource(url, true); var prop = rdf.GetResource("http://home.netscape.com/NC-rdf#URL", true); var target = datasources.GetTarget(src, prop, true); if (target) target = target.QueryInterface(Components.interfaces.nsIRDFLiteral); if (target) target = target.Value; if (target) url = target; } } catch(ex) { } // Ignore "NC:" urls. if (url.substring(0, 3) == "NC:") { return false; } // Check if we have a browser window if ( window.content == null ) { window.openDialog( getBrowserURL(), "_blank", "chrome,all,dialog=no", url ); } else { //window.content.location.href = url; if (appCore) appCore.loadUrl(url); else dump("BrowserAppCore is not initialised\n"); RefreshUrlbar(); } } |
var rdf = Components.classes["component: | var rdf = Components.classes["@mozilla.org/rdf/rdf-service;1"].getService(); | function OpenBookmarkURL(event, node, datasources){ if (node.getAttribute("container") == "true") { return(false); } var url = node.getAttribute("id"); try { // add support for IE favorites under Win32, and NetPositive URLs under BeOS var rdf = Components.classes["component://netscape/rdf/rdf-service"].getService(); if (rdf) rdf = rdf.QueryInterface(Components.interfaces.nsIRDFService); if (rdf && datasources) { var src = rdf.GetResource(url, true); var prop = rdf.GetResource("http://home.netscape.com/NC-rdf#URL", true); var target = datasources.GetTarget(src, prop, true); if (target) target = target.QueryInterface(Components.interfaces.nsIRDFLiteral); if (target) target = target.Value; if (target) url = target; } } catch(ex) { } // Ignore "NC:" urls. if (url.substring(0, 3) == "NC:") { return(false); } if (!window._content) { const WM_PROGID = "component://netscape/rdf/datasource?name=window-mediator"; var wm = nsJSComponentManager.getService(WM_PROGID, "nsIWindowMediator"); if (wm) { navWindow = wm.getMostRecentWindow("navigator:browser"); if (navWindow) { navWindow.appCore.loadUrl(url); } } else { window.openDialog( getBrowserURL(), "_blank", "chrome,all,dialog=no", url ); } } else if (event.metaKey) { // if metaKey is down, open in a new browser window window.openDialog( getBrowserURL(), "_blank", "chrome,all,dialog=no", url ); } else { if(appCore) { // support session history (if appCore is available) appCore.loadUrl(url); } else { // fallback case (if appCore isn't available) window._content.location = url; } }} |
const WM_PROGID = "component: var wm = nsJSComponentManager.getService(WM_PROGID, "nsIWindowMediator"); | const WM_CONTRACTID = "@mozilla.org/rdf/datasource;1?name=window-mediator"; var wm = nsJSComponentManager.getService(WM_CONTRACTID, "nsIWindowMediator"); | function OpenBookmarkURL(event, node, datasources){ if (node.getAttribute("container") == "true") { return(false); } var url = node.getAttribute("id"); try { // add support for IE favorites under Win32, and NetPositive URLs under BeOS var rdf = Components.classes["component://netscape/rdf/rdf-service"].getService(); if (rdf) rdf = rdf.QueryInterface(Components.interfaces.nsIRDFService); if (rdf && datasources) { var src = rdf.GetResource(url, true); var prop = rdf.GetResource("http://home.netscape.com/NC-rdf#URL", true); var target = datasources.GetTarget(src, prop, true); if (target) target = target.QueryInterface(Components.interfaces.nsIRDFLiteral); if (target) target = target.Value; if (target) url = target; } } catch(ex) { } // Ignore "NC:" urls. if (url.substring(0, 3) == "NC:") { return(false); } if (!window._content) { const WM_PROGID = "component://netscape/rdf/datasource?name=window-mediator"; var wm = nsJSComponentManager.getService(WM_PROGID, "nsIWindowMediator"); if (wm) { navWindow = wm.getMostRecentWindow("navigator:browser"); if (navWindow) { navWindow.appCore.loadUrl(url); } } else { window.openDialog( getBrowserURL(), "_blank", "chrome,all,dialog=no", url ); } } else if (event.metaKey) { // if metaKey is down, open in a new browser window window.openDialog( getBrowserURL(), "_blank", "chrome,all,dialog=no", url ); } else { if(appCore) { // support session history (if appCore is available) appCore.loadUrl(url); } else { // fallback case (if appCore isn't available) window._content.location = url; } }} |
window.openDialog( "chrome: | window.openDialog( getBrowserURL(), "_blank", "chrome,all,dialog=no", url ); | function OpenBookmarkURL(node, datasources){ if (node.getAttribute("container") == "true") { return(false); } var url = node.getAttribute("id"); try { // add support for IE favorites under Win32, and NetPositive URLs under BeOS var rdf = Components.classes["component://netscape/rdf/rdf-service"].getService(); if (rdf) rdf = rdf.QueryInterface(Components.interfaces.nsIRDFService); if (rdf && datasources) { var src = rdf.GetResource(url, true); var prop = rdf.GetResource("http://home.netscape.com/NC-rdf#URL", true); var target = datasources.GetTarget(src, prop, true); if (target) target = target.QueryInterface(Components.interfaces.nsIRDFLiteral); if (target) target = target.Value; if (target) url = target; } } catch(ex) { } // Ignore "NC:" urls. if (url.substring(0, 3) == "NC:") { return(false); } // Check if we have a browser window if (window.content == null) { window.openDialog( "chrome://navigator/content/navigator.xul", "_blank", "chrome,all,dialog=no", url ); } else { window.content.location = url; }} |
if (node.getAttribute('container') == "true") | if (node.getAttribute("container") == "true") | function OpenBookmarkURL(event, datasources){ // what is the meaning of the return value from this function? var node = event.target; if (node.getAttribute('container') == "true") return null; var url = node.getAttribute('id'); try { // add support for IE favorites under Win32, and NetPositive URLs under BeOS var rdf = Components.classes["@mozilla.org/rdf/rdf-service;1"].getService(); if (rdf) rdf = rdf.QueryInterface(Components.interfaces.nsIRDFService); if (rdf && datasources) { var src = rdf.GetResource(url, true); var prop = rdf.GetResource("http://home.netscape.com/NC-rdf#URL", true); var target = datasources.GetTarget(src, prop, true); if (target) target = target.QueryInterface(Components.interfaces.nsIRDFLiteral); if (target) target = target.Value; if (target) url = target; } } catch(ex) { return null; } // Ignore "NC:" urls. if (url.substring(0, 3) == "NC:") return null; // Check if we have a browser window if (!window._content) { window.openDialog( getBrowserURL(), "_blank", "chrome,all,dialog=no", url ); return true; } else { loadURI(url); } return false;} |
var url = node.getAttribute('id'); | var url = node.getAttribute("id"); | function OpenBookmarkURL(event, datasources){ // what is the meaning of the return value from this function? var node = event.target; if (node.getAttribute('container') == "true") return null; var url = node.getAttribute('id'); try { // add support for IE favorites under Win32, and NetPositive URLs under BeOS var rdf = Components.classes["@mozilla.org/rdf/rdf-service;1"].getService(); if (rdf) rdf = rdf.QueryInterface(Components.interfaces.nsIRDFService); if (rdf && datasources) { var src = rdf.GetResource(url, true); var prop = rdf.GetResource("http://home.netscape.com/NC-rdf#URL", true); var target = datasources.GetTarget(src, prop, true); if (target) target = target.QueryInterface(Components.interfaces.nsIRDFLiteral); if (target) target = target.Value; if (target) url = target; } } catch(ex) { return null; } // Ignore "NC:" urls. if (url.substring(0, 3) == "NC:") return null; // Check if we have a browser window if (!window._content) { window.openDialog( getBrowserURL(), "_blank", "chrome,all,dialog=no", url ); return true; } else { loadURI(url); } return false;} |
if (window.content == null) | if (window._content == null) | function OpenBookmarkURL(node, datasources){ if (node.getAttribute("container") == "true") { return(false); } var url = node.getAttribute("id"); try { // add support for IE favorites under Win32, and NetPositive URLs under BeOS var rdf = Components.classes["component://netscape/rdf/rdf-service"].getService(); if (rdf) rdf = rdf.QueryInterface(Components.interfaces.nsIRDFService); if (rdf && datasources) { var src = rdf.GetResource(url, true); var prop = rdf.GetResource("http://home.netscape.com/NC-rdf#URL", true); var target = datasources.GetTarget(src, prop, true); if (target) target = target.QueryInterface(Components.interfaces.nsIRDFLiteral); if (target) target = target.Value; if (target) url = target; } } catch(ex) { } // Ignore "NC:" urls. if (url.substring(0, 3) == "NC:") { return(false); } // Check if we have a browser window if (window.content == null) { window.openDialog( getBrowserURL(), "_blank", "chrome,all,dialog=no", url ); } else { if(appCore) appCore.loadUrl(url); else { // May be it s'd look for a Browser window or create one // and redirect this to the browser. dump("BrowserAppCore is not initialised\n"); } }} |
var rdf = Components.classes["component: | var rdf = Components.classes["@mozilla.org/rdf/rdf-service;1"].getService(); | function OpenBookmarkURL(node, datasources) { // what is the meaning of the return value from this function? if (node.getAttribute('container') == "true") { return false; } var url = node.getAttribute('id'); try { // add support for IE favorites under Win32, and NetPositive URLs under BeOS var rdf = Components.classes["component://netscape/rdf/rdf-service"].getService(); if (rdf) rdf = rdf.QueryInterface(Components.interfaces.nsIRDFService); if (rdf && datasources) { var src = rdf.GetResource(url, true); var prop = rdf.GetResource("http://home.netscape.com/NC-rdf#URL", true); var target = datasources.GetTarget(src, prop, true); if (target) target = target.QueryInterface(Components.interfaces.nsIRDFLiteral); if (target) target = target.Value; if (target) url = target; } } catch(ex) { } // Ignore "NC:" urls. if (url.substring(0, 3) == "NC:") { return false; } // Check if we have a browser window if ( window._content == null ) { window.openDialog( getBrowserURL(), "_blank", "chrome,all,dialog=no", url ); return true; } else { //window._content.location.href = url; if (appCore) { appCore.loadUrl(url); return true; } else { dump("BrowserAppCore is not initialised\n"); return false; } RefreshUrlbar(); } return false; } |
var handler = Components.classes['component: | var handler = Components.classes['@mozilla.org/commandlinehandler/general-startup;1?type=browser']; | function OpenBrowserWindow(){ dump("In OpenBrowserWindw()...\n"); var charsetArg = new String(); var handler = Components.classes['component://netscape/commandlinehandler/general-startup-browser']; handler = handler.getService(); handler = handler.QueryInterface(Components.interfaces.nsICmdLineHandler); var startpage = handler.defaultArgs; var url = handler.chromeUrlForTask; var wintype = document.firstChild.getAttribute('windowtype'); // if and only if the current window is a browser window and it has a document with a character // set, then extract the current charset menu setting from the current document and use it to // initialize the new browser window... if (window && (wintype == "navigator:browser") && window._content && window._content.document) { var DocCharset = window._content.document.characterSet; charsetArg = "charset="+DocCharset; dump("*** Current document charset: " + DocCharset + "\n"); //we should "inherit" the charset menu setting in a new window window.openDialog(url, "_blank", "chrome,all,dialog=no", startpage, charsetArg); } else // forget about the charset information. { window.openDialog(url, "_blank", "chrome,all,dialog=no", startpage); }} |
var handler = Components.classes['@mozilla.org/commandlinehandler/general-startup;1?type=browser']; handler = handler.getService(); handler = handler.QueryInterface(Components.interfaces.nsICmdLineHandler); var startpage = handler.defaultArgs; var url = handler.chromeUrlForTask; | var handler = Components.classes["@mozilla.org/browser/clh;1"] .getService(Components.interfaces.nsIBrowserHandler); var startpage = handler.startPage; | function OpenBrowserWindow(){ var charsetArg = new String(); var handler = Components.classes['@mozilla.org/commandlinehandler/general-startup;1?type=browser']; handler = handler.getService(); handler = handler.QueryInterface(Components.interfaces.nsICmdLineHandler); var startpage = handler.defaultArgs; var url = handler.chromeUrlForTask; var wintype = document.firstChild.getAttribute('windowtype'); // if and only if the current window is a browser window and it has a document with a character // set, then extract the current charset menu setting from the current document and use it to // initialize the new browser window... if (window && (wintype == "navigator:browser") && window._content && window._content.document) { var DocCharset = window._content.document.characterSet; charsetArg = "charset="+DocCharset; //we should "inherit" the charset menu setting in a new window window.openDialog(url, "_blank", "chrome,all,dialog=no", startpage, charsetArg); } else // forget about the charset information. { window.openDialog(url, "_blank", "chrome,all,dialog=no", startpage); }} |
window.openDialog(url, "_blank", "chrome,all,dialog=no", startpage, charsetArg); | window.openDialog("chrome: | function OpenBrowserWindow(){ var charsetArg = new String(); var handler = Components.classes['@mozilla.org/commandlinehandler/general-startup;1?type=browser']; handler = handler.getService(); handler = handler.QueryInterface(Components.interfaces.nsICmdLineHandler); var startpage = handler.defaultArgs; var url = handler.chromeUrlForTask; var wintype = document.firstChild.getAttribute('windowtype'); // if and only if the current window is a browser window and it has a document with a character // set, then extract the current charset menu setting from the current document and use it to // initialize the new browser window... if (window && (wintype == "navigator:browser") && window._content && window._content.document) { var DocCharset = window._content.document.characterSet; charsetArg = "charset="+DocCharset; //we should "inherit" the charset menu setting in a new window window.openDialog(url, "_blank", "chrome,all,dialog=no", startpage, charsetArg); } else // forget about the charset information. { window.openDialog(url, "_blank", "chrome,all,dialog=no", startpage); }} |
window.openDialog(url, "_blank", "chrome,all,dialog=no", startpage); | window.openDialog("chrome: | function OpenBrowserWindow(){ var charsetArg = new String(); var handler = Components.classes['@mozilla.org/commandlinehandler/general-startup;1?type=browser']; handler = handler.getService(); handler = handler.QueryInterface(Components.interfaces.nsICmdLineHandler); var startpage = handler.defaultArgs; var url = handler.chromeUrlForTask; var wintype = document.firstChild.getAttribute('windowtype'); // if and only if the current window is a browser window and it has a document with a character // set, then extract the current charset menu setting from the current document and use it to // initialize the new browser window... if (window && (wintype == "navigator:browser") && window._content && window._content.document) { var DocCharset = window._content.document.characterSet; charsetArg = "charset="+DocCharset; //we should "inherit" the charset menu setting in a new window window.openDialog(url, "_blank", "chrome,all,dialog=no", startpage, charsetArg); } else // forget about the charset information. { window.openDialog(url, "_blank", "chrome,all,dialog=no", startpage); }} |
if (window && (window.windowtype == "navigator:browser") && window.content && window.content.document) | if (window && (window.windowtype == "navigator:browser") && window._content && window._content.document) | function OpenBrowserWindow(){ dump("In OpenBrowserWindw()...\n"); var charsetArg = new String(); var handler = Components.classes['component://netscape/commandlinehandler/general-startup-browser']; handler = handler.getService(); handler = handler.QueryInterface(Components.interfaces.nsICmdLineHandler); var startpage = handler.defaultArgs; var url = handler.chromeUrlForTask; // if and only if the current window is a browser window and it has a document with a character // set, then extract the current charset menu setting from the current document and use it to // initialize the new browser window... if (window && (window.windowtype == "navigator:browser") && window.content && window.content.document) { var DocCharset = window.content.document.characterSet; charsetArg = "charset="+DocCharset; dump("*** Current document charset: " + DocCharset + "\n"); //we should "inherit" the charset menu setting in a new window window.openDialog(url, "_blank", "chrome,all,dialog=no", startpage, charsetArg); } else // forget about the charset information. { window.openDialog(url, "_blank", "chrome,all,dialog=no", startpage); }} |
var DocCharset = window.content.document.characterSet; | var DocCharset = window._content.document.characterSet; | function OpenBrowserWindow(){ dump("In OpenBrowserWindw()...\n"); var charsetArg = new String(); var handler = Components.classes['component://netscape/commandlinehandler/general-startup-browser']; handler = handler.getService(); handler = handler.QueryInterface(Components.interfaces.nsICmdLineHandler); var startpage = handler.defaultArgs; var url = handler.chromeUrlForTask; // if and only if the current window is a browser window and it has a document with a character // set, then extract the current charset menu setting from the current document and use it to // initialize the new browser window... if (window && (window.windowtype == "navigator:browser") && window.content && window.content.document) { var DocCharset = window.content.document.characterSet; charsetArg = "charset="+DocCharset; dump("*** Current document charset: " + DocCharset + "\n"); //we should "inherit" the charset menu setting in a new window window.openDialog(url, "_blank", "chrome,all,dialog=no", startpage, charsetArg); } else // forget about the charset information. { window.openDialog(url, "_blank", "chrome,all,dialog=no", startpage); }} |
openDialog("chrome: | openDialog("chrome: "chrome,titlebar,modal,resizable", args); | function openEventDialog(calendarItem, calendar, mode, callback){ var args = new Object(); args.calendarEvent = calendarItem; args.calendar = calendar; args.mode = mode; args.onOk = callback; // the dialog will reset this to auto when it is done loading. window.setCursor("wait"); // open the dialog modally openDialog("chrome://calendar/content/calendar-event-dialog.xul", "_blank", "chrome,titlebar,modal", args); //openDialog("chrome://calendar/content/eventDialog.xul", "_blank", "chrome,titlebar,modal", args);} |
dump( "OpenFile called?\n" ); | debug("OpenFile called?\n"); | function OpenFile(url) { // Obsolete (called from C++ code that is no longer called). dump( "OpenFile called?\n" ); openNewWindowWith( url ); } |
openFindBar: function () | openFindBar: function (showMinimalUI) | openFindBar: function () { // Notify anyone else that might want to handle this event var findActivatedEvent = document.createEvent("Events"); findActivatedEvent.initEvent("find-activated", false, true); window.dispatchEvent(findActivatedEvent); if (!this.mFindEnabled) throw Components.results.NS_OK; if (!this.mNotFoundStr || !this.mWrappedToTopStr || !this.mWrappedToBottomStr) { var bundle = document.getElementById("bundle_findBar"); this.mNotFoundStr = bundle.getString("NotFound"); this.mWrappedToTopStr = bundle.getString("WrappedToTop"); this.mWrappedToBottomStr = bundle.getString("WrappedToBottom"); } var findToolbar = document.getElementById("FindToolbar"); if (findToolbar.hidden) { findToolbar.hidden = false; var statusIcon = document.getElementById("find-status-icon"); var statusText = document.getElementById("find-status"); var findField = document.getElementById("find-field"); findField.removeAttribute("status"); statusIcon.removeAttribute("status"); statusText.value = ""; return true; } return false; }, |
!this.mWrappedToBottomStr) { | !this.mWrappedToBottomStr || !this.mNormalFindStr || !this.mFastFindStr) { | openFindBar: function () { // Notify anyone else that might want to handle this event var findActivatedEvent = document.createEvent("Events"); findActivatedEvent.initEvent("find-activated", false, true); window.dispatchEvent(findActivatedEvent); if (!this.mFindEnabled) throw Components.results.NS_OK; if (!this.mNotFoundStr || !this.mWrappedToTopStr || !this.mWrappedToBottomStr) { var bundle = document.getElementById("bundle_findBar"); this.mNotFoundStr = bundle.getString("NotFound"); this.mWrappedToTopStr = bundle.getString("WrappedToTop"); this.mWrappedToBottomStr = bundle.getString("WrappedToBottom"); } var findToolbar = document.getElementById("FindToolbar"); if (findToolbar.hidden) { findToolbar.hidden = false; var statusIcon = document.getElementById("find-status-icon"); var statusText = document.getElementById("find-status"); var findField = document.getElementById("find-field"); findField.removeAttribute("status"); statusIcon.removeAttribute("status"); statusText.value = ""; return true; } return false; }, |
this.updateFindUI(showMinimalUI); | openFindBar: function () { // Notify anyone else that might want to handle this event var findActivatedEvent = document.createEvent("Events"); findActivatedEvent.initEvent("find-activated", false, true); window.dispatchEvent(findActivatedEvent); if (!this.mFindEnabled) throw Components.results.NS_OK; if (!this.mNotFoundStr || !this.mWrappedToTopStr || !this.mWrappedToBottomStr) { var bundle = document.getElementById("bundle_findBar"); this.mNotFoundStr = bundle.getString("NotFound"); this.mWrappedToTopStr = bundle.getString("WrappedToTop"); this.mWrappedToBottomStr = bundle.getString("WrappedToBottom"); } var findToolbar = document.getElementById("FindToolbar"); if (findToolbar.hidden) { findToolbar.hidden = false; var statusIcon = document.getElementById("find-status-icon"); var statusText = document.getElementById("find-status"); var findField = document.getElementById("find-field"); findField.removeAttribute("status"); statusIcon.removeAttribute("status"); statusText.value = ""; return true; } return false; }, |
|
if (!this._confirmOpenTabs(RDFC.GetCount())) | while (containerChildren.hasMoreElements()) { var res = containerChildren.getNext().QueryInterface(kRDFRSCIID); var type = BookmarksUtils.resolveType(res); if (type == "Bookmark" || type == "LivemarkBookmark" || type == "ImmutableBookmark" || type == "IEFavorite" || type == "FileSystemObject") numTabsToOpen++; } if (!this._confirmOpenTabs(numTabsToOpen)) | openGroupBookmark: function (aURI, aTargetBrowser) { var w = getTopWin(); if (!w) // no browser window is open, we have to open the group into a new window aTargetBrowser = "window"; var resource = RDF.GetResource(aURI); var urlArc = RDF.GetResource(gNC_NS+"URL"); RDFC.Init(BMDS, resource); var containerChildren = RDFC.GetElements(); if (!this._confirmOpenTabs(RDFC.GetCount())) return; if (aTargetBrowser == "current" || aTargetBrowser == "tab") { var browser = w.document.getElementById("content"); var tabPanels = browser.browsers; var tabs = browser.mTabContainer.childNodes; var tabCount = tabPanels.length; var doReplace = PREF.getBoolPref("browser.tabs.loadFolderAndReplace"); var loadInBackground = PREF.getBoolPref("browser.tabs.loadBookmarksInBackground"); var index0; if (doReplace) index0 = 0; else { for (index0=tabCount-1; index0>=0; --index0) if (tabPanels[index0].webNavigation.currentURI.spec != "about:blank") break; ++index0; } var index = index0; while (containerChildren.hasMoreElements()) { var res = containerChildren.getNext().QueryInterface(kRDFRSCIID); var target = BMDS.GetTarget(res, urlArc, true); if (target) { var uri = target.QueryInterface(kRDFLITIID).Value; if (index < tabCount) tabPanels[index].loadURI(uri); else { // This is not a modal sub-action of a given tab/document within a window // since opening a bookmarks group replaces all existing tabs in the window, // closing extras. If this ever changes to be augmentative, this code will // have to change to probably just use <tabbrowser>.loadTabs() which figures // out whether or not owner should be set. browser.addTab(uri); } ++index; } } // If the bookmark group was completely invalid, just bail. if (index == index0) return; // focus the first tab if prefs say to if (!loadInBackground || doReplace) { // Select the first tab in the group. // Set newly selected tab after quick timeout, otherwise hideous focus problems // can occur because new presshell is not ready to handle events function selectNewForegroundTab(browser, tab) { browser.selectedTab = tab; } setTimeout(selectNewForegroundTab, 0, browser, tabs[index0]); } // Close any remaining open tabs that are left over. // (Always skipped when we append tabs) for (var i = tabCount-1; i >= index; --i) browser.removeTab(tabs[i]); // and focus the content w.content.focus(); } else if (aTargetBrowser == "window") { var URIs = []; while (containerChildren.hasMoreElements()) { var res = containerChildren.getNext().QueryInterface(kRDFRSCIID); var target = BMDS.GetTarget(res, urlArc, true); if (target) URIs.push(target.QueryInterface(kRDFLITIID).Value); } openDialog(getBrowserURL(), "_blank", "chrome,all,dialog=no", URIs.join("|")); } }, |
openGroupBookmark: function (aURI, aTargetBrowser) | openGroupBookmark: function (aURI, aTargetBrowser, aEvent) | openGroupBookmark: function (aURI, aTargetBrowser) { var w = getTopWin(); if (!w) // no browser window open, so we have to open in new window aTargetBrowser="window"; var resource = RDF.GetResource(aURI); var urlArc = RDF.GetResource(NC_NS+"URL"); RDFC.Init(BMDS, resource); var containerChildren = RDFC.GetElements(); var URIs = []; while (containerChildren.hasMoreElements()) { var res = containerChildren.getNext().QueryInterface(kRDFRSCIID); var target = BMDS.GetTarget(res, urlArc, true); if (target) { if (aTargetBrowser == "window") URIs.push(target.QueryInterface(kRDFLITIID).Value); else URIs.push({ URI: target.QueryInterface(kRDFLITIID).Value }); } } if (aTargetBrowser == "window") { // This opens the URIs in separate tabs of a new window openDialog(getBrowserURL(), "_blank", "chrome,all,dialog=no", URIs.join("\n")); } else { var browser = w.getBrowser(); var tab = browser.loadGroup(URIs); if (!gLoadInBackground) browser.selectedTab = tab; } }, |
var urlArc = RDF.GetResource(NC_NS+"URL"); | openGroupBookmark: function (aURI, aTargetBrowser) { var w = getTopWin(); if (!w) // no browser window open, so we have to open in new window aTargetBrowser="window"; var resource = RDF.GetResource(aURI); var urlArc = RDF.GetResource(NC_NS+"URL"); RDFC.Init(BMDS, resource); var containerChildren = RDFC.GetElements(); var URIs = []; while (containerChildren.hasMoreElements()) { var res = containerChildren.getNext().QueryInterface(kRDFRSCIID); var target = BMDS.GetTarget(res, urlArc, true); if (target) { if (aTargetBrowser == "window") URIs.push(target.QueryInterface(kRDFLITIID).Value); else URIs.push({ URI: target.QueryInterface(kRDFLITIID).Value }); } } if (aTargetBrowser == "window") { // This opens the URIs in separate tabs of a new window openDialog(getBrowserURL(), "_blank", "chrome,all,dialog=no", URIs.join("\n")); } else { var browser = w.getBrowser(); var tab = browser.loadGroup(URIs); if (!gLoadInBackground) browser.selectedTab = tab; } }, |
|
} else { var browser = w.getBrowser(); var tab = browser.loadGroup(URIs); if (!gLoadInBackground) browser.selectedTab = tab; | return; | openGroupBookmark: function (aURI, aTargetBrowser) { var w = getTopWin(); if (!w) // no browser window open, so we have to open in new window aTargetBrowser="window"; var resource = RDF.GetResource(aURI); var urlArc = RDF.GetResource(NC_NS+"URL"); RDFC.Init(BMDS, resource); var containerChildren = RDFC.GetElements(); var URIs = []; while (containerChildren.hasMoreElements()) { var res = containerChildren.getNext().QueryInterface(kRDFRSCIID); var target = BMDS.GetTarget(res, urlArc, true); if (target) { if (aTargetBrowser == "window") URIs.push(target.QueryInterface(kRDFLITIID).Value); else URIs.push({ URI: target.QueryInterface(kRDFLITIID).Value }); } } if (aTargetBrowser == "window") { // This opens the URIs in separate tabs of a new window openDialog(getBrowserURL(), "_blank", "chrome,all,dialog=no", URIs.join("\n")); } else { var browser = w.getBrowser(); var tab = browser.loadGroup(URIs); if (!gLoadInBackground) browser.selectedTab = tab; } }, |
var browser = w.getBrowser(); var tab = browser.loadGroup(URIs); if (!BookmarksUtils.shouldLoadTabInBackground(aEvent)) browser.selectedTab = tab; | openGroupBookmark: function (aURI, aTargetBrowser) { var w = getTopWin(); if (!w) // no browser window open, so we have to open in new window aTargetBrowser="window"; var resource = RDF.GetResource(aURI); var urlArc = RDF.GetResource(NC_NS+"URL"); RDFC.Init(BMDS, resource); var containerChildren = RDFC.GetElements(); var URIs = []; while (containerChildren.hasMoreElements()) { var res = containerChildren.getNext().QueryInterface(kRDFRSCIID); var target = BMDS.GetTarget(res, urlArc, true); if (target) { if (aTargetBrowser == "window") URIs.push(target.QueryInterface(kRDFLITIID).Value); else URIs.push({ URI: target.QueryInterface(kRDFLITIID).Value }); } } if (aTargetBrowser == "window") { // This opens the URIs in separate tabs of a new window openDialog(getBrowserURL(), "_blank", "chrome,all,dialog=no", URIs.join("\n")); } else { var browser = w.getBrowser(); var tab = browser.loadGroup(URIs); if (!gLoadInBackground) browser.selectedTab = tab; } }, |
|
var tabs = browser.tabContainer.childNodes; browser.selectedTab = tabs[index0]; | if (!loadInBackground || doReplace) { var tabs = browser.mTabContainer.childNodes; browser.selectedTab = tabs[index0]; } | openGroupBookmark: function (aURI, aTargetBrowser) { if (aTargetBrowser == "current" || aTargetBrowser == "tab") { var w = getTopWin(); var browser = w.document.getElementById("content"); var resource = RDF.GetResource(aURI); var urlArc = RDF.GetResource(NC_NS+"URL"); RDFC.Init(BMDS, resource); var containerChildren = RDFC.GetElements(); var tabPanels = browser.mPanelContainer.childNodes; var tabCount = tabPanels.length; var doReplace = PREF.getBoolPref("browser.tabs.loadFolderAndReplace"); var index0; if (doReplace) index0 = 0; else { for (index0=tabCount-1; index0>=0; --index0) if (browser.browsers[index0].webNavigation.currentURI.spec != "about:blank") break; ++index0; } var index = index0; while (containerChildren.hasMoreElements()) { var res = containerChildren.getNext().QueryInterface(kRDFRSCIID); var target = BMDS.GetTarget(res, urlArc, true); if (target) { var uri = target.QueryInterface(kRDFLITIID).Value; if (index < tabCount) tabPanels[index].loadURI(uri); else browser.addTab(uri); ++index; } } // If the bookmark group was completely invalid, just bail. if (index == index0) return; // Select the first tab in the group. var tabs = browser.tabContainer.childNodes; browser.selectedTab = tabs[index0]; // Close any remaining open tabs that are left over. // (Always skipped when we append tabs) for (var i = tabCount-1; i >= index; --i) browser.removeTab(tabs[i]); // and focus the content browser.focus(); } else { dump("Open Group in new window: not implemented...\n"); } }, |
var tabs = browser.mTabContainer.childNodes; | var tabs = browser.tabContainer.childNodes; | openGroupBookmark: function (aURI, aTargetBrowser) { if (aTargetBrowser == "current" || aTargetBrowser == "tab") { var w = getTopWin(); var browser = w.document.getElementById("content"); var resource = RDF.GetResource(aURI); var urlArc = RDF.GetResource(NC_NS+"URL"); RDFC.Init(BMDS, resource); var containerChildren = RDFC.GetElements(); var tabPanels = browser.mPanelContainer.childNodes; var tabCount = tabPanels.length; var doReplace = PREF.getBoolPref("browser.tabs.loadFolderAndReplace"); var index0; if (doReplace) index0 = 0; else { for (index0=tabCount-1; index0>=0; --index0) if (browser.browsers[index0].webNavigation.currentURI.spec != "about:blank") break; ++index0; } var index = index0; while (containerChildren.hasMoreElements()) { var res = containerChildren.getNext().QueryInterface(kRDFRSCIID); var target = BMDS.GetTarget(res, urlArc, true); if (target) { var uri = target.QueryInterface(kRDFLITIID).Value; if (index < tabCount) tabPanels[index].loadURI(uri); else browser.addTab(uri); ++index; } } // If the bookmark group was completely invalid, just bail. if (index == index0) return; // Select the first tab in the group. var tabs = browser.mTabContainer.childNodes; browser.selectedTab = tabs[index0]; // Close any remaining open tabs that are left over. // (Always skipped when we append tabs) for (var i = tabCount-1; i >= index; --i) browser.removeTab(tabs[i]); // and focus the content browser.focus(); } else { dump("Open Group in new window: not implemented...\n"); } }, |
var w = getTopWin(); | openGroupBookmark: function (aURI, aTargetBrowser) { if (aTargetBrowser == "current" || aTargetBrowser == "tab") { var w = getTopWin(); var browser = w.document.getElementById("content"); var resource = RDF.GetResource(aURI); var urlArc = RDF.GetResource(NC_NS+"URL"); RDFC.Init(BMDS, resource); var containerChildren = RDFC.GetElements(); var tabPanels = browser.browsers; var tabCount = tabPanels.length; var doReplace = PREF.getBoolPref("browser.tabs.loadFolderAndReplace"); var loadInBackground = PREF.getBoolPref("browser.tabs.loadBookmarksInBackground"); var index0; if (doReplace) index0 = 0; else { for (index0=tabCount-1; index0>=0; --index0) if (browser.browsers[index0].webNavigation.currentURI.spec != "about:blank") break; ++index0; } var index = index0; while (containerChildren.hasMoreElements()) { var res = containerChildren.getNext().QueryInterface(kRDFRSCIID); var target = BMDS.GetTarget(res, urlArc, true); if (target) { var uri = target.QueryInterface(kRDFLITIID).Value; if (index < tabCount) tabPanels[index].loadURI(uri); else browser.addTab(uri); ++index; } } // If the bookmark group was completely invalid, just bail. if (index == index0) return; // focus the first tab if prefs say to if (!loadInBackground || doReplace) { // Select the first tab in the group. var tabs = browser.mTabContainer.childNodes; browser.selectedTab = tabs[index0]; } // Close any remaining open tabs that are left over. // (Always skipped when we append tabs) for (var i = tabCount-1; i >= index; --i) browser.removeTab(tabs[i]); // and focus the content w.content.focus(); } else { dump("Open Group in new window: not implemented...\n"); } }, |
|
var resource = RDF.GetResource(aURI); var urlArc = RDF.GetResource(NC_NS+"URL"); RDFC.Init(BMDS, resource); var containerChildren = RDFC.GetElements(); | openGroupBookmark: function (aURI, aTargetBrowser) { if (aTargetBrowser == "current" || aTargetBrowser == "tab") { var w = getTopWin(); var browser = w.document.getElementById("content"); var resource = RDF.GetResource(aURI); var urlArc = RDF.GetResource(NC_NS+"URL"); RDFC.Init(BMDS, resource); var containerChildren = RDFC.GetElements(); var tabPanels = browser.browsers; var tabCount = tabPanels.length; var doReplace = PREF.getBoolPref("browser.tabs.loadFolderAndReplace"); var loadInBackground = PREF.getBoolPref("browser.tabs.loadBookmarksInBackground"); var index0; if (doReplace) index0 = 0; else { for (index0=tabCount-1; index0>=0; --index0) if (browser.browsers[index0].webNavigation.currentURI.spec != "about:blank") break; ++index0; } var index = index0; while (containerChildren.hasMoreElements()) { var res = containerChildren.getNext().QueryInterface(kRDFRSCIID); var target = BMDS.GetTarget(res, urlArc, true); if (target) { var uri = target.QueryInterface(kRDFLITIID).Value; if (index < tabCount) tabPanels[index].loadURI(uri); else browser.addTab(uri); ++index; } } // If the bookmark group was completely invalid, just bail. if (index == index0) return; // focus the first tab if prefs say to if (!loadInBackground || doReplace) { // Select the first tab in the group. var tabs = browser.mTabContainer.childNodes; browser.selectedTab = tabs[index0]; } // Close any remaining open tabs that are left over. // (Always skipped when we append tabs) for (var i = tabCount-1; i >= index; --i) browser.removeTab(tabs[i]); // and focus the content w.content.focus(); } else { dump("Open Group in new window: not implemented...\n"); } }, |
|
} else { dump("Open Group in new window: not implemented...\n"); | } else if (aTargetBrowser == "window") { var URIs = []; while (containerChildren.hasMoreElements()) { var res = containerChildren.getNext().QueryInterface(kRDFRSCIID); var target = BMDS.GetTarget(res, urlArc, true); if (target) URIs.push(target.QueryInterface(kRDFLITIID).Value); } openDialog(getBrowserURL(), "_blank", "chrome,all,dialog=no", URIs.join("|")); | openGroupBookmark: function (aURI, aTargetBrowser) { if (aTargetBrowser == "current" || aTargetBrowser == "tab") { var w = getTopWin(); var browser = w.document.getElementById("content"); var resource = RDF.GetResource(aURI); var urlArc = RDF.GetResource(NC_NS+"URL"); RDFC.Init(BMDS, resource); var containerChildren = RDFC.GetElements(); var tabPanels = browser.browsers; var tabCount = tabPanels.length; var doReplace = PREF.getBoolPref("browser.tabs.loadFolderAndReplace"); var loadInBackground = PREF.getBoolPref("browser.tabs.loadBookmarksInBackground"); var index0; if (doReplace) index0 = 0; else { for (index0=tabCount-1; index0>=0; --index0) if (browser.browsers[index0].webNavigation.currentURI.spec != "about:blank") break; ++index0; } var index = index0; while (containerChildren.hasMoreElements()) { var res = containerChildren.getNext().QueryInterface(kRDFRSCIID); var target = BMDS.GetTarget(res, urlArc, true); if (target) { var uri = target.QueryInterface(kRDFLITIID).Value; if (index < tabCount) tabPanels[index].loadURI(uri); else browser.addTab(uri); ++index; } } // If the bookmark group was completely invalid, just bail. if (index == index0) return; // focus the first tab if prefs say to if (!loadInBackground || doReplace) { // Select the first tab in the group. var tabs = browser.mTabContainer.childNodes; browser.selectedTab = tabs[index0]; } // Close any remaining open tabs that are left over. // (Always skipped when we append tabs) for (var i = tabCount-1; i >= index; --i) browser.removeTab(tabs[i]); // and focus the content w.content.focus(); } else { dump("Open Group in new window: not implemented...\n"); } }, |
tabPanels[index].loadURI(uri, null, nsIWebNavigation.LOAD_FLAGS_NONE); | tabPanels[index].loadURI(uri); | openGroupBookmark: function (aURI, aTargetBrowser) { if (aTargetBrowser == "current" || aTargetBrowser == "tab") { var w = getTopWin(); var browser = w.document.getElementById("content"); var resource = RDF.GetResource(aURI); var urlArc = RDF.GetResource(NC_NS+"URL"); RDFC.Init(BMDS, resource); var containerChildren = RDFC.GetElements(); var tabPanels = browser.mPanelContainer.childNodes; var tabCount = tabPanels.length; // Get the preferences service var prefService = Components.classes["@mozilla.org/preferences-service;1"] .getService(Components.interfaces.nsIPrefService); var doReplace = prefService.getBranch(null) .getBoolPref("browser.tabs.loadFolderAndReplace"); var index0; if (doReplace) index0 = 0; else { for (index0=tabCount-1; index0>0; --index0) if (browser.browsers[index0].webNavigation.currentURI.spec != "about:blank") { ++index0; break; } } var index = index0; while (containerChildren.hasMoreElements()) { var res = containerChildren.getNext().QueryInterface(kRDFRSCIID); var target = BMDS.GetTarget(res, urlArc, true); if (target) { var uri = target.QueryInterface(kRDFLITIID).Value; if (index < tabCount) tabPanels[index].loadURI(uri, null, nsIWebNavigation.LOAD_FLAGS_NONE); else browser.addTab(uri); ++index; } } // If the bookmark group was completely invalid, just bail. if (index == index0) return; // Select the first tab in the group. var tabs = browser.mTabContainer.childNodes; browser.selectedTab = tabs[index0]; // Close any remaining open tabs that are left over. // (Always skipped when we append tabs) for (var i = tabCount-1; i >= index; --i) browser.removeTab(tabs[i]); // and focus the content browser.focus(); } else { dump("Open Group in new window: not implemented...\n"); } }, |
if (browser.browsers[index0].webNavigation.currentURI.spec != "about:blank") | if (tabPanels[index0].webNavigation.currentURI.spec != "about:blank") | openGroupBookmark: function (aURI, aTargetBrowser) { var w = getTopWin(); if (!w) // no browser window is open, we have to open the group into a new window aTargetBrowser = "window"; var resource = RDF.GetResource(aURI); var urlArc = RDF.GetResource(gNC_NS+"URL"); RDFC.Init(BMDS, resource); var containerChildren = RDFC.GetElements(); if (aTargetBrowser == "current" || aTargetBrowser == "tab") { var browser = w.document.getElementById("content"); var tabPanels = browser.browsers; var tabCount = tabPanels.length; var doReplace = PREF.getBoolPref("browser.tabs.loadFolderAndReplace"); var loadInBackground = PREF.getBoolPref("browser.tabs.loadBookmarksInBackground"); var index0; if (doReplace) index0 = 0; else { for (index0=tabCount-1; index0>=0; --index0) if (browser.browsers[index0].webNavigation.currentURI.spec != "about:blank") break; ++index0; } var index = index0; while (containerChildren.hasMoreElements()) { var res = containerChildren.getNext().QueryInterface(kRDFRSCIID); var target = BMDS.GetTarget(res, urlArc, true); if (target) { var uri = target.QueryInterface(kRDFLITIID).Value; if (index < tabCount) tabPanels[index].loadURI(uri); else browser.addTab(uri); ++index; } } // If the bookmark group was completely invalid, just bail. if (index == index0) return; // focus the first tab if prefs say to if (!loadInBackground || doReplace) { // Select the first tab in the group. // Set newly selected tab after quick timeout, otherwise hideous focus problems // can occur because new presshell is not ready to handle events function selectNewForegroundTab(browser, tab) { browser.selectedTab = tab; } var tabs = browser.mTabContainer.childNodes; setTimeout(selectNewForegroundTab, 0, browser, tabs[index0]); } // Close any remaining open tabs that are left over. // (Always skipped when we append tabs) for (var i = tabCount-1; i >= index; --i) browser.removeTab(tabs[i]); // and focus the content w.content.focus(); } else if (aTargetBrowser == "window") { var URIs = []; while (containerChildren.hasMoreElements()) { var res = containerChildren.getNext().QueryInterface(kRDFRSCIID); var target = BMDS.GetTarget(res, urlArc, true); if (target) URIs.push(target.QueryInterface(kRDFLITIID).Value); } openDialog(getBrowserURL(), "_blank", "chrome,all,dialog=no", URIs.join("|")); } }, |
var tabs = browser.mTabContainer.childNodes; | openGroupBookmark: function (aURI, aTargetBrowser) { var w = getTopWin(); if (!w) // no browser window is open, we have to open the group into a new window aTargetBrowser = "window"; var resource = RDF.GetResource(aURI); var urlArc = RDF.GetResource(gNC_NS+"URL"); RDFC.Init(BMDS, resource); var containerChildren = RDFC.GetElements(); if (aTargetBrowser == "current" || aTargetBrowser == "tab") { var browser = w.document.getElementById("content"); var tabPanels = browser.browsers; var tabCount = tabPanels.length; var doReplace = PREF.getBoolPref("browser.tabs.loadFolderAndReplace"); var loadInBackground = PREF.getBoolPref("browser.tabs.loadBookmarksInBackground"); var index0; if (doReplace) index0 = 0; else { for (index0=tabCount-1; index0>=0; --index0) if (browser.browsers[index0].webNavigation.currentURI.spec != "about:blank") break; ++index0; } var index = index0; while (containerChildren.hasMoreElements()) { var res = containerChildren.getNext().QueryInterface(kRDFRSCIID); var target = BMDS.GetTarget(res, urlArc, true); if (target) { var uri = target.QueryInterface(kRDFLITIID).Value; if (index < tabCount) tabPanels[index].loadURI(uri); else browser.addTab(uri); ++index; } } // If the bookmark group was completely invalid, just bail. if (index == index0) return; // focus the first tab if prefs say to if (!loadInBackground || doReplace) { // Select the first tab in the group. // Set newly selected tab after quick timeout, otherwise hideous focus problems // can occur because new presshell is not ready to handle events function selectNewForegroundTab(browser, tab) { browser.selectedTab = tab; } var tabs = browser.mTabContainer.childNodes; setTimeout(selectNewForegroundTab, 0, browser, tabs[index0]); } // Close any remaining open tabs that are left over. // (Always skipped when we append tabs) for (var i = tabCount-1; i >= index; --i) browser.removeTab(tabs[i]); // and focus the content w.content.focus(); } else if (aTargetBrowser == "window") { var URIs = []; while (containerChildren.hasMoreElements()) { var res = containerChildren.getNext().QueryInterface(kRDFRSCIID); var target = BMDS.GetTarget(res, urlArc, true); if (target) URIs.push(target.QueryInterface(kRDFLITIID).Value); } openDialog(getBrowserURL(), "_blank", "chrome,all,dialog=no", URIs.join("|")); } }, |
|
for (index0=tabCount-1; index0>=0; --index0) if (tabPanels[index0].webNavigation.currentURI.spec != "about:blank") | for (index0=tabCount-1; index0>=0; --index0) { var tab = tabPanels[index0]; if (tab.webNavigation.currentURI.spec != "about:blank" || tab.webProgress.isLoadingDocument) | openGroupBookmark: function (aURI, aTargetBrowser) { var w = getTopWin(); if (!w) // no browser window is open, we have to open the group into a new window aTargetBrowser = "window"; var resource = RDF.GetResource(aURI); var urlArc = RDF.GetResource(gNC_NS+"URL"); RDFC.Init(BMDS, resource); var containerChildren = RDFC.GetElements(); var numTabsToOpen = 0; // we can't just use |RDFC.GetCount()| as that might include // folders, separators, deleted bookmarks, etc. while (containerChildren.hasMoreElements()) { var res = containerChildren.getNext().QueryInterface(kRDFRSCIID); var type = BookmarksUtils.resolveType(res); // these are the types in getCommands() that support the // "bm_openinnewwindow" and "bm_openinnewtab" commands if (type == "Bookmark" || type == "LivemarkBookmark" || type == "ImmutableBookmark" || type == "IEFavorite" || type == "FileSystemObject") numTabsToOpen++; } if (!this._confirmOpenTabs(numTabsToOpen)) return; // counting the number of tabs to open modified the // containerChildren enumerator, so we need to reset it. containerChildren = RDFC.GetElements(); if (aTargetBrowser == "current" || aTargetBrowser == "tab") { var browser = w.document.getElementById("content"); var tabPanels = browser.browsers; var tabs = browser.mTabContainer.childNodes; var tabCount = tabPanels.length; var doReplace = PREF.getBoolPref("browser.tabs.loadFolderAndReplace"); var loadInBackground = PREF.getBoolPref("browser.tabs.loadBookmarksInBackground"); var index0; if (doReplace) index0 = 0; else { for (index0=tabCount-1; index0>=0; --index0) if (tabPanels[index0].webNavigation.currentURI.spec != "about:blank") break; ++index0; } var index = index0; while (containerChildren.hasMoreElements()) { var res = containerChildren.getNext().QueryInterface(kRDFRSCIID); var target = BMDS.GetTarget(res, urlArc, true); if (target) { var uri = target.QueryInterface(kRDFLITIID).Value; if (index < tabCount) tabPanels[index].loadURI(uri); else { // This is not a modal sub-action of a given tab/document within a window // since opening a bookmarks group replaces all existing tabs in the window, // closing extras. If this ever changes to be augmentative, this code will // have to change to probably just use <tabbrowser>.loadTabs() which figures // out whether or not owner should be set. browser.addTab(uri); } ++index; } } // If the bookmark group was completely invalid, just bail. if (index == index0) return; // focus the first tab if prefs say to if (!loadInBackground || doReplace) { // Select the first tab in the group. // Set newly selected tab after quick timeout, otherwise hideous focus problems // can occur because new presshell is not ready to handle events function selectNewForegroundTab(browser, tab) { browser.selectedTab = tab; } setTimeout(selectNewForegroundTab, 0, browser, tabs[index0]); } // Close any remaining open tabs that are left over. // (Always skipped when we append tabs) for (var i = tabCount-1; i >= index; --i) browser.removeTab(tabs[i]); // and focus the content w.content.focus(); } else if (aTargetBrowser == "window") { var URIs = []; while (containerChildren.hasMoreElements()) { var res = containerChildren.getNext().QueryInterface(kRDFRSCIID); var target = BMDS.GetTarget(res, urlArc, true); if (target) URIs.push(target.QueryInterface(kRDFLITIID).Value); } openDialog(getBrowserURL(), "_blank", "chrome,all,dialog=no", URIs.join("|")); } }, |
} | openGroupBookmark: function (aURI, aTargetBrowser) { var w = getTopWin(); if (!w) // no browser window is open, we have to open the group into a new window aTargetBrowser = "window"; var resource = RDF.GetResource(aURI); var urlArc = RDF.GetResource(gNC_NS+"URL"); RDFC.Init(BMDS, resource); var containerChildren = RDFC.GetElements(); var numTabsToOpen = 0; // we can't just use |RDFC.GetCount()| as that might include // folders, separators, deleted bookmarks, etc. while (containerChildren.hasMoreElements()) { var res = containerChildren.getNext().QueryInterface(kRDFRSCIID); var type = BookmarksUtils.resolveType(res); // these are the types in getCommands() that support the // "bm_openinnewwindow" and "bm_openinnewtab" commands if (type == "Bookmark" || type == "LivemarkBookmark" || type == "ImmutableBookmark" || type == "IEFavorite" || type == "FileSystemObject") numTabsToOpen++; } if (!this._confirmOpenTabs(numTabsToOpen)) return; // counting the number of tabs to open modified the // containerChildren enumerator, so we need to reset it. containerChildren = RDFC.GetElements(); if (aTargetBrowser == "current" || aTargetBrowser == "tab") { var browser = w.document.getElementById("content"); var tabPanels = browser.browsers; var tabs = browser.mTabContainer.childNodes; var tabCount = tabPanels.length; var doReplace = PREF.getBoolPref("browser.tabs.loadFolderAndReplace"); var loadInBackground = PREF.getBoolPref("browser.tabs.loadBookmarksInBackground"); var index0; if (doReplace) index0 = 0; else { for (index0=tabCount-1; index0>=0; --index0) if (tabPanels[index0].webNavigation.currentURI.spec != "about:blank") break; ++index0; } var index = index0; while (containerChildren.hasMoreElements()) { var res = containerChildren.getNext().QueryInterface(kRDFRSCIID); var target = BMDS.GetTarget(res, urlArc, true); if (target) { var uri = target.QueryInterface(kRDFLITIID).Value; if (index < tabCount) tabPanels[index].loadURI(uri); else { // This is not a modal sub-action of a given tab/document within a window // since opening a bookmarks group replaces all existing tabs in the window, // closing extras. If this ever changes to be augmentative, this code will // have to change to probably just use <tabbrowser>.loadTabs() which figures // out whether or not owner should be set. browser.addTab(uri); } ++index; } } // If the bookmark group was completely invalid, just bail. if (index == index0) return; // focus the first tab if prefs say to if (!loadInBackground || doReplace) { // Select the first tab in the group. // Set newly selected tab after quick timeout, otherwise hideous focus problems // can occur because new presshell is not ready to handle events function selectNewForegroundTab(browser, tab) { browser.selectedTab = tab; } setTimeout(selectNewForegroundTab, 0, browser, tabs[index0]); } // Close any remaining open tabs that are left over. // (Always skipped when we append tabs) for (var i = tabCount-1; i >= index; --i) browser.removeTab(tabs[i]); // and focus the content w.content.focus(); } else if (aTargetBrowser == "window") { var URIs = []; while (containerChildren.hasMoreElements()) { var res = containerChildren.getNext().QueryInterface(kRDFRSCIID); var target = BMDS.GetTarget(res, urlArc, true); if (target) URIs.push(target.QueryInterface(kRDFLITIID).Value); } openDialog(getBrowserURL(), "_blank", "chrome,all,dialog=no", URIs.join("|")); } }, |
|
var pressedVal = { }; | function openHomeDialog(aURL){ var promptService = Components.classes["@mozilla.org/embedcomp/prompt-service;1"].getService(Components.interfaces.nsIPromptService); var pressedVal = { }; var promptTitle = gNavigatorBundle.getString("droponhometitle"); var promptMsg = gNavigatorBundle.getString("droponhomemsg"); var okButton = gNavigatorBundle.getString("droponhomeokbutton"); promptService.confirmEx(window, promptTitle, promptMsg, (promptService.BUTTON_TITLE_IS_STRING * promptService.BUTTON_POS_0) + (promptService.BUTTON_TITLE_CANCEL * promptService.BUTTON_POS_1), okButton, null, null, null, {value:0}, pressedVal); if (pressedVal.value == 0) { nsPreferences.setUnicharPref("browser.startup.homepage", aURL); setTooltipText("home-button", aURL); }} |
|
promptService.confirmEx(window, promptTitle, promptMsg, | var pressedVal = promptService.confirmEx(window, promptTitle, promptMsg, | function openHomeDialog(aURL){ var promptService = Components.classes["@mozilla.org/embedcomp/prompt-service;1"].getService(Components.interfaces.nsIPromptService); var pressedVal = { }; var promptTitle = gNavigatorBundle.getString("droponhometitle"); var promptMsg = gNavigatorBundle.getString("droponhomemsg"); var okButton = gNavigatorBundle.getString("droponhomeokbutton"); promptService.confirmEx(window, promptTitle, promptMsg, (promptService.BUTTON_TITLE_IS_STRING * promptService.BUTTON_POS_0) + (promptService.BUTTON_TITLE_CANCEL * promptService.BUTTON_POS_1), okButton, null, null, null, {value:0}, pressedVal); if (pressedVal.value == 0) { nsPreferences.setUnicharPref("browser.startup.homepage", aURL); setTooltipText("home-button", aURL); }} |
okButton, null, null, null, {value:0}, pressedVal); | okButton, null, null, null, {value:0}); | function openHomeDialog(aURL){ var promptService = Components.classes["@mozilla.org/embedcomp/prompt-service;1"].getService(Components.interfaces.nsIPromptService); var pressedVal = { }; var promptTitle = gNavigatorBundle.getString("droponhometitle"); var promptMsg = gNavigatorBundle.getString("droponhomemsg"); var okButton = gNavigatorBundle.getString("droponhomeokbutton"); promptService.confirmEx(window, promptTitle, promptMsg, (promptService.BUTTON_TITLE_IS_STRING * promptService.BUTTON_POS_0) + (promptService.BUTTON_TITLE_CANCEL * promptService.BUTTON_POS_1), okButton, null, null, null, {value:0}, pressedVal); if (pressedVal.value == 0) { nsPreferences.setUnicharPref("browser.startup.homepage", aURL); setTooltipText("home-button", aURL); }} |
if (pressedVal.value == 0) { | if (pressedVal == 0) { | function openHomeDialog(aURL){ var promptService = Components.classes["@mozilla.org/embedcomp/prompt-service;1"].getService(Components.interfaces.nsIPromptService); var pressedVal = { }; var promptTitle = gNavigatorBundle.getString("droponhometitle"); var promptMsg = gNavigatorBundle.getString("droponhomemsg"); var okButton = gNavigatorBundle.getString("droponhomeokbutton"); promptService.confirmEx(window, promptTitle, promptMsg, (promptService.BUTTON_TITLE_IS_STRING * promptService.BUTTON_POS_0) + (promptService.BUTTON_TITLE_CANCEL * promptService.BUTTON_POS_1), okButton, null, null, null, {value:0}, pressedVal); if (pressedVal.value == 0) { nsPreferences.setUnicharPref("browser.startup.homepage", aURL); setTooltipText("home-button", aURL); }} |
window.openDialog('am-identity-edit.xul', 'identity-edit', 'modal,titlebar,chrome', args); | window.openDialog('am-identity-edit.xul', '', 'modal,titlebar,chrome', args); | function openIdentityEditor(identity){ var result = false; var args = { identity: identity, account: gAccount, result: result }; window.openDialog('am-identity-edit.xul', 'identity-edit', 'modal,titlebar,chrome', args); var selectedItemIndex = gIdentityListBox.selectedIndex; if (args.result) { refreshIdentityList(); gIdentityListBox.selectedIndex = selectedItemIndex; }} |
"chrome,modal", imapServer); | "chrome,modal,titlebar", imapServer); | function openImapAdvanced(){ var imapServer = getImapServer(); dump("Opening dialog..\n"); window.openDialog("chrome://messenger/content/am-imap-advanced.xul", "_blank", "chrome,modal", imapServer); saveServerLocally(imapServer);} |
if(CheckOnline()) { | if (MailOfflineMgr.isOnline() || MailOfflineMgr.getNewMail()) { | function OpenInboxForServer(server){ try { ShowThreadPane(); var inboxFolder = GetInboxFolder(server); SelectFolder(inboxFolder.URI); if(CheckOnline()) { if (server.type != "imap") GetMessagesForInboxOnServer(server); } else if (DoGetNewMailWhenOffline()) GetMessagesForInboxOnServer(server); } catch (ex) { dump("Error opening inbox for server -> " + ex + "\n"); return; }} |
else if (DoGetNewMailWhenOffline()) GetMessagesForInboxOnServer(server); | function OpenInboxForServer(server){ try { ShowThreadPane(); var inboxFolder = GetInboxFolder(server); SelectFolder(inboxFolder.URI); if(CheckOnline()) { if (server.type != "imap") GetMessagesForInboxOnServer(server); } else if (DoGetNewMailWhenOffline()) GetMessagesForInboxOnServer(server); } catch (ex) { dump("Error opening inbox for server -> " + ex + "\n"); return; }} |
|
if(CheckOnline()) GetMessagesForInboxOnServer(server); | if(CheckOnline()) { if (server.type != "imap") GetMessagesForInboxOnServer(server); } | function OpenInboxForServer(server){ try { HideAccountCentral(); var inboxFolder = GetInboxFolder(server); SelectFolder(inboxFolder.URI); if(CheckOnline()) GetMessagesForInboxOnServer(server); else { var option = PromptGetMessagesOffline(); if(option == 0) { if (!gOfflineManager) GetOfflineMgrService(); gOfflineManager.goOnline(false /* sendUnsentMessages */, false /* playbackOfflineImapOperations */, msgWindow); GetMessagesForInboxOnServer(server); } } } catch (ex) { dump("Error opening inbox for server -> " + ex + "\n"); return; }} |
openNewWindowWith( this.linkURL() ); | openNewWindowWith( this.linkURL(), true ); | openLink : function () { // Determine linked-to URL. openNewWindowWith( this.linkURL() ); }, |
var safeurls = /(^http(s)?:|^file:|^chrome:|^resource:|^mailbox:|^imap:|^(s)?news:|^nntp:|^about:|^mailto:|^ftp:|^gopher:)/i; if (url.search(safeurls) == 0) { | var safeurls = /^https?:|^file:|^chrome:|^resource:|^mailbox:|^imap:|^s?news:|^nntp:|^about:|^mailto:|^ftp:|^gopher:/i; if (safeurls.test(url)) { | function openLink(node){ var url = node.getAttribute("value"); // Security-Critical: Only links to 'safe' protocols should be functional. // Specifically, javascript: and data: URLs must be made non-functional // here, because they will run with full privilege. var safeurls = /(^http(s)?:|^file:|^chrome:|^resource:|^mailbox:|^imap:|^(s)?news:|^nntp:|^about:|^mailto:|^ftp:|^gopher:)/i; if (url.search(safeurls) == 0) { var secMan = Components.classes["@mozilla.org/scriptsecuritymanager;1"].getService(). QueryInterface(nsIScriptSecurityManager); try { secMan.checkLoadURIStr(nodeView._content.document.location, url, nsIScriptSecurityManager.STANDARD); } catch (e) { return; } nodeView._content.document.location = url; window.close(); }} |
var safeurls = /^https?:|^file:|^chrome:|^resource:|^mailbox:|^imap:|^s?news:|^nntp:|^about:|^mailto:|^ftp:|^gopher:/i; if (safeurls.test(url)) { | var safeurls = /(^http(s)?:|^file:|^chrome:|^resource:|^mailbox:|^imap:|^(s)?news:|^nntp:|^about:|^mailto:|^ftp:|^gopher:)/i; if (url.search(safeurls) == 0) { | function openLink(node){ var url = node.getAttribute("value"); // Security-Critical: Only links to 'safe' protocols should be functional. // Specifically, javascript: and data: URLs must be made non-functional // here, because they will run with full privilege. var safeurls = /^https?:|^file:|^chrome:|^resource:|^mailbox:|^imap:|^s?news:|^nntp:|^about:|^mailto:|^ftp:|^gopher:/i; if (safeurls.test(url)) { var secMan = Components.classes["@mozilla.org/scriptsecuritymanager;1"].getService(). QueryInterface(nsIScriptSecurityManager); try { secMan.checkLoadURIStr(nodeView._content.document.location, url, nsIScriptSecurityManager.STANDARD); } catch (e) { return; } nodeView._content.document.location = url; window.close(); }} |
nodeView._content.document.location = url; window.close(); | var safeurls = /(^http(s)?:|^file:|^chrome:|^resource:|^mailbox:|^imap:|^news:|^about:|^mailto:|^ftp:|^gopher:)/i; if (url.search(safeurls) == 0) { var secMan = Components.classes["@mozilla.org/scriptsecuritymanager;1"].getService(). QueryInterface(nsIScriptSecurityManager); try { secMan.checkLoadURIStr(nodeView._content.document.location, url, nsIScriptSecurityManager.STANDARD); } catch (e) { return; } nodeView._content.document.location = url; window.close(); } | function openLink(node){ var url = node.getAttribute("value"); nodeView._content.document.location = url; window.close();} |
messenger.loadURL(window, document.getElementById(id).getAttribute("href")); | messenger.launchExternalURL(document.getElementById(id).getAttribute("href")); | function openLink(id){ try { var messenger = Components.classes["@mozilla.org/messenger;1"].createInstance(); messenger = messenger.QueryInterface(Components.interfaces.nsIMessenger); messenger.loadURL(window, document.getElementById(id).getAttribute("href")); } catch (ex) {} // return false, so we don't load the href in the addressbook window return false;} |
openNewTabWith( this.linkURL() ); | openNewTabWith( this.linkURL(), true, false ); | openLinkInTab : function () { // Determine linked-to URL. openNewTabWith( this.linkURL() ); }, |
var composite = getDisplayComposite(); | var composite = getCompositeCalendar(); | function openLocalCalendar() { const nsIFilePicker = Components.interfaces.nsIFilePicker; var fp = Components.classes["@mozilla.org/filepicker;1"].createInstance(nsIFilePicker); fp.init(window, gCalendarBundle.getString("Open"), nsIFilePicker.modeOpen); fp.appendFilter(gCalendarBundle.getString("filterCalendar"), "*.ics"); fp.appendFilters(nsIFilePicker.filterAll); if (fp.show() != nsIFilePicker.returnOK) { return; } var url = fp.fileURL.spec; var calMgr = getCalendarManager(); var composite = getDisplayComposite(); var openCalendar = calMgr.createCalendar("ics", makeURL(url)); calMgr.registerCalendar(openCalendar); // Strip ".ics" from filename for use as calendar name, taken from calendarCreation.js var fullPathRegex = new RegExp("([^/:]+)[.]ics$"); var prettyName = url.match(fullPathRegex); var name; if (prettyName && prettyName.length >= 1) { name = decodeURIComponent(prettyName[1]); } else { name = gCalendarBundle.getString("untitledCalendarName"); } openCalendar.name = name;} |
return openDialog(search_getBrowserURL(), "_blank", "chrome,all,dialog=no"); | var newNavigator = open(search_getBrowserURL(), "_blank", "chrome,all,dialog=no"); dump("*** newNavigator - " + newNavigator + "\n"); return newNavigator; | function openNewNavigator(){ return openDialog(search_getBrowserURL(), "_blank", "chrome,all,dialog=no");} |
const WM_PROGID = "component: var wm = nsJSComponentManager.getService(WM_PROGID, "nsIWindowMediator"); | const WM_CONTRACTID = "@mozilla.org/rdf/datasource;1?name=window-mediator"; var wm = nsJSComponentManager.getService(WM_CONTRACTID, "nsIWindowMediator"); | function openNewNavigator(){ var navURL = search_getBrowserURL(); var newNavigator = openDialog(navURL, "_blank", "chrome,all,dialog=no"); const WM_PROGID = "component://netscape/rdf/datasource?name=window-mediator"; var wm = nsJSComponentManager.getService(WM_PROGID, "nsIWindowMediator"); var mostRecentNavigator = wm.getMostRecentWindow("navigator:browser"); return mostRecentNavigator ? mostRecentNavigator : newNavigator;} |
function openNewTabOrWindow(event, href) | function openNewTabOrWindow(event, href, sendReferrer) | function openNewTabOrWindow(event, href) { // should we open it in a new tab? if (pref && pref.getBoolPref("browser.tabs.opentabfor.middleclick") && ("getBrowser" in window) && getBrowser().localName == "tabbrowser") { var loadInBackground = pref.getBoolPref("browser.tabs.loadInBackground"); if (event.shiftKey) loadInBackground = !loadInBackground; var theTab = getBrowser().addTab(href, getReferrer(document)); if (!loadInBackground) getBrowser().selectedTab = theTab; event.preventBubble(); return true; } // should we open it in a new window? if (pref && pref.getBoolPref("middlemouse.openNewWindow")) { openNewWindowWith(href); event.preventBubble(); return true; } // let someone else deal with it return false; } |
var loadInBackground = pref.getBoolPref("browser.tabs.loadInBackground"); if (event.shiftKey) loadInBackground = !loadInBackground; var theTab = getBrowser().addTab(href, getReferrer(document)); if (!loadInBackground) getBrowser().selectedTab = theTab; | openNewTabWith(href, sendReferrer, event.shiftKey); | function openNewTabOrWindow(event, href) { // should we open it in a new tab? if (pref && pref.getBoolPref("browser.tabs.opentabfor.middleclick") && ("getBrowser" in window) && getBrowser().localName == "tabbrowser") { var loadInBackground = pref.getBoolPref("browser.tabs.loadInBackground"); if (event.shiftKey) loadInBackground = !loadInBackground; var theTab = getBrowser().addTab(href, getReferrer(document)); if (!loadInBackground) getBrowser().selectedTab = theTab; event.preventBubble(); return true; } // should we open it in a new window? if (pref && pref.getBoolPref("middlemouse.openNewWindow")) { openNewWindowWith(href); event.preventBubble(); return true; } // let someone else deal with it return false; } |
openNewWindowWith(href); | openNewWindowWith(href, sendReferrer); | function openNewTabOrWindow(event, href) { // should we open it in a new tab? if (pref && pref.getBoolPref("browser.tabs.opentabfor.middleclick") && ("getBrowser" in window) && getBrowser().localName == "tabbrowser") { var loadInBackground = pref.getBoolPref("browser.tabs.loadInBackground"); if (event.shiftKey) loadInBackground = !loadInBackground; var theTab = getBrowser().addTab(href, getReferrer(document)); if (!loadInBackground) getBrowser().selectedTab = theTab; event.preventBubble(); return true; } // should we open it in a new window? if (pref && pref.getBoolPref("middlemouse.openNewWindow")) { openNewWindowWith(href); event.preventBubble(); return true; } // let someone else deal with it return false; } |
var wintype = document.firstChild.getAttribute('windowtype'); | var browser = getBrowser(); | function openNewTabWith(url) { urlSecurityCheck(url, document); var wintype = document.firstChild.getAttribute('windowtype'); var referrer = getReferrer(document); if (window && (wintype == "navigator:browser")) { var browser = getBrowser(); var t = browser.addTab(url, referrer); // open link in new tab if (pref && !pref.getBoolPref("browser.tabs.loadInBackground")) browser.selectedTab = t; }} |
if (window && (wintype == "navigator:browser")) { var browser = getBrowser(); var t = browser.addTab(url, referrer); if (pref && !pref.getBoolPref("browser.tabs.loadInBackground")) browser.selectedTab = t; } | if (pref && !pref.getBoolPref("browser.tabs.loadInBackground")) browser.selectedTab = tab; | function openNewTabWith(url) { urlSecurityCheck(url, document); var wintype = document.firstChild.getAttribute('windowtype'); var referrer = getReferrer(document); if (window && (wintype == "navigator:browser")) { var browser = getBrowser(); var t = browser.addTab(url, referrer); // open link in new tab if (pref && !pref.getBoolPref("browser.tabs.loadInBackground")) browser.selectedTab = t; }} |
function openNewTabWith(url, sendReferrer, reverseBackgroundPref) | function openNewTabWith(aURL, aSendReferrer, aReverseBackgroundPref) | function openNewTabWith(url, sendReferrer, reverseBackgroundPref){ var browser; try { // if we're running in a browser window, this should work // browser = getBrowser(); } catch (ex if ex instanceof ReferenceError) { // must be running somewhere else (eg mailnews message pane); need to // find a browser window first // var windowMediator = Components.classes["@mozilla.org/appshell/window-mediator;1"] .getService(Components.interfaces.nsIWindowMediator); var browserWin = windowMediator.getMostRecentWindow("navigator:browser"); // if there's no existing browser window, then, as long as // we are allowed to, open this url in one and return // if (!browserWin) { urlSecurityCheck(url, document); window.openDialog(getBrowserURL(), "_blank", "chrome,all,dialog=no", url, null, referrer); return; } // otherwise, get the existing browser object // browser = browserWin.getBrowser(); } // Get the XUL document that the browser is actually contained in. // This is needed if we are trying to load a URL from a non-navigator // window such as the JS Console. var browserDocument = browser.ownerDocument; urlSecurityCheck(url, browserDocument); var referrer = sendReferrer ? getReferrer(browserDocument) : null; // As in openNewWindowWith(), we want to pass the charset of the // current document over to a new tab. var wintype = browserDocument.documentElement.getAttribute('windowtype'); var originCharset; if (wintype == "navigator:browser") { originCharset = window.content.document.characterSet; } // open link in new tab var loadInBackground = false; if (pref) { loadInBackground = pref.getBoolPref("browser.tabs.loadInBackground"); if (reverseBackgroundPref) loadInBackground = !loadInBackground; } browser.addTab(url, referrer, originCharset, !loadInBackground);} |
var browser; try { browser = getBrowser(); } catch (ex if ex instanceof ReferenceError) { var windowMediator = Components.classes["@mozilla.org/appshell/window-mediator;1"] .getService(Components.interfaces.nsIWindowMediator); var browserWin = windowMediator.getMostRecentWindow("navigator:browser"); if (!browserWin) { urlSecurityCheck(url, document); window.openDialog(getBrowserURL(), "_blank", "chrome,all,dialog=no", url, null, referrer); return; } browser = browserWin.getBrowser(); } var browserDocument = browser.ownerDocument; urlSecurityCheck(url, browserDocument); var referrer = sendReferrer ? getReferrer(browserDocument) : null; var wintype = browserDocument.documentElement.getAttribute('windowtype'); var originCharset; if (wintype == "navigator:browser") { originCharset = window.content.document.characterSet; } var loadInBackground = false; if (pref) { loadInBackground = pref.getBoolPref("browser.tabs.loadInBackground"); if (reverseBackgroundPref) loadInBackground = !loadInBackground; } browser.addTab(url, referrer, originCharset, !loadInBackground); | openNewTabWindowOrExistingWith(kNewTab, aURL, aSendReferrer, aReverseBackgroundPref); | function openNewTabWith(url, sendReferrer, reverseBackgroundPref){ var browser; try { // if we're running in a browser window, this should work // browser = getBrowser(); } catch (ex if ex instanceof ReferenceError) { // must be running somewhere else (eg mailnews message pane); need to // find a browser window first // var windowMediator = Components.classes["@mozilla.org/appshell/window-mediator;1"] .getService(Components.interfaces.nsIWindowMediator); var browserWin = windowMediator.getMostRecentWindow("navigator:browser"); // if there's no existing browser window, then, as long as // we are allowed to, open this url in one and return // if (!browserWin) { urlSecurityCheck(url, document); window.openDialog(getBrowserURL(), "_blank", "chrome,all,dialog=no", url, null, referrer); return; } // otherwise, get the existing browser object // browser = browserWin.getBrowser(); } // Get the XUL document that the browser is actually contained in. // This is needed if we are trying to load a URL from a non-navigator // window such as the JS Console. var browserDocument = browser.ownerDocument; urlSecurityCheck(url, browserDocument); var referrer = sendReferrer ? getReferrer(browserDocument) : null; // As in openNewWindowWith(), we want to pass the charset of the // current document over to a new tab. var wintype = browserDocument.documentElement.getAttribute('windowtype'); var originCharset; if (wintype == "navigator:browser") { originCharset = window.content.document.characterSet; } // open link in new tab var loadInBackground = false; if (pref) { loadInBackground = pref.getBoolPref("browser.tabs.loadInBackground"); if (reverseBackgroundPref) loadInBackground = !loadInBackground; } browser.addTab(url, referrer, originCharset, !loadInBackground);} |
var wintype = browserDocument.firstChild.getAttribute('windowtype'); | var wintype = browserDocument.documentElement.getAttribute('windowtype'); | function openNewTabWith(url, sendReferrer, reverseBackgroundPref){ var browser; try { // if we're running in a browser window, this should work // browser = getBrowser(); } catch (ex if ex instanceof ReferenceError) { // must be running somewhere else (eg mailnews message pane); need to // find a browser window first // var windowMediator = Components.classes["@mozilla.org/appshell/window-mediator;1"] .getService(Components.interfaces.nsIWindowMediator); var browserWin = windowMediator.getMostRecentWindow("navigator:browser"); // if there's no existing browser window, then, as long as // we are allowed to, open this url in one and return // if (!browserWin) { urlSecurityCheck(url, document); window.openDialog(getBrowserURL(), "_blank", "chrome,all,dialog=no", url, null, referrer); return; } // otherwise, get the existing browser object // browser = browserWin.getBrowser(); } // Get the XUL document that the browser is actually contained in. // This is needed if we are trying to load a URL from a non-navigator // window such as the JS Console. var browserDocument = browser.ownerDocument; urlSecurityCheck(url, browserDocument); var referrer = sendReferrer ? getReferrer(browserDocument) : null; // As in openNewWindowWith(), we want to pass the charset of the // current document over to a new tab. var wintype = browserDocument.firstChild.getAttribute('windowtype'); var originCharset; if (wintype == "navigator:browser") { originCharset = window.content.document.characterSet; } // open link in new tab var loadInBackground = false; if (pref) { loadInBackground = pref.getBoolPref("browser.tabs.loadInBackground"); if (reverseBackgroundPref) loadInBackground = !loadInBackground; } browser.addTab(url, referrer, originCharset, !loadInBackground);} |
function openNewTabWith(href, linkNode, event, securityCheck, postData) | function openNewTabWith(href, linkNode, event, securityCheck, postData, sendReferrer) | function openNewTabWith(href, linkNode, event, securityCheck, postData){ if (securityCheck) urlSecurityCheck(href, document); var prefSvc = Components.classes["@mozilla.org/preferences-service;1"] .getService(Components.interfaces.nsIPrefService); prefSvc = prefSvc.getBranch(null); // should we open it in a new tab? var loadInBackground = true; try { loadInBackground = prefSvc.getBoolPref("browser.tabs.loadInBackground"); } catch(ex) { } if (event && event.shiftKey) loadInBackground = !loadInBackground; // As in openNewWindowWith(), we want to pass the charset of the // current document over to a new tab. var wintype = document.firstChild.getAttribute('windowtype'); var originCharset; if (wintype == "navigator:browser") { originCharset = window.content.document.characterSet; } // open link in new tab var browser = top.document.getElementById("content"); var theTab = browser.addTab(href, getReferrer(document), originCharset, postData); if (!loadInBackground) browser.selectedTab = theTab; if (linkNode) markLinkVisited(href, linkNode);} |
var browser = top.document.getElementById("content"); var theTab = browser.addTab(href, getReferrer(document), originCharset, postData); | var browser = top.document.getElementById("content"); var referrer = (sendReferrer == false) ? null : getReferrer(document); var theTab = browser.addTab(href, referrer, originCharset, postData); | function openNewTabWith(href, linkNode, event, securityCheck, postData){ if (securityCheck) urlSecurityCheck(href, document); var prefSvc = Components.classes["@mozilla.org/preferences-service;1"] .getService(Components.interfaces.nsIPrefService); prefSvc = prefSvc.getBranch(null); // should we open it in a new tab? var loadInBackground = true; try { loadInBackground = prefSvc.getBoolPref("browser.tabs.loadInBackground"); } catch(ex) { } if (event && event.shiftKey) loadInBackground = !loadInBackground; // As in openNewWindowWith(), we want to pass the charset of the // current document over to a new tab. var wintype = document.firstChild.getAttribute('windowtype'); var originCharset; if (wintype == "navigator:browser") { originCharset = window.content.document.characterSet; } // open link in new tab var browser = top.document.getElementById("content"); var theTab = browser.addTab(href, getReferrer(document), originCharset, postData); if (!loadInBackground) browser.selectedTab = theTab; if (linkNode) markLinkVisited(href, linkNode);} |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.