rem
stringlengths 0
126k
| add
stringlengths 0
441k
| context
stringlengths 15
136k
|
---|---|---|
if (e.channelName[0].search(/[#&+!]/) != 0) e.channelName = "#" + e.channelName; | if (arrayIndexOf(e.server.channelTypes, e.channelName[0]) == -1) e.channelName = e.server.channelTypes[0] + e.channelName; | function cmdJoin(e){ if (!("charset" in e)) { e.charset = null; } else if (e.charset && !checkCharset(e.charset)) { display (getMsg(MSG_ERR_INVALID_CHARSET, e.charset), MT_ERROR); return null; } if (e.channelName && (e.channelName.search(",") != -1)) { // We can join multiple channels! Woo! var chan; var chans = e.channelName.split(","); var keys = []; if (e.key) keys = e.key.split(","); for (var c in chans) { chan = dispatch("join", { charset: e.charset, channelName: chans[c], key: keys.shift() }); } return chan; } if (!e.channelName) { var channel = e.channel; if (!channel) { display(getMsg(MSG_ERR_REQUIRED_PARAM, "channel"), MT_ERROR); return null; } e.channelName = channel.unicodeName; if (channel.mode.key) e.key = channel.mode.key } if (e.channelName[0].search(/[#&+!]/) != 0) e.channelName = "#" + e.channelName; var charset = e.charset ? e.charset : e.network.prefs["charset"]; e.channel = e.server.addChannel(e.channelName, charset); if (e.charset) e.channel.prefs["charset"] = e.charset; e.channel.join(e.key); /* !-channels are "safe" channels, and get a server-generated prefix. For * this reason, we shouldn't do anything client-side until the server * replies (since the reply will have the appropriate prefix). */ if (e.channelName[0] != "!") { if (!("messages" in e.channel)) { e.channel.displayHere(getMsg(MSG_CHANNEL_OPENED, e.channel.unicodeName), MT_INFO); } setCurrentObject(e.channel); } return e.channel;} |
{ var hostmask; if (e.user.host.match(/^[\d\.]*$/) != null) hostmask = e.user.host.replace(/[^.]+$/, "*"); else hostmask = e.user.host.replace(/^[^.]+/, "*"); e.server.sendData("MODE " + e.channel.encodedName + " +b *!" + e.user.name + "@" + hostmask + "\n"); } | e.sourceObject.dispatch("ban", { nickname: e.user.encodedName }); | function cmdKick(e){ if (!e.user) e.user = e.channel.getUser(e.nickname); if (!e.user) { display(getMsg(MSG_ERR_UNKNOWN_USER, e.nickname), MT_ERROR); return; } if (e.command.name == "kick-ban") { var hostmask; if (e.user.host.match(/^[\d\.]*$/) != null) hostmask = e.user.host.replace(/[^.]+$/, "*"); else hostmask = e.user.host.replace(/^[^.]+/, "*"); e.server.sendData("MODE " + e.channel.encodedName + " +b *!" + e.user.name + "@" + hostmask + "\n"); } e.user.kick(e.reason);} |
if (e.channelName[0].search(/[#&+!]/) != 0) e.channelName = "#" + e.channelName; | if (arrayIndexOf(e.server.channelTypes, e.channelName[0]) == -1) e.channelName = e.server.channelTypes[0] + e.channelName; | function cmdLeave(e){ if (!e.server) { display(MSG_ERR_IMPROPER_VIEW, MT_ERROR); return; } if (e.channelName) { if (e.channelName[0].search(/[#&+!]/) != 0) e.channelName = "#" + e.channelName; e.channelName = fromUnicode(e.channelName, e.network); var key = e.server.toLowerCase(e.channelName); if (key in e.server.channels) e.channel = e.server.channels[key]; else e.channel = null; } else { if (!e.channel) { display(MSG_ERR_IMPROPER_VIEW, MT_ERROR); return; } e.channelName = e.channel.encodedName; } /* If it's not active, we're not actually in it, even though the view is * still here. */ if (e.channel && e.channel.active) { if (e.noDelete) e.channel.noDelete = true; if (!e.reason) e.reason = ""; e.server.sendData("PART " + e.channelName + " :" + fromUnicode(e.reason, e.channel) + "\n"); } else { if (!e.noDelete && client.prefs["deleteOnPart"]) e.channel.dispatch("delete"); }} |
display("Huh?", MT_ERROR); | display(getMsg(MSG_ERR_UNKNOWN_CHANNEL, e.channelName), MT_ERROR); | function cmdLeave(e){ if (!e.server) { display(MSG_ERR_IMPROPER_VIEW, MT_ERROR); return; } // FIXME: Smart param handling... // if (e.channelName) { if (arrayIndexOf(e.server.channelTypes, e.channelName[0]) == -1) { // No valid prefix character. Check they really meant a channel... var valid = false; for (var i = 0; i < e.server.channelTypes.length; i++) { // Hmm, not ideal... var chan = e.server.getChannel(e.server.channelTypes[i] + e.channelName); if (chan) { // Yes! They just missed that single character. e.channel = chan; valid = true; break; } } // We can only let them get away here if we've got a channel. if (!valid) { if (e.channel) { e.reason = e.channelName + " " + e.reason; } else { display("Huh?", MT_ERROR); return; } } } else { // Valid prefix, so get real channel (if it exists...). e.channel = e.server.getChannel(e.channelName); } } /* If it's not active, we're not actually in it, even though the view is * still here. */ if (e.channel && e.channel.active) { if (e.noDelete) e.channel.noDelete = true; if (!e.reason) e.reason = ""; e.server.sendData("PART " + e.channel.encodedName + " :" + fromUnicode(e.reason, e.channel) + "\n"); } else { if (!e.noDelete && client.prefs["deleteOnPart"]) e.channel.dispatch("delete"); }} |
if (e.channel && e.channel.active) | if (e.channel.active) | function cmdLeave(e){ if (!e.server) { display(MSG_ERR_IMPROPER_VIEW, MT_ERROR); return; } // FIXME: Smart param handling... // if (e.channelName) { if (arrayIndexOf(e.server.channelTypes, e.channelName[0]) == -1) { // No valid prefix character. Check they really meant a channel... var valid = false; for (var i = 0; i < e.server.channelTypes.length; i++) { // Hmm, not ideal... var chan = e.server.getChannel(e.server.channelTypes[i] + e.channelName); if (chan) { // Yes! They just missed that single character. e.channel = chan; valid = true; break; } } // We can only let them get away here if we've got a channel. if (!valid) { if (e.channel) { e.reason = e.channelName + " " + e.reason; } else { display("Huh?", MT_ERROR); return; } } } else { // Valid prefix, so get real channel (if it exists...). e.channel = e.server.getChannel(e.channelName); } } /* If it's not active, we're not actually in it, even though the view is * still here. */ if (e.channel && e.channel.active) { if (e.noDelete) e.channel.noDelete = true; if (!e.reason) e.reason = ""; e.server.sendData("PART " + e.channel.encodedName + " :" + fromUnicode(e.reason, e.channel) + "\n"); } else { if (!e.noDelete && client.prefs["deleteOnPart"]) e.channel.dispatch("delete"); }} |
if ("disablePlugin" in plugin.scope) | if ((plugin.API > 0) || ("disablePlugin" in plugin.scope)) | function cmdListPlugins(e){ function listPlugin(plugin, i) { var enabled; if ("disablePlugin" in plugin.scope) enabled = plugin.enabled; else enabled = MSG_ALWAYS; display(getMsg(MSG_FMT_PLUGIN1, [i, plugin.url])); display(getMsg(MSG_FMT_PLUGIN2, [plugin.id, plugin.version, enabled, plugin.status])); display(getMsg(MSG_FMT_PLUGIN3, plugin.description)); } if (e.plugin) { listPlugin(e.plugin, 0); return; } if (client.plugins.length > 0) { for (var i = 0; i < client.plugins.length; ++i) listPlugin(client.plugins[i], i); } else { display(MSG_NO_PLUGINS); }} |
for (var i = 0; i < client.plugins.length; ++i) listPlugin(client.plugins[i], i); | if (client.plugins.length > 0) { for (var i = 0; i < client.plugins.length; ++i) listPlugin(client.plugins[i], i); } else { display(MSG_NO_PLUGINS); } | function cmdListPlugins(e){ function listPlugin(plugin, i) { var enabled; if ("disablePlugin" in plugin.scope) enabled = plugin.enabled; else enabled = MSG_ALWAYS; display(getMsg(MSG_FMT_PLUGIN1, [i, plugin.url])); display(getMsg(MSG_FMT_PLUGIN2, [plugin.id, plugin.version, enabled, plugin.status])); display(getMsg(MSG_FMT_PLUGIN3, plugin.description)); } if (e.plugin) { listPlugin(e.plugin, 0); return; } for (var i = 0; i < client.plugins.length; ++i) listPlugin(client.plugins[i], i);} |
description: "", status: MSG_LOADING, enabled: true}; | description: "", status: MSG_LOADING, enabled: false, PluginAPI: 1, cwd: e.url.match(/^(.*?)[^\/]+$/)[1]}; | function cmdLoad (e){ var ex; if (!e.scope) e.scope = new Object(); if (!("plugin" in e.scope)) { e.scope.plugin = { url: e.url, id: MSG_UNKNOWN, version: -1, description: "", status: MSG_LOADING, enabled: true}; } e.scope.plugin.scope = e.scope; try { var rvStr; var rv = rvStr = client.load(e.url, e.scope); if ("initPlugin" in e.scope) rv = rvStr = e.scope.initPlugin(e.scope); /* do this again, in case the plugin trashed it */ if (!("plugin" in e.scope)) { e.scope.plugin = { url: e.url, id: MSG_UNKNOWN, version: -1, description: "", status: MSG_ERROR, enabled: true }; } else { e.scope.plugin.status = "loaded"; } e.scope.plugin.scope = e.scope; if (typeof rv == "function") rvStr = "function"; if (!("__id" in e.scope)) e.scope.__id = null; if (!("__description" in e.scope)) e.scope.__description = null; var i = getPluginIndexByURL(e.url); if (i != -1) client.plugins[i] = e.scope.plugin; else client.plugins.push(e.scope.plugin); feedback(e, getMsg(MSG_SUBSCRIPT_LOADED, [e.url, rvStr]), MT_INFO); return rv; } catch (ex) { display (getMsg(MSG_ERR_SCRIPTLOAD, e.url)); display (formatException(ex), MT_ERROR); } return null;} |
e.scope.plugin.scope = e.scope; | plugin = e.scope.plugin; plugin.scope = e.scope; | function cmdLoad (e){ var ex; if (!e.scope) e.scope = new Object(); if (!("plugin" in e.scope)) { e.scope.plugin = { url: e.url, id: MSG_UNKNOWN, version: -1, description: "", status: MSG_LOADING, enabled: true}; } e.scope.plugin.scope = e.scope; try { var rvStr; var rv = rvStr = client.load(e.url, e.scope); if ("initPlugin" in e.scope) rv = rvStr = e.scope.initPlugin(e.scope); /* do this again, in case the plugin trashed it */ if (!("plugin" in e.scope)) { e.scope.plugin = { url: e.url, id: MSG_UNKNOWN, version: -1, description: "", status: MSG_ERROR, enabled: true }; } else { e.scope.plugin.status = "loaded"; } e.scope.plugin.scope = e.scope; if (typeof rv == "function") rvStr = "function"; if (!("__id" in e.scope)) e.scope.__id = null; if (!("__description" in e.scope)) e.scope.__description = null; var i = getPluginIndexByURL(e.url); if (i != -1) client.plugins[i] = e.scope.plugin; else client.plugins.push(e.scope.plugin); feedback(e, getMsg(MSG_SUBSCRIPT_LOADED, [e.url, rvStr]), MT_INFO); return rv; } catch (ex) { display (getMsg(MSG_ERR_SCRIPTLOAD, e.url)); display (formatException(ex), MT_ERROR); } return null;} |
if ("initPlugin" in e.scope) rv = rvStr = e.scope.initPlugin(e.scope); | var index; | function cmdLoad (e){ var ex; if (!e.scope) e.scope = new Object(); if (!("plugin" in e.scope)) { e.scope.plugin = { url: e.url, id: MSG_UNKNOWN, version: -1, description: "", status: MSG_LOADING, enabled: true}; } e.scope.plugin.scope = e.scope; try { var rvStr; var rv = rvStr = client.load(e.url, e.scope); if ("initPlugin" in e.scope) rv = rvStr = e.scope.initPlugin(e.scope); /* do this again, in case the plugin trashed it */ if (!("plugin" in e.scope)) { e.scope.plugin = { url: e.url, id: MSG_UNKNOWN, version: -1, description: "", status: MSG_ERROR, enabled: true }; } else { e.scope.plugin.status = "loaded"; } e.scope.plugin.scope = e.scope; if (typeof rv == "function") rvStr = "function"; if (!("__id" in e.scope)) e.scope.__id = null; if (!("__description" in e.scope)) e.scope.__description = null; var i = getPluginIndexByURL(e.url); if (i != -1) client.plugins[i] = e.scope.plugin; else client.plugins.push(e.scope.plugin); feedback(e, getMsg(MSG_SUBSCRIPT_LOADED, [e.url, rvStr]), MT_INFO); return rv; } catch (ex) { display (getMsg(MSG_ERR_SCRIPTLOAD, e.url)); display (formatException(ex), MT_ERROR); } return null;} |
if (!("plugin" in e.scope)) | if ((index = removeOldPlugin(plugin.id)) == null) return null; if ("init" in plugin) | function cmdLoad (e){ var ex; if (!e.scope) e.scope = new Object(); if (!("plugin" in e.scope)) { e.scope.plugin = { url: e.url, id: MSG_UNKNOWN, version: -1, description: "", status: MSG_LOADING, enabled: true}; } e.scope.plugin.scope = e.scope; try { var rvStr; var rv = rvStr = client.load(e.url, e.scope); if ("initPlugin" in e.scope) rv = rvStr = e.scope.initPlugin(e.scope); /* do this again, in case the plugin trashed it */ if (!("plugin" in e.scope)) { e.scope.plugin = { url: e.url, id: MSG_UNKNOWN, version: -1, description: "", status: MSG_ERROR, enabled: true }; } else { e.scope.plugin.status = "loaded"; } e.scope.plugin.scope = e.scope; if (typeof rv == "function") rvStr = "function"; if (!("__id" in e.scope)) e.scope.__id = null; if (!("__description" in e.scope)) e.scope.__description = null; var i = getPluginIndexByURL(e.url); if (i != -1) client.plugins[i] = e.scope.plugin; else client.plugins.push(e.scope.plugin); feedback(e, getMsg(MSG_SUBSCRIPT_LOADED, [e.url, rvStr]), MT_INFO); return rv; } catch (ex) { display (getMsg(MSG_ERR_SCRIPTLOAD, e.url)); display (formatException(ex), MT_ERROR); } return null;} |
e.scope.plugin = { url: e.url, id: MSG_UNKNOWN, version: -1, description: "", status: MSG_ERROR, enabled: true }; | if (!("enable" in plugin) || !("disable" in plugin) || !("id" in plugin) || !(plugin.id.match(/^[A-Za-z-_]+$/))) { display (getMsg(MSG_ERR_PLUGINAPI, e.url)); display (getMsg(MSG_ERR_SCRIPTLOAD, e.url)); return null; } plugin.API = 1; plugin.prefary = [["enabled", true, ""]]; rv = rvStr = plugin.init(e.scope); var branch = "extensions.irc.plugins." + plugin.id + "."; var prefManager = new PrefManager(branch, client.defaultBundle); prefManager.addPrefs(plugin.prefary); plugin.prefManager = prefManager; plugin.prefs = prefManager.prefs; if ("onPrefChanged" in plugin) prefManager.addObserver(plugin); client.prefManager.addObserver(prefManager); | function cmdLoad (e){ var ex; if (!e.scope) e.scope = new Object(); if (!("plugin" in e.scope)) { e.scope.plugin = { url: e.url, id: MSG_UNKNOWN, version: -1, description: "", status: MSG_LOADING, enabled: true}; } e.scope.plugin.scope = e.scope; try { var rvStr; var rv = rvStr = client.load(e.url, e.scope); if ("initPlugin" in e.scope) rv = rvStr = e.scope.initPlugin(e.scope); /* do this again, in case the plugin trashed it */ if (!("plugin" in e.scope)) { e.scope.plugin = { url: e.url, id: MSG_UNKNOWN, version: -1, description: "", status: MSG_ERROR, enabled: true }; } else { e.scope.plugin.status = "loaded"; } e.scope.plugin.scope = e.scope; if (typeof rv == "function") rvStr = "function"; if (!("__id" in e.scope)) e.scope.__id = null; if (!("__description" in e.scope)) e.scope.__description = null; var i = getPluginIndexByURL(e.url); if (i != -1) client.plugins[i] = e.scope.plugin; else client.plugins.push(e.scope.plugin); feedback(e, getMsg(MSG_SUBSCRIPT_LOADED, [e.url, rvStr]), MT_INFO); return rv; } catch (ex) { display (getMsg(MSG_ERR_SCRIPTLOAD, e.url)); display (formatException(ex), MT_ERROR); } return null;} |
e.scope.plugin.status = "loaded"; | plugin.API = 0; if ("initPlugin" in e.scope) rv = rvStr = e.scope.initPlugin(e.scope); plugin.enabled = true; | function cmdLoad (e){ var ex; if (!e.scope) e.scope = new Object(); if (!("plugin" in e.scope)) { e.scope.plugin = { url: e.url, id: MSG_UNKNOWN, version: -1, description: "", status: MSG_LOADING, enabled: true}; } e.scope.plugin.scope = e.scope; try { var rvStr; var rv = rvStr = client.load(e.url, e.scope); if ("initPlugin" in e.scope) rv = rvStr = e.scope.initPlugin(e.scope); /* do this again, in case the plugin trashed it */ if (!("plugin" in e.scope)) { e.scope.plugin = { url: e.url, id: MSG_UNKNOWN, version: -1, description: "", status: MSG_ERROR, enabled: true }; } else { e.scope.plugin.status = "loaded"; } e.scope.plugin.scope = e.scope; if (typeof rv == "function") rvStr = "function"; if (!("__id" in e.scope)) e.scope.__id = null; if (!("__description" in e.scope)) e.scope.__description = null; var i = getPluginIndexByURL(e.url); if (i != -1) client.plugins[i] = e.scope.plugin; else client.plugins.push(e.scope.plugin); feedback(e, getMsg(MSG_SUBSCRIPT_LOADED, [e.url, rvStr]), MT_INFO); return rv; } catch (ex) { display (getMsg(MSG_ERR_SCRIPTLOAD, e.url)); display (formatException(ex), MT_ERROR); } return null;} |
e.scope.plugin.scope = e.scope; | plugin.status = "loaded"; | function cmdLoad (e){ var ex; if (!e.scope) e.scope = new Object(); if (!("plugin" in e.scope)) { e.scope.plugin = { url: e.url, id: MSG_UNKNOWN, version: -1, description: "", status: MSG_LOADING, enabled: true}; } e.scope.plugin.scope = e.scope; try { var rvStr; var rv = rvStr = client.load(e.url, e.scope); if ("initPlugin" in e.scope) rv = rvStr = e.scope.initPlugin(e.scope); /* do this again, in case the plugin trashed it */ if (!("plugin" in e.scope)) { e.scope.plugin = { url: e.url, id: MSG_UNKNOWN, version: -1, description: "", status: MSG_ERROR, enabled: true }; } else { e.scope.plugin.status = "loaded"; } e.scope.plugin.scope = e.scope; if (typeof rv == "function") rvStr = "function"; if (!("__id" in e.scope)) e.scope.__id = null; if (!("__description" in e.scope)) e.scope.__description = null; var i = getPluginIndexByURL(e.url); if (i != -1) client.plugins[i] = e.scope.plugin; else client.plugins.push(e.scope.plugin); feedback(e, getMsg(MSG_SUBSCRIPT_LOADED, [e.url, rvStr]), MT_INFO); return rv; } catch (ex) { display (getMsg(MSG_ERR_SCRIPTLOAD, e.url)); display (formatException(ex), MT_ERROR); } return null;} |
if (!("__id" in e.scope)) e.scope.__id = null; if (!("__description" in e.scope)) e.scope.__description = null; | function cmdLoad (e){ var ex; if (!e.scope) e.scope = new Object(); if (!("plugin" in e.scope)) { e.scope.plugin = { url: e.url, id: MSG_UNKNOWN, version: -1, description: "", status: MSG_LOADING, enabled: true}; } e.scope.plugin.scope = e.scope; try { var rvStr; var rv = rvStr = client.load(e.url, e.scope); if ("initPlugin" in e.scope) rv = rvStr = e.scope.initPlugin(e.scope); /* do this again, in case the plugin trashed it */ if (!("plugin" in e.scope)) { e.scope.plugin = { url: e.url, id: MSG_UNKNOWN, version: -1, description: "", status: MSG_ERROR, enabled: true }; } else { e.scope.plugin.status = "loaded"; } e.scope.plugin.scope = e.scope; if (typeof rv == "function") rvStr = "function"; if (!("__id" in e.scope)) e.scope.__id = null; if (!("__description" in e.scope)) e.scope.__description = null; var i = getPluginIndexByURL(e.url); if (i != -1) client.plugins[i] = e.scope.plugin; else client.plugins.push(e.scope.plugin); feedback(e, getMsg(MSG_SUBSCRIPT_LOADED, [e.url, rvStr]), MT_INFO); return rv; } catch (ex) { display (getMsg(MSG_ERR_SCRIPTLOAD, e.url)); display (formatException(ex), MT_ERROR); } return null;} |
|
var i = getPluginIndexByURL(e.url); if (i != -1) client.plugins[i] = e.scope.plugin; | if (index != -1) client.plugins[index] = plugin; | function cmdLoad (e){ var ex; if (!e.scope) e.scope = new Object(); if (!("plugin" in e.scope)) { e.scope.plugin = { url: e.url, id: MSG_UNKNOWN, version: -1, description: "", status: MSG_LOADING, enabled: true}; } e.scope.plugin.scope = e.scope; try { var rvStr; var rv = rvStr = client.load(e.url, e.scope); if ("initPlugin" in e.scope) rv = rvStr = e.scope.initPlugin(e.scope); /* do this again, in case the plugin trashed it */ if (!("plugin" in e.scope)) { e.scope.plugin = { url: e.url, id: MSG_UNKNOWN, version: -1, description: "", status: MSG_ERROR, enabled: true }; } else { e.scope.plugin.status = "loaded"; } e.scope.plugin.scope = e.scope; if (typeof rv == "function") rvStr = "function"; if (!("__id" in e.scope)) e.scope.__id = null; if (!("__description" in e.scope)) e.scope.__description = null; var i = getPluginIndexByURL(e.url); if (i != -1) client.plugins[i] = e.scope.plugin; else client.plugins.push(e.scope.plugin); feedback(e, getMsg(MSG_SUBSCRIPT_LOADED, [e.url, rvStr]), MT_INFO); return rv; } catch (ex) { display (getMsg(MSG_ERR_SCRIPTLOAD, e.url)); display (formatException(ex), MT_ERROR); } return null;} |
client.plugins.push(e.scope.plugin); | index = client.plugins.push(plugin) - 1; | function cmdLoad (e){ var ex; if (!e.scope) e.scope = new Object(); if (!("plugin" in e.scope)) { e.scope.plugin = { url: e.url, id: MSG_UNKNOWN, version: -1, description: "", status: MSG_LOADING, enabled: true}; } e.scope.plugin.scope = e.scope; try { var rvStr; var rv = rvStr = client.load(e.url, e.scope); if ("initPlugin" in e.scope) rv = rvStr = e.scope.initPlugin(e.scope); /* do this again, in case the plugin trashed it */ if (!("plugin" in e.scope)) { e.scope.plugin = { url: e.url, id: MSG_UNKNOWN, version: -1, description: "", status: MSG_ERROR, enabled: true }; } else { e.scope.plugin.status = "loaded"; } e.scope.plugin.scope = e.scope; if (typeof rv == "function") rvStr = "function"; if (!("__id" in e.scope)) e.scope.__id = null; if (!("__description" in e.scope)) e.scope.__description = null; var i = getPluginIndexByURL(e.url); if (i != -1) client.plugins[i] = e.scope.plugin; else client.plugins.push(e.scope.plugin); feedback(e, getMsg(MSG_SUBSCRIPT_LOADED, [e.url, rvStr]), MT_INFO); return rv; } catch (ex) { display (getMsg(MSG_ERR_SCRIPTLOAD, e.url)); display (formatException(ex), MT_ERROR); } return null;} |
if ((plugin.API > 0) && plugin.prefs["enabled"]) dispatch("enable-plugin " + index); | function cmdLoad (e){ var ex; if (!e.scope) e.scope = new Object(); if (!("plugin" in e.scope)) { e.scope.plugin = { url: e.url, id: MSG_UNKNOWN, version: -1, description: "", status: MSG_LOADING, enabled: true}; } e.scope.plugin.scope = e.scope; try { var rvStr; var rv = rvStr = client.load(e.url, e.scope); if ("initPlugin" in e.scope) rv = rvStr = e.scope.initPlugin(e.scope); /* do this again, in case the plugin trashed it */ if (!("plugin" in e.scope)) { e.scope.plugin = { url: e.url, id: MSG_UNKNOWN, version: -1, description: "", status: MSG_ERROR, enabled: true }; } else { e.scope.plugin.status = "loaded"; } e.scope.plugin.scope = e.scope; if (typeof rv == "function") rvStr = "function"; if (!("__id" in e.scope)) e.scope.__id = null; if (!("__description" in e.scope)) e.scope.__description = null; var i = getPluginIndexByURL(e.url); if (i != -1) client.plugins[i] = e.scope.plugin; else client.plugins.push(e.scope.plugin); feedback(e, getMsg(MSG_SUBSCRIPT_LOADED, [e.url, rvStr]), MT_INFO); return rv; } catch (ex) { display (getMsg(MSG_ERR_SCRIPTLOAD, e.url)); display (formatException(ex), MT_ERROR); } return null;} |
|
e.action = filterOutput (e.action, "ACTION", "ME!"); display (e.action, "ACTION", "ME!", e.sourceObject); e.sourceObject.act (e.action); | var msg = filterOutput(e.action, "ACTION", "ME!"); e.sourceObject.display(msg, "ACTION", "ME!", e.sourceObject); e.sourceObject.act(msg); | function cmdMe(e){ if (!("act" in e.sourceObject)) { display(getMsg(MSG_ERR_IMPROPER_VIEW, "me"), MT_ERROR); return; } e.action = filterOutput (e.action, "ACTION", "ME!"); display (e.action, "ACTION", "ME!", e.sourceObject); e.sourceObject.act (e.action);} |
client.munger.entries[".mailto"].enabled = false; | function cmdMe(e){ if (!("act" in e.sourceObject)) { display(getMsg(MSG_ERR_IMPROPER_VIEW, "me"), MT_ERROR); return; } var msg = filterOutput(e.action, "ACTION", e.sourceObject); e.sourceObject.display(msg, "ACTION", "ME!", e.sourceObject); e.sourceObject.act(msg);} |
|
var chan = fromUnicode(e.target, e.server); | var chan; | function cmdMode(e){ // get our canonical channel name, so we know what channel we talk about var chan = fromUnicode(e.target, e.server); // Make sure the user can leave the channel name out from a channel view. if (e.channel && /^[\+\-].+/.test(e.target) && !(e.server.toLowerCase(chan) in e.server.channels)) { chan = e.channel.canonicalName; if (e.param && e.modestr) { e.paramList.unshift(e.modestr); } else if (e.modestr) { e.paramList = [e.modestr]; e.param = e.modestr; } e.modestr = e.target; } // Check whether our mode string makes sense if (!(/^([+-][a-z]+)+$/i).test(e.modestr)) { display(getMsg(MSG_ERR_INVALID_MODE, e.modestr), MT_ERROR); return; } var params = (e.param) ? " " + e.paramList.join(" ") : ""; e.server.sendData("MODE " + chan + " " + fromUnicode(e.modestr, e.server) + params + "\n");} |
if (e.channel && /^[\+\-].+/.test(e.target) && !(e.server.toLowerCase(chan) in e.server.channels)) | if ((!e.target || /^[\+\-].+/.test(e.target)) && !(chan && e.server.getChannel(chan))) | function cmdMode(e){ // get our canonical channel name, so we know what channel we talk about var chan = fromUnicode(e.target, e.server); // Make sure the user can leave the channel name out from a channel view. if (e.channel && /^[\+\-].+/.test(e.target) && !(e.server.toLowerCase(chan) in e.server.channels)) { chan = e.channel.canonicalName; if (e.param && e.modestr) { e.paramList.unshift(e.modestr); } else if (e.modestr) { e.paramList = [e.modestr]; e.param = e.modestr; } e.modestr = e.target; } // Check whether our mode string makes sense if (!(/^([+-][a-z]+)+$/i).test(e.modestr)) { display(getMsg(MSG_ERR_INVALID_MODE, e.modestr), MT_ERROR); return; } var params = (e.param) ? " " + e.paramList.join(" ") : ""; e.server.sendData("MODE " + chan + " " + fromUnicode(e.modestr, e.server) + params + "\n");} |
chan = e.channel.canonicalName; if (e.param && e.modestr) | if (e.channel) | function cmdMode(e){ // get our canonical channel name, so we know what channel we talk about var chan = fromUnicode(e.target, e.server); // Make sure the user can leave the channel name out from a channel view. if (e.channel && /^[\+\-].+/.test(e.target) && !(e.server.toLowerCase(chan) in e.server.channels)) { chan = e.channel.canonicalName; if (e.param && e.modestr) { e.paramList.unshift(e.modestr); } else if (e.modestr) { e.paramList = [e.modestr]; e.param = e.modestr; } e.modestr = e.target; } // Check whether our mode string makes sense if (!(/^([+-][a-z]+)+$/i).test(e.modestr)) { display(getMsg(MSG_ERR_INVALID_MODE, e.modestr), MT_ERROR); return; } var params = (e.param) ? " " + e.paramList.join(" ") : ""; e.server.sendData("MODE " + chan + " " + fromUnicode(e.modestr, e.server) + params + "\n");} |
e.paramList.unshift(e.modestr); | chan = e.channel.canonicalName; if (e.param && e.modestr) { e.paramList.unshift(e.modestr); } else if (e.modestr) { e.paramList = [e.modestr]; e.param = e.modestr; } e.modestr = e.target; | function cmdMode(e){ // get our canonical channel name, so we know what channel we talk about var chan = fromUnicode(e.target, e.server); // Make sure the user can leave the channel name out from a channel view. if (e.channel && /^[\+\-].+/.test(e.target) && !(e.server.toLowerCase(chan) in e.server.channels)) { chan = e.channel.canonicalName; if (e.param && e.modestr) { e.paramList.unshift(e.modestr); } else if (e.modestr) { e.paramList = [e.modestr]; e.param = e.modestr; } e.modestr = e.target; } // Check whether our mode string makes sense if (!(/^([+-][a-z]+)+$/i).test(e.modestr)) { display(getMsg(MSG_ERR_INVALID_MODE, e.modestr), MT_ERROR); return; } var params = (e.param) ? " " + e.paramList.join(" ") : ""; e.server.sendData("MODE " + chan + " " + fromUnicode(e.modestr, e.server) + params + "\n");} |
else if (e.modestr) | else | function cmdMode(e){ // get our canonical channel name, so we know what channel we talk about var chan = fromUnicode(e.target, e.server); // Make sure the user can leave the channel name out from a channel view. if (e.channel && /^[\+\-].+/.test(e.target) && !(e.server.toLowerCase(chan) in e.server.channels)) { chan = e.channel.canonicalName; if (e.param && e.modestr) { e.paramList.unshift(e.modestr); } else if (e.modestr) { e.paramList = [e.modestr]; e.param = e.modestr; } e.modestr = e.target; } // Check whether our mode string makes sense if (!(/^([+-][a-z]+)+$/i).test(e.modestr)) { display(getMsg(MSG_ERR_INVALID_MODE, e.modestr), MT_ERROR); return; } var params = (e.param) ? " " + e.paramList.join(" ") : ""; e.server.sendData("MODE " + chan + " " + fromUnicode(e.modestr, e.server) + params + "\n");} |
e.paramList = [e.modestr]; e.param = e.modestr; | display(getMsg(MSG_ERR_REQUIRED_PARAM, "target"), MT_ERROR); return; | function cmdMode(e){ // get our canonical channel name, so we know what channel we talk about var chan = fromUnicode(e.target, e.server); // Make sure the user can leave the channel name out from a channel view. if (e.channel && /^[\+\-].+/.test(e.target) && !(e.server.toLowerCase(chan) in e.server.channels)) { chan = e.channel.canonicalName; if (e.param && e.modestr) { e.paramList.unshift(e.modestr); } else if (e.modestr) { e.paramList = [e.modestr]; e.param = e.modestr; } e.modestr = e.target; } // Check whether our mode string makes sense if (!(/^([+-][a-z]+)+$/i).test(e.modestr)) { display(getMsg(MSG_ERR_INVALID_MODE, e.modestr), MT_ERROR); return; } var params = (e.param) ? " " + e.paramList.join(" ") : ""; e.server.sendData("MODE " + chan + " " + fromUnicode(e.modestr, e.server) + params + "\n");} |
e.modestr = e.target; | } else { chan = fromUnicode(e.target, e.server); | function cmdMode(e){ // get our canonical channel name, so we know what channel we talk about var chan = fromUnicode(e.target, e.server); // Make sure the user can leave the channel name out from a channel view. if (e.channel && /^[\+\-].+/.test(e.target) && !(e.server.toLowerCase(chan) in e.server.channels)) { chan = e.channel.canonicalName; if (e.param && e.modestr) { e.paramList.unshift(e.modestr); } else if (e.modestr) { e.paramList = [e.modestr]; e.param = e.modestr; } e.modestr = e.target; } // Check whether our mode string makes sense if (!(/^([+-][a-z]+)+$/i).test(e.modestr)) { display(getMsg(MSG_ERR_INVALID_MODE, e.modestr), MT_ERROR); return; } var params = (e.param) ? " " + e.paramList.join(" ") : ""; e.server.sendData("MODE " + chan + " " + fromUnicode(e.modestr, e.server) + params + "\n");} |
if (!(/^([+-][a-z]+)+$/i).test(e.modestr)) | if (!e.modestr) { e.modestr = ""; if (!e.channel && arrayContains(e.server.channelTypes, chan[0])) e.channel = new CIRCChannel(e.server, null, chan); if (e.channel) e.channel.pendingModeReply = true; } else if (!(/^([+-][a-z]+)+$/i).test(e.modestr)) | function cmdMode(e){ // get our canonical channel name, so we know what channel we talk about var chan = fromUnicode(e.target, e.server); // Make sure the user can leave the channel name out from a channel view. if (e.channel && /^[\+\-].+/.test(e.target) && !(e.server.toLowerCase(chan) in e.server.channels)) { chan = e.channel.canonicalName; if (e.param && e.modestr) { e.paramList.unshift(e.modestr); } else if (e.modestr) { e.paramList = [e.modestr]; e.param = e.modestr; } e.modestr = e.target; } // Check whether our mode string makes sense if (!(/^([+-][a-z]+)+$/i).test(e.modestr)) { display(getMsg(MSG_ERR_INVALID_MODE, e.modestr), MT_ERROR); return; } var params = (e.param) ? " " + e.paramList.join(" ") : ""; e.server.sendData("MODE " + chan + " " + fromUnicode(e.modestr, e.server) + params + "\n");} |
var usr = e.server.addUser(e.nickname); | var target = e.server.addTarget(e.nickname); | function cmdMsg(e){ var usr = e.server.addUser(e.nickname); var msg = filterOutput(e.message, "PRIVMSG", "ME!"); usr.display(e.message, "PRIVMSG", "ME!", usr); usr.say(e.message, e.sourceObject);} |
usr.display(e.message, "PRIVMSG", "ME!", usr); usr.say(e.message, e.sourceObject); | e.sourceObject.display(msg, "PRIVMSG", "ME!", target); target.say(msg, target); | function cmdMsg(e){ var usr = e.server.addUser(e.nickname); var msg = filterOutput(e.message, "PRIVMSG", "ME!"); usr.display(e.message, "PRIVMSG", "ME!", usr); usr.say(e.message, e.sourceObject);} |
client.munger.entries[".mailto"].enabled = false; | function cmdMsg(e){ var target = e.server.addTarget(e.nickname); var msg = filterOutput(e.message, "PRIVMSG", target); e.sourceObject.display(msg, "PRIVMSG", "ME!", target); target.say(msg);} |
|
network.displayHere(getMsg(MSG_NETWORK_OPENED, network.name)); | network.displayHere(getMsg(MSG_NETWORK_OPENED, network.unicodeName)); | function cmdNetwork(e){ if (!(e.networkName in client.networks)) { display (getMsg(MSG_ERR_UNKNOWN_NETWORK, e.networkName), MT_ERROR); return; } var network = client.networks[e.networkName]; if (!("messages" in network)) network.displayHere(getMsg(MSG_NETWORK_OPENED, network.name)); dispatch("set-current-view", { view: network });} |
this.mPropsBoxObject.beginUpdateBatch(); | cmdNewProperty: function() { var bundle = this.mPanel.panelset.stringBundle; var msg = bundle.getString("styleRulePropertyName.message"); var title = bundle.getString("styleRuleNewProperty.title"); var propName = { value: "" }; var propValue = { value: "" }; var dummy = { value: false }; if (!gPromptService.prompt(window, title, msg, propName, null, dummy)) { return; } msg = bundle.getString("styleRulePropertyValue.message"); if (!gPromptService.prompt(window, title, msg, propValue, null, dummy)) { return; } this.mPropsBoxObject.beginUpdateBatch(); var style = this.getSelectedRule().style; style.setProperty(propName.value, propValue.value, ""); this.mPropsBoxObject.endUpdateBatch(); }, |
|
this.mPropsBoxObject.endUpdateBatch(); | this.mPropsBoxObject.invalidate(); | cmdNewProperty: function() { var bundle = this.mPanel.panelset.stringBundle; var msg = bundle.getString("styleRulePropertyName.message"); var title = bundle.getString("styleRuleNewProperty.title"); var propName = { value: "" }; var propValue = { value: "" }; var dummy = { value: false }; if (!gPromptService.prompt(window, title, msg, propName, null, dummy)) { return; } msg = bundle.getString("styleRulePropertyValue.message"); if (!gPromptService.prompt(window, title, msg, propValue, null, dummy)) { return; } this.mPropsBoxObject.beginUpdateBatch(); var style = this.getSelectedRule().style; style.setProperty(propName.value, propValue.value, ""); this.mPropsBoxObject.endUpdateBatch(); }, |
this.mPropsBoxObject.invalidate(); | this.mPropsBoxObject.endUpdateBatch(); | cmdNewProperty: function() { var bundle = this.mPanel.panelset.stringBundle; var msg = bundle.getString("styleRulePropertyName.message"); var title = bundle.getString("styleRuleNewProperty.title"); var propName = { value: "" }; var propValue = { value: "" }; var dummy = { value: false }; if (!gPromptService.prompt(window, title, msg, propName, null, dummy)) { return; } msg = bundle.getString("styleRulePropertyValue.message"); if (!gPromptService.prompt(window, title, msg, propValue, null, dummy)) { return; } var style = this.getSelectedRule().style; style.setProperty(propName.value, propValue.value, ""); this.mPropsBoxObject.invalidate(); }, |
e.nickname = prompt(MSG_NICK_PROMPT); | var curNick; if (e.network) curNick = e.network.prefs["nickname"]; else curNick = client.prefs["nickname"]; e.nickname = prompt(MSG_NICK_PROMPT, curNick); | function cmdNick(e){ if (!e.nickname) { e.nickname = prompt(MSG_NICK_PROMPT); if (e.nickname == null) return; } if (e.server) e.server.changeNick(e.nickname); if (e.network) e.network.prefs["nickname"] = e.nickname; else client.prefs["nickname"] = e.nickname;} |
if (!e.nickname) { e.nickname = prompt(MSG_NICK_PROMPT); if (e.nickname == null) return; } | function cmdNick(e){ if (e.server) e.server.changeNick(e.nickname); if (e.network) e.network.prefs["nickname"] = e.nickname; else client.prefs["nickname"] = e.nickname;} |
|
client.munger.entries[".mailto"].enabled = false; | function cmdNotice(e){ var target = e.server.addTarget(e.nickname); var msg = filterOutput(e.message, "NOTICE", target); e.sourceObject.display(msg, "NOTICE", "ME!", target); target.notice(msg);} |
|
console.sourceView.prettyPrint = !console.sourceView.prettyPrint; if (console.sourceView.details) cmdFindScript({scriptRec: console.sourceView.details}); | setPrettyPrintState(!console.sourceView.prettyPrint); | function cmdPPrint (e){ console.sourceView.prettyPrint = !console.sourceView.prettyPrint; if (console.sourceView.details) cmdFindScript({scriptRec: console.sourceView.details}); return true;} |
var ary = pm.listPrefs(e.prefName); if (ary.length == 0) { display (getMsg(MSG_ERR_UNKNOWN_PREF, [e.prefName]), MT_ERROR); return false; } | function cmdPref (e){ var msg; var pm; if (e.command.name == "network-pref") { pm = e.network.prefManager; msg = MSG_FMT_NETPREF; } else if (e.command.name == "channel-pref") { pm = e.channel.prefManager; msg = MSG_FMT_CHANPREF; } else if (e.command.name == "user-motif") { pm = e.user.prefManager; msg = MSG_FMT_USERPREF; } else { pm = client.prefManager; msg = MSG_FMT_PREF; } if (e.prefValue == "-") e.deletePref = true; if (e.deletePref) { try { pm.clearPref(e.prefName); } catch (ex) { // ignore exception generated by clear of nonexistant pref if (!("result" in ex) || ex.result != Components.results.NS_ERROR_UNEXPECTED) { throw ex; } } var prefValue = pm.prefs[e.prefName]; feedback (e, getMsg(msg, [e.prefName, pm.prefs[e.prefName]])); return true; } if (e.prefValue) { var r = pm.prefRecords[e.prefName]; var type; if (typeof r.defaultValue == "function") type = typeof r.defaultValue(e.prefName); else type = typeof r.defaultValue; switch (type) { case "number": e.prefValue = Number(e.prefValue); break; case "boolean": e.prefValue = (e.prefValue.toLowerCase() == "true"); break; case "string": break; default: if (r.defaultValue instanceof Array) e.prefValue = pm.stringToArray(e.prefValue); else e.prefValue = e.prefValue.join("; "); break; } pm.prefs[e.prefName] = e.prefValue; feedback (e, getMsg(msg, [e.prefName, e.prefValue])); } else { var ary = pm.listPrefs(e.prefName); if (ary.length == 0) { display (getMsg(MSG_ERR_UNKNOWN_PREF, [e.prefName]), MT_ERROR); return false; } for (var i = 0; i < ary.length; ++i) { var value; if (pm.prefs[ary[i]] instanceof Array) value = pm.prefs[ary[i]].join("; "); else value = pm.prefs[ary[i]]; feedback(e, getMsg(msg, [ary[i], value])); } } return true;} |
|
if (!(e.prefName in console.prefs)) { display (getMsg(MSN_ERR_INVALID_PARAM, ["prefName", e.prefName]), MT_ERROR); return false; } | function cmdPref (e){ if (e.prefValue) { if (e.prefName[0] == "-") { console.prefs.prefBranch.clearUserPref(e.prefName.substr(1)); return true; } if (!(e.prefName in console.prefs)) { display (getMsg(MSN_ERR_INVALID_PARAM, ["prefName", e.prefName]), MT_ERROR); return false; } var type = typeof console.prefs[e.prefName]; switch (type) { case "number": e.prefValue = Number(e.prefValue); break; case "boolean": e.prefValue = (e.prefValue.toLowerCase() == "true"); break; case "string": break; default: e.prefValue = String(e.prefValue); break; } console.prefs[e.prefName] = e.prefValue; display (getMsg(MSN_FMT_PREFVALUE, [e.prefName, e.prefValue])); } else { var ary = console.listPrefs(e.prefName); for (var i = 0; i < ary.length; ++i) display (getMsg(MSN_FMT_PREFVALUE, [ary[i], console.prefs[ary[i]]])); } return true;} |
|
display (getMsg(MSN_FMT_PREFVALUE, [e.prefName, e.prefValue])); | feedback (e, getMsg(MSN_FMT_PREFVALUE, [e.prefName, e.prefValue])); | function cmdPref (e){ if (e.prefValue) { if (e.prefName[0] == "-") { console.prefs.prefBranch.clearUserPref(e.prefName.substr(1)); return true; } if (!(e.prefName in console.prefs)) { display (getMsg(MSN_ERR_INVALID_PARAM, ["prefName", e.prefName]), MT_ERROR); return false; } var type = typeof console.prefs[e.prefName]; switch (type) { case "number": e.prefValue = Number(e.prefValue); break; case "boolean": e.prefValue = (e.prefValue.toLowerCase() == "true"); break; case "string": break; default: e.prefValue = String(e.prefValue); break; } console.prefs[e.prefName] = e.prefValue; display (getMsg(MSN_FMT_PREFVALUE, [e.prefName, e.prefValue])); } else { var ary = console.listPrefs(e.prefName); for (var i = 0; i < ary.length; ++i) display (getMsg(MSN_FMT_PREFVALUE, [ary[i], console.prefs[ary[i]]])); } return true;} |
display (getMsg(MSN_FMT_PREFVALUE, [ary[i], console.prefs[ary[i]]])); | { feedback (e, getMsg(MSN_FMT_PREFVALUE, [ary[i], console.prefs[ary[i]]])); } | function cmdPref (e){ if (e.prefValue) { if (e.prefName[0] == "-") { console.prefs.prefBranch.clearUserPref(e.prefName.substr(1)); return true; } if (!(e.prefName in console.prefs)) { display (getMsg(MSN_ERR_INVALID_PARAM, ["prefName", e.prefName]), MT_ERROR); return false; } var type = typeof console.prefs[e.prefName]; switch (type) { case "number": e.prefValue = Number(e.prefValue); break; case "boolean": e.prefValue = (e.prefValue.toLowerCase() == "true"); break; case "string": break; default: e.prefValue = String(e.prefValue); break; } console.prefs[e.prefName] = e.prefValue; display (getMsg(MSN_FMT_PREFVALUE, [e.prefName, e.prefValue])); } else { var ary = console.listPrefs(e.prefName); for (var i = 0; i < ary.length; ++i) display (getMsg(MSN_FMT_PREFVALUE, [ary[i], console.prefs[ary[i]]])); } return true;} |
if (e.prefName[0] == "-") { console.prefs.prefBranch.clearUserPref(e.prefName.substr(1)); return true; } | function cmdPref (e){ if (e.prefName) { if (!(e.prefName in console.prefs)) { display (getMsg(MSN_ERR_INVALID_PARAM, ["prefName", e.prefName]), MT_ERROR); return false; } if (e.prefValue) console.prefs[e.prefName] = e.prefValue; else e.prefValue = console.prefs[e.prefName]; display (getMsg(MSN_FMT_PREFVALUE, [e.prefName, e.prefValue])); } else { for (var i in console.prefs.prefNames) { var name = console.prefs.prefNames[i]; display (getMsg(MSN_FMT_PREFVALUE, [name, console.prefs[name]])); } } return true;} |
|
return; | return false; | function cmdProps (e){ var v; var debuggerScope = (e.command.name == "propsd"); if (debuggerScope) { v = console.jsds.wrapValue(evalInDebuggerScope (e.expression)); } else { if (!("currentEvalObject" in console)) { display (MSG_ERR_NO_EVAL_OBJECT, MT_ERROR); return; } if (console.currentEvalObject instanceof jsdIStackFrame) { v = evalInTargetScope (e.expression); } else { v = console.doEval.apply(console.currentEvalObject, [e.expression, parent]); v = console.jsds.wrapValue(v); } } if (!(v instanceof jsdIValue) || v.jsType != jsdIValue.TYPE_OBJECT) { var str = (v instanceof jsdIValue) ? formatValue(v) : String(v) display (getMsg(MSN_ERR_INVALID_PARAM, [MSG_VAL_EXPRESSION, str]), MT_ERROR); return false; } display (getMsg(debuggerScope ? MSN_PROPSD_HEADER : MSN_PROPS_HEADER, e.expression)); displayProperties(v); return true;} |
window.close(); return true; | goQuitApplication(); | function cmdQuit (){ window.close(); return true;} |
e.channel.dispatch("part", { reason: e.reason, noDelete: true }); | e.channel.dispatch("part", { reason: e.reason, deleteWhenDone: false }); | function cmdRejoin(e){ if (e.channel.joined) { if (!e.reason) e.reason = ""; e.channel.dispatch("part", { reason: e.reason, noDelete: true }); } e.channel.join(e.channel.mode.key);} |
client.munger.entries[".mailto"].enabled = false; | function cmdSay(e){ if (!("say" in e.sourceObject)) { display(getMsg(MSG_ERR_IMPROPER_VIEW, "say"), MT_ERROR); return; } var msg = filterOutput(e.message, "PRIVMSG", e.sourceObject); e.sourceObject.display(msg, "PRIVMSG", "ME!", e.sourceObject); e.sourceObject.say(msg);} |
|
keys(server.channelTypes).join(MSG_COMMASP))); | server.channelTypes.join(MSG_COMMASP))); | function cmdSupports(e){ var server = e.server; var data = server.supports; if ("channelTypes" in server) display(getMsg(MSG_SUPPORTS_CHANTYPES, keys(server.channelTypes).join(MSG_COMMASP))); if ("channelModes" in server) { display(getMsg(MSG_SUPPORTS_CHANMODESA, server.channelModes.a.join(MSG_COMMASP))); display(getMsg(MSG_SUPPORTS_CHANMODESB, server.channelModes.b.join(MSG_COMMASP))); display(getMsg(MSG_SUPPORTS_CHANMODESC, server.channelModes.c.join(MSG_COMMASP))); display(getMsg(MSG_SUPPORTS_CHANMODESD, server.channelModes.d.join(MSG_COMMASP))); } if ("userModes" in server) { var list = new Array(); for (var m in server.userModes) { list.push(getMsg(MSG_SUPPORTS_USERMODE, [ server.userModes[m].mode, server.userModes[m].symbol ])); } display(getMsg(MSG_SUPPORTS_USERMODES, list.join(MSG_COMMASP))); } var listB1 = new Array(); var listB2 = new Array(); var listN = new Array(); for (var k in data) { if (typeof data[k] == "boolean") { if (data[k]) listB1.push(k); else listB2.push(k); } else { listN.push(getMsg(MSG_SUPPORTS_MISCOPTION, [ k, data[k] ] )); } } listB1.sort(); listB2.sort(); listN.sort(); display(getMsg(MSG_SUPPORTS_FLAGSON, listB1.join(MSG_COMMASP))); display(getMsg(MSG_SUPPORTS_FLAGSOFF, listB2.join(MSG_COMMASP))); display(getMsg(MSG_SUPPORTS_MISCOPTIONS, listN.join(MSG_COMMASP)));} |
if (console.prefs["dbgContexts"]) | if (eval(console.prefs["dbgContexts"])) | function cmdSyncDebug(){ if (console.prefs["dbgContexts"]) console.dbgContexts = true; else delete console.dbgContexts; if (console.prefs["dbgDispatch"]) console.dbgDispatch = true; else delete console.dbgDispatch; if (console.prefs["dbgRealize"]) console.dbgRealize = true; else delete console.dbgRealize;} |
if (console.prefs["dbgDispatch"]) | if (eval(console.prefs["dbgDispatch"])) | function cmdSyncDebug(){ if (console.prefs["dbgContexts"]) console.dbgContexts = true; else delete console.dbgContexts; if (console.prefs["dbgDispatch"]) console.dbgDispatch = true; else delete console.dbgDispatch; if (console.prefs["dbgRealize"]) console.dbgRealize = true; else delete console.dbgRealize;} |
if (console.prefs["dbgRealize"]) | if (eval(console.prefs["dbgRealize"])) | function cmdSyncDebug(){ if (console.prefs["dbgContexts"]) console.dbgContexts = true; else delete console.dbgContexts; if (console.prefs["dbgDispatch"]) console.dbgDispatch = true; else delete console.dbgDispatch; if (console.prefs["dbgRealize"]) console.dbgRealize = true; else delete console.dbgRealize;} |
var sampleChannel = {TYPE: "IRCChannel", name: "#mojo"}; | var sampleChannel = {TYPE: "IRCChannel", name: "#mojo", displayName: "#mojo"}; | function cmdTestDisplay(e){ display(MSG_TEST_HELLO, MT_HELLO); display(MSG_TEST_INFO, MT_INFO); display(MSG_TEST_ERROR, MT_ERROR); display(MSG_TEST_HELP, MT_HELP); display(MSG_TEST_USAGE, MT_USAGE); display(MSG_TEST_STATUS, MT_STATUS); if (e.server && e.server.me) { var me = e.server.me; var sampleUser = {TYPE: "IRCUser", nick: "ircmonkey", name: "IRCMonkey", properNick: "IRCMonkey", host: ""}; var sampleChannel = {TYPE: "IRCChannel", name: "#mojo"}; function test (from, to) { var fromText = (from != me) ? from.TYPE + " ``" + from.name + "''" : MSG_YOU; var toText = (to != me) ? to.TYPE + " ``" + to.name + "''" : MSG_YOU; display (getMsg(MSG_TEST_PRIVMSG, [fromText, toText]), "PRIVMSG", from, to); display (getMsg(MSG_TEST_ACTION, [fromText, toText]), "ACTION", from, to); display (getMsg(MSG_TEST_NOTICE, [fromText, toText]), "NOTICE", from, to); } test (sampleUser, me); /* from user to me */ test (me, sampleUser); /* me to user */ display(MSG_TEST_URL, "PRIVMSG", sampleUser, me); display(MSG_TEST_STYLES, "PRIVMSG", sampleUser, me); display(MSG_TEST_EMOTICON, "PRIVMSG", sampleUser, me); display(MSG_TEST_RHEET, "PRIVMSG", sampleUser, me); display(unescape(MSG_TEST_CTLCHR), "PRIVMSG", sampleUser, me); display(unescape(MSG_TEST_COLOR), "PRIVMSG", sampleUser, me); display(MSG_TEST_QUOTE, "PRIVMSG", sampleUser, me); if (e.channel) { test (sampleUser, sampleChannel); /* user to channel */ test (me, sampleChannel); /* me to channel */ display(MSG_TEST_TOPIC, "TOPIC", sampleUser, sampleChannel); display(MSG_TEST_JOIN, "JOIN", sampleUser, sampleChannel); display(MSG_TEST_PART, "PART", sampleUser, sampleChannel); display(MSG_TEST_KICK, "KICK", sampleUser, sampleChannel); display(MSG_TEST_QUIT, "QUIT", sampleUser, sampleChannel); display(getMsg(MSG_TEST_STALK, me.nick), "PRIVMSG", sampleUser, sampleChannel); display(MSG_TEST_STYLES, "PRIVMSG", me, sampleChannel); } }} |
return; | return false; | function cmdThisExpr(e){ if (e.expression == "debugger") { rv = console.jsdConsole; } else if (console.currentEvalObject instanceof jsdIStackFrame) { rv = evalInTargetScope (e.expression); } else { rv = console.doEval.apply(console.currentEvalObject, [e.expression, parent]); } if (!(rv instanceof jsdIValue)) rv = console.jsds.wrapValue(rv); if (rv.jsType != TYPE_OBJECT) { display (MSG_ERR_THIS_NOT_OBJECT, MT_ERROR); return; } dispatch ("set-eval-obj", { jsdValue: rv }); dispatch ("hook-eval-done"); return true;} |
case EMODE_IGNORE: | case TMODE_IGNORE: | function cmdTMode (e){ if (e.mode != null) { e.mode = e.mode.toLowerCase(); if (e.mode == "cycle") { switch (console.throwMode) { case TMODE_IGNORE: e.mode = "trace"; break; case TMODE_TRACE: e.mode = "break"; break; case TMODE_BREAK: e.mode = "ignore"; break; } } switch (e.mode.toLowerCase()) { case "ignore": console.jsds.throwHook = null; console.throwMode = TMODE_IGNORE; break; case "trace": console.jsds.throwHook = console.executionHook; console.throwMode = TMODE_TRACE; break; case "break": console.jsds.throwHook = console.executionHook; console.throwMode = TMODE_BREAK; break; default: display (getMsg(MSN_ERR_INVALID_PARAM, ["mode", e.mode]), MT_ERROR); return false; } console.prefs["lastThrowMode"] = e.mode; } switch (console.throwMode) { case EMODE_IGNORE: feedback (e, MSG_TMODE_IGNORE); break; case EMODE_TRACE: feedback (e, MSG_TMODE_TRACE); break; case EMODE_BREAK: feedback (e, MSG_TMODE_BREAK); break; } return true;} |
case EMODE_TRACE: | case TMODE_TRACE: | function cmdTMode (e){ if (e.mode != null) { e.mode = e.mode.toLowerCase(); if (e.mode == "cycle") { switch (console.throwMode) { case TMODE_IGNORE: e.mode = "trace"; break; case TMODE_TRACE: e.mode = "break"; break; case TMODE_BREAK: e.mode = "ignore"; break; } } switch (e.mode.toLowerCase()) { case "ignore": console.jsds.throwHook = null; console.throwMode = TMODE_IGNORE; break; case "trace": console.jsds.throwHook = console.executionHook; console.throwMode = TMODE_TRACE; break; case "break": console.jsds.throwHook = console.executionHook; console.throwMode = TMODE_BREAK; break; default: display (getMsg(MSN_ERR_INVALID_PARAM, ["mode", e.mode]), MT_ERROR); return false; } console.prefs["lastThrowMode"] = e.mode; } switch (console.throwMode) { case EMODE_IGNORE: feedback (e, MSG_TMODE_IGNORE); break; case EMODE_TRACE: feedback (e, MSG_TMODE_TRACE); break; case EMODE_BREAK: feedback (e, MSG_TMODE_BREAK); break; } return true;} |
case EMODE_BREAK: | case TMODE_BREAK: | function cmdTMode (e){ if (e.mode != null) { e.mode = e.mode.toLowerCase(); if (e.mode == "cycle") { switch (console.throwMode) { case TMODE_IGNORE: e.mode = "trace"; break; case TMODE_TRACE: e.mode = "break"; break; case TMODE_BREAK: e.mode = "ignore"; break; } } switch (e.mode.toLowerCase()) { case "ignore": console.jsds.throwHook = null; console.throwMode = TMODE_IGNORE; break; case "trace": console.jsds.throwHook = console.executionHook; console.throwMode = TMODE_TRACE; break; case "break": console.jsds.throwHook = console.executionHook; console.throwMode = TMODE_BREAK; break; default: display (getMsg(MSN_ERR_INVALID_PARAM, ["mode", e.mode]), MT_ERROR); return false; } console.prefs["lastThrowMode"] = e.mode; } switch (console.throwMode) { case EMODE_IGNORE: feedback (e, MSG_TMODE_IGNORE); break; case EMODE_TRACE: feedback (e, MSG_TMODE_TRACE); break; case EMODE_BREAK: feedback (e, MSG_TMODE_BREAK); break; } return true;} |
{ var currentState = console.prefs["services.source.sourceColoring"]; if (currentState == "true") e.toggle = false; else e.toggle = true; if (e.toggle) console.prefs["services.source.sourceColoring"] = "true"; else console.prefs["services.source.sourceColoring"] = "false"; } } | e.toggle = !console.prefs["services.source.colorize"]; console.prefs["services.source.colorize"] = e.toggle; } | function cmdToggleColoring (e){ if (e.toggle != null) { if (e.toggle == "toggle") { var currentState = console.prefs["services.source.sourceColoring"]; if (currentState == "true") e.toggle = false; else e.toggle = true; if (e.toggle) console.prefs["services.source.sourceColoring"] = "true"; else console.prefs["services.source.sourceColoring"] = "false"; } } feedback (e, "pref services.source.sourceColoring");} |
feedback (e, "pref services.source.sourceColoring"); | if ("isInteractive" in e && e.isInteractive) dispatch("pref services.source.colorize", { isInteractive: true }); | function cmdToggleColoring (e){ if (e.toggle != null) { if (e.toggle == "toggle") { var currentState = console.prefs["services.source.sourceColoring"]; if (currentState == "true") e.toggle = false; else e.toggle = true; if (e.toggle) console.prefs["services.source.sourceColoring"] = "true"; else console.prefs["services.source.sourceColoring"] = "false"; } } feedback (e, "pref services.source.sourceColoring");} |
if ((e.thing == "userlist") && (sourceObject.TYPE == "IRCChannel")) { var rv = getSelectedNicknames(document.getElementById("user-list")); sourceObject.userlistSelection = rv; } | function cmdToggleUI(e){ var ids = new Array(); switch (e.thing) { case "tabstrip": ids = ["view-tabs"]; break; case "userlist": ids = ["main-splitter", "user-list-box"]; break; case "header": client.currentObject.prefs["displayHeader"] = !client.currentObject.prefs["displayHeader"]; return; case "status": ids = ["status-bar"]; break; default: ASSERT (0,"Unknown element ``" + e.thing + "'' passed to onToggleVisibility."); return; } var newState; var elem = document.getElementById(ids[0]); var sourceObject = e.sourceObject; if (elem.getAttribute("collapsed") == "true") { if (e.thing == "userlist") { if (sourceObject.TYPE == "IRCChannel") { client.rdf.setTreeRoot("user-list", sourceObject.getGraphResource()); } else { client.rdf.setTreeRoot("user-list", client.rdf.resNullChan); } } newState = "false"; } else { newState = "true"; } for (var i in ids) { elem = document.getElementById(ids[i]); elem.setAttribute ("collapsed", newState); } updateTitle(); dispatch("focus-input");} |
|
return; | return null; | function cmdWatchExpr (e){ if (!e.expression) { var watches = console.views.watches.childData; var len = watches.length; display (getMsg(MSN_WATCH_HEADER, len)); for (var i = 0; i < len; ++i) { display (getMsg(MSN_FMT_WATCH_ITEM, [i, watches[i].displayName, watches[i].displayValue])); } return null; } var refresher; if (e.command.name == "watch-expr") { if (!("currentEvalObject" in console)) { display (MSG_ERR_NO_EVAL_OBJECT, MT_ERROR); return; } if (console.currentEvalObject instanceof jsdIStackFrame) { refresher = function () { if ("frames" in console) { this.value = evalInTargetScope(e.expression, true); } }; } else { var evalObject = console.currentEvalObject; refresher = function () { rv = console.doEval.apply(evalObject, [e.expression, parent]); this.value = console.jsds.wrapValue(rv); }; } } else { refresher = function () { var rv = evalInDebuggerScope(e.expression, true); this.value = console.jsds.wrapValue(rv); }; } var rec = new ValueRecord(console.jsds.wrapValue(null), e.expression, 0); rec.onPreRefresh = refresher; rec.refresh(); console.views.watches.childData.appendChild(rec); console.views.watches.refresh(); return rec;} |
e.server.who(e.pattern); | e.server.who(e.rest); | function cmdWho(e){ e.network.pendingWhoReply = true; e.server.LIGHTWEIGHT_WHO = false; e.server.who(e.pattern);} |
key.setAttribute ("modifiers", ary[1]); | if (ary[1]) key.setAttribute ("modifiers", ary[1]); | function cmgr_instkey (parentElem, command){ if (!command.keystr) return; var ary = command.keystr.match (/(.*\s)?([\S]+)$/); if (!ASSERT(ary, "couldn't parse key string ``" + command.keystr + "'' for command ``" + command.name + "''")) { return; } var key = document.createElement ("key"); key.setAttribute ("id", "key:" + command.name); key.setAttribute ("oncommand", "dispatch('" + command.name + "', {isInteractive: true});"); key.setAttribute ("modifiers", ary[1]); if (ary[2].indexOf("VK_") == 0) key.setAttribute ("keycode", ary[2]); else key.setAttribute ("key", ary[2]); parentElem.appendChild(key); command.keyNodes.push(key);} |
if ("eval" in this.commands && typeof this.commands.eval == "object") commandNames.push ("eval"); | if (("eval" in this.commands) && (typeof this.commands.eval == "object") && !arrayContains(commandNames, "eval")) { commandNames.push("eval"); } | function cmgr_list (partialName, flags){ /* returns array of command objects which look like |partialName|, or * all commands if |partialName| is not specified */ function compare (a, b) { a = a.labelstr.toLowerCase(); b = b.labelstr.toLowerCase(); if (a == b) return 0; if (a > b) return 1; return -1; } var ary = new Array(); var commandNames = keys(this.commands); /* a command named "eval" wouldn't show up in the result of keys() because * eval is not-enumerable, even if overwritten. */ if ("eval" in this.commands && typeof this.commands.eval == "object") commandNames.push ("eval"); for (var i in commandNames) { var name = commandNames[i]; if (!flags || (this.commands[name].flags & flags)) { if (!partialName || this.commands[name].name.indexOf(partialName) == 0) { if (partialName && partialName.length == this.commands[name].name.length) { /* exact match */ return [this.commands[name]]; } else { ary.push (this.commands[name]); } } } } ary.sort(compare); return ary;} |
return cmdNames.sort(); | cmdNames.sort(); return cmdNames; | function cmgr_listnames (partialName, flags){ var cmds = this.list(partialName, flags); var cmdNames = new Array(); for (var c in cmds) cmdNames.push (cmds[c].name); return cmdNames.sort();} |
function CMungerEntry (name, regex, className, tagName) | function CMungerEntry (name, regex, className, enable, tagName) | function CMungerEntry (name, regex, className, tagName){ this.name = name; this.tagName = (tagName) ? tagName : "html:span"; if (regex instanceof RegExp) this.regex = regex; else this.lambdaMatch = regex; if (typeof className == "function") this.lambdaReplace = className; else this.className = className; } |
this.description = getMsg("rule_" + name); this.enabled = (typeof enable == "undefined" ? true : enable); | function CMungerEntry (name, regex, className, tagName){ this.name = name; this.tagName = (tagName) ? tagName : "html:span"; if (regex instanceof RegExp) this.regex = regex; else this.lambdaMatch = regex; if (typeof className == "function") this.lambdaReplace = className; else this.className = className; } |
|
var inboxFolder = currentServer.rootMsgFolder.getFoldersWithFlag(0x1000, 1, outNumFolders); pop3Server = currentServer.QueryInterface(Components.interfaces.nsIPop3IncomingServer); | var inboxFolder = currentServer.rootMsgFolder.getFoldersWithFlag(0x1000, 1, outNumFolders); var pop3Server = currentServer.QueryInterface(Components.interfaces.nsIPop3IncomingServer); | function CoalesceGetMsgsForPop3ServersByDestFolder(currentServer, pop3DownloadServersArray, localFoldersToDownloadTo){ var outNumFolders = new Object(); var inboxFolder = currentServer.rootMsgFolder.getFoldersWithFlag(0x1000, 1, outNumFolders); pop3Server = currentServer.QueryInterface(Components.interfaces.nsIPop3IncomingServer); // coalesce the servers that download into the same folder... var index = localFoldersToDownloadTo.GetIndexOf(inboxFolder); if (index == -1) { if(inboxFolder) { inboxFolder.biffState = Components.interfaces.nsIMsgFolder.nsMsgBiffState_NoMail; inboxFolder.clearNewMessages(); } localFoldersToDownloadTo.AppendElement(inboxFolder); index = pop3DownloadServersArray.length pop3DownloadServersArray[index] = Components.classes["@mozilla.org/supports-array;1"].createInstance(Components.interfaces.nsISupportsArray); pop3DownloadServersArray[index].AppendElement(currentServer); } else { pop3DownloadServersArray[index].AppendElement(currentServer); }} |
gDuration = gEndDate.getTime() - gStartDate.getTime(); | function commandAllDay(){ //user enddate == ical enddate - 1 (for allday events) if( getFieldValue( "all-day-event-checkbox", "checked" ) ) { gEndDate.setDate( gEndDate.getDate() + 1 ); } else { gEndDate.setDate( gEndDate.getDate() - 1 ); } updateStartEndItemEnabled(); updateOKButton();} |
|
this.currentDispatchDepth = 0; this.maxDispatchDepth = 10; this.dispatchUnwinding = false; | function CommandManager (defaultBundle){ this.commands = new Object(); this.defaultBundle = defaultBundle;} |
|
goUpdateCommand('cmd_newlist'); | function CommandUpdate_AddressBook(){ goUpdateCommand('cmd_delete'); goUpdateCommand('button_delete');} |
|
document.getElementById("messagepanebox").setAttribute("focusring","false"); document.getElementById("threadTree").setAttribute("focusring","false") document.getElementById("folderTree").setAttribute("focusring","false") if ( MessagePaneHasFocus() ) { document.getElementById("messagepanebox").setAttribute("focusring","true"); } else { if( WhichPaneHasFocus() == "threadTree"){ document.getElementById("threadTree").setAttribute("focusring","true") } else{ if(WhichPaneHasFocus()=="folderTree") document.getElementById("folderTree").setAttribute("focusring","true") } } | function CommandUpdate_Mail(){ //var messagePane = top.document.getElementById('messagePane'); //var drawFocusBorder = messagePane.getAttribute('draw-focus-border'); document.getElementById("messagepanebox").setAttribute("focusring","false"); document.getElementById("threadTree").setAttribute("focusring","false") document.getElementById("folderTree").setAttribute("focusring","false") if ( MessagePaneHasFocus() ) { //if ( !drawFocusBorder ) // messagePane.setAttribute('draw-focus-border', 'true'); document.getElementById("messagepanebox").setAttribute("focusring","true"); //document.getElementById("threadTree").setAttribute("focusring","false") //document.getElementById("folderTree").setAttribute("focusring","false") } else { //if ( drawFocusBorder ) // messagePane.removeAttribute('draw-focus-border'); //document.getElementById("messagepanebox").setAttribute("focusring","false"); if( WhichPaneHasFocus() == "threadTree"){ document.getElementById("threadTree").setAttribute("focusring","true") //document.getElementById("folderTree").setAttribute("focusring","false") } // mail3PaneWindowCommands.js else{ if(WhichPaneHasFocus()=="folderTree") //document.getElementById("threadTree").setAttribute("focusring","false") document.getElementById("folderTree").setAttribute("focusring","true") } } //goUpdateCommand('button_delete'); goUpdateCommand('cmd_delete'); goUpdateCommand('cmd_nextMsg'); goUpdateCommand('cmd_nextUnreadMsg'); goUpdateCommand('cmd_nextUnreadThread'); goUpdateCommand('cmd_nextFlaggedMsg'); goUpdateCommand('cmd_previousMsg'); goUpdateCommand('cmd_previousUnreadMsg'); goUpdateCommand('cmd_previousFlaggedMsg'); goUpdateCommand('cmd_sortByThread'); goUpdateCommand('cmd_viewAllMsgs'); goUpdateCommand('cmd_viewUnreadMsgs'); goUpdateCommand('cmd_expandAllThreads'); goUpdateCommand('cmd_collapseAllThreads'); goUpdateCommand('cmd_renameFolder'); goUpdateCommand('cmd_getNewMessages'); goUpdateCommand('cmd_getNextNMessages'); goUpdateCommand('cmd_find'); goUpdateCommand('cmd_findAgain'); goUpdateCommand('cmd_markAllRead'); goUpdateCommand('cmd_emptyTrash'); goUpdateCommand('cmd_compactFolder');} |
|
document.getElementById("threadTree").setAttribute("focusring","false") document.getElementById("folderTree").setAttribute("focusring","false") | function CommandUpdate_Mail(){ //var messagePane = top.document.getElementById('messagePane'); //var drawFocusBorder = messagePane.getAttribute('draw-focus-border'); if ( MessagePaneHasFocus() ) { //if ( !drawFocusBorder ) // messagePane.setAttribute('draw-focus-border', 'true'); document.getElementById("messagepanebox").setAttribute("focusring","true"); document.getElementById("threadTree").setAttribute("focusring","false") document.getElementById("folderTree").setAttribute("focusring","false") } else { //if ( drawFocusBorder ) // messagePane.removeAttribute('draw-focus-border'); document.getElementById("messagepanebox").setAttribute("focusring","false"); if( WhichPaneHasFocus() == "threadTree"){ document.getElementById("threadTree").setAttribute("focusring","true") document.getElementById("folderTree").setAttribute("focusring","false") } // mail3PaneWindowCommands.js else{ document.getElementById("threadTree").setAttribute("focusring","false") document.getElementById("folderTree").setAttribute("focusring","true") } } //goUpdateCommand('button_delete'); goUpdateCommand('cmd_delete'); goUpdateCommand('cmd_nextMsg'); goUpdateCommand('cmd_nextUnreadMsg'); goUpdateCommand('cmd_nextUnreadThread'); goUpdateCommand('cmd_nextFlaggedMsg'); goUpdateCommand('cmd_previousMsg'); goUpdateCommand('cmd_previousUnreadMsg'); goUpdateCommand('cmd_previousFlaggedMsg'); goUpdateCommand('cmd_sortByThread'); goUpdateCommand('cmd_viewAllMsgs'); goUpdateCommand('cmd_viewUnreadMsgs'); goUpdateCommand('cmd_expandAllThreads'); goUpdateCommand('cmd_collapseAllThreads'); goUpdateCommand('cmd_renameFolder'); goUpdateCommand('cmd_getNewMessages'); goUpdateCommand('cmd_getNextNMessages'); goUpdateCommand('cmd_find'); goUpdateCommand('cmd_findAgain'); goUpdateCommand('cmd_markAllRead'); goUpdateCommand('cmd_emptyTrash'); goUpdateCommand('cmd_compactFolder');} |
|
document.getElementById("messagepanebox").setAttribute("focusring","false"); | function CommandUpdate_Mail(){ //var messagePane = top.document.getElementById('messagePane'); //var drawFocusBorder = messagePane.getAttribute('draw-focus-border'); if ( MessagePaneHasFocus() ) { //if ( !drawFocusBorder ) // messagePane.setAttribute('draw-focus-border', 'true'); document.getElementById("messagepanebox").setAttribute("focusring","true"); document.getElementById("threadTree").setAttribute("focusring","false") document.getElementById("folderTree").setAttribute("focusring","false") } else { //if ( drawFocusBorder ) // messagePane.removeAttribute('draw-focus-border'); document.getElementById("messagepanebox").setAttribute("focusring","false"); if( WhichPaneHasFocus() == "threadTree"){ document.getElementById("threadTree").setAttribute("focusring","true") document.getElementById("folderTree").setAttribute("focusring","false") } // mail3PaneWindowCommands.js else{ document.getElementById("threadTree").setAttribute("focusring","false") document.getElementById("folderTree").setAttribute("focusring","true") } } //goUpdateCommand('button_delete'); goUpdateCommand('cmd_delete'); goUpdateCommand('cmd_nextMsg'); goUpdateCommand('cmd_nextUnreadMsg'); goUpdateCommand('cmd_nextUnreadThread'); goUpdateCommand('cmd_nextFlaggedMsg'); goUpdateCommand('cmd_previousMsg'); goUpdateCommand('cmd_previousUnreadMsg'); goUpdateCommand('cmd_previousFlaggedMsg'); goUpdateCommand('cmd_sortByThread'); goUpdateCommand('cmd_viewAllMsgs'); goUpdateCommand('cmd_viewUnreadMsgs'); goUpdateCommand('cmd_expandAllThreads'); goUpdateCommand('cmd_collapseAllThreads'); goUpdateCommand('cmd_renameFolder'); goUpdateCommand('cmd_getNewMessages'); goUpdateCommand('cmd_getNextNMessages'); goUpdateCommand('cmd_find'); goUpdateCommand('cmd_findAgain'); goUpdateCommand('cmd_markAllRead'); goUpdateCommand('cmd_emptyTrash'); goUpdateCommand('cmd_compactFolder');} |
|
document.getElementById("folderTree").setAttribute("focusring","false") | function CommandUpdate_Mail(){ //var messagePane = top.document.getElementById('messagePane'); //var drawFocusBorder = messagePane.getAttribute('draw-focus-border'); if ( MessagePaneHasFocus() ) { //if ( !drawFocusBorder ) // messagePane.setAttribute('draw-focus-border', 'true'); document.getElementById("messagepanebox").setAttribute("focusring","true"); document.getElementById("threadTree").setAttribute("focusring","false") document.getElementById("folderTree").setAttribute("focusring","false") } else { //if ( drawFocusBorder ) // messagePane.removeAttribute('draw-focus-border'); document.getElementById("messagepanebox").setAttribute("focusring","false"); if( WhichPaneHasFocus() == "threadTree"){ document.getElementById("threadTree").setAttribute("focusring","true") document.getElementById("folderTree").setAttribute("focusring","false") } // mail3PaneWindowCommands.js else{ document.getElementById("threadTree").setAttribute("focusring","false") document.getElementById("folderTree").setAttribute("focusring","true") } } //goUpdateCommand('button_delete'); goUpdateCommand('cmd_delete'); goUpdateCommand('cmd_nextMsg'); goUpdateCommand('cmd_nextUnreadMsg'); goUpdateCommand('cmd_nextUnreadThread'); goUpdateCommand('cmd_nextFlaggedMsg'); goUpdateCommand('cmd_previousMsg'); goUpdateCommand('cmd_previousUnreadMsg'); goUpdateCommand('cmd_previousFlaggedMsg'); goUpdateCommand('cmd_sortByThread'); goUpdateCommand('cmd_viewAllMsgs'); goUpdateCommand('cmd_viewUnreadMsgs'); goUpdateCommand('cmd_expandAllThreads'); goUpdateCommand('cmd_collapseAllThreads'); goUpdateCommand('cmd_renameFolder'); goUpdateCommand('cmd_getNewMessages'); goUpdateCommand('cmd_getNextNMessages'); goUpdateCommand('cmd_find'); goUpdateCommand('cmd_findAgain'); goUpdateCommand('cmd_markAllRead'); goUpdateCommand('cmd_emptyTrash'); goUpdateCommand('cmd_compactFolder');} |
|
document.getElementById("threadTree").setAttribute("focusring","false") | if(WhichPaneHasFocus()=="folderTree") | function CommandUpdate_Mail(){ //var messagePane = top.document.getElementById('messagePane'); //var drawFocusBorder = messagePane.getAttribute('draw-focus-border'); if ( MessagePaneHasFocus() ) { //if ( !drawFocusBorder ) // messagePane.setAttribute('draw-focus-border', 'true'); document.getElementById("messagepanebox").setAttribute("focusring","true"); document.getElementById("threadTree").setAttribute("focusring","false") document.getElementById("folderTree").setAttribute("focusring","false") } else { //if ( drawFocusBorder ) // messagePane.removeAttribute('draw-focus-border'); document.getElementById("messagepanebox").setAttribute("focusring","false"); if( WhichPaneHasFocus() == "threadTree"){ document.getElementById("threadTree").setAttribute("focusring","true") document.getElementById("folderTree").setAttribute("focusring","false") } // mail3PaneWindowCommands.js else{ document.getElementById("threadTree").setAttribute("focusring","false") document.getElementById("folderTree").setAttribute("focusring","true") } } //goUpdateCommand('button_delete'); goUpdateCommand('cmd_delete'); goUpdateCommand('cmd_nextMsg'); goUpdateCommand('cmd_nextUnreadMsg'); goUpdateCommand('cmd_nextUnreadThread'); goUpdateCommand('cmd_nextFlaggedMsg'); goUpdateCommand('cmd_previousMsg'); goUpdateCommand('cmd_previousUnreadMsg'); goUpdateCommand('cmd_previousFlaggedMsg'); goUpdateCommand('cmd_sortByThread'); goUpdateCommand('cmd_viewAllMsgs'); goUpdateCommand('cmd_viewUnreadMsgs'); goUpdateCommand('cmd_expandAllThreads'); goUpdateCommand('cmd_collapseAllThreads'); goUpdateCommand('cmd_renameFolder'); goUpdateCommand('cmd_getNewMessages'); goUpdateCommand('cmd_getNextNMessages'); goUpdateCommand('cmd_find'); goUpdateCommand('cmd_findAgain'); goUpdateCommand('cmd_markAllRead'); goUpdateCommand('cmd_emptyTrash'); goUpdateCommand('cmd_compactFolder');} |
goUpdateCommand('button_reply'); goUpdateCommand('button_replyall'); goUpdateCommand('button_forward'); | function CommandUpdate_Mail(){ /*var messagePane = top.document.getElementById('messagePane'); var drawFocusBorder = messagePane.getAttribute('draw-focus-border'); if ( MessagePaneHasFocus() ) { if ( !drawFocusBorder ) messagePane.setAttribute('draw-focus-border', 'true'); } else { if ( drawFocusBorder ) messagePane.removeAttribute('draw-focus-border'); }*/ goUpdateCommand('cmd_delete'); goUpdateCommand('button_delete'); goUpdateCommand('cmd_shiftDelete'); goUpdateCommand('cmd_nextMsg'); goUpdateCommand('cmd_nextUnreadMsg'); goUpdateCommand('cmd_nextUnreadThread'); goUpdateCommand('cmd_nextFlaggedMsg'); goUpdateCommand('cmd_previousMsg'); goUpdateCommand('cmd_previousUnreadMsg'); goUpdateCommand('cmd_previousFlaggedMsg'); goUpdateCommand('cmd_sortBySubject'); goUpdateCommand('cmd_sortByDate'); goUpdateCommand('cmd_sortByFlag'); goUpdateCommand('cmd_sortByPriority'); goUpdateCommand('cmd_sortBySender'); goUpdateCommand('cmd_sortBySize'); goUpdateCommand('cmd_sortByStatus'); goUpdateCommand('cmd_sortByRead'); goUpdateCommand('cmd_sortByOrderReceived'); goUpdateCommand('cmd_sortAscending'); goUpdateCommand('cmd_sortDescending'); goUpdateCommand('cmd_sortByThread'); goUpdateCommand('cmd_viewAllMsgs'); goUpdateCommand('cmd_viewUnreadMsgs');} |
|
goUpdateCommand("cmd_sendNow"); goUpdateCommand("cmd_sendLater"); | goUpdateCommand("cmd_attachFile"); goUpdateCommand("cmd_attachPage"); goUpdateCommand("cmd_close"); | function CommandUpdate_MsgCompose(){ goUpdateCommand("cmd_sendNow"); goUpdateCommand("cmd_sendLater"); goUpdateCommand("cmd_saveDefault"); goUpdateCommand("cmd_saveAsDraft"); goUpdateCommand("cmd_saveAsTemplate"); goUpdateCommand("cmd_attachFile"); goUpdateCommand("cmd_selectAddress");} |
goUpdateCommand("cmd_attachFile"); | goUpdateCommand("cmd_sendNow"); goUpdateCommand("cmd_sendLater"); goUpdateCommand("cmd_quit"); goUpdateCommand("cmd_pasteQuote"); goUpdateCommand("cmd_find"); goUpdateCommand("cmd_findNext"); goUpdateCommand("cmd_account"); goUpdateCommand("cmd_preferences"); goUpdateCommand("cmd_showComposeToolbar"); goUpdateCommand("cmd_showFormatToolbar"); goUpdateCommand("cmd_insert"); goUpdateCommand("cmd_link"); goUpdateCommand("cmd_anchor"); goUpdateCommand("cmd_image"); goUpdateCommand("cmd_hline"); goUpdateCommand("cmd_table"); goUpdateCommand("cmd_insertHTML"); goUpdateCommand("cmd_insertChars"); goUpdateCommand("cmd_insertBreak"); goUpdateCommand("cmd_insertBreakAll"); goUpdateCommand("cmd_format"); goUpdateCommand("cmd_decreaseFont"); goUpdateCommand("cmd_increaseFont"); goUpdateCommand("cmd_bold"); goUpdateCommand("cmd_italic"); goUpdateCommand("cmd_underline"); goUpdateCommand("cmd_strikethrough"); goUpdateCommand("cmd_superscript"); goUpdateCommand("cmd_subscript"); goUpdateCommand("cmd_nobreak"); goUpdateCommand("cmd_em"); goUpdateCommand("cmd_strong"); goUpdateCommand("cmd_cite"); goUpdateCommand("cmd_abbr"); goUpdateCommand("cmd_acronym"); goUpdateCommand("cmd_code"); goUpdateCommand("cmd_samp"); goUpdateCommand("cmd_var"); goUpdateCommand("cmd_removeList"); goUpdateCommand("cmd_ul"); goUpdateCommand("cmd_ol"); goUpdateCommand("cmd_dt"); goUpdateCommand("cmd_dd"); goUpdateCommand("cmd_listProperties"); goUpdateCommand("cmd_indent"); goUpdateCommand("cmd_outdent"); goUpdateCommand("cmd_objectProperties"); goUpdateCommand("cmd_InsertTable"); goUpdateCommand("cmd_InsertRowAbove"); goUpdateCommand("cmd_InsertRowBelow"); goUpdateCommand("cmd_InsertColumnBefore"); goUpdateCommand("cmd_InsertColumnAfter"); goUpdateCommand("cmd_SelectTable"); goUpdateCommand("cmd_SelectRow"); goUpdateCommand("cmd_SelectColumn"); goUpdateCommand("cmd_SelectCell"); goUpdateCommand("cmd_SelectAllCells"); goUpdateCommand("cmd_DeleteTable"); goUpdateCommand("cmd_DeleteRow"); goUpdateCommand("cmd_DeleteColumn"); goUpdateCommand("cmd_DeleteCell"); goUpdateCommand("cmd_DeleteCellContents"); goUpdateCommand("cmd_NormalizeTable"); goUpdateCommand("cmd_tableJoinCells"); goUpdateCommand("cmd_tableSplitCell"); goUpdateCommand("cmd_editTable"); | function CommandUpdate_MsgCompose(){ goUpdateCommand("cmd_sendNow"); goUpdateCommand("cmd_sendLater"); goUpdateCommand("cmd_saveDefault"); goUpdateCommand("cmd_saveAsDraft"); goUpdateCommand("cmd_saveAsTemplate"); goUpdateCommand("cmd_attachFile"); goUpdateCommand("cmd_selectAddress");} |
goUpdateCommand("cmd_outputFormat"); | function CommandUpdate_MsgCompose(){ goUpdateCommand("cmd_sendNow"); goUpdateCommand("cmd_sendLater"); goUpdateCommand("cmd_saveDefault"); goUpdateCommand("cmd_saveAsDraft"); goUpdateCommand("cmd_saveAsTemplate"); goUpdateCommand("cmd_attachFile"); goUpdateCommand("cmd_selectAddress");} |
|
goUpdateCommand("cmd_saveAsFile"); | function CommandUpdate_MsgCompose(){// dump("\nCommandUpdate_MsgCompose\n"); try { //File Menu goUpdateCommand("cmd_attachFile"); goUpdateCommand("cmd_attachPage"); goUpdateCommand("cmd_close"); goUpdateCommand("cmd_saveDefault"); goUpdateCommand("cmd_saveAsDraft"); goUpdateCommand("cmd_saveAsTemplate"); goUpdateCommand("cmd_sendNow"); goUpdateCommand("cmd_sendLater"); goUpdateCommand("cmd_quit"); //Edit Menu goUpdateCommand("cmd_pasteQuote"); goUpdateCommand("cmd_find"); goUpdateCommand("cmd_findNext"); goUpdateCommand("cmd_account"); goUpdateCommand("cmd_preferences"); //View Menu goUpdateCommand("cmd_showComposeToolbar"); goUpdateCommand("cmd_showFormatToolbar"); //Insert Menu if (msgCompose.composeHTML) { goUpdateCommand("cmd_insert"); goUpdateCommand("cmd_link"); goUpdateCommand("cmd_anchor"); goUpdateCommand("cmd_image"); goUpdateCommand("cmd_hline"); goUpdateCommand("cmd_table"); goUpdateCommand("cmd_insertHTML"); goUpdateCommand("cmd_insertChars"); goUpdateCommand("cmd_insertBreak"); goUpdateCommand("cmd_insertBreakAll"); } //Format Menu if (msgCompose.composeHTML) { goUpdateCommand("cmd_format"); goUpdateCommand("cmd_decreaseFont"); goUpdateCommand("cmd_increaseFont"); goUpdateCommand("cmd_bold"); goUpdateCommand("cmd_italic"); goUpdateCommand("cmd_underline"); goUpdateCommand("cmd_strikethrough"); goUpdateCommand("cmd_superscript"); goUpdateCommand("cmd_subscript"); goUpdateCommand("cmd_nobreak"); goUpdateCommand("cmd_em"); goUpdateCommand("cmd_strong"); goUpdateCommand("cmd_cite"); goUpdateCommand("cmd_abbr"); goUpdateCommand("cmd_acronym"); goUpdateCommand("cmd_code"); goUpdateCommand("cmd_samp"); goUpdateCommand("cmd_var"); goUpdateCommand("cmd_removeList"); goUpdateCommand("cmd_ul"); goUpdateCommand("cmd_ol"); goUpdateCommand("cmd_dt"); goUpdateCommand("cmd_dd"); goUpdateCommand("cmd_listProperties"); goUpdateCommand("cmd_indent"); goUpdateCommand("cmd_outdent"); goUpdateCommand("cmd_objectProperties"); goUpdateCommand("cmd_InsertTable"); goUpdateCommand("cmd_InsertRowAbove"); goUpdateCommand("cmd_InsertRowBelow"); goUpdateCommand("cmd_InsertColumnBefore"); goUpdateCommand("cmd_InsertColumnAfter"); goUpdateCommand("cmd_SelectTable"); goUpdateCommand("cmd_SelectRow"); goUpdateCommand("cmd_SelectColumn"); goUpdateCommand("cmd_SelectCell"); goUpdateCommand("cmd_SelectAllCells"); goUpdateCommand("cmd_DeleteTable"); goUpdateCommand("cmd_DeleteRow"); goUpdateCommand("cmd_DeleteColumn"); goUpdateCommand("cmd_DeleteCell"); goUpdateCommand("cmd_DeleteCellContents"); goUpdateCommand("cmd_NormalizeTable"); goUpdateCommand("cmd_tableJoinCells"); goUpdateCommand("cmd_tableSplitCell"); goUpdateCommand("cmd_editTable"); } //Options Menu goUpdateCommand("cmd_selectAddress"); goUpdateCommand("cmd_spelling"); goUpdateCommand("cmd_outputFormat");// goUpdateCommand("cmd_quoteMessage"); } catch(e) {}} |
|
try { goUpdateCommand("cmd_close"); goUpdateCommand("cmd_print"); goUpdateCommand("cmd_quit"); goUpdateCommand("cmd_pasteQuote"); goUpdateCommand("cmd_find"); goUpdateCommand("cmd_findNext"); goUpdateCommand("cmd_preferences"); if (msgCompose && msgCompose.composeHTML) { goUpdateCommand("cmd_insert"); goUpdateCommand("cmd_link"); goUpdateCommand("cmd_anchor"); goUpdateCommand("cmd_image"); goUpdateCommand("cmd_hline"); goUpdateCommand("cmd_table"); goUpdateCommand("cmd_insertHTML"); goUpdateCommand("cmd_insertChars"); goUpdateCommand("cmd_insertBreak"); goUpdateCommand("cmd_insertBreakAll"); goUpdateCommand("cmd_format"); goUpdateCommand("cmd_decreaseFont"); goUpdateCommand("cmd_increaseFont"); goUpdateCommand("cmd_bold"); goUpdateCommand("cmd_italic"); goUpdateCommand("cmd_underline"); goUpdateCommand("cmd_strikethrough"); goUpdateCommand("cmd_superscript"); goUpdateCommand("cmd_subscript"); goUpdateCommand("cmd_nobreak"); goUpdateCommand("cmd_em"); goUpdateCommand("cmd_strong"); goUpdateCommand("cmd_cite"); goUpdateCommand("cmd_abbr"); goUpdateCommand("cmd_acronym"); goUpdateCommand("cmd_code"); goUpdateCommand("cmd_samp"); goUpdateCommand("cmd_var"); goUpdateCommand("cmd_removeList"); goUpdateCommand("cmd_ul"); goUpdateCommand("cmd_ol"); goUpdateCommand("cmd_dt"); goUpdateCommand("cmd_dd"); goUpdateCommand("cmd_listProperties"); goUpdateCommand("cmd_indent"); goUpdateCommand("cmd_outdent"); goUpdateCommand("cmd_align"); goUpdateCommand("cmd_smiley"); goUpdateCommand("cmd_objectProperties"); goUpdateCommand("cmd_InsertTable"); goUpdateCommand("cmd_InsertRowAbove"); goUpdateCommand("cmd_InsertRowBelow"); goUpdateCommand("cmd_InsertColumnBefore"); goUpdateCommand("cmd_InsertColumnAfter"); goUpdateCommand("cmd_SelectTable"); goUpdateCommand("cmd_SelectRow"); goUpdateCommand("cmd_SelectColumn"); goUpdateCommand("cmd_SelectCell"); goUpdateCommand("cmd_SelectAllCells"); goUpdateCommand("cmd_DeleteTable"); goUpdateCommand("cmd_DeleteRow"); goUpdateCommand("cmd_DeleteColumn"); goUpdateCommand("cmd_DeleteCell"); goUpdateCommand("cmd_DeleteCellContents"); goUpdateCommand("cmd_NormalizeTable"); goUpdateCommand("cmd_tableJoinCells"); goUpdateCommand("cmd_tableSplitCell"); goUpdateCommand("cmd_editTable"); } goUpdateCommand("cmd_spelling"); } catch(e) {} | window.setTimeout("updateComposeItems()", 0); | function CommandUpdate_MsgCompose(){// dump("\nCommandUpdate_MsgCompose\n"); try { //File Menu// goUpdateCommand("cmd_attachFile");// goUpdateCommand("cmd_attachPage"); goUpdateCommand("cmd_close");// goUpdateCommand("cmd_saveDefault");// goUpdateCommand("cmd_saveAsFile");// goUpdateCommand("cmd_saveAsDraft");// goUpdateCommand("cmd_saveAsTemplate");// goUpdateCommand("cmd_sendButton");// goUpdateCommand("cmd_sendNow");// goUpdateCommand("cmd_sendLater");// goUpdateCommand("cmd_printSetup"); goUpdateCommand("cmd_print"); goUpdateCommand("cmd_quit"); //Edit Menu goUpdateCommand("cmd_pasteQuote"); goUpdateCommand("cmd_find"); goUpdateCommand("cmd_findNext");// goUpdateCommand("cmd_account"); goUpdateCommand("cmd_preferences"); //View Menu// goUpdateCommand("cmd_showComposeToolbar");// goUpdateCommand("cmd_showFormatToolbar"); //Insert Menu if (msgCompose && msgCompose.composeHTML) { goUpdateCommand("cmd_insert"); goUpdateCommand("cmd_link"); goUpdateCommand("cmd_anchor"); goUpdateCommand("cmd_image"); goUpdateCommand("cmd_hline"); goUpdateCommand("cmd_table"); goUpdateCommand("cmd_insertHTML"); goUpdateCommand("cmd_insertChars"); goUpdateCommand("cmd_insertBreak"); goUpdateCommand("cmd_insertBreakAll"); //Format Menu goUpdateCommand("cmd_format"); goUpdateCommand("cmd_decreaseFont"); goUpdateCommand("cmd_increaseFont"); goUpdateCommand("cmd_bold"); goUpdateCommand("cmd_italic"); goUpdateCommand("cmd_underline"); goUpdateCommand("cmd_strikethrough"); goUpdateCommand("cmd_superscript"); goUpdateCommand("cmd_subscript"); goUpdateCommand("cmd_nobreak"); goUpdateCommand("cmd_em"); goUpdateCommand("cmd_strong"); goUpdateCommand("cmd_cite"); goUpdateCommand("cmd_abbr"); goUpdateCommand("cmd_acronym"); goUpdateCommand("cmd_code"); goUpdateCommand("cmd_samp"); goUpdateCommand("cmd_var"); goUpdateCommand("cmd_removeList"); goUpdateCommand("cmd_ul"); goUpdateCommand("cmd_ol"); goUpdateCommand("cmd_dt"); goUpdateCommand("cmd_dd"); goUpdateCommand("cmd_listProperties"); goUpdateCommand("cmd_indent"); goUpdateCommand("cmd_outdent"); goUpdateCommand("cmd_align"); goUpdateCommand("cmd_smiley"); goUpdateCommand("cmd_objectProperties"); goUpdateCommand("cmd_InsertTable"); goUpdateCommand("cmd_InsertRowAbove"); goUpdateCommand("cmd_InsertRowBelow"); goUpdateCommand("cmd_InsertColumnBefore"); goUpdateCommand("cmd_InsertColumnAfter"); goUpdateCommand("cmd_SelectTable"); goUpdateCommand("cmd_SelectRow"); goUpdateCommand("cmd_SelectColumn"); goUpdateCommand("cmd_SelectCell"); goUpdateCommand("cmd_SelectAllCells"); goUpdateCommand("cmd_DeleteTable"); goUpdateCommand("cmd_DeleteRow"); goUpdateCommand("cmd_DeleteColumn"); goUpdateCommand("cmd_DeleteCell"); goUpdateCommand("cmd_DeleteCellContents"); goUpdateCommand("cmd_NormalizeTable"); goUpdateCommand("cmd_tableJoinCells"); goUpdateCommand("cmd_tableSplitCell"); goUpdateCommand("cmd_editTable"); } //Options Menu// goUpdateCommand("cmd_selectAddress"); goUpdateCommand("cmd_spelling");// goUpdateCommand("cmd_outputFormat");// goUpdateCommand("cmd_quoteMessage");// goUpdateCommand("cmd_rewrap"); } catch(e) {}} |
var dayRange = dayRangeNode.selectedItem.getAttribute("data"); | var dayRange = dayRangeNode.selectedItem.getAttribute("value"); | function Commit(){ var changed = false; // Grovel through the fields to see if any of the values have // changed. If so, update the RDF graph and force them to be saved // to disk. for (var i = 0; i < gFields.length; ++i) { var field = document.getElementById(gFields[i]); if (field) { // Get the new value as a literal, using 'null' if the value is empty. var newvalue = field.value; var oldvalue = Bookmarks.GetTarget(RDF.GetResource(gBookmarkURL), RDF.GetResource(gProperties[i]), true); if (oldvalue) oldvalue = oldvalue.QueryInterface(Components.interfaces.nsIRDFLiteral); if (newvalue && gProperties[i] == (NC_NAMESPACE_URI + "ShortcutURL")) { // shortcuts are always lowercased internally newvalue = newvalue.toLowerCase(); } else if (newvalue && gProperties[i] == (NC_NAMESPACE_URI + "URL")) { // we're dealing with the URL attribute; // if a scheme isn't specified, use "http://" if (newvalue.indexOf(":") < 0) newvalue = "http://" + newvalue; } if (newvalue) newvalue = RDF.GetLiteral(newvalue); if (updateAttribute(gProperties[i], oldvalue, newvalue)) { // Update gBookmarkURL if the url changed if (newvalue && gProperties[i] == NC_NAMESPACE_URI + "URL") gBookmarkURL = newvalue.Value; changed = true; } } } // Update bookmark schedule if necessary; // if the tab was removed, just skip it var scheduleTab = document.getElementById("ScheduleTab"); if (scheduleTab) { var scheduleRes = "http://home.netscape.com/WEB-rdf#Schedule"; oldvalue = Bookmarks.GetTarget(RDF.GetResource(gBookmarkURL), RDF.GetResource(scheduleRes), true); newvalue = ""; var dayRangeNode = document.getElementById("dayRange"); var dayRange = dayRangeNode.selectedItem.getAttribute("data"); if (dayRange) { var startHourRangeNode = document.getElementById("startHourRange"); var startHourRange = startHourRangeNode.selectedItem.getAttribute("data"); var endHourRangeNode = document.getElementById("endHourRange"); var endHourRange = endHourRangeNode.selectedItem.getAttribute("data"); if (parseInt(startHourRange) > parseInt(endHourRange)) { var temp = startHourRange; startHourRange = endHourRange; endHourRange = temp; } var bookmarkBundle; var duration = document.getElementById("duration").value; if (!duration) { bookmarkBundle = document.getElementById("bundle_bookmark"); alert (bookmarkBundle.getString("pleaseEnterADuration")); return false; } var methods = []; if (document.getElementById("bookmarkIcon").checked) methods.push("icon"); if (document.getElementById("playSound").checked) methods.push("sound"); if (document.getElementById("showAlert").checked) methods.push("alert"); if (document.getElementById("openWindow").checked) methods.push("open"); if (methods.length == 0) { bookmarkBundle = document.getElementById("bundle_bookmark"); alert (bookmarkBundle.getString("pleaseSelectANotification")); return false; } var method = methods.join(); // join string in array with "," newvalue = dayRange + "|" + startHourRange + "-" + endHourRange + "|" + duration + "|" + method; } if (newvalue) newvalue = RDF.GetLiteral(newvalue); if (updateAttribute(scheduleRes, oldvalue, newvalue)) changed = true; } if (changed) { var remote = Bookmarks.QueryInterface(Components.interfaces.nsIRDFRemoteDataSource); if (remote) remote.Flush(); } window.close(); return true;} |
var startHourRange = startHourRangeNode.selectedItem.getAttribute("data"); | var startHourRange = startHourRangeNode.selectedItem.getAttribute("value"); | function Commit(){ var changed = false; // Grovel through the fields to see if any of the values have // changed. If so, update the RDF graph and force them to be saved // to disk. for (var i = 0; i < gFields.length; ++i) { var field = document.getElementById(gFields[i]); if (field) { // Get the new value as a literal, using 'null' if the value is empty. var newvalue = field.value; var oldvalue = Bookmarks.GetTarget(RDF.GetResource(gBookmarkURL), RDF.GetResource(gProperties[i]), true); if (oldvalue) oldvalue = oldvalue.QueryInterface(Components.interfaces.nsIRDFLiteral); if (newvalue && gProperties[i] == (NC_NAMESPACE_URI + "ShortcutURL")) { // shortcuts are always lowercased internally newvalue = newvalue.toLowerCase(); } else if (newvalue && gProperties[i] == (NC_NAMESPACE_URI + "URL")) { // we're dealing with the URL attribute; // if a scheme isn't specified, use "http://" if (newvalue.indexOf(":") < 0) newvalue = "http://" + newvalue; } if (newvalue) newvalue = RDF.GetLiteral(newvalue); if (updateAttribute(gProperties[i], oldvalue, newvalue)) { // Update gBookmarkURL if the url changed if (newvalue && gProperties[i] == NC_NAMESPACE_URI + "URL") gBookmarkURL = newvalue.Value; changed = true; } } } // Update bookmark schedule if necessary; // if the tab was removed, just skip it var scheduleTab = document.getElementById("ScheduleTab"); if (scheduleTab) { var scheduleRes = "http://home.netscape.com/WEB-rdf#Schedule"; oldvalue = Bookmarks.GetTarget(RDF.GetResource(gBookmarkURL), RDF.GetResource(scheduleRes), true); newvalue = ""; var dayRangeNode = document.getElementById("dayRange"); var dayRange = dayRangeNode.selectedItem.getAttribute("data"); if (dayRange) { var startHourRangeNode = document.getElementById("startHourRange"); var startHourRange = startHourRangeNode.selectedItem.getAttribute("data"); var endHourRangeNode = document.getElementById("endHourRange"); var endHourRange = endHourRangeNode.selectedItem.getAttribute("data"); if (parseInt(startHourRange) > parseInt(endHourRange)) { var temp = startHourRange; startHourRange = endHourRange; endHourRange = temp; } var bookmarkBundle; var duration = document.getElementById("duration").value; if (!duration) { bookmarkBundle = document.getElementById("bundle_bookmark"); alert (bookmarkBundle.getString("pleaseEnterADuration")); return false; } var methods = []; if (document.getElementById("bookmarkIcon").checked) methods.push("icon"); if (document.getElementById("playSound").checked) methods.push("sound"); if (document.getElementById("showAlert").checked) methods.push("alert"); if (document.getElementById("openWindow").checked) methods.push("open"); if (methods.length == 0) { bookmarkBundle = document.getElementById("bundle_bookmark"); alert (bookmarkBundle.getString("pleaseSelectANotification")); return false; } var method = methods.join(); // join string in array with "," newvalue = dayRange + "|" + startHourRange + "-" + endHourRange + "|" + duration + "|" + method; } if (newvalue) newvalue = RDF.GetLiteral(newvalue); if (updateAttribute(scheduleRes, oldvalue, newvalue)) changed = true; } if (changed) { var remote = Bookmarks.QueryInterface(Components.interfaces.nsIRDFRemoteDataSource); if (remote) remote.Flush(); } window.close(); return true;} |
var endHourRange = endHourRangeNode.selectedItem.getAttribute("data"); | var endHourRange = endHourRangeNode.selectedItem.getAttribute("value"); | function Commit(){ var changed = false; // Grovel through the fields to see if any of the values have // changed. If so, update the RDF graph and force them to be saved // to disk. for (var i = 0; i < gFields.length; ++i) { var field = document.getElementById(gFields[i]); if (field) { // Get the new value as a literal, using 'null' if the value is empty. var newvalue = field.value; var oldvalue = Bookmarks.GetTarget(RDF.GetResource(gBookmarkURL), RDF.GetResource(gProperties[i]), true); if (oldvalue) oldvalue = oldvalue.QueryInterface(Components.interfaces.nsIRDFLiteral); if (newvalue && gProperties[i] == (NC_NAMESPACE_URI + "ShortcutURL")) { // shortcuts are always lowercased internally newvalue = newvalue.toLowerCase(); } else if (newvalue && gProperties[i] == (NC_NAMESPACE_URI + "URL")) { // we're dealing with the URL attribute; // if a scheme isn't specified, use "http://" if (newvalue.indexOf(":") < 0) newvalue = "http://" + newvalue; } if (newvalue) newvalue = RDF.GetLiteral(newvalue); if (updateAttribute(gProperties[i], oldvalue, newvalue)) { // Update gBookmarkURL if the url changed if (newvalue && gProperties[i] == NC_NAMESPACE_URI + "URL") gBookmarkURL = newvalue.Value; changed = true; } } } // Update bookmark schedule if necessary; // if the tab was removed, just skip it var scheduleTab = document.getElementById("ScheduleTab"); if (scheduleTab) { var scheduleRes = "http://home.netscape.com/WEB-rdf#Schedule"; oldvalue = Bookmarks.GetTarget(RDF.GetResource(gBookmarkURL), RDF.GetResource(scheduleRes), true); newvalue = ""; var dayRangeNode = document.getElementById("dayRange"); var dayRange = dayRangeNode.selectedItem.getAttribute("data"); if (dayRange) { var startHourRangeNode = document.getElementById("startHourRange"); var startHourRange = startHourRangeNode.selectedItem.getAttribute("data"); var endHourRangeNode = document.getElementById("endHourRange"); var endHourRange = endHourRangeNode.selectedItem.getAttribute("data"); if (parseInt(startHourRange) > parseInt(endHourRange)) { var temp = startHourRange; startHourRange = endHourRange; endHourRange = temp; } var bookmarkBundle; var duration = document.getElementById("duration").value; if (!duration) { bookmarkBundle = document.getElementById("bundle_bookmark"); alert (bookmarkBundle.getString("pleaseEnterADuration")); return false; } var methods = []; if (document.getElementById("bookmarkIcon").checked) methods.push("icon"); if (document.getElementById("playSound").checked) methods.push("sound"); if (document.getElementById("showAlert").checked) methods.push("alert"); if (document.getElementById("openWindow").checked) methods.push("open"); if (methods.length == 0) { bookmarkBundle = document.getElementById("bundle_bookmark"); alert (bookmarkBundle.getString("pleaseSelectANotification")); return false; } var method = methods.join(); // join string in array with "," newvalue = dayRange + "|" + startHourRange + "-" + endHourRange + "|" + duration + "|" + method; } if (newvalue) newvalue = RDF.GetLiteral(newvalue); if (updateAttribute(scheduleRes, oldvalue, newvalue)) changed = true; } if (changed) { var remote = Bookmarks.QueryInterface(Components.interfaces.nsIRDFRemoteDataSource); if (remote) remote.Flush(); } window.close(); return true;} |
var oldvalue = gBookmarks.GetTarget(RDF.GetResource(gBookmarkID), RDF.GetResource(gProperties[i]), true); | var oldvalue = BMDS.GetTarget(RDF.GetResource(gBookmarkID), RDF.GetResource(gProperties[i]), true); | function Commit(){ var changed = false; // Grovel through the fields to see if any of the values have // changed. If so, update the RDF graph and force them to be saved // to disk. for (var i = 0; i < gFields.length; ++i) { var field = document.getElementById(gFields[i]); if (field) { // Get the new value as a literal, using 'null' if the value is empty. var newvalue = field.value; var oldvalue = gBookmarks.GetTarget(RDF.GetResource(gBookmarkID), RDF.GetResource(gProperties[i]), true); if (oldvalue) oldvalue = oldvalue.QueryInterface(Components.interfaces.nsIRDFLiteral); if (newvalue && gProperties[i] == (NC_NS + "ShortcutURL")) { // shortcuts are always lowercased internally newvalue = newvalue.toLowerCase(); } else if (newvalue && gProperties[i] == (NC_NS + "URL")) { // we're dealing with the URL attribute; // if a scheme isn't specified, use "http://" if (newvalue.indexOf(":") < 0) newvalue = "http://" + newvalue; } if (newvalue) newvalue = RDF.GetLiteral(newvalue); if (updateAttribute(gProperties[i], oldvalue, newvalue)) { changed = true; } } } // Update bookmark schedule if necessary; // if the tab was removed, just skip it var scheduling = document.getElementById("scheduling"); var schedulingHidden = scheduling.getAttribute("hidden"); if (schedulingHidden != "true") { var scheduleRes = "http://home.netscape.com/WEB-rdf#Schedule"; oldvalue = gBookmarks.GetTarget(RDF.GetResource(gBookmarkID), RDF.GetResource(scheduleRes), true); newvalue = ""; var dayRangeNode = document.getElementById("dayRange"); var dayRange = dayRangeNode.selectedItem.getAttribute("value"); if (dayRange) { var startHourRangeNode = document.getElementById("startHourRange"); var startHourRange = startHourRangeNode.selectedItem.getAttribute("value"); var endHourRangeNode = document.getElementById("endHourRange"); var endHourRange = endHourRangeNode.selectedItem.getAttribute("value"); if (parseInt(startHourRange) > parseInt(endHourRange)) { var temp = startHourRange; startHourRange = endHourRange; endHourRange = temp; } var duration = document.getElementById("duration").value; if (!duration) { alert(BookmarksUtils.getLocaleString("pleaseEnterADuration")); return false; } var methods = []; if (document.getElementById("bookmarkIcon").checked) methods.push("icon"); if (document.getElementById("playSound").checked) methods.push("sound"); if (document.getElementById("showAlert").checked) methods.push("alert"); if (document.getElementById("openWindow").checked) methods.push("open"); if (methods.length == 0) { alert(BookmarksUtils.getLocaleString("pleaseSelectANotification")); return false; } var method = methods.join(); // join string in array with "," newvalue = dayRange + "|" + startHourRange + "-" + endHourRange + "|" + duration + "|" + method; } if (newvalue) newvalue = RDF.GetLiteral(newvalue); if (updateAttribute(scheduleRes, oldvalue, newvalue)) changed = true; } if (changed) { var remote = gBookmarks.QueryInterface(Components.interfaces.nsIRDFRemoteDataSource); if (remote) remote.Flush(); } window.close(); return true;} |
oldvalue = gBookmarks.GetTarget(RDF.GetResource(gBookmarkID), RDF.GetResource(scheduleRes), true); | oldvalue = BMDS.GetTarget(RDF.GetResource(gBookmarkID), RDF.GetResource(scheduleRes), true); | function Commit(){ var changed = false; // Grovel through the fields to see if any of the values have // changed. If so, update the RDF graph and force them to be saved // to disk. for (var i = 0; i < gFields.length; ++i) { var field = document.getElementById(gFields[i]); if (field) { // Get the new value as a literal, using 'null' if the value is empty. var newvalue = field.value; var oldvalue = gBookmarks.GetTarget(RDF.GetResource(gBookmarkID), RDF.GetResource(gProperties[i]), true); if (oldvalue) oldvalue = oldvalue.QueryInterface(Components.interfaces.nsIRDFLiteral); if (newvalue && gProperties[i] == (NC_NS + "ShortcutURL")) { // shortcuts are always lowercased internally newvalue = newvalue.toLowerCase(); } else if (newvalue && gProperties[i] == (NC_NS + "URL")) { // we're dealing with the URL attribute; // if a scheme isn't specified, use "http://" if (newvalue.indexOf(":") < 0) newvalue = "http://" + newvalue; } if (newvalue) newvalue = RDF.GetLiteral(newvalue); if (updateAttribute(gProperties[i], oldvalue, newvalue)) { changed = true; } } } // Update bookmark schedule if necessary; // if the tab was removed, just skip it var scheduling = document.getElementById("scheduling"); var schedulingHidden = scheduling.getAttribute("hidden"); if (schedulingHidden != "true") { var scheduleRes = "http://home.netscape.com/WEB-rdf#Schedule"; oldvalue = gBookmarks.GetTarget(RDF.GetResource(gBookmarkID), RDF.GetResource(scheduleRes), true); newvalue = ""; var dayRangeNode = document.getElementById("dayRange"); var dayRange = dayRangeNode.selectedItem.getAttribute("value"); if (dayRange) { var startHourRangeNode = document.getElementById("startHourRange"); var startHourRange = startHourRangeNode.selectedItem.getAttribute("value"); var endHourRangeNode = document.getElementById("endHourRange"); var endHourRange = endHourRangeNode.selectedItem.getAttribute("value"); if (parseInt(startHourRange) > parseInt(endHourRange)) { var temp = startHourRange; startHourRange = endHourRange; endHourRange = temp; } var duration = document.getElementById("duration").value; if (!duration) { alert(BookmarksUtils.getLocaleString("pleaseEnterADuration")); return false; } var methods = []; if (document.getElementById("bookmarkIcon").checked) methods.push("icon"); if (document.getElementById("playSound").checked) methods.push("sound"); if (document.getElementById("showAlert").checked) methods.push("alert"); if (document.getElementById("openWindow").checked) methods.push("open"); if (methods.length == 0) { alert(BookmarksUtils.getLocaleString("pleaseSelectANotification")); return false; } var method = methods.join(); // join string in array with "," newvalue = dayRange + "|" + startHourRange + "-" + endHourRange + "|" + duration + "|" + method; } if (newvalue) newvalue = RDF.GetLiteral(newvalue); if (updateAttribute(scheduleRes, oldvalue, newvalue)) changed = true; } if (changed) { var remote = gBookmarks.QueryInterface(Components.interfaces.nsIRDFRemoteDataSource); if (remote) remote.Flush(); } window.close(); return true;} |
var remote = gBookmarks.QueryInterface(Components.interfaces.nsIRDFRemoteDataSource); | var remote = BMDS.QueryInterface(Components.interfaces.nsIRDFRemoteDataSource); | function Commit(){ var changed = false; // Grovel through the fields to see if any of the values have // changed. If so, update the RDF graph and force them to be saved // to disk. for (var i = 0; i < gFields.length; ++i) { var field = document.getElementById(gFields[i]); if (field) { // Get the new value as a literal, using 'null' if the value is empty. var newvalue = field.value; var oldvalue = gBookmarks.GetTarget(RDF.GetResource(gBookmarkID), RDF.GetResource(gProperties[i]), true); if (oldvalue) oldvalue = oldvalue.QueryInterface(Components.interfaces.nsIRDFLiteral); if (newvalue && gProperties[i] == (NC_NS + "ShortcutURL")) { // shortcuts are always lowercased internally newvalue = newvalue.toLowerCase(); } else if (newvalue && gProperties[i] == (NC_NS + "URL")) { // we're dealing with the URL attribute; // if a scheme isn't specified, use "http://" if (newvalue.indexOf(":") < 0) newvalue = "http://" + newvalue; } if (newvalue) newvalue = RDF.GetLiteral(newvalue); if (updateAttribute(gProperties[i], oldvalue, newvalue)) { changed = true; } } } // Update bookmark schedule if necessary; // if the tab was removed, just skip it var scheduling = document.getElementById("scheduling"); var schedulingHidden = scheduling.getAttribute("hidden"); if (schedulingHidden != "true") { var scheduleRes = "http://home.netscape.com/WEB-rdf#Schedule"; oldvalue = gBookmarks.GetTarget(RDF.GetResource(gBookmarkID), RDF.GetResource(scheduleRes), true); newvalue = ""; var dayRangeNode = document.getElementById("dayRange"); var dayRange = dayRangeNode.selectedItem.getAttribute("value"); if (dayRange) { var startHourRangeNode = document.getElementById("startHourRange"); var startHourRange = startHourRangeNode.selectedItem.getAttribute("value"); var endHourRangeNode = document.getElementById("endHourRange"); var endHourRange = endHourRangeNode.selectedItem.getAttribute("value"); if (parseInt(startHourRange) > parseInt(endHourRange)) { var temp = startHourRange; startHourRange = endHourRange; endHourRange = temp; } var duration = document.getElementById("duration").value; if (!duration) { alert(BookmarksUtils.getLocaleString("pleaseEnterADuration")); return false; } var methods = []; if (document.getElementById("bookmarkIcon").checked) methods.push("icon"); if (document.getElementById("playSound").checked) methods.push("sound"); if (document.getElementById("showAlert").checked) methods.push("alert"); if (document.getElementById("openWindow").checked) methods.push("open"); if (methods.length == 0) { alert(BookmarksUtils.getLocaleString("pleaseSelectANotification")); return false; } var method = methods.join(); // join string in array with "," newvalue = dayRange + "|" + startHourRange + "-" + endHourRange + "|" + duration + "|" + method; } if (newvalue) newvalue = RDF.GetLiteral(newvalue); if (updateAttribute(scheduleRes, oldvalue, newvalue)) changed = true; } if (changed) { var remote = gBookmarks.QueryInterface(Components.interfaces.nsIRDFRemoteDataSource); if (remote) remote.Flush(); } window.close(); return true;} |
window.arguments[1].ok = true; | function Commit(){ var changed = false; // Grovel through the fields to see if any of the values have // changed. If so, update the RDF graph and force them to be saved // to disk. for (var i=0; i<gFields.length; ++i) { var field = document.getElementById(gFields[i]); if (! field) continue // Get the new value as a literal, using 'null' if the value is empty. var newValue = field.value; if (gFields[i] == "webpanel") newValue = field.checked ? "true" : undefined; var oldValue = BMDS.GetTarget(gResource, gProperties[i], true); if (oldValue) oldValue = oldValue.QueryInterface(Components.interfaces.nsIRDFLiteral); if (newValue && gFields[i] == "shortcut") // shortcuts are always lowercased internally newValue = newValue.toLowerCase(); else if (newValue && gFields[i] == "url") { if (newValue.indexOf(":") < 0) // we're dealing with the URL attribute; // if a scheme isn't specified, use "http://" newValue = "http://" + newValue; } if (newValue) newValue = RDF.GetLiteral(newValue); changed |= updateAttribute(gProperties[i], oldValue, newValue); } // Update bookmark schedule if necessary; // if the tab was removed, just skip it var scheduleTab = document.getElementById("ScheduleTab"); if (scheduleTab) { var scheduleArc = RDF.GetResource(WEB_NS+"Schedule"); oldValue = BMDS.GetTarget(gResource, scheduleArc, true); newValue = null; var dayRangeNode = document.getElementById("dayRange"); var dayRange = dayRangeNode.selectedItem.getAttribute("value"); if (dayRange) { var startHourRangeNode = document.getElementById("startHourRange"); var startHourRange = startHourRangeNode.selectedItem.getAttribute("value"); var endHourRangeNode = document.getElementById("endHourRange"); var endHourRange = endHourRangeNode.selectedItem.getAttribute("value"); if (parseInt(startHourRange) > parseInt(endHourRange)) { var temp = startHourRange; startHourRange = endHourRange; endHourRange = temp; } var duration = document.getElementById("duration").value; if (!duration) { alert(BookmarksUtils.getLocaleString("pleaseEnterADuration")); return false; } var methods = []; if (document.getElementById("bookmarkIcon").checked) methods.push("icon"); if (document.getElementById("playSound").checked) methods.push("sound"); if (document.getElementById("showAlert").checked) methods.push("alert"); if (document.getElementById("openWindow").checked) methods.push("open"); if (methods.length == 0) { alert(BookmarksUtils.getLocaleString("pleaseSelectANotification")); return false; } var method = methods.join(); // join string in array with "," newValue = dayRange + "|" + startHourRange + "-" + endHourRange + "|" + duration + "|" + method; } if (newValue) newValue = RDF.GetLiteral(newValue); changed |= updateAttribute(scheduleArc, oldValue, newValue); } if (changed) { var remote = BMDS.QueryInterface(Components.interfaces.nsIRDFRemoteDataSource); if (remote) remote.Flush(); } window.close(); return true;} |
|
var firstButton = document.documentElement.getButton("accept"); | function commonDialogOnLoad(){ // set the window title window.title = gCommonDialogParam.GetString(12); // set the number of command buttons var nButtons = gCommonDialogParam.GetInt(2); var dialog = document.documentElement; switch (nButtons) { case 1: dialog.getButton("cancel").hidden = true; break; case 4: dialog.getButton("extra2").hidden = false; case 3: dialog.getButton("extra1").hidden = false; } // display the main text var messageText = gCommonDialogParam.GetString(0); var messageParent = document.getElementById("info.box"); var messageParagraphs = messageText.split("\n"); for (var i = 0; i < messageParagraphs.length; i++) { var descriptionNode = document.createElement("description"); var text = document.createTextNode(messageParagraphs[i]); descriptionNode.appendChild(text); messageParent.appendChild(descriptionNode); } setElementText("info.header", gCommonDialogParam.GetString(3), true); // set the icon var iconElement = document.getElementById("info.icon"); var iconClass = gCommonDialogParam.GetString(2); if (!iconClass) iconClass = "message-icon"; iconElement.setAttribute("class", iconElement.getAttribute("class") + " " + iconClass); var firstButton = document.documentElement.getButton("accept"); switch (nButtons) { case 4: setLabelForNode(document.documentElement.getButton("extra2"), gCommonDialogParam.GetString(11)); // fall through case 3: setLabelForNode(document.documentElement.getButton("extra1"), gCommonDialogParam.GetString(10)); // fall through default: case 2: var string = gCommonDialogParam.GetString(9); if (string) setLabelForNode(document.documentElement.getButton("cancel"), string); // fall through case 1: string = gCommonDialogParam.GetString(8); if (string) setLabelForNode(firstButton, string); break; } // set default result to cancelled gCommonDialogParam.SetInt(0, 1); // initialize the checkbox setCheckbox(gCommonDialogParam.GetString(1), gCommonDialogParam.GetInt(1)); if (gCommonDialogParam.GetInt(3) == 0) // If no text fields firstButton.focus(); // Don't focus checkbox, focus first button instead getAttention();} |
|
setLabelForNode(firstButton, string); | setLabelForNode(document.documentElement.getButton("accept"), string); | function commonDialogOnLoad(){ // set the window title window.title = gCommonDialogParam.GetString(12); // set the number of command buttons var nButtons = gCommonDialogParam.GetInt(2); var dialog = document.documentElement; switch (nButtons) { case 1: dialog.getButton("cancel").hidden = true; break; case 4: dialog.getButton("extra2").hidden = false; case 3: dialog.getButton("extra1").hidden = false; } // display the main text var messageText = gCommonDialogParam.GetString(0); var messageParent = document.getElementById("info.box"); var messageParagraphs = messageText.split("\n"); for (var i = 0; i < messageParagraphs.length; i++) { var descriptionNode = document.createElement("description"); var text = document.createTextNode(messageParagraphs[i]); descriptionNode.appendChild(text); messageParent.appendChild(descriptionNode); } setElementText("info.header", gCommonDialogParam.GetString(3), true); // set the icon var iconElement = document.getElementById("info.icon"); var iconClass = gCommonDialogParam.GetString(2); if (!iconClass) iconClass = "message-icon"; iconElement.setAttribute("class", iconElement.getAttribute("class") + " " + iconClass); var firstButton = document.documentElement.getButton("accept"); switch (nButtons) { case 4: setLabelForNode(document.documentElement.getButton("extra2"), gCommonDialogParam.GetString(11)); // fall through case 3: setLabelForNode(document.documentElement.getButton("extra1"), gCommonDialogParam.GetString(10)); // fall through default: case 2: var string = gCommonDialogParam.GetString(9); if (string) setLabelForNode(document.documentElement.getButton("cancel"), string); // fall through case 1: string = gCommonDialogParam.GetString(8); if (string) setLabelForNode(firstButton, string); break; } // set default result to cancelled gCommonDialogParam.SetInt(0, 1); // initialize the checkbox setCheckbox(gCommonDialogParam.GetString(1), gCommonDialogParam.GetInt(1)); if (gCommonDialogParam.GetInt(3) == 0) // If no text fields firstButton.focus(); // Don't focus checkbox, focus first button instead getAttention();} |
firstButton.focus(); | { var dButton; var defaultButton = gCommonDialogParam.GetInt(5); switch (defaultButton) { case 3: dButton = document.documentElement.getButton("extra2"); break; case 2: dButton = document.documentElement.getButton("extra1"); break; case 1: dButton = document.documentElement.getButton("cancel"); break; default: case 0: dButton = document.documentElement.getButton("accept"); break; } document.documentElement.getButton("accept").setAttribute("default",false); dButton.setAttribute("default", true); dButton.focus(); } if (gCommonDialogParam.GetInt(6) != 0) { var delayInterval = 2000; try { var prefs = Components.classes["@mozilla.org/preferences-service;1"] .getService(Components.interfaces.nsIPrefBranch); delayInterval = prefs.getIntPref("security.dialog_enable_delay"); } catch (e) {} document.documentElement.getButton("accept").disabled = true; document.documentElement.getButton("extra1").disabled = true; document.documentElement.getButton("extra2").disabled = true; setTimeout(commonDialogReenableButtons, delayInterval); } | function commonDialogOnLoad(){ // set the window title window.title = gCommonDialogParam.GetString(12); // set the number of command buttons var nButtons = gCommonDialogParam.GetInt(2); var dialog = document.documentElement; switch (nButtons) { case 1: dialog.getButton("cancel").hidden = true; break; case 4: dialog.getButton("extra2").hidden = false; case 3: dialog.getButton("extra1").hidden = false; } // display the main text var messageText = gCommonDialogParam.GetString(0); var messageParent = document.getElementById("info.box"); var messageParagraphs = messageText.split("\n"); for (var i = 0; i < messageParagraphs.length; i++) { var descriptionNode = document.createElement("description"); var text = document.createTextNode(messageParagraphs[i]); descriptionNode.appendChild(text); messageParent.appendChild(descriptionNode); } setElementText("info.header", gCommonDialogParam.GetString(3), true); // set the icon var iconElement = document.getElementById("info.icon"); var iconClass = gCommonDialogParam.GetString(2); if (!iconClass) iconClass = "message-icon"; iconElement.setAttribute("class", iconElement.getAttribute("class") + " " + iconClass); var firstButton = document.documentElement.getButton("accept"); switch (nButtons) { case 4: setLabelForNode(document.documentElement.getButton("extra2"), gCommonDialogParam.GetString(11)); // fall through case 3: setLabelForNode(document.documentElement.getButton("extra1"), gCommonDialogParam.GetString(10)); // fall through default: case 2: var string = gCommonDialogParam.GetString(9); if (string) setLabelForNode(document.documentElement.getButton("cancel"), string); // fall through case 1: string = gCommonDialogParam.GetString(8); if (string) setLabelForNode(firstButton, string); break; } // set default result to cancelled gCommonDialogParam.SetInt(0, 1); // initialize the checkbox setCheckbox(gCommonDialogParam.GetString(1), gCommonDialogParam.GetInt(1)); if (gCommonDialogParam.GetInt(3) == 0) // If no text fields firstButton.focus(); // Don't focus checkbox, focus first button instead getAttention();} |
focus(); GetAttention(); | function commonDialogOnLoad(){ doSetOKCancel(commonDialogOnOK, commonDialogOnCancel, commonDialogOnButton2, commonDialogOnButton3); gCommonDialogParam = window.arguments[0].QueryInterface(Components.interfaces.nsIDialogParamBlock); // display the main text var messageText = gCommonDialogParam.GetString(0); var messageParent = document.getElementById("info.box"); var messageParagraphs = messageText.split("\n"); var i; for (i = 0; i < messageParagraphs.length; i++) { var descriptionNode = document.createElement("description"); //descriptionNode.setAttribute("style", "max-width: 45em;"); var text = document.createTextNode(messageParagraphs[i]); descriptionNode.appendChild(text); messageParent.appendChild(descriptionNode); } setElementText("info.header", gCommonDialogParam.GetString(3), true); // set the window title window.title = gCommonDialogParam.GetString(12); // set the icon var iconElement = document.getElementById("info.icon"); var iconClass = gCommonDialogParam.GetString(2); if (!iconClass) iconClass = "message-icon"; iconElement.setAttribute("class", iconElement.getAttribute("class") + " " + iconClass); // set the number of command buttons var nButtons = gCommonDialogParam.GetInt(2); if (nButtons == 1) hideElementById("cancel"); switch (nButtons) { case 4: unHideElementByID("Button3"); document.getElementById("Button3").label = gCommonDialogParam.GetString(11); // fall through case 3: unHideElementByID("Button2"); document.getElementById("Button2").label = gCommonDialogParam.GetString(10); // fall through default: case 2: var string = gCommonDialogParam.GetString(8); if (string) document.getElementById("ok").label = string; // fall through case 1: string = gCommonDialogParam.GetString(9); if (string) document.getElementById("cancel").label = string; break; } // initialize the checkbox setCheckbox(gCommonDialogParam.GetString(1), gCommonDialogParam.GetInt(1)); // initialize the edit fields var nEditFields = gCommonDialogParam.GetInt(3); switch (nEditFields) { case 2: var containerID, fieldID, labelID; if (gCommonDialogParam.GetInt(4) == 1) { // two password fields ('password' and 'retype password') var password2Container = document.getElementById("password2EditField"); password2Container.removeAttribute("collapsed"); var password2Field = document.getElementById("dialog.password2"); password2Field.value = gCommonDialogParam.GetString(7); var password2Label = gCommonDialogParam.GetString(5); if (password2Label) setElementText("password2.text", password2Label); containerID = "password1EditField"; fieldID = "dialog.password1"; labelID = "password1.text"; } else { // one login field and one password field var passwordContainer = document.getElementById("password1EditField"); passwordContainer.removeAttribute("collapsed"); var passwordField = document.getElementById("dialog.password1"); passwordField.value = gCommonDialogParam.GetString(7); var passwordLabel = gCommonDialogParam.GetString(5); if (passwordLabel) setElementText("password1.text", passwordLabel); containerID = "loginEditField"; fieldID = "dialog.loginname"; labelID = "login.text"; } unHideElementByID(containerID); var field = document.getElementById(fieldID); field.value = gCommonDialogParam.GetString(6); var label = gCommonDialogParam.GetString(4); if (label) setElementText(labelID, label); field.focus(); break; case 1: var editFieldIsPassword = gCommonDialogParam.GetInt(4); if (editFieldIsPassword == 1) { containerID = "password1EditField"; fieldID = "dialog.password1"; setElementText("password1.text", ""); // hide the meaningless text } else { containerID = "loginEditField"; fieldID = "dialog.loginname"; setElementText("login.text", gCommonDialogParam.GetString(4)); } unHideElementByID(containerID); field = document.getElementById(fieldID); field.value = gCommonDialogParam.GetString(6); field.focus(); break; } // set the pressed button to cancel to handle the case where the close box is pressed gCommonDialogParam.SetInt(0, 1); // set default focus // preferred order is textbox1, textbox2, textbox 3, OK, cancel, button2, button3 var visibilityList = ["loginEditField", "password1EditField", "password2EditField", "ok", "cancel", "Button2", "Button3"] var focusList = ["dialog.loginname", "dialog.password1", "dialog.password2", "ok", "cancel", "Button2", "Button3"] for (i = 0; i < visibilityList.length; i++) { if (isVisible(visibilityList[i])) { document.getElementById(focusList[i]).focus(); break; } }} |
|
element.setAttribute("style","display: none;" ); | element.setAttribute("style","visibility: collapse;" ); | function commonDialogOnLoad(){ dump("commonDialogOnLoad \n"); doSetOKCancel( commonDialogOnOK, commonDialogOnCancel, commonDialogOnButton2, commonDialogOnButton3 ); param = window.arguments[0].QueryInterface( Components.interfaces.nsIDialogParamBlock ); if( !param ) dump( " error getting param block interface\n" ); var messageText = param.GetString( 0 );// dump("message: "+ msg +"\n"); //SetElementText("info.txt", msg ); { var messageFragment; // Let the caller use "\n" to cause breaks // Translate these into <br> tags var messageParent = (document.getElementById("info.txt")); done = false; while (!done) { breakIndex = messageText.indexOf('\n'); if (breakIndex == 0) { // Ignore break at the first character messageText = messageText.slice(1); dump("Found break at begining\n"); messageFragment = ""; } else if (breakIndex > 0) { // The fragment up to the break messageFragment = messageText.slice(0, breakIndex); // Chop off fragment we just found from remaining string messageText = messageText.slice(breakIndex+1); } else { // "\n" not found. We're done done = true; messageFragment = messageText; } messageNode = document.createTextNode(messageFragment); if (messageNode) messageParent.appendChild(messageNode); // This is needed when the default namespace of the document is XUL breakNode = document.createElementWithNameSpace("BR", "http://www.w3.org/TR/REC-html40"); if (breakNode) messageParent.appendChild(breakNode); } } var msg = param.GetString( 3 );// dump("title message: "+ msg +"\n"); SetElementText("info.header", msg ); var windowTitle = param.GetString( 12 ); window.title = windowTitle; var iconURL = param.GetString(2 ); var element = document.getElementById("info.icon"); if( element ) element.src = iconURL; else dump("couldn't find icon element \n"); // Set button names var buttonText = param.GetString( 8 ); if ( buttonText != "" ) {// dump( "Setting OK Button to "+buttonText+"\n"); var okButton = document.getElementById("ok"); okButton.setAttribute("value", buttonText); } buttonText = param.GetString( 9 ); if ( buttonText != "" ) { // dump( "Setting Cancel Button to"+buttonText+"\n"); var cancelButton = document.getElementById("cancel"); cancelButton.setAttribute( "value",buttonText); } // Adjust number buttons var numButtons = param.GetInt( 2 ); if ( numButtons == 1 ) { } switch ( numButtons ) { case 4: { var button = document.getElementById("Button3"); button.setAttribute("style", "display:inline;"); var buttonText = param.GetString( 11 ); button.setAttribute( "value",buttonText); } case 3: { var button = document.getElementById("Button2"); button.setAttribute("style", "display:inline;"); var buttonText = param.GetString( 10 ); button.setAttribute( "value",buttonText); } break; case 1: var element = document.getElementById("cancel"); if ( element ) { // dump( "hide button \n" ); element.setAttribute("style", "display:none;" ); } else { // dump( "couldn't find button \n"); } break; } // Set the Checkbox// dump(" set checkbox \n"); var checkMsg = param.GetString( 1 );// dump("check box msg is "+ checkMsg +"\n"); if ( checkMsg != "" ) { var prompt = (document.getElementById("checkboxLabel")); if ( prompt ) { // dump(" setting message \n" ); prompt.childNodes[1].nodeValue = checkMsg; } var checkValue = param.GetInt( 1 ); var element=document.getElementById("checkbox" ); var checkbool = checkValue > 0 ? true : false; element.checked = checkbool; } else {// dump("not visibile \n"); var element = document.getElementById("checkboxLabel"); element.setAttribute("style","display: none;" ); } // handle the edit fields// dump("set editfields \n"); var numEditfields = param.GetInt( 3 ); switch( numEditfields ) { case 2: var element = document.getElementById("dialog.password2"); element.value = param.GetString( 7 ); var editMsg = param.GetString( 5 ); if (editMsg) { SetElementText("password2.text", editMsg ); } var editfield1Password = param.GetInt( 4 ); if ( editfield1Password == 1 ) { var element = document.getElementById("dialog.password1"); element.value = param.GetString( 6 ); var editMsg1 = param.GetString( 4 ); if (editMsg1) { SetElementText("password1.text", editMsg1 ); }// dump("hiding loginEditField"); var element = document.getElementById("loginEditField"); element.setAttribute("style","display: none;" ); var element = document.getElementById("dialog.password1"); element.focus(); } else { var element = document.getElementById("dialog.loginname"); element.value = param.GetString( 6 ); var editMsg1 = param.GetString( 4 ); if (editMsg1) { SetElementText("login.text", editMsg1 ); }// dump("hiding password1EditField"); var element = document.getElementById("password1EditField"); element.setAttribute("style","display: none;" ); var element = document.getElementById("dialog.loginname"); element.focus(); } break; case 1: var editfield1Password = param.GetInt( 4 ); if ( editfield1Password == 1 ) { var element = document.getElementById("dialog.password1"); element.value = param.GetString( 6 );// var editMsg1 = param.GetString( 4 );// if (editMsg1) {// SetElementText("password1.text", editMsg1 ); // } // Now hide the meaningless text var element = document.getElementById("password1.text"); element.setAttribute("style", "display:none;" );// dump("hiding loginEditField and password2EditField"); var element = document.getElementById("loginEditField"); element.setAttribute("style","display: none;" ); var element = document.getElementById("password2EditField"); element.setAttribute("style","display: none;" ); var element = document.getElementById("dialog.password1");// dump("give keyboard focus to password edit field \n"); element.focus(); } else { var element = document.getElementById("dialog.loginname"); element.value = param.GetString( 6 ); var editMsg1 = param.GetString( 4 ); if (editMsg1) { SetElementText("login.text", editMsg1 ); } // Now hide the meaningless text var element = document.getElementById("login.text"); element.setAttribute("style", "display:none;" );// dump("hiding password1EditField and password2EditField"); var element = document.getElementById("password1EditField"); element.setAttribute("style","display: none;" ); var element = document.getElementById("password2EditField"); element.setAttribute("style","display: none;" ); var element = document.getElementById("dialog.loginname");// dump("give keyboard focus to password edit field \n"); element.focus(); } break; case 0:// dump("hiding all editfields \n"); var element = document.getElementById("editFields"); element.setAttribute("style","display: none;" ); break; } // set the pressed button to cancel to handle the case where the close box is pressed param.SetInt(0, 1 ); // resize the window to the content window.sizeToContent(); // Move to the right location moveToAlertPosition();} |
addEventListener("blur", commonDialogBlur, false); addEventListener("focus", commonDialogFocus, false); | function commonDialogOnLoad(){ // set the document title document.title = gCommonDialogParam.GetString(12); // set the number of command buttons var nButtons = gCommonDialogParam.GetInt(2); var dialog = document.documentElement; switch (nButtons) { case 1: dialog.getButton("cancel").hidden = true; break; case 4: dialog.getButton("extra2").hidden = false; case 3: dialog.getButton("extra1").hidden = false; } // display the main text var messageText = gCommonDialogParam.GetString(0); var messageParent = document.getElementById("info.box"); var messageParagraphs = messageText.split("\n"); for (var i = 0; i < messageParagraphs.length; i++) { var descriptionNode = document.createElement("description"); var text = document.createTextNode(messageParagraphs[i]); descriptionNode.appendChild(text); messageParent.appendChild(descriptionNode); } setElementText("info.header", gCommonDialogParam.GetString(3), true); // set the icon var iconElement = document.getElementById("info.icon"); var iconClass = gCommonDialogParam.GetString(2); if (!iconClass) iconClass = "message-icon"; iconElement.setAttribute("class", iconElement.getAttribute("class") + " " + iconClass); switch (nButtons) { case 4: setLabelForNode(document.documentElement.getButton("extra2"), gCommonDialogParam.GetString(11)); // fall through case 3: setLabelForNode(document.documentElement.getButton("extra1"), gCommonDialogParam.GetString(10)); // fall through default: case 2: var string = gCommonDialogParam.GetString(9); if (string) setLabelForNode(document.documentElement.getButton("cancel"), string); // fall through case 1: string = gCommonDialogParam.GetString(8); if (string) setLabelForNode(document.documentElement.getButton("accept"), string); break; } // set default result to cancelled gCommonDialogParam.SetInt(0, 1); // initialize the checkbox setCheckbox(gCommonDialogParam.GetString(1), gCommonDialogParam.GetInt(1)); if (gCommonDialogParam.GetInt(3) == 0) // If no text fields { var dButton; var defaultButton = gCommonDialogParam.GetInt(5); switch (defaultButton) { case 3: dButton = document.documentElement.getButton("extra2"); break; case 2: dButton = document.documentElement.getButton("extra1"); break; case 1: dButton = document.documentElement.getButton("cancel"); break; default: case 0: dButton = document.documentElement.getButton("accept"); break; } // move the default attribute and focus from the accept button // to the one specified in the dialog params document.documentElement.getButton("accept").setAttribute("default",false); dButton.setAttribute("default", true); dButton.focus(); } if (gCommonDialogParam.GetInt(6) != 0) // delay button enable { var delayInterval = 2000; try { var prefs = Components.classes["@mozilla.org/preferences-service;1"] .getService(Components.interfaces.nsIPrefBranch); delayInterval = prefs.getIntPref("security.dialog_enable_delay"); } catch (e) {} document.documentElement.getButton("accept").disabled = true; document.documentElement.getButton("extra1").disabled = true; document.documentElement.getButton("extra2").disabled = true; setTimeout(commonDialogReenableButtons, delayInterval); } getAttention();} |
|
var element = document.getElementById("dialog.password2"); element.value = param.GetString( 7 ); var editMsg = param.GetString( 5 ); if (editMsg) { SetElementText("password2.text", editMsg ); } var editfield1Password = param.GetInt( 4 ); if ( editfield1Password == 1 ) { var element = document.getElementById("dialog.password1"); element.value = param.GetString( 6 ); var editMsg1 = param.GetString( 4 ); if (editMsg1) { SetElementText("password1.text", editMsg1 ); } var element = document.getElementById("loginEditField"); element.setAttribute("style","display: none;" ); var element = document.getElementById("dialog.password1"); element.focus(); } else { var element = document.getElementById("dialog.loginname"); element.value = param.GetString( 6 ); var editMsg1 = param.GetString( 4 ); if (editMsg1) { SetElementText("login.text", editMsg1 ); } var element = document.getElementById("password1EditField"); element.setAttribute("style","display: none;" ); var element = document.getElementById("dialog.loginname"); element.focus(); } | var element = document.getElementById("dialog.loginname"); element.focus(); | function commonDialogOnLoad(){ dump("commonDialogOnLoad \n"); doSetOKCancel( commonDialogOnOK, commonDialogOnCancel, commonDialogOnButton2, commonDialogOnButton3 ); param = window.arguments[0].QueryInterface( Components.interfaces.nsIDialogParamBlock ); if( !param ) dump( " error getting param block interface\n" ); var messageText = param.GetString( 0 );// dump("message: "+ msg +"\n"); //SetElementText("info.txt", msg ); { var messageFragment; // Let the caller use "\n" to cause breaks // Translate these into <br> tags var messageParent = (document.getElementById("info.txt")); done = false; while (!done) { breakIndex = messageText.indexOf('\n'); if (breakIndex == 0) { // Ignore break at the first character messageText = messageText.slice(1); dump("Found break at begining\n"); messageFragment = ""; } else if (breakIndex > 0) { // The fragment up to the break messageFragment = messageText.slice(0, breakIndex); // Chop off fragment we just found from remaining string messageText = messageText.slice(breakIndex+1); } else { // "\n" not found. We're done done = true; messageFragment = messageText; } messageNode = document.createTextNode(messageFragment); if (messageNode) messageParent.appendChild(messageNode); // This is needed when the default namespace of the document is XUL breakNode = document.createElementWithNameSpace("BR", "http://www.w3.org/TR/REC-html40"); if (breakNode) messageParent.appendChild(breakNode); } } var msg = param.GetString( 3 );// dump("title message: "+ msg +"\n"); SetElementText("info.header", msg ); var windowTitle = param.GetString( 12 ); window.title = windowTitle; var iconURL = param.GetString(2 ); var element = document.getElementById("info.icon"); if( element ) element.src = iconURL; else dump("couldn't find icon element \n"); // Set button names var buttonText = param.GetString( 8 ); if ( buttonText != "" ) {// dump( "Setting OK Button to "+buttonText+"\n"); var okButton = document.getElementById("ok"); okButton.setAttribute("value", buttonText); } buttonText = param.GetString( 9 ); if ( buttonText != "" ) { // dump( "Setting Cancel Button to"+buttonText+"\n"); var cancelButton = document.getElementById("cancel"); cancelButton.setAttribute( "value",buttonText); } // Adjust number buttons var numButtons = param.GetInt( 2 ); if ( numButtons == 1 ) { } switch ( numButtons ) { case 4: { var button = document.getElementById("Button3"); button.setAttribute("style", "display:inline;"); var buttonText = param.GetString( 11 ); button.setAttribute( "value",buttonText); } case 3: { var button = document.getElementById("Button2"); button.setAttribute("style", "display:inline;"); var buttonText = param.GetString( 10 ); button.setAttribute( "value",buttonText); } break; case 1: var element = document.getElementById("cancel"); if ( element ) { // dump( "hide button \n" ); element.setAttribute("style", "display:none;" ); } else { // dump( "couldn't find button \n"); } break; } // Set the Checkbox// dump(" set checkbox \n"); var checkMsg = param.GetString( 1 );// dump("check box msg is "+ checkMsg +"\n"); if ( checkMsg != "" ) { var prompt = (document.getElementById("checkboxLabel")); if ( prompt ) { // dump(" setting message \n" ); prompt.childNodes[1].nodeValue = checkMsg; } var checkValue = param.GetInt( 1 ); var element=document.getElementById("checkbox" ); var checkbool = checkValue > 0 ? true : false; element.checked = checkbool; } else {// dump("not visibile \n"); var element = document.getElementById("checkboxLabel"); element.setAttribute("style","display: none;" ); } // handle the edit fields// dump("set editfields \n"); var numEditfields = param.GetInt( 3 ); switch( numEditfields ) { case 2: var element = document.getElementById("dialog.password2"); element.value = param.GetString( 7 ); var editMsg = param.GetString( 5 ); if (editMsg) { SetElementText("password2.text", editMsg ); } var editfield1Password = param.GetInt( 4 ); if ( editfield1Password == 1 ) { var element = document.getElementById("dialog.password1"); element.value = param.GetString( 6 ); var editMsg1 = param.GetString( 4 ); if (editMsg1) { SetElementText("password1.text", editMsg1 ); }// dump("hiding loginEditField"); var element = document.getElementById("loginEditField"); element.setAttribute("style","display: none;" ); var element = document.getElementById("dialog.password1"); element.focus(); } else { var element = document.getElementById("dialog.loginname"); element.value = param.GetString( 6 ); var editMsg1 = param.GetString( 4 ); if (editMsg1) { SetElementText("login.text", editMsg1 ); }// dump("hiding password1EditField"); var element = document.getElementById("password1EditField"); element.setAttribute("style","display: none;" ); var element = document.getElementById("dialog.loginname"); element.focus(); } break; case 1: var editfield1Password = param.GetInt( 4 ); if ( editfield1Password == 1 ) { var element = document.getElementById("dialog.password1"); element.value = param.GetString( 6 );// var editMsg1 = param.GetString( 4 );// if (editMsg1) {// SetElementText("password1.text", editMsg1 ); // } // Now hide the meaningless text var element = document.getElementById("password1.text"); element.setAttribute("style", "display:none;" );// dump("hiding loginEditField and password2EditField"); var element = document.getElementById("loginEditField"); element.setAttribute("style","display: none;" ); var element = document.getElementById("password2EditField"); element.setAttribute("style","display: none;" ); var element = document.getElementById("dialog.password1");// dump("give keyboard focus to password edit field \n"); element.focus(); } else { var element = document.getElementById("dialog.loginname"); element.value = param.GetString( 6 ); var editMsg1 = param.GetString( 4 ); if (editMsg1) { SetElementText("login.text", editMsg1 ); } // Now hide the meaningless text var element = document.getElementById("login.text"); element.setAttribute("style", "display:none;" );// dump("hiding password1EditField and password2EditField"); var element = document.getElementById("password1EditField"); element.setAttribute("style","display: none;" ); var element = document.getElementById("password2EditField"); element.setAttribute("style","display: none;" ); var element = document.getElementById("dialog.loginname");// dump("give keyboard focus to password edit field \n"); element.focus(); } break; case 0:// dump("hiding all editfields \n"); var element = document.getElementById("editFields"); element.setAttribute("style","display: none;" ); break; } // set the pressed button to cancel to handle the case where the close box is pressed param.SetInt(0, 1 ); // resize the window to the content window.sizeToContent(); // Move to the right location moveToAlertPosition();} |
var element = document.getElementById("dialog.password1"); element.value = param.GetString( 6 ); var element = document.getElementById("password1.text"); element.setAttribute("style", "display:none;" ); | function commonDialogOnLoad(){ dump("commonDialogOnLoad \n"); doSetOKCancel( commonDialogOnOK, commonDialogOnCancel, commonDialogOnButton2, commonDialogOnButton3 ); param = window.arguments[0].QueryInterface( Components.interfaces.nsIDialogParamBlock ); if( !param ) dump( " error getting param block interface\n" ); var messageText = param.GetString( 0 );// dump("message: "+ msg +"\n"); //SetElementText("info.txt", msg ); { var messageFragment; // Let the caller use "\n" to cause breaks // Translate these into <br> tags var messageParent = (document.getElementById("info.txt")); done = false; while (!done) { breakIndex = messageText.indexOf('\n'); if (breakIndex == 0) { // Ignore break at the first character messageText = messageText.slice(1); dump("Found break at begining\n"); messageFragment = ""; } else if (breakIndex > 0) { // The fragment up to the break messageFragment = messageText.slice(0, breakIndex); // Chop off fragment we just found from remaining string messageText = messageText.slice(breakIndex+1); } else { // "\n" not found. We're done done = true; messageFragment = messageText; } messageNode = document.createTextNode(messageFragment); if (messageNode) messageParent.appendChild(messageNode); // This is needed when the default namespace of the document is XUL breakNode = document.createElementWithNameSpace("BR", "http://www.w3.org/TR/REC-html40"); if (breakNode) messageParent.appendChild(breakNode); } } var msg = param.GetString( 3 );// dump("title message: "+ msg +"\n"); SetElementText("info.header", msg ); var windowTitle = param.GetString( 12 ); window.title = windowTitle; var iconURL = param.GetString(2 ); var element = document.getElementById("info.icon"); if( element ) element.src = iconURL; else dump("couldn't find icon element \n"); // Set button names var buttonText = param.GetString( 8 ); if ( buttonText != "" ) {// dump( "Setting OK Button to "+buttonText+"\n"); var okButton = document.getElementById("ok"); okButton.setAttribute("value", buttonText); } buttonText = param.GetString( 9 ); if ( buttonText != "" ) { // dump( "Setting Cancel Button to"+buttonText+"\n"); var cancelButton = document.getElementById("cancel"); cancelButton.setAttribute( "value",buttonText); } // Adjust number buttons var numButtons = param.GetInt( 2 ); if ( numButtons == 1 ) { } switch ( numButtons ) { case 4: { var button = document.getElementById("Button3"); button.setAttribute("style", "display:inline;"); var buttonText = param.GetString( 11 ); button.setAttribute( "value",buttonText); } case 3: { var button = document.getElementById("Button2"); button.setAttribute("style", "display:inline;"); var buttonText = param.GetString( 10 ); button.setAttribute( "value",buttonText); } break; case 1: var element = document.getElementById("cancel"); if ( element ) { // dump( "hide button \n" ); element.setAttribute("style", "display:none;" ); } else { // dump( "couldn't find button \n"); } break; } // Set the Checkbox// dump(" set checkbox \n"); var checkMsg = param.GetString( 1 );// dump("check box msg is "+ checkMsg +"\n"); if ( checkMsg != "" ) { var prompt = (document.getElementById("checkboxLabel")); if ( prompt ) { // dump(" setting message \n" ); prompt.childNodes[1].nodeValue = checkMsg; } var checkValue = param.GetInt( 1 ); var element=document.getElementById("checkbox" ); var checkbool = checkValue > 0 ? true : false; element.checked = checkbool; } else {// dump("not visibile \n"); var element = document.getElementById("checkboxLabel"); element.setAttribute("style","display: none;" ); } // handle the edit fields// dump("set editfields \n"); var numEditfields = param.GetInt( 3 ); switch( numEditfields ) { case 2: var element = document.getElementById("dialog.password2"); element.value = param.GetString( 7 ); var editMsg = param.GetString( 5 ); if (editMsg) { SetElementText("password2.text", editMsg ); } var editfield1Password = param.GetInt( 4 ); if ( editfield1Password == 1 ) { var element = document.getElementById("dialog.password1"); element.value = param.GetString( 6 ); var editMsg1 = param.GetString( 4 ); if (editMsg1) { SetElementText("password1.text", editMsg1 ); }// dump("hiding loginEditField"); var element = document.getElementById("loginEditField"); element.setAttribute("style","display: none;" ); var element = document.getElementById("dialog.password1"); element.focus(); } else { var element = document.getElementById("dialog.loginname"); element.value = param.GetString( 6 ); var editMsg1 = param.GetString( 4 ); if (editMsg1) { SetElementText("login.text", editMsg1 ); }// dump("hiding password1EditField"); var element = document.getElementById("password1EditField"); element.setAttribute("style","display: none;" ); var element = document.getElementById("dialog.loginname"); element.focus(); } break; case 1: var editfield1Password = param.GetInt( 4 ); if ( editfield1Password == 1 ) { var element = document.getElementById("dialog.password1"); element.value = param.GetString( 6 );// var editMsg1 = param.GetString( 4 );// if (editMsg1) {// SetElementText("password1.text", editMsg1 ); // } // Now hide the meaningless text var element = document.getElementById("password1.text"); element.setAttribute("style", "display:none;" );// dump("hiding loginEditField and password2EditField"); var element = document.getElementById("loginEditField"); element.setAttribute("style","display: none;" ); var element = document.getElementById("password2EditField"); element.setAttribute("style","display: none;" ); var element = document.getElementById("dialog.password1");// dump("give keyboard focus to password edit field \n"); element.focus(); } else { var element = document.getElementById("dialog.loginname"); element.value = param.GetString( 6 ); var editMsg1 = param.GetString( 4 ); if (editMsg1) { SetElementText("login.text", editMsg1 ); } // Now hide the meaningless text var element = document.getElementById("login.text"); element.setAttribute("style", "display:none;" );// dump("hiding password1EditField and password2EditField"); var element = document.getElementById("password1EditField"); element.setAttribute("style","display: none;" ); var element = document.getElementById("password2EditField"); element.setAttribute("style","display: none;" ); var element = document.getElementById("dialog.loginname");// dump("give keyboard focus to password edit field \n"); element.focus(); } break; case 0:// dump("hiding all editfields \n"); var element = document.getElementById("editFields"); element.setAttribute("style","display: none;" ); break; } // set the pressed button to cancel to handle the case where the close box is pressed param.SetInt(0, 1 ); // resize the window to the content window.sizeToContent(); // Move to the right location moveToAlertPosition();} |
|
var element = document.getElementById("password2EditField"); element.setAttribute("style","display: none;" ); var element = document.getElementById("dialog.password1"); | var element = document.getElementById("password.text"); element.setAttribute("style", "display:none;" ); var element = document.getElementById("dialog.password"); | function commonDialogOnLoad(){ dump("commonDialogOnLoad \n"); doSetOKCancel( commonDialogOnOK, commonDialogOnCancel, commonDialogOnButton2, commonDialogOnButton3 ); param = window.arguments[0].QueryInterface( Components.interfaces.nsIDialogParamBlock ); if( !param ) dump( " error getting param block interface\n" ); var messageText = param.GetString( 0 );// dump("message: "+ msg +"\n"); //SetElementText("info.txt", msg ); { var messageFragment; // Let the caller use "\n" to cause breaks // Translate these into <br> tags var messageParent = (document.getElementById("info.txt")); done = false; while (!done) { breakIndex = messageText.indexOf('\n'); if (breakIndex == 0) { // Ignore break at the first character messageText = messageText.slice(1); dump("Found break at begining\n"); messageFragment = ""; } else if (breakIndex > 0) { // The fragment up to the break messageFragment = messageText.slice(0, breakIndex); // Chop off fragment we just found from remaining string messageText = messageText.slice(breakIndex+1); } else { // "\n" not found. We're done done = true; messageFragment = messageText; } messageNode = document.createTextNode(messageFragment); if (messageNode) messageParent.appendChild(messageNode); // This is needed when the default namespace of the document is XUL breakNode = document.createElementWithNameSpace("BR", "http://www.w3.org/TR/REC-html40"); if (breakNode) messageParent.appendChild(breakNode); } } var msg = param.GetString( 3 );// dump("title message: "+ msg +"\n"); SetElementText("info.header", msg ); var windowTitle = param.GetString( 12 ); window.title = windowTitle; var iconURL = param.GetString(2 ); var element = document.getElementById("info.icon"); if( element ) element.src = iconURL; else dump("couldn't find icon element \n"); // Set button names var buttonText = param.GetString( 8 ); if ( buttonText != "" ) {// dump( "Setting OK Button to "+buttonText+"\n"); var okButton = document.getElementById("ok"); okButton.setAttribute("value", buttonText); } buttonText = param.GetString( 9 ); if ( buttonText != "" ) { // dump( "Setting Cancel Button to"+buttonText+"\n"); var cancelButton = document.getElementById("cancel"); cancelButton.setAttribute( "value",buttonText); } // Adjust number buttons var numButtons = param.GetInt( 2 ); if ( numButtons == 1 ) { } switch ( numButtons ) { case 4: { var button = document.getElementById("Button3"); button.setAttribute("style", "display:inline;"); var buttonText = param.GetString( 11 ); button.setAttribute( "value",buttonText); } case 3: { var button = document.getElementById("Button2"); button.setAttribute("style", "display:inline;"); var buttonText = param.GetString( 10 ); button.setAttribute( "value",buttonText); } break; case 1: var element = document.getElementById("cancel"); if ( element ) { // dump( "hide button \n" ); element.setAttribute("style", "display:none;" ); } else { // dump( "couldn't find button \n"); } break; } // Set the Checkbox// dump(" set checkbox \n"); var checkMsg = param.GetString( 1 );// dump("check box msg is "+ checkMsg +"\n"); if ( checkMsg != "" ) { var prompt = (document.getElementById("checkboxLabel")); if ( prompt ) { // dump(" setting message \n" ); prompt.childNodes[1].nodeValue = checkMsg; } var checkValue = param.GetInt( 1 ); var element=document.getElementById("checkbox" ); var checkbool = checkValue > 0 ? true : false; element.checked = checkbool; } else {// dump("not visibile \n"); var element = document.getElementById("checkboxLabel"); element.setAttribute("style","display: none;" ); } // handle the edit fields// dump("set editfields \n"); var numEditfields = param.GetInt( 3 ); switch( numEditfields ) { case 2: var element = document.getElementById("dialog.password2"); element.value = param.GetString( 7 ); var editMsg = param.GetString( 5 ); if (editMsg) { SetElementText("password2.text", editMsg ); } var editfield1Password = param.GetInt( 4 ); if ( editfield1Password == 1 ) { var element = document.getElementById("dialog.password1"); element.value = param.GetString( 6 ); var editMsg1 = param.GetString( 4 ); if (editMsg1) { SetElementText("password1.text", editMsg1 ); }// dump("hiding loginEditField"); var element = document.getElementById("loginEditField"); element.setAttribute("style","display: none;" ); var element = document.getElementById("dialog.password1"); element.focus(); } else { var element = document.getElementById("dialog.loginname"); element.value = param.GetString( 6 ); var editMsg1 = param.GetString( 4 ); if (editMsg1) { SetElementText("login.text", editMsg1 ); }// dump("hiding password1EditField"); var element = document.getElementById("password1EditField"); element.setAttribute("style","display: none;" ); var element = document.getElementById("dialog.loginname"); element.focus(); } break; case 1: var editfield1Password = param.GetInt( 4 ); if ( editfield1Password == 1 ) { var element = document.getElementById("dialog.password1"); element.value = param.GetString( 6 );// var editMsg1 = param.GetString( 4 );// if (editMsg1) {// SetElementText("password1.text", editMsg1 ); // } // Now hide the meaningless text var element = document.getElementById("password1.text"); element.setAttribute("style", "display:none;" );// dump("hiding loginEditField and password2EditField"); var element = document.getElementById("loginEditField"); element.setAttribute("style","display: none;" ); var element = document.getElementById("password2EditField"); element.setAttribute("style","display: none;" ); var element = document.getElementById("dialog.password1");// dump("give keyboard focus to password edit field \n"); element.focus(); } else { var element = document.getElementById("dialog.loginname"); element.value = param.GetString( 6 ); var editMsg1 = param.GetString( 4 ); if (editMsg1) { SetElementText("login.text", editMsg1 ); } // Now hide the meaningless text var element = document.getElementById("login.text"); element.setAttribute("style", "display:none;" );// dump("hiding password1EditField and password2EditField"); var element = document.getElementById("password1EditField"); element.setAttribute("style","display: none;" ); var element = document.getElementById("password2EditField"); element.setAttribute("style","display: none;" ); var element = document.getElementById("dialog.loginname");// dump("give keyboard focus to password edit field \n"); element.focus(); } break; case 0:// dump("hiding all editfields \n"); var element = document.getElementById("editFields"); element.setAttribute("style","display: none;" ); break; } // set the pressed button to cancel to handle the case where the close box is pressed param.SetInt(0, 1 ); // resize the window to the content window.sizeToContent(); // Move to the right location moveToAlertPosition();} |
var element = document.getElementById("dialog.loginname"); element.value = param.GetString( 6 ); var editMsg1 = param.GetString( 4 ); if (editMsg1) { SetElementText("login.text", editMsg1 ); } | var element = document.getElementById("passwordEditfield"); element.setAttribute("style","display: none;" ); | function commonDialogOnLoad(){ dump("commonDialogOnLoad \n"); doSetOKCancel( commonDialogOnOK, commonDialogOnCancel, commonDialogOnButton2, commonDialogOnButton3 ); param = window.arguments[0].QueryInterface( Components.interfaces.nsIDialogParamBlock ); if( !param ) dump( " error getting param block interface\n" ); var messageText = param.GetString( 0 );// dump("message: "+ msg +"\n"); //SetElementText("info.txt", msg ); { var messageFragment; // Let the caller use "\n" to cause breaks // Translate these into <br> tags var messageParent = (document.getElementById("info.txt")); done = false; while (!done) { breakIndex = messageText.indexOf('\n'); if (breakIndex == 0) { // Ignore break at the first character messageText = messageText.slice(1); dump("Found break at begining\n"); messageFragment = ""; } else if (breakIndex > 0) { // The fragment up to the break messageFragment = messageText.slice(0, breakIndex); // Chop off fragment we just found from remaining string messageText = messageText.slice(breakIndex+1); } else { // "\n" not found. We're done done = true; messageFragment = messageText; } messageNode = document.createTextNode(messageFragment); if (messageNode) messageParent.appendChild(messageNode); // This is needed when the default namespace of the document is XUL breakNode = document.createElementWithNameSpace("BR", "http://www.w3.org/TR/REC-html40"); if (breakNode) messageParent.appendChild(breakNode); } } var msg = param.GetString( 3 );// dump("title message: "+ msg +"\n"); SetElementText("info.header", msg ); var windowTitle = param.GetString( 12 ); window.title = windowTitle; var iconURL = param.GetString(2 ); var element = document.getElementById("info.icon"); if( element ) element.src = iconURL; else dump("couldn't find icon element \n"); // Set button names var buttonText = param.GetString( 8 ); if ( buttonText != "" ) {// dump( "Setting OK Button to "+buttonText+"\n"); var okButton = document.getElementById("ok"); okButton.setAttribute("value", buttonText); } buttonText = param.GetString( 9 ); if ( buttonText != "" ) { // dump( "Setting Cancel Button to"+buttonText+"\n"); var cancelButton = document.getElementById("cancel"); cancelButton.setAttribute( "value",buttonText); } // Adjust number buttons var numButtons = param.GetInt( 2 ); if ( numButtons == 1 ) { } switch ( numButtons ) { case 4: { var button = document.getElementById("Button3"); button.setAttribute("style", "display:inline;"); var buttonText = param.GetString( 11 ); button.setAttribute( "value",buttonText); } case 3: { var button = document.getElementById("Button2"); button.setAttribute("style", "display:inline;"); var buttonText = param.GetString( 10 ); button.setAttribute( "value",buttonText); } break; case 1: var element = document.getElementById("cancel"); if ( element ) { // dump( "hide button \n" ); element.setAttribute("style", "display:none;" ); } else { // dump( "couldn't find button \n"); } break; } // Set the Checkbox// dump(" set checkbox \n"); var checkMsg = param.GetString( 1 );// dump("check box msg is "+ checkMsg +"\n"); if ( checkMsg != "" ) { var prompt = (document.getElementById("checkboxLabel")); if ( prompt ) { // dump(" setting message \n" ); prompt.childNodes[1].nodeValue = checkMsg; } var checkValue = param.GetInt( 1 ); var element=document.getElementById("checkbox" ); var checkbool = checkValue > 0 ? true : false; element.checked = checkbool; } else {// dump("not visibile \n"); var element = document.getElementById("checkboxLabel"); element.setAttribute("style","display: none;" ); } // handle the edit fields// dump("set editfields \n"); var numEditfields = param.GetInt( 3 ); switch( numEditfields ) { case 2: var element = document.getElementById("dialog.password2"); element.value = param.GetString( 7 ); var editMsg = param.GetString( 5 ); if (editMsg) { SetElementText("password2.text", editMsg ); } var editfield1Password = param.GetInt( 4 ); if ( editfield1Password == 1 ) { var element = document.getElementById("dialog.password1"); element.value = param.GetString( 6 ); var editMsg1 = param.GetString( 4 ); if (editMsg1) { SetElementText("password1.text", editMsg1 ); }// dump("hiding loginEditField"); var element = document.getElementById("loginEditField"); element.setAttribute("style","display: none;" ); var element = document.getElementById("dialog.password1"); element.focus(); } else { var element = document.getElementById("dialog.loginname"); element.value = param.GetString( 6 ); var editMsg1 = param.GetString( 4 ); if (editMsg1) { SetElementText("login.text", editMsg1 ); }// dump("hiding password1EditField"); var element = document.getElementById("password1EditField"); element.setAttribute("style","display: none;" ); var element = document.getElementById("dialog.loginname"); element.focus(); } break; case 1: var editfield1Password = param.GetInt( 4 ); if ( editfield1Password == 1 ) { var element = document.getElementById("dialog.password1"); element.value = param.GetString( 6 );// var editMsg1 = param.GetString( 4 );// if (editMsg1) {// SetElementText("password1.text", editMsg1 ); // } // Now hide the meaningless text var element = document.getElementById("password1.text"); element.setAttribute("style", "display:none;" );// dump("hiding loginEditField and password2EditField"); var element = document.getElementById("loginEditField"); element.setAttribute("style","display: none;" ); var element = document.getElementById("password2EditField"); element.setAttribute("style","display: none;" ); var element = document.getElementById("dialog.password1");// dump("give keyboard focus to password edit field \n"); element.focus(); } else { var element = document.getElementById("dialog.loginname"); element.value = param.GetString( 6 ); var editMsg1 = param.GetString( 4 ); if (editMsg1) { SetElementText("login.text", editMsg1 ); } // Now hide the meaningless text var element = document.getElementById("login.text"); element.setAttribute("style", "display:none;" );// dump("hiding password1EditField and password2EditField"); var element = document.getElementById("password1EditField"); element.setAttribute("style","display: none;" ); var element = document.getElementById("password2EditField"); element.setAttribute("style","display: none;" ); var element = document.getElementById("dialog.loginname");// dump("give keyboard focus to password edit field \n"); element.focus(); } break; case 0:// dump("hiding all editfields \n"); var element = document.getElementById("editFields"); element.setAttribute("style","display: none;" ); break; } // set the pressed button to cancel to handle the case where the close box is pressed param.SetInt(0, 1 ); // resize the window to the content window.sizeToContent(); // Move to the right location moveToAlertPosition();} |
var element = document.getElementById("password1EditField"); element.setAttribute("style","display: none;" ); var element = document.getElementById("password2EditField"); element.setAttribute("style","display: none;" ); var element = document.getElementById("dialog.loginname"); element.focus(); | function commonDialogOnLoad(){ dump("commonDialogOnLoad \n"); doSetOKCancel( commonDialogOnOK, commonDialogOnCancel, commonDialogOnButton2, commonDialogOnButton3 ); param = window.arguments[0].QueryInterface( Components.interfaces.nsIDialogParamBlock ); if( !param ) dump( " error getting param block interface\n" ); var messageText = param.GetString( 0 );// dump("message: "+ msg +"\n"); //SetElementText("info.txt", msg ); { var messageFragment; // Let the caller use "\n" to cause breaks // Translate these into <br> tags var messageParent = (document.getElementById("info.txt")); done = false; while (!done) { breakIndex = messageText.indexOf('\n'); if (breakIndex == 0) { // Ignore break at the first character messageText = messageText.slice(1); dump("Found break at begining\n"); messageFragment = ""; } else if (breakIndex > 0) { // The fragment up to the break messageFragment = messageText.slice(0, breakIndex); // Chop off fragment we just found from remaining string messageText = messageText.slice(breakIndex+1); } else { // "\n" not found. We're done done = true; messageFragment = messageText; } messageNode = document.createTextNode(messageFragment); if (messageNode) messageParent.appendChild(messageNode); // This is needed when the default namespace of the document is XUL breakNode = document.createElementWithNameSpace("BR", "http://www.w3.org/TR/REC-html40"); if (breakNode) messageParent.appendChild(breakNode); } } var msg = param.GetString( 3 );// dump("title message: "+ msg +"\n"); SetElementText("info.header", msg ); var windowTitle = param.GetString( 12 ); window.title = windowTitle; var iconURL = param.GetString(2 ); var element = document.getElementById("info.icon"); if( element ) element.src = iconURL; else dump("couldn't find icon element \n"); // Set button names var buttonText = param.GetString( 8 ); if ( buttonText != "" ) {// dump( "Setting OK Button to "+buttonText+"\n"); var okButton = document.getElementById("ok"); okButton.setAttribute("value", buttonText); } buttonText = param.GetString( 9 ); if ( buttonText != "" ) { // dump( "Setting Cancel Button to"+buttonText+"\n"); var cancelButton = document.getElementById("cancel"); cancelButton.setAttribute( "value",buttonText); } // Adjust number buttons var numButtons = param.GetInt( 2 ); if ( numButtons == 1 ) { } switch ( numButtons ) { case 4: { var button = document.getElementById("Button3"); button.setAttribute("style", "display:inline;"); var buttonText = param.GetString( 11 ); button.setAttribute( "value",buttonText); } case 3: { var button = document.getElementById("Button2"); button.setAttribute("style", "display:inline;"); var buttonText = param.GetString( 10 ); button.setAttribute( "value",buttonText); } break; case 1: var element = document.getElementById("cancel"); if ( element ) { // dump( "hide button \n" ); element.setAttribute("style", "display:none;" ); } else { // dump( "couldn't find button \n"); } break; } // Set the Checkbox// dump(" set checkbox \n"); var checkMsg = param.GetString( 1 );// dump("check box msg is "+ checkMsg +"\n"); if ( checkMsg != "" ) { var prompt = (document.getElementById("checkboxLabel")); if ( prompt ) { // dump(" setting message \n" ); prompt.childNodes[1].nodeValue = checkMsg; } var checkValue = param.GetInt( 1 ); var element=document.getElementById("checkbox" ); var checkbool = checkValue > 0 ? true : false; element.checked = checkbool; } else {// dump("not visibile \n"); var element = document.getElementById("checkboxLabel"); element.setAttribute("style","display: none;" ); } // handle the edit fields// dump("set editfields \n"); var numEditfields = param.GetInt( 3 ); switch( numEditfields ) { case 2: var element = document.getElementById("dialog.password2"); element.value = param.GetString( 7 ); var editMsg = param.GetString( 5 ); if (editMsg) { SetElementText("password2.text", editMsg ); } var editfield1Password = param.GetInt( 4 ); if ( editfield1Password == 1 ) { var element = document.getElementById("dialog.password1"); element.value = param.GetString( 6 ); var editMsg1 = param.GetString( 4 ); if (editMsg1) { SetElementText("password1.text", editMsg1 ); }// dump("hiding loginEditField"); var element = document.getElementById("loginEditField"); element.setAttribute("style","display: none;" ); var element = document.getElementById("dialog.password1"); element.focus(); } else { var element = document.getElementById("dialog.loginname"); element.value = param.GetString( 6 ); var editMsg1 = param.GetString( 4 ); if (editMsg1) { SetElementText("login.text", editMsg1 ); }// dump("hiding password1EditField"); var element = document.getElementById("password1EditField"); element.setAttribute("style","display: none;" ); var element = document.getElementById("dialog.loginname"); element.focus(); } break; case 1: var editfield1Password = param.GetInt( 4 ); if ( editfield1Password == 1 ) { var element = document.getElementById("dialog.password1"); element.value = param.GetString( 6 );// var editMsg1 = param.GetString( 4 );// if (editMsg1) {// SetElementText("password1.text", editMsg1 ); // } // Now hide the meaningless text var element = document.getElementById("password1.text"); element.setAttribute("style", "display:none;" );// dump("hiding loginEditField and password2EditField"); var element = document.getElementById("loginEditField"); element.setAttribute("style","display: none;" ); var element = document.getElementById("password2EditField"); element.setAttribute("style","display: none;" ); var element = document.getElementById("dialog.password1");// dump("give keyboard focus to password edit field \n"); element.focus(); } else { var element = document.getElementById("dialog.loginname"); element.value = param.GetString( 6 ); var editMsg1 = param.GetString( 4 ); if (editMsg1) { SetElementText("login.text", editMsg1 ); } // Now hide the meaningless text var element = document.getElementById("login.text"); element.setAttribute("style", "display:none;" );// dump("hiding password1EditField and password2EditField"); var element = document.getElementById("password1EditField"); element.setAttribute("style","display: none;" ); var element = document.getElementById("password2EditField"); element.setAttribute("style","display: none;" ); var element = document.getElementById("dialog.loginname");// dump("give keyboard focus to password edit field \n"); element.focus(); } break; case 0:// dump("hiding all editfields \n"); var element = document.getElementById("editFields"); element.setAttribute("style","display: none;" ); break; } // set the pressed button to cancel to handle the case where the close box is pressed param.SetInt(0, 1 ); // resize the window to the content window.sizeToContent(); // Move to the right location moveToAlertPosition();} |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.