rem
stringlengths 0
126k
| add
stringlengths 0
441k
| context
stringlengths 15
136k
|
---|---|---|
this.lag = (new Date() - this.lastPingSent) / 1000; | this.lag = roundTo ((new Date() - this.lastPingSent) / 1000, 1); | function serv_pong (e){ if (this.lastPingSent) this.lag = (new Date() - this.lastPingSent) / 1000; delete this.lastPingSent; e.destObject = this.parent; e.set = "network"; return true; } |
if (ev.data.match(/^(?::[^ ]+ )?32[123] /i)) | if (ev.data.match(/^(?::[^ ]+ )?(?:32[123]|352|315) /i)) | function serv_ppline(e){ var line = e.line; if (line == "") return false; var incomplete = (line[line.length - 1] != '\n'); var lines = line.split("\n"); if (this.savedLine) { lines[0] = this.savedLine + lines[0]; this.savedLine = ""; } if (incomplete) this.savedLine = lines.pop(); for (i in lines) { var ev = new CEvent("server", "rawdata", this, "onRawData"); ev.data = lines[i].replace(/\r/g, ""); if (ev.data) { if (ev.data.match(/^(?::[^ ]+ )?32[123] /i)) this.parent.eventPump.addBulkEvent(ev); else this.parent.eventPump.addEvent(ev); } } return true;} |
var incomplete = (line[line.length] != '\n'); | var incomplete = (line[line.length - 1] != '\n'); | function serv_ppline(e){ var line = e.line; if (line == "") return false; var incomplete = (line[line.length] != '\n'); var lines = line.split("\n"); if (this.savedLine) { lines[0] = this.savedLine + lines[0]; this.savedLine = ""; } if (incomplete) this.savedLine = lines.pop(); for (i in lines) { var ev = new CEvent("server", "rawdata", this, "onRawData"); ev.data = lines[i].replace(/\r/g, ""); this.parent.eventPump.addEvent (ev); } return true;} |
this.parent.eventPump.addEvent (ev); | if (ev.data) this.parent.eventPump.addEvent (ev); | function serv_ppline(e){ var line = e.line; if (line == "") return false; var incomplete = (line[line.length] != '\n'); var lines = line.split("\n"); if (this.savedLine) { lines[0] = this.savedLine + lines[0]; this.savedLine = ""; } if (incomplete) this.savedLine = lines.pop(); for (i in lines) { var ev = new CEvent("server", "rawdata", this, "onRawData"); ev.data = lines[i].replace(/\r/g, ""); this.parent.eventPump.addEvent (ev); } return true;} |
e.params[2] = toUnicode(e.params[2], e.channel); | function serv_privmsg (e){ /* setting replyTo provides a standard place to find the target for */ /* replys associated with this event. */ if ((e.params[1][0] == "#") || (e.params[1][0] == "&") || (e.params[1][0] == "+") || (e.params[1][0] == "!")) { e.channel = new CIRCChannel(this, e.params[1]); e.user = new CIRCChanUser(e.channel, e.user.nick); e.replyTo = e.channel; e.set = "channel"; e.params[2] = toUnicode(e.params[2], e.channel); } else { e.set = "user"; e.replyTo = e.user; /* send replys to the user who sent the message */ e.params[2] = toUnicode(e.params[2], e.user); } if (e.params[2].search (/\x01.*\x01/i) != -1) { e.type = "ctcp"; e.destMethod = "onCTCP"; e.set = "server"; e.destObject = this; } else e.destObject = e.replyTo; return true;} |
|
e.params[2] = toUnicode(e.params[2], e.user); | function serv_privmsg (e){ /* setting replyTo provides a standard place to find the target for */ /* replys associated with this event. */ if ((e.params[1][0] == "#") || (e.params[1][0] == "&") || (e.params[1][0] == "+") || (e.params[1][0] == "!")) { e.channel = new CIRCChannel(this, e.params[1]); e.user = new CIRCChanUser(e.channel, e.user.nick); e.replyTo = e.channel; e.set = "channel"; e.params[2] = toUnicode(e.params[2], e.channel); } else { e.set = "user"; e.replyTo = e.user; /* send replys to the user who sent the message */ e.params[2] = toUnicode(e.params[2], e.user); } if (e.params[2].search (/\x01.*\x01/i) != -1) { e.type = "ctcp"; e.destMethod = "onCTCP"; e.set = "server"; e.destObject = this; } else e.destObject = e.replyTo; return true;} |
|
if (e.server.channels[c].users[e.user.nick]) | if (e.server.channels[c].active && e.user.nick in e.server.channels[c].users) | function serv_quit (e){ for (var c in e.server.channels) { if (e.server.channels[c].users[e.user.nick]) { var ev = new CEvent ("channel", "quit", e.server.channels[c], "onQuit"); ev.user = e.server.channels[c].users[e.user.nick]; ev.channel = e.server.channels[c]; ev.server = ev.channel.parent; ev.reason = e.meat; this.parent.eventPump.addEvent(ev); delete e.server.channels[c].users[e.user.nick]; } } this.users[e.user.nick].lastQuitMessage = e.meat; this.users[e.user.nick].lastQuitDate = new Date; e.reason = e.meat; e.destObject = e.user; e.set = "user"; return true;} |
e.params[1] = toUnicode(e.params[1], this.parent); | var reason = e.decodeParam(1); | function serv_quit (e){ e.params[1] = toUnicode(e.params[1], this.parent); for (var c in e.server.channels) { if (e.server.channels[c].active && e.user.nick in e.server.channels[c].users) { var ev = new CEvent ("channel", "quit", e.server.channels[c], "onQuit"); ev.user = e.server.channels[c].users[e.user.nick]; ev.channel = e.server.channels[c]; ev.server = ev.channel.parent; ev.reason = e.params[1]; this.parent.eventPump.addEvent(ev); delete e.server.channels[c].users[e.user.nick]; } } this.users[e.user.nick].lastQuitMessage = e.params[1]; this.users[e.user.nick].lastQuitDate = new Date; e.reason = e.params[1]; e.destObject = e.user; e.set = "user"; return true;} |
ev.reason = e.params[1]; | ev.reason = reason; | function serv_quit (e){ e.params[1] = toUnicode(e.params[1], this.parent); for (var c in e.server.channels) { if (e.server.channels[c].active && e.user.nick in e.server.channels[c].users) { var ev = new CEvent ("channel", "quit", e.server.channels[c], "onQuit"); ev.user = e.server.channels[c].users[e.user.nick]; ev.channel = e.server.channels[c]; ev.server = ev.channel.parent; ev.reason = e.params[1]; this.parent.eventPump.addEvent(ev); delete e.server.channels[c].users[e.user.nick]; } } this.users[e.user.nick].lastQuitMessage = e.params[1]; this.users[e.user.nick].lastQuitDate = new Date; e.reason = e.params[1]; e.destObject = e.user; e.set = "user"; return true;} |
this.users[e.user.nick].lastQuitMessage = e.params[1]; this.users[e.user.nick].lastQuitDate = new Date; | this.users[e.user.nick].lastQuitMessage = reason; this.users[e.user.nick].lastQuitDate = new Date(); | function serv_quit (e){ e.params[1] = toUnicode(e.params[1], this.parent); for (var c in e.server.channels) { if (e.server.channels[c].active && e.user.nick in e.server.channels[c].users) { var ev = new CEvent ("channel", "quit", e.server.channels[c], "onQuit"); ev.user = e.server.channels[c].users[e.user.nick]; ev.channel = e.server.channels[c]; ev.server = ev.channel.parent; ev.reason = e.params[1]; this.parent.eventPump.addEvent(ev); delete e.server.channels[c].users[e.user.nick]; } } this.users[e.user.nick].lastQuitMessage = e.params[1]; this.users[e.user.nick].lastQuitDate = new Date; e.reason = e.params[1]; e.destObject = e.user; e.set = "user"; return true;} |
e.reason = e.params[1]; | e.reason = reason; | function serv_quit (e){ e.params[1] = toUnicode(e.params[1], this.parent); for (var c in e.server.channels) { if (e.server.channels[c].active && e.user.nick in e.server.channels[c].users) { var ev = new CEvent ("channel", "quit", e.server.channels[c], "onQuit"); ev.user = e.server.channels[c].users[e.user.nick]; ev.channel = e.server.channels[c]; ev.server = ev.channel.parent; ev.reason = e.params[1]; this.parent.eventPump.addEvent(ev); delete e.server.channels[c].users[e.user.nick]; } } this.users[e.user.nick].lastQuitMessage = e.params[1]; this.users[e.user.nick].lastQuitDate = new Date; e.reason = e.params[1]; e.destObject = e.user; e.set = "user"; return true;} |
arrayInsertAt (this.sendQueue, 0, msg); | arrayInsertAt (this.sendQueue, 0, new String(msg)); | function serv_senddata (msg){ if (this.sendQueue.length == 0) this.parent.eventPump.addEvent (new CEvent ("server", "senddata", this, "onSendData")); arrayInsertAt (this.sendQueue, 0, msg); } |
smtpServer = parent.smtpService.defaultServer; setPageData(pageData, "identity", "smtpServerKey", smtpServer.key); | if (!parent.smtpService.defaultServer.redirectorType) { smtpServer = parent.smtpService.defaultServer; setPageData(pageData, "identity", "smtpServerKey", smtpServer.key); } | function serverPageInit() { gOnMailServersPage = (document.documentElement.currentPage.id == "serverpage"); gOnNewsServerPage = (document.documentElement.currentPage.id == "newsserver"); if (gOnNewsServerPage) { var newsServer = document.getElementById("newsServer"); var pageData = parent.GetPageData(); try { newsServer.value = pageData.newsserver.hostname.value; } catch (ex){} } // Server type selection (pop3 or imap) is for mail accounts only var pageData = parent.GetPageData(); var isMailAccount = pageData.accounttype.mailaccount; if (isMailAccount && isMailAccount.value){ var serverTypeRadioGroup = document.getElementById("servertype"); /* * Check to see if the radiogroup has any value. If there is no * value, this must be the first time user visting this page in the * account setup process. So, the default is set to pop3. If there * is a value (it's used automatically), user has already visited * page and server type selection is done. Once user visits the page, * the server type value from then on will persist (whether the selection * came from the default or the user action). */ if (!serverTypeRadioGroup.value) { // Set pop3 server type as default selection var pop3RadioItem = document.getElementById("pop3"); serverTypeRadioGroup.selectedItem = pop3RadioItem; } } gPrefsBundle = document.getElementById("bundle_prefs"); var smtpServer = null; try { smtpServer = parent.smtpService.defaultServer; setPageData(pageData, "identity", "smtpServerKey", smtpServer.key); } catch(ex){} // modify the value in the smtp display if we already have a // smtp server so that the single string displays the // name of the smtp server. var smtpStatic = document.getElementById("smtpStaticText"); if (smtpServer && smtpServer.hostname && smtpStatic && smtpStatic.hasChildNodes()) { var staticText = smtpStatic.firstChild.nodeValue; staticText = staticText.replace(/@server_name@/, smtpServer.hostname); while (smtpStatic.hasChildNodes()) smtpStatic.removeChild(smtpStatic.firstChild); var staticTextNode = document.createTextNode(staticText); smtpStatic.appendChild(staticTextNode); } hideShowSmtpSettings(smtpServer);} |
document.getElementById("downloadMsgs").hidden = true; | function serverPageInit() { gOnMailServersPage = (document.documentElement.currentPage.id == "serverpage"); gOnNewsServerPage = (document.documentElement.currentPage.id == "newsserver"); if (gOnNewsServerPage) { var newsServer = document.getElementById("newsServer"); var pageData = parent.GetPageData(); try { newsServer.value = pageData.newsserver.hostname.value; } catch (ex){} // never show this UI for news accounts document.getElementById("downloadMsgs").hidden = true; } // Server type selection (pop3 or imap) is for mail accounts only var pageData = parent.GetPageData(); var isMailAccount = pageData.accounttype.mailaccount; if (isMailAccount && isMailAccount.value){ var serverTypeRadioGroup = document.getElementById("servertype"); /* * Check to see if the radiogroup has any value. If there is no * value, this must be the first time user visting this page in the * account setup process. So, the default is set to pop3. If there * is a value (it's used automatically), user has already visited * page and server type selection is done. Once user visits the page, * the server type value from then on will persist (whether the selection * came from the default or the user action). */ if (!serverTypeRadioGroup.value) { // Set pop3 server type as default selection var pop3RadioItem = document.getElementById("pop3"); serverTypeRadioGroup.selectedItem = pop3RadioItem; setServerType(); } } gPrefsBundle = document.getElementById("bundle_prefs"); var smtpServer = null; try { smtpServer = parent.smtpService.defaultServer; setPageData(pageData, "identity", "smtpServerKey", smtpServer.key); } catch(ex){} // modify the value in the smtp display if we already have a // smtp server so that the single string displays the // name of the smtp server. var smtpStatic = document.getElementById("smtpStaticText"); if (smtpServer && smtpServer.hostname && smtpStatic && smtpStatic.hasChildNodes()) { var staticText = smtpStatic.firstChild.nodeValue; staticText = staticText.replace(/@server_name@/, smtpServer.hostname); while (smtpStatic.hasChildNodes()) smtpStatic.removeChild(smtpStatic.firstChild); var staticTextNode = document.createTextNode(staticText); smtpStatic.appendChild(staticTextNode); } hideShowSmtpSettings(smtpServer);} |
|
setServerType(); | function serverPageInit() { gOnMailServersPage = (document.documentElement.currentPage.id == "serverpage"); gOnNewsServerPage = (document.documentElement.currentPage.id == "newsserver"); if (gOnNewsServerPage) { var newsServer = document.getElementById("newsServer"); var pageData = parent.GetPageData(); try { newsServer.value = pageData.newsserver.hostname.value; } catch (ex){} // never show this UI for news accounts document.getElementById("downloadMsgs").hidden = true; } // Server type selection (pop3 or imap) is for mail accounts only var pageData = parent.GetPageData(); var isMailAccount = pageData.accounttype.mailaccount; if (isMailAccount && isMailAccount.value){ var serverTypeRadioGroup = document.getElementById("servertype"); /* * Check to see if the radiogroup has any value. If there is no * value, this must be the first time user visting this page in the * account setup process. So, the default is set to pop3. If there * is a value (it's used automatically), user has already visited * page and server type selection is done. Once user visits the page, * the server type value from then on will persist (whether the selection * came from the default or the user action). */ if (!serverTypeRadioGroup.value) { // Set pop3 server type as default selection var pop3RadioItem = document.getElementById("pop3"); serverTypeRadioGroup.selectedItem = pop3RadioItem; setServerType(); } } gPrefsBundle = document.getElementById("bundle_prefs"); var smtpServer = null; try { smtpServer = parent.smtpService.defaultServer; setPageData(pageData, "identity", "smtpServerKey", smtpServer.key); } catch(ex){} // modify the value in the smtp display if we already have a // smtp server so that the single string displays the // name of the smtp server. var smtpStatic = document.getElementById("smtpStaticText"); if (smtpServer && smtpServer.hostname && smtpStatic && smtpStatic.hasChildNodes()) { var staticText = smtpStatic.firstChild.nodeValue; staticText = staticText.replace(/@server_name@/, smtpServer.hostname); while (smtpStatic.hasChildNodes()) smtpStatic.removeChild(smtpStatic.firstChild); var staticTextNode = document.createTextNode(staticText); smtpStatic.appendChild(staticTextNode); } hideShowSmtpSettings(smtpServer);} |
|
if (gOnNewsServerPage) { var newsServer = document.getElementById("newsServer"); var pageData = parent.GetPageData() try { newsServer.value = pageData.newsserver.hostname.value; } catch (ex){} } | function serverPageInit() { gOnMailServersPage = (document.documentElement.currentPage.id == "serverpage"); gOnNewsServerPage = (document.documentElement.currentPage.id == "newsserver"); // Server type selection (pop3 or imap) is for mail accounts only var isMailAccount = parent.GetPageData().accounttype.mailaccount; if (isMailAccount && isMailAccount.value){ var serverTypeRadioGroup = document.getElementById("servertype"); /* * Check to see if the radiogroup has any value. If there is no * value, this must be the first time user visting this page in the * account setup process. So, the default is set to pop3. If there * is a value (it's used automatically), user has already visited * page and server type selection is done. Once user visits the page, * the server type value from then on will persist (whether the selection * came from the default or the user action). */ if (!serverTypeRadioGroup.value) { // Set pop3 server type as default selection var pop3RadioItem = document.getElementById("pop3"); serverTypeRadioGroup.selectedItem = pop3RadioItem; } } gPrefsBundle = document.getElementById("bundle_prefs"); var smtpServer = null; try { smtpServer = parent.smtpService.defaultServer; } catch(ex){} // modify the value in the smtp display if we already have a // smtp server so that the single string displays the // name of the smtp server. var smtpStatic = document.getElementById("smtpStaticText"); if (smtpServer && smtpServer.hostname && smtpStatic && smtpStatic.hasChildNodes()) { var staticText = smtpStatic.firstChild.nodeValue; staticText = staticText.replace(/@server_name@/, smtpServer.hostname); while (smtpStatic.hasChildNodes()) smtpStatic.removeChild(smtpStatic.firstChild); var staticTextNode = document.createTextNode(staticText); smtpStatic.appendChild(staticTextNode); } hideShowSmtpSettings(smtpServer);} |
|
supports = currData.supports; length = 0; | set: function (aTransferDataSet) { var trans = this.createTransferable(); for (var i = 0; i < aTransferDataSet.dataList.length; ++i) { var currData = aTransferDataSet.dataList[i]; var currFlavour = currData.flavour.contentType; trans.addDataFlavor(currFlavour); var supports = null; // nsISupports data var length = 0; if (currData.flavour.dataIIDKey == "nsISupportsString") { supports = Components.classes["@mozilla.org/supports-string;1"] .createInstance(Components.interfaces.nsISupportsString); supports.data = currData.supports; length = supports.data.length; } else { // non-string data. TBD! } trans.setTransferData(currFlavour, supports, length * 2); } return trans; }, |
|
return this.each(function(){ if ( typeof b == 'undefined' ) for ( var j in a ) $.attr(this,j,a[j]); else $.attr(this,a,b); }); }, | return this.each(function(){ if ( b == undefined ) for ( var j in a ) $.attr(this,j,a[j]); else $.attr(this,a,b); }); }, | set: function(a,b) { return this.each(function(){ if ( typeof b == 'undefined' ) for ( var j in a ) $.attr(this,j,a[j]); else $.attr(this,a,b); }); }, |
document.getElementById("searchFilter").value = value; | if (value != this._value) { this._pb.setCharPref(this._pref, this._serializable.serialize(value)); var ps = this._pb.QueryInterface(Ci.nsIPrefService); ps.savePrefFile(null); } | set value(value) { document.getElementById("searchFilter").value = value; return value; } |
throw Components.results.NS_NOT_IMPLEMENTED; | throw Components.results.NS_ERROR_NOT_IMPLEMENTED; | set icalString() { throw Components.results.NS_NOT_IMPLEMENTED; }, |
var propmap = [["mStartDate", "startTime"], ["mEndDate", "endTime"], ["mStampDate", "stampDate"]]; this.mapPropsFromICS(event, propmap); this.mIsAllDay = this.mStartDate.isDate; | this.mapPropsFromICS(event, this.icsEventPropMap); this.mIsAllDay = this.mStartDate && this.mStartDate.isDate; | set icalString(value) { if (this.mImmutable) throw Components.results.NS_ERROR_FAILURE; var ical = icalFromString(value); var event = ical.getFirstSubcomponent(Components.interfaces.calIIcalComponent.VEVENT_COMPONENT); if (!event) throw Components.results.NS_ERROR_INVALID_ARG; this.setItemBaseFromICS(event); var propmap = [["mStartDate", "startTime"], ["mEndDate", "endTime"], ["mStampDate", "stampDate"]]; this.mapPropsFromICS(event, propmap); this.mIsAllDay = this.mStartDate.isDate; }, |
set icalComponent(todo) { | set entryDate(value) { | set icalComponent(todo) { this.modify(); if (todo.componentType != "VTODO") { todo = todo.getFirstSubcomponent("VTODO"); if (!todo) throw Components.results.NS_ERROR_INVALID_ARG; } this.setItemBaseFromICS(todo); this.mapPropsFromICS(todo, this.icsEventPropMap); this.mIsAllDay = this.mStartDate && this.mStartDate.isDate; this.importUnpromotedProperties(todo, this.todoPromotedProps); // Importing didn't really change anything this.mDirty = false; }, |
if (todo.componentType != "VTODO") { todo = todo.getFirstSubcomponent("VTODO"); if (!todo) throw Components.results.NS_ERROR_INVALID_ARG; | if (this.parentItem == this) { var rec = this.recurrenceInfo; if (rec) { rec.onStartDateChange(value,this.entryDate); } | set icalComponent(todo) { this.modify(); if (todo.componentType != "VTODO") { todo = todo.getFirstSubcomponent("VTODO"); if (!todo) throw Components.results.NS_ERROR_INVALID_ARG; } this.setItemBaseFromICS(todo); this.mapPropsFromICS(todo, this.icsEventPropMap); this.mIsAllDay = this.mStartDate && this.mStartDate.isDate; this.importUnpromotedProperties(todo, this.todoPromotedProps); // Importing didn't really change anything this.mDirty = false; }, |
this.setItemBaseFromICS(todo); this.mapPropsFromICS(todo, this.icsEventPropMap); this.mIsAllDay = this.mStartDate && this.mStartDate.isDate; this.importUnpromotedProperties(todo, this.todoPromotedProps); this.mDirty = false; | this.setProperty("DTSTART", value); | set icalComponent(todo) { this.modify(); if (todo.componentType != "VTODO") { todo = todo.getFirstSubcomponent("VTODO"); if (!todo) throw Components.results.NS_ERROR_INVALID_ARG; } this.setItemBaseFromICS(todo); this.mapPropsFromICS(todo, this.icsEventPropMap); this.mIsAllDay = this.mStartDate && this.mStartDate.isDate; this.importUnpromotedProperties(todo, this.todoPromotedProps); // Importing didn't really change anything this.mDirty = false; }, |
if (event.componentType != "VEVENT"); { | if (event.componentType != "VEVENT") { | set icalComponent(event) { if (this.mImmutable) throw Components.results.NS_ERROR_FAILURE; if (event.componentType != "VEVENT"); { event = event.getFirstSubcomponent("VEVENT"); if (!event) throw Components.results.NS_ERROR_INVALID_ARG; } this.setItemBaseFromICS(event); this.mapPropsFromICS(event, this.icsEventPropMap); this.mIsAllDay = this.mStartDate && this.mStartDate.isDate; var promotedProps = { "DTSTART": true, "DTEND": true, "DTSTAMP": true, __proto__: this.itemBasePromotedProps }; this.importUnpromotedProperties(event, promotedProps); } |
if (aObject.nodeType == Node.ELEMENT_NODE) { deck.setAttribute("selectedIndex", 0); this.setTextValue("nodeName", aObject.nodeName); this.setTextValue("nodeType", aObject.nodeType); this.setTextValue("nodeValue", aObject.nodeValue); this.setTextValue("namespace", aObject.namespaceURI); if (aObject != this.mDOMView.rootNode) { this.mDOMView.rootNode = aObject; this.mAttrTree.view.selection.select(-1); } } else { deck.setAttribute("selectedIndex", 1); var txb = document.getElementById("txbTextNodeValue"); txb.value = aObject.nodeValue; } | set subject(aObject) { this.mSubject = aObject; var deck = document.getElementById("dkContent"); if (aObject.nodeType == Node.ELEMENT_NODE) { deck.setAttribute("selectedIndex", 0); this.setTextValue("nodeName", aObject.nodeName); this.setTextValue("nodeType", aObject.nodeType); this.setTextValue("nodeValue", aObject.nodeValue); this.setTextValue("namespace", aObject.namespaceURI); if (aObject != this.mDOMView.rootNode) { this.mDOMView.rootNode = aObject; this.mAttrTree.view.selection.select(-1); } } else { deck.setAttribute("selectedIndex", 1); var txb = document.getElementById("txbTextNodeValue"); txb.value = aObject.nodeValue; } this.mObsMan.dispatchEvent("subjectChange", { subject: aObject }); }, |
|
this.mDOMView.rootNode = aObject; | this.mDOMView.rootNode = aObject.documentElement; | set subject(aObject) { this.mSubject = aObject; this.mDOMView.rootNode = aObject; this.mObsMan.dispatchEvent("subjectChange", { subject: aObject }); this.setInitialSelection(aObject); }, |
if (event.duration) { this.endDate = this.startDate.clone(); this.endDate.addDuration(event.duration); } | set icalComponent(event) { this.modify(); if (event.componentType != "VEVENT") { event = event.getFirstSubcomponent("VEVENT"); if (!event) throw Components.results.NS_ERROR_INVALID_ARG; } this.setItemBaseFromICS(event); this.mapPropsFromICS(event, this.icsEventPropMap); this.importUnpromotedProperties(event, this.eventPromotedProps); // Importing didn't really change anything this.mDirty = false; }, |
|
this.importUnpromotedProperties(todo, todoPromotedProps); | this.importUnpromotedProperties(todo, this.todoPromotedProps); | set icalComponent(todo) { this.modify(); if (todo.componentType != "VTODO") { todo = todo.getFirstSubcomponent("VTODO"); if (!todo) throw Components.results.NS_ERROR_INVALID_ARG; } this.setItemBaseFromICS(todo); this.mapPropsFromICS(todo, this.icsEventPropMap); this.mIsAllDay = this.mStartDate && this.mStartDate.isDate; this.importUnpromotedProperties(todo, todoPromotedProps); // Importing didn't really change anything this.mDirty = false; }, |
for each (exitem in this.mExceptions) { exitem.item.parentItem = value; } | set item(value) { if (this.mImmutable) throw Components.results.NS_ERROR_OBJECT_IS_IMMUTABLE; this.mBaseItem = value; }, |
|
set searchTitle(aTitle) { var splitter = document.getElementById("splSearch"); splitter.setAttribute("label", "Search" + (aTitle ? " - " + aTitle : "")); }, | set progress(aPct) { document.getElementById("pmStatus").value = aPct; }, | set searchTitle(aTitle) { var splitter = document.getElementById("splSearch"); splitter.setAttribute("label", "Search" + (aTitle ? " - " + aTitle : "")); }, |
set icalComponent(event) { | set startDate(value) { | set icalComponent(event) { this.modify(); if (event.componentType != "VEVENT") { event = event.getFirstSubcomponent("VEVENT"); if (!event) throw Components.results.NS_ERROR_INVALID_ARG; } this.setItemBaseFromICS(event); this.mapPropsFromICS(event, this.icsEventPropMap); this.importUnpromotedProperties(event, this.eventPromotedProps); // If there is a duration set on the event, calculate the right // end time. // XXX This means that serializing later will loose the duration // information, to replace it with a dtend. bug 317786 if (event.duration) { this.endDate = this.startDate.clone(); this.endDate.addDuration(event.duration); } // If endDate is still invalid neither a end time nor a duration is set // on the event. We have to set endDate ourselves. // If the start time is a date-time the event ends on the same calendar // date and time of day. If the start time is a date the events // non-inclusive end is the end of the calendar date. if (!this.endDate.isValid) { this.endDate = this.startDate.clone(); if (this.startDate.isDate) { this.endDate.day += 1; this.endDate.normalize(); } } // Importing didn't really change anything this.mDirty = false; }, |
if (event.componentType != "VEVENT") { event = event.getFirstSubcomponent("VEVENT"); if (!event) throw Components.results.NS_ERROR_INVALID_ARG; | if (this.parentItem == this) { var rec = this.recurrenceInfo; if (rec) { rec.onStartDateChange(value,this.startDate); } | set icalComponent(event) { this.modify(); if (event.componentType != "VEVENT") { event = event.getFirstSubcomponent("VEVENT"); if (!event) throw Components.results.NS_ERROR_INVALID_ARG; } this.setItemBaseFromICS(event); this.mapPropsFromICS(event, this.icsEventPropMap); this.importUnpromotedProperties(event, this.eventPromotedProps); // If there is a duration set on the event, calculate the right // end time. // XXX This means that serializing later will loose the duration // information, to replace it with a dtend. bug 317786 if (event.duration) { this.endDate = this.startDate.clone(); this.endDate.addDuration(event.duration); } // If endDate is still invalid neither a end time nor a duration is set // on the event. We have to set endDate ourselves. // If the start time is a date-time the event ends on the same calendar // date and time of day. If the start time is a date the events // non-inclusive end is the end of the calendar date. if (!this.endDate.isValid) { this.endDate = this.startDate.clone(); if (this.startDate.isDate) { this.endDate.day += 1; this.endDate.normalize(); } } // Importing didn't really change anything this.mDirty = false; }, |
this.setItemBaseFromICS(event); this.mapPropsFromICS(event, this.icsEventPropMap); this.importUnpromotedProperties(event, this.eventPromotedProps); if (event.duration) { this.endDate = this.startDate.clone(); this.endDate.addDuration(event.duration); } if (!this.endDate.isValid) { this.endDate = this.startDate.clone(); if (this.startDate.isDate) { this.endDate.day += 1; this.endDate.normalize(); } } this.mDirty = false; | this.setProperty("DTSTART", value); | set icalComponent(event) { this.modify(); if (event.componentType != "VEVENT") { event = event.getFirstSubcomponent("VEVENT"); if (!event) throw Components.results.NS_ERROR_INVALID_ARG; } this.setItemBaseFromICS(event); this.mapPropsFromICS(event, this.icsEventPropMap); this.importUnpromotedProperties(event, this.eventPromotedProps); // If there is a duration set on the event, calculate the right // end time. // XXX This means that serializing later will loose the duration // information, to replace it with a dtend. bug 317786 if (event.duration) { this.endDate = this.startDate.clone(); this.endDate.addDuration(event.duration); } // If endDate is still invalid neither a end time nor a duration is set // on the event. We have to set endDate ourselves. // If the start time is a date-time the event ends on the same calendar // date and time of day. If the start time is a date the events // non-inclusive end is the end of the calendar date. if (!this.endDate.isValid) { this.endDate = this.startDate.clone(); if (this.startDate.isDate) { this.endDate.day += 1; this.endDate.normalize(); } } // Importing didn't really change anything this.mDirty = false; }, |
set value(value) { if (value != this._value) this._pb.setCharPref(this._pref, this._serializable.serialize(value)); return value; } | set activeView(activeView) { this._activeView = activeView; return this._activeView; }, | set value(value) { if (value != this._value) this._pb.setCharPref(this._pref, this._serializable.serialize(value)); return value; } |
var ti = this.addTreeItem(this.mTreeKids, "target", aObject, aObject); | var ti = this.addTreeItem(this.mTreeKids, bundle.getString("root.title"), aObject, aObject); | set subject(aObject) { this.mSubject = aObject; this.emptyTree(this.mTreeKids); var ti = this.addTreeItem(this.mTreeKids, "target", aObject, aObject); this.openTreeItem(ti); this.mObsMan.dispatchEvent("subjectChange", { subject: aObject }); }, |
this.locked = true; this.loading = true; | set uri(aUri) { this.mMemoryCalendar.uri = this.mUri; // Lock other changes to the item list. this.locked = true; // set to prevent writing after loading, without any changes this.loading = true; this.mUri = aUri; var ioService = Components.classes["@mozilla.org/network/io-service;1"] .getService(Components.interfaces.nsIIOService); var channel = ioService.newChannelFromURI(fixupUri(this.mUri)); channel.loadFlags |= Components.interfaces.nsIRequest.LOAD_BYPASS_CACHE; channel.notificationCallbacks = this; var streamLoader = Components.classes["@mozilla.org/network/stream-loader;1"] .createInstance(Components.interfaces.nsIStreamLoader); streamLoader.init(channel, this, this); }, |
|
var ioService = Components.classes["@mozilla.org/network/io-service;1"] .getService(Components.interfaces.nsIIOService); var channel = ioService.newChannelFromURI(fixupUri(this.mUri)); channel.loadFlags |= Components.interfaces.nsIRequest.LOAD_BYPASS_CACHE; channel.notificationCallbacks = this; var streamLoader = Components.classes["@mozilla.org/network/stream-loader;1"] .createInstance(Components.interfaces.nsIStreamLoader); streamLoader.init(channel, this, this); | this.refresh(); | set uri(aUri) { this.mMemoryCalendar.uri = this.mUri; // Lock other changes to the item list. this.locked = true; // set to prevent writing after loading, without any changes this.loading = true; this.mUri = aUri; var ioService = Components.classes["@mozilla.org/network/io-service;1"] .getService(Components.interfaces.nsIIOService); var channel = ioService.newChannelFromURI(fixupUri(this.mUri)); channel.loadFlags |= Components.interfaces.nsIRequest.LOAD_BYPASS_CACHE; channel.notificationCallbacks = this; var streamLoader = Components.classes["@mozilla.org/network/stream-loader;1"] .createInstance(Components.interfaces.nsIStreamLoader); streamLoader.init(channel, this, this); }, |
document.getElementById('introtext').value = getEditorContent('introtext'); document.getElementById('bodytext').value = getEditorContent('bodytext'); | document.getElementById('introtext').value = getEditorContent('introhtml'); document.getElementById('bodytext').value = getEditorContent('bodyhtml'); | function set_postcontent() { if (document.getElementById('sel_editmode').value == 'html') { document.getElementById('introtext').value = getEditorContent('introtext'); document.getElementById('bodytext').value = getEditorContent('bodytext'); } } |
element.selectedItem = element.getElementsByAttribute("value", aDataObject.value)[0]; | element.value = aDataObject.value; | set_Radiogroup: function (aElementID, aDataObject) { var element = gCurrentWindow.document.getElementById(aElementID); wsm.generic_Set(element, aDataObject); if ("value" in aDataObject) element.selectedItem = element.getElementsByAttribute("value", aDataObject.value)[0]; if ("disabled" in aDataObject) element.disabled = aDataObject.disabled; }, |
var startTime = getDateTimeFieldValue( "start-date-text" ); var dayNumber = startTime.getDay(); | var dayNumber = document.getElementById( "start-date-picker" ).value.getDay(); | function setAdvancedWeekRepeat(){ var checked = false; if( gEvent.recurWeekdays > 0 ) { for( var i = 0; i < 7; i++ ) { checked = ( ( gEvent.recurWeekdays | eval( "kRepeatDay_"+i ) ) == eval( gEvent.recurWeekdays ) ); setFieldValue( "advanced-repeat-week-"+i, checked, "checked" ); setFieldValue( "advanced-repeat-week-"+i, false, "today" ); } } //get the day number for today. var startTime = getDateTimeFieldValue( "start-date-text" ); var dayNumber = startTime.getDay(); setFieldValue( "advanced-repeat-week-"+dayNumber, "true", "checked" ); setFieldValue( "advanced-repeat-week-"+dayNumber, "true", "disabled" ); setFieldValue( "advanced-repeat-week-"+dayNumber, "true", "today" ); } |
var dayNumber = document.getElementById( "start-date-picker" ).value.getDay(); | var dayNumber = document.getElementById( "start-datetime" ).value.getDay(); | function setAdvancedWeekRepeat(){ var checked = false; if( gEvent.recurWeekdays > 0 ) { for( var i = 0; i < 7; i++ ) { checked = ( ( gEvent.recurWeekdays | eval( "kRepeatDay_"+i ) ) == eval( gEvent.recurWeekdays ) ); setFieldValue( "advanced-repeat-week-"+i, checked, "checked" ); setFieldValue( "advanced-repeat-week-"+i, false, "today" ); } } //get the day number for today. var dayNumber = document.getElementById( "start-date-picker" ).value.getDay(); setFieldValue( "advanced-repeat-week-"+dayNumber, "true", "checked" ); setFieldValue( "advanced-repeat-week-"+dayNumber, "true", "disabled" ); setFieldValue( "advanced-repeat-week-"+dayNumber, "true", "today" ); } |
DWREngine.setAsync = function(async) { DWREngine._async = async; | dwr.engine.setAsync = function(async) { dwr.engine._async = async; | DWREngine.setAsync = function(async) { DWREngine._async = async;}; |
obj.setAttribute ("msg-user", fromAttr); | function setAttribs (obj, c, attrs) { for (var a in attrs) obj.setAttribute (a, attrs[a]); obj.setAttribute ("class", c); obj.setAttribute ("msg-type", msgtype); obj.setAttribute ("msg-user", fromAttr); obj.setAttribute ("msg-dest", toAttr); obj.setAttribute ("dest-type", toType); obj.setAttribute ("view-type", viewType); } |
|
obj.setAttribute ("view-type", viewType); } | obj.setAttribute ("view-type", viewType); if (fromAttr) if (fromUser) obj.setAttribute ("msg-user", fromAttr); else obj.setAttribute ("msg-source", fromAttr); } | function setAttribs (obj, c, attrs) { for (var a in attrs) obj.setAttribute (a, attrs[a]); obj.setAttribute ("class", c); obj.setAttribute ("msg-type", msgtype); obj.setAttribute ("msg-user", fromAttr); obj.setAttribute ("msg-dest", toAttr); obj.setAttribute ("dest-type", toType); obj.setAttribute ("view-type", viewType); } |
jQuery.setAuto = function(e,p) { var a = e.style[p]; var o = jQuery.css(e,p); e.style[p] = "auto"; var n = jQuery.css(e,p); if ( o != n ) e.style[p] = a; }; | setAuto: function(e,p) { var a = e.style[p]; var o = jQuery.css(e,p); e.style[p] = "auto"; var n = jQuery.css(e,p); if ( o != n ) e.style[p] = a; }, | jQuery.setAuto = function(e,p) { var a = e.style[p]; var o = jQuery.css(e,p); e.style[p] = "auto"; var n = jQuery.css(e,p); if ( o != n ) e.style[p] = a;}; |
if ( o != n && n != "auto" ) e.style[p] = a; | if ( o != n && n != "auto" ) { e.style[p] = a; e.notAuto = true; } | setAuto: function(e,p) { // Remember the original height var a = e.style[p]; // Figure out the size of the height right now var o = jQuery.curCSS(e,p,1); // Set the height to auto e.style[p] = e.currentStyle ? "" : "auto"; // See what the size of "auto" is var n = jQuery.curCSS(e,p,1); // Revert back to the original size if ( o != n && n != "auto" ) e.style[p] = a; }, |
e.style[p] = 'auto'; | e.style[p] = "auto"; | $.setAuto = function(e,p) { var a = e.style[p]; var o = $.css(e,p); e.style[p] = 'auto'; var n = $.css(e,p); if ( o != n ) { e.style[p] = a; }}; |
if ( o != n ) { | if ( o != n ) | $.setAuto = function(e,p) { var a = e.style[p]; var o = $.css(e,p); e.style[p] = 'auto'; var n = $.css(e,p); if ( o != n ) { e.style[p] = a; }}; |
} | $.setAuto = function(e,p) { var a = e.style[p]; var o = $.css(e,p); e.style[p] = 'auto'; var n = $.css(e,p); if ( o != n ) { e.style[p] = a; }}; |
|
var matches = bpr.scriptMatches | var matches = bpr.scriptMatches; | function setBreakpoint (fileName, line){ var scriptRec = console.scripts[fileName]; if (!scriptRec) { display (getMsg(MSN_ERR_NOSCRIPT, fileName), MT_ERROR); return null; } var bpr = console.breakpoints.locateChildByFileLine (fileName, line); if (bpr) { display (getMsg(MSN_BP_EXISTS, [fileName, line]), MT_INFO); return null; } bpr = new BPRecord (fileName, line); var ary = scriptRec.childData; var found = false; for (var i = 0; i < ary.length; ++i) { if (ary[i].containsLine(line) && ary[i].script.isLineExecutable(line, PCMAP_SOURCETEXT)) { found = true; bpr.addScriptRecord(ary[i]); } } var matches = bpr.scriptMatches if (!matches) { display (getMsg(MSN_ERR_BP_NOLINE, [fileName, line]), MT_ERROR); return null; } if (scriptRec.sourceText.isLoaded && scriptRec.sourceText.lines[line - 1]) { scriptRec.sourceText.lines[line - 1].bpRecord = bpr; if (console.sourceView.childData.fileName == fileName) console.sourceView.outliner.invalidateRow (line - 1); } console.breakpoints.appendChild (bpr); display (getMsg(MSN_BP_CREATED, [fileName, line, matches])); return bpr;} |
display (getMsg(MSN_BP_CREATED, [fileName, line, matches])); | function setBreakpoint (fileName, line){ var scriptRec = console.scripts[fileName]; if (!scriptRec) { display (getMsg(MSN_ERR_NOSCRIPT, fileName), MT_ERROR); return null; } var bpr = console.breakpoints.locateChildByFileLine (fileName, line); if (bpr) { display (getMsg(MSN_BP_EXISTS, [fileName, line]), MT_INFO); return null; } bpr = new BPRecord (fileName, line); var ary = scriptRec.childData; var found = false; for (var i = 0; i < ary.length; ++i) { if (ary[i].containsLine(line) && ary[i].script.isLineExecutable(line, PCMAP_SOURCETEXT)) { found = true; bpr.addScriptRecord(ary[i]); } } var matches = bpr.scriptMatches if (!matches) { display (getMsg(MSN_ERR_BP_NOLINE, [fileName, line]), MT_ERROR); return null; } if (scriptRec.sourceText.isLoaded && scriptRec.sourceText.lines[line - 1]) { scriptRec.sourceText.lines[line - 1].bpRecord = bpr; if (console.sourceView.childData.fileName == fileName) console.sourceView.outliner.invalidateRow (line - 1); } console.breakpoints.appendChild (bpr); display (getMsg(MSN_BP_CREATED, [fileName, line, matches])); return bpr;} |
|
var profile = Components.classes["@mozilla.org/profile/manager;1"].getService(Components.interfaces.nsIProfileInternal); gProfileDirURL = gIOService.newFileURI(profile.getProfileDir(profile.currentProfile)); | var dirService = Components.classes["@mozilla.org/directory_service;1"] .getService(Components.interfaces.nsIProperties); var profileDir = dirService.get("ProfD", Components.interfaces.nsIFile); gProfileDirURL = gIOService.newFileURI(profileDir); | function setBuddyIcon(card, buddyIcon){ try { var myScreenName = gPrefs.getCharPref("aim.session.screenname"); if (myScreenName && card.primaryEmail) { if (!gProfileDirURL) { // lazily create these file urls, and keep them around var profile = Components.classes["@mozilla.org/profile/manager;1"].getService(Components.interfaces.nsIProfileInternal); gProfileDirURL = gIOService.newFileURI(profile.getProfileDir(profile.currentProfile)); } // if we did have a buddy icon on disk for this screenname, this would be the file url spec for it var iconURLStr = gProfileDirURL.spec + "/NIM/" + myScreenName + "/picture/" + card.aimScreenName + ".gif"; // check if the file exists var file = gFileHandler.getFileFromURLSpec(iconURLStr); // check if the file exists // is this a perf hit? (how expensive is stat()?) if (file.exists()) { buddyIcon.setAttribute("src", iconURLStr); return true; } } } catch (ex) { // can get here if no screenname } buddyIcon.setAttribute("src", ""); return false;} |
bb.disabled = backButtonDisabled; bn.disabled = nextButtonDisabled; | this.wiz.canRewind = !backButtonDisabled; this.wiz.canAdvance = !(nextButtonDisabled && finishButtonDisabled); | setButtons: function(backButtonLabel, backButtonDisabled, nextButtonLabel, nextButtonDisabled, finishButtonLabel, finishButtonDisabled, cancelButtonLabel, cancelButtonDisabled, hideBackAndCancelButtons, extraButtonLabel, extraButtonDisabled) { var bb = this.wiz.getButton("back"); var bn = this.wiz.getButton("next"); var bf = this.wiz.getButton("finish"); var bc = this.wiz.getButton("cancel"); var be = this.wiz.getButton("extra1"); bb.label = backButtonLabel || this._buttonLabel_back; bn.label = nextButtonLabel || this._buttonLabel_next; bf.label = finishButtonLabel || this._buttonLabel_finish; bc.label = cancelButtonLabel || this._buttonLabel_hide; be.label = extraButtonLabel || this._buttonLabel_hide; bb.disabled = backButtonDisabled; bn.disabled = nextButtonDisabled; bf.disabled = finishButtonDisabled; bc.disabled = cancelButtonDisabled; be.disabled = extraButtonDisabled; // Show or hide the cancel and back buttons, since the Extra // button does this job. bc.hidden = hideBackAndCancelButtons; bb.hidden = hideBackAndCancelButtons; // Show or hide the extra button be.hidden = extraButtonLabel == null; }, |
this.init(); | function setCalendar(calendar){ if (this.calendar) this.calendar.removeObserver(this.calendarObserver); this.calendar = calendar; calendar.addObserver(this.calendarObserver); // Update everything this.refreshPeriodDates();}; |
|
var composite = getDisplayComposite(); | var composite = getCompositeCalendar(); | function setCalendarManagerUI(){ var calendarList = document.getElementById("list-calendars-listbox"); var child; while ((child = calendarList.lastChild) && (child.tagName == "listitem")) { calendarList.removeChild(child); } var composite = getDisplayComposite(); var calmgr = getCalendarManager(); var calendars = calmgr.getCalendars({}); var hasRefreshableCal = false; for each (var calendar in calendars) { if (calendar.canRefresh) { hasRefreshableCal = true; } var listItem = document.createElement("listitem"); var checkCell = document.createElement("listcell"); checkCell.setAttribute("type", "checkbox"); checkCell.setAttribute("checked", composite.getCalendar(calendar.uri) ? true : false); listItem.appendChild(checkCell); listItem.addEventListener("click", onCalendarCheckboxClick, true); var colorCell = document.createElement("listcell"); try { var calColor = calmgr.getCalendarPref(calendar, 'color'); colorCell.style.background = calColor; } catch(e) {} listItem.appendChild(colorCell); var nameCell = document.createElement("listcell"); nameCell.setAttribute("label", calendar.name); listItem.appendChild(nameCell); listItem.calendar = calendar; calendarList.appendChild(listItem); if (calendarList.selectedIndex == -1) calendarList.selectedIndex = 0; } var remoteCommand = document.getElementById("reload_remote_calendars"); if (!hasRefreshableCal) { remoteCommand.setAttribute("disabled", true); } else { remoteCommand.removeAttribute("disabled"); }} |
if (checkboxValue){ try { pref.ClearUserPref(prefName); } catch (e) {} } else { pref.SetCharPref(prefName, "noAccess"); | if (checkboxValue){ try { parent.hPrefWindow.pref.ClearUserPref(prefName); } catch (e) {} } else { parent.hPrefWindow.setPref("string", prefName, "noAccess"); } | function setCapabilityPolicy(prefName, checkboxValue){ //if checked, we allow the script to do task, so we clear the pref. //since some options are made up of multiple capability policies and users can turn //individual ones on/off via prefs.js, it can happen that we clear a nonexistent pref if (checkboxValue){ try { pref.ClearUserPref(prefName); } catch (e) {} } else { pref.SetCharPref(prefName, "noAccess"); }} |
} | function setCapabilityPolicy(prefName, checkboxValue){ //if checked, we allow the script to do task, so we clear the pref. //since some options are made up of multiple capability policies and users can turn //individual ones on/off via prefs.js, it can happen that we clear a nonexistent pref if (checkboxValue){ try { pref.ClearUserPref(prefName); } catch (e) {} } else { pref.SetCharPref(prefName, "noAccess"); }} |
|
try { cardproperty.phoneticFirstName = doc.getElementById('PhoneticFirstName').value; cardproperty.phoneticLastName = doc.getElementById('PhoneticLastName').value; } catch (ex) {} | function SetCardValues(cardproperty, doc){ if (cardproperty) { cardproperty.firstName = doc.getElementById('FirstName').value; cardproperty.lastName = doc.getElementById('LastName').value; cardproperty.displayName = doc.getElementById('DisplayName').value; cardproperty.nickName = doc.getElementById('NickName').value; cardproperty.primaryEmail = doc.getElementById('PrimaryEmail').value; cardproperty.secondEmail = doc.getElementById('SecondEmail').value; cardproperty.aimScreenName = doc.getElementById('ScreenName').value; var popup = document.getElementById('PreferMailFormatPopup'); if ( popup ) cardproperty.preferMailFormat = popup.value; cardproperty.workPhone = doc.getElementById('WorkPhone').value; cardproperty.homePhone = doc.getElementById('HomePhone').value; cardproperty.faxNumber = doc.getElementById('FaxNumber').value; cardproperty.pagerNumber = doc.getElementById('PagerNumber').value; cardproperty.cellularNumber = doc.getElementById('CellularNumber').value; cardproperty.homeAddress = doc.getElementById('HomeAddress').value; cardproperty.homeAddress2 = doc.getElementById('HomeAddress2').value; cardproperty.homeCity = doc.getElementById('HomeCity').value; cardproperty.homeState = doc.getElementById('HomeState').value; cardproperty.homeZipCode = doc.getElementById('HomeZipCode').value; cardproperty.homeCountry = doc.getElementById('HomeCountry').value; cardproperty.webPage2 = CleanUpWebPage(doc.getElementById('WebPage2').value); cardproperty.jobTitle = doc.getElementById('JobTitle').value; cardproperty.department = doc.getElementById('Department').value; cardproperty.company = doc.getElementById('Company').value; cardproperty.workAddress = doc.getElementById('WorkAddress').value; cardproperty.workAddress2 = doc.getElementById('WorkAddress2').value; cardproperty.workCity = doc.getElementById('WorkCity').value; cardproperty.workState = doc.getElementById('WorkState').value; cardproperty.workZipCode = doc.getElementById('WorkZipCode').value; cardproperty.workCountry = doc.getElementById('WorkCountry').value; cardproperty.webPage1 = CleanUpWebPage(doc.getElementById('WebPage1').value); cardproperty.custom1 = doc.getElementById('Custom1').value; cardproperty.custom2 = doc.getElementById('Custom2').value; cardproperty.custom3 = doc.getElementById('Custom3').value; cardproperty.custom4 = doc.getElementById('Custom4').value; cardproperty.notes = doc.getElementById('Notes').value; }} |
|
delete client.ucConverter; | function setCharset (charset){ client.CHARSET = charset; if (!charset) { delete client.ucConverter; client.eventPump.removeHookByName("uc-hook"); return true; } var ex; try { if (!("ucConverter" in client)) { const UC_CTRID = "@mozilla.org/intl/scriptableunicodeconverter"; const nsIUnicodeConverter = Components.interfaces.nsIScriptableUnicodeConverter; client.ucConverter = Components.classes[UC_CTRID].getService(nsIUnicodeConverter); } client.ucConverter.charset = charset; if (!client.eventPump.getHook("uc-hook")) { client.eventPump.addHook ([{type: "parseddata", set: "server"}], ucConvertIncomingMessage, "uc-hook"); } } catch (ex) { dd ("Caught exception setting charset to " + charset + "\n" + ex); client.CHARSET = ""; client.eventPump.removeHookByName("uc-hook"); return false; } return true;} |
|
client.output = doc.getElementById("output"); if (client.output) { dd ("Got output element."); initStatic(); } else dd ("ARG! Couldn't get output element, try again later."); | client.output = frames[0].document.getElementById("output"); | function setClientOutput(doc) { client.output = doc.getElementById("output"); if (client.output) { dd ("Got output element."); /* continue processing now: */ initStatic(); } else dd ("ARG! Couldn't get output element, try again later."); } |
gDialog.CellInheritColor.setAttribute("collapsed","true"); | gDialog.CellInheritColor.collapsed = true; | function SetColor(ColorWellID, color){ // Save the color if (ColorWellID == "cellBackgroundCW") { if (color) { globalCellElement.setAttribute(bgcolor, color); gDialog.CellInheritColor.setAttribute("collapsed","true"); } else { try { gActiveEditor.removeAttributeOrEquivalent(globalCellElement, bgcolor, true); } catch(e) {} // Reveal addition message explaining "default" color gDialog.CellInheritColor.removeAttribute("collapsed"); } } else { if (color) { globalTableElement.setAttribute(bgcolor, color); gDialog.TableInheritColor.setAttribute("collapsed","true"); } else { try { gActiveEditor.removeAttributeOrEquivalent(globalTableElement, bgcolor, true); } catch(e) {} gDialog.TableInheritColor.removeAttribute("collapsed"); } SetCheckbox('CellColorCheckbox'); } setColorWell(ColorWellID, color);} |
gDialog.CellInheritColor.removeAttribute("collapsed"); | gDialog.CellInheritColor.collapsed = false; | function SetColor(ColorWellID, color){ // Save the color if (ColorWellID == "cellBackgroundCW") { if (color) { globalCellElement.setAttribute(bgcolor, color); gDialog.CellInheritColor.setAttribute("collapsed","true"); } else { try { gActiveEditor.removeAttributeOrEquivalent(globalCellElement, bgcolor, true); } catch(e) {} // Reveal addition message explaining "default" color gDialog.CellInheritColor.removeAttribute("collapsed"); } } else { if (color) { globalTableElement.setAttribute(bgcolor, color); gDialog.TableInheritColor.setAttribute("collapsed","true"); } else { try { gActiveEditor.removeAttributeOrEquivalent(globalTableElement, bgcolor, true); } catch(e) {} gDialog.TableInheritColor.removeAttribute("collapsed"); } SetCheckbox('CellColorCheckbox'); } setColorWell(ColorWellID, color);} |
gDialog.TableInheritColor.setAttribute("collapsed","true"); | gDialog.TableInheritColor.collapsed = true; | function SetColor(ColorWellID, color){ // Save the color if (ColorWellID == "cellBackgroundCW") { if (color) { globalCellElement.setAttribute(bgcolor, color); gDialog.CellInheritColor.setAttribute("collapsed","true"); } else { try { gActiveEditor.removeAttributeOrEquivalent(globalCellElement, bgcolor, true); } catch(e) {} // Reveal addition message explaining "default" color gDialog.CellInheritColor.removeAttribute("collapsed"); } } else { if (color) { globalTableElement.setAttribute(bgcolor, color); gDialog.TableInheritColor.setAttribute("collapsed","true"); } else { try { gActiveEditor.removeAttributeOrEquivalent(globalTableElement, bgcolor, true); } catch(e) {} gDialog.TableInheritColor.removeAttribute("collapsed"); } SetCheckbox('CellColorCheckbox'); } setColorWell(ColorWellID, color);} |
gDialog.TableInheritColor.removeAttribute("collapsed"); | gDialog.TableInheritColor.collapsed = false; | function SetColor(ColorWellID, color){ // Save the color if (ColorWellID == "cellBackgroundCW") { if (color) { globalCellElement.setAttribute(bgcolor, color); gDialog.CellInheritColor.setAttribute("collapsed","true"); } else { try { gActiveEditor.removeAttributeOrEquivalent(globalCellElement, bgcolor, true); } catch(e) {} // Reveal addition message explaining "default" color gDialog.CellInheritColor.removeAttribute("collapsed"); } } else { if (color) { globalTableElement.setAttribute(bgcolor, color); gDialog.TableInheritColor.setAttribute("collapsed","true"); } else { try { gActiveEditor.removeAttributeOrEquivalent(globalTableElement, bgcolor, true); } catch(e) {} gDialog.TableInheritColor.removeAttribute("collapsed"); } SetCheckbox('CellColorCheckbox'); } setColorWell(ColorWellID, color);} |
document.cookie = n+'=hidden; expires='+a.toGMTString()+';' | document.cookie = n+'=hidden; expires='+a.toGMTString()+';'; | function SetCookie(n) { var a = new Date(); a = new Date(a.getTime() +1000*60*60*24*365); document.cookie = n+'=hidden; expires='+a.toGMTString()+';'} |
function setCSSClass(id, cssclass) | DWRUtil.setCSSClass = function(id, cssclass) | function setCSSClass(id, cssclass){ var element = document.getElementById(id); if (element) { element.className = cssclass; }} |
var element = document.getElementById(id); if (element) | var ele = document.getElementById(id); if (ele == null) | function setCSSClass(id, cssclass){ var element = document.getElementById(id); if (element) { element.className = cssclass; }} |
element.className = cssclass; | alert("setCSSClass() can't find an element with id: " + id + "."); throw id; } if (ele) { ele.className = cssclass; | function setCSSClass(id, cssclass){ var element = document.getElementById(id); if (element) { element.className = cssclass; }} |
if (client.currentObject == obj) | if (("currentObject" in client && client.currentObject == obj) || !("output" in client) || !client.output) | function setCurrentObject (obj){ if (!obj.messages) { dd ("** INVALID OBJECT passed to setCurrentObject **"); return; } if (client.currentObject == obj) return; var tb, userList; if (client.currentObject) { tb = getTabForObject(client.currentObject); } if (tb) { tb.setAttribute ("selected", "false"); tb.setAttribute ("state", "normal"); } if (client.output.firstChild) client.output.removeChild (client.output.firstChild); client.output.appendChild (obj.messages); /* Unselect currently selected users. */ userList = document.getElementById("user-list"); if (userList) /* Remove curently selection items before this tree gets rerooted, * because it seems to remember the selections for eternity if not. */ userList.clearItemSelection (); else dd ("setCurrentObject: could not find element with ID='user-list'"); if (obj.TYPE == "IRCChannel") client.rdf.setTreeRoot ("user-list", obj.getGraphResource()); else client.rdf.setTreeRoot ("user-list", client.rdf.resNullChan); client.currentObject = obj; tb = getTabForObject(obj); if (tb) { tb.setAttribute ("selected", "true"); tb.setAttribute ("state", "current"); } var vk = Number(tb.getAttribute("viewKey")); delete client.activityList[vk]; updateNetwork(); updateChannel(); updateTitle (); if (client.PRINT_DIRECTION == 1) scrollDown(); focusInput();} |
if (client.currentObject) | if ("currentObject" in client && client.currentObject) | function setCurrentObject (obj){ if (!obj.messages) { dd ("** INVALID OBJECT passed to setCurrentObject **"); return; } if (client.currentObject == obj) return; var tb, userList; if (client.currentObject) { tb = getTabForObject(client.currentObject); } if (tb) { tb.setAttribute ("selected", "false"); tb.setAttribute ("state", "normal"); } if (client.output.firstChild) client.output.removeChild (client.output.firstChild); client.output.appendChild (obj.messages); /* Unselect currently selected users. */ userList = document.getElementById("user-list"); if (userList) /* Remove curently selection items before this tree gets rerooted, * because it seems to remember the selections for eternity if not. */ userList.clearItemSelection (); else dd ("setCurrentObject: could not find element with ID='user-list'"); if (obj.TYPE == "IRCChannel") client.rdf.setTreeRoot ("user-list", obj.getGraphResource()); else client.rdf.setTreeRoot ("user-list", client.rdf.resNullChan); client.currentObject = obj; tb = getTabForObject(obj); if (tb) { tb.setAttribute ("selected", "true"); tb.setAttribute ("state", "current"); } var vk = Number(tb.getAttribute("viewKey")); delete client.activityList[vk]; updateNetwork(); updateChannel(); updateTitle (); if (client.PRINT_DIRECTION == 1) scrollDown(); focusInput();} |
if (userList) userList.clearItemSelection (); else dd ("setCurrentObject: could not find element with ID='user-list'"); | userList.clearItemSelection (); | function setCurrentObject (obj){ if (!obj.messages) { dd ("** INVALID OBJECT passed to setCurrentObject **"); return; } if (client.currentObject == obj) return; var tb, userList; if (client.currentObject) { tb = getTabForObject(client.currentObject); } if (tb) { tb.setAttribute ("selected", "false"); tb.setAttribute ("state", "normal"); } if (client.output.firstChild) client.output.removeChild (client.output.firstChild); client.output.appendChild (obj.messages); /* Unselect currently selected users. */ userList = document.getElementById("user-list"); if (userList) /* Remove curently selection items before this tree gets rerooted, * because it seems to remember the selections for eternity if not. */ userList.clearItemSelection (); else dd ("setCurrentObject: could not find element with ID='user-list'"); if (obj.TYPE == "IRCChannel") client.rdf.setTreeRoot ("user-list", obj.getGraphResource()); else client.rdf.setTreeRoot ("user-list", client.rdf.resNullChan); client.currentObject = obj; tb = getTabForObject(obj); if (tb) { tb.setAttribute ("selected", "true"); tb.setAttribute ("state", "current"); } var vk = Number(tb.getAttribute("viewKey")); delete client.activityList[vk]; updateNetwork(); updateChannel(); updateTitle (); if (client.PRINT_DIRECTION == 1) scrollDown(); focusInput();} |
focusInput(); | if (client.currentObject.TYPE == "IRCChannel") client.statusBar["channel-topic"].setAttribute ("editable", "true"); else client.statusBar["channel-topic"].removeAttribute ("editable"); var status = document.getElementById("offline-status"); if (client.currentObject == client) { status.setAttribute ("hidden", "true"); } else { status.removeAttribute ("hidden"); var details = getObjectDetails(client.currentObject); if ("network" in details && details.network.isConnected()) status.removeAttribute ("offline"); else status.setAttribute ("offline", "true"); } | function setCurrentObject (obj){ if (!obj.messages) { dd ("** INVALID OBJECT passed to setCurrentObject **"); return; } if (client.currentObject == obj) return; var tb, userList; if (client.currentObject) { tb = getTabForObject(client.currentObject); } if (tb) { tb.setAttribute ("selected", "false"); tb.setAttribute ("state", "normal"); } if (client.output.firstChild) client.output.removeChild (client.output.firstChild); client.output.appendChild (obj.messages); /* Unselect currently selected users. */ userList = document.getElementById("user-list"); if (userList) /* Remove curently selection items before this tree gets rerooted, * because it seems to remember the selections for eternity if not. */ userList.clearItemSelection (); else dd ("setCurrentObject: could not find element with ID='user-list'"); if (obj.TYPE == "IRCChannel") client.rdf.setTreeRoot ("user-list", obj.getGraphResource()); else client.rdf.setTreeRoot ("user-list", client.rdf.resNullChan); client.currentObject = obj; tb = getTabForObject(obj); if (tb) { tb.setAttribute ("selected", "true"); tb.setAttribute ("state", "current"); } var vk = Number(tb.getAttribute("viewKey")); delete client.activityList[vk]; updateNetwork(); updateChannel(); updateTitle (); if (client.PRINT_DIRECTION == 1) scrollDown(); focusInput();} |
if (tb) tb.setAttribute ("state", "normal"); | function setCurrentObject (obj){ if (!obj.messages) { dd ("** INVALID OBJECT passed to setCurrentObject **"); return; } if (client.currentObject == obj) return; var tb, userList; if (client.currentObject) tb = getTBForObject(client.currentObject); if (tb) tb.setAttribute ("state", "normal"); if (client.output.firstChild) client.output.removeChild (client.output.firstChild); client.output.appendChild (obj.messages); /* Unselect currently selected users. */ userList = document.getElementById("user-list"); if (userList) /* Remove curently selection items before this tree gets rerooted, because it seems to remember the selections for eternity if not. */ userList.clearItemSelection (); else dd ("setCurrentObject: could not find element with ID='user-list'"); if (obj.TYPE == "IRCChannel") client.rdf.setTreeRoot ("user-list", obj.getGraphResource()); else client.rdf.setTreeRoot ("user-list", client.rdf.resNullChan); client.currentObject = obj; tb = getTBForObject(obj); if (tb) tb.setAttribute ("state", "current"); var vk = Number(tb.getAttribute("viewKey")); delete client.activityList[vk]; updateNetwork(); updateChannel(); updateTitle (); if (client.PRINT_DIRECTION == 1) window.frames[0].scrollTo(0, window.frames[0].document.height); } |
|
} | function setCurrentObject (obj){ if (!obj.messages) { dd ("** INVALID OBJECT passed to setCurrentObject **"); return; } if (client.currentObject == obj) return; var tb, userList; if (client.currentObject) tb = getTBForObject(client.currentObject); if (tb) tb.setAttribute ("state", "normal"); if (client.output.firstChild) client.output.removeChild (client.output.firstChild); client.output.appendChild (obj.messages); /* Unselect currently selected users. */ userList = document.getElementById("user-list"); if (userList) /* Remove curently selection items before this tree gets rerooted, because it seems to remember the selections for eternity if not. */ userList.clearItemSelection (); else dd ("setCurrentObject: could not find element with ID='user-list'"); if (obj.TYPE == "IRCChannel") client.rdf.setTreeRoot ("user-list", obj.getGraphResource()); else client.rdf.setTreeRoot ("user-list", client.rdf.resNullChan); client.currentObject = obj; tb = getTBForObject(obj); if (tb) tb.setAttribute ("state", "current"); var vk = Number(tb.getAttribute("viewKey")); delete client.activityList[vk]; updateNetwork(); updateChannel(); updateTitle (); if (client.PRINT_DIRECTION == 1) window.frames[0].scrollTo(0, window.frames[0].document.height); } |
|
window.frames[0].scrollTo(0, window.frames[0].document.height); | scrollDown(); | function setCurrentObject (obj){ if (!obj.messages) { dd ("** INVALID OBJECT passed to setCurrentObject **"); return; } if (client.currentObject == obj) return; var tb, userList; if (client.currentObject) tb = getTBForObject(client.currentObject); if (tb) tb.setAttribute ("state", "normal"); if (client.output.firstChild) client.output.removeChild (client.output.firstChild); client.output.appendChild (obj.messages); /* Unselect currently selected users. */ userList = document.getElementById("user-list"); if (userList) /* Remove curently selection items before this tree gets rerooted, because it seems to remember the selections for eternity if not. */ userList.clearItemSelection (); else dd ("setCurrentObject: could not find element with ID='user-list'"); if (obj.TYPE == "IRCChannel") client.rdf.setTreeRoot ("user-list", obj.getGraphResource()); else client.rdf.setTreeRoot ("user-list", client.rdf.resNullChan); client.currentObject = obj; tb = getTBForObject(obj); if (tb) tb.setAttribute ("state", "current"); var vk = Number(tb.getAttribute("viewKey")); delete client.activityList[vk]; updateNetwork(); updateChannel(); updateTitle (); if (client.PRINT_DIRECTION == 1) window.frames[0].scrollTo(0, window.frames[0].document.height); } |
client.input.focus(); | function setCurrentObject (obj){ function clearList() { client.rdf.Unassert (client.rdf.resNullChan, client.rdf.resChanUser, client.rdf.resNullUser, true); }; if (!ASSERT(obj.messages, "INVALID OBJECT passed to setCurrentObject **")) return; if ("currentObject" in client && client.currentObject == obj) return; var tb, userList; if ("currentObject" in client && client.currentObject) { tb = getTabForObject(client.currentObject); } if (tb) { tb.selected = false; tb.setAttribute ("state", "normal"); } /* Unselect currently selected users. */ userList = document.getElementById("user-list"); if (isVisible("user-list-box")) { /* Remove currently selected items before this tree gets rerooted, * because it seems to remember the selections for eternity if not. */ if (userList.treeBoxObject.selection) userList.treeBoxObject.selection.clearSelection (); if (obj.TYPE == "IRCChannel") { client.rdf.setTreeRoot("user-list", obj.getGraphResource()); updateUserList(); } else { var rdf = client.rdf; rdf.setTreeRoot("user-list", rdf.resNullChan); rdf.Assert (rdf.resNullChan, rdf.resChanUser, rdf.resNullUser, true); setTimeout(clearList, 100); } } client.currentObject = obj; tb = getTabForObject(obj, true); if (tb) { tb.selected = true; tb.setAttribute ("state", "current"); } var vk = Number(tb.getAttribute("viewKey")); delete client.activityList[vk]; client.deck.selectedIndex = vk; updateTitle(); if (client.PRINT_DIRECTION == 1) scrollDown(obj.frame, false); } |
|
var mimeRes = rdf.GetResource( "urn:mimetype:" + this.mLauncher.MIMEInfo.MIMEType ); var fileLocator = Components.classes[ "@mozilla.org/file/directory_service;1" ].getService( Components.interfaces.nsIProperties ); var file = fileLocator.get( "UMimTyp", Components.interfaces.nsIFile ); var file_url = Components.classes[ "@mozilla.org/network/standard-url;1" ].createInstance( Components.interfaces.nsIFileURL ); if ( file_url ) { file_url.file = file; } var ds = rdf.GetDataSource( file_url.spec ).QueryInterface( Components.interfaces.nsIRDFDataSource ); var valueProperty = rdf.GetResource( "http: var mimeLiteral = rdf.GetLiteral( this.mLauncher.MIMEInfo.MIMEType ); exists = ds.HasAssertion( mimeRes, valueProperty, mimeLiteral, true ); | var remoteDS = ds.QueryInterface( Components.interfaces.nsIRDFRemoteDataSource ); remoteDS.Init( file_url.spec ); remoteDS.Refresh( true ); | setDefault: function() { // Get RDF service. var rdf = Components.classes[ "@mozilla.org/rdf/rdf-service;1" ] .getService( Components.interfaces.nsIRDFService ); // Now ask if it knows about this mime type. var exists = false; try { var mimeRes = rdf.GetResource( "urn:mimetype:" + this.mLauncher.MIMEInfo.MIMEType ); var fileLocator = Components.classes[ "@mozilla.org/file/directory_service;1" ].getService( Components.interfaces.nsIProperties ); var file = fileLocator.get( "UMimTyp", Components.interfaces.nsIFile ); var file_url = Components.classes[ "@mozilla.org/network/standard-url;1" ].createInstance( Components.interfaces.nsIFileURL ); if ( file_url ) { file_url.file = file; } var ds = rdf.GetDataSource( file_url.spec ).QueryInterface( Components.interfaces.nsIRDFDataSource ); // The next line will produce "blocking load requested when async load pending" and an NS_ERROR_FAILURE //ds.QueryInterface( Components.interfaces.nsIRDFRemoteDataSource.Refresh( true ); var valueProperty = rdf.GetResource( "http://home.netscape.com/NC-rdf#value" ); var mimeLiteral = rdf.GetLiteral( this.mLauncher.MIMEInfo.MIMEType ); exists = ds.HasAssertion( mimeRes, valueProperty, mimeLiteral, true ); } catch ( all ) {this.dump( "Exception testing if mime type entry exists: " + all + "\n" ); } if ( exists ) { // Open "edit mime type" dialog. this.mDialog.openDialog( "chrome://communicator/content/pref/pref-applications-edit.xul", "appEdit", "chrome,modal=yes,resizable=no", this ); } else { // Open "add mime type" dialog. this.mDialog.openDialog( "chrome://communicator/content/pref/pref-applications-new.xul", "appEdit", "chrome,modal=yes,resizable=no", this ); } // Refresh dialog with updated info. this.initIntro(); this.initExplanation(); }, |
this.dump( "Exception testing if mime type entry exists: " + all + "\n" ); | ds = rdf.GetDataSource( file_url.spec ); | setDefault: function() { // Get RDF service. var rdf = Components.classes[ "@mozilla.org/rdf/rdf-service;1" ] .getService( Components.interfaces.nsIRDFService ); // Now ask if it knows about this mime type. var exists = false; try { var mimeRes = rdf.GetResource( "urn:mimetype:" + this.mLauncher.MIMEInfo.MIMEType ); var fileLocator = Components.classes[ "@mozilla.org/file/directory_service;1" ].getService( Components.interfaces.nsIProperties ); var file = fileLocator.get( "UMimTyp", Components.interfaces.nsIFile ); var file_url = Components.classes[ "@mozilla.org/network/standard-url;1" ].createInstance( Components.interfaces.nsIFileURL ); if ( file_url ) { file_url.file = file; } var ds = rdf.GetDataSource( file_url.spec ).QueryInterface( Components.interfaces.nsIRDFDataSource ); // The next line will produce "blocking load requested when async load pending" and an NS_ERROR_FAILURE //ds.QueryInterface( Components.interfaces.nsIRDFRemoteDataSource.Refresh( true ); var valueProperty = rdf.GetResource( "http://home.netscape.com/NC-rdf#value" ); var mimeLiteral = rdf.GetLiteral( this.mLauncher.MIMEInfo.MIMEType ); exists = ds.HasAssertion( mimeRes, valueProperty, mimeLiteral, true ); } catch ( all ) {this.dump( "Exception testing if mime type entry exists: " + all + "\n" ); } if ( exists ) { // Open "edit mime type" dialog. this.mDialog.openDialog( "chrome://communicator/content/pref/pref-applications-edit.xul", "appEdit", "chrome,modal=yes,resizable=no", this ); } else { // Open "add mime type" dialog. this.mDialog.openDialog( "chrome://communicator/content/pref/pref-applications-new.xul", "appEdit", "chrome,modal=yes,resizable=no", this ); } // Refresh dialog with updated info. this.initIntro(); this.initExplanation(); }, |
this.mDialog.openDialog( "chrome: "appEdit", "chrome,modal=yes,resizable=no", this ); | dlgUrl = "chrome: | setDefault: function() { // Get RDF service. var rdf = Components.classes[ "@mozilla.org/rdf/rdf-service;1" ] .getService( Components.interfaces.nsIRDFService ); // Now ask if it knows about this mime type. var exists = false; try { var mimeRes = rdf.GetResource( "urn:mimetype:" + this.mLauncher.MIMEInfo.MIMEType ); var fileLocator = Components.classes[ "@mozilla.org/file/directory_service;1" ].getService( Components.interfaces.nsIProperties ); var file = fileLocator.get( "UMimTyp", Components.interfaces.nsIFile ); var file_url = Components.classes[ "@mozilla.org/network/standard-url;1" ].createInstance( Components.interfaces.nsIFileURL ); if ( file_url ) { file_url.file = file; } var ds = rdf.GetDataSource( file_url.spec ).QueryInterface( Components.interfaces.nsIRDFDataSource ); // The next line will produce "blocking load requested when async load pending" and an NS_ERROR_FAILURE //ds.QueryInterface( Components.interfaces.nsIRDFRemoteDataSource.Refresh( true ); var valueProperty = rdf.GetResource( "http://home.netscape.com/NC-rdf#value" ); var mimeLiteral = rdf.GetLiteral( this.mLauncher.MIMEInfo.MIMEType ); exists = ds.HasAssertion( mimeRes, valueProperty, mimeLiteral, true ); } catch ( all ) {this.dump( "Exception testing if mime type entry exists: " + all + "\n" ); } if ( exists ) { // Open "edit mime type" dialog. this.mDialog.openDialog( "chrome://communicator/content/pref/pref-applications-edit.xul", "appEdit", "chrome,modal=yes,resizable=no", this ); } else { // Open "add mime type" dialog. this.mDialog.openDialog( "chrome://communicator/content/pref/pref-applications-new.xul", "appEdit", "chrome,modal=yes,resizable=no", this ); } // Refresh dialog with updated info. this.initIntro(); this.initExplanation(); }, |
this.mDialog.openDialog( dlgUrl, "_blank", "chrome,modal=yes,resizable=no", this ); | setDefault: function() { // Get RDF service. var rdf = Components.classes[ "@mozilla.org/rdf/rdf-service;1" ] .getService( Components.interfaces.nsIRDFService ); // Now ask if it knows about this mime type. var exists = false; try { var mimeRes = rdf.GetResource( "urn:mimetype:" + this.mLauncher.MIMEInfo.MIMEType ); var fileLocator = Components.classes[ "@mozilla.org/file/directory_service;1" ].getService( Components.interfaces.nsIProperties ); var file = fileLocator.get( "UMimTyp", Components.interfaces.nsIFile ); var file_url = Components.classes[ "@mozilla.org/network/standard-url;1" ].createInstance( Components.interfaces.nsIFileURL ); if ( file_url ) { file_url.file = file; } var ds = rdf.GetDataSource( file_url.spec ).QueryInterface( Components.interfaces.nsIRDFDataSource ); // The next line will produce "blocking load requested when async load pending" and an NS_ERROR_FAILURE //ds.QueryInterface( Components.interfaces.nsIRDFRemoteDataSource.Refresh( true ); var valueProperty = rdf.GetResource( "http://home.netscape.com/NC-rdf#value" ); var mimeLiteral = rdf.GetLiteral( this.mLauncher.MIMEInfo.MIMEType ); exists = ds.HasAssertion( mimeRes, valueProperty, mimeLiteral, true ); } catch ( all ) {this.dump( "Exception testing if mime type entry exists: " + all + "\n" ); } if ( exists ) { // Open "edit mime type" dialog. this.mDialog.openDialog( "chrome://communicator/content/pref/pref-applications-edit.xul", "appEdit", "chrome,modal=yes,resizable=no", this ); } else { // Open "add mime type" dialog. this.mDialog.openDialog( "chrome://communicator/content/pref/pref-applications-new.xul", "appEdit", "chrome,modal=yes,resizable=no", this ); } // Refresh dialog with updated info. this.initIntro(); this.initExplanation(); }, |
|
aItem.entryDate = now(); | aItem.entryDate = getSelectedDay().clone(); | function setDefaultAlarmValues(aItem){ var prefService = Components.classes["@mozilla.org/preferences-service;1"] .getService(Components.interfaces.nsIPrefService); var alarmsBranch = prefService.getBranch("calendar.alarms."); if (isEvent(aItem)) { try { if (alarmsBranch.getIntPref("onforevents") == 1) { var alarmOffset = Components.classes["@mozilla.org/calendar/duration;1"] .createInstance(Components.interfaces.calIDuration); try { var units = alarmsBranch.getCharPref("eventalarmunit"); alarmOffset[units] = alarmsBranch.getIntPref("eventalarmlen"); } catch(ex) { alarmOffset.minutes = 15; } aItem.alarmOffset = alarmOffset; aItem.alarmRelated = aItem.ALARM_RELATED_START; } } catch (ex) { Components.utils.reportError( "Failed to apply default alarm settings to event: " + ex); } } else if (isToDo(aItem)) { try { if (alarmsBranch.getIntPref("onfortodos") == 1) { // You can't have an alarm if the entryDate doesn't exist. if (!aItem.entryDate) { // XXX We should use the selected day from view instead aItem.entryDate = now(); } var alarmOffset = Components.classes["@mozilla.org/calendar/duration;1"] .createInstance(Components.interfaces.calIDuration); try { var units = alarmsBranch.getCharPref("todoalarmunit"); alarmOffset[units] = alarmsBranch.getIntPref("todoalarmlen"); } catch(ex) { alarmOffset.minutes = 15; } aItem.alarmOffset = alarmOffset; aItem.alarmRelated = aItem.ALARM_RELATED_START; } } catch (ex) { Components.utils.reportError( "Failed to apply default alarm settings to task: " + ex); } }} |
alarmOffset.isNegative = true; | function setDefaultAlarmValues(aItem){ var prefService = Components.classes["@mozilla.org/preferences-service;1"] .getService(Components.interfaces.nsIPrefService); var alarmsBranch = prefService.getBranch("calendar.alarms."); if (isEvent(aItem)) { try { if (alarmsBranch.getIntPref("onforevents") == 1) { var alarmOffset = Components.classes["@mozilla.org/calendar/duration;1"] .createInstance(Components.interfaces.calIDuration); try { var units = alarmsBranch.getCharPref("eventalarmunit"); alarmOffset[units] = alarmsBranch.getIntPref("eventalarmlen"); } catch(ex) { alarmOffset.minutes = 15; } aItem.alarmOffset = alarmOffset; aItem.alarmRelated = Components.interfaces.calIItemBase.ALARM_RELATED_START; } } catch (ex) { Components.utils.reportError( "Failed to apply default alarm settings to event: " + ex); } } else if (isToDo(aItem)) { try { if (alarmsBranch.getIntPref("onfortodos") == 1) { // You can't have an alarm if the entryDate doesn't exist. if (!aItem.entryDate) { aItem.entryDate = getSelectedDay().clone(); } var alarmOffset = Components.classes["@mozilla.org/calendar/duration;1"] .createInstance(Components.interfaces.calIDuration); try { var units = alarmsBranch.getCharPref("todoalarmunit"); alarmOffset[units] = alarmsBranch.getIntPref("todoalarmlen"); } catch(ex) { alarmOffset.minutes = 15; } aItem.alarmOffset = alarmOffset; aItem.alarmRelated = Components.interfaces.calIItemBase.ALARM_RELATED_START; } } catch (ex) { Components.utils.reportError( "Failed to apply default alarm settings to task: " + ex); } }} |
|
var folders = rootFolder.GetSubFolders(); var msgFolder = rootFolder.QueryInterface(Components.interfaces.nsIMsgFolder); var numFolders = new Object(); var protocolInfo = Components.classes["@mozilla.org/messenger/protocol/info;1?type=" + msgFolder.server.type].getService(Components.interfaces.nsIMsgProtocolInfo); | var folders = rootFolder.GetSubFolders(); var msgFolder = rootFolder.QueryInterface(Components.interfaces.nsIMsgFolder); | function setDefaultCopiesAndFoldersPrefs(identity, server, accountData){ dump("finding folders on server = " + server.hostName + "\n"); var rootFolder = server.rootFolder; // we need to do this or it is possible that the server's draft, // stationery fcc folder will not be in rdf // // this can happen in a couple cases // 1) the first account we create, creates the local mail. since // local mail was just created, it obviously hasn't been opened, // or in rdf.. // 2) the account we created is of a type where // defaultCopiesAndFoldersPrefsToServer is true // this since we are creating the server, it obviously hasn't been // opened, or in rdf. // // this makes the assumption that the server's draft, stationery fcc folder // are at the top level (ie subfolders of the root folder.) this works // because we happen to be doing things that way, and if the user changes // that, it will work because to change the folder, it must be in rdf, // coming from the folder cache, in the worst case. var folders = rootFolder.GetSubFolders(); var msgFolder = rootFolder.QueryInterface(Components.interfaces.nsIMsgFolder); var numFolders = new Object(); var protocolInfo = Components.classes["@mozilla.org/messenger/protocol/info;1?type=" + msgFolder.server.type].getService(Components.interfaces.nsIMsgProtocolInfo); /** * Check if this protocol service needs to create special folder URIs. * In case of IMAP, when a new account is created, folders 'Sent', 'Drafts' * and 'Templates' are not created then, but created on demand at runtime. * But we do need to present them as possible choices in the Copies and Folders * UI. To do that, folder URIs have to be created and stored in the prefs file. * So, if there is a need to build special folders, append the special folder * names and create right URIs. */ if (protocolInfo.needToBuildSpecialFolderURIs) { var folderDelim = "/"; /* we use internal names known to everyone like Sent, Templates and Drafts */ /* if folder names were already given in isp rdf, we use them, otherwise we use internal names known to everyone like Sent, Templates and Drafts */ var draftFolder = (accountData.identity && accountData.identity.draftFolder ? accountData.identity.draftFolder : "Drafts"); var stationeryFolder = (accountData.identity && accountData.identity.stationeryFolder ? accountData.identity.stationeryFolder : "Templates"); var fccFolder = (accountData.identity && accountData.identity.fccFolder ? accountData.identity.fccFolder : "Sent"); identity.draftFolder = msgFolder.server.serverURI+ folderDelim + draftFolder; identity.stationeryFolder = msgFolder.server.serverURI+ folderDelim + stationeryFolder; identity.fccFolder = msgFolder.server.serverURI+ folderDelim + fccFolder; } else { // these hex values come from nsMsgFolderFlags.h var draftFolder = msgFolder.getFoldersWithFlag(0x0400, 1, numFolders); var stationeryFolder = msgFolder.getFoldersWithFlag(0x400000, 1, numFolders); var fccFolder = msgFolder.getFoldersWithFlag(0x0200, 1, numFolders); if (draftFolder) identity.draftFolder = draftFolder.URI; if (stationeryFolder) identity.stationeryFolder = stationeryFolder.URI; if (fccFolder) identity.fccFolder = fccFolder.URI; dump("fccFolder = " + identity.fccFolder + "\n"); dump("draftFolder = " + identity.draftFolder + "\n"); dump("stationeryFolder = " + identity.stationeryFolder + "\n"); } identity.fccFolderPickerMode = (accountData.identity && accountData.identity.fccFolder ? 1 : gDefaultSpecialFolderPickerMode); identity.draftsFolderPickerMode = (accountData.identity && accountData.identity.draftFolder ? 1 : gDefaultSpecialFolderPickerMode); identity.tmplFolderPickerMode = (accountData.identity && accountData.identity.stationeryFolder ? 1 : gDefaultSpecialFolderPickerMode);} |
* Check if this protocol service needs to create special folder URIs. * In case of IMAP, when a new account is created, folders 'Sent', 'Drafts' | * When a new account is created, folders 'Sent', 'Drafts' | function setDefaultCopiesAndFoldersPrefs(identity, server, accountData){ dump("finding folders on server = " + server.hostName + "\n"); var rootFolder = server.rootFolder; // we need to do this or it is possible that the server's draft, // stationery fcc folder will not be in rdf // // this can happen in a couple cases // 1) the first account we create, creates the local mail. since // local mail was just created, it obviously hasn't been opened, // or in rdf.. // 2) the account we created is of a type where // defaultCopiesAndFoldersPrefsToServer is true // this since we are creating the server, it obviously hasn't been // opened, or in rdf. // // this makes the assumption that the server's draft, stationery fcc folder // are at the top level (ie subfolders of the root folder.) this works // because we happen to be doing things that way, and if the user changes // that, it will work because to change the folder, it must be in rdf, // coming from the folder cache, in the worst case. var folders = rootFolder.GetSubFolders(); var msgFolder = rootFolder.QueryInterface(Components.interfaces.nsIMsgFolder); var numFolders = new Object(); var protocolInfo = Components.classes["@mozilla.org/messenger/protocol/info;1?type=" + msgFolder.server.type].getService(Components.interfaces.nsIMsgProtocolInfo); /** * Check if this protocol service needs to create special folder URIs. * In case of IMAP, when a new account is created, folders 'Sent', 'Drafts' * and 'Templates' are not created then, but created on demand at runtime. * But we do need to present them as possible choices in the Copies and Folders * UI. To do that, folder URIs have to be created and stored in the prefs file. * So, if there is a need to build special folders, append the special folder * names and create right URIs. */ if (protocolInfo.needToBuildSpecialFolderURIs) { var folderDelim = "/"; /* we use internal names known to everyone like Sent, Templates and Drafts */ /* if folder names were already given in isp rdf, we use them, otherwise we use internal names known to everyone like Sent, Templates and Drafts */ var draftFolder = (accountData.identity && accountData.identity.draftFolder ? accountData.identity.draftFolder : "Drafts"); var stationeryFolder = (accountData.identity && accountData.identity.stationeryFolder ? accountData.identity.stationeryFolder : "Templates"); var fccFolder = (accountData.identity && accountData.identity.fccFolder ? accountData.identity.fccFolder : "Sent"); identity.draftFolder = msgFolder.server.serverURI+ folderDelim + draftFolder; identity.stationeryFolder = msgFolder.server.serverURI+ folderDelim + stationeryFolder; identity.fccFolder = msgFolder.server.serverURI+ folderDelim + fccFolder; } else { // these hex values come from nsMsgFolderFlags.h var draftFolder = msgFolder.getFoldersWithFlag(0x0400, 1, numFolders); var stationeryFolder = msgFolder.getFoldersWithFlag(0x400000, 1, numFolders); var fccFolder = msgFolder.getFoldersWithFlag(0x0200, 1, numFolders); if (draftFolder) identity.draftFolder = draftFolder.URI; if (stationeryFolder) identity.stationeryFolder = stationeryFolder.URI; if (fccFolder) identity.fccFolder = fccFolder.URI; dump("fccFolder = " + identity.fccFolder + "\n"); dump("draftFolder = " + identity.draftFolder + "\n"); dump("stationeryFolder = " + identity.stationeryFolder + "\n"); } identity.fccFolderPickerMode = (accountData.identity && accountData.identity.fccFolder ? 1 : gDefaultSpecialFolderPickerMode); identity.draftsFolderPickerMode = (accountData.identity && accountData.identity.draftFolder ? 1 : gDefaultSpecialFolderPickerMode); identity.tmplFolderPickerMode = (accountData.identity && accountData.identity.stationeryFolder ? 1 : gDefaultSpecialFolderPickerMode);} |
if (protocolInfo.needToBuildSpecialFolderURIs) { var folderDelim = "/"; | var folderDelim = "/"; | function setDefaultCopiesAndFoldersPrefs(identity, server, accountData){ dump("finding folders on server = " + server.hostName + "\n"); var rootFolder = server.rootFolder; // we need to do this or it is possible that the server's draft, // stationery fcc folder will not be in rdf // // this can happen in a couple cases // 1) the first account we create, creates the local mail. since // local mail was just created, it obviously hasn't been opened, // or in rdf.. // 2) the account we created is of a type where // defaultCopiesAndFoldersPrefsToServer is true // this since we are creating the server, it obviously hasn't been // opened, or in rdf. // // this makes the assumption that the server's draft, stationery fcc folder // are at the top level (ie subfolders of the root folder.) this works // because we happen to be doing things that way, and if the user changes // that, it will work because to change the folder, it must be in rdf, // coming from the folder cache, in the worst case. var folders = rootFolder.GetSubFolders(); var msgFolder = rootFolder.QueryInterface(Components.interfaces.nsIMsgFolder); var numFolders = new Object(); var protocolInfo = Components.classes["@mozilla.org/messenger/protocol/info;1?type=" + msgFolder.server.type].getService(Components.interfaces.nsIMsgProtocolInfo); /** * Check if this protocol service needs to create special folder URIs. * In case of IMAP, when a new account is created, folders 'Sent', 'Drafts' * and 'Templates' are not created then, but created on demand at runtime. * But we do need to present them as possible choices in the Copies and Folders * UI. To do that, folder URIs have to be created and stored in the prefs file. * So, if there is a need to build special folders, append the special folder * names and create right URIs. */ if (protocolInfo.needToBuildSpecialFolderURIs) { var folderDelim = "/"; /* we use internal names known to everyone like Sent, Templates and Drafts */ /* if folder names were already given in isp rdf, we use them, otherwise we use internal names known to everyone like Sent, Templates and Drafts */ var draftFolder = (accountData.identity && accountData.identity.draftFolder ? accountData.identity.draftFolder : "Drafts"); var stationeryFolder = (accountData.identity && accountData.identity.stationeryFolder ? accountData.identity.stationeryFolder : "Templates"); var fccFolder = (accountData.identity && accountData.identity.fccFolder ? accountData.identity.fccFolder : "Sent"); identity.draftFolder = msgFolder.server.serverURI+ folderDelim + draftFolder; identity.stationeryFolder = msgFolder.server.serverURI+ folderDelim + stationeryFolder; identity.fccFolder = msgFolder.server.serverURI+ folderDelim + fccFolder; } else { // these hex values come from nsMsgFolderFlags.h var draftFolder = msgFolder.getFoldersWithFlag(0x0400, 1, numFolders); var stationeryFolder = msgFolder.getFoldersWithFlag(0x400000, 1, numFolders); var fccFolder = msgFolder.getFoldersWithFlag(0x0200, 1, numFolders); if (draftFolder) identity.draftFolder = draftFolder.URI; if (stationeryFolder) identity.stationeryFolder = stationeryFolder.URI; if (fccFolder) identity.fccFolder = fccFolder.URI; dump("fccFolder = " + identity.fccFolder + "\n"); dump("draftFolder = " + identity.draftFolder + "\n"); dump("stationeryFolder = " + identity.stationeryFolder + "\n"); } identity.fccFolderPickerMode = (accountData.identity && accountData.identity.fccFolder ? 1 : gDefaultSpecialFolderPickerMode); identity.draftsFolderPickerMode = (accountData.identity && accountData.identity.draftFolder ? 1 : gDefaultSpecialFolderPickerMode); identity.tmplFolderPickerMode = (accountData.identity && accountData.identity.stationeryFolder ? 1 : gDefaultSpecialFolderPickerMode);} |
identity.draftFolder = msgFolder.server.serverURI+ folderDelim + draftFolder; identity.stationeryFolder = msgFolder.server.serverURI+ folderDelim + stationeryFolder; identity.fccFolder = msgFolder.server.serverURI+ folderDelim + fccFolder; } else { var draftFolder = msgFolder.getFoldersWithFlag(0x0400, 1, numFolders); var stationeryFolder = msgFolder.getFoldersWithFlag(0x400000, 1, numFolders); var fccFolder = msgFolder.getFoldersWithFlag(0x0200, 1, numFolders); if (draftFolder) identity.draftFolder = draftFolder.URI; if (stationeryFolder) identity.stationeryFolder = stationeryFolder.URI; if (fccFolder) identity.fccFolder = fccFolder.URI; dump("fccFolder = " + identity.fccFolder + "\n"); dump("draftFolder = " + identity.draftFolder + "\n"); dump("stationeryFolder = " + identity.stationeryFolder + "\n"); } | identity.draftFolder = msgFolder.server.serverURI+ folderDelim + draftFolder; identity.stationeryFolder = msgFolder.server.serverURI+ folderDelim + stationeryFolder; identity.fccFolder = msgFolder.server.serverURI+ folderDelim + fccFolder; | function setDefaultCopiesAndFoldersPrefs(identity, server, accountData){ dump("finding folders on server = " + server.hostName + "\n"); var rootFolder = server.rootFolder; // we need to do this or it is possible that the server's draft, // stationery fcc folder will not be in rdf // // this can happen in a couple cases // 1) the first account we create, creates the local mail. since // local mail was just created, it obviously hasn't been opened, // or in rdf.. // 2) the account we created is of a type where // defaultCopiesAndFoldersPrefsToServer is true // this since we are creating the server, it obviously hasn't been // opened, or in rdf. // // this makes the assumption that the server's draft, stationery fcc folder // are at the top level (ie subfolders of the root folder.) this works // because we happen to be doing things that way, and if the user changes // that, it will work because to change the folder, it must be in rdf, // coming from the folder cache, in the worst case. var folders = rootFolder.GetSubFolders(); var msgFolder = rootFolder.QueryInterface(Components.interfaces.nsIMsgFolder); var numFolders = new Object(); var protocolInfo = Components.classes["@mozilla.org/messenger/protocol/info;1?type=" + msgFolder.server.type].getService(Components.interfaces.nsIMsgProtocolInfo); /** * Check if this protocol service needs to create special folder URIs. * In case of IMAP, when a new account is created, folders 'Sent', 'Drafts' * and 'Templates' are not created then, but created on demand at runtime. * But we do need to present them as possible choices in the Copies and Folders * UI. To do that, folder URIs have to be created and stored in the prefs file. * So, if there is a need to build special folders, append the special folder * names and create right URIs. */ if (protocolInfo.needToBuildSpecialFolderURIs) { var folderDelim = "/"; /* we use internal names known to everyone like Sent, Templates and Drafts */ /* if folder names were already given in isp rdf, we use them, otherwise we use internal names known to everyone like Sent, Templates and Drafts */ var draftFolder = (accountData.identity && accountData.identity.draftFolder ? accountData.identity.draftFolder : "Drafts"); var stationeryFolder = (accountData.identity && accountData.identity.stationeryFolder ? accountData.identity.stationeryFolder : "Templates"); var fccFolder = (accountData.identity && accountData.identity.fccFolder ? accountData.identity.fccFolder : "Sent"); identity.draftFolder = msgFolder.server.serverURI+ folderDelim + draftFolder; identity.stationeryFolder = msgFolder.server.serverURI+ folderDelim + stationeryFolder; identity.fccFolder = msgFolder.server.serverURI+ folderDelim + fccFolder; } else { // these hex values come from nsMsgFolderFlags.h var draftFolder = msgFolder.getFoldersWithFlag(0x0400, 1, numFolders); var stationeryFolder = msgFolder.getFoldersWithFlag(0x400000, 1, numFolders); var fccFolder = msgFolder.getFoldersWithFlag(0x0200, 1, numFolders); if (draftFolder) identity.draftFolder = draftFolder.URI; if (stationeryFolder) identity.stationeryFolder = stationeryFolder.URI; if (fccFolder) identity.fccFolder = fccFolder.URI; dump("fccFolder = " + identity.fccFolder + "\n"); dump("draftFolder = " + identity.draftFolder + "\n"); dump("stationeryFolder = " + identity.stationeryFolder + "\n"); } identity.fccFolderPickerMode = (accountData.identity && accountData.identity.fccFolder ? 1 : gDefaultSpecialFolderPickerMode); identity.draftsFolderPickerMode = (accountData.identity && accountData.identity.draftFolder ? 1 : gDefaultSpecialFolderPickerMode); identity.tmplFolderPickerMode = (accountData.identity && accountData.identity.stationeryFolder ? 1 : gDefaultSpecialFolderPickerMode);} |
var protocolInfo = Components.classes["@mozilla.org/messenger/protocol/info;1?type=" + msgFolder.server.type].getService(Components.interfaces.nsIMsgProtocolInfo); if (protocolInfo.needToBuildSpecialFolderURIs) { var folderDelim = "/"; var sentFolderName = gMessengerBundle.getString("sentFolderName"); var draftsFolderName = gMessengerBundle.getString("draftsFolderName"); var templatesFolderName = gMessengerBundle.getString("templatesFolderName"); identity.draftFolder = msgFolder.server.serverURI+ folderDelim + draftsFolderName; identity.stationeryFolder = msgFolder.server.serverURI+ folderDelim + templatesFolderName; identity.fccFolder = msgFolder.server.serverURI+ folderDelim + sentFolderName; } else { | function setDefaultCopiesAndFoldersPrefs(identity, server){ dump("finding folders on server = " + server.hostName + "\n"); var rootFolder = server.RootFolder; // we need to do this or it is possible that the server's draft, // stationery fcc folder will not be in rdf // // this can happen in a couple cases // 1) the first account we create, creates the local mail. since // local mail was just created, it obviously hasn't been opened, // or in rdf.. // 2) the account we created is of a type where // defaultCopiesAndFoldersPrefsToServer is true // this since we are creating the server, it obviously hasn't been // opened, or in rdf. // // this makes the assumption that the server's draft, stationery fcc folder // are at the top level (ie subfolders of the root folder.) this works // because we happen to be doing things that way, and if the user changes // that, it will work because to change the folder, it must be in rdf, // coming from the folder cache, in the worst case. var folders = rootFolder.GetSubFolders(); var msgFolder = rootFolder.QueryInterface(Components.interfaces.nsIMsgFolder); var numFolders = new Object(); // these hex values come from nsMsgFolderFlags.h var draftFolder = msgFolder.getFoldersWithFlag(0x0400, 1, numFolders); var stationeryFolder = msgFolder.getFoldersWithFlag(0x400000, 1, numFolders); var fccFolder = msgFolder.getFoldersWithFlag(0x0200, 1, numFolders); if (draftFolder) identity.draftFolder = draftFolder.URI; if (stationeryFolder) identity.stationeryFolder = stationeryFolder.URI; if (fccFolder) identity.fccFolder = fccFolder.URI; dump("fccFolder = " + identity.fccFolder + "\n"); dump("draftFolder = " + identity.draftFolder + "\n"); dump("stationeryFolder = " + identity.stationeryFolder + "\n");} |
|
} identity.fccFolderPickerMode = gDefaultSpecialFolderPickerMode; identity.draftsFolderPickerMode = gDefaultSpecialFolderPickerMode; identity.tmplFolderPickerMode = gDefaultSpecialFolderPickerMode; | function setDefaultCopiesAndFoldersPrefs(identity, server){ dump("finding folders on server = " + server.hostName + "\n"); var rootFolder = server.RootFolder; // we need to do this or it is possible that the server's draft, // stationery fcc folder will not be in rdf // // this can happen in a couple cases // 1) the first account we create, creates the local mail. since // local mail was just created, it obviously hasn't been opened, // or in rdf.. // 2) the account we created is of a type where // defaultCopiesAndFoldersPrefsToServer is true // this since we are creating the server, it obviously hasn't been // opened, or in rdf. // // this makes the assumption that the server's draft, stationery fcc folder // are at the top level (ie subfolders of the root folder.) this works // because we happen to be doing things that way, and if the user changes // that, it will work because to change the folder, it must be in rdf, // coming from the folder cache, in the worst case. var folders = rootFolder.GetSubFolders(); var msgFolder = rootFolder.QueryInterface(Components.interfaces.nsIMsgFolder); var numFolders = new Object(); // these hex values come from nsMsgFolderFlags.h var draftFolder = msgFolder.getFoldersWithFlag(0x0400, 1, numFolders); var stationeryFolder = msgFolder.getFoldersWithFlag(0x400000, 1, numFolders); var fccFolder = msgFolder.getFoldersWithFlag(0x0200, 1, numFolders); if (draftFolder) identity.draftFolder = draftFolder.URI; if (stationeryFolder) identity.stationeryFolder = stationeryFolder.URI; if (fccFolder) identity.fccFolder = fccFolder.URI; dump("fccFolder = " + identity.fccFolder + "\n"); dump("draftFolder = " + identity.draftFolder + "\n"); dump("stationeryFolder = " + identity.stationeryFolder + "\n");} |
|
prefs = Components.classes['component: | prefs = Components.classes['@mozilla.org/preferences;1']; | function SetDefaultMailSendCharacterSet(){ // Set the current menu selection as the default if (currentMailSendCharset != null) { // try to get preferences service var prefs = null; try { prefs = Components.classes['component://netscape/preferences']; prefs = prefs.getService(); prefs = prefs.QueryInterface(Components.interfaces.nsIPref); } catch (ex) { dump("failed to get prefs service!\n"); prefs = null; } if (msgCompose) { // write to the pref file prefs.SetCharPref("mailnews.send_default_charset", currentMailSendCharset); // update the global g_send_default_charset = currentMailSendCharset; dump("Set send_default_charset to" + currentMailSendCharset + "\n"); } else dump("Compose has not been created!\n"); }} |
if(status == "") defaultStatus = null; else defaultStatus = status; UpdateStatusField(); | setDefaultStatus : function(status) { //XXX Should do something here. }, |
|
details = dialogParams.GetString(index+itemCount+3); | var details = dialogParams.GetString(index+itemCount+3); | function setDetails(){ var index = parseInt(document.getElementById("nicknames").value); details = dialogParams.GetString(index+itemCount+3); document.getElementById("details").value = details;} |
if (mode == EditorDisplayMode) | if (mode == gEditorDisplayMode) | function SetDisplayMode(mode){ if (gIsHTMLEditor) { // Already in requested mode: // return false to indicate we didn't switch if (mode == EditorDisplayMode) return false; EditorDisplayMode = mode; // Save the last non-source mode so we can cancel source editing easily if (mode != DisplayModeSource) PreviousNonSourceDisplayMode = mode; // Editorshell does the style sheet loading/unloading editorShell.SetDisplayMode(mode); // Set the UI states gPreviewModeButton.setAttribute("selected",Number(mode == DisplayModePreview)); gNormalModeButton.setAttribute("selected",Number(mode == DisplayModeNormal)); gTagModeButton.setAttribute("selected",Number(mode == DisplayModeAllTags)); gSourceModeButton.setAttribute("selected", Number(mode == DisplayModeSource)); if (mode == DisplayModeSource) { // Switch to the sourceWindow (second in the deck) gContentWindowDeck.setAttribute("index","1"); // TODO: WE MUST DISABLE ALL KEYBOARD COMMANDS! // THIS DOESN'T WORK! gSourceContentWindow.focus(); } else { // Switch to the normal editor (first in the deck) gContentWindowDeck.setAttribute("index","0"); // TODO: WE MUST ENABLE ALL KEYBOARD COMMANDS! gContentWindow.focus(); } return true; }} |
EditorDisplayMode = mode; | gEditorDisplayMode = mode; | function SetDisplayMode(mode){ if (gIsHTMLEditor) { // Already in requested mode: // return false to indicate we didn't switch if (mode == EditorDisplayMode) return false; EditorDisplayMode = mode; // Save the last non-source mode so we can cancel source editing easily if (mode != DisplayModeSource) PreviousNonSourceDisplayMode = mode; // Editorshell does the style sheet loading/unloading editorShell.SetDisplayMode(mode); // Set the UI states gPreviewModeButton.setAttribute("selected",Number(mode == DisplayModePreview)); gNormalModeButton.setAttribute("selected",Number(mode == DisplayModeNormal)); gTagModeButton.setAttribute("selected",Number(mode == DisplayModeAllTags)); gSourceModeButton.setAttribute("selected", Number(mode == DisplayModeSource)); if (mode == DisplayModeSource) { // Switch to the sourceWindow (second in the deck) gContentWindowDeck.setAttribute("index","1"); // TODO: WE MUST DISABLE ALL KEYBOARD COMMANDS! // THIS DOESN'T WORK! gSourceContentWindow.focus(); } else { // Switch to the normal editor (first in the deck) gContentWindowDeck.setAttribute("index","0"); // TODO: WE MUST ENABLE ALL KEYBOARD COMMANDS! gContentWindow.focus(); } return true; }} |
window._content.focus(); | gContentWindow.focus(); | function SetDisplayMode(mode){ if (gIsHTMLEditor) { // Already in requested mode: // return false to indicate we didn't switch if (mode == gEditorDisplayMode) return false; gEditorDisplayMode = mode; // Save the last non-source mode so we can cancel source editing easily if (mode != DisplayModeSource) PreviousNonSourceDisplayMode = mode; // Editorshell does the style sheet loading/unloading editorShell.SetDisplayMode(mode); // Set the UI states var selectedTab = null; if (mode == DisplayModePreview) selectedTab = gPreviewModeButton; if (mode == DisplayModeNormal) selectedTab = gNormalModeButton; if (mode == DisplayModeAllTags) selectedTab = gTagModeButton; if (mode == DisplayModeSource) selectedTab = gSourceModeButton; if (selectedTab) document.getElementById("EditModeTabs").selectedTab = selectedTab; if (mode == DisplayModeSource) { // Switch to the sourceWindow (second in the deck) gContentWindowDeck.setAttribute("index","1"); DisableMenusForHTMLSource(true); //Hide the formating toolbar if not already hidden gFormatToolbarHidden = gFormatToolbar.getAttribute("hidden"); if (gFormatToolbarHidden != "true") { gFormatToolbar.setAttribute("hidden", "true"); } gSourceContentWindow.focus(); } else { // Switch to the normal editor (first in the deck) gContentWindowDeck.setAttribute("index","0"); // Restore menus and toolbars DisableMenusForHTMLSource(false); if (gFormatToolbarHidden != "true") { gFormatToolbar.setAttribute("hidden", gFormatToolbarHidden); } window._content.focus(); } // We must set check on menu item since toolbar may have been used document.getElementById("viewPreviewMode").setAttribute("checked","false"); document.getElementById("viewNormalMode").setAttribute("checked","false"); document.getElementById("viewAllTagsMode").setAttribute("checked","false"); document.getElementById("viewSourceMode").setAttribute("checked","false"); var menuID; switch(mode) { case DisplayModePreview: menuID = "viewPreviewMode"; break; case DisplayModeNormal: menuID = "viewNormalMode"; break; case DisplayModeAllTags: menuID = "viewAllTagsMode"; break; case DisplayModeSource: menuID = "viewSourceMode"; break; } if (menuID) document.getElementById(menuID).setAttribute("checked","true"); return true; } return false;} |
window.content.focus(); | window._content.focus(); | function SetDisplayMode(mode){ if (gIsHTMLEditor) { // Already in requested mode: // return false to indicate we didn't switch if (mode == gEditorDisplayMode) return false; gEditorDisplayMode = mode; // Save the last non-source mode so we can cancel source editing easily if (mode != DisplayModeSource) PreviousNonSourceDisplayMode = mode; // Editorshell does the style sheet loading/unloading editorShell.SetDisplayMode(mode); // Set the UI states gPreviewModeButton.setAttribute("selected",Number(mode == DisplayModePreview)); gNormalModeButton.setAttribute("selected",Number(mode == DisplayModeNormal)); gTagModeButton.setAttribute("selected",Number(mode == DisplayModeAllTags)); gSourceModeButton.setAttribute("selected", Number(mode == DisplayModeSource)); if (mode == DisplayModeSource) { // Switch to the sourceWindow (second in the deck) gContentWindowDeck.setAttribute("index","1"); // TODO: WE MUST DISABLE APPROPRIATE COMMANDS // and change UI to appropriate // THIS DOESN'T WORK! gSourceContentWindow.focus(); } else { // Switch to the normal editor (first in the deck) gContentWindowDeck.setAttribute("index","0"); // TODO: WE MUST ENABLE APPROPRIATE COMMANDS // and change UI back to "normal" window.content.focus(); } return true; }} |
defaultProfileDir.append(document.getElementById("profileName").value); | defaultProfileDir.append(saltName(document.getElementById("profileName").value)); | function setDisplayToDefaultFolder(){ var defaultProfileDir = gDefaultProfileParent.clone(); defaultProfileDir.append(document.getElementById("profileName").value); gProfileRoot = defaultProfileDir; document.getElementById("useDefault").disabled = true;} |
if ( div ) { if ( div.childNodes.length == 0 ) { | if (div) { if (!div.childNodes.length) { | function SetDivText(id, text){ var div = document.getElementById(id); if ( div ) { if ( div.childNodes.length == 0 ) { var textNode = document.createTextNode(text); div.appendChild(textNode); } else if ( div.childNodes.length == 1 ) { div.childNodes[0].nodeValue = text; } }} |
gAutocompleteSession.defaultDomain = emailAddr.slice(start + 1, emailAddr.length); | defaultDomain = emailAddr.slice(start + 1); | function setDomainName(){ if (gCurrentIdentity.autocompleteToMyDomain) { var emailAddr = gCurrentIdentity.email; var start = emailAddr.lastIndexOf("@"); gAutocompleteSession.defaultDomain = emailAddr.slice(start + 1, emailAddr.length); }} |
gAutocompleteSession.defaultDomain = defaultDomain; | function setDomainName(){ if (gCurrentIdentity.autocompleteToMyDomain) { var emailAddr = gCurrentIdentity.email; var start = emailAddr.lastIndexOf("@"); gAutocompleteSession.defaultDomain = emailAddr.slice(start + 1, emailAddr.length); }} |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.