rem
stringlengths 0
126k
| add
stringlengths 0
441k
| context
stringlengths 15
136k
|
---|---|---|
var targetType; | function onOutputContextMenuCreate(e){ var target = document.popupNode; var foundSomethingUseful = false; var targetType; do { if (target.tagName == "html:a" || target.tagName == "html:td") foundSomethingUseful = true; else target = target.parentNode; } while (target && !foundSomethingUseful); var targetType = createPopupContext(e, target); var targetClass = client._popupContext.targetClass; var viewType = client.currentObject.TYPE; var targetIsOp = "n/a"; var targetIsVoice = "n/a"; var iAmOp = "n/a"; var targetUser = String(client._popupContext.user); var targetServer = getObjectDetails(client.currentObject).server; if (targetServer && targetUser == "ME!") { targetUser = targetServer.me.nick; } var targetProperNick = targetUser; if (targetServer && targetServer.users[targetUser]) targetProperNick = targetServer.users[targetUser].properNick; if (viewType == "IRCChannel" && targetUser) { var cuser = client.currentObject.users[targetUser]; if (cuser) { targetIsOp = cuser.isOp ? "yes" : "no"; targetIsVoice = cuser.isVoice ? "yes" : "no"; } var server = getObjectDetails(client.currentObject).server; if (server) iAmOp = client.currentObject.users[server.me.nick].isOp ? "yes" : "no"; } var popup = document.getElementById ("outputContext"); var menuitem = popup.firstChild; while (menuitem) { var showfor = menuitem.getAttribute("showfor"); if (showfor) { showfor = showfor.replace (/\Wis\W/gi, " == "); showfor = showfor.replace (/\Wor\W/gi, " || "); showfor = showfor.replace (/\Wand\W/gi, " && "); if (eval("(" + showfor + ")")) { var format = menuitem.getAttribute("format"); if (format) { format = format.replace (/\$nick/gi, targetProperNick); menuitem.setAttribute ("label", format); } menuitem.setAttribute ("hidden", "false"); } else menuitem.setAttribute ("hidden", "true"); } menuitem = menuitem.nextSibling; }} |
|
if (target.tagName == "html:a" || target.tagName == "html:td") | if ("tagName" in target && (target.tagName == "html:a" || target.tagName == "html:td")) | function onOutputContextMenuCreate(e){ var target = document.popupNode; var foundSomethingUseful = false; var targetType; do { if (target.tagName == "html:a" || target.tagName == "html:td") foundSomethingUseful = true; else target = target.parentNode; } while (target && !foundSomethingUseful); var targetType = createPopupContext(e, target); var targetClass = client._popupContext.targetClass; var viewType = client.currentObject.TYPE; var targetIsOp = "n/a"; var targetIsVoice = "n/a"; var iAmOp = "n/a"; var targetUser = String(client._popupContext.user); var targetServer = getObjectDetails(client.currentObject).server; if (targetServer && targetUser == "ME!") { targetUser = targetServer.me.nick; } var targetProperNick = targetUser; if (targetServer && targetServer.users[targetUser]) targetProperNick = targetServer.users[targetUser].properNick; if (viewType == "IRCChannel" && targetUser) { var cuser = client.currentObject.users[targetUser]; if (cuser) { targetIsOp = cuser.isOp ? "yes" : "no"; targetIsVoice = cuser.isVoice ? "yes" : "no"; } var server = getObjectDetails(client.currentObject).server; if (server) iAmOp = client.currentObject.users[server.me.nick].isOp ? "yes" : "no"; } var popup = document.getElementById ("outputContext"); var menuitem = popup.firstChild; while (menuitem) { var showfor = menuitem.getAttribute("showfor"); if (showfor) { showfor = showfor.replace (/\Wis\W/gi, " == "); showfor = showfor.replace (/\Wor\W/gi, " || "); showfor = showfor.replace (/\Wand\W/gi, " && "); if (eval("(" + showfor + ")")) { var format = menuitem.getAttribute("format"); if (format) { format = format.replace (/\$nick/gi, targetProperNick); menuitem.setAttribute ("label", format); } menuitem.setAttribute ("hidden", "false"); } else menuitem.setAttribute ("hidden", "true"); } menuitem = menuitem.nextSibling; }} |
var targetClass = client._popupContext.targetClass; | var targetClass = ("targetClass" in client._popupContext) ? client._popupContext.targetClass : ""; | function onOutputContextMenuCreate(e){ var target = document.popupNode; var foundSomethingUseful = false; var targetType; do { if (target.tagName == "html:a" || target.tagName == "html:td") foundSomethingUseful = true; else target = target.parentNode; } while (target && !foundSomethingUseful); var targetType = createPopupContext(e, target); var targetClass = client._popupContext.targetClass; var viewType = client.currentObject.TYPE; var targetIsOp = "n/a"; var targetIsVoice = "n/a"; var iAmOp = "n/a"; var targetUser = String(client._popupContext.user); var targetServer = getObjectDetails(client.currentObject).server; if (targetServer && targetUser == "ME!") { targetUser = targetServer.me.nick; } var targetProperNick = targetUser; if (targetServer && targetServer.users[targetUser]) targetProperNick = targetServer.users[targetUser].properNick; if (viewType == "IRCChannel" && targetUser) { var cuser = client.currentObject.users[targetUser]; if (cuser) { targetIsOp = cuser.isOp ? "yes" : "no"; targetIsVoice = cuser.isVoice ? "yes" : "no"; } var server = getObjectDetails(client.currentObject).server; if (server) iAmOp = client.currentObject.users[server.me.nick].isOp ? "yes" : "no"; } var popup = document.getElementById ("outputContext"); var menuitem = popup.firstChild; while (menuitem) { var showfor = menuitem.getAttribute("showfor"); if (showfor) { showfor = showfor.replace (/\Wis\W/gi, " == "); showfor = showfor.replace (/\Wor\W/gi, " || "); showfor = showfor.replace (/\Wand\W/gi, " && "); if (eval("(" + showfor + ")")) { var format = menuitem.getAttribute("format"); if (format) { format = format.replace (/\$nick/gi, targetProperNick); menuitem.setAttribute ("label", format); } menuitem.setAttribute ("hidden", "false"); } else menuitem.setAttribute ("hidden", "true"); } menuitem = menuitem.nextSibling; }} |
var targetUser = String(client._popupContext.user); var targetServer = getObjectDetails(client.currentObject).server; | var targetUser = ("user" in client._popupContext) ? String(client._popupContext.user) : ""; var details = getObjectDetails(client.currentObject); var targetServer = ("server" in details) ? details.server : ""; | function onOutputContextMenuCreate(e){ var target = document.popupNode; var foundSomethingUseful = false; var targetType; do { if (target.tagName == "html:a" || target.tagName == "html:td") foundSomethingUseful = true; else target = target.parentNode; } while (target && !foundSomethingUseful); var targetType = createPopupContext(e, target); var targetClass = client._popupContext.targetClass; var viewType = client.currentObject.TYPE; var targetIsOp = "n/a"; var targetIsVoice = "n/a"; var iAmOp = "n/a"; var targetUser = String(client._popupContext.user); var targetServer = getObjectDetails(client.currentObject).server; if (targetServer && targetUser == "ME!") { targetUser = targetServer.me.nick; } var targetProperNick = targetUser; if (targetServer && targetServer.users[targetUser]) targetProperNick = targetServer.users[targetUser].properNick; if (viewType == "IRCChannel" && targetUser) { var cuser = client.currentObject.users[targetUser]; if (cuser) { targetIsOp = cuser.isOp ? "yes" : "no"; targetIsVoice = cuser.isVoice ? "yes" : "no"; } var server = getObjectDetails(client.currentObject).server; if (server) iAmOp = client.currentObject.users[server.me.nick].isOp ? "yes" : "no"; } var popup = document.getElementById ("outputContext"); var menuitem = popup.firstChild; while (menuitem) { var showfor = menuitem.getAttribute("showfor"); if (showfor) { showfor = showfor.replace (/\Wis\W/gi, " == "); showfor = showfor.replace (/\Wor\W/gi, " || "); showfor = showfor.replace (/\Wand\W/gi, " && "); if (eval("(" + showfor + ")")) { var format = menuitem.getAttribute("format"); if (format) { format = format.replace (/\$nick/gi, targetProperNick); menuitem.setAttribute ("label", format); } menuitem.setAttribute ("hidden", "false"); } else menuitem.setAttribute ("hidden", "true"); } menuitem = menuitem.nextSibling; }} |
if (targetServer && targetServer.users[targetUser]) | if (targetServer && targetUser in targetServer.users) | function onOutputContextMenuCreate(e){ var target = document.popupNode; var foundSomethingUseful = false; var targetType; do { if (target.tagName == "html:a" || target.tagName == "html:td") foundSomethingUseful = true; else target = target.parentNode; } while (target && !foundSomethingUseful); var targetType = createPopupContext(e, target); var targetClass = client._popupContext.targetClass; var viewType = client.currentObject.TYPE; var targetIsOp = "n/a"; var targetIsVoice = "n/a"; var iAmOp = "n/a"; var targetUser = String(client._popupContext.user); var targetServer = getObjectDetails(client.currentObject).server; if (targetServer && targetUser == "ME!") { targetUser = targetServer.me.nick; } var targetProperNick = targetUser; if (targetServer && targetServer.users[targetUser]) targetProperNick = targetServer.users[targetUser].properNick; if (viewType == "IRCChannel" && targetUser) { var cuser = client.currentObject.users[targetUser]; if (cuser) { targetIsOp = cuser.isOp ? "yes" : "no"; targetIsVoice = cuser.isVoice ? "yes" : "no"; } var server = getObjectDetails(client.currentObject).server; if (server) iAmOp = client.currentObject.users[server.me.nick].isOp ? "yes" : "no"; } var popup = document.getElementById ("outputContext"); var menuitem = popup.firstChild; while (menuitem) { var showfor = menuitem.getAttribute("showfor"); if (showfor) { showfor = showfor.replace (/\Wis\W/gi, " == "); showfor = showfor.replace (/\Wor\W/gi, " || "); showfor = showfor.replace (/\Wand\W/gi, " && "); if (eval("(" + showfor + ")")) { var format = menuitem.getAttribute("format"); if (format) { format = format.replace (/\$nick/gi, targetProperNick); menuitem.setAttribute ("label", format); } menuitem.setAttribute ("hidden", "false"); } else menuitem.setAttribute ("hidden", "true"); } menuitem = menuitem.nextSibling; }} |
var cuser = client.currentObject.users[targetUser]; if (cuser) | if (targetUser in client.currentObject.users) | function onOutputContextMenuCreate(e){ var target = document.popupNode; var foundSomethingUseful = false; var targetType; do { if (target.tagName == "html:a" || target.tagName == "html:td") foundSomethingUseful = true; else target = target.parentNode; } while (target && !foundSomethingUseful); var targetType = createPopupContext(e, target); var targetClass = client._popupContext.targetClass; var viewType = client.currentObject.TYPE; var targetIsOp = "n/a"; var targetIsVoice = "n/a"; var iAmOp = "n/a"; var targetUser = String(client._popupContext.user); var targetServer = getObjectDetails(client.currentObject).server; if (targetServer && targetUser == "ME!") { targetUser = targetServer.me.nick; } var targetProperNick = targetUser; if (targetServer && targetServer.users[targetUser]) targetProperNick = targetServer.users[targetUser].properNick; if (viewType == "IRCChannel" && targetUser) { var cuser = client.currentObject.users[targetUser]; if (cuser) { targetIsOp = cuser.isOp ? "yes" : "no"; targetIsVoice = cuser.isVoice ? "yes" : "no"; } var server = getObjectDetails(client.currentObject).server; if (server) iAmOp = client.currentObject.users[server.me.nick].isOp ? "yes" : "no"; } var popup = document.getElementById ("outputContext"); var menuitem = popup.firstChild; while (menuitem) { var showfor = menuitem.getAttribute("showfor"); if (showfor) { showfor = showfor.replace (/\Wis\W/gi, " == "); showfor = showfor.replace (/\Wor\W/gi, " || "); showfor = showfor.replace (/\Wand\W/gi, " && "); if (eval("(" + showfor + ")")) { var format = menuitem.getAttribute("format"); if (format) { format = format.replace (/\$nick/gi, targetProperNick); menuitem.setAttribute ("label", format); } menuitem.setAttribute ("hidden", "false"); } else menuitem.setAttribute ("hidden", "true"); } menuitem = menuitem.nextSibling; }} |
if (server) iAmOp = client.currentObject.users[server.me.nick].isOp ? "yes" : "no"; | if (server && server.me.nick in client.currentObject.users && client.currentObject.users[server.me.nick].isOp) { iAmOp = "yes"; } else { iAmOp = "no"; } | function onOutputContextMenuCreate(e){ var target = document.popupNode; var foundSomethingUseful = false; var targetType; do { if (target.tagName == "html:a" || target.tagName == "html:td") foundSomethingUseful = true; else target = target.parentNode; } while (target && !foundSomethingUseful); var targetType = createPopupContext(e, target); var targetClass = client._popupContext.targetClass; var viewType = client.currentObject.TYPE; var targetIsOp = "n/a"; var targetIsVoice = "n/a"; var iAmOp = "n/a"; var targetUser = String(client._popupContext.user); var targetServer = getObjectDetails(client.currentObject).server; if (targetServer && targetUser == "ME!") { targetUser = targetServer.me.nick; } var targetProperNick = targetUser; if (targetServer && targetServer.users[targetUser]) targetProperNick = targetServer.users[targetUser].properNick; if (viewType == "IRCChannel" && targetUser) { var cuser = client.currentObject.users[targetUser]; if (cuser) { targetIsOp = cuser.isOp ? "yes" : "no"; targetIsVoice = cuser.isVoice ? "yes" : "no"; } var server = getObjectDetails(client.currentObject).server; if (server) iAmOp = client.currentObject.users[server.me.nick].isOp ? "yes" : "no"; } var popup = document.getElementById ("outputContext"); var menuitem = popup.firstChild; while (menuitem) { var showfor = menuitem.getAttribute("showfor"); if (showfor) { showfor = showfor.replace (/\Wis\W/gi, " == "); showfor = showfor.replace (/\Wor\W/gi, " || "); showfor = showfor.replace (/\Wand\W/gi, " && "); if (eval("(" + showfor + ")")) { var format = menuitem.getAttribute("format"); if (format) { format = format.replace (/\$nick/gi, targetProperNick); menuitem.setAttribute ("label", format); } menuitem.setAttribute ("hidden", "false"); } else menuitem.setAttribute ("hidden", "true"); } menuitem = menuitem.nextSibling; }} |
while (menuitem) | do | function onOutputContextMenuCreate(e){ var target = document.popupNode; var foundSomethingUseful = false; var targetType; do { if (target.tagName == "html:a" || target.tagName == "html:td") foundSomethingUseful = true; else target = target.parentNode; } while (target && !foundSomethingUseful); var targetType = createPopupContext(e, target); var targetClass = client._popupContext.targetClass; var viewType = client.currentObject.TYPE; var targetIsOp = "n/a"; var targetIsVoice = "n/a"; var iAmOp = "n/a"; var targetUser = String(client._popupContext.user); var targetServer = getObjectDetails(client.currentObject).server; if (targetServer && targetUser == "ME!") { targetUser = targetServer.me.nick; } var targetProperNick = targetUser; if (targetServer && targetServer.users[targetUser]) targetProperNick = targetServer.users[targetUser].properNick; if (viewType == "IRCChannel" && targetUser) { var cuser = client.currentObject.users[targetUser]; if (cuser) { targetIsOp = cuser.isOp ? "yes" : "no"; targetIsVoice = cuser.isVoice ? "yes" : "no"; } var server = getObjectDetails(client.currentObject).server; if (server) iAmOp = client.currentObject.users[server.me.nick].isOp ? "yes" : "no"; } var popup = document.getElementById ("outputContext"); var menuitem = popup.firstChild; while (menuitem) { var showfor = menuitem.getAttribute("showfor"); if (showfor) { showfor = showfor.replace (/\Wis\W/gi, " == "); showfor = showfor.replace (/\Wor\W/gi, " || "); showfor = showfor.replace (/\Wand\W/gi, " && "); if (eval("(" + showfor + ")")) { var format = menuitem.getAttribute("format"); if (format) { format = format.replace (/\$nick/gi, targetProperNick); menuitem.setAttribute ("label", format); } menuitem.setAttribute ("hidden", "false"); } else menuitem.setAttribute ("hidden", "true"); } menuitem = menuitem.nextSibling; }} |
var showfor = menuitem.getAttribute("showfor"); if (showfor) | if (evalIfAttribute(menuitem, "visibleif")) | function onOutputContextMenuCreate(e){ var target = document.popupNode; var foundSomethingUseful = false; var targetType; do { if (target.tagName == "html:a" || target.tagName == "html:td") foundSomethingUseful = true; else target = target.parentNode; } while (target && !foundSomethingUseful); var targetType = createPopupContext(e, target); var targetClass = client._popupContext.targetClass; var viewType = client.currentObject.TYPE; var targetIsOp = "n/a"; var targetIsVoice = "n/a"; var iAmOp = "n/a"; var targetUser = String(client._popupContext.user); var targetServer = getObjectDetails(client.currentObject).server; if (targetServer && targetUser == "ME!") { targetUser = targetServer.me.nick; } var targetProperNick = targetUser; if (targetServer && targetServer.users[targetUser]) targetProperNick = targetServer.users[targetUser].properNick; if (viewType == "IRCChannel" && targetUser) { var cuser = client.currentObject.users[targetUser]; if (cuser) { targetIsOp = cuser.isOp ? "yes" : "no"; targetIsVoice = cuser.isVoice ? "yes" : "no"; } var server = getObjectDetails(client.currentObject).server; if (server) iAmOp = client.currentObject.users[server.me.nick].isOp ? "yes" : "no"; } var popup = document.getElementById ("outputContext"); var menuitem = popup.firstChild; while (menuitem) { var showfor = menuitem.getAttribute("showfor"); if (showfor) { showfor = showfor.replace (/\Wis\W/gi, " == "); showfor = showfor.replace (/\Wor\W/gi, " || "); showfor = showfor.replace (/\Wand\W/gi, " && "); if (eval("(" + showfor + ")")) { var format = menuitem.getAttribute("format"); if (format) { format = format.replace (/\$nick/gi, targetProperNick); menuitem.setAttribute ("label", format); } menuitem.setAttribute ("hidden", "false"); } else menuitem.setAttribute ("hidden", "true"); } menuitem = menuitem.nextSibling; }} |
showfor = showfor.replace (/\Wis\W/gi, " == "); showfor = showfor.replace (/\Wor\W/gi, " || "); showfor = showfor.replace (/\Wand\W/gi, " && "); if (eval("(" + showfor + ")")) { var format = menuitem.getAttribute("format"); if (format) { format = format.replace (/\$nick/gi, targetProperNick); menuitem.setAttribute ("label", format); } menuitem.setAttribute ("hidden", "false"); } else menuitem.setAttribute ("hidden", "true"); | menuitem.setAttribute ("hidden", "false"); } else { menuitem.setAttribute ("hidden", "true"); continue; | function onOutputContextMenuCreate(e){ var target = document.popupNode; var foundSomethingUseful = false; var targetType; do { if (target.tagName == "html:a" || target.tagName == "html:td") foundSomethingUseful = true; else target = target.parentNode; } while (target && !foundSomethingUseful); var targetType = createPopupContext(e, target); var targetClass = client._popupContext.targetClass; var viewType = client.currentObject.TYPE; var targetIsOp = "n/a"; var targetIsVoice = "n/a"; var iAmOp = "n/a"; var targetUser = String(client._popupContext.user); var targetServer = getObjectDetails(client.currentObject).server; if (targetServer && targetUser == "ME!") { targetUser = targetServer.me.nick; } var targetProperNick = targetUser; if (targetServer && targetServer.users[targetUser]) targetProperNick = targetServer.users[targetUser].properNick; if (viewType == "IRCChannel" && targetUser) { var cuser = client.currentObject.users[targetUser]; if (cuser) { targetIsOp = cuser.isOp ? "yes" : "no"; targetIsVoice = cuser.isVoice ? "yes" : "no"; } var server = getObjectDetails(client.currentObject).server; if (server) iAmOp = client.currentObject.users[server.me.nick].isOp ? "yes" : "no"; } var popup = document.getElementById ("outputContext"); var menuitem = popup.firstChild; while (menuitem) { var showfor = menuitem.getAttribute("showfor"); if (showfor) { showfor = showfor.replace (/\Wis\W/gi, " == "); showfor = showfor.replace (/\Wor\W/gi, " || "); showfor = showfor.replace (/\Wand\W/gi, " && "); if (eval("(" + showfor + ")")) { var format = menuitem.getAttribute("format"); if (format) { format = format.replace (/\$nick/gi, targetProperNick); menuitem.setAttribute ("label", format); } menuitem.setAttribute ("hidden", "false"); } else menuitem.setAttribute ("hidden", "true"); } menuitem = menuitem.nextSibling; }} |
menuitem = menuitem.nextSibling; } | if (menuitem.hasAttribute("checkedif")) { if (evalIfAttribute(menuitem, "checkedif")) menuitem.setAttribute ("checked", "true"); else menuitem.setAttribute ("checked", "false"); } var format = menuitem.getAttribute("format"); if (format) { format = format.replace (/\$nick/gi, targetProperNick); format = format.replace (/\$viewname/gi, client.currentObject.name); menuitem.setAttribute ("label", format); } } while ((menuitem = menuitem.nextSibling)); return true; | function onOutputContextMenuCreate(e){ var target = document.popupNode; var foundSomethingUseful = false; var targetType; do { if (target.tagName == "html:a" || target.tagName == "html:td") foundSomethingUseful = true; else target = target.parentNode; } while (target && !foundSomethingUseful); var targetType = createPopupContext(e, target); var targetClass = client._popupContext.targetClass; var viewType = client.currentObject.TYPE; var targetIsOp = "n/a"; var targetIsVoice = "n/a"; var iAmOp = "n/a"; var targetUser = String(client._popupContext.user); var targetServer = getObjectDetails(client.currentObject).server; if (targetServer && targetUser == "ME!") { targetUser = targetServer.me.nick; } var targetProperNick = targetUser; if (targetServer && targetServer.users[targetUser]) targetProperNick = targetServer.users[targetUser].properNick; if (viewType == "IRCChannel" && targetUser) { var cuser = client.currentObject.users[targetUser]; if (cuser) { targetIsOp = cuser.isOp ? "yes" : "no"; targetIsVoice = cuser.isVoice ? "yes" : "no"; } var server = getObjectDetails(client.currentObject).server; if (server) iAmOp = client.currentObject.users[server.me.nick].isOp ? "yes" : "no"; } var popup = document.getElementById ("outputContext"); var menuitem = popup.firstChild; while (menuitem) { var showfor = menuitem.getAttribute("showfor"); if (showfor) { showfor = showfor.replace (/\Wis\W/gi, " == "); showfor = showfor.replace (/\Wor\W/gi, " || "); showfor = showfor.replace (/\Wand\W/gi, " && "); if (eval("(" + showfor + ")")) { var format = menuitem.getAttribute("format"); if (format) { format = format.replace (/\$nick/gi, targetProperNick); menuitem.setAttribute ("label", format); } menuitem.setAttribute ("hidden", "false"); } else menuitem.setAttribute ("hidden", "true"); } menuitem = menuitem.nextSibling; }} |
}, | } | onPageShowPatching: function() { gUpdates.wiz.getButton("back").disabled = true; gUpdates.wiz.getButton("cancel").disabled = true; gUpdates.wiz.getButton("next").focus(); }, |
paraMenuList.setAttribute("value",GetString('MixedFormats')); | paraMenuList.setAttribute("value",GetString('Mixed')); | function onParagraphFormatChange(paraMenuList, commandID){ var commandNode = document.getElementById(commandID); var state = commandNode.getAttribute("state"); dump("Updating font face with " + state + "\n"); // force match with "normal" if (state == "body") state = ""; if (state == "mixed") { //Selection is the "mixed" ( > 1 style) state paraMenuList.selectedItem = null; paraMenuList.setAttribute("value",GetString('MixedFormats')); } else { var menuPopup = document.getElementById("ParagraphPopup"); var menuItems = menuPopup.childNodes; for (i=0; i < menuItems.length; i++) { var menuItem = menuItems.item(i); if (menuItem.data == state) { paraMenuList.selectedItem = menuItem; break; } } }} |
for (var i = 0; i < browser.popupUrls.length; ++i) { if (browser.popupUrls[i].equals(aEvent.popupWindowURI)) { browser.popupUrls.splice(i, 1); browser.popupFeatures.splice(i, 1); break; } } if (browser.popupUrls.length >= 100) { browser.popupUrls.shift(); browser.popupFeatures.shift(); } | function onPopupBlocked(aEvent) { var playSound = pref.getBoolPref("privacy.popups.sound_enabled"); if (playSound) { var sound = Components.classes["@mozilla.org/sound;1"] .createInstance(Components.interfaces.nsISound); var soundUrlSpec = pref.getCharPref("privacy.popups.sound_url"); if (!soundUrlSpec) sound.beep(); if (soundUrlSpec.substr(0, 7) == "file://") { var soundUrl = Components.classes["@mozilla.org/network/standard-url;1"] .createInstance(Components.interfaces.nsIFileURL); soundUrl.spec = soundUrlSpec; var file = soundUrl.file; if (file.exists) sound.play(soundUrl); } else { sound.playSystemSound(soundUrlSpec); } } var showIcon = pref.getBoolPref("privacy.popups.statusbar_icon_enabled"); if (showIcon) { var browser = getBrowserForDocument(aEvent.target); if (browser) { var hostPort = browser.currentURI.hostPort; browser.popupDomain = hostPort; if (browser == getBrowser().selectedBrowser) { var popupIcon = document.getElementById("popupIcon"); popupIcon.hidden = false; } if (!browser.popupUrls) { browser.popupUrls = []; browser.popupFeatures = []; } browser.popupUrls.push(aEvent.popupWindowURI); browser.popupFeatures.push(aEvent.popupWindowFeatures); } }} |
|
if (!browser.popupUrls) { browser.popupUrls = []; browser.popupFeatures = []; } for (var i = 0; i < browser.popupUrls.length; ++i) { if (browser.popupUrls[i].equals(aEvent.popupWindowURI)) { browser.popupUrls.splice(i, 1); browser.popupFeatures.splice(i, 1); break; } } if (browser.popupUrls.length >= 100) { browser.popupUrls.shift(); browser.popupFeatures.shift(); } browser.popupUrls.push(aEvent.popupWindowURI); browser.popupFeatures.push(aEvent.popupWindowFeatures); | function onPopupBlocked(aEvent) { var playSound = pref.getBoolPref("privacy.popups.sound_enabled"); if (playSound) { var sound = Components.classes["@mozilla.org/sound;1"] .createInstance(Components.interfaces.nsISound); var soundUrlSpec = pref.getCharPref("privacy.popups.sound_url"); if (!soundUrlSpec) sound.beep(); if (soundUrlSpec.substr(0, 7) == "file://") { var soundUrl = Components.classes["@mozilla.org/network/standard-url;1"] .createInstance(Components.interfaces.nsIFileURL); soundUrl.spec = soundUrlSpec; var file = soundUrl.file; if (file.exists) sound.play(soundUrl); } else { sound.playSystemSound(soundUrlSpec); } } var showIcon = pref.getBoolPref("privacy.popups.statusbar_icon_enabled"); if (showIcon) { var browser = getBrowserForDocument(aEvent.target); if (browser) { var hostPort = browser.currentURI.hostPort; browser.popupDomain = hostPort; if (browser == getBrowser().selectedBrowser) { var popupIcon = document.getElementById("popupIcon"); popupIcon.hidden = false; } } }} |
|
permissionmanager = permissionmanager.QueryInterface(Components.interfaces.nsIPermissionManager); | permissionmanager = permissionmanager.QueryInterface(nsIPermissionManager); | function onPopupPrefsOK(){ var permissionmanager = Components.classes["@mozilla.org/permissionmanager;1"].getService(); permissionmanager = permissionmanager.QueryInterface(Components.interfaces.nsIPermissionManager); var dataObject = parent.hPrefWindow.wsm.dataManager.pageData["chrome://browser/content/pref/pref-features.xul"].userData; if ('deletedPermissions' in dataObject) { for (var p = 0; p < dataObject.deletedPermissions.length; ++p) { permissionmanager.remove(dataObject.deletedPermissions[p].host, dataObject.deletedPermissions[p].type); } } if ('permissions' in dataObject) { var uri = Components.classes["@mozilla.org/network/standard-url;1"] .createInstance(Components.interfaces.nsIURI); for (p = 0; p < dataObject.permissions.length; ++p) { uri.spec = dataObject.permissions[p].host; if (permissionmanager.testPermission(uri, "popup") != dataObject.permissions[p].perm) permissionmanager.add(uri, "popup", nsIPermissionManager.ALLOW_ACTION); } }} |
var amPmItem = null; var hours12 = null; if( oeTimePicker.isTimeAm( oeTimePicker.gSelectedTime ) ) { amPmItem = document.getElementById( "oe-time-picker-am-box" ); hours12 = hours24; } else { amPmItem = document.getElementById( "oe-time-picker-pm-box" ); hours12 = hours24 - 12; } oeTimePicker.selectAmPmItem( amPmItem ); | oeTimePicker.onpopupshowing = function( popup ){ // remember the popup oeTimePicker.gPopup = popup; // if there is a Date object in the popup item's value attribute, use it, // otherwise use Now. var inputTime = oeTimePicker.gPopup.getAttribute( "value" ); if( inputTime ) { oeTimePicker.gSelectedTime = new Date( inputTime ); } else { oeTimePicker.gSelectedTime = new Date(); } // Select the AM or PM item based on whether the hour is 0-11 or 12-23 var hours24 = oeTimePicker.gSelectedTime.getHours(); var amPmItem = null; var hours12 = null; if( oeTimePicker.isTimeAm( oeTimePicker.gSelectedTime ) ) { amPmItem = document.getElementById( "oe-time-picker-am-box" ); hours12 = hours24; } else { amPmItem = document.getElementById( "oe-time-picker-pm-box" ); hours12 = hours24 - 12; } oeTimePicker.selectAmPmItem( amPmItem ); // select the hour item var hourItem = document.getElementById( "oe-time-picker-hour-box-" + hours12 ); oeTimePicker.selectHourItem( hourItem ); // Show the five minute view if we are an even five minutes, one minute // otherwise var minutesByFive = oeTimePicker.calcNearestFiveMinutes( oeTimePicker.gSelectedTime ); if( minutesByFive == oeTimePicker.gSelectedTime.getMinutes() ) { oeTimePicker.clickLess(); } else { oeTimePicker.clickMore(); }} |
|
var hourItem = document.getElementById( "oe-time-picker-hour-box-" + hours12 ); | var hourItem = document.getElementById( "oe-time-picker-hour-box-" + hours24 ); | oeTimePicker.onpopupshowing = function( popup ){ // remember the popup oeTimePicker.gPopup = popup; // if there is a Date object in the popup item's value attribute, use it, // otherwise use Now. var inputTime = oeTimePicker.gPopup.getAttribute( "value" ); if( inputTime ) { oeTimePicker.gSelectedTime = new Date( inputTime ); } else { oeTimePicker.gSelectedTime = new Date(); } // Select the AM or PM item based on whether the hour is 0-11 or 12-23 var hours24 = oeTimePicker.gSelectedTime.getHours(); var amPmItem = null; var hours12 = null; if( oeTimePicker.isTimeAm( oeTimePicker.gSelectedTime ) ) { amPmItem = document.getElementById( "oe-time-picker-am-box" ); hours12 = hours24; } else { amPmItem = document.getElementById( "oe-time-picker-pm-box" ); hours12 = hours24 - 12; } oeTimePicker.selectAmPmItem( amPmItem ); // select the hour item var hourItem = document.getElementById( "oe-time-picker-hour-box-" + hours12 ); oeTimePicker.selectHourItem( hourItem ); // Show the five minute view if we are an even five minutes, one minute // otherwise var minutesByFive = oeTimePicker.calcNearestFiveMinutes( oeTimePicker.gSelectedTime ); if( minutesByFive == oeTimePicker.gSelectedTime.getMinutes() ) { oeTimePicker.clickLess(); } else { oeTimePicker.clickMore(); }} |
var nick = client._popupContext.user; if (nick == "ME!") | if ("user" in client._popupContext) | function onPopupSimulateCommand (line){ var nick = client._popupContext.user; if (nick == "ME!") { var server = getObjectDetails(client.currentObject).server; if (server) nick = server.me.properNick; } line = line.replace (/\$nick/ig, nick); onInputCompleteLine ({line: line}, true);} |
var server = getObjectDetails(client.currentObject).server; if (server) nick = server.me.properNick; | var nick = client._popupContext.user; if (nick.indexOf("ME!") != -1) { var details = getObjectDetails(client.currentObject); if ("server" in details) nick = details.server.me.properNick; } line = line.replace (/\$nick/ig, nick); | function onPopupSimulateCommand (line){ var nick = client._popupContext.user; if (nick == "ME!") { var server = getObjectDetails(client.currentObject).server; if (server) nick = server.me.properNick; } line = line.replace (/\$nick/ig, nick); onInputCompleteLine ({line: line}, true);} |
line = line.replace (/\$nick/ig, nick); | function onPopupSimulateCommand (line){ var nick = client._popupContext.user; if (nick == "ME!") { var server = getObjectDetails(client.currentObject).server; if (server) nick = server.me.properNick; } line = line.replace (/\$nick/ig, nick); onInputCompleteLine ({line: line}, true);} |
|
this.setAccessibleNodes(PrefUtils.getPref("inspector.dom.showAccessibleNodes", true)); | this.setAccessibleNodes(PrefUtils.getPref("inspector.dom.showAccessibleNodes"), true); | onPrefChanged: function(aName) { if (aName == "inspector.dom.showAnon") this.setAnonContent(PrefUtils.getPref("inspector.dom.showAnon"), true); if (aName == "inspector.dom.showWhitespaceNodes") this.setWhitespaceNodes(PrefUtils.getPref("inspector.dom.showWhitespaceNodes")); if (aName == "inspector.dom.showAccessibleNodes") this.setAccessibleNodes(PrefUtils.getPref("inspector.dom.showAccessibleNodes", true)); if (aName == "inspector.blink.on") this.setFlashSelected(PrefUtils.getPref("inspector.blink.on")); if (this.mFlasher) { if (aName == "inspector.blink.border-color") { this.mFlasher.color = PrefUtils.getPref("inspector.blink.border-color"); } else if (aName == "inspector.blink.border-width") { this.mFlasher.thickness = PrefUtils.getPref("inspector.blink.border-width"); } else if (aName == "inspector.blink.duration") { this.mFlasher.duration = PrefUtils.getPref("inspector.blink.duration"); } else if (aName == "inspector.blink.speed") { this.mFlasher.speed = PrefUtils.getPref("inspector.blink.speed"); } else if (aName == "inspector.blink.invert") { this.mFlasher.invert = PrefUtils.getPref("inspector.blink.invert"); } } }, |
if ((document.getElementById('prefname').value == "browser.startup.homepage") && (document.getElementById('prefvalue').value.length > 0)) { gPromptService.alert(window, "", "You cannot set the browser.startup.homepage here, you can only lock it."); return false; } | function OnPrefOK(){ listbox = this.opener.document.getElementById('prefList'); var listitem; if (window.name == 'newpref') { listitem = listbox.appendItem(document.getElementById('prefname').value, document.getElementById('prefvalue').value); } else { listitem = listbox.selectedItem; listitem.label = document.getElementById('prefname').value; listitem.value = document.getElementById('prefvalue').value; } if (document.getElementById('lockPref').checked) { listitem.cck['lock'] = "true"; } else { listitem.cck['lock'] = ""; }} |
|
var titleStringID; if (gIncomingServer.offlineSupportLevel >= 10) { titleStringID = "prefPanel-offline-and-diskspace"; } else { titleStringID = "prefPanel-diskspace"; } var prefBundle = document.getElementById("bundle_prefs"); var headertitle = document.getElementById("headertitle"); headertitle.setAttribute('title',prefBundle.getString(titleStringID)); | function onPreInit(account, accountValues){ gServerType = getAccountValue(account, accountValues, "server", "type"); hideShowControls(gServerType); gIncomingServer= account.incomingServer; gIncomingServer.type = gServerType;} |
|
gServer = account.incomingServer; if(!account.incomingServer.canEmptyTrashOnExit) { document.getElementById("server.emptyTrashOnExit").setAttribute("hidden", "true"); document.getElementById("imap.deleteModel.box").setAttribute("hidden", "true"); | gServer = account.incomingServer; if(!account.incomingServer.canEmptyTrashOnExit) { document.getElementById("server.emptyTrashOnExit").setAttribute("hidden", "true"); document.getElementById("imap.deleteModel.box").setAttribute("hidden", "true"); } var hideButton = false; try { if (gRedirectorType) { var prefs = Components.classes["@mozilla.org/preferences-service;1"].getService(Components.interfaces.nsIPrefBranch); var prefString = "mail.accountmanager." + gRedirectorType + ".hide_advanced_button"; hideButton = prefs.getBoolPref(prefString); | function onPreInit(account, accountValues){ // Bug 134238 // Make sure server.isSecure will be saved before server.port preference parent.getAccountValue(account, accountValues, "server", "isSecure", null, false); var type = parent.getAccountValue(account, accountValues, "server", "type", null, false); gRedirectorType = parent.getAccountValue(account, accountValues, "server", "redirectorType", null, false); hideShowControls(type); gServer = account.incomingServer; if(!account.incomingServer.canEmptyTrashOnExit) { document.getElementById("server.emptyTrashOnExit").setAttribute("hidden", "true"); document.getElementById("imap.deleteModel.box").setAttribute("hidden", "true"); } var hideButton = false; try { if (gRedirectorType) { var prefs = Components.classes["@mozilla.org/preferences-service;1"].getService(Components.interfaces.nsIPrefBranch); var prefString = "mail.accountmanager." + gRedirectorType + ".hide_advanced_button"; hideButton = prefs.getBoolPref(prefString); } } catch (ex) { } if (hideButton) document.getElementById("server.advancedbutton").setAttribute("hidden", "true"); else document.getElementById("server.advancedbutton").removeAttribute("hidden"); } |
var hideButton = false; try { if (gRedirectorType) { var prefs = Components.classes["@mozilla.org/preferences-service;1"].getService(Components.interfaces.nsIPrefBranch); var prefString = "mail.accountmanager." + gRedirectorType + ".hide_advanced_button"; hideButton = prefs.getBoolPref(prefString); } } catch (ex) { } if (hideButton) document.getElementById("server.advancedbutton").setAttribute("hidden", "true"); else document.getElementById("server.advancedbutton").removeAttribute("hidden"); | } catch (ex) { } if (hideButton) document.getElementById("server.advancedbutton").setAttribute("hidden", "true"); else document.getElementById("server.advancedbutton").removeAttribute("hidden"); | function onPreInit(account, accountValues){ // Bug 134238 // Make sure server.isSecure will be saved before server.port preference parent.getAccountValue(account, accountValues, "server", "isSecure", null, false); var type = parent.getAccountValue(account, accountValues, "server", "type", null, false); gRedirectorType = parent.getAccountValue(account, accountValues, "server", "redirectorType", null, false); hideShowControls(type); gServer = account.incomingServer; if(!account.incomingServer.canEmptyTrashOnExit) { document.getElementById("server.emptyTrashOnExit").setAttribute("hidden", "true"); document.getElementById("imap.deleteModel.box").setAttribute("hidden", "true"); } var hideButton = false; try { if (gRedirectorType) { var prefs = Components.classes["@mozilla.org/preferences-service;1"].getService(Components.interfaces.nsIPrefBranch); var prefString = "mail.accountmanager." + gRedirectorType + ".hide_advanced_button"; hideButton = prefs.getBoolPref(prefString); } } catch (ex) { } if (hideButton) document.getElementById("server.advancedbutton").setAttribute("hidden", "true"); else document.getElementById("server.advancedbutton").removeAttribute("hidden"); } |
var hideButton = false; try { if (gRedirectorType) { var prefs = Components.classes["@mozilla.org/preferences-service;1"].getService(Components.interfaces.nsIPrefBranch); var prefString = "mail.accountmanager." + gRedirectorType + ".hide_advanced_button"; hideButton = prefs.getBoolPref(prefString); } } catch (ex) { } if (hideButton) document.getElementById("server.advancedbutton").setAttribute("hidden", "true"); else document.getElementById("server.advancedbutton").removeAttribute("hidden"); | function onPreInit(account, accountValues){ var type = parent.getAccountValue(account, accountValues, "server", "type", null, false); gRedirectorType = parent.getAccountValue(account, accountValues, "server", "redirectorType", null, false); hideShowControls(type); if(!(account.incomingServer.isSecureServer)) document.getElementById("server.isSecure").setAttribute("hidden", "true"); else document.getElementById("server.isSecure").removeAttribute("hidden"); if(!account.incomingServer.canEmptyTrashOnExit) { document.getElementById("server.emptyTrashOnExit").setAttribute("hidden", "true"); document.getElementById("imap.deleteModel.box").setAttribute("hidden", "true"); }} |
|
var prefs = Components.classes["@mozilla.org/preferences-service;1"]. getService(Components.interfaces.nsIPrefBranch); var ioService = Components.classes["@mozilla.org/network/io-service;1"].getService(Components.interfaces.nsIIOService); | var ioService = Components.classes["@mozilla.org/network/io-service;1"] .getService(Components.interfaces.nsIIOService); if (gStartingUp) { gStartingUp = false; if (ioService.offline) { debug("already offline!"); return; } } | onProfileStartup: function() { debug("onProfileStartup"); var prefs = Components.classes["@mozilla.org/preferences-service;1"]. getService(Components.interfaces.nsIPrefBranch); var ioService = Components.classes["@mozilla.org/network/io-service;1"].getService(Components.interfaces.nsIIOService); gOfflineStartupMode = prefs.getIntPref(kOfflineStartupPref); if (gOfflineStartupMode == kRememberLastState) { var offline = !prefs.getBoolPref("network.online"); // if the user checked "work offline" in the profile mgr UI // and forced us offline, remember that in prefs // if checked, the "work offline" checkbox overrides our // persisted state if (ioService.offline) prefs.setBoolPref("network.online", false); else { // if user did not check "work offline" in the profile manager UI // use the persisted online state pref to restore our offline state ioService.offline = offline; } var observerService = Components. classes["@mozilla.org/observer-service;1"]. getService(Components.interfaces.nsIObserverService); observerService.addObserver(this, "network:offline-status-changed", false); observerService.addObserver(this, "quit-application", false); observerService.addObserver(this, "xpcom-shutdown", false); } else if (gOfflineStartupMode == kAskForOnlineState) { var promptService = Components. classes["@mozilla.org/embedcomp/prompt-service;1"]. getService(Components.interfaces.nsIPromptService); var bundle = getBundle(kBundleURI); if (!bundle) return; var title = bundle.GetStringFromName("title"); var desc = bundle.GetStringFromName("desc"); var button0Text = bundle.GetStringFromName("workOnline"); var button1Text = bundle.GetStringFromName("workOffline"); var checkVal = {value:0}; var result = promptService.confirmEx(null, title, desc, (promptService.BUTTON_POS_0 * promptService.BUTTON_TITLE_IS_STRING) + (promptService.BUTTON_POS_1 * promptService.BUTTON_TITLE_IS_STRING), button0Text, button1Text, null, null, checkVal); debug ("result = " + result + "\n"); if (result == 1) ioService.offline = true; } }, |
gOfflineStartupMode = prefs.getIntPref(kOfflineStartupPref); | var prefs = Components.classes["@mozilla.org/preferences-service;1"] .getService(Components.interfaces.nsIPrefBranch); gOfflineStartupMode = prefs.getIntPref(kOfflineStartupPref); | onProfileStartup: function() { debug("onProfileStartup"); var prefs = Components.classes["@mozilla.org/preferences-service;1"]. getService(Components.interfaces.nsIPrefBranch); var ioService = Components.classes["@mozilla.org/network/io-service;1"].getService(Components.interfaces.nsIIOService); gOfflineStartupMode = prefs.getIntPref(kOfflineStartupPref); if (gOfflineStartupMode == kRememberLastState) { var offline = !prefs.getBoolPref("network.online"); // if the user checked "work offline" in the profile mgr UI // and forced us offline, remember that in prefs // if checked, the "work offline" checkbox overrides our // persisted state if (ioService.offline) prefs.setBoolPref("network.online", false); else { // if user did not check "work offline" in the profile manager UI // use the persisted online state pref to restore our offline state ioService.offline = offline; } var observerService = Components. classes["@mozilla.org/observer-service;1"]. getService(Components.interfaces.nsIObserverService); observerService.addObserver(this, "network:offline-status-changed", false); observerService.addObserver(this, "quit-application", false); observerService.addObserver(this, "xpcom-shutdown", false); } else if (gOfflineStartupMode == kAskForOnlineState) { var promptService = Components. classes["@mozilla.org/embedcomp/prompt-service;1"]. getService(Components.interfaces.nsIPromptService); var bundle = getBundle(kBundleURI); if (!bundle) return; var title = bundle.GetStringFromName("title"); var desc = bundle.GetStringFromName("desc"); var button0Text = bundle.GetStringFromName("workOnline"); var button1Text = bundle.GetStringFromName("workOffline"); var checkVal = {value:0}; var result = promptService.confirmEx(null, title, desc, (promptService.BUTTON_POS_0 * promptService.BUTTON_TITLE_IS_STRING) + (promptService.BUTTON_POS_1 * promptService.BUTTON_TITLE_IS_STRING), button0Text, button1Text, null, null, checkVal); debug ("result = " + result + "\n"); if (result == 1) ioService.offline = true; } }, |
if (gOfflineStartupMode == kRememberLastState) | if (gOfflineStartupMode == kAlwaysOffline) | onProfileStartup: function() { debug("onProfileStartup"); var prefs = Components.classes["@mozilla.org/preferences-service;1"]. getService(Components.interfaces.nsIPrefBranch); var ioService = Components.classes["@mozilla.org/network/io-service;1"].getService(Components.interfaces.nsIIOService); gOfflineStartupMode = prefs.getIntPref(kOfflineStartupPref); if (gOfflineStartupMode == kRememberLastState) { var offline = !prefs.getBoolPref("network.online"); // if the user checked "work offline" in the profile mgr UI // and forced us offline, remember that in prefs // if checked, the "work offline" checkbox overrides our // persisted state if (ioService.offline) prefs.setBoolPref("network.online", false); else { // if user did not check "work offline" in the profile manager UI // use the persisted online state pref to restore our offline state ioService.offline = offline; } var observerService = Components. classes["@mozilla.org/observer-service;1"]. getService(Components.interfaces.nsIObserverService); observerService.addObserver(this, "network:offline-status-changed", false); observerService.addObserver(this, "quit-application", false); observerService.addObserver(this, "xpcom-shutdown", false); } else if (gOfflineStartupMode == kAskForOnlineState) { var promptService = Components. classes["@mozilla.org/embedcomp/prompt-service;1"]. getService(Components.interfaces.nsIPromptService); var bundle = getBundle(kBundleURI); if (!bundle) return; var title = bundle.GetStringFromName("title"); var desc = bundle.GetStringFromName("desc"); var button0Text = bundle.GetStringFromName("workOnline"); var button1Text = bundle.GetStringFromName("workOffline"); var checkVal = {value:0}; var result = promptService.confirmEx(null, title, desc, (promptService.BUTTON_POS_0 * promptService.BUTTON_TITLE_IS_STRING) + (promptService.BUTTON_POS_1 * promptService.BUTTON_TITLE_IS_STRING), button0Text, button1Text, null, null, checkVal); debug ("result = " + result + "\n"); if (result == 1) ioService.offline = true; } }, |
var offline = !prefs.getBoolPref("network.online"); if (ioService.offline) prefs.setBoolPref("network.online", false); else { ioService.offline = offline; } var observerService = Components. classes["@mozilla.org/observer-service;1"]. getService(Components.interfaces.nsIObserverService); observerService.addObserver(this, "network:offline-status-changed", false); observerService.addObserver(this, "quit-application", false); observerService.addObserver(this, "xpcom-shutdown", false); | ioService.offline = true; } else if (gOfflineStartupMode == kRememberLastState) { ioService.offline = !prefs.getBoolPref("network.online"); | onProfileStartup: function() { debug("onProfileStartup"); var prefs = Components.classes["@mozilla.org/preferences-service;1"]. getService(Components.interfaces.nsIPrefBranch); var ioService = Components.classes["@mozilla.org/network/io-service;1"].getService(Components.interfaces.nsIIOService); gOfflineStartupMode = prefs.getIntPref(kOfflineStartupPref); if (gOfflineStartupMode == kRememberLastState) { var offline = !prefs.getBoolPref("network.online"); // if the user checked "work offline" in the profile mgr UI // and forced us offline, remember that in prefs // if checked, the "work offline" checkbox overrides our // persisted state if (ioService.offline) prefs.setBoolPref("network.online", false); else { // if user did not check "work offline" in the profile manager UI // use the persisted online state pref to restore our offline state ioService.offline = offline; } var observerService = Components. classes["@mozilla.org/observer-service;1"]. getService(Components.interfaces.nsIObserverService); observerService.addObserver(this, "network:offline-status-changed", false); observerService.addObserver(this, "quit-application", false); observerService.addObserver(this, "xpcom-shutdown", false); } else if (gOfflineStartupMode == kAskForOnlineState) { var promptService = Components. classes["@mozilla.org/embedcomp/prompt-service;1"]. getService(Components.interfaces.nsIPromptService); var bundle = getBundle(kBundleURI); if (!bundle) return; var title = bundle.GetStringFromName("title"); var desc = bundle.GetStringFromName("desc"); var button0Text = bundle.GetStringFromName("workOnline"); var button1Text = bundle.GetStringFromName("workOffline"); var checkVal = {value:0}; var result = promptService.confirmEx(null, title, desc, (promptService.BUTTON_POS_0 * promptService.BUTTON_TITLE_IS_STRING) + (promptService.BUTTON_POS_1 * promptService.BUTTON_TITLE_IS_STRING), button0Text, button1Text, null, null, checkVal); debug ("result = " + result + "\n"); if (result == 1) ioService.offline = true; } }, |
observerService.addObserver(this, "xpcom-shutdown", false); | onProfileStartup: function(aProfileName) { debug("onProfileStartup"); var prefs = Components.classes["@mozilla.org/preferences-service;1"]. getService(Components.interfaces.nsIPrefBranch); gOfflineStartupMode = prefs.getIntPref(kOfflineStartupPref); if (gOfflineStartupMode == kRememberLastState) { var prefs = Components.classes["@mozilla.org/preferences-service;1"]. getService(Components.interfaces.nsIPrefBranch); var offline = !prefs.getBoolPref("network.online"); var ioService = Components.classes["@mozilla.org/network/io-service;1"].getService(Components.interfaces.nsIIOService); ioService.offline = offline; var observerService = Components. classes["@mozilla.org/observer-service;1"]. getService(Components.interfaces.nsIObserverService); observerService.addObserver(this, "network:offline-status-changed", false); observerService.addObserver(this, "quit-application", false); } else if (gOfflineStartupMode == kAskForOnlineState) { var promptService = Components. classes["@mozilla.org/embedcomp/prompt-service;1"]. getService(Components.interfaces.nsIPromptService); var bundle = getBundle(kBundleURI); if (!bundle) return; var title = bundle.GetStringFromName("title"); var desc = bundle.GetStringFromName("desc"); var button0Text = bundle.GetStringFromName("workOnline"); var button1Text = bundle.GetStringFromName("workOffline"); var checkVal = {value:0}; var result = promptService.confirmEx(null, title, desc, (promptService.BUTTON_POS_0 * promptService.BUTTON_TITLE_IS_STRING) + (promptService.BUTTON_POS_1 * promptService.BUTTON_TITLE_IS_STRING), button0Text, button1Text, null, null, checkVal); debug ("result = " + result + "\n"); if (result == 1) { var ioService = Components.classes["@mozilla.org/network/io-service;1"].getService(Components.interfaces.nsIIOService); ioService.offline = true; } } }, |
|
onProgress: function(request, position, totalSize) { var pm = document.getElementById("checkingProgress"); checkingProgress.setAttribute("mode", "normal"); checkingProgress.setAttribute("value", Math.floor(100 * (position/totalSize))); }, | onProgress: function(request, context, progress, maxProgress) { request.QueryInterface(nsIIncrementalDownload); LOG("UI:DownloadingPage.onProgress", request.URI.spec + ", " + progress + "/" + maxProgress); var p = gUpdates.update.selectedPatch; p.QueryInterface(Components.interfaces.nsIWritablePropertyBag); p.setProperty("progress", Math.round(100 * (progress/maxProgress))); p.setProperty("status", this.statusFormatter.formatStatus(progress, maxProgress)); this._downloadProgress.mode = "normal"; this._downloadProgress.value = parseInt(p.getProperty("progress")); this._pauseButton.disabled = false; var name = gUpdates.strings.getFormattedString("downloadingPrefix", [gUpdates.update.name]); this._downloadName.value = name; var status = p.getProperty("status"); if (status) this._setStatus(status); }, | onProgress: function(request, position, totalSize) { var pm = document.getElementById("checkingProgress"); checkingProgress.setAttribute("mode", "normal"); checkingProgress.setAttribute("value", Math.floor(100 * (position/totalSize))); }, |
onProgress: function(aProgress, aProgressMax) | onProgress: function(feed, aProgress, aProgressMax) | onProgress: function(aProgress, aProgressMax) { updateStatusItem('progressMeter', (aProgress * 100) / aProgressMax); }, |
feed.downloadCallback.onProgress(event.position, event.totalSize); | feed.downloadCallback.onProgress(feed, event.position, event.totalSize); | Feed.onProgress = function(event) { var request = event.target; var url = request.channel.originalURI.spec; var feed = gFzFeedCache[url]; if (feed.downloadCallback) feed.downloadCallback.onProgress(event.position, event.totalSize);} |
Feed.onProgress = function(event) { var request = event.target; var url = request.channel.originalURI.spec; var feed = FeedCache.getFeed(url); | onProgress: function(aEvent) { var request = aEvent.target; var url = request.channel.originalURI.spec; var feed = FeedCache.getFeed(url); | Feed.onProgress = function(event) { var request = event.target; var url = request.channel.originalURI.spec; var feed = FeedCache.getFeed(url); if (feed.downloadCallback) feed.downloadCallback.onProgress(feed, event.position, event.totalSize);} |
if (feed.downloadCallback) feed.downloadCallback.onProgress(feed, event.position, event.totalSize); } | if (feed.downloadCallback) feed.downloadCallback.onProgress(feed, aEvent.position, aEvent.totalSize); }, | Feed.onProgress = function(event) { var request = event.target; var url = request.channel.originalURI.spec; var feed = FeedCache.getFeed(url); if (feed.downloadCallback) feed.downloadCallback.onProgress(feed, event.position, event.totalSize);} |
dialog.cancel.removeAttribute( "disabled" ); | function onProgress( bytes, max ) { // Check for first time. if ( !started ) { // Initialize download start time. started = true; startTime = ( new Date() ).getTime(); // Let the user stop, now. dialog.cancel.removeAttribute( "disabled" ); } // Get current time. var now = ( new Date() ).getTime(); // If interval hasn't elapsed, ignore it. if ( now - lastUpdate < interval && eval(bytes) < eval(max) ) { return; } // Update this time. lastUpdate = now; // Update download rate. elapsed = now - startTime; var rate; // bytes/sec if ( elapsed ) { rate = ( bytes * 1000 ) / elapsed; } else { rate = 0; } // Calculate percentage. var percent = Math.round( (bytes*100)/max ); // Advance progress meter. dialog.progress.setAttribute( "value", percent ); // Check if download complete. if ( !completed ) { // Update status (nnn of mmm) var status = "( "; status += Math.round( bytes/1024 ); status += "K of "; status += Math.round( max/1024 ); status += "K bytes "; if ( rate ) { status += "at "; status += Math.round( (rate*10)/1024 ) / 10; status += "K bytes/sec )"; } else { status += ")"; } // Update status msg. onStatus( status ); } // Update percentage label on progress meter. dialog.progressPercent.childNodes[0].nodeValue = percent + "%"; if ( !completed ) { // Update time remaining. if ( rate ) { var rem = Math.round( ( max - bytes ) / rate ); // In seconds. dialog.timeLeft.childNodes[0].nodeValue = formatSeconds( rem ); } } else { // Clear time remaining field. dialog.timeLeft.childNodes[0].nodeValue = ""; }} |
|
if ( now - lastUpdate < interval && eval(bytes) < eval(max) ) { | if ( now - lastUpdate < interval && max != "-1" && eval(bytes) < eval(max) ) { | function onProgress( bytes, max ) { // Check for first time. if ( !started ) { // Initialize download start time. started = true; startTime = ( new Date() ).getTime(); // Let the user stop, now. dialog.cancel.removeAttribute( "disabled" ); } // Get current time. var now = ( new Date() ).getTime(); // If interval hasn't elapsed, ignore it. if ( now - lastUpdate < interval && eval(bytes) < eval(max) ) { return; } // Update this time. lastUpdate = now; // Update download rate. elapsed = now - startTime; var rate; // bytes/sec if ( elapsed ) { rate = ( bytes * 1000 ) / elapsed; } else { rate = 0; } // Calculate percentage. var percent = Math.round( (bytes*100)/max ); // Advance progress meter. dialog.progress.setAttribute( "value", percent ); // Check if download complete. if ( !completed ) { // Update status (nnn of mmm) var status = "( "; status += Math.round( bytes/1024 ); status += "K of "; status += Math.round( max/1024 ); status += "K bytes "; if ( rate ) { status += "at "; status += Math.round( (rate*10)/1024 ) / 10; status += "K bytes/sec )"; } else { status += ")"; } // Update status msg. onStatus( status ); } // Update percentage label on progress meter. dialog.progressPercent.childNodes[0].nodeValue = percent + "%"; if ( !completed ) { // Update time remaining. if ( rate ) { var rem = Math.round( ( max - bytes ) / rate ); // In seconds. dialog.timeLeft.childNodes[0].nodeValue = formatSeconds( rem ); } } else { // Clear time remaining field. dialog.timeLeft.childNodes[0].nodeValue = ""; }} |
var percent = Math.round( (bytes*100)/max ); | var percent; if ( max != "-1" ) { percent = Math.round( (bytes*100)/max ); | function onProgress( bytes, max ) { // Check for first time. if ( !started ) { // Initialize download start time. started = true; startTime = ( new Date() ).getTime(); // Let the user stop, now. dialog.cancel.removeAttribute( "disabled" ); } // Get current time. var now = ( new Date() ).getTime(); // If interval hasn't elapsed, ignore it. if ( now - lastUpdate < interval && eval(bytes) < eval(max) ) { return; } // Update this time. lastUpdate = now; // Update download rate. elapsed = now - startTime; var rate; // bytes/sec if ( elapsed ) { rate = ( bytes * 1000 ) / elapsed; } else { rate = 0; } // Calculate percentage. var percent = Math.round( (bytes*100)/max ); // Advance progress meter. dialog.progress.setAttribute( "value", percent ); // Check if download complete. if ( !completed ) { // Update status (nnn of mmm) var status = "( "; status += Math.round( bytes/1024 ); status += "K of "; status += Math.round( max/1024 ); status += "K bytes "; if ( rate ) { status += "at "; status += Math.round( (rate*10)/1024 ) / 10; status += "K bytes/sec )"; } else { status += ")"; } // Update status msg. onStatus( status ); } // Update percentage label on progress meter. dialog.progressPercent.childNodes[0].nodeValue = percent + "%"; if ( !completed ) { // Update time remaining. if ( rate ) { var rem = Math.round( ( max - bytes ) / rate ); // In seconds. dialog.timeLeft.childNodes[0].nodeValue = formatSeconds( rem ); } } else { // Clear time remaining field. dialog.timeLeft.childNodes[0].nodeValue = ""; }} |
dialog.progress.setAttribute( "value", percent ); | dialog.progress.setAttribute( "value", percent ); } else { percent = "??"; dialog.progress.setAttribute( "mode", "undetermined" ); } | function onProgress( bytes, max ) { // Check for first time. if ( !started ) { // Initialize download start time. started = true; startTime = ( new Date() ).getTime(); // Let the user stop, now. dialog.cancel.removeAttribute( "disabled" ); } // Get current time. var now = ( new Date() ).getTime(); // If interval hasn't elapsed, ignore it. if ( now - lastUpdate < interval && eval(bytes) < eval(max) ) { return; } // Update this time. lastUpdate = now; // Update download rate. elapsed = now - startTime; var rate; // bytes/sec if ( elapsed ) { rate = ( bytes * 1000 ) / elapsed; } else { rate = 0; } // Calculate percentage. var percent = Math.round( (bytes*100)/max ); // Advance progress meter. dialog.progress.setAttribute( "value", percent ); // Check if download complete. if ( !completed ) { // Update status (nnn of mmm) var status = "( "; status += Math.round( bytes/1024 ); status += "K of "; status += Math.round( max/1024 ); status += "K bytes "; if ( rate ) { status += "at "; status += Math.round( (rate*10)/1024 ) / 10; status += "K bytes/sec )"; } else { status += ")"; } // Update status msg. onStatus( status ); } // Update percentage label on progress meter. dialog.progressPercent.childNodes[0].nodeValue = percent + "%"; if ( !completed ) { // Update time remaining. if ( rate ) { var rem = Math.round( ( max - bytes ) / rate ); // In seconds. dialog.timeLeft.childNodes[0].nodeValue = formatSeconds( rem ); } } else { // Clear time remaining field. dialog.timeLeft.childNodes[0].nodeValue = ""; }} |
status += Math.round( max/1024 ); status += "K bytes "; | if ( max != "-1" ) { status += Math.round( max/1024 ); status += "K bytes "; } else { status += "??.?K bytes "; } | function onProgress( bytes, max ) { // Check for first time. if ( !started ) { // Initialize download start time. started = true; startTime = ( new Date() ).getTime(); // Let the user stop, now. dialog.cancel.removeAttribute( "disabled" ); } // Get current time. var now = ( new Date() ).getTime(); // If interval hasn't elapsed, ignore it. if ( now - lastUpdate < interval && eval(bytes) < eval(max) ) { return; } // Update this time. lastUpdate = now; // Update download rate. elapsed = now - startTime; var rate; // bytes/sec if ( elapsed ) { rate = ( bytes * 1000 ) / elapsed; } else { rate = 0; } // Calculate percentage. var percent = Math.round( (bytes*100)/max ); // Advance progress meter. dialog.progress.setAttribute( "value", percent ); // Check if download complete. if ( !completed ) { // Update status (nnn of mmm) var status = "( "; status += Math.round( bytes/1024 ); status += "K of "; status += Math.round( max/1024 ); status += "K bytes "; if ( rate ) { status += "at "; status += Math.round( (rate*10)/1024 ) / 10; status += "K bytes/sec )"; } else { status += ")"; } // Update status msg. onStatus( status ); } // Update percentage label on progress meter. dialog.progressPercent.childNodes[0].nodeValue = percent + "%"; if ( !completed ) { // Update time remaining. if ( rate ) { var rem = Math.round( ( max - bytes ) / rate ); // In seconds. dialog.timeLeft.childNodes[0].nodeValue = formatSeconds( rem ); } } else { // Clear time remaining field. dialog.timeLeft.childNodes[0].nodeValue = ""; }} |
if ( rate ) { | if ( rate && max != "-1" ) { | function onProgress( bytes, max ) { // Check for first time. if ( !started ) { // Initialize download start time. started = true; startTime = ( new Date() ).getTime(); // Let the user stop, now. dialog.cancel.removeAttribute( "disabled" ); } // Get current time. var now = ( new Date() ).getTime(); // If interval hasn't elapsed, ignore it. if ( now - lastUpdate < interval && eval(bytes) < eval(max) ) { return; } // Update this time. lastUpdate = now; // Update download rate. elapsed = now - startTime; var rate; // bytes/sec if ( elapsed ) { rate = ( bytes * 1000 ) / elapsed; } else { rate = 0; } // Calculate percentage. var percent = Math.round( (bytes*100)/max ); // Advance progress meter. dialog.progress.setAttribute( "value", percent ); // Check if download complete. if ( !completed ) { // Update status (nnn of mmm) var status = "( "; status += Math.round( bytes/1024 ); status += "K of "; status += Math.round( max/1024 ); status += "K bytes "; if ( rate ) { status += "at "; status += Math.round( (rate*10)/1024 ) / 10; status += "K bytes/sec )"; } else { status += ")"; } // Update status msg. onStatus( status ); } // Update percentage label on progress meter. dialog.progressPercent.childNodes[0].nodeValue = percent + "%"; if ( !completed ) { // Update time remaining. if ( rate ) { var rem = Math.round( ( max - bytes ) / rate ); // In seconds. dialog.timeLeft.childNodes[0].nodeValue = formatSeconds( rem ); } } else { // Clear time remaining field. dialog.timeLeft.childNodes[0].nodeValue = ""; }} |
} else { dialog.timeLeft.childNodes[0].nodeValue = "??:??:??"; | function onProgress( bytes, max ) { // Check for first time. if ( !started ) { // Initialize download start time. started = true; startTime = ( new Date() ).getTime(); // Let the user stop, now. dialog.cancel.removeAttribute( "disabled" ); } // Get current time. var now = ( new Date() ).getTime(); // If interval hasn't elapsed, ignore it. if ( now - lastUpdate < interval && eval(bytes) < eval(max) ) { return; } // Update this time. lastUpdate = now; // Update download rate. elapsed = now - startTime; var rate; // bytes/sec if ( elapsed ) { rate = ( bytes * 1000 ) / elapsed; } else { rate = 0; } // Calculate percentage. var percent = Math.round( (bytes*100)/max ); // Advance progress meter. dialog.progress.setAttribute( "value", percent ); // Check if download complete. if ( !completed ) { // Update status (nnn of mmm) var status = "( "; status += Math.round( bytes/1024 ); status += "K of "; status += Math.round( max/1024 ); status += "K bytes "; if ( rate ) { status += "at "; status += Math.round( (rate*10)/1024 ) / 10; status += "K bytes/sec )"; } else { status += ")"; } // Update status msg. onStatus( status ); } // Update percentage label on progress meter. dialog.progressPercent.childNodes[0].nodeValue = percent + "%"; if ( !completed ) { // Update time remaining. if ( rate ) { var rem = Math.round( ( max - bytes ) / rate ); // In seconds. dialog.timeLeft.childNodes[0].nodeValue = formatSeconds( rem ); } } else { // Clear time remaining field. dialog.timeLeft.childNodes[0].nodeValue = ""; }} |
|
xulBrowserWin.setStatus(msg); defaultStatus = msg; | defaultStatus = msg; UpdateStatusField(); window.XULBrowserWindow.setDefaultStatus(msg); | function onProgress() { var throbber = document.getElementById("Browser:Throbber"); var meter = document.getElementById("Browser:LoadingProgress"); if ( throbber && meter ) { var busy = throbber.getAttribute("busy"); var wasBusy = meter.getAttribute("mode") == "undetermined" ? "true" : "false"; if ( busy == "true" ) { if ( wasBusy == "false" ) { // Remember when loading commenced. startTime = (new Date()).getTime(); // Turn progress meter on. meter.setAttribute("mode","undetermined"); } // Update status bar. } else if ( busy == "false" && wasBusy == "true" ) { // Record page loading time. var elapsed = ( (new Date()).getTime() - startTime ) / 1000; var msg = bundle.GetStringFromName("nv_done") + " (" + elapsed + " secs)"; dump( msg + "\n" ); xulBrowserWin.setStatus(msg); defaultStatus = msg; // Turn progress meter off. meter.setAttribute("mode","normal"); } } } |
var aDownloadID = aDownload.target.persistentDescriptor; | var aDownloadID = aDownload.target.path; | onProgressChange: function(aWebProgress, aRequest, aCurSelfProgress, aMaxSelfProgress, aCurTotalProgress, aMaxTotalProgress, aDownload) { var overallProgress = aCurTotalProgress; // Get current time. var now = (new Date()).getTime(); // If interval hasn't elapsed, ignore it. if (now - this.lastUpdate < interval && aMaxTotalProgress != "-1" && parseInt(aCurTotalProgress) < parseInt(aMaxTotalProgress)) { return; } // Update this time. this.lastUpdate = now; // Update download rate. this.elapsed = now - (aDownload.startTime / 1000); var rate; // aCurTotalProgress/sec if (this.elapsed) rate = (aCurTotalProgress * 1000) / this.elapsed; else rate = 0; var aDownloadID = aDownload.target.persistentDescriptor; var download = this.doc.getElementById(aDownloadID); // Calculate percentage. var percent; if (aMaxTotalProgress > 0) { percent = Math.floor((overallProgress*100.0)/aMaxTotalProgress); if (percent > 100) percent = 100; // Advance progress meter. if (download) { download.setAttribute("progress", percent); download.setAttribute("progressmode", "normal"); onUpdateProgress(); } } else { percent = -1; // Progress meter should be barber-pole in this case. download.setAttribute("progressmode", "undetermined"); } // Now that we've set the progress and the time, update the UI with // all the the pertinent information (bytes transferred, bytes total, // download rate, time remaining). var status = this._statusFormat; // Insert the progress so far using the formatting routine. var KBProgress = parseInt(overallProgress/1024 + .5); var KBTotal = parseInt(aMaxTotalProgress/1024 + .5); var kbProgress = this._formatKBytes(KBProgress, KBTotal); status = this._replaceInsert(status, 1, kbProgress); if (download) download.setAttribute("status-internal", kbProgress); if (rate) { // rate is bytes/sec var kRate = rate / 1024; // K bytes/sec; kRate = parseInt( kRate * 10 + .5 ); // xxx (3 digits) // Don't update too often! if (kRate != this.priorRate) { if (this.rateChanges++ == this.rateChangeLimit) { // Time to update download rate. this.priorRate = kRate; this.rateChanges = 0; } else { // Stick with old rate for a bit longer. kRate = this.priorRate; } } else this.rateChanges = 0; var fraction = kRate % 10; kRate = parseInt((kRate - fraction) / 10); // Insert 3 is the download rate (in kilobytes/sec). status = this._replaceInsert(status, 2, kRate + "." + fraction); } else status = this._replaceInsert(status, 2, "??.?"); // Update time remaining. if (rate && (aMaxTotalProgress > 0)) { var rem = (aMaxTotalProgress - aCurTotalProgress) / rate; rem = parseInt(rem + .5); status = this._replaceInsert(status, 3, this._formatSeconds(rem, this.doc)); } else status = this._replaceInsert(status, 3, "???"); if (download) download.setAttribute("status", status); }, |
document.getElementById("statusbar-text").label= "dbg:onProgressChange " + aCurTotalProgress + " " + aMaxTotalProgress; | onProgressChange : function(aWebProgress, aRequest, aCurSelfProgress, aMaxSelfProgress, aCurTotalProgress, aMaxTotalProgress) { var percentage = parseInt((aCurTotalProgress/aMaxTotalProgress)*parseInt(gURLBarBoxObject.width)); if(percentage<0) percentage=10; document.getElementById("urlbar").inputField.style.backgroundPosition=percentage+"px 100%"; }, |
|
this._disablePhishingProtection(); | this._disableOnloadPhishChecks(); | onProviderChanged: function () { if (!this._userAgreedToPhishingEULA()) { this._disablePhishingProtection(); } }, |
newItem.id, newItem); | aItem.id, aItem); | function onPutComplete(aStatusCode, aResource, aOperation, aClosure) { // 201 = HTTP "Created" // if (aStatusCode == 201) { debug("Item added successfully\n"); var retVal = Components.results.NS_OK; } else if (aStatusCode == 200) { // XXXdmose once we get etag stuff working, this should // debug("200 received from clients, until we have etags working" + " this probably means a collision; after that it'll" + " mean server malfunction/n"); retVal = Components.results.NS_ERROR_FAILURE; } else { if (aStatusCode > 999) { aStatusCode = "0x" + aStatusCode.toString(16); } // XXX real error handling debug("Error adding item: " + aStatusCode + "\n"); retVal = Components.results.NS_ERROR_FAILURE; } // notify the listener if (aListener) { try { aListener.onOperationComplete(thisCalendar, retVal, aListener.ADD, newItem.id, newItem); } catch (ex) { debug("addItem's onOperationComplete threw an exception " + ex + "; ignoring\n"); } } // notify observers if (Components.isSuccessCode(retVal)) { thisCalendar.observeAddItem(newItem); } } |
thisCalendar.observeAddItem(newItem); | thisCalendar.observeAddItem(aItem); | function onPutComplete(aStatusCode, aResource, aOperation, aClosure) { // 201 = HTTP "Created" // if (aStatusCode == 201) { debug("Item added successfully\n"); var retVal = Components.results.NS_OK; } else if (aStatusCode == 200) { // XXXdmose once we get etag stuff working, this should // debug("200 received from clients, until we have etags working" + " this probably means a collision; after that it'll" + " mean server malfunction/n"); retVal = Components.results.NS_ERROR_FAILURE; } else { if (aStatusCode > 999) { aStatusCode = "0x" + aStatusCode.toString(16); } // XXX real error handling debug("Error adding item: " + aStatusCode + "\n"); retVal = Components.results.NS_ERROR_FAILURE; } // notify the listener if (aListener) { try { aListener.onOperationComplete(thisCalendar, retVal, aListener.ADD, newItem.id, newItem); } catch (ex) { debug("addItem's onOperationComplete threw an exception " + ex + "; ignoring\n"); } } // notify observers if (Components.isSuccessCode(retVal)) { thisCalendar.observeAddItem(newItem); } } |
document.getElementById("startupPage").value != gData.navigatorData["startupPage"].originalValue; | gData.navigatorData["startupPage"].value != gData.navigatorData["startupPage"].originalValue; | function onRadioCheck(event){ gData.navigatorData["startupPage"].changed = document.getElementById("startupPage").value != gData.navigatorData["startupPage"].originalValue;} |
if ( xml.readyState == 4 ) { if ( jQuery.httpSuccess( xml ) ) { if ( success ) success( xml ); | if ( xml.readyState == 4 ) { if ( jQuery.httpSuccess( xml ) ) { | xml.onreadystatechange = function(){ // The transfer is complete and the data is available if ( xml.readyState == 4 ) { // Make sure that the request was successful if ( jQuery.httpSuccess( xml ) ) { // If a local callback was specified, fire it if ( success ) success( xml ); // Fire the global callback jQuery.event.trigger( "ajaxSuccess" ); // Otherwise, the request was not successful } else { // If a local callback was specified, fire it if ( error ) error( xml ); // Fire the global callback jQuery.event.trigger( "ajaxError" ); } // The request was completed jQuery.event.trigger( "ajaxComplete" ); // Handle the global AJAX counter if ( ! --jQuery.ajax.active ) jQuery.event.trigger( "ajaxStop" ); // Process result if ( ret ) ret(xml); } }; |
jQuery.event.trigger( "ajaxSuccess" ); } else { if ( error ) error( xml ); | if ( success ) success( xml ); jQuery.event.trigger( "ajaxSuccess" ); | xml.onreadystatechange = function(){ // The transfer is complete and the data is available if ( xml.readyState == 4 ) { // Make sure that the request was successful if ( jQuery.httpSuccess( xml ) ) { // If a local callback was specified, fire it if ( success ) success( xml ); // Fire the global callback jQuery.event.trigger( "ajaxSuccess" ); // Otherwise, the request was not successful } else { // If a local callback was specified, fire it if ( error ) error( xml ); // Fire the global callback jQuery.event.trigger( "ajaxError" ); } // The request was completed jQuery.event.trigger( "ajaxComplete" ); // Handle the global AJAX counter if ( ! --jQuery.ajax.active ) jQuery.event.trigger( "ajaxStop" ); // Process result if ( ret ) ret(xml); } }; |
jQuery.event.trigger( "ajaxError" ); | } else { if ( error ) error( xml ); jQuery.event.trigger( "ajaxError" ); } jQuery.event.trigger( "ajaxComplete" ); if ( ! --jQuery.active ) jQuery.event.trigger( "ajaxStop" ); if ( ret ) ret(xml); | xml.onreadystatechange = function(){ // The transfer is complete and the data is available if ( xml.readyState == 4 ) { // Make sure that the request was successful if ( jQuery.httpSuccess( xml ) ) { // If a local callback was specified, fire it if ( success ) success( xml ); // Fire the global callback jQuery.event.trigger( "ajaxSuccess" ); // Otherwise, the request was not successful } else { // If a local callback was specified, fire it if ( error ) error( xml ); // Fire the global callback jQuery.event.trigger( "ajaxError" ); } // The request was completed jQuery.event.trigger( "ajaxComplete" ); // Handle the global AJAX counter if ( ! --jQuery.ajax.active ) jQuery.event.trigger( "ajaxStop" ); // Process result if ( ret ) ret(xml); } }; |
jQuery.event.trigger( "ajaxComplete" ); if ( ! --jQuery.ajax.active ) jQuery.event.trigger( "ajaxStop" ); if ( ret ) ret(xml); | xml.onreadystatechange = function(){ // The transfer is complete and the data is available if ( xml.readyState == 4 ) { // Make sure that the request was successful if ( jQuery.httpSuccess( xml ) ) { // If a local callback was specified, fire it if ( success ) success( xml ); // Fire the global callback jQuery.event.trigger( "ajaxSuccess" ); // Otherwise, the request was not successful } else { // If a local callback was specified, fire it if ( error ) error( xml ); // Fire the global callback jQuery.event.trigger( "ajaxError" ); } // The request was completed jQuery.event.trigger( "ajaxComplete" ); // Handle the global AJAX counter if ( ! --jQuery.ajax.active ) jQuery.event.trigger( "ajaxStop" ); // Process result if ( ret ) ret(xml); } }; |
|
}; | xml.onreadystatechange = function(){ // The transfer is complete and the data is available if ( xml.readyState == 4 ) { // Make sure that the request was successful if ( jQuery.httpSuccess( xml ) ) { // If a local callback was specified, fire it if ( success ) success( xml ); // Fire the global callback jQuery.event.trigger( "ajaxSuccess" ); // Otherwise, the request was not successful } else { // If a local callback was specified, fire it if ( error ) error( xml ); // Fire the global callback jQuery.event.trigger( "ajaxError" ); } // The request was completed jQuery.event.trigger( "ajaxComplete" ); // Handle the global AJAX counter if ( ! --jQuery.ajax.active ) jQuery.event.trigger( "ajaxStop" ); // Process result if ( ret ) ret(xml); } }; |
|
if ( this.readyState == 'complete' ) | if ( this.readyState == "complete" ) | script.onreadystatechange = function() { if ( this.readyState == 'complete' ) $.ready(); }; |
call.req.onreadystatechange = function() { dwrStateChange(call); }; | call.req.onreadystatechange = function() { DWREngine.stateChange(call); }; | call.req.onreadystatechange = function() { dwrStateChange(call); }; |
$.xmlActive++; | $.ajax.active++; | xml.onreadystatechange = function(){ // Socket is openend if ( xml.readyState == 1 ) { // Increase counter $.xmlActive++; // Show loader if needed if ( $.xmlActive >= 1 && $.xmlCreate ) $.event.trigger( 'ajaxStart' ); } // Socket is closed and data is available if ( xml.readyState == 4 ) { // Decrease counter $.xmlActive--; // Hide loader if needed if ( $.xmlActive <= 0 && $.xmlDestroy ) { $.event.trigger( 'ajaxComplete' ); $.xmlActive = 0 } // Make sure that the request was successful if ( $.httpSuccess( xml ) ) { // If a local callback was specified, fire it if ( success ) success( xml ); // Fire the global callback $.event.trigger( 'ajaxSuccess' ); // Otherwise, the request was not successful } else { // If a local callback was specified, fire it if ( error ) error( xml ); // Fire the global callback $.event.trigger( 'ajaxError' ); } // Process result if ( ret ) ret(xml); } }; |
if ( $.xmlActive >= 1 && $.xmlCreate ) $.event.trigger( 'ajaxStart' ); | $.event.trigger( "ajaxStart" ); | xml.onreadystatechange = function(){ // Socket is openend if ( xml.readyState == 1 ) { // Increase counter $.xmlActive++; // Show loader if needed if ( $.xmlActive >= 1 && $.xmlCreate ) $.event.trigger( 'ajaxStart' ); } // Socket is closed and data is available if ( xml.readyState == 4 ) { // Decrease counter $.xmlActive--; // Hide loader if needed if ( $.xmlActive <= 0 && $.xmlDestroy ) { $.event.trigger( 'ajaxComplete' ); $.xmlActive = 0 } // Make sure that the request was successful if ( $.httpSuccess( xml ) ) { // If a local callback was specified, fire it if ( success ) success( xml ); // Fire the global callback $.event.trigger( 'ajaxSuccess' ); // Otherwise, the request was not successful } else { // If a local callback was specified, fire it if ( error ) error( xml ); // Fire the global callback $.event.trigger( 'ajaxError' ); } // Process result if ( ret ) ret(xml); } }; |
$.xmlActive--; | xml.onreadystatechange = function(){ // Socket is openend if ( xml.readyState == 1 ) { // Increase counter $.xmlActive++; // Show loader if needed if ( $.xmlActive >= 1 && $.xmlCreate ) $.event.trigger( 'ajaxStart' ); } // Socket is closed and data is available if ( xml.readyState == 4 ) { // Decrease counter $.xmlActive--; // Hide loader if needed if ( $.xmlActive <= 0 && $.xmlDestroy ) { $.event.trigger( 'ajaxComplete' ); $.xmlActive = 0 } // Make sure that the request was successful if ( $.httpSuccess( xml ) ) { // If a local callback was specified, fire it if ( success ) success( xml ); // Fire the global callback $.event.trigger( 'ajaxSuccess' ); // Otherwise, the request was not successful } else { // If a local callback was specified, fire it if ( error ) error( xml ); // Fire the global callback $.event.trigger( 'ajaxError' ); } // Process result if ( ret ) ret(xml); } }; |
|
if ( $.xmlActive <= 0 && $.xmlDestroy ) { $.event.trigger( 'ajaxComplete' ); $.xmlActive = 0 | if ( ! --$.ajax.active ) { $.event.trigger( "ajaxComplete" ); $.ajax.active = 0 | xml.onreadystatechange = function(){ // Socket is openend if ( xml.readyState == 1 ) { // Increase counter $.xmlActive++; // Show loader if needed if ( $.xmlActive >= 1 && $.xmlCreate ) $.event.trigger( 'ajaxStart' ); } // Socket is closed and data is available if ( xml.readyState == 4 ) { // Decrease counter $.xmlActive--; // Hide loader if needed if ( $.xmlActive <= 0 && $.xmlDestroy ) { $.event.trigger( 'ajaxComplete' ); $.xmlActive = 0 } // Make sure that the request was successful if ( $.httpSuccess( xml ) ) { // If a local callback was specified, fire it if ( success ) success( xml ); // Fire the global callback $.event.trigger( 'ajaxSuccess' ); // Otherwise, the request was not successful } else { // If a local callback was specified, fire it if ( error ) error( xml ); // Fire the global callback $.event.trigger( 'ajaxError' ); } // Process result if ( ret ) ret(xml); } }; |
$.event.trigger( 'ajaxSuccess' ); | $.event.trigger( "ajaxSuccess" ); | xml.onreadystatechange = function(){ // Socket is openend if ( xml.readyState == 1 ) { // Increase counter $.xmlActive++; // Show loader if needed if ( $.xmlActive >= 1 && $.xmlCreate ) $.event.trigger( 'ajaxStart' ); } // Socket is closed and data is available if ( xml.readyState == 4 ) { // Decrease counter $.xmlActive--; // Hide loader if needed if ( $.xmlActive <= 0 && $.xmlDestroy ) { $.event.trigger( 'ajaxComplete' ); $.xmlActive = 0 } // Make sure that the request was successful if ( $.httpSuccess( xml ) ) { // If a local callback was specified, fire it if ( success ) success( xml ); // Fire the global callback $.event.trigger( 'ajaxSuccess' ); // Otherwise, the request was not successful } else { // If a local callback was specified, fire it if ( error ) error( xml ); // Fire the global callback $.event.trigger( 'ajaxError' ); } // Process result if ( ret ) ret(xml); } }; |
$.event.trigger( 'ajaxError' ); | $.event.trigger( "ajaxError" ); | xml.onreadystatechange = function(){ // Socket is openend if ( xml.readyState == 1 ) { // Increase counter $.xmlActive++; // Show loader if needed if ( $.xmlActive >= 1 && $.xmlCreate ) $.event.trigger( 'ajaxStart' ); } // Socket is closed and data is available if ( xml.readyState == 4 ) { // Decrease counter $.xmlActive--; // Hide loader if needed if ( $.xmlActive <= 0 && $.xmlDestroy ) { $.event.trigger( 'ajaxComplete' ); $.xmlActive = 0 } // Make sure that the request was successful if ( $.httpSuccess( xml ) ) { // If a local callback was specified, fire it if ( success ) success( xml ); // Fire the global callback $.event.trigger( 'ajaxSuccess' ); // Otherwise, the request was not successful } else { // If a local callback was specified, fire it if ( error ) error( xml ); // Fire the global callback $.event.trigger( 'ajaxError' ); } // Process result if ( ret ) ret(xml); } }; |
if ( ($.xmlActive >= 1) && ($.xmlCreate) ) $.xmlCreate(); | if ( $.xmlActive >= 1 && $.xmlCreate ) $.event.trigger( 'ajaxStart' ); } if ( xml.readyState == 4 ) { $.xmlActive--; if ( $.xmlActive <= 0 && $.xmlDestroy ) { $.event.trigger( 'ajaxComplete' ); $.xmlActive = 0 | xml.onreadystatechange = function() { // Socket is openend if ( xml.readyState == 1 ) { // Increase counter $.xmlActive++; // Show loader if needed if ( ($.xmlActive >= 1) && ($.xmlCreate) ) $.xmlCreate(); } // Socket is closed and data is available if ( xml.readyState == 4 ) { // Decrease counter $.xmlActive--; // Hide loader if needed if ( ($.xmlActive <= 0) && ($.xmlDestroy) ) { $.xmlDestroy(); $.xmlActive = 0 } if ( ( xml.status && ( xml.status >= 200 && xml.status < 300 ) || xml.status == 304 ) || !xml.status && location.protocol == 'file:' ) { if ( onSuccess ) onSuccess( xml ); } else if ( onError ) { onError( xml ); } // Process result if ( ret ) ret(xml); } }; |
if ( xml.readyState == 4 ) { $.xmlActive--; | if ( $.httpSuccess( xml ) ) { if ( success ) success( xml ); $.event.trigger( 'ajaxSuccess' ); } else { if ( error ) error( xml ); $.event.trigger( 'ajaxError' ); } | xml.onreadystatechange = function() { // Socket is openend if ( xml.readyState == 1 ) { // Increase counter $.xmlActive++; // Show loader if needed if ( ($.xmlActive >= 1) && ($.xmlCreate) ) $.xmlCreate(); } // Socket is closed and data is available if ( xml.readyState == 4 ) { // Decrease counter $.xmlActive--; // Hide loader if needed if ( ($.xmlActive <= 0) && ($.xmlDestroy) ) { $.xmlDestroy(); $.xmlActive = 0 } if ( ( xml.status && ( xml.status >= 200 && xml.status < 300 ) || xml.status == 304 ) || !xml.status && location.protocol == 'file:' ) { if ( onSuccess ) onSuccess( xml ); } else if ( onError ) { onError( xml ); } // Process result if ( ret ) ret(xml); } }; |
if ( ($.xmlActive <= 0) && ($.xmlDestroy) ) { $.xmlDestroy(); $.xmlActive = 0 } if ( ( xml.status && ( xml.status >= 200 && xml.status < 300 ) || xml.status == 304 ) || !xml.status && location.protocol == 'file:' ) { if ( onSuccess ) onSuccess( xml ); } else if ( onError ) { onError( xml ); } if ( ret ) ret(xml); } }; | if ( ret ) ret(xml); } }; | xml.onreadystatechange = function() { // Socket is openend if ( xml.readyState == 1 ) { // Increase counter $.xmlActive++; // Show loader if needed if ( ($.xmlActive >= 1) && ($.xmlCreate) ) $.xmlCreate(); } // Socket is closed and data is available if ( xml.readyState == 4 ) { // Decrease counter $.xmlActive--; // Hide loader if needed if ( ($.xmlActive <= 0) && ($.xmlDestroy) ) { $.xmlDestroy(); $.xmlActive = 0 } if ( ( xml.status && ( xml.status >= 200 && xml.status < 300 ) || xml.status == 304 ) || !xml.status && location.protocol == 'file:' ) { if ( onSuccess ) onSuccess( xml ); } else if ( onError ) { onError( xml ); } // Process result if ( ret ) ret(xml); } }; |
else{if(xajax.responseErrorsForAlert.containsValue(r.status)){var errorString="Error: the server returned the following HTTP status: "+r.status;errorString+="\nReceived:\n"+r.responseText;alert(errorString);} | else{if(ArrayContainsValue(xajax.responseErrorsForAlert,r.status)){var errorString="Error: the server returned the following HTTP status: "+r.status;errorString+="\nReceived:\n"+r.responseText;alert(errorString);} | r.onreadystatechange=function(){if(r.readyState!=4)return;if(r.status==200){if(xajaxDebug)xajax.DebugMessage("Received:\n"+r.responseText);if(r.responseXML&&r.responseXML.documentElement)xajax.processResponse(r.responseXML);else{var errorString="Error: the XML response that was returned from the server is invalid.";errorString+="\nReceived:\n"+r.responseText;trimmedResponseText=r.responseText.replace(/^\s+/g,"");trimmedResponseText=trimmedResponseText.replace(/\s+$/g,"");if(trimmedResponseText!=r.responseText)errorString+="\nYou have whitespace in your response.";alert(errorString);document.body.style.cursor='default';if(xajaxStatusMessages==true)window.status='Invalid XML response error';}}else{if(xajax.responseErrorsForAlert.containsValue(r.status)){var errorString="Error: the server returned the following HTTP status: "+r.status;errorString+="\nReceived:\n"+r.responseText;alert(errorString);}document.body.style.cursor='default';if(xajaxStatusMessages==true)window.status='Invalid XML response error';}delete r;r=null;} |
$.triggerAJAX( $.httpData(xml) ); | $.xmlActive--; if ($.xmlActive <= 0) { if ($.xmlDestroy) $.xmlDestroy(); } | xml.onreadystatechange = function() { if ( xml.readyState == 4 ) { if ( ret ) ret(xml); $.triggerAJAX( $.httpData(xml) ); } }; |
batch.req.onreadystatechange = function() { DWREngine._stateChange(batch); }; | batch.req.onreadystatechange = function() { dwr.engine._stateChange(batch); }; | batch.req.onreadystatechange = function() { DWREngine._stateChange(batch); }; |
if ( this.readyState == "complete" ) jQuery.ready(); | if ( this.readyState 1= "complete" ) return; this.parentNode.removeChild( this ); jQuery.ready(); | script.onreadystatechange = function() { if ( this.readyState == "complete" ) jQuery.ready(); }; |
window.content.focus(); | onReopen: function(params) { //Reset focus to avoid undesirable visual effect when reopening the winodw var identityElement = document.getElementById("msgIdentity"); if (identityElement) identityElement.focus(); InitializeGlobalVariables(); window.content.focus(); ComposeStartup(true, params); enableEditableFields(); var event = document.createEvent('Events'); event.initEvent('compose-window-reopen', false, true); document.getElementById("msgcomposeWindow").dispatchEvent(event); } |
|
enableEditableFields(); | onReopen: function(params) { //Reset focus to avoid undesirable visual effect when reopening the winodw var identityElement = document.getElementById("msgIdentity"); if (identityElement) identityElement.focus(); InitializeGlobalVariables(); window.content.focus(); ComposeStartup(true, params); enableEditableFields(); var event = document.createEvent('Events'); event.initEvent('compose-window-reopen', false, true); document.getElementById("msgcomposeWindow").dispatchEvent(event); } |
|
dump("This is a recycled compose window!\n"); | onReopen: function(params) { dump("This is a recycled compose window!\n"); InitializeGlobalVariables(); enableEditableFields(); window.editorShell.contentWindow.focus(); ComposeStartup(true, params); } |
|
window.editorShell.contentWindow.focus(); | onReopen: function(params) { dump("This is a recycled compose window!\n"); InitializeGlobalVariables(); enableEditableFields(); window.editorShell.contentWindow.focus(); ComposeStartup(true, params); } |
|
enableEditableFields(); window.editorShell.contentWindow.focus(); | onReopen: function(params) { dump("This is a recycled compose window!\n"); InitializeGlobalVariables(); ComposeStartup(true, params); } |
|
if ( selArray[i][0].search(/\s/) == -1 || specArray[i][0].search(/\s/) == -1) | if ( /\S/.test(selArray[i][0]) || /\S/.test(specArray[i][0]) ) | function onReplace(){ if (!gEditor) return false; // Does the current selection match the find string? var selection = gEditor.selection; var selStr = selection.toString(); var specStr = gReplaceDialog.findInput.value; if (!gReplaceDialog.caseSensitive.checked) { selStr = selStr.toLowerCase(); specStr = specStr.toLowerCase(); } // Unfortunately, because of whitespace we can't just check // whether (selStr == specStr), but have to loop ourselves. // N chars of whitespace in specStr can match any M >= N in selStr. var matches = true; var specLen = specStr.length; var selLen = selStr.length; if (selLen < specLen) matches = false; else { var specArray = specStr.match(/\S+|\s+/g); var selArray = selStr.match(/\S+|\s+/g); if ( specArray.length != selArray.length) matches = false; else { for (var i=0; i<selArray.length; i++) { if (selArray[i] != specArray[i]) { if ( selArray[i][0].search(/\s/) == -1 || specArray[i][0].search(/\s/) == -1) { // lowercase \s, not a space chunk -- match fails matches = false; break; } else if ( selArray[i].length < specArray[i].length ) { // if it's a space chunk then we only care that sel be // at least as long as spec matches = false; break; } } } } } // If the current selection doesn't match the pattern, // then we want to find the next match, but not do the replace. // That's what most other apps seem to do. // So here, just return. if (!matches) return false; // Transfer dialog contents to the find service. saveFindData(); // For reverse finds, need to remember the caret position // before current selection var newRange; if (gReplaceDialog.searchBackwards.checked && selection.rangeCount > 0) { newRange = selection.getRangeAt(0).cloneRange(); newRange.collapse(true); } // nsPlaintextEditor::InsertText fails if the string is empty, // so make that a special case: var replStr = gReplaceDialog.replaceInput.value; if (replStr == "") gEditor.deleteSelection(0); else gEditor.insertText(replStr); // For reverse finds, need to move caret just before the replaced text if (gReplaceDialog.searchBackwards.checked && newRange) { gEditor.selection.removeAllRanges(); gEditor.selection.addRange(newRange); } return true;} |
document.getElementById( ThisCalendarObject.getSubject() ).childNodes[1].childNodes[0].removeAttribute( "synching" ); | var onResponse = function( CalendarData ) { //save the stream to a file. saveDataToFile( ThisCalendarObject.getAttribute( "http://home.netscape.com/NC-rdf#path" ), CalendarData, "UTF-8" ); CalendarManager.removeCalendar( ThisCalendarObject ); if( ThisCalendarObject.getAttribute( "http://home.netscape.com/NC-rdf#active" ) == "true" ) { CalendarManager.addCalendar( ThisCalendarObject.getAttribute( "http://home.netscape.com/NC-rdf#path" ) ); } refreshEventTree( getAndSetEventTable() ); refreshToDoTree( false ); CalendarManager.CalendarWindow.currentView.refreshEvents(); //document.getElementById( "calendar-list-image-"+calendarToGet.getAttribute( "http://home.netscape.com/NC-rdf#serverNumber" ) ).removeAttribute( "synching" ); } |
|
alert( "The calendar "+calendarToGet.name+" is not a valid iCalendar file." ); gCalendarWindow.calendarManager.deleteCalendar( calendarToGet ); saveDataToFile( calendarToGet.path, "", "UTF-8" ); | function onResponseAndRefresh( ){ //check to make sure this is a real calendar file first. //if its not, it causes Mozilla to crash. if( request.responseText.indexOf( "BEGIN:VCALENDAR" ) == -1 ) { alert( "The calendar "+calendarToGet.name+" is not a valid iCalendar file." ); gCalendarWindow.calendarManager.deleteCalendar( calendarToGet ); saveDataToFile( calendarToGet.path, "", "UTF-8" ); return; } //save the stream to a file. saveDataToFile( calendarToGet.path, request.responseText, "UTF-8" ); gCalendarWindow.calendarManager.removeCalendar( calendarToGet ); if( calendarToGet.active ) gCalendarWindow.calendarManager.addCalendar( calendarToGet ); refreshEventTree( false ); refreshToDoTree( false ); gCalendarWindow.currentView.refreshEvents(); document.getElementById( "calendar-list-image-"+calendarToGet.serverNumber ).removeAttribute( "synching" );} |
|
saveDataToFile( calendarToGet.path, request.responseText, "UTF-8" ); | saveDataToFile( calendarToGet.getAttribute( "http: | function onResponseAndRefresh( ){ //check to make sure this is a real calendar file first. //if its not, it causes Mozilla to crash. if( request.responseText.indexOf( "BEGIN:VCALENDAR" ) == -1 ) { alert( "The calendar "+calendarToGet.name+" is not a valid iCalendar file." ); gCalendarWindow.calendarManager.deleteCalendar( calendarToGet ); saveDataToFile( calendarToGet.path, "", "UTF-8" ); return; } //save the stream to a file. saveDataToFile( calendarToGet.path, request.responseText, "UTF-8" ); gCalendarWindow.calendarManager.removeCalendar( calendarToGet ); if( calendarToGet.active ) gCalendarWindow.calendarManager.addCalendar( calendarToGet ); refreshEventTree( false ); refreshToDoTree( false ); gCalendarWindow.currentView.refreshEvents(); document.getElementById( "calendar-list-image-"+calendarToGet.serverNumber ).removeAttribute( "synching" );} |
if( calendarToGet.active ) gCalendarWindow.calendarManager.addCalendar( calendarToGet ); | if( calendarToGet.getAttribute( "http: { gCalendarWindow.calendarManager.addCalendar( calendarToGet.getAttribute( "http: calendarToGet = null; } | function onResponseAndRefresh( ){ //check to make sure this is a real calendar file first. //if its not, it causes Mozilla to crash. if( request.responseText.indexOf( "BEGIN:VCALENDAR" ) == -1 ) { alert( "The calendar "+calendarToGet.name+" is not a valid iCalendar file." ); gCalendarWindow.calendarManager.deleteCalendar( calendarToGet ); saveDataToFile( calendarToGet.path, "", "UTF-8" ); return; } //save the stream to a file. saveDataToFile( calendarToGet.path, request.responseText, "UTF-8" ); gCalendarWindow.calendarManager.removeCalendar( calendarToGet ); if( calendarToGet.active ) gCalendarWindow.calendarManager.addCalendar( calendarToGet ); refreshEventTree( false ); refreshToDoTree( false ); gCalendarWindow.currentView.refreshEvents(); document.getElementById( "calendar-list-image-"+calendarToGet.serverNumber ).removeAttribute( "synching" );} |
document.getElementById( "calendar-list-image-"+calendarToGet.serverNumber ).removeAttribute( "synching" ); | function onResponseAndRefresh( ){ //check to make sure this is a real calendar file first. //if its not, it causes Mozilla to crash. if( request.responseText.indexOf( "BEGIN:VCALENDAR" ) == -1 ) { alert( "The calendar "+calendarToGet.name+" is not a valid iCalendar file." ); gCalendarWindow.calendarManager.deleteCalendar( calendarToGet ); saveDataToFile( calendarToGet.path, "", "UTF-8" ); return; } //save the stream to a file. saveDataToFile( calendarToGet.path, request.responseText, "UTF-8" ); gCalendarWindow.calendarManager.removeCalendar( calendarToGet ); if( calendarToGet.active ) gCalendarWindow.calendarManager.addCalendar( calendarToGet ); refreshEventTree( false ); refreshToDoTree( false ); gCalendarWindow.currentView.refreshEvents(); document.getElementById( "calendar-list-image-"+calendarToGet.serverNumber ).removeAttribute( "synching" );} |
|
viewer.pane.panelset.updateAllCommands(); | onRuleSelect: function() { var dec = this.getSelectedDec(); this.mPropsView = new StylePropsView(dec); this.mPropsBoxObject.view = this.mPropsView; }, |
|
SaveUriFromPicker("identity.junkMailFolder", "msgJunkMailFolderPicker"); | function onSave(){ SaveUriFromPicker("identity.fccFolder", "msgFccFolderPicker"); SaveUriFromPicker("identity.draftFolder", "msgDraftsFolderPicker"); SaveUriFromPicker("identity.stationeryFolder", "msgStationeryFolderPicker"); SaveUriFromPicker("identity.junkMailFolder", "msgJunkMailFolderPicker");} |
|
SaveUriFromPicker("identity.fccFolder", "msgFccFolderPicker"); SaveUriFromPicker("identity.draftFolder", "msgDraftsFolderPicker"); SaveUriFromPicker("identity.stationeryFolder", "msgStationeryFolderPicker"); | SaveFolderSettings( gFccRadioElemChoice, "doFcc", gFccFolderWithDelim, fccAccountPickerId, fccFolderPickerId, "identity.fccFolder", "identity.fccFolderPickerMode" ); SaveFolderSettings( gDraftsRadioElemChoice, "messageDrafts", gDraftsFolderWithDelim, draftsAccountPickerId, draftsFolderPickerId, "identity.draftFolder", "identity.draftsFolderPickerMode" ); SaveFolderSettings( gTmplRadioElemChoice, "messageTemplates", gTemplatesFolderWithDelim, tmplAccountPickerId, tmplFolderPickerId, "identity.stationeryFolder", "identity.tmplFolderPickerMode" ); | function onSave(){ SaveUriFromPicker("identity.fccFolder", "msgFccFolderPicker"); SaveUriFromPicker("identity.draftFolder", "msgDraftsFolderPicker"); SaveUriFromPicker("identity.stationeryFolder", "msgStationeryFolderPicker");} |
if (percentIndex > 0) { | if (width) { if (percentIndex > 0) { percent = true; widthInt = Number(width.substr(0, percentIndex)); } else { percent = false; widthInt = Number(width); } } else { | function onSaveDefault(){ // "false" means set attributes on the globalElement, // not the real element being edited if (ValidateData()) { var prefs = GetPrefs(); if (prefs) { dump("Setting HLine prefs\n"); var alignInt; if (align == "left") { alignInt = 0; } else if (align == "right") { alignInt = 2; } else { alignInt = 1; } prefs.SetIntPref("editor.hrule.align", alignInt); var percentIndex = width.search(/%/); var percent; var widthInt; if (percentIndex > 0) { percent = true; widthInt = Number(width.substr(0, percentIndex)); } else { percent = false; widthInt = Number(width); } prefs.SetIntPref("editor.hrule.width", widthInt); prefs.SetBoolPref("editor.hrule.width_percent", percent); // Convert string to number prefs.SetIntPref("editor.hrule.height", Number(height)); prefs.SetBoolPref("editor.hrule.shading", shading); // Write the prefs out NOW! prefs.SavePrefFile(); } }} |
widthInt = Number(width.substr(0, percentIndex)); } else { percent = false; widthInt = Number(width); | widthInt = Number(100); | function onSaveDefault(){ // "false" means set attributes on the globalElement, // not the real element being edited if (ValidateData()) { var prefs = GetPrefs(); if (prefs) { dump("Setting HLine prefs\n"); var alignInt; if (align == "left") { alignInt = 0; } else if (align == "right") { alignInt = 2; } else { alignInt = 1; } prefs.SetIntPref("editor.hrule.align", alignInt); var percentIndex = width.search(/%/); var percent; var widthInt; if (percentIndex > 0) { percent = true; widthInt = Number(width.substr(0, percentIndex)); } else { percent = false; widthInt = Number(width); } prefs.SetIntPref("editor.hrule.width", widthInt); prefs.SetBoolPref("editor.hrule.width_percent", percent); // Convert string to number prefs.SetIntPref("editor.hrule.height", Number(height)); prefs.SetBoolPref("editor.hrule.shading", shading); // Write the prefs out NOW! prefs.SavePrefFile(); } }} |
var percentIndex = width.search(/%/); | function onSaveDefault(){ // "false" means set attributes on the globalElement, // not the real element being edited if (ValidateData()) { var prefs = GetPrefs(); if (prefs) { var alignInt; if (align == "left") { alignInt = 0; } else if (align == "right") { alignInt = 2; } else { alignInt = 1; } prefs.setIntPref("editor.hrule.align", alignInt); var percentIndex = width.search(/%/); var percent; var widthInt; var heightInt; if (width) { if (percentIndex > 0) { percent = true; widthInt = Number(width.substr(0, percentIndex)); } else { percent = false; widthInt = Number(width); } } else { percent = true; widthInt = Number(100); } heightInt = height ? Number(height) : 2; prefs.setIntPref("editor.hrule.width", widthInt); prefs.setBoolPref("editor.hrule.width_percent", percent); prefs.setIntPref("editor.hrule.height", heightInt); prefs.setBoolPref("editor.hrule.shading", shading); // Write the prefs out NOW! var prefService = Components.classes["@mozilla.org/preferences-service;1"] .getService(Components.interfaces.nsIPrefService); prefService.savePrefFile(null); } }} |
|
if (percentIndex > 0) { | if (/%/.test(width)) { | function onSaveDefault(){ // "false" means set attributes on the globalElement, // not the real element being edited if (ValidateData()) { var prefs = GetPrefs(); if (prefs) { var alignInt; if (align == "left") { alignInt = 0; } else if (align == "right") { alignInt = 2; } else { alignInt = 1; } prefs.setIntPref("editor.hrule.align", alignInt); var percentIndex = width.search(/%/); var percent; var widthInt; var heightInt; if (width) { if (percentIndex > 0) { percent = true; widthInt = Number(width.substr(0, percentIndex)); } else { percent = false; widthInt = Number(width); } } else { percent = true; widthInt = Number(100); } heightInt = height ? Number(height) : 2; prefs.setIntPref("editor.hrule.width", widthInt); prefs.setBoolPref("editor.hrule.width_percent", percent); prefs.setIntPref("editor.hrule.height", heightInt); prefs.setBoolPref("editor.hrule.shading", shading); // Write the prefs out NOW! var prefService = Components.classes["@mozilla.org/preferences-service;1"] .getService(Components.interfaces.nsIPrefService); prefService.savePrefFile(null); } }} |
widthInt = Number(width.substr(0, percentIndex)); | widthInt = Number(RegExp.leftContext); | function onSaveDefault(){ // "false" means set attributes on the globalElement, // not the real element being edited if (ValidateData()) { var prefs = GetPrefs(); if (prefs) { var alignInt; if (align == "left") { alignInt = 0; } else if (align == "right") { alignInt = 2; } else { alignInt = 1; } prefs.setIntPref("editor.hrule.align", alignInt); var percentIndex = width.search(/%/); var percent; var widthInt; var heightInt; if (width) { if (percentIndex > 0) { percent = true; widthInt = Number(width.substr(0, percentIndex)); } else { percent = false; widthInt = Number(width); } } else { percent = true; widthInt = Number(100); } heightInt = height ? Number(height) : 2; prefs.setIntPref("editor.hrule.width", widthInt); prefs.setBoolPref("editor.hrule.width_percent", percent); prefs.setIntPref("editor.hrule.height", heightInt); prefs.setBoolPref("editor.hrule.shading", shading); // Write the prefs out NOW! var prefService = Components.classes["@mozilla.org/preferences-service;1"] .getService(Components.interfaces.nsIPrefService); prefService.savePrefFile(null); } }} |
gThreadTree.setAttribute("ref", gThreadTree.getAttribute("ref")); | function onSearch(event){ gSearchSession.clearScopes(); // tell the search session what the new scope is gSearchSession.addScopeTerm(GetScopeForFolder(gCurrentFolder), gCurrentFolder); saveSearchTerms(gSearchSession.searchTerms, gSearchSession); gSearchSession.search(msgWindow);} |
|
dump("Kicking it off with " + gThreadTree.getAttribute("ref") + "\n"); | function onSearch(event){ gSearchSession.clearScopes(); // tell the search session what the new scope is gSearchSession.addScopeTerm(GetScopeForFolder(gCurrentFolder), gCurrentFolder); // reflect the search widgets back into the search session saveSearchTerms(gSearchSession.searchTerms, gSearchSession); gSearchSession.search(msgWindow); // refresh the tree after the search starts, because initiating the // search will cause the datasource to clear itself gThreadTree.setAttribute("ref", gThreadTree.getAttribute("ref"));} |
|
viewDebug("gSearchInput = " + gSearchInput.value + "\n"); | onSearchDone: function(status) { SetQSStatusText(gDBView.QueryInterface(Components.interfaces.nsITreeView).rowCount) statusFeedback.showProgress(0); gStatusBar.setAttribute("mode","normal"); gSearchInProgress = false; viewDebug("gSearchInput = " + gSearchInput.value + "\n"); // ### TODO need to find out if there's quick search within a virtual folder. if (gCurrentVirtualFolderUri && (gSearchInput.value == "" || gSearchInput.showingSearchCriteria)) { var vFolder = GetMsgFolderFromUri(gCurrentVirtualFolderUri, false); var dbFolderInfo = vFolder.getMsgDatabase(msgWindow).dBFolderInfo; dbFolderInfo.NumUnreadMessages = gNumUnreadMessages; dbFolderInfo.NumMessages = gNumTotalMessages; vFolder.updateSummaryTotals(true); // force update from db. var msgdb = vFolder.getMsgDatabase(msgWindow); msgdb.Commit(MSG_DB_LARGE_COMMIT); // load the last used mail view for the folder... var result = dbFolderInfo.getUint32Property("current-view", 0); ViewChangeByValue(result); // now that we have finished loading a virtual folder, scroll to the correct message ScrollToMessageAfterFolderLoad(vFolder); } }, |
|
(gSearchInput.value == "" || gSearchInput.showingSearchCriteria)) | (!gSearchInput || gSearchInput.value == "" || gSearchInput.showingSearchCriteria)) | onSearchDone: function(status) { SetQSStatusText(gDBView.QueryInterface(Components.interfaces.nsITreeView).rowCount) statusFeedback.showProgress(0); gStatusBar.setAttribute("mode","normal"); gSearchInProgress = false; viewDebug("gSearchInput = " + gSearchInput.value + "\n"); // ### TODO need to find out if there's quick search within a virtual folder. if (gCurrentVirtualFolderUri && (gSearchInput.value == "" || gSearchInput.showingSearchCriteria)) { var vFolder = GetMsgFolderFromUri(gCurrentVirtualFolderUri, false); var dbFolderInfo = vFolder.getMsgDatabase(msgWindow).dBFolderInfo; dbFolderInfo.NumUnreadMessages = gNumUnreadMessages; dbFolderInfo.NumMessages = gNumTotalMessages; vFolder.updateSummaryTotals(true); // force update from db. var msgdb = vFolder.getMsgDatabase(msgWindow); msgdb.Commit(MSG_DB_LARGE_COMMIT); // load the last used mail view for the folder... var result = dbFolderInfo.getUint32Property("current-view", 0); ViewChangeByValue(result); // now that we have finished loading a virtual folder, scroll to the correct message ScrollToMessageAfterFolderLoad(vFolder); } }, |
ScrollToMessageAfterFolderLoad(vFolder); | onSearchDone: function(status) { SetQSStatusText(gDBView.QueryInterface(Components.interfaces.nsITreeView).rowCount) statusFeedback.showProgress(0); gStatusBar.setAttribute("mode","normal"); gSearchInProgress = false; viewDebug("gSearchInput = " + gSearchInput.value + "\n"); // ### TODO need to find out if there's quick search within a virtual folder. if (gCurrentVirtualFolderUri && (gSearchInput.value == "" || gSearchInput.showingSearchCriteria)) { var vFolder = GetMsgFolderFromUri(gCurrentVirtualFolderUri, false); var dbFolderInfo = vFolder.getMsgDatabase(msgWindow).dBFolderInfo; dbFolderInfo.NumUnreadMessages = gNumUnreadMessages; dbFolderInfo.NumMessages = gNumTotalMessages; vFolder.updateSummaryTotals(true); // force update from db. var msgdb = vFolder.getMsgDatabase(msgWindow); msgdb.Commit(MSG_DB_LARGE_COMMIT); } }, |
|
if (this.urlBar) this.urlBar.setAttribute("infotext", securityUI.tooltipText); | var lockIcon = document.getElementById("lock-icon"); if (lockIcon) lockIcon.setAttribute("tooltiptext", securityUI.tooltipText); | onSecurityChange : function(aWebProgress, aRequest, aState) { const wpl = Components.interfaces.nsIWebProgressListener; this.securityButton.removeAttribute("label"); switch (aState) { case wpl.STATE_IS_SECURE | wpl.STATE_SECURE_HIGH: this.securityButton.setAttribute("level", "high"); if (this.urlBar) this.urlBar.setAttribute("level", "high"); try { this.securityButton.setAttribute("label", gBrowser.contentWindow.location.host); } catch(exception) {} break; case wpl.STATE_IS_SECURE | wpl.STATE_SECURE_LOW: this.securityButton.setAttribute("level", "low"); if (this.urlBar) this.urlBar.setAttribute("level", "low"); try { this.securityButton.setAttribute("label", gBrowser.contentWindow.location.host); } catch(exception) {} break; case wpl.STATE_IS_BROKEN: this.securityButton.setAttribute("level", "broken"); if (this.urlBar) this.urlBar.setAttribute("level", "broken"); break; case wpl.STATE_IS_INSECURE: default: this.securityButton.removeAttribute("level"); if (this.urlBar) this.urlBar.removeAttribute("level"); break; } var securityUI = gBrowser.securityUI; this.securityButton.setAttribute("tooltiptext", securityUI.tooltipText); if (this.urlBar) this.urlBar.setAttribute("infotext", securityUI.tooltipText); }, |
var row = tree.currentIndex; | var row = tree.treeBoxObject.view.selection.currentIndex; | function onselect_loadURI(tree, columnName) { try { var row = tree.currentIndex; var properties = Components.classes["@mozilla.org/supports-array;1"] .createInstance(Components.interfaces.nsISupportsArray); tree.treeBoxObject.view.getCellProperties(row, columnName, properties); if (!properties) { return; } var uri = getPropertyValue(properties, "link-"); if (uri) { loadURI(uri); } } catch (e) { }// when switching between tabs a spurious row number is returned.} |
SearchTree.treeBoxObject.selection.select( -1 ); | SearchTree.treeBoxObject.selection.clearSelection(); | onSelectionChanged : function( EventSelectionArray ) { /* This no longer works since we moved to a tree */ var SearchTree = document.getElementById( "unifinder-search-results-listbox" ); SearchTree.setAttribute( "suppressonselect", "true" ); SearchTree.treeBoxObject.selection.select( -1 ); if( EventSelectionArray.length > 0 ) { for( i = 0; i < EventSelectionArray.length; i++ ) { var SearchTreeItem = document.getElementById( "search-unifinder-treeitem-"+EventSelectionArray[i].id ); if( SearchTreeItem ) { var Index = SearchTree.contentView.getIndexOfItem( SearchTreeItem ); SearchTree.treeBoxObject.ensureRowIsVisible( Index ); SearchTree.treeBoxObject.selection.select( Index ); } } } /*SearchTree.clearSelection(); if( EventSelectionArray.length > 0 ) { for( i = 0; i < EventSelectionArray.length; i++ ) { var SearchTreeItem = document.getElementById( "search-unifinder-treeitem-"+EventSelectionArray[i].id ); //you need this for when an event is added. It doesn't yet exist. if( SearchTreeItem ) SearchTree.addItemToSelection( SearchTreeItem ); } } dump( "\nAllow on select now!" ); SearchTree.removeAttribute( "suppressonselect" ); */ } |
SearchTree.treeBoxObject.selection.select( Index ); | SearchTree.treeBoxObject.selection.toggleSelect( Index ); | onSelectionChanged : function( EventSelectionArray ) { /* This no longer works since we moved to a tree */ var SearchTree = document.getElementById( "unifinder-search-results-listbox" ); SearchTree.setAttribute( "suppressonselect", "true" ); SearchTree.treeBoxObject.selection.select( -1 ); if( EventSelectionArray.length > 0 ) { for( i = 0; i < EventSelectionArray.length; i++ ) { var SearchTreeItem = document.getElementById( "search-unifinder-treeitem-"+EventSelectionArray[i].id ); if( SearchTreeItem ) { var Index = SearchTree.contentView.getIndexOfItem( SearchTreeItem ); SearchTree.treeBoxObject.ensureRowIsVisible( Index ); SearchTree.treeBoxObject.selection.select( Index ); } } } /*SearchTree.clearSelection(); if( EventSelectionArray.length > 0 ) { for( i = 0; i < EventSelectionArray.length; i++ ) { var SearchTreeItem = document.getElementById( "search-unifinder-treeitem-"+EventSelectionArray[i].id ); //you need this for when an event is added. It doesn't yet exist. if( SearchTreeItem ) SearchTree.addItemToSelection( SearchTreeItem ); } } dump( "\nAllow on select now!" ); SearchTree.removeAttribute( "suppressonselect" ); */ } |
var SearchTree = document.getElementById( UnifinderTreeName ); | onSelectionChanged : function( EventSelectionArray ) { // XXX This selection observer needs to be re written. // Problems: When selecting everything, if( gCalendarEventTreeClicked === false ) { var SearchTree = document.getElementById( UnifinderTreeName ); if( EventSelectionArray.length > 1 ) { //get all the rows for the events for( i = 0; i < EventSelectionArray.length; i++ ) { var RowToScrollTo = SearchTree.eventView.getRowOfCalendarEvent( EventSelectionArray[i] ); } //select all the rows in the tree. } else if( EventSelectionArray.length == 1 ) { SearchTree.treeBoxObject.selection.clearSelection( ); var RowToScrollTo = SearchTree.eventView.getRowOfCalendarEvent( EventSelectionArray[0] ); SearchTree.treeBoxObject.ensureRowIsVisible( RowToScrollTo ); SearchTree.treeBoxObject.selection.timedSelect( RowToScrollTo, 1 ); } } gCalendarEventTreeClicked = false; } |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.