rem
stringlengths
0
126k
add
stringlengths
0
441k
context
stringlengths
15
136k
this.mRecurrenceInfo = Components.classes["@mozilla.org/calendar/recurrence-info;1"]. createInstance(Components.interfaces.calIRecurrenceInfo);
this.mRecurrenceInfo = null;
initItemBase: function () { this.mCreationDate = new CalDateTime(); this.mAlarmTime = new CalDateTime(); this.mLastModifiedTime = new CalDateTime(); this.mCreationDate.jsDate = new Date(); this.mLastModifiedTime.jsDate = new Date(); this.mProperties = Components.classes["@mozilla.org/hash-property-bag;1"]. createInstance(Components.interfaces.nsIWritablePropertyBag); this.mAttendees = []; this.mRecurrenceInfo = Components.classes["@mozilla.org/calendar/recurrence-info;1"]. createInstance(Components.interfaces.calIRecurrenceInfo); this.mAttachments = null; },
this.initMetadataItems();
initItems : function () { this.initOpenItems(); this.initNavigationItems(); this.initViewItems(); this.initMiscItems(); this.initSaveItems(); this.initClipboardItems(); },
menuItem.setAttribute("value",menuText);
menuItem.setAttribute("label",menuText);
function InitJoinCellMenuitem(id){ // Change text on the "Join..." item depending if we // are joining selected cells or just cell to right // TODO: What to do about normal selection that crosses // table border? Try to figure out all cells // included in the selection? var menuText; var menuItem = document.getElementById(id); if (!menuItem) return; // Use "Join selected cells if there's more than 1 cell selected var tagNameObj = new Object; var countObj = new Object; if (window.editorShell.GetSelectedOrParentTableElement(tagNameObj, countObj) && countObj.value > 1) menuText = GetString("JoinSelectedCells"); else menuText = GetString("JoinCellToRight"); menuItem.setAttribute("value",menuText); menuItem.setAttribute("accesskey",GetString("JoinCellAccesskey"));}
console.addPref ("services.source.sourceColoring", "false");
console.addPref ("services.source.colorize", true); console.addPref ("services.source.colorizeLimit", 1500);
function initJSDURL(){ console.addPref ("services.help.css", "chrome://venkman/skin/venkman-help.css"); console.addPref ("services.help.template", "chrome://venkman/locale/venkman-help.tpl"); console.addPref ("services.source.css", "chrome://venkman/skin/venkman-source.css"); console.addPref ("services.source.sourceColoring", "false");}
AppendValueAndDataToMenulist(dialog.LanguageMenulist, menuStr, dictList[i]);
AppendLabelAndValueToMenulist(dialog.LanguageMenulist, menuStr, dictList[i]);
function InitLanguageMenu(curLang){ ClearMenulist(dialog.LanguageMenulist); var o1 = {}; var o2 = {}; // Get the list of dictionaries from // the spellchecker. try { spellChecker.GetDictionaryList(o1, o2); } catch(ex) { dump("Failed to get DictionaryList!\n"); return; } var dictList = o1.value; var count = o2.value; // Load the string bundles that will help us map // RFC 1766 strings to UI strings. var languageBundle; var regionBundle; var menuStr; var menuStr2; var isoStrArray; var defaultIndex = 0; // Try to load the language string bundle. try { languageBundle = srGetStrBundle("chrome://global/locale/languageNames.properties"); } catch(ex) { languageBundle = null; } // If we have a language string bundle, try to load the region string bundle. if (languageBundle) { try { regionBundle = srGetStrBundle("chrome://global/locale/regionNames.properties"); } catch(ex) { regionBundle = null; } } for (var i = 0; i < dictList.length; i++) { try { isoStrArray = dictList[i].split("-"); if (languageBundle && isoStrArray[0]) menuStr = languageBundle.GetStringFromName(isoStrArray[0].toLowerCase()); if (regionBundle && menuStr && isoStrArray.length > 1 && isoStrArray[1]) { menuStr2 = regionBundle.GetStringFromName(isoStrArray[1].toLowerCase()); if (menuStr2) menuStr = menuStr + "/" + menuStr2; } if (!menuStr) menuStr = dictList[i]; } catch (ex) { // GetStringFromName throws an exception when // a key is not found in the bundle. In that // case, just use the original dictList string. menuStr = dictList[i]; } if (curLang && dictList[i] == curLang) defaultIndex = i; AppendValueAndDataToMenulist(dialog.LanguageMenulist, menuStr, dictList[i]); } // Now make sure the correct item in the menu list is selected. if (dictList.length > 0) dialog.LanguageMenulist.selectedIndex = defaultIndex;}
var languageMenuList = document.getElementById('LanguageMenulist');
function initLanguageMenu(){ var spellChecker = Components.classes['@mozilla.org/spellchecker/myspell;1'].getService(Components.interfaces.mozISpellCheckingEngine); var o1 = {}; var o2 = {}; var languageMenuList = document.getElementById('LanguageMenulist'); // Get the list of dictionaries from // the spellchecker. spellChecker.getDictionaryList(o1, o2); var dictList = o1.value; var count = o2.value; // Load the string bundles that will help us map // RFC 1766 strings to UI strings. // Load the language string bundle. var languageBundle = document.getElementById("languageBundle"); var regionBundle; // If we have a language string bundle, load the region string bundle. if (languageBundle) regionBundle = document.getElementById("regionBundle"); var menuStr2; var isoStrArray; var defaultItem = null; var langId; var i; for (i = 0; i < dictList.length; i++) { try { langId = dictList[i]; isoStrArray = dictList[i].split("-"); dictList[i] = new Array(2); // first subarray element - pretty name dictList[i][1] = langId; // second subarray element - language ID if (languageBundle && isoStrArray[0]) dictList[i][0] = languageBundle.getString(isoStrArray[0].toLowerCase()); if (regionBundle && dictList[i][0] && isoStrArray.length > 1 && isoStrArray[1]) { menuStr2 = regionBundle.getString(isoStrArray[1].toLowerCase()); if (menuStr2) dictList[i][0] = dictList[i][0] + "/" + menuStr2; } if (!dictList[i][0]) dictList[i][0] = dictList[i][1]; } catch (ex) { // GetString throws an exception when // a key is not found in the bundle. In that // case, just use the original dictList string. dictList[i][0] = dictList[i][1]; } } // note this is not locale-aware collation, just simple ASCII-based sorting // we really need to add locale-aware JS collation dictList.sort(); // now select the dictionary we are currently using for (i = 0; i < dictList.length; i++) { var item = document.createElement("menuitem"); item.setAttribute("label", dictList[i][0]); item.setAttribute("value", dictList[i][1]); item.setAttribute('type', 'radio'); item.setAttribute('oncommand', "changeLanguage(event)"); languageMenuList.appendChild(item); } }
itemNode.setAttribute("observes", "cmd_renderedHTMLEnabler");
function initLocalFontFaceMenu(menuPopup){ if (!gLocalFonts) { // Build list of all local fonts once per editor try { var enumerator = Components.classes["@mozilla.org/gfx/fontenumerator;1"] .getService(Components.interfaces.nsIFontEnumerator); var localFontCount = { value: 0 } gLocalFonts = enumerator.EnumerateAllFonts(localFontCount); } catch(e) { } } var useRadioMenuitems = (menuPopup.parentNode.localName == "menu"); // don't do this for menulists if (menuPopup.childNodes.length == kFixedFontFaceMenuItems) { if (gLocalFonts.length == 0) { menuPopup.childNodes[kFixedFontFaceMenuItems - 1].hidden = true; } for (var i = 0; i < gLocalFonts.length; ++i) { if (gLocalFonts[i] != "") { var itemNode = document.createElementNS(XUL_NS, "menuitem"); itemNode.setAttribute("label", gLocalFonts[i]); itemNode.setAttribute("value", gLocalFonts[i]); if (useRadioMenuitems) { itemNode.setAttribute("type", "radio"); itemNode.setAttribute("name", "2"); } itemNode.setAttribute("observes", "cmd_renderedHTMLEnabler"); menuPopup.appendChild(itemNode); } } }}
for (var i = 0; i < gLocalFonts.length; ++i) { if (gLocalFonts[i] != "") { var itemNode = document.createElementNS(XUL_NS, "menuitem"); itemNode.setAttribute("label", gLocalFonts[i]); itemNode.setAttribute("value", gLocalFonts[i]); itemNode.setAttribute("type", "radio"); itemNode.setAttribute("name", "2"); itemNode.setAttribute("observes", "cmd_renderedHTMLEnabler"); menuPopup.appendChild(itemNode); } }
function initLocalFontFaceMenu(menuPopup){ if (!gLocalFonts) { // Build list of all local fonts once per editor try { var enumerator = Components.classes["@mozilla.org/gfx/fontenumerator;1"] .getService(Components.interfaces.nsIFontEnumerator); var localFontCount = { value: 0 } gLocalFonts = enumerator.EnumerateAllFonts(localFontCount); for (var i = 0; i < gLocalFonts.length; ++i) { if (gLocalFonts[i] != "") { var itemNode = document.createElementNS(XUL_NS, "menuitem"); itemNode.setAttribute("label", gLocalFonts[i]); itemNode.setAttribute("value", gLocalFonts[i]); itemNode.setAttribute("type", "radio"); itemNode.setAttribute("name", "2"); itemNode.setAttribute("observes", "cmd_renderedHTMLEnabler"); menuPopup.appendChild(itemNode); } } } catch(e) { } }}
var useRadioMenuitems = (menuPopup.parentNode.localName == "menu"); if (menuPopup.childNodes.length == kFixedFontFaceMenuItems) { if (gLocalFonts.length == 0) { menuPopup.childNodes[kFixedFontFaceMenuItems - 1].hidden = true; } for (var i = 0; i < gLocalFonts.length; ++i) { if (gLocalFonts[i] != "") { var itemNode = document.createElementNS(XUL_NS, "menuitem"); itemNode.setAttribute("label", gLocalFonts[i]); itemNode.setAttribute("value", gLocalFonts[i]); if (useRadioMenuitems) { itemNode.setAttribute("type", "radio"); itemNode.setAttribute("name", "2"); } itemNode.setAttribute("observes", "cmd_renderedHTMLEnabler"); menuPopup.appendChild(itemNode); } } }
function initLocalFontFaceMenu(menuPopup){ if (!gLocalFonts) { // Build list of all local fonts once per editor try { var enumerator = Components.classes["@mozilla.org/gfx/fontenumerator;1"] .getService(Components.interfaces.nsIFontEnumerator); var localFontCount = { value: 0 } gLocalFonts = enumerator.EnumerateAllFonts(localFontCount); for (var i = 0; i < gLocalFonts.length; ++i) { if (gLocalFonts[i] != "") { var itemNode = document.createElementNS(XUL_NS, "menuitem"); itemNode.setAttribute("label", gLocalFonts[i]); itemNode.setAttribute("value", gLocalFonts[i]); itemNode.setAttribute("type", "radio"); itemNode.setAttribute("name", "2"); itemNode.setAttribute("observes", "cmd_renderedHTMLEnabler"); menuPopup.appendChild(itemNode); } } } catch(e) { } }}
for (var i = 1; i <= lastLabel; i++)
for (var i = 0; i <= lastLabel; i++)
function InitMessageLabel(){ /* this code gets the label strings and changes the menu labels */ var lastLabel = 5; // start with 1 because there is no None label (id 0) as an filtering // option to filter to. for (var i = 1; i <= lastLabel; i++) { setLabelAttributes(i, "labelMenuItem" + i); } /* We set the label attribute for labels here because they have to be read from prefs. Default selection is always 0 and the picker thinks that it is already showing the label but it is not. Just setting selectedIndex to 0 doesn't do it because it thinks that it is already showing 0. So we need to set it to something else than 0 and then back to 0, to make it show the default case- probably some sort of dom optimization*/ gActionLabel.selectedIndex = 1; gActionLabel.selectedIndex = 0; document.commandDispatcher.updateCommands('create-menu-label');}
}
function InitMessageMenu(){ var aMessage = GetSelectedMessage(0); var isNews = false; if(aMessage) { isNews = GetMessageType(aMessage) == "news"; } //We show reply to Newsgroups only for news messages. var replyNewsgroupMenuItem = document.getElementById("replyNewsgroupMainMenu"); if(replyNewsgroupMenuItem) replyNewsgroupMenuItem.setAttribute("hidden", isNews ? "" : "true"); //For mail messages we say reply. For news we say ReplyToSender. var replyMenuItem = document.getElementById("replyMainMenu"); if(replyMenuItem) { replyMenuItem.setAttribute("hidden", !isNews ? "" : "true"); } var replySenderMenuItem = document.getElementById("replySenderMainMenu"); if(replySenderMenuItem) { replySenderMenuItem.setAttribute("hidden", isNews ? "" : "true"); } //disable the move and copy menus only if there are no messages selected. var moveMenu = document.getElementById("moveMenu"); if(moveMenu) moveMenu.setAttribute("disabled", !aMessage); var copyMenu = document.getElementById("copyMenu"); if(copyMenu) copyMenu.setAttribute("disabled", !aMessage);}
client.name = MSG_CLIENT_NAME;
client.displayName = client.name = MSG_CLIENT_NAME;
function initMessages(){ var path = "chrome://chatzilla/locale/chatzilla.properties"; client.messageManager = new MessageManager(); client.defaultBundle = client.messageManager.addBundle(path); client.name = MSG_CLIENT_NAME; client.responseCodeMap = { "HELLO": MSG_RSP_HELLO, "HELP" : MSG_RSP_HELP, "USAGE": MSG_RSP_USAGE, "ERROR": MSG_RSP_ERROR, "WARNING": MSG_RSP_WARN, "INFO": MSG_RSP_INFO, "EVAL-IN": MSG_RSP_EVIN, "EVAL_-OUT": MSG_RSP_EVOUT, "JOIN": "-->|", "PART": "<--|", "QUIT": "|<--", "NICK": "=-=", "TOPIC": "=-=", "KICK": "=-=", "MODE": "=-=", "END_STATUS": "---", "315": "---", /* end of WHO */ "318": "---", /* end of WHOIS */ "366": "---", /* end of NAMES */ "376": "---" /* end of MOTD */ };}
"DISCONNECT": MSG_RSP_DISCONNECT,
function initMessages(){ var path = "chrome://chatzilla/locale/chatzilla.properties"; client.messageManager = new MessageManager(); client.defaultBundle = client.messageManager.addBundle(path); client.viewName = client.unicodeName = MSG_CLIENT_NAME; client.responseCodeMap = { "HELLO": MSG_RSP_HELLO, "HELP" : MSG_RSP_HELP, "USAGE": MSG_RSP_USAGE, "ERROR": MSG_RSP_ERROR, "WARNING": MSG_RSP_WARN, "INFO": MSG_RSP_INFO, "EVAL-IN": MSG_RSP_EVIN, "EVAL-OUT": MSG_RSP_EVOUT, "JOIN": "-->|", "PART": "<--|", "QUIT": "|<--", "NICK": "=-=", "TOPIC": "=-=", "KICK": "=-=", "MODE": "=-=", "END_STATUS": "---", "DCC-CHAT": "[DCC]", "DCC-FILE": "[DCC]", "315": "---", /* end of WHO */ "318": "---", /* end of WHOIS */ "366": "---", /* end of NAMES */ "376": "---" /* end of MOTD */ };}
while (menuPopup.firstChild && menuPopup.firstChild.localName != 'menuseparator') menuPopup.removeChild(menuPopup.firstChild); var menuSeparatorNode = menuPopup.firstChild;
var menuseparator = menuPopup.lastChild.previousSibling; for (var i = menuPopup.childNodes.length; i > 4; --i) menuPopup.removeChild(menuseparator.previousSibling); menuseparator.previousSibling.hidden = !allTags.hasMore(); var tagRemoveLabel = gMessengerBundle.getString("mailnews.tags.remove"); SetMessageTagLabel(menuPopup.firstChild, 0, tagRemoveLabel);
function InitMessageTags(menuPopup){ var tagService = Components.classes["@mozilla.org/messenger/tagservice;1"].getService(Components.interfaces.nsIMsgTagService); var allTags = tagService.tagEnumerator; var allKeys = tagService.keyEnumerator; // remove existing entries up until the menuseparator which precedes the Add New Tag option while (menuPopup.firstChild && menuPopup.firstChild.localName != 'menuseparator') menuPopup.removeChild(menuPopup.firstChild); var menuSeparatorNode = menuPopup.firstChild; // now rebuild the list var msgHdr = gDBView.hdrForFirstSelectedMessage; var curKeys = msgHdr.getStringProperty("keywords"); var newMenuItem; var curMsgHdrKeyArray = curKeys.split(" "); if (msgHdr.label != 0) curMsgHdrKeyArray.push("$label" + msgHdr.label); while (allTags.hasMore()) { var tag = allTags.getNext(); var key = allKeys.getNext(); // TODO we want to either remove or "check" the tags that already exist newMenuItem = document.createElement('menuitem'); newMenuItem.setAttribute('label', tag); newMenuItem.setAttribute('value', key); newMenuItem.setAttribute('type', 'checkbox'); newMenuItem.style.color = tagService.getColorForKey(key); var removeKey = (" " + curKeys + " ").indexOf(" " + key + " ") > -1; newMenuItem.setAttribute('checked', removeKey); newMenuItem.setAttribute('oncommand', 'ToggleMessageTagCmd(event.target)'); menuPopup.insertBefore(newMenuItem, menuSeparatorNode); }}
var newMenuItem;
if (msgHdr.label) curKeys += " $label" + msgHdr.label;
function InitMessageTags(menuPopup){ var tagService = Components.classes["@mozilla.org/messenger/tagservice;1"].getService(Components.interfaces.nsIMsgTagService); var allTags = tagService.tagEnumerator; var allKeys = tagService.keyEnumerator; // remove existing entries up until the menuseparator which precedes the Add New Tag option while (menuPopup.firstChild && menuPopup.firstChild.localName != 'menuseparator') menuPopup.removeChild(menuPopup.firstChild); var menuSeparatorNode = menuPopup.firstChild; // now rebuild the list var msgHdr = gDBView.hdrForFirstSelectedMessage; var curKeys = msgHdr.getStringProperty("keywords"); var newMenuItem; var curMsgHdrKeyArray = curKeys.split(" "); if (msgHdr.label != 0) curMsgHdrKeyArray.push("$label" + msgHdr.label); while (allTags.hasMore()) { var tag = allTags.getNext(); var key = allKeys.getNext(); // TODO we want to either remove or "check" the tags that already exist newMenuItem = document.createElement('menuitem'); newMenuItem.setAttribute('label', tag); newMenuItem.setAttribute('value', key); newMenuItem.setAttribute('type', 'checkbox'); newMenuItem.style.color = tagService.getColorForKey(key); var removeKey = (" " + curKeys + " ").indexOf(" " + key + " ") > -1; newMenuItem.setAttribute('checked', removeKey); newMenuItem.setAttribute('oncommand', 'ToggleMessageTagCmd(event.target)'); menuPopup.insertBefore(newMenuItem, menuSeparatorNode); }}
var curMsgHdrKeyArray = curKeys.split(" "); if (msgHdr.label != 0) curMsgHdrKeyArray.push("$label" + msgHdr.label);
var index = 0;
function InitMessageTags(menuPopup){ var tagService = Components.classes["@mozilla.org/messenger/tagservice;1"].getService(Components.interfaces.nsIMsgTagService); var allTags = tagService.tagEnumerator; var allKeys = tagService.keyEnumerator; // remove existing entries up until the menuseparator which precedes the Add New Tag option while (menuPopup.firstChild && menuPopup.firstChild.localName != 'menuseparator') menuPopup.removeChild(menuPopup.firstChild); var menuSeparatorNode = menuPopup.firstChild; // now rebuild the list var msgHdr = gDBView.hdrForFirstSelectedMessage; var curKeys = msgHdr.getStringProperty("keywords"); var newMenuItem; var curMsgHdrKeyArray = curKeys.split(" "); if (msgHdr.label != 0) curMsgHdrKeyArray.push("$label" + msgHdr.label); while (allTags.hasMore()) { var tag = allTags.getNext(); var key = allKeys.getNext(); // TODO we want to either remove or "check" the tags that already exist newMenuItem = document.createElement('menuitem'); newMenuItem.setAttribute('label', tag); newMenuItem.setAttribute('value', key); newMenuItem.setAttribute('type', 'checkbox'); newMenuItem.style.color = tagService.getColorForKey(key); var removeKey = (" " + curKeys + " ").indexOf(" " + key + " ") > -1; newMenuItem.setAttribute('checked', removeKey); newMenuItem.setAttribute('oncommand', 'ToggleMessageTagCmd(event.target)'); menuPopup.insertBefore(newMenuItem, menuSeparatorNode); }}
newMenuItem = document.createElement('menuitem'); newMenuItem.setAttribute('label', tag); newMenuItem.setAttribute('value', key); newMenuItem.setAttribute('type', 'checkbox');
var newMenuItem = document.createElement("menuitem"); SetMessageTagLabel(newMenuItem, ++index, tag); newMenuItem.setAttribute("value", key); newMenuItem.setAttribute("type", "checkbox");
function InitMessageTags(menuPopup){ var tagService = Components.classes["@mozilla.org/messenger/tagservice;1"].getService(Components.interfaces.nsIMsgTagService); var allTags = tagService.tagEnumerator; var allKeys = tagService.keyEnumerator; // remove existing entries up until the menuseparator which precedes the Add New Tag option while (menuPopup.firstChild && menuPopup.firstChild.localName != 'menuseparator') menuPopup.removeChild(menuPopup.firstChild); var menuSeparatorNode = menuPopup.firstChild; // now rebuild the list var msgHdr = gDBView.hdrForFirstSelectedMessage; var curKeys = msgHdr.getStringProperty("keywords"); var newMenuItem; var curMsgHdrKeyArray = curKeys.split(" "); if (msgHdr.label != 0) curMsgHdrKeyArray.push("$label" + msgHdr.label); while (allTags.hasMore()) { var tag = allTags.getNext(); var key = allKeys.getNext(); // TODO we want to either remove or "check" the tags that already exist newMenuItem = document.createElement('menuitem'); newMenuItem.setAttribute('label', tag); newMenuItem.setAttribute('value', key); newMenuItem.setAttribute('type', 'checkbox'); newMenuItem.style.color = tagService.getColorForKey(key); var removeKey = (" " + curKeys + " ").indexOf(" " + key + " ") > -1; newMenuItem.setAttribute('checked', removeKey); newMenuItem.setAttribute('oncommand', 'ToggleMessageTagCmd(event.target)'); menuPopup.insertBefore(newMenuItem, menuSeparatorNode); }}
newMenuItem.setAttribute('oncommand', 'ToggleMessageTagCmd(event.target)'); menuPopup.insertBefore(newMenuItem, menuSeparatorNode);
newMenuItem.setAttribute('oncommand', 'ToggleMessageTagMenu(event.target);'); menuPopup.insertBefore(newMenuItem, menuseparator);
function InitMessageTags(menuPopup){ var tagService = Components.classes["@mozilla.org/messenger/tagservice;1"].getService(Components.interfaces.nsIMsgTagService); var allTags = tagService.tagEnumerator; var allKeys = tagService.keyEnumerator; // remove existing entries up until the menuseparator which precedes the Add New Tag option while (menuPopup.firstChild && menuPopup.firstChild.localName != 'menuseparator') menuPopup.removeChild(menuPopup.firstChild); var menuSeparatorNode = menuPopup.firstChild; // now rebuild the list var msgHdr = gDBView.hdrForFirstSelectedMessage; var curKeys = msgHdr.getStringProperty("keywords"); var newMenuItem; var curMsgHdrKeyArray = curKeys.split(" "); if (msgHdr.label != 0) curMsgHdrKeyArray.push("$label" + msgHdr.label); while (allTags.hasMore()) { var tag = allTags.getNext(); var key = allKeys.getNext(); // TODO we want to either remove or "check" the tags that already exist newMenuItem = document.createElement('menuitem'); newMenuItem.setAttribute('label', tag); newMenuItem.setAttribute('value', key); newMenuItem.setAttribute('type', 'checkbox'); newMenuItem.style.color = tagService.getColorForKey(key); var removeKey = (" " + curKeys + " ").indexOf(" " + key + " ") > -1; newMenuItem.setAttribute('checked', removeKey); newMenuItem.setAttribute('oncommand', 'ToggleMessageTagCmd(event.target)'); menuPopup.insertBefore(newMenuItem, menuSeparatorNode); }}
this.showItem( "context-blockimage", this.onImage);
initMiscItems : function () { // Use "Bookmark This Link" if on a link. this.showItem( "context-bookmarkpage", !( this.isContentSelected || this.onTextInput || this.onLink || this.onImage ) ); this.showItem( "context-bookmarklink", this.onLink && !this.onMailtoLink ); this.showItem( "context-searchselect", this.isTextSelected ); this.showItem( "context-keywordfield", this.onTextInput && this.onKeywordField ); this.showItem( "frame", this.inFrame ); this.showItem( "frame-sep", this.inFrame ); this.showItem( "context-blockimage", this.onImage); // BiDi UI this.showItem( "context-sep-bidi", gBidiUI); this.showItem( "context-bidi-text-direction-toggle", this.onTextInput && gBidiUI); this.showItem( "context-bidi-page-direction-toggle", !this.onTextInput && gBidiUI); if (this.onImage) { var blockImage = document.getElementById("context-blockimage"); var uri = this.target.QueryInterface(Components.interfaces.nsIImageLoadingContent).currentURI; var shortenedUriHost = uri.host.replace(/^www\./i,""); if (shortenedUriHost.length > 15) shortenedUriHost = shortenedUriHost.substr(0,15) + "..."; blockImage.label = gNavigatorBundle.getFormattedString ("blockImages", [shortenedUriHost]); if (this.isImageBlocked()) { blockImage.setAttribute("checked", "true"); } else blockImage.removeAttribute("checked"); } },
var shortenedUriHost = uri.host.replace(/^www\./i,""); if (shortenedUriHost.length > 15) shortenedUriHost = shortenedUriHost.substr(0,15) + "..."; blockImage.label = gNavigatorBundle.getFormattedString ("blockImages", [shortenedUriHost]);
var hostLabel; try { hostLabel = uri.host; } catch (ex) { }
initMiscItems : function () { // Use "Bookmark This Link" if on a link. this.showItem( "context-bookmarkpage", !( this.isContentSelected || this.onTextInput || this.onLink || this.onImage ) ); this.showItem( "context-bookmarklink", this.onLink && !this.onMailtoLink ); this.showItem( "context-searchselect", this.isTextSelected ); this.showItem( "context-keywordfield", this.onTextInput && this.onKeywordField ); this.showItem( "frame", this.inFrame ); this.showItem( "frame-sep", this.inFrame ); this.showItem( "context-blockimage", this.onImage); // BiDi UI this.showItem( "context-sep-bidi", gBidiUI); this.showItem( "context-bidi-text-direction-toggle", this.onTextInput && gBidiUI); this.showItem( "context-bidi-page-direction-toggle", !this.onTextInput && gBidiUI); if (this.onImage) { var blockImage = document.getElementById("context-blockimage"); var uri = this.target.QueryInterface(Components.interfaces.nsIImageLoadingContent).currentURI; var shortenedUriHost = uri.host.replace(/^www\./i,""); if (shortenedUriHost.length > 15) shortenedUriHost = shortenedUriHost.substr(0,15) + "..."; blockImage.label = gNavigatorBundle.getFormattedString ("blockImages", [shortenedUriHost]); if (this.isImageBlocked()) { blockImage.setAttribute("checked", "true"); } else blockImage.removeAttribute("checked"); } },
if (this.isImageBlocked()) { blockImage.setAttribute("checked", "true");
if (hostLabel) { var shortenedUriHost = hostLabel.replace(/^www\./i,""); if (shortenedUriHost.length > 15) shortenedUriHost = shortenedUriHost.substr(0,15) + "..."; blockImage.label = gNavigatorBundle.getFormattedString("blockImages", [shortenedUriHost]); if (this.isImageBlocked()) blockImage.setAttribute("checked", "true"); else blockImage.removeAttribute("checked");
initMiscItems : function () { // Use "Bookmark This Link" if on a link. this.showItem( "context-bookmarkpage", !( this.isContentSelected || this.onTextInput || this.onLink || this.onImage ) ); this.showItem( "context-bookmarklink", this.onLink && !this.onMailtoLink ); this.showItem( "context-searchselect", this.isTextSelected ); this.showItem( "context-keywordfield", this.onTextInput && this.onKeywordField ); this.showItem( "frame", this.inFrame ); this.showItem( "frame-sep", this.inFrame ); this.showItem( "context-blockimage", this.onImage); // BiDi UI this.showItem( "context-sep-bidi", gBidiUI); this.showItem( "context-bidi-text-direction-toggle", this.onTextInput && gBidiUI); this.showItem( "context-bidi-page-direction-toggle", !this.onTextInput && gBidiUI); if (this.onImage) { var blockImage = document.getElementById("context-blockimage"); var uri = this.target.QueryInterface(Components.interfaces.nsIImageLoadingContent).currentURI; var shortenedUriHost = uri.host.replace(/^www\./i,""); if (shortenedUriHost.length > 15) shortenedUriHost = shortenedUriHost.substr(0,15) + "..."; blockImage.label = gNavigatorBundle.getFormattedString ("blockImages", [shortenedUriHost]); if (this.isImageBlocked()) { blockImage.setAttribute("checked", "true"); } else blockImage.removeAttribute("checked"); } },
else blockImage.removeAttribute("checked");
initMiscItems : function () { // Use "Bookmark This Link" if on a link. this.showItem( "context-bookmarkpage", !( this.isContentSelected || this.onTextInput || this.onLink || this.onImage ) ); this.showItem( "context-bookmarklink", this.onLink && !this.onMailtoLink ); this.showItem( "context-searchselect", this.isTextSelected ); this.showItem( "context-keywordfield", this.onTextInput && this.onKeywordField ); this.showItem( "frame", this.inFrame ); this.showItem( "frame-sep", this.inFrame ); this.showItem( "context-blockimage", this.onImage); // BiDi UI this.showItem( "context-sep-bidi", gBidiUI); this.showItem( "context-bidi-text-direction-toggle", this.onTextInput && gBidiUI); this.showItem( "context-bidi-page-direction-toggle", !this.onTextInput && gBidiUI); if (this.onImage) { var blockImage = document.getElementById("context-blockimage"); var uri = this.target.QueryInterface(Components.interfaces.nsIImageLoadingContent).currentURI; var shortenedUriHost = uri.host.replace(/^www\./i,""); if (shortenedUriHost.length > 15) shortenedUriHost = shortenedUriHost.substr(0,15) + "..."; blockImage.label = gNavigatorBundle.getFormattedString ("blockImages", [shortenedUriHost]); if (this.isImageBlocked()) { blockImage.setAttribute("checked", "true"); } else blockImage.removeAttribute("checked"); } },
this.showItem( "context-blockimage", this.onImage && hostLabel);
initMiscItems : function () { // Use "Bookmark This Link" if on a link. this.showItem( "context-bookmarkpage", !( this.isContentSelected || this.onTextInput || this.onLink || this.onImage ) ); this.showItem( "context-bookmarklink", this.onLink && !this.onMailtoLink ); this.showItem( "context-searchselect", this.isTextSelected ); this.showItem( "context-keywordfield", this.onTextInput && this.onKeywordField ); this.showItem( "frame", this.inFrame ); this.showItem( "frame-sep", this.inFrame ); this.showItem( "context-blockimage", this.onImage); // BiDi UI this.showItem( "context-sep-bidi", gBidiUI); this.showItem( "context-bidi-text-direction-toggle", this.onTextInput && gBidiUI); this.showItem( "context-bidi-page-direction-toggle", !this.onTextInput && gBidiUI); if (this.onImage) { var blockImage = document.getElementById("context-blockimage"); var uri = this.target.QueryInterface(Components.interfaces.nsIImageLoadingContent).currentURI; var shortenedUriHost = uri.host.replace(/^www\./i,""); if (shortenedUriHost.length > 15) shortenedUriHost = shortenedUriHost.substr(0,15) + "..."; blockImage.label = gNavigatorBundle.getFormattedString ("blockImages", [shortenedUriHost]); if (this.isImageBlocked()) { blockImage.setAttribute("checked", "true"); } else blockImage.removeAttribute("checked"); } },
this.showItem( "context-bookmarkpage", !( this.isTextSelected || this.onTextInput ) );
this.showItem( "context-bookmarkpage", !( this.isTextSelected || this.onTextInput || this.onStandaloneImage ) );
initMiscItems : function () { // Use "Bookmark This Link" if on a link. this.showItem( "context-bookmarkpage", !( this.isTextSelected || this.onTextInput ) ); this.showItem( "context-bookmarklink", this.onLink && !this.onMailtoLink ); this.showItem( "context-searchselect", this.isTextSelected && !this.onTextInput ); this.showItem( "frame", this.inFrame ); this.showItem( "frame-sep", this.inFrame ); var blocking = true; if (this.popupURL) try { const PM = Components.classes["@mozilla.org/PopupWindowManager;1"] .getService(Components.interfaces.nsIPopupWindowManager); blocking = PM.testPermission(this.popupURL) == Components.interfaces.nsIPopupWindowManager.DENY_POPUP; } catch (e) { } this.showItem( "popupwindow-reject", this.popupURL && !blocking); this.showItem( "popupwindow-allow", this.popupURL && blocking); this.showItem( "context-sep-popup", this.popupURL); },
gDialog.MoreFewerButton.setAttribute("accesskey",GetString("PropertiesAccessKey"));
function InitMoreFewer(){ // Set SeeMore bool to the OPPOSITE of the current state, // which is automatically saved by using the 'persist="more"' // attribute on the gDialog.MoreFewerButton button // onMoreFewer will toggle it and redraw the dialog SeeMore = (gDialog.MoreFewerButton.getAttribute("more") != "1"); onMoreFewer();}
dump(SeeMore+"=SeeMore - InitMoreFewer\n");
function InitMoreFewer(){ // Set SeeMore bool to the OPPOSITE of the current state, // which is automatically saved by using the 'persist="more"' // attribute on the dialog.MoreFewerButton button // onMoreFewer will toggle it and redraw the dialog SeeMore = (dialog.MoreFewerButton.getAttribute("more") != "1"); onMoreFewer();}
document.getElementById("messagepane").docShell.allowAuth = false;
getBrowser().docShell.allowAuth = false;
function InitMsgWindow(){ msgWindow.messagePaneController = new nsMessagePaneController(); msgWindow.statusFeedback = statusFeedback; msgWindow.msgHeaderSink = messageHeaderSink; msgWindow.SetDOMWindow(window); mailSession.AddMsgWindow(msgWindow); document.getElementById("messagepane").docShell.allowAuth = false; msgWindow.rootDocShell.allowAuth = true; }
msgWindow.SetDOMWindow(window);
msgWindow.msgHeaderSink = messageHeaderSink; msgWindow.SetDOMWindow(window);
function InitMsgWindow(){ msgWindow.statusFeedback = statusFeedback; msgWindow.messageView = messageView; msgWindow.SetDOMWindow(window);}
/((\w[\w-]+):[^<>\[\]()\'\"\s\u201d]+|www(\.[^.<>\[\]()\'\"\s\u201d]+){2,})/;
/(?:\s|\W|^)((?:(\w[\w-]+):[^\s]+|www(\.[^.\s]+){2,})[^>)\].,!?\'\"\u201d])(?:\s|\W|$)/;
function initMunger(){ client.linkRE = /((\w[\w-]+):[^<>\[\]()\'\"\s\u201d]+|www(\.[^.<>\[\]()\'\"\s\u201d]+){2,})/; var munger = client.munger = new CMunger(); // Special internal munger! munger.addRule (".inline-buttons", /(\[\[.*?\]\])/, insertInlineButton, false); munger.addRule ("quote", /(``|'')/, insertQuote); munger.addRule ("bold", /(?:\s|^)(\*[^*()]*\*)(?:[\s.,]|$)/, "chatzilla-bold"); munger.addRule ("underline", /(?:\s|^)(\_[^_()]*\_)(?:[\s.,]|$)/, "chatzilla-underline"); munger.addRule ("italic", /(?:\s|^)(\/[^\/()]*\/)(?:[\s.,]|$)/, "chatzilla-italic"); /* allow () chars inside |code()| blocks */ munger.addRule ("teletype", /(?:\s|^)(\|[^|]*\|)(?:[\s.,]|$)/, "chatzilla-teletype"); munger.addRule (".mirc-colors", /(\x03((\d{1,2})(,\d{1,2}|)|))/, mircChangeColor); munger.addRule (".mirc-bold", /(\x02)/, mircToggleBold); munger.addRule (".mirc-underline", /(\x1f)/, mircToggleUnder); munger.addRule (".mirc-color-reset", /(\x0f)/, mircResetColor); munger.addRule (".mirc-reverse", /(\x16)/, mircReverseColor); munger.addRule ("ctrl-char", /([\x01-\x1f])/, showCtrlChar); munger.addRule ("link", client.linkRE, insertLink); munger.addRule ("mailto", /(?:\s|\W|^)((mailto:)?[^<>\[\]()\'\"\s\u201d]+@[^.<>\[\]()\'\"\s\u201d]+\.[^<>\[\]()\'\"\s\u201d]+)/i, insertMailToLink); munger.addRule ("bugzilla-link", /(?:\s|\W|^)(bug\s+#?\d{3,6})/i, insertBugzillaLink); munger.addRule ("channel-link", /(?:\s|\W|^)[@+]?(#[^<>\[\](){}\"\s\u201d]*[^:,.<>\[\](){}\'\"\s\u201d])/i, insertChannelLink); munger.addRule ("face", /((^|\s)(?:[>]?[B8=:;(xX]\~?[-^v"]?[)|(PpDSs0oO\?\[\]\/\\]|[oO9][._][oO9])(\s|$))/, insertSmiley); munger.addRule ("rheet", /(?:\s|\W|^)(rhee+t\!*)(?:\s|$)/i, insertRheet); munger.addRule ("word-hyphenator", new RegExp ("(\\S{" + client.MAX_WORD_DISPLAY + ",})"), insertHyphenatedWord); client.enableColors = client.prefs["munger.colorCodes"]; for (var entry in client.munger.entries) { var branch = client.prefManager.prefBranch; if (entry[0] != ".") { try { munger.entries[entry].enabled = branch.getBoolPref("munger." + entry); } catch (ex) { // nada } } }}
munger.addRule ("mailto",
munger.addRule (".mailto",
function initMunger(){ /* linkRE: the general URL linkifier regular expression: * * - start with whitespace, non-word, or begining-of-line * - then match: * - EITHER scheme (word + hyphen), colon, then lots of non-whitespace * - OR "www" followed by at least 2 sets of: * - "." plus some non-whitespace, non-"." characters * - must end match with a word-break * - include a "/" or "=" beyond break if present * - end with whitespace, non-word, or end-of-line */ client.linkRE = /(?:\s|\W|^)((?:(\w[\w-]+):[^\s]+|www(\.[^.\s]+){2,})\b[\/=]?)(?:\s|\W|$)/; var munger = client.munger = new CMunger(); // Special internal munger! munger.addRule (".inline-buttons", /(\[\[.*?\]\])/, insertInlineButton, false); munger.addRule ("quote", /(``|'')/, insertQuote); munger.addRule ("bold", /(?:\s|^)(\*[^*()]*\*)(?:[\s.,]|$)/, "chatzilla-bold"); munger.addRule ("underline", /(?:\s|^)(\_[^_()]*\_)(?:[\s.,]|$)/, "chatzilla-underline"); munger.addRule ("italic", /(?:\s|^)(\/[^\/()]*\/)(?:[\s.,]|$)/, "chatzilla-italic"); /* allow () chars inside |code()| blocks */ munger.addRule ("teletype", /(?:\s|^)(\|[^|]*\|)(?:[\s.,]|$)/, "chatzilla-teletype"); munger.addRule (".mirc-colors", /(\x03((\d{1,2})(,\d{1,2}|)|))/, mircChangeColor); munger.addRule (".mirc-bold", /(\x02)/, mircToggleBold); munger.addRule (".mirc-underline", /(\x1f)/, mircToggleUnder); munger.addRule (".mirc-color-reset", /(\x0f)/, mircResetColor); munger.addRule (".mirc-reverse", /(\x16)/, mircReverseColor); munger.addRule ("ctrl-char", /([\x01-\x1f])/, showCtrlChar); munger.addRule ("link", client.linkRE, insertLink); munger.addRule ("mailto", /(?:\s|\W|^)((mailto:)?[^<>\[\]()\'\"\s\u201d]+@[^.<>\[\]()\'\"\s\u201d]+\.[^<>\[\]()\'\"\s\u201d]+)/i, insertMailToLink); munger.addRule ("bugzilla-link", /(?:\s|\W|^)(bug\s+(?:#?\d{3,6}|#[^\s,]{1,20}))/i, insertBugzillaLink); munger.addRule ("channel-link", /(?:\s|\W|^)[@+]?(#[^<>\[\](){}\"\s\u201d]*[^:,.<>\[\](){}\'\"\s\u201d])/i, insertChannelLink); munger.addRule("talkback-link", /(?:\W|^)(TB\d{8,}[A-Z]?)(?:\W|$)/, insertTalkbackLink); munger.addRule ("face", /((^|\s)(?:[>]?[B8=:;(xX][~']?[-^v"]?(?:[)|(PpSs0oO\?\[\]\/\\]|D+)|>[-^v]?\)|[oO9][._][oO9])(\s|$))/, insertSmiley); munger.addRule ("rheet", /(?:\s|\W|^)(rhee+t\!*)(?:\s|$)/i, insertRheet); munger.addRule ("word-hyphenator", new RegExp ("(\\S{" + client.MAX_WORD_DISPLAY + ",})"), insertHyphenatedWord); client.enableColors = client.prefs["munger.colorCodes"]; for (var entry in client.munger.entries) { var branch = client.prefManager.prefBranch; if (entry[0] != ".") { try { munger.entries[entry].enabled = branch.getBoolPref("munger." + entry); } catch (ex) { // nada } } }}
insertMailToLink);
insertMailToLink, false);
function initMunger(){ /* linkRE: the general URL linkifier regular expression: * * - start with whitespace, non-word, or begining-of-line * - then match: * - EITHER scheme (word + hyphen), colon, then lots of non-whitespace * - OR "www" followed by at least 2 sets of: * - "." plus some non-whitespace, non-"." characters * - must end match with a word-break * - include a "/" or "=" beyond break if present * - end with whitespace, non-word, or end-of-line */ client.linkRE = /(?:\s|\W|^)((?:(\w[\w-]+):[^\s]+|www(\.[^.\s]+){2,})\b[\/=]?)(?:\s|\W|$)/; var munger = client.munger = new CMunger(); // Special internal munger! munger.addRule (".inline-buttons", /(\[\[.*?\]\])/, insertInlineButton, false); munger.addRule ("quote", /(``|'')/, insertQuote); munger.addRule ("bold", /(?:\s|^)(\*[^*()]*\*)(?:[\s.,]|$)/, "chatzilla-bold"); munger.addRule ("underline", /(?:\s|^)(\_[^_()]*\_)(?:[\s.,]|$)/, "chatzilla-underline"); munger.addRule ("italic", /(?:\s|^)(\/[^\/()]*\/)(?:[\s.,]|$)/, "chatzilla-italic"); /* allow () chars inside |code()| blocks */ munger.addRule ("teletype", /(?:\s|^)(\|[^|]*\|)(?:[\s.,]|$)/, "chatzilla-teletype"); munger.addRule (".mirc-colors", /(\x03((\d{1,2})(,\d{1,2}|)|))/, mircChangeColor); munger.addRule (".mirc-bold", /(\x02)/, mircToggleBold); munger.addRule (".mirc-underline", /(\x1f)/, mircToggleUnder); munger.addRule (".mirc-color-reset", /(\x0f)/, mircResetColor); munger.addRule (".mirc-reverse", /(\x16)/, mircReverseColor); munger.addRule ("ctrl-char", /([\x01-\x1f])/, showCtrlChar); munger.addRule ("link", client.linkRE, insertLink); munger.addRule ("mailto", /(?:\s|\W|^)((mailto:)?[^<>\[\]()\'\"\s\u201d]+@[^.<>\[\]()\'\"\s\u201d]+\.[^<>\[\]()\'\"\s\u201d]+)/i, insertMailToLink); munger.addRule ("bugzilla-link", /(?:\s|\W|^)(bug\s+(?:#?\d{3,6}|#[^\s,]{1,20}))/i, insertBugzillaLink); munger.addRule ("channel-link", /(?:\s|\W|^)[@+]?(#[^<>\[\](){}\"\s\u201d]*[^:,.<>\[\](){}\'\"\s\u201d])/i, insertChannelLink); munger.addRule("talkback-link", /(?:\W|^)(TB\d{8,}[A-Z]?)(?:\W|$)/, insertTalkbackLink); munger.addRule ("face", /((^|\s)(?:[>]?[B8=:;(xX][~']?[-^v"]?(?:[)|(PpSs0oO\?\[\]\/\\]|D+)|>[-^v]?\)|[oO9][._][oO9])(\s|$))/, insertSmiley); munger.addRule ("rheet", /(?:\s|\W|^)(rhee+t\!*)(?:\s|$)/i, insertRheet); munger.addRule ("word-hyphenator", new RegExp ("(\\S{" + client.MAX_WORD_DISPLAY + ",})"), insertHyphenatedWord); client.enableColors = client.prefs["munger.colorCodes"]; for (var entry in client.munger.entries) { var branch = client.prefManager.prefBranch; if (entry[0] != ".") { try { munger.entries[entry].enabled = branch.getBoolPref("munger." + entry); } catch (ex) { // nada } } }}
this.showItem( "context-reload", !this.inFrame ); this.showItem( "context-reload-frame", this.inFrame );
initNavigationItems : function () { // Back determined by canGoBack broadcaster. this.setItemAttrFromNode( "context-back", "disabled", "canGoBack" ); // Forward determined by canGoForward broadcaster. this.setItemAttrFromNode( "context-forward", "disabled", "canGoForward" ); // Reload is always OK. // Stop determined by canStop broadcaster. this.setItemAttrFromNode( "context-stop", "disabled", "canStop" ); },
client.addNetwork("moznet",[{name: "irc.mozilla.org", port: 6667}]);
client.addNetwork("moznet", [{name: "irc.mozilla.org", port:6667}, {name: "irc.mozilla.org", port:6697, isSecure:true}]);
function initNetworks(){ client.addNetwork("moznet",[{name: "irc.mozilla.org", port: 6667}]); client.addNetwork("hybridnet", [{name: "irc.ssc.net", port: 6667}]); client.addNetwork("slashnet", [{name: "irc.slashnet.org", port:6667}]); client.addNetwork("dalnet", [{name: "irc.dal.net", port:6667}]); client.addNetwork("undernet", [{name: "irc.undernet.org", port:6667}]); client.addNetwork("webbnet", [{name: "irc.webbnet.info", port:6667}]); client.addNetwork("quakenet", [{name: "irc.quakenet.org", port:6667}]); client.addNetwork("freenode", [{name: "irc.freenode.net", port:6667}]); client.addNetwork("serenia", [{name: "chat.serenia.net", port:9999, isSecure:true}]); client.addNetwork("efnet", [{name: "irc.prison.net", port: 6667}, {name: "irc.magic.ca", port: 6667}]);}
menuItem.setAttribute("value", menuStr);
menuItem.setAttribute("label", menuStr);
function InitObjectPropertiesMenuitem(id){ // Set strings and enable for the [Object] Properties item // Note that we directly do the enabling instead of // using goSetCommandEnabled since we already have the menuitem var menuItem = document.getElementById(id); if (!menuItem) return null; var element = GetObjectForProperties(); var menuStr = GetString("ObjectProperties"); var name; if (element && element.nodeName) { var objStr = ""; menuItem.setAttribute("disabled", ""); name = element.nodeName.toLowerCase(); switch (name) { case "img": objStr = GetString("Image"); break; case "hr": objStr = GetString("HLine"); break; case "table": objStr = GetString("Table"); break; case "th": name = "td"; case "td": objStr = GetString("TableCell"); break; case "ol": case "ul": case "dl": objStr = GetString("List"); break; case "a": if (element.name) { objStr = GetString("NamedAnchor"); name = "anchor"; } else if(element.href) { objStr = GetString("Link"); name = "href"; } break; } menuStr = menuStr.replace(/%obj%/,objStr); } else { // We show generic "Properties" string, but disable menu item menuItem.setAttribute("disabled","true"); // Replace placeholder with "", then remaining space on left side menuStr = menuStr.replace(/%obj%/,"").replace(/^\s+/, ""); } menuItem.setAttribute("value", menuStr); menuItem.setAttribute("accesskey",GetString("ObjectPropertiesAccessKey")); return name;}
console.sourceView.atomPrettyPrint = atomsvc.getAtom("prettyprint");
function initOutliners(){ const ATOM_CTRID = "@mozilla.org/atom-service;1"; const nsIAtomService = Components.interfaces.nsIAtomService; var atomsvc = Components.classes[ATOM_CTRID].getService(nsIAtomService); console.sourceView.atomCurrent = atomsvc.getAtom("current-line"); console.sourceView.atomHighlightStart = atomsvc.getAtom("highlight-start"); console.sourceView.atomHighlightRange = atomsvc.getAtom("highlight-range"); console.sourceView.atomHighlightEnd = atomsvc.getAtom("highlight-end"); console.sourceView.atomBreakpoint = atomsvc.getAtom("breakpoint"); console.sourceView.atomCode = atomsvc.getAtom("code"); console.sourceView.atomWhitespace = atomsvc.getAtom("whitespace"); var outliner = document.getElementById("source-outliner"); outliner.outlinerBoxObject.view = console.sourceView; console.scriptsView.childData.setSortColumn("baseLineNumber"); console.scriptsView.groupFiles = true; console.scriptsView.atomUnknown = atomsvc.getAtom("ft-unk"); console.scriptsView.atomHTML = atomsvc.getAtom("ft-html"); console.scriptsView.atomJS = atomsvc.getAtom("ft-js"); console.scriptsView.atomXUL = atomsvc.getAtom("ft-xul"); console.scriptsView.atomXML = atomsvc.getAtom("ft-xml"); console.scriptsView.atomGuessed = atomsvc.getAtom("fn-guessed"); console.scriptsView.atomBreakpoint = atomsvc.getAtom("has-bp"); outliner = document.getElementById("script-list-outliner"); outliner.outlinerBoxObject.view = console.scriptsView; outliner.setAttribute ("ondraggesture", "nsDragAndDrop.startDrag(event, " + "console.scriptsView);"); outliner = document.getElementById("stack-outliner"); outliner.outlinerBoxObject.view = console.stackView; console.stackView.atomStack = atomsvc.getAtom("w-stack"); console.stackView.atomFrame = atomsvc.getAtom("w-frame"); console.stackView.atomVoid = atomsvc.getAtom("w-void"); console.stackView.atomNull = atomsvc.getAtom("w-null"); console.stackView.atomBool = atomsvc.getAtom("w-bool"); console.stackView.atomInt = atomsvc.getAtom("w-int"); console.stackView.atomDouble = atomsvc.getAtom("w-double"); console.stackView.atomString = atomsvc.getAtom("w-string"); console.stackView.atomFunction = atomsvc.getAtom("w-function"); console.stackView.atomObject = atomsvc.getAtom("w-object"); console.stackView.stack.property = console.stackView.atomStack; console.stackView.stack.reserveChildren(); console.stackView.childData.appendChild (console.stackView.stack); console.stackView.stack.hide(); outliner = document.getElementById("project-outliner"); outliner.outlinerBoxObject.view = console.projectView; console.projectView.atomBlacklist = atomsvc.getAtom("pj-blacklist"); console.projectView.atomBLItem = atomsvc.getAtom("pj-bl-item"); console.projectView.atomBreakpoints = atomsvc.getAtom("pj-breakpoints"); console.projectView.atomBreakpoint = atomsvc.getAtom("pj-breakpoint"); console.blacklist.property = console.projectView.atomBlacklist; console.blacklist.reserveChildren(); //console.projectView.childData.appendChild (console.blacklist); console.breakpoints.property = console.projectView.atomBreakpoints; console.breakpoints.reserveChildren(); console.projectView.childData.appendChild (console.breakpoints); BPRecord.prototype.property = console.projectView.atomBreakpoint; BLRecord.prototype.property = console.projectView.atomBLItem; }
BLRecord.prototype.property = console.projectView.atomBLItem; var enumerator = console.windowWatcher.getWindowEnumerator(); while (enumerator.hasMoreElements()) { var win = enumerator.getNext(); console.windows.appendChild (new WindowRecord(win)); }
BLRecord.prototype.property = console.projectView.atomBLItem;
function initOutliners(){ const ATOM_CTRID = "@mozilla.org/atom-service;1"; const nsIAtomService = Components.interfaces.nsIAtomService; var atomsvc = Components.classes[ATOM_CTRID].getService(nsIAtomService); console.sourceView.atomCurrent = atomsvc.getAtom("current-line"); console.sourceView.atomHighlightStart = atomsvc.getAtom("highlight-start"); console.sourceView.atomHighlightRange = atomsvc.getAtom("highlight-range"); console.sourceView.atomHighlightEnd = atomsvc.getAtom("highlight-end"); console.sourceView.atomBreakpoint = atomsvc.getAtom("breakpoint"); console.sourceView.atomFBreakpoint = atomsvc.getAtom("future-breakpoint"); console.sourceView.atomCode = atomsvc.getAtom("code"); console.sourceView.atomPrettyPrint = atomsvc.getAtom("prettyprint"); console.sourceView.atomWhitespace = atomsvc.getAtom("whitespace"); var outliner = document.getElementById("source-outliner"); outliner.outlinerBoxObject.view = console.sourceView; console.scriptsView.childData.setSortColumn("baseLineNumber"); console.scriptsView.groupFiles = true; console.scriptsView.atomUnknown = atomsvc.getAtom("ft-unk"); console.scriptsView.atomHTML = atomsvc.getAtom("ft-html"); console.scriptsView.atomJS = atomsvc.getAtom("ft-js"); console.scriptsView.atomXUL = atomsvc.getAtom("ft-xul"); console.scriptsView.atomXML = atomsvc.getAtom("ft-xml"); console.scriptsView.atomGuessed = atomsvc.getAtom("fn-guessed"); console.scriptsView.atomBreakpoint = atomsvc.getAtom("has-bp"); outliner = document.getElementById("script-list-outliner"); outliner.outlinerBoxObject.view = console.scriptsView; outliner.setAttribute ("ondraggesture", "nsDragAndDrop.startDrag(event, " + "console.scriptsView);"); outliner = document.getElementById("stack-outliner"); outliner.outlinerBoxObject.view = console.stackView; console.stackView.atomStack = atomsvc.getAtom("w-stack"); console.stackView.atomFrame = atomsvc.getAtom("w-frame"); console.stackView.atomVoid = atomsvc.getAtom("w-void"); console.stackView.atomNull = atomsvc.getAtom("w-null"); console.stackView.atomBool = atomsvc.getAtom("w-bool"); console.stackView.atomInt = atomsvc.getAtom("w-int"); console.stackView.atomDouble = atomsvc.getAtom("w-double"); console.stackView.atomString = atomsvc.getAtom("w-string"); console.stackView.atomFunction = atomsvc.getAtom("w-function"); console.stackView.atomObject = atomsvc.getAtom("w-object"); console.stackView.stack.property = console.stackView.atomStack; console.stackView.stack.reserveChildren(); console.stackView.childData.appendChild (console.stackView.stack); console.stackView.stack.hide(); outliner = document.getElementById("project-outliner"); outliner.outlinerBoxObject.view = console.projectView; console.projectView.atomBlacklist = atomsvc.getAtom("pj-blacklist"); console.projectView.atomBLItem = atomsvc.getAtom("pj-bl-item"); console.projectView.atomWindows = atomsvc.getAtom("pj-windows"); console.projectView.atomWindow = atomsvc.getAtom("pj-window"); console.projectView.atomFiles = atomsvc.getAtom("pj-files"); console.projectView.atomFile = atomsvc.getAtom("pj-file"); console.projectView.atomBreakpoints = atomsvc.getAtom("pj-breakpoints"); console.projectView.atomBreakpoint = atomsvc.getAtom("pj-breakpoint"); console.blacklist.property = console.projectView.atomBlacklist; console.blacklist.reserveChildren(); //console.projectView.childData.appendChild (console.blacklist); console.windows.property = console.projectView.atomWindows; console.windows.reserveChildren(); console.projectView.childData.appendChild (console.windows); console.breakpoints.property = console.projectView.atomBreakpoints; console.breakpoints.reserveChildren(); console.projectView.childData.appendChild (console.breakpoints); WindowRecord.prototype.property = console.projectView.atomWindow; FileContainerRecord.prototype.property = console.projectView.atomFiles; FileRecord.prototype.property = console.projectView.atomFile; BPRecord.prototype.property = console.projectView.atomBreakpoint; BLRecord.prototype.property = console.projectView.atomBLItem; var enumerator = console.windowWatcher.getWindowEnumerator(); while (enumerator.hasMoreElements()) { var win = enumerator.getNext(); console.windows.appendChild (new WindowRecord(win)); } }
function InitPixelOrPercentCombobox(element, attribute, selectID)
function InitPixelOrPercentCombobox(elementForAtt, attribute, selectID)
function InitPixelOrPercentCombobox(element, attribute, selectID){ size = element.getAttribute(attribute); select = document.getElementById(selectID); if (select) { ClearList(select); AppendStringToList(select,GetString("Pixels")); AppendStringToList(select,GetAppropriatePercentString()); } // Search for a "%" character percentIndex = size.search(/%/); if (percentIndex > 0) { // Strip out the % size = size.substr(0, percentIndex); if (select) select.selectedIndex = 1; } else { if (select) select.selectedIndex = 0; } return size;}
size = element.getAttribute(attribute);
size = elementForAtt.getAttribute(attribute);
function InitPixelOrPercentCombobox(element, attribute, selectID){ size = element.getAttribute(attribute); select = document.getElementById(selectID); if (select) { ClearList(select); AppendStringToList(select,GetString("Pixels")); AppendStringToList(select,GetAppropriatePercentString()); } // Search for a "%" character percentIndex = size.search(/%/); if (percentIndex > 0) { // Strip out the % size = size.substr(0, percentIndex); if (select) select.selectedIndex = 1; } else { if (select) select.selectedIndex = 0; } return size;}
AppendStringToList(select,GetAppropriatePercentString());
AppendStringToList(select,GetAppropriatePercentString(elementForAtt,window.editorShell.editorSelection.anchorNode));
function InitPixelOrPercentCombobox(element, attribute, selectID){ size = element.getAttribute(attribute); select = document.getElementById(selectID); if (select) { ClearList(select); AppendStringToList(select,GetString("Pixels")); AppendStringToList(select,GetAppropriatePercentString()); } // Search for a "%" character percentIndex = size.search(/%/); if (percentIndex > 0) { // Strip out the % size = size.substr(0, percentIndex); if (select) select.selectedIndex = 1; } else { if (select) select.selectedIndex = 0; } return size;}
function InitPixelOrPercentMenulist(elementForAtt, elementInDoc, attribute, menulistID)
function InitPixelOrPercentMenulist(elementForAtt, elementInDoc, attribute, menulistID, defaultIndex)
function InitPixelOrPercentMenulist(elementForAtt, elementInDoc, attribute, menulistID){ var size = elementForAtt.getAttribute(attribute); var menulist = document.getElementById(menulistID); var pixelItem; var percentItem; if (!menulist) { dump("NO MENULIST found for ID="+menulistID+"\n"); return size; } ClearMenulist(menulist); pixelItem = AppendStringToMenulist(menulist, GetString("Pixels")); percentItem = AppendStringToMenulist(menulist, GetAppropriatePercentString(elementForAtt, elementInDoc));//dump("**** InitPixelOrPercentMenulist: pixelItem="+pixelItem+", percentItem="+percentItem+", menulistID="+menulistID+"\n"); // Search for a "%" character percentIndex = size.search(/%/); if (percentIndex > 0) { // Strip out the % size = size.substr(0, percentIndex); if (percentItem) menulist.selectedItem = percentItem; } else if(pixelItem) menulist.selectedItem = pixelItem; return size;}
percentIndex = size.search(/%/); if (percentIndex > 0)
if (size && size.length > 0)
function InitPixelOrPercentMenulist(elementForAtt, elementInDoc, attribute, menulistID){ var size = elementForAtt.getAttribute(attribute); var menulist = document.getElementById(menulistID); var pixelItem; var percentItem; if (!menulist) { dump("NO MENULIST found for ID="+menulistID+"\n"); return size; } ClearMenulist(menulist); pixelItem = AppendStringToMenulist(menulist, GetString("Pixels")); percentItem = AppendStringToMenulist(menulist, GetAppropriatePercentString(elementForAtt, elementInDoc));//dump("**** InitPixelOrPercentMenulist: pixelItem="+pixelItem+", percentItem="+percentItem+", menulistID="+menulistID+"\n"); // Search for a "%" character percentIndex = size.search(/%/); if (percentIndex > 0) { // Strip out the % size = size.substr(0, percentIndex); if (percentItem) menulist.selectedItem = percentItem; } else if(pixelItem) menulist.selectedItem = pixelItem; return size;}
size = size.substr(0, percentIndex); if (percentItem) menulist.selectedItem = percentItem; } else if(pixelItem) menulist.selectedItem = pixelItem;
percentIndex = size.search(/%/); if (percentIndex > 0) { size = size.substr(0, percentIndex); if (percentItem) menulist.selectedItem = percentItem; } else menulist.selectedItem = pixelItem; } else menulist.selectedIndex = defaultIndex;
function InitPixelOrPercentMenulist(elementForAtt, elementInDoc, attribute, menulistID){ var size = elementForAtt.getAttribute(attribute); var menulist = document.getElementById(menulistID); var pixelItem; var percentItem; if (!menulist) { dump("NO MENULIST found for ID="+menulistID+"\n"); return size; } ClearMenulist(menulist); pixelItem = AppendStringToMenulist(menulist, GetString("Pixels")); percentItem = AppendStringToMenulist(menulist, GetAppropriatePercentString(elementForAtt, elementInDoc));//dump("**** InitPixelOrPercentMenulist: pixelItem="+pixelItem+", percentItem="+percentItem+", menulistID="+menulistID+"\n"); // Search for a "%" character percentIndex = size.search(/%/); if (percentIndex > 0) { // Strip out the % size = size.substr(0, percentIndex); if (percentItem) menulist.selectedItem = percentItem; } else if(pixelItem) menulist.selectedItem = pixelItem; return size;}
pixelItem = menulist.appendItem(GetString("Pixels"));
pixelItem = AppendStringToMenulist(menulist, GetString("Pixels"));
function InitPixelOrPercentMenulist(elementForAtt, elementInDoc, attribute, menulistID, defaultIndex){ if (!defaultIndex) defaultIndex = gPixel; // var size = elementForAtt.getAttribute(attribute); var size = GetHTMLOrCSSStyleValue(elementForAtt, attribute, attribute) var menulist = document.getElementById(menulistID); var pixelItem; var percentItem; if (!menulist) { dump("NO MENULIST found for ID="+menulistID+"\n"); return size; } ClearMenulist(menulist); pixelItem = menulist.appendItem(GetString("Pixels")); if (!pixelItem) return 0; percentItem = menulist.appendItem(GetAppropriatePercentString(elementForAtt, elementInDoc)); if (size && size.length > 0) { // Search for a "%" or "px" if (/%/.test(size)) { // Strip out the % size = RegExp.leftContext; if (percentItem) menulist.selectedItem = percentItem; } else { if (/px/.test(size)) // Strip out the px size = RegExp.leftContext; menulist.selectedItem = pixelItem; } } else menulist.selectedIndex = defaultIndex; return size;}
percentItem = menulist.appendItem(GetAppropriatePercentString(elementForAtt, elementInDoc));
percentItem = AppendStringToMenulist(menulist, GetAppropriatePercentString(elementForAtt, elementInDoc));
function InitPixelOrPercentMenulist(elementForAtt, elementInDoc, attribute, menulistID, defaultIndex){ if (!defaultIndex) defaultIndex = gPixel; // var size = elementForAtt.getAttribute(attribute); var size = GetHTMLOrCSSStyleValue(elementForAtt, attribute, attribute) var menulist = document.getElementById(menulistID); var pixelItem; var percentItem; if (!menulist) { dump("NO MENULIST found for ID="+menulistID+"\n"); return size; } ClearMenulist(menulist); pixelItem = menulist.appendItem(GetString("Pixels")); if (!pixelItem) return 0; percentItem = menulist.appendItem(GetAppropriatePercentString(elementForAtt, elementInDoc)); if (size && size.length > 0) { // Search for a "%" or "px" if (/%/.test(size)) { // Strip out the % size = RegExp.leftContext; if (percentItem) menulist.selectedItem = percentItem; } else { if (/px/.test(size)) // Strip out the px size = RegExp.leftContext; menulist.selectedItem = pixelItem; } } else menulist.selectedIndex = defaultIndex; return size;}
btn.setAttribute("value",GetAppropriatePercentString());
btn.setAttribute("value",GetAppropriatePercentString(element));
function InitPixelOrPercentPopupButton(element, attribute, buttonID){ size = element.getAttribute(attribute); btn = document.getElementById(buttonID); // Search for a "%" character percentIndex = size.search(/%/); if (percentIndex > 0) { percentChar = "%"; // Strip out the % size = size.substr(0, percentIndex); if (btn) btn.setAttribute("value",GetAppropriatePercentString()); } else { if (btn) btn.setAttribute("value",GetString("Pixels")); } return size;}
btn.setAttribute("value","percent");
btn.setAttribute("value",GetAppropriatePercentString());
function InitPixelOrPercentPopupButton(element, attribute, buttonID){ size = element.getAttribute(attribute); btn = document.getElementById(buttonID); // Search for a "%" character percentIndex = size.search(/%/); if (percentIndex > 0) { percentChar = "%"; // Strip out the % size = size.substr(0, percentIndex); // TODO: USE ENTITIES FOR TEXT VALUES if (btn) btn.setAttribute("value","percent"); } else { if (btn) btn.setAttribute("value","pixels"); } return size;}
btn.setAttribute("value","pixels");
btn.setAttribute("value",GetString("Pixels"));
function InitPixelOrPercentPopupButton(element, attribute, buttonID){ size = element.getAttribute(attribute); btn = document.getElementById(buttonID); // Search for a "%" character percentIndex = size.search(/%/); if (percentIndex > 0) { percentChar = "%"; // Strip out the % size = size.substr(0, percentIndex); // TODO: USE ENTITIES FOR TEXT VALUES if (btn) btn.setAttribute("value","percent"); } else { if (btn) btn.setAttribute("value","pixels"); } return size;}
return;
initPopupURL: function() { // quick check: if no opener, it can't be a popup if (!window.content.opener) return; try { var show = false; // is it a popup window? const CI = Components.interfaces; var xulwin = window .QueryInterface(CI.nsIInterfaceRequestor) .getInterface(CI.nsIWebNavigation) .QueryInterface(CI.nsIDocShellTreeItem) .treeOwner .QueryInterface(CI.nsIInterfaceRequestor) .getInterface(CI.nsIXULWindow); if (xulwin.contextFlags & CI.nsIWindowCreator2.PARENT_IS_LOADING_OR_RUNNING_TIMEOUT) { // do the pref settings allow site-by-site popup management? const PB = Components.classes["@mozilla.org/preferences-service;1"] .getService(CI.nsIPrefBranch); show = !PB.getBoolPref("dom.disable_open_during_load") && PB.getIntPref("privacy.popups.policy") == CI.nsIPopupWindowManager.ALLOW_POPUP && PB.getBoolPref("privacy.popups.usecustom"); } if (show) { // initialize popupURL const IOS = Components.classes["@mozilla.org/network/io-service;1"] .getService(CI.nsIIOService); var spec = Components.lookupMethod(window.content.opener, "location") .call(); this.popupURL = IOS.newURI(spec, null, null); // but cancel if it's an unsuitable URL const PM = Components.classes["@mozilla.org/PopupWindowManager;1"] .getService(CI.nsIPopupWindowManager); if (!PM.testSuitability(this.popupURL)) this.popupURL = null; } } catch(e) { } },
console.addPref ("profile.template.html", "chrome: console.addPref ("profile.ranges", "1000000, 5000, 2500, 1000, 750, 500, 250, 100, 75, 50, " + "25, 10, 7.5, 5, 2.5, 1, 0.75, 0.5, 0.25");
function initPrefs(){ console.prefs = new Object(); console.prefs.prefService = Components.classes[PREF_CTRID].getService(nsIPrefService); console.prefs.prefBranch = console.prefs.prefService.getBranch("extensions.venkman."); console.prefs.prefNames = new Array(); // console.addPref ("input.commandchar", "/"); console.addPref ("enableChromeFilter", false); console.addPref ("sourcetext.tab.width", 4); console.addPref ("input.history.max", 20); console.addPref ("input.dtab.time", 500); console.addPref ("initialScripts", ""); var list = console.prefs.prefBranch.getChildList("extensions.venkman.", {}); for (var p in list) { dd ("pref list " + list[p]); if (!(list[p] in console.prefs)) console.addPref(list[p]); } }
["toggle-ecmas", "show-ecma toggle", 0]
["toggle-ecmas", "show-ecma toggle", 0], ["toggle-constants", "show-constants toggle", 0]
function initRecords(){ var cmdary = [/* "real" commands */ ["show-functions", cmdShowFunctions, CMD_CONSOLE], ["show-ecmas", cmdShowECMAs, CMD_CONSOLE], /* aliases */ ["toggle-functions", "show-functions toggle", 0], ["toggle-ecmas", "show-ecma toggle", 0] ]; console.commandManager.defineCommands (cmdary); var atomsvc = console.atomService; WindowRecord.prototype.property = atomsvc.getAtom("item-window"); FileContainerRecord.prototype.property = atomsvc.getAtom("item-files"); FileRecord.prototype.property = atomsvc.getAtom("item-file"); FrameRecord.prototype.property = atomsvc.getAtom("item-frame"); FrameRecord.prototype.atomCurrent = atomsvc.getAtom("current-frame-flag"); ScriptInstanceRecord.prototype.atomUnknown = atomsvc.getAtom("item-unk"); ScriptInstanceRecord.prototype.atomHTML = atomsvc.getAtom("item-html"); ScriptInstanceRecord.prototype.atomJS = atomsvc.getAtom("item-js"); ScriptInstanceRecord.prototype.atomXUL = atomsvc.getAtom("item-xul"); ScriptInstanceRecord.prototype.atomXML = atomsvc.getAtom("item-xml"); ScriptInstanceRecord.prototype.atomDisabled = atomsvc.getAtom("script-disabled"); ScriptRecord.prototype.atomFunction = atomsvc.getAtom("file-function"); ScriptRecord.prototype.atomBreakpoint = atomsvc.getAtom("item-has-bp"); ScriptRecord.prototype.atomDisabled = atomsvc.getAtom("script-disabled"); var prefs = [ ["valueRecord.showFunctions", false], ["valueRecord.showECMAProps", false], ["valueRecord.brokenObjects", "^JavaPackage$"] ]; console.prefManager.addPrefs(prefs); try { ValueRecord.prototype.brokenObjects = new RegExp (console.prefs["valueRecord.brokenObjects"]); } catch (ex) { display (MSN_ERR_INVALID_PREF, ["valueRecord.brokenObjects", console.prefs["valueRecord.brokenObjects"]], MT_ERROR); display (formatException(ex), MT_ERROR); ValueRecord.prototype.brokenObjects = /^JavaPackage$/; } ValueRecord.prototype.atomVoid = atomsvc.getAtom("item-void"); ValueRecord.prototype.atomNull = atomsvc.getAtom("item-null"); ValueRecord.prototype.atomBool = atomsvc.getAtom("item-bool"); ValueRecord.prototype.atomInt = atomsvc.getAtom("item-int"); ValueRecord.prototype.atomDouble = atomsvc.getAtom("item-double"); ValueRecord.prototype.atomString = atomsvc.getAtom("item-string"); ValueRecord.prototype.atomFunction = atomsvc.getAtom("item-function"); ValueRecord.prototype.atomObject = atomsvc.getAtom("item-object"); ValueRecord.prototype.atomError = atomsvc.getAtom("item-error"); ValueRecord.prototype.atomException = atomsvc.getAtom("item-exception"); ValueRecord.prototype.atomHinted = atomsvc.getAtom("item-hinted");}
["valueRecord.showConstants", false],
function initRecords(){ var cmdary = [/* "real" commands */ ["show-functions", cmdShowFunctions, CMD_CONSOLE], ["show-ecmas", cmdShowECMAs, CMD_CONSOLE], /* aliases */ ["toggle-functions", "show-functions toggle", 0], ["toggle-ecmas", "show-ecma toggle", 0] ]; console.commandManager.defineCommands (cmdary); var atomsvc = console.atomService; WindowRecord.prototype.property = atomsvc.getAtom("item-window"); FileContainerRecord.prototype.property = atomsvc.getAtom("item-files"); FileRecord.prototype.property = atomsvc.getAtom("item-file"); FrameRecord.prototype.property = atomsvc.getAtom("item-frame"); FrameRecord.prototype.atomCurrent = atomsvc.getAtom("current-frame-flag"); ScriptInstanceRecord.prototype.atomUnknown = atomsvc.getAtom("item-unk"); ScriptInstanceRecord.prototype.atomHTML = atomsvc.getAtom("item-html"); ScriptInstanceRecord.prototype.atomJS = atomsvc.getAtom("item-js"); ScriptInstanceRecord.prototype.atomXUL = atomsvc.getAtom("item-xul"); ScriptInstanceRecord.prototype.atomXML = atomsvc.getAtom("item-xml"); ScriptInstanceRecord.prototype.atomDisabled = atomsvc.getAtom("script-disabled"); ScriptRecord.prototype.atomFunction = atomsvc.getAtom("file-function"); ScriptRecord.prototype.atomBreakpoint = atomsvc.getAtom("item-has-bp"); ScriptRecord.prototype.atomDisabled = atomsvc.getAtom("script-disabled"); var prefs = [ ["valueRecord.showFunctions", false], ["valueRecord.showECMAProps", false], ["valueRecord.brokenObjects", "^JavaPackage$"] ]; console.prefManager.addPrefs(prefs); try { ValueRecord.prototype.brokenObjects = new RegExp (console.prefs["valueRecord.brokenObjects"]); } catch (ex) { display (MSN_ERR_INVALID_PREF, ["valueRecord.brokenObjects", console.prefs["valueRecord.brokenObjects"]], MT_ERROR); display (formatException(ex), MT_ERROR); ValueRecord.prototype.brokenObjects = /^JavaPackage$/; } ValueRecord.prototype.atomVoid = atomsvc.getAtom("item-void"); ValueRecord.prototype.atomNull = atomsvc.getAtom("item-null"); ValueRecord.prototype.atomBool = atomsvc.getAtom("item-bool"); ValueRecord.prototype.atomInt = atomsvc.getAtom("item-int"); ValueRecord.prototype.atomDouble = atomsvc.getAtom("item-double"); ValueRecord.prototype.atomString = atomsvc.getAtom("item-string"); ValueRecord.prototype.atomFunction = atomsvc.getAtom("item-function"); ValueRecord.prototype.atomObject = atomsvc.getAtom("item-object"); ValueRecord.prototype.atomError = atomsvc.getAtom("item-error"); ValueRecord.prototype.atomException = atomsvc.getAtom("item-exception"); ValueRecord.prototype.atomHinted = atomsvc.getAtom("item-hinted");}
console.addPref ("valueRecord.showFunctions", false); console.addPref ("valueRecord.showECMAProps", false);
function initRecords(){ var atomsvc = console.atomService; WindowRecord.prototype.property = atomsvc.getAtom("item-window"); FileContainerRecord.prototype.property = atomsvc.getAtom("item-files"); FileRecord.prototype.property = atomsvc.getAtom("item-file"); FrameRecord.prototype.property = atomsvc.getAtom("item-frame"); FrameRecord.prototype.atomCurrent = atomsvc.getAtom("current-frame-flag"); console.addPref ("valueRecord.brokenObjects", "^JavaPackage$"); try { ValueRecord.prototype.brokenObjects = new RegExp (console.prefs["valueRecord.brokenObjects"]); } catch (ex) { display (MSN_ERR_INVALID_PREF, ["valueRecord.brokenObjects", console.prefs["valueRecord.brokenObjects"]], MT_ERROR); display (formatException(ex), MT_ERROR); ValueRecord.prototype.brokenObjects = /^JavaPackage$/; } ValueRecord.prototype.atomVoid = atomsvc.getAtom("item-void"); ValueRecord.prototype.atomNull = atomsvc.getAtom("item-null"); ValueRecord.prototype.atomBool = atomsvc.getAtom("item-bool"); ValueRecord.prototype.atomInt = atomsvc.getAtom("item-int"); ValueRecord.prototype.atomDouble = atomsvc.getAtom("item-double"); ValueRecord.prototype.atomString = atomsvc.getAtom("item-string"); ValueRecord.prototype.atomFunction = atomsvc.getAtom("item-function"); ValueRecord.prototype.atomObject = atomsvc.getAtom("item-object"); ValueRecord.prototype.atomError = atomsvc.getAtom("item-error"); ValueRecord.prototype.atomException = atomsvc.getAtom("item-exception"); ValueRecord.prototype.atomHinted = atomsvc.getAtom("item-hinted");}
stylesItem.setAttribute("value", isCollapsed ? GetString("StopTextStyles") : GetString("RemoveTextStyles"));
stylesItem.setAttribute("label", isCollapsed ? GetString("StopTextStyles") : GetString("RemoveTextStyles"));
function InitRemoveStylesMenuitems(removeStylesId, removeLinksId){ // Change wording of menuitems depending on selection var stylesItem = document.getElementById(removeStylesId); var linkItem = document.getElementById(removeLinksId); var isCollapsed = editorShell.editorSelection.isCollapsed; if (stylesItem) { stylesItem.setAttribute("value", isCollapsed ? GetString("StopTextStyles") : GetString("RemoveTextStyles")); stylesItem.setAttribute("accesskey", GetString("RemoveTextStylesAccesskey")); } if (linkItem) { linkItem.setAttribute("value", isCollapsed ? GetString("StopLinks") : GetString("RemoveLinks")); linkItem.setAttribute("accesskey", GetString("RemoveLinksAccesskey")); // Note: disabling text style is a pain since there are so many - forget it! // Disable if not in a link, but always allow "Remove" // if selection isn't collapsed since we only look at anchor node DisableItem(removeLinksId, isCollapsed && !window.editorShell.GetElementOrParentByTagName("href", null)); }}
linkItem.setAttribute("value", isCollapsed ? GetString("StopLinks") : GetString("RemoveLinks"));
linkItem.setAttribute("label", isCollapsed ? GetString("StopLinks") : GetString("RemoveLinks"));
function InitRemoveStylesMenuitems(removeStylesId, removeLinksId){ // Change wording of menuitems depending on selection var stylesItem = document.getElementById(removeStylesId); var linkItem = document.getElementById(removeLinksId); var isCollapsed = editorShell.editorSelection.isCollapsed; if (stylesItem) { stylesItem.setAttribute("value", isCollapsed ? GetString("StopTextStyles") : GetString("RemoveTextStyles")); stylesItem.setAttribute("accesskey", GetString("RemoveTextStylesAccesskey")); } if (linkItem) { linkItem.setAttribute("value", isCollapsed ? GetString("StopLinks") : GetString("RemoveLinks")); linkItem.setAttribute("accesskey", GetString("RemoveLinksAccesskey")); // Note: disabling text style is a pain since there are so many - forget it! // Disable if not in a link, but always allow "Remove" // if selection isn't collapsed since we only look at anchor node DisableItem(removeLinksId, isCollapsed && !window.editorShell.GetElementOrParentByTagName("href", null)); }}
saveImageMenuItem.setAttribute( "value", caption );
saveImageMenuItem.setAttribute( "label", caption );
initSaveItems : function () { // Save page is always OK, unless in directory listing. this.showItem( "context-savepage", !this.inDirList ); // Save frame as depends on whether we're in a frame. this.showItem( "context-saveframe", this.inFrame ); // Save link depends on whether we're in a link. this.showItem( "context-savelink", this.onSaveableLink ); // Save background image depends on whether there is one. this.showItem( "context-savebgimage", this.hasBGImage ); // Save image depends on whether there is one. this.showItem( "context-saveimage", this.onImage ); if (this.onImage){ //if onImage, let's get the imagename into the context menu var saveImageMenuItem = document.getElementById( 'context-saveimage' ); var imageName = extractFileNameFromUrl(this.imageURL); var bundle = srGetStrBundle("chrome://communicator/locale/contentAreaCommands.properties"); var caption = bundle.formatStringFromName("saveImageAs",[imageName],1); saveImageMenuItem.setAttribute( "value", caption ); } // Remove separator if none of these were shown. var showSep = !this.inDirList || this.inFrame || this.onSaveableLink || this.hasBGImage || this.onImage; this.showItem( "context-sep-save", showSep ); },
this.showItem( "context-savepage", !( this.inDirList || this.isTextSelected || this.onTextInput ) && !( this.onLink && this.onImage ) );
this.showItem( "context-savepage", !( this.inDirList || this.isTextSelected || this.onTextInput || this.onStandaloneImage || (this.onLink && this.onImage)));
initSaveItems : function () { this.showItem( "context-savepage", !( this.inDirList || this.isTextSelected || this.onTextInput ) && !( this.onLink && this.onImage ) ); // Save link depends on whether we're in a link. this.showItem( "context-savelink", this.onSaveableLink ); // Save image depends on whether there is one. this.showItem( "context-saveimage", this.onImage ); this.showItem( "context-sendimage", this.onImage ); },
this.showItem( "context-saveimage", this.onImage );
this.showItem( "context-saveimage", this.onImage || this.onStandaloneImage);
initSaveItems : function () { this.showItem( "context-savepage", !( this.inDirList || this.isTextSelected || this.onTextInput ) && !( this.onLink && this.onImage ) ); // Save link depends on whether we're in a link. this.showItem( "context-savelink", this.onSaveableLink ); // Save image depends on whether there is one. this.showItem( "context-saveimage", this.onImage ); this.showItem( "context-sendimage", this.onImage ); },
this.showItem( "context-sendimage", this.onImage );
this.showItem( "context-sendimage", this.onImage || this.onStandaloneImage);
initSaveItems : function () { this.showItem( "context-savepage", !( this.inDirList || this.isTextSelected || this.onTextInput ) && !( this.onLink && this.onImage ) ); // Save link depends on whether we're in a link. this.showItem( "context-savelink", this.onSaveableLink ); // Save image depends on whether there is one. this.showItem( "context-saveimage", this.onImage ); this.showItem( "context-sendimage", this.onImage ); },
var stringBundle = document.getElementById("bundle_messenger"); var verboseName = stringBundle.getString(propertyName);
var messengerBundle = document.getElementById("bundle_messenger"); var verboseName = messengerBundle.getString(propertyName);
function initServerType() { var serverType = document.getElementById("server.type").getAttribute("value"); var propertyName = "serverType-" + serverType; var stringBundle = document.getElementById("bundle_messenger"); var verboseName = stringBundle.getString(propertyName); setDivText("servertype.verbose", verboseName);}
if (index != undefined) { var deck = document.getElementById("serverdeck"); deck.setAttribute("index", index); }
function initServerType() { var serverType = document.getElementById("server.type").value; var verboseName; var index; if (serverType == "pop3") { verboseName = "POP Mail Server"; index = 0; } else if (serverType == "imap") { verboseName = "IMAP Mail Server"; index = 1; } else if (serverType == "nntp") { verboseName = "Newsgroup server (NNTP)"; index = 2; } else if (serverType == "none") { verboseName = "Local Mail store"; index = 3; } if (index != undefined) { var deck = document.getElementById("serverdeck"); deck.setAttribute("index", index); } var hostname = document.getElementById("server.hostName").value; var username = document.getElementById("server.username").value; setDivText("servertype.verbose", verboseName); setDivText("servername.verbose", hostname); setDivText("username.verbose", username);}
var isSecureSelected = document.getElementById("server.isSecure").checked; var protocolInfo = Components.classes["@mozilla.org/messenger/protocol/info;1?type=" + serverType].getService(Components.interfaces.nsIMsgProtocolInfo); document.getElementById("defaultPort").value = protocolInfo.getDefaultServerPort(isSecureSelected);
function initServerType() { var serverType = document.getElementById("server.type").getAttribute("value"); var propertyName = "serverType-" + serverType; var messengerBundle = document.getElementById("bundle_messenger"); var verboseName = messengerBundle.getString(propertyName); setDivText("servertype.verbose", verboseName);}
var elements = gSmtpTrySSL.getElementsByAttribute("data", server.trySSL);
var elements = gSmtpTrySSL.getElementsByAttribute("value", server.trySSL);
function initSmtpSettings(server) { gSmtpUsername = document.getElementById("smtp.username"); gSmtpUsernameLabel = document.getElementById("smtpusernamelabel"); gSmtpHostname = document.getElementById("smtp.hostname"); gSmtpUseUsername = document.getElementById("smtp.useUsername"); gSmtpAuthMethod = document.getElementById("smtp.authMethod"); gSmtpTrySSL = document.getElementById("smtp.trySSL"); if (server) { gSmtpHostname.value = server.hostname; gSmtpUsername.value = server.username; gSmtpAuthMethod.setAttribute("value", server.authMethod); var elements = gSmtpTrySSL.getElementsByAttribute("data", server.trySSL); if (elements.length == 0) elements = gSmtpTrySSL.getElementsByAttribute("data", "1"); gSmtpTrySSL.selectedItem = elements[0]; } else { gSmtpAuthMethod.setAttribute("value", "1"); gSmtpTrySSL.selectedItem = gSmtpTrySSL.getElementsByAttribute("data", "1")[0]; } if (gSmtpAuthMethod.getAttribute("value") == "1") gSmtpUseUsername.checked = true; //dump("gSmtpAuthMethod = <" + gSmtpAuthMethod.localName + ">\n"); //dump("gSmtpAuthMethod.value = " + gSmtpAuthMethod.getAttribute("value") + "\n"); onUseUsername(gSmtpUseUsername, false); updateControls();}
elements = gSmtpTrySSL.getElementsByAttribute("data", "1");
elements = gSmtpTrySSL.getElementsByAttribute("value", "1");
function initSmtpSettings(server) { gSmtpUsername = document.getElementById("smtp.username"); gSmtpUsernameLabel = document.getElementById("smtpusernamelabel"); gSmtpHostname = document.getElementById("smtp.hostname"); gSmtpUseUsername = document.getElementById("smtp.useUsername"); gSmtpAuthMethod = document.getElementById("smtp.authMethod"); gSmtpTrySSL = document.getElementById("smtp.trySSL"); if (server) { gSmtpHostname.value = server.hostname; gSmtpUsername.value = server.username; gSmtpAuthMethod.setAttribute("value", server.authMethod); var elements = gSmtpTrySSL.getElementsByAttribute("data", server.trySSL); if (elements.length == 0) elements = gSmtpTrySSL.getElementsByAttribute("data", "1"); gSmtpTrySSL.selectedItem = elements[0]; } else { gSmtpAuthMethod.setAttribute("value", "1"); gSmtpTrySSL.selectedItem = gSmtpTrySSL.getElementsByAttribute("data", "1")[0]; } if (gSmtpAuthMethod.getAttribute("value") == "1") gSmtpUseUsername.checked = true; //dump("gSmtpAuthMethod = <" + gSmtpAuthMethod.localName + ">\n"); //dump("gSmtpAuthMethod.value = " + gSmtpAuthMethod.getAttribute("value") + "\n"); onUseUsername(gSmtpUseUsername, false); updateControls();}
gSmtpTrySSL.getElementsByAttribute("data", "1")[0];
gSmtpTrySSL.getElementsByAttribute("value", "1")[0];
function initSmtpSettings(server) { gSmtpUsername = document.getElementById("smtp.username"); gSmtpUsernameLabel = document.getElementById("smtpusernamelabel"); gSmtpHostname = document.getElementById("smtp.hostname"); gSmtpUseUsername = document.getElementById("smtp.useUsername"); gSmtpAuthMethod = document.getElementById("smtp.authMethod"); gSmtpTrySSL = document.getElementById("smtp.trySSL"); if (server) { gSmtpHostname.value = server.hostname; gSmtpUsername.value = server.username; gSmtpAuthMethod.setAttribute("value", server.authMethod); var elements = gSmtpTrySSL.getElementsByAttribute("data", server.trySSL); if (elements.length == 0) elements = gSmtpTrySSL.getElementsByAttribute("data", "1"); gSmtpTrySSL.selectedItem = elements[0]; } else { gSmtpAuthMethod.setAttribute("value", "1"); gSmtpTrySSL.selectedItem = gSmtpTrySSL.getElementsByAttribute("data", "1")[0]; } if (gSmtpAuthMethod.getAttribute("value") == "1") gSmtpUseUsername.checked = true; //dump("gSmtpAuthMethod = <" + gSmtpAuthMethod.localName + ">\n"); //dump("gSmtpAuthMethod.value = " + gSmtpAuthMethod.getAttribute("value") + "\n"); onUseUsername(gSmtpUseUsername, false); updateControls();}
selectProtocol();
selectProtocol(1);
function initSmtpSettings(server) { gSmtpUsername = document.getElementById("smtp.username"); gSmtpUsernameLabel = document.getElementById("smtpusernamelabel"); gSmtpHostname = document.getElementById("smtp.hostname"); gSmtpPort = document.getElementById("smtp.port"); gSmtpUseUsername = document.getElementById("smtp.useUsername"); gSmtpAuthMethod = document.getElementById("smtp.authMethod"); gSmtpTrySSL = document.getElementById("smtp.trySSL"); gDefaultPort = document.getElementById("smtp.defaultPort"); gPort = document.getElementById("smtp.port"); gSmtpS = document.getElementById("smtp.alwaysSmtpS"); if (server) { gSmtpHostname.value = server.hostname; gSmtpPort.value = server.port ? server.port : ""; gSmtpUsername.value = server.username; gSmtpAuthMethod.setAttribute("value", server.authMethod); var elements = gSmtpTrySSL.getElementsByAttribute("value", server.trySSL); if (elements.length == 0) elements = gSmtpTrySSL.getElementsByAttribute("value", "1"); gSmtpTrySSL.selectedItem = elements[0]; } else { gSmtpAuthMethod.setAttribute("value", "1"); gSmtpTrySSL.selectedItem = gSmtpTrySSL.getElementsByAttribute("value", "1")[0]; } if (gSmtpAuthMethod.getAttribute("value") == "1") gSmtpUseUsername.checked = true; //dump("gSmtpAuthMethod = <" + gSmtpAuthMethod.localName + ">\n"); //dump("gSmtpAuthMethod.value = " + gSmtpAuthMethod.getAttribute("value") + "\n"); onUseUsername(gSmtpUseUsername, false); updateControls(); selectProtocol(); if (gSmtpService.defaultServer) onLockPreference();}
if (server.username && server.username != "") gSmtpUseUsername.checked = true;
function initSmtpSettings(server) { gSmtpUsername = document.getElementById("smtp.username"); gSmtpHostname = document.getElementById("smtp.hostname"); gSmtpUseUsername = document.getElementById("smtp.useUsername"); gSmtpSavePassword = document.getElementById("smtp.savePassword") if (server) { gSmtpHostname.value = server.hostname; gSmtpUsername.value = server.username; gSmtpSavePassword.checked = server.savePassword; // radio groups not implemented //document.getElementById("smtp.trySSL").value = server.trySSL; if (server.username && server.username != "") gSmtpUseUsername.checked = true; } onUseUsername(gSmtpUseUsername, false); updateControls();}
if (gSmtpAuthMethod.getAttribute("value") == "1") gSmtpUseUsername.checked = true; dump("gSmtpAuthMethod = <" + gSmtpAuthMethod.localName + ">\n"); dump("gSmtpAuthMethod.value = " + gSmtpAuthMethod.getAttribute("value") + "\n");
function initSmtpSettings(server) { gSmtpUsername = document.getElementById("smtp.username"); gSmtpHostname = document.getElementById("smtp.hostname"); gSmtpUseUsername = document.getElementById("smtp.useUsername"); gSmtpSavePassword = document.getElementById("smtp.savePassword") if (server) { gSmtpHostname.value = server.hostname; gSmtpUsername.value = server.username; gSmtpSavePassword.checked = server.savePassword; // radio groups not implemented //document.getElementById("smtp.trySSL").value = server.trySSL; if (server.username && server.username != "") gSmtpUseUsername.checked = true; } onUseUsername(gSmtpUseUsername, false); updateControls();}
if (!jsenv.HAS_XPCOM) client.display ("ChatZilla was not given access to the XPConnect " + "service. You will not be able to connect to an " + "irc server. A workaround may be to set the " + "'security.checkxpconnect' pref to false in " + "all.js, or your user prefs.", "ERROR");
function initStatic(){ var obj; obj = document.getElementById("input"); obj.onkeyup = onInputKeyUp; obj = document.getElementById("tb[*client*]"); client.quickList = new CListBox(document.getElementById("quickList")); var saveDir = client.PRINT_DIRECTION; client.PRINT_DIRECTION = 1; client.display ("Welcome to ChatZilla...\n" + "Use /attach <network-name> connect to a network.\n" + "Where <network-name> is one of [" + keys (client.networks) + "]\n" + "More help is available with /help [<command-name>]", "HELLO"); client.PRINT_DIRECTION = saveDir; setCurrentObject (client); window.onkeypress = onWindowKeyPress; }
const nsISound = Components.interfaces.nsISound; client.sound = Components.classes["@mozilla.org/sound;1"].createInstance(nsISound); const nsIGlobalHistory = Components.interfaces.nsIGlobalHistory; const GHIST_CONTRACTID = "@mozilla.org/browser/global-history;1"; client.globalHistory = Components.classes[GHIST_CONTRACTID].getService(nsIGlobalHistory); const nsISDateFormat = Components.interfaces.nsIScriptableDateFormat; const DTFMT_CID = "@mozilla.org/intl/scriptabledateformat;1"; client.dtFormatter = Components.classes[DTFMT_CID].createInstance(nsISDateFormat);
function initStatic(){ CIRCServer.prototype.VERSION_RPLY = getMsg(MSG_VERSION_REPLY, [__cz_version, navigator.userAgent]); client.mainWindow = window; const nsISound = Components.interfaces.nsISound; client.sound = Components.classes["@mozilla.org/sound;1"].createInstance(nsISound); const nsIGlobalHistory = Components.interfaces.nsIGlobalHistory; const GHIST_CONTRACTID = "@mozilla.org/browser/global-history;1"; client.globalHistory = Components.classes[GHIST_CONTRACTID].getService(nsIGlobalHistory); const nsISDateFormat = Components.interfaces.nsIScriptableDateFormat; const DTFMT_CID = "@mozilla.org/intl/scriptabledateformat;1"; client.dtFormatter = Components.classes[DTFMT_CID].createInstance(nsISDateFormat); // Mmmm, fun. This ONLY affects the ChatZilla window, don't worry! Date.prototype.toStringInt = Date.prototype.toString; Date.prototype.toString = function() { var dtf = client.dtFormatter; return dtf.FormatDateTime("", dtf.dateFormatLong, dtf.timeFormatSeconds, this.getFullYear(), this.getMonth() + 1, this.getDate(), this.getHours(), this.getMinutes(), this.getSeconds() ); } multilineInputMode(client.prefs["multiline"]); if (client.prefs["showModeSymbols"]) setListMode("symbol"); else setListMode("graphic"); setDebugMode(client.prefs["debugMode"]); var ary = navigator.userAgent.match (/(rv:[^;)\s]+).*?Gecko\/(\d+)/); if (ary) { client.userAgent = "ChatZilla " + __cz_version + " [Mozilla " + ary[1] + "/" + ary[2] + "]"; } else { client.userAgent = "ChatZilla " + __cz_version + " [" + navigator.userAgent + "]"; } client.statusBar = new Object(); client.statusBar["server-nick"] = document.getElementById ("server-nick"); client.statusElement = document.getElementById ("status-text"); client.defaultStatus = MSG_DEFAULT_STATUS; client.logFile = null; setInterval("onNotifyTimeout()", client.NOTIFY_TIMEOUT); client.defaultCompletion = client.COMMAND_CHAR + "help "; client.deck = document.getElementById('output-deck');}
Date.prototype.toStringInt = Date.prototype.toString; Date.prototype.toString = function() { var dtf = client.dtFormatter; return dtf.FormatDateTime("", dtf.dateFormatLong, dtf.timeFormatSeconds, this.getFullYear(), this.getMonth() + 1, this.getDate(), this.getHours(), this.getMinutes(), this.getSeconds() );
try { var io = Components.classes['@mozilla.org/network/io-service;1']; client.iosvc = io.getService(Components.interfaces.nsIIOService); } catch (ex) { throw { summary: "IO service failed to initalize", exception: ex }; } try { const nsISound = Components.interfaces.nsISound; client.sound = Components.classes["@mozilla.org/sound;1"].createInstance(nsISound); client.soundList = new Object(); } catch (ex) { throw { summary: "Sound failed to initalize", exception: ex }; } try { const nsIGlobalHistory = Components.interfaces.nsIGlobalHistory; const GHIST_CONTRACTID = "@mozilla.org/browser/global-history;1"; client.globalHistory = Components.classes[GHIST_CONTRACTID].getService(nsIGlobalHistory); } catch (ex) { throw { summary: "Global History failed to initalize", exception: ex }; } try { const nsISDateFormat = Components.interfaces.nsIScriptableDateFormat; const DTFMT_CID = "@mozilla.org/intl/scriptabledateformat;1"; client.dtFormatter = Components.classes[DTFMT_CID].createInstance(nsISDateFormat); Date.prototype.toStringInt = Date.prototype.toString; Date.prototype.toString = function() { var dtf = client.dtFormatter; return dtf.FormatDateTime("", dtf.dateFormatLong, dtf.timeFormatSeconds, this.getFullYear(), this.getMonth() + 1, this.getDate(), this.getHours(), this.getMinutes(), this.getSeconds() ); } } catch (ex) { throw { summary: "Locale-correct date formatting failed to initalize", exception: ex };
function initStatic(){ CIRCServer.prototype.VERSION_RPLY = getMsg(MSG_VERSION_REPLY, [__cz_version, navigator.userAgent]); client.mainWindow = window; const nsISound = Components.interfaces.nsISound; client.sound = Components.classes["@mozilla.org/sound;1"].createInstance(nsISound); const nsIGlobalHistory = Components.interfaces.nsIGlobalHistory; const GHIST_CONTRACTID = "@mozilla.org/browser/global-history;1"; client.globalHistory = Components.classes[GHIST_CONTRACTID].getService(nsIGlobalHistory); const nsISDateFormat = Components.interfaces.nsIScriptableDateFormat; const DTFMT_CID = "@mozilla.org/intl/scriptabledateformat;1"; client.dtFormatter = Components.classes[DTFMT_CID].createInstance(nsISDateFormat); // Mmmm, fun. This ONLY affects the ChatZilla window, don't worry! Date.prototype.toStringInt = Date.prototype.toString; Date.prototype.toString = function() { var dtf = client.dtFormatter; return dtf.FormatDateTime("", dtf.dateFormatLong, dtf.timeFormatSeconds, this.getFullYear(), this.getMonth() + 1, this.getDate(), this.getHours(), this.getMinutes(), this.getSeconds() ); } multilineInputMode(client.prefs["multiline"]); if (client.prefs["showModeSymbols"]) setListMode("symbol"); else setListMode("graphic"); setDebugMode(client.prefs["debugMode"]); var ary = navigator.userAgent.match (/(rv:[^;)\s]+).*?Gecko\/(\d+)/); if (ary) { client.userAgent = "ChatZilla " + __cz_version + " [Mozilla " + ary[1] + "/" + ary[2] + "]"; } else { client.userAgent = "ChatZilla " + __cz_version + " [" + navigator.userAgent + "]"; } client.statusBar = new Object(); client.statusBar["server-nick"] = document.getElementById ("server-nick"); client.statusElement = document.getElementById ("status-text"); client.defaultStatus = MSG_DEFAULT_STATUS; client.logFile = null; setInterval("onNotifyTimeout()", client.NOTIFY_TIMEOUT); client.defaultCompletion = client.COMMAND_CHAR + "help "; client.deck = document.getElementById('output-deck');}
client.lineEnd = "\n"; if (navigator.platform.search(/win/i) >= 0) client.lineEnd = "\r\n";
function initStatic(){ CIRCServer.prototype.VERSION_RPLY = getMsg(MSG_VERSION_REPLY, [__cz_version, navigator.userAgent]); client.mainWindow = window; const nsISound = Components.interfaces.nsISound; client.sound = Components.classes["@mozilla.org/sound;1"].createInstance(nsISound); const nsIGlobalHistory = Components.interfaces.nsIGlobalHistory; const GHIST_CONTRACTID = "@mozilla.org/browser/global-history;1"; client.globalHistory = Components.classes[GHIST_CONTRACTID].getService(nsIGlobalHistory); const nsISDateFormat = Components.interfaces.nsIScriptableDateFormat; const DTFMT_CID = "@mozilla.org/intl/scriptabledateformat;1"; client.dtFormatter = Components.classes[DTFMT_CID].createInstance(nsISDateFormat); // Mmmm, fun. This ONLY affects the ChatZilla window, don't worry! Date.prototype.toStringInt = Date.prototype.toString; Date.prototype.toString = function() { var dtf = client.dtFormatter; return dtf.FormatDateTime("", dtf.dateFormatLong, dtf.timeFormatSeconds, this.getFullYear(), this.getMonth() + 1, this.getDate(), this.getHours(), this.getMinutes(), this.getSeconds() ); } multilineInputMode(client.prefs["multiline"]); if (client.prefs["showModeSymbols"]) setListMode("symbol"); else setListMode("graphic"); setDebugMode(client.prefs["debugMode"]); var ary = navigator.userAgent.match (/(rv:[^;)\s]+).*?Gecko\/(\d+)/); if (ary) { client.userAgent = "ChatZilla " + __cz_version + " [Mozilla " + ary[1] + "/" + ary[2] + "]"; } else { client.userAgent = "ChatZilla " + __cz_version + " [" + navigator.userAgent + "]"; } client.statusBar = new Object(); client.statusBar["server-nick"] = document.getElementById ("server-nick"); client.statusElement = document.getElementById ("status-text"); client.defaultStatus = MSG_DEFAULT_STATUS; client.logFile = null; setInterval("onNotifyTimeout()", client.NOTIFY_TIMEOUT); client.defaultCompletion = client.COMMAND_CHAR + "help "; client.deck = document.getElementById('output-deck');}
setMenuCheck ("menu-dmessages", client.eventPump.getHook ("event-tracer").enabled); setMenuCheck ("menu-munger", client.munger.enabled); setMenuCheck ("menu-viewicons", client.ICONS_IN_TOOLBAR);
function initStatic(){ var obj; obj = document.getElementById("input"); obj.addEventListener("keyup", onInputKeyUp, false); //obj = document.getElementById("tb[*client*]"); client.quickList = new CListBox(document.getElementById("quickList")); client.quickList.selectedItemCallback = quicklistCallback; var saveDir = client.PRINT_DIRECTION; client.PRINT_DIRECTION = 1; client.display ("Welcome to ChatZilla...\n" + "Use /attach <network-name> connect to a network.\n" + "Where <network-name> is one of [" + keys (client.networks) + "]\n" + "More help is available with /help [<command-name>]", "HELLO"); client.PRINT_DIRECTION = saveDir; setCurrentObject (client); if (!jsenv.HAS_XPCOM) client.display ("ChatZilla was not given access to the XPConnect " + "service. You will not be able to connect to an " + "irc server. A workaround may be to set the " + "'security.checkxpconnect' pref to false in " + "all.js, or your user prefs.", "ERROR"); window.onkeypress = onWindowKeyPress; }
setMenuCheck ("menu-munger", client.munger.enabled);
setMenuCheck ("menu-munger-global", !client.munger.enabled); setupMungerMenu(client.munger);
function initStatic(){ var obj; const nsISound = Components.interfaces.nsISound; client.sound = Components.classes["@mozilla.org/sound;1"].createInstance(nsISound); var ary = navigator.userAgent.match (/;\s*([^;\s]+\s*)\).*\/(\d+)/); if (ary) client.userAgent = "ChatZilla " + client.version + " [Mozilla " + ary[1] + "/" + ary[2] + "]"; else client.userAgent = "ChatZilla " + client.version + "[" + navigator.userAgent + "]"; obj = document.getElementById("input"); obj.addEventListener("keyup", onInputKeyUp, false); obj = document.getElementById("multiline-input"); obj.addEventListener("keyup", onMultilineInputKeyUp, false); window.onkeypress = onWindowKeyPress; setMenuCheck ("menu-dmessages", client.eventPump.getHook ("event-tracer").enabled); setMenuCheck ("menu-munger", client.munger.enabled); client.uiState["tabstrip"] = setMenuCheck ("menu-view-tabstrip", isVisible("view-tabs")); client.uiState["info"] = setMenuCheck ("menu-view-info", isVisible("user-list-box")); client.uiState["status"] = setMenuCheck ("menu-view-status", isVisible("status-bar-tbar")); client.statusBar = new Object(); client.statusBar["net-name"] = document.getElementById ("net-name"); client.statusBar["server-name"] = document.getElementById ("server-name"); client.statusBar["server-nick"] = document.getElementById ("server-nick"); client.statusBar["server-lag"] = document.getElementById ("server-lag"); client.statusBar["last-ping"] = document.getElementById ("last-ping"); client.statusBar["channel-name"] = document.getElementById ("channel-name"); client.statusBar["channel-limit"] = document.getElementById ("channel-limit"); client.statusBar["channel-key"] = document.getElementById ("channel-key"); client.statusBar["channel-mode"] = document.getElementById ("channel-mode"); client.statusBar["channel-users"] = document.getElementById ("channel-users"); client.statusBar["channel-topic"] = document.getElementById ("channel-topic"); client.statusBar["channel-topicby"] = document.getElementById ("channel-topicby"); onSortCol ("usercol-nick"); client.display (getMsg("welcome"), "HELLO"); setCurrentObject (client); client.onInputNetworks(); client.onInputCommands(); ary = client.INITIAL_VICTIMS.split(";"); for (i in ary) { ary[i] = stringTrim(ary[i]); if (ary[i]) client.stalkingVictims.push (ary[i]); } var m = document.getElementById ("menu-settings-autosave"); m.setAttribute ("checked", String(client.SAVE_SETTINGS)); var wentSomewhere = false; if (window.arguments && window.arguments[0] && window.arguments[0].url) { url = window.arguments[0].url; if (url.search(/^irc:\/?\/?$/i) == -1) { /* if the url is not irc: irc:/ or irc://, then go to it. */ gotoIRCURL (url); wentSomewhere = true; } } if (!wentSomewhere) { /* if we had nowhere else to go, connect to any default urls */ var ary = client.INITIAL_URLS.split(";"); for (var i in ary) if ((ary[i] = stringTrim(ary[i]))) gotoIRCURL (ary[i]); } setInterval ("onNotifyTimeout()", client.NOTIFY_TIMEOUT); }
client.display ("Welcome to ChatZilla...\n" + "Use /attach <network-name> connect to a network, or " + "click on one of the network names below.\n" + "For general IRC help and FAQs, please go to " + "<http:
client.display (getMsg("welcome"), "HELLO");
function initStatic(){ var obj; const nsISound = Components.interfaces.nsISound; client.sound = Components.classes["@mozilla.org/sound;1"].createInstance(nsISound); var ary = navigator.userAgent.match (/;\s*([^;\s]+\s*)\).*\/(\d+)/); if (ary) client.userAgent = "ChatZilla " + client.version + " [Mozilla " + ary[1] + "/" + ary[2] + "]"; else client.userAgent = "ChatZilla " + client.version + "[" + navigator.userAgent + "]"; obj = document.getElementById("input"); obj.addEventListener("keyup", onInputKeyUp, false); obj = document.getElementById("multiline-input"); obj.addEventListener("keyup", onMultilineInputKeyUp, false); window.onkeypress = onWindowKeyPress; setMenuCheck ("menu-dmessages", client.eventPump.getHook ("event-tracer").enabled); setMenuCheck ("menu-munger", client.munger.enabled); client.uiState["toolbar"] = setMenuCheck ("menu-view-toolbar", isVisible("views-tbar")); client.uiState["info"] = setMenuCheck ("menu-view-info", isVisible("user-list-box")); client.uiState["status"] = setMenuCheck ("menu-view-status", isVisible("status-bar-tbar")); client.statusBar = new Object(); client.statusBar["net-name"] = document.getElementById ("net-name"); client.statusBar["server-name"] = document.getElementById ("server-name"); client.statusBar["server-nick"] = document.getElementById ("server-nick"); client.statusBar["server-lag"] = document.getElementById ("server-lag"); client.statusBar["last-ping"] = document.getElementById ("last-ping"); client.statusBar["channel-name"] = document.getElementById ("channel-name"); client.statusBar["channel-limit"] = document.getElementById ("channel-limit"); client.statusBar["channel-key"] = document.getElementById ("channel-key"); client.statusBar["channel-mode"] = document.getElementById ("channel-mode"); client.statusBar["channel-users"] = document.getElementById ("channel-users"); client.statusBar["channel-topic"] = document.getElementById ("channel-topic"); client.statusBar["channel-topicby"] = document.getElementById ("channel-topicby"); onSortCol ("usercol-nick"); client.display ("Welcome to ChatZilla...\n" + "Use /attach <network-name> connect to a network, or " + "click on one of the network names below.\n" + "For general IRC help and FAQs, please go to " + "<http://www.irchelp.org>.", "HELLO"); setCurrentObject (client); client.onInputNetworks(); client.onInputCommands(); var ary = client.INITIAL_URLS.split(";"); for (var i in ary) { ary[i] = stringTrim(ary[i]); if (ary[i]) { if (ary[i].indexOf("irc://") != 0) ary[i] = "irc://" + ary[i]; gotoIRCURL (ary[i]); } } ary = client.INITIAL_VICTIMS.split(";"); for (i in ary) { ary[i] = stringTrim(ary[i]); if (ary[i]) client.stalkingVictims.push (ary[i]); } var m = document.getElementById ("menu-settings-autosave"); m.setAttribute ("checked", String(client.SAVE_SETTINGS)); if (document.location.search) gotoIRCURL (document.location.search.substr(1)); setInterval ("onNotifyTimeout()", client.NOTIFY_TIMEOUT); }
window.onkeypress = onWindowKeyPress;
function initStatic(){ var obj; obj = document.getElementById("input"); obj.addEventListener("keyup", onInputKeyUp, false); //obj = document.getElementById("tb[*client*]"); /* client.quickList = new CListBox(document.getElementById("quickList")); client.quickList.selectedItemCallback = quicklistCallback; */ var saveDir = client.PRINT_DIRECTION; client.PRINT_DIRECTION = 1; client.display ("Welcome to ChatZilla...\n" + "Use /attach <network-name> connect to a network.\n" + "Where <network-name> is one of [" + keys (client.networks) + "]\n" + "More help is available with /help [<command-name>]", "HELLO"); setCurrentObject (client); client.onInputCommands(); client.PRINT_DIRECTION = saveDir; if (!jsenv.HAS_XPCOM) client.display ("ChatZilla was not given access to the XPConnect " + "service. You will not be able to connect to an " + "irc server. A workaround may be to set the " + "'security.checkxpconnect' pref to false in " + "all.js, or your user prefs.", "ERROR"); window.onkeypress = onWindowKeyPress; setMenuCheck ("menu-dmessages", client.eventPump.getHook ("event-tracer").enabled); setMenuCheck ("menu-munger", client.munger.enabled); setMenuCheck ("menu-viewicons", client.ICONS_IN_TOOLBAR); client.uiState["toolbar"] = setMenuCheck ("menu-view-toolbar", isVisible("views-tbox")); client.uiState["info"] = setMenuCheck ("menu-view-info", isVisible("user-list")); client.uiState["status"] = setMenuCheck ("menu-view-status", isVisible("status-bar-tbox")); onSortCol ("usercol-nick"); if (document.location.search) gotoIRCURL (document.location.search.substr(1)); }
var saveDir = client.PRINT_DIRECTION; client.PRINT_DIRECTION = 1;
setMenuCheck ("menu-dmessages", client.eventPump.getHook ("event-tracer").enabled); setMenuCheck ("menu-munger", client.munger.enabled); setMenuCheck ("menu-viewicons", client.ICONS_IN_TOOLBAR); client.uiState["toolbar"] = setMenuCheck ("menu-view-toolbar", isVisible("views-tbar")); client.uiState["info"] = setMenuCheck ("menu-view-info", isVisible("user-list-box")); client.uiState["status"] = setMenuCheck ("menu-view-status", isVisible("status-bar-tbar")); client.statusBar = new Object(); client.statusBar["net-name"] = document.getElementById ("net-name"); client.statusBar["server-name"] = document.getElementById ("server-name"); client.statusBar["server-nick"] = document.getElementById ("server-nick"); client.statusBar["server-lag"] = document.getElementById ("server-lag"); client.statusBar["last-ping"] = document.getElementById ("last-ping"); client.statusBar["channel-name"] = document.getElementById ("channel-name"); client.statusBar["channel-limit"] = document.getElementById ("channel-limit"); client.statusBar["channel-key"] = document.getElementById ("channel-key"); client.statusBar["channel-mode"] = document.getElementById ("channel-mode"); client.statusBar["channel-users"] = document.getElementById ("channel-users"); client.statusBar["channel-topic"] = document.getElementById ("channel-topic"); client.statusBar["channel-topicby"] = document.getElementById ("channel-topicby"); onSortCol ("usercol-nick");
function initStatic(){ var obj; obj = document.getElementById("input"); obj.addEventListener("keyup", onInputKeyUp, false); //obj = document.getElementById("tb[*client*]"); /* client.quickList = new CListBox(document.getElementById("quickList")); client.quickList.selectedItemCallback = quicklistCallback; */ var saveDir = client.PRINT_DIRECTION; client.PRINT_DIRECTION = 1; client.display ("Welcome to ChatZilla...\n" + "Use /attach <network-name> connect to a network.\n" + "Where <network-name> is one of [" + keys (client.networks) + "]\n" + "More help is available with /help [<command-name>]", "HELLO"); setCurrentObject (client); client.onInputCommands(); client.PRINT_DIRECTION = saveDir; if (!jsenv.HAS_XPCOM) client.display ("ChatZilla was not given access to the XPConnect " + "service. You will not be able to connect to an " + "irc server. A workaround may be to set the " + "'security.checkxpconnect' pref to false in " + "all.js, or your user prefs.", "ERROR"); window.onkeypress = onWindowKeyPress; setMenuCheck ("menu-dmessages", client.eventPump.getHook ("event-tracer").enabled); setMenuCheck ("menu-munger", client.munger.enabled); setMenuCheck ("menu-viewicons", client.ICONS_IN_TOOLBAR); client.uiState["toolbar"] = setMenuCheck ("menu-view-toolbar", isVisible("views-tbox")); client.uiState["info"] = setMenuCheck ("menu-view-info", isVisible("user-list")); client.uiState["status"] = setMenuCheck ("menu-view-status", isVisible("status-bar-tbox")); onSortCol ("usercol-nick"); if (document.location.search) gotoIRCURL (document.location.search.substr(1)); }
client.PRINT_DIRECTION = saveDir;
function initStatic(){ var obj; obj = document.getElementById("input"); obj.addEventListener("keyup", onInputKeyUp, false); //obj = document.getElementById("tb[*client*]"); /* client.quickList = new CListBox(document.getElementById("quickList")); client.quickList.selectedItemCallback = quicklistCallback; */ var saveDir = client.PRINT_DIRECTION; client.PRINT_DIRECTION = 1; client.display ("Welcome to ChatZilla...\n" + "Use /attach <network-name> connect to a network.\n" + "Where <network-name> is one of [" + keys (client.networks) + "]\n" + "More help is available with /help [<command-name>]", "HELLO"); setCurrentObject (client); client.onInputCommands(); client.PRINT_DIRECTION = saveDir; if (!jsenv.HAS_XPCOM) client.display ("ChatZilla was not given access to the XPConnect " + "service. You will not be able to connect to an " + "irc server. A workaround may be to set the " + "'security.checkxpconnect' pref to false in " + "all.js, or your user prefs.", "ERROR"); window.onkeypress = onWindowKeyPress; setMenuCheck ("menu-dmessages", client.eventPump.getHook ("event-tracer").enabled); setMenuCheck ("menu-munger", client.munger.enabled); setMenuCheck ("menu-viewicons", client.ICONS_IN_TOOLBAR); client.uiState["toolbar"] = setMenuCheck ("menu-view-toolbar", isVisible("views-tbox")); client.uiState["info"] = setMenuCheck ("menu-view-info", isVisible("user-list")); client.uiState["status"] = setMenuCheck ("menu-view-status", isVisible("status-bar-tbox")); onSortCol ("usercol-nick"); if (document.location.search) gotoIRCURL (document.location.search.substr(1)); }
if (!jsenv.HAS_XPCOM) client.display ("ChatZilla was not given access to the XPConnect " + "service. You will not be able to connect to an " + "irc server. A workaround may be to set the " + "'security.checkxpconnect' pref to false in " + "all.js, or your user prefs.", "ERROR"); window.onkeypress = onWindowKeyPress;
var ary = client.INITIAL_URLS.split(";"); for (var i in ary) { ary[i] = stringTrim(ary[i]); if (ary[i]) { if (ary[i].indexOf("irc: ary[i] = "irc: gotoIRCURL (ary[i]); } }
function initStatic(){ var obj; obj = document.getElementById("input"); obj.addEventListener("keyup", onInputKeyUp, false); //obj = document.getElementById("tb[*client*]"); /* client.quickList = new CListBox(document.getElementById("quickList")); client.quickList.selectedItemCallback = quicklistCallback; */ var saveDir = client.PRINT_DIRECTION; client.PRINT_DIRECTION = 1; client.display ("Welcome to ChatZilla...\n" + "Use /attach <network-name> connect to a network.\n" + "Where <network-name> is one of [" + keys (client.networks) + "]\n" + "More help is available with /help [<command-name>]", "HELLO"); setCurrentObject (client); client.onInputCommands(); client.PRINT_DIRECTION = saveDir; if (!jsenv.HAS_XPCOM) client.display ("ChatZilla was not given access to the XPConnect " + "service. You will not be able to connect to an " + "irc server. A workaround may be to set the " + "'security.checkxpconnect' pref to false in " + "all.js, or your user prefs.", "ERROR"); window.onkeypress = onWindowKeyPress; setMenuCheck ("menu-dmessages", client.eventPump.getHook ("event-tracer").enabled); setMenuCheck ("menu-munger", client.munger.enabled); setMenuCheck ("menu-viewicons", client.ICONS_IN_TOOLBAR); client.uiState["toolbar"] = setMenuCheck ("menu-view-toolbar", isVisible("views-tbox")); client.uiState["info"] = setMenuCheck ("menu-view-info", isVisible("user-list")); client.uiState["status"] = setMenuCheck ("menu-view-status", isVisible("status-bar-tbox")); onSortCol ("usercol-nick"); if (document.location.search) gotoIRCURL (document.location.search.substr(1)); }
setMenuCheck ("menu-dmessages", client.eventPump.getHook ("event-tracer").enabled); setMenuCheck ("menu-munger", client.munger.enabled); setMenuCheck ("menu-viewicons", client.ICONS_IN_TOOLBAR); client.uiState["toolbar"] = setMenuCheck ("menu-view-toolbar", isVisible("views-tbox")); client.uiState["info"] = setMenuCheck ("menu-view-info", isVisible("user-list")); client.uiState["status"] = setMenuCheck ("menu-view-status", isVisible("status-bar-tbox"));
ary = client.INITIAL_VICTIMS.split(";"); for (i in ary) { ary[i] = stringTrim(ary[i]); if (ary[i]) client.stalkingVictims.push (ary[i]); }
function initStatic(){ var obj; obj = document.getElementById("input"); obj.addEventListener("keyup", onInputKeyUp, false); //obj = document.getElementById("tb[*client*]"); /* client.quickList = new CListBox(document.getElementById("quickList")); client.quickList.selectedItemCallback = quicklistCallback; */ var saveDir = client.PRINT_DIRECTION; client.PRINT_DIRECTION = 1; client.display ("Welcome to ChatZilla...\n" + "Use /attach <network-name> connect to a network.\n" + "Where <network-name> is one of [" + keys (client.networks) + "]\n" + "More help is available with /help [<command-name>]", "HELLO"); setCurrentObject (client); client.onInputCommands(); client.PRINT_DIRECTION = saveDir; if (!jsenv.HAS_XPCOM) client.display ("ChatZilla was not given access to the XPConnect " + "service. You will not be able to connect to an " + "irc server. A workaround may be to set the " + "'security.checkxpconnect' pref to false in " + "all.js, or your user prefs.", "ERROR"); window.onkeypress = onWindowKeyPress; setMenuCheck ("menu-dmessages", client.eventPump.getHook ("event-tracer").enabled); setMenuCheck ("menu-munger", client.munger.enabled); setMenuCheck ("menu-viewicons", client.ICONS_IN_TOOLBAR); client.uiState["toolbar"] = setMenuCheck ("menu-view-toolbar", isVisible("views-tbox")); client.uiState["info"] = setMenuCheck ("menu-view-info", isVisible("user-list")); client.uiState["status"] = setMenuCheck ("menu-view-status", isVisible("status-bar-tbox")); onSortCol ("usercol-nick"); if (document.location.search) gotoIRCURL (document.location.search.substr(1)); }
onSortCol ("usercol-nick");
var m = document.getElementById ("menu-settings-autosave"); m.setAttribute ("checked", String(client.SAVE_SETTINGS));
function initStatic(){ var obj; obj = document.getElementById("input"); obj.addEventListener("keyup", onInputKeyUp, false); //obj = document.getElementById("tb[*client*]"); /* client.quickList = new CListBox(document.getElementById("quickList")); client.quickList.selectedItemCallback = quicklistCallback; */ var saveDir = client.PRINT_DIRECTION; client.PRINT_DIRECTION = 1; client.display ("Welcome to ChatZilla...\n" + "Use /attach <network-name> connect to a network.\n" + "Where <network-name> is one of [" + keys (client.networks) + "]\n" + "More help is available with /help [<command-name>]", "HELLO"); setCurrentObject (client); client.onInputCommands(); client.PRINT_DIRECTION = saveDir; if (!jsenv.HAS_XPCOM) client.display ("ChatZilla was not given access to the XPConnect " + "service. You will not be able to connect to an " + "irc server. A workaround may be to set the " + "'security.checkxpconnect' pref to false in " + "all.js, or your user prefs.", "ERROR"); window.onkeypress = onWindowKeyPress; setMenuCheck ("menu-dmessages", client.eventPump.getHook ("event-tracer").enabled); setMenuCheck ("menu-munger", client.munger.enabled); setMenuCheck ("menu-viewicons", client.ICONS_IN_TOOLBAR); client.uiState["toolbar"] = setMenuCheck ("menu-view-toolbar", isVisible("views-tbox")); client.uiState["info"] = setMenuCheck ("menu-view-info", isVisible("user-list")); client.uiState["status"] = setMenuCheck ("menu-view-status", isVisible("status-bar-tbox")); onSortCol ("usercol-nick"); if (document.location.search) gotoIRCURL (document.location.search.substr(1)); }
var wentSomewhere = false; if ("arguments" in window && 0 in window.arguments && typeof window.arguments[0] == "object" && "url" in window.arguments[0]) { url = window.arguments[0].url; if (url.search(/^irc:\/?\/?$/i) == -1) { ary = client.INITIAL_URLS.split(/\s*;\s*/).reverse(); for (var i in ary) { if (ary[i] && ary[i] != "irc: gotoIRCURL (ary[i]); } } if (client.viewsArray.length > 1 && !isStartupURL("irc: { var tb = getTabForObject (client); deleteTab(tb); }
function initStatic(){ var obj; const nsISound = Components.interfaces.nsISound; client.sound = Components.classes["@mozilla.org/sound;1"].createInstance(nsISound); if (client.CHARSET) setCharset(client.CHARSET); var ary = navigator.userAgent.match (/;\s*([^;\s]+\s*)\).*\/(\d+)/); if (ary) client.userAgent = "ChatZilla " + client.version + " [Mozilla " + ary[1] + "/" + ary[2] + "]"; else client.userAgent = "ChatZilla " + client.version + " [" + navigator.userAgent + "]"; obj = document.getElementById("input"); obj.addEventListener("keypress", onInputKeyPress, false); obj = document.getElementById("multiline-input"); obj.addEventListener("keypress", onMultilineInputKeyPress, false); obj = document.getElementById("channel-topicedit"); obj.addEventListener("keypress", onTopicKeyPress, false); obj.active = false; window.onkeypress = onWindowKeyPress; setMenuCheck ("menu-dmessages", client.eventPump.getHook ("event-tracer").enabled); setMenuCheck ("menu-munger-global", !client.munger.enabled); setMenuCheck ("menu-colors", client.enableColors); setupMungerMenu(client.munger); client.uiState["tabstrip"] = setMenuCheck ("menu-view-tabstrip", isVisible("view-tabs")); client.uiState["info"] = setMenuCheck ("menu-view-info", isVisible("user-list-box")); client.uiState["header"] = setMenuCheck ("menu-view-header", isVisible("header-bar-tbox")); client.uiState["status"] = setMenuCheck ("menu-view-status", isVisible("status-bar")); client.statusBar = new Object(); client.statusBar["header-url"] = document.getElementById ("header-url"); client.statusBar["server-nick"] = document.getElementById ("server-nick"); client.statusBar["channel-mode"] = document.getElementById ("channel-mode"); client.statusBar["channel-users"] = document.getElementById ("channel-users"); client.statusBar["channel-topic"] = document.getElementById ("channel-topic"); client.statusBar["channel-topicedit"] = document.getElementById ("channel-topicedit"); client.statusElement = document.getElementById ("status-text"); client.defaultStatus = getMsg ("defaultStatus"); onSortCol ("usercol-nick"); client.display (getMsg("welcome"), "HELLO"); setCurrentObject (client); client.onInputNetworks(); client.onInputCommands(); ary = client.INITIAL_VICTIMS.split(/\s*;\s*/); for (i in ary) { if (ary[i]) client.stalkingVictims.push (ary[i]); } var m = document.getElementById ("menu-settings-autosave"); m.setAttribute ("checked", String(client.SAVE_SETTINGS)); var wentSomewhere = false; if ("arguments" in window && 0 in window.arguments && typeof window.arguments[0] == "object" && "url" in window.arguments[0]) { url = window.arguments[0].url; if (url.search(/^irc:\/?\/?$/i) == -1) { /* if the url is not irc: irc:/ or irc://, then go to it. */ gotoIRCURL (url); wentSomewhere = true; } } if (!wentSomewhere) { /* if we had nowhere else to go, connect to any default urls */ ary = client.INITIAL_URLS.split(/\s*;\s*/).reverse(); for (var i in ary) { if (ary[i] && ary[i] != "irc://") gotoIRCURL (ary[i]); } } if (client.viewsArray.length > 1 && !isStartupURL("irc://")) { var tb = getTabForObject (client); deleteTab(tb); } setInterval ("onNotifyTimeout()", client.NOTIFY_TIMEOUT); }
window.onkeypress = onWindowKeyPress;
function initStatic(){ var obj; obj = document.getElementById("input"); obj.onkeyup = onInputKeyUp; obj = document.getElementById("tb[*client*]"); client.quickList = new CListBox(document.getElementById("quickList")); var saveDir = client.PRINT_DIRECTION; client.PRINT_DIRECTION = 1; client.display ("Welcome to ChatZilla...\n" + "Use /attach <network-name> connect to a network.\n" + "Where <network-name> is one of [" + keys (client.networks) + "]\n" + "More help is available with /help [<command-name>]", "HELLO"); client.PRINT_DIRECTION = saveDir; setCurrentObject (client); }
this.showItem( "context-setWallpaper", this.onImage && navigator.appVersion.indexOf("Windows") != -1);
var isWin = navigator.appVersion.indexOf("Windows") != -1; this.showItem( "context-setWallpaper", isWin && this.onImage );
initViewItems : function () { // View source is always OK, unless in directory listing. this.showItem( "context-viewsource", !( this.inDirList || this.onImage || this.isTextSelected || this.onLink || this.onTextInput ) ); this.showItem( "context-viewinfo", !( this.inDirList || this.onImage || this.isTextSelected || this.onLink || this.onTextInput ) ); this.showItem( "context-sep-properties", !( this.inDirList || this.isTextSelected || this.onTextInput ) ); // Set As Wallpaper depends on whether an image was clicked on, and only works on Windows. this.showItem( "context-setWallpaper", this.onImage && navigator.appVersion.indexOf("Windows") != -1); this.showItem( "context-sep-image", this.onImage ); // View Image depends on whether an image was clicked on. this.showItem( "context-viewimage", this.onImage ); // View background image depends on whether there is one. this.showItem( "context-viewbgimage", !( this.inDirList || this.onImage || this.isTextSelected || this.onLink || this.onTextInput ) ); this.showItem( "context-sep-viewbgimage", !( this.inDirList || this.onImage || this.isTextSelected || this.onLink || this.onTextInput ) ); var menuitem = document.getElementById("context-viewbgimage"); if (this.hasBGImage) menuitem.removeAttribute("disabled"); else menuitem.setAttribute("disabled", "true"); },
if( isWin && this.onImage ) { var wallpaperItem = document.getElementById("context-setWallpaper"); if( !("complete" in this.target) || this.target.complete ) { wallpaperItem.removeAttribute("disabled"); } else { wallpaperItem.setAttribute("disabled", "true"); } }
initViewItems : function () { // View source is always OK, unless in directory listing. this.showItem( "context-viewsource", !( this.inDirList || this.onImage || this.isTextSelected || this.onLink || this.onTextInput ) ); this.showItem( "context-viewinfo", !( this.inDirList || this.onImage || this.isTextSelected || this.onLink || this.onTextInput ) ); this.showItem( "context-sep-properties", !( this.inDirList || this.isTextSelected || this.onTextInput ) ); // Set As Wallpaper depends on whether an image was clicked on, and only works on Windows. this.showItem( "context-setWallpaper", this.onImage && navigator.appVersion.indexOf("Windows") != -1); this.showItem( "context-sep-image", this.onImage ); // View Image depends on whether an image was clicked on. this.showItem( "context-viewimage", this.onImage ); // View background image depends on whether there is one. this.showItem( "context-viewbgimage", !( this.inDirList || this.onImage || this.isTextSelected || this.onLink || this.onTextInput ) ); this.showItem( "context-sep-viewbgimage", !( this.inDirList || this.onImage || this.isTextSelected || this.onLink || this.onTextInput ) ); var menuitem = document.getElementById("context-viewbgimage"); if (this.hasBGImage) menuitem.removeAttribute("disabled"); else menuitem.setAttribute("disabled", "true"); },
this.showItem( "context-setWallpaper", isWin && this.onImage );
this.showItem( "context-setWallpaper", isWin && (this.onImage || this.onStandaloneImage));
initViewItems : function () { // View source is always OK, unless in directory listing. this.showItem( "context-viewpartialsource-selection", this.isTextSelected && !this.onTextInput ); this.showItem( "context-viewpartialsource-mathml", this.onMathML && !this.isTextSelected ); var showView = !( this.inDirList || this.onImage || this.isTextSelected || this.onLink || this.onTextInput ); this.showItem( "context-viewsource", showView ); this.showItem( "context-viewinfo", showView ); this.showItem( "context-sep-properties", !( this.inDirList || this.isTextSelected || this.onTextInput ) ); // Set As Wallpaper depends on whether an image was clicked on, and only works on Windows. var isWin = navigator.appVersion.indexOf("Windows") != -1; this.showItem( "context-setWallpaper", isWin && this.onImage ); this.showItem( "context-sep-image", this.onImage ); if( isWin && this.onImage ) // Disable the Set As Wallpaper menu item if we're still trying to load the image this.setItemAttr( "context-setWallpaper", "disabled", (("complete" in this.target) && !this.target.complete) ? "true" : null ); this.showItem( "context-fitimage", this.onStandaloneImage && _content.document.imageResizingEnabled ); if ( this.onStandaloneImage && _content.document.imageResizingEnabled ) { this.setItemAttr( "context-fitimage", "disabled", _content.document.imageIsOverflowing ? null : "true"); this.setItemAttr( "context-fitimage", "checked", _content.document.imageIsResized ? "true" : null); } // View Image depends on whether an image was clicked on. this.showItem( "context-viewimage", this.onImage && !this.onStandaloneImage); // View background image depends on whether there is one. this.showItem( "context-viewbgimage", showView ); this.showItem( "context-sep-viewbgimage", showView ); this.setItemAttr( "context-viewbgimage", "disabled", this.hasBGImage ? null : "true"); },
this.showItem( "context-sep-image", this.onImage );
this.showItem( "context-sep-image", this.onImage || this.onStandaloneImage);
initViewItems : function () { // View source is always OK, unless in directory listing. this.showItem( "context-viewpartialsource-selection", this.isTextSelected && !this.onTextInput ); this.showItem( "context-viewpartialsource-mathml", this.onMathML && !this.isTextSelected ); var showView = !( this.inDirList || this.onImage || this.isTextSelected || this.onLink || this.onTextInput ); this.showItem( "context-viewsource", showView ); this.showItem( "context-viewinfo", showView ); this.showItem( "context-sep-properties", !( this.inDirList || this.isTextSelected || this.onTextInput ) ); // Set As Wallpaper depends on whether an image was clicked on, and only works on Windows. var isWin = navigator.appVersion.indexOf("Windows") != -1; this.showItem( "context-setWallpaper", isWin && this.onImage ); this.showItem( "context-sep-image", this.onImage ); if( isWin && this.onImage ) // Disable the Set As Wallpaper menu item if we're still trying to load the image this.setItemAttr( "context-setWallpaper", "disabled", (("complete" in this.target) && !this.target.complete) ? "true" : null ); this.showItem( "context-fitimage", this.onStandaloneImage && _content.document.imageResizingEnabled ); if ( this.onStandaloneImage && _content.document.imageResizingEnabled ) { this.setItemAttr( "context-fitimage", "disabled", _content.document.imageIsOverflowing ? null : "true"); this.setItemAttr( "context-fitimage", "checked", _content.document.imageIsResized ? "true" : null); } // View Image depends on whether an image was clicked on. this.showItem( "context-viewimage", this.onImage && !this.onStandaloneImage); // View background image depends on whether there is one. this.showItem( "context-viewbgimage", showView ); this.showItem( "context-sep-viewbgimage", showView ); this.setItemAttr( "context-viewbgimage", "disabled", this.hasBGImage ? null : "true"); },
this.showItem( "context-viewbgimage", showView ); this.showItem( "context-sep-viewbgimage", showView );
this.showItem( "context-viewbgimage", showView && !this.onStandaloneImage); this.showItem( "context-sep-viewbgimage", showView && !this.onStandaloneImage);
initViewItems : function () { // View source is always OK, unless in directory listing. this.showItem( "context-viewpartialsource-selection", this.isTextSelected && !this.onTextInput ); this.showItem( "context-viewpartialsource-mathml", this.onMathML && !this.isTextSelected ); var showView = !( this.inDirList || this.onImage || this.isTextSelected || this.onLink || this.onTextInput ); this.showItem( "context-viewsource", showView ); this.showItem( "context-viewinfo", showView ); this.showItem( "context-sep-properties", !( this.inDirList || this.isTextSelected || this.onTextInput ) ); // Set As Wallpaper depends on whether an image was clicked on, and only works on Windows. var isWin = navigator.appVersion.indexOf("Windows") != -1; this.showItem( "context-setWallpaper", isWin && this.onImage ); this.showItem( "context-sep-image", this.onImage ); if( isWin && this.onImage ) // Disable the Set As Wallpaper menu item if we're still trying to load the image this.setItemAttr( "context-setWallpaper", "disabled", (("complete" in this.target) && !this.target.complete) ? "true" : null ); this.showItem( "context-fitimage", this.onStandaloneImage && _content.document.imageResizingEnabled ); if ( this.onStandaloneImage && _content.document.imageResizingEnabled ) { this.setItemAttr( "context-fitimage", "disabled", _content.document.imageIsOverflowing ? null : "true"); this.setItemAttr( "context-fitimage", "checked", _content.document.imageIsResized ? "true" : null); } // View Image depends on whether an image was clicked on. this.showItem( "context-viewimage", this.onImage && !this.onStandaloneImage); // View background image depends on whether there is one. this.showItem( "context-viewbgimage", showView ); this.showItem( "context-sep-viewbgimage", showView ); this.setItemAttr( "context-viewbgimage", "disabled", this.hasBGImage ? null : "true"); },
dump("init view messages\n");
function InitViewMessagesMenu(){ dump("init view messages\n"); var allMenuItem = document.getElementById("viewAllMessagesMenuItem"); var viewFlags = gDBView.viewFlags; var viewType = gDBView.viewType; if(allMenuItem) allMenuItem.setAttribute("checked", (viewFlags & nsMsgViewFlagsType.kUnreadOnly) == 0 && (viewType == nsMsgViewType.eShowAllThreads)); var unreadMenuItem = document.getElementById("viewUnreadMessagesMenuItem"); if(unreadMenuItem) unreadMenuItem.setAttribute("checked", (viewFlags & nsMsgViewFlagsType.kUnreadOnly) != 0); var theadedMenuItem = document.getElementById("menu_showThreads"); if (theadedMenuItem) theadedMenuItem.setAttribute("checked", (viewFlags & nsMsgViewFlagsType.kThreadedDisplay) != 0); document.commandDispatcher.updateCommands('create-menu-view'); var theadsWithUnreadMenuItem = document.getElementById("viewThreadsWithUnreadMenuItem"); if(theadsWithUnreadMenuItem) theadsWithUnreadMenuItem.setAttribute("checked", viewType == nsMsgViewType.eShowThreadsWithUnread); var watchedTheadsWithUnreadMenuItem = document.getElementById("viewWatchedThreadsWithUnreadMenuItem"); if(watchedTheadsWithUnreadMenuItem) watchedTheadsWithUnreadMenuItem.setAttribute("checked", viewType == nsMsgViewType.eShowWatchedThreadsWithUnread);}
setSortByMenuItemCheckState("sortByScoreMenuitem", (sortType == nsMsgViewSortType.byScore));
function InitViewSortByMenu(){ var sortType = gDBView.sortType; setSortByMenuItemCheckState("sortByDateMenuitem", (sortType == nsMsgViewSortType.byDate)); setSortByMenuItemCheckState("sortByFlagMenuitem", (sortType == nsMsgViewSortType.byFlagged)); setSortByMenuItemCheckState("sortByOrderReceivedMenuitem", (sortType == nsMsgViewSortType.byId)); setSortByMenuItemCheckState("sortByPriorityMenuitem", (sortType == nsMsgViewSortType.byPriority)); setSortByMenuItemCheckState("sortBySizeMenuitem", (sortType == nsMsgViewSortType.bySize)); setSortByMenuItemCheckState("sortByStatusMenuitem", (sortType == nsMsgViewSortType.byStatus)); setSortByMenuItemCheckState("sortBySubjectMenuitem", (sortType == nsMsgViewSortType.bySubject)); setSortByMenuItemCheckState("sortByThreadMenuitem", (sortType == nsMsgViewSortType.byThread)); setSortByMenuItemCheckState("sortByUnreadMenuitem", (sortType == nsMsgViewSortType.byUnread)); setSortByMenuItemCheckState("sortByLabelMenuitem", (sortType == nsMsgViewSortType.byLabel)); // the Sender / Recipient menu is dynamic setSortByMenuItemCheckState("sortBySenderOrRecipientMenuitem", (sortType == nsMsgViewSortType.byAuthor) || (sortType == nsMsgViewSortType.byRecipient)); var senderOrRecipientMenuitem = document.getElementById("sortBySenderOrRecipientMenuitem"); if (senderOrRecipientMenuitem) { var currentFolder = gDBView.msgFolder; if (IsSpecialFolder(currentFolder, MSG_FOLDER_FLAG_SENTMAIL | MSG_FOLDER_FLAG_DRAFTS | MSG_FOLDER_FLAG_QUEUE)) { senderOrRecipientMenuitem.setAttribute('label',gMessengerBundle.getString('recipientColumnHeader')); senderOrRecipientMenuitem.setAttribute('accesskey',gMessengerBundle.getString('recipientAccessKey')); } else { senderOrRecipientMenuitem.setAttribute('label',gMessengerBundle.getString('senderColumnHeader')); senderOrRecipientMenuitem.setAttribute('accesskey',gMessengerBundle.getString('senderAccessKey')); } } var sortOrder = gDBView.sortOrder; setSortByMenuItemCheckState("sortAscending", (sortOrder == nsMsgViewSortOrder.ascending)); setSortByMenuItemCheckState("sortDescending", (sortOrder == nsMsgViewSortOrder.descending));}
setSortByMenuItemCheckState("sortBySenderMenuitem", (sortType == nsMsgViewSortType.byAuthor));
function InitViewSortByMenu(){ var sortType = gDBView.sortType; setSortByMenuItemCheckState("sortByDateMenuitem", (sortType == nsMsgViewSortType.byDate)); setSortByMenuItemCheckState("sortByFlagMenuitem", (sortType == nsMsgViewSortType.byFlagged)); setSortByMenuItemCheckState("sortByOrderReceivedMenuitem", (sortType == nsMsgViewSortType.byId)); setSortByMenuItemCheckState("sortByPriorityMenuitem", (sortType == nsMsgViewSortType.byPriority)); setSortByMenuItemCheckState("sortBySenderMenuitem", (sortType == nsMsgViewSortType.byAuthor)); setSortByMenuItemCheckState("sortBySizeMenuitem", (sortType == nsMsgViewSortType.bySize)); setSortByMenuItemCheckState("sortByStatusMenuitem", (sortType == nsMsgViewSortType.byStatus)); setSortByMenuItemCheckState("sortBySubjectMenuitem", (sortType == nsMsgViewSortType.bySubject)); setSortByMenuItemCheckState("sortByThreadMenuitem", (sortType == nsMsgViewSortType.byThread)); setSortByMenuItemCheckState("sortByUnreadMenuitem", (sortType == nsMsgViewSortType.byUnread)); var sortOrder = gDBView.sortOrder; setSortByMenuItemCheckState("sortAscending", (sortOrder == nsMsgViewSortOrder.ascending)); setSortByMenuItemCheckState("sortDescending", (sortOrder == nsMsgViewSortOrder.descending));}
setSortByMenuItemCheckState("sortBySenderOrRecipientMenuitem", (sortType == nsMsgViewSortType.byAuthor) || (sortType == nsMsgViewSortType.byRecipient)); var senderOrRecipientMenuitem = document.getElementById("sortBySenderOrRecipientMenuitem"); if (senderOrRecipientMenuitem) { var currentFolder = gDBView.msgFolder; if (IsSpecialFolder(currentFolder, MSG_FOLDER_FLAG_SENTMAIL | MSG_FOLDER_FLAG_DRAFTS | MSG_FOLDER_FLAG_QUEUE)) { senderOrRecipientMenuitem.setAttribute('label',gMessengerBundle.getString('recipientColumnHeader')); senderOrRecipientMenuitem.setAttribute('accesskey',gMessengerBundle.getString('recipientAccessKey')); } else { senderOrRecipientMenuitem.setAttribute('label',gMessengerBundle.getString('senderColumnHeader')); senderOrRecipientMenuitem.setAttribute('accesskey',gMessengerBundle.getString('senderAccessKey')); } }
function InitViewSortByMenu(){ var sortType = gDBView.sortType; setSortByMenuItemCheckState("sortByDateMenuitem", (sortType == nsMsgViewSortType.byDate)); setSortByMenuItemCheckState("sortByFlagMenuitem", (sortType == nsMsgViewSortType.byFlagged)); setSortByMenuItemCheckState("sortByOrderReceivedMenuitem", (sortType == nsMsgViewSortType.byId)); setSortByMenuItemCheckState("sortByPriorityMenuitem", (sortType == nsMsgViewSortType.byPriority)); setSortByMenuItemCheckState("sortBySenderMenuitem", (sortType == nsMsgViewSortType.byAuthor)); setSortByMenuItemCheckState("sortBySizeMenuitem", (sortType == nsMsgViewSortType.bySize)); setSortByMenuItemCheckState("sortByStatusMenuitem", (sortType == nsMsgViewSortType.byStatus)); setSortByMenuItemCheckState("sortBySubjectMenuitem", (sortType == nsMsgViewSortType.bySubject)); setSortByMenuItemCheckState("sortByThreadMenuitem", (sortType == nsMsgViewSortType.byThread)); setSortByMenuItemCheckState("sortByUnreadMenuitem", (sortType == nsMsgViewSortType.byUnread)); var sortOrder = gDBView.sortOrder; setSortByMenuItemCheckState("sortAscending", (sortOrder == nsMsgViewSortOrder.ascending)); setSortByMenuItemCheckState("sortDescending", (sortOrder == nsMsgViewSortOrder.descending));}
if (!eventData.network || matchText.search(bogusChannels) != -1)
if (!("network" in eventData) || matchText.search(bogusChannels) != -1)
function insertChannelLink (matchText, containerTag, eventData){ var bogusChannels = /^#(include|error|define|if|ifdef|else|elsif|endif|\d+)$/i; if (!eventData.network || matchText.search(bogusChannels) != -1) { containerTag.appendChild(document.createTextNode(matchText)); return; } var encodedMatchText = fromUnicode(matchText, eventData.sourceObject); var anchor = document.createElementNS("http://www.w3.org/1999/xhtml", "html:a"); anchor.setAttribute ("href", eventData.network.getURL() + ecmaEscape(encodedMatchText)); anchor.setAttribute ("class", "chatzilla-link"); insertHyphenatedWord (matchText, anchor); containerTag.appendChild (anchor);}
"/" + escape (matchText));
"/" + escape (encodedMatchText));
function insertChannelLink (matchText, containerTag, eventData){ if (!("network" in eventData) || matchText.search (/^#(include|error|define|if|ifdef|else|elsif|endif|\d+)$/i) != -1) { containerTag.appendChild (document.createTextNode(matchText)); return; } var anchor = document.createElementNS ("http://www.w3.org/1999/xhtml", "html:a"); anchor.setAttribute ("href", "irc://" + escape(eventData.network.name) + "/" + escape (matchText)); anchor.setAttribute ("class", "chatzilla-link"); //anchor.setAttribute ("target", "_content"); insertHyphenatedWord (matchText, anchor); containerTag.appendChild (anchor); }
img.setAttribute ("title", matchText);
function insertEar (matchText, containerTag){ if (client.smileyText) containerTag.appendChild (document.createTextNode (matchText)); var img = document.createElementNS ("http://www.w3.org/1999/xhtml", "html:img"); img.setAttribute ("src", client.IMAGEDIR + "face-ear.gif"); containerTag.appendChild (img); }
if (includesToggleButton)
if (includesToggleButton && numOfEmailsInEnumerator < gNumOfEmailsToShowToggleButtonInFront)
function InsertEmailAddressUnderEnclosingBox(parentBox, parentDiv, includesToggleButton, emailAddress, fullAddress, displayName) { if ( parentBox ) { var item = document.createElement("mail-emailaddress"); var itemInDocument; if ( item && parentDiv) { if (parentDiv.childNodes.length) { var child = parentDiv.childNodes[parentDiv.childNodes.length - 1]; if (parentDiv.childNodes.length > 1 || (!includesToggleButton && parentDiv.childNodes.length >= 1) ) { var textNode = document.createElement("text"); textNode.setAttribute("value", ", "); textNode.setAttribute("class", "emailSeparator"); if (includesToggleButton) parentDiv.insertBefore(textNode, child); else parentDiv.appendChild(textNode); } if (includesToggleButton) itemInDocument = parentDiv.insertBefore(item, child); else itemInDocument = parentDiv.appendChild(item); } else { itemInDocument = parentDiv.appendChild(item); } itemInDocument.setAttribute("value", fullAddress); itemInDocument.setTextAttribute("emailAddress", emailAddress); itemInDocument.setTextAttribute("fullAddress", fullAddress); itemInDocument.setTextAttribute("displayName", displayName); if (this.AddExtraAddressProcessing != undefined) AddExtraAddressProcessing(emailAddress, itemInDocument); hdrViewSetVisible(parentBox, true); } } }
var item = document.createElement("html:a");
var item = document.createElement("titledbutton");
function InsertEmailAddressUnderEnclosingBox(parentBox, parentDiv, emailAddress, fullAddress) { if ( parentBox ) { var item = document.createElement("html:a"); if ( item && parentDiv) { item.setAttribute('href', "mailto:" + emailAddress); item.appendChild(document.createTextNode(fullAddress)); if (parentDiv.childNodes.length) { var child = parentDiv.childNodes[parentDiv.childNodes.length - 1]; if (parentDiv.childNodes.length > 1) parentDiv.insertBefore(document.createTextNode(", "), child); parentDiv.insertBefore(item, child); } else parentDiv.appendChild(item); hdrViewSetVisible(parentBox, true); } } }
item.setAttribute('href', "mailto:" + emailAddress); item.appendChild(document.createTextNode(fullAddress));
item.setAttribute("class", "emailDisplayButton"); item.setAttribute("popup", "emailAddressPopup"); item.setAttribute("value", fullAddress);
function InsertEmailAddressUnderEnclosingBox(parentBox, parentDiv, emailAddress, fullAddress) { if ( parentBox ) { var item = document.createElement("html:a"); if ( item && parentDiv) { item.setAttribute('href', "mailto:" + emailAddress); item.appendChild(document.createTextNode(fullAddress)); if (parentDiv.childNodes.length) { var child = parentDiv.childNodes[parentDiv.childNodes.length - 1]; if (parentDiv.childNodes.length > 1) parentDiv.insertBefore(document.createTextNode(", "), child); parentDiv.insertBefore(item, child); } else parentDiv.appendChild(item); hdrViewSetVisible(parentBox, true); } } }
AddExtraAddressProcessing(emailAddress, item); var addressInfo = new Object; addressInfo.emailAddress = emailAddress; addressInfo.fullAddress = fullAddress; currentAddressData[item] = addressInfo;
function InsertEmailAddressUnderEnclosingBox(parentBox, parentDiv, emailAddress, fullAddress) { if ( parentBox ) { var item = document.createElement("html:a"); if ( item && parentDiv) { item.setAttribute('href', "mailto:" + emailAddress); item.appendChild(document.createTextNode(fullAddress)); if (parentDiv.childNodes.length) { var child = parentDiv.childNodes[parentDiv.childNodes.length - 1]; if (parentDiv.childNodes.length > 1) parentDiv.insertBefore(document.createTextNode(", "), child); parentDiv.insertBefore(item, child); } else parentDiv.appendChild(item); hdrViewSetVisible(parentBox, true); } } }
itemInDocument.setAttribute("value", fullAddress);
itemInDocument.setAttribute("label", fullAddress);
function InsertEmailAddressUnderEnclosingBox(parentBox, parentDiv, includesToggleButton, emailAddress, fullAddress, displayName) { if ( parentBox ) { var item = document.createElement("mail-emailaddress"); var itemInDocument; if ( item && parentDiv) { if (parentDiv.childNodes.length) { var child = parentDiv.childNodes[parentDiv.childNodes.length - 1]; if (parentDiv.childNodes.length > 1 || (!includesToggleButton && parentDiv.childNodes.length >= 1) ) { var textNode = document.createElement("text"); textNode.setAttribute("value", ", "); textNode.setAttribute("class", "emailSeparator"); if (includesToggleButton && numOfEmailsInEnumerator < gNumOfEmailsToShowToggleButtonInFront) parentDiv.insertBefore(textNode, child); else parentDiv.appendChild(textNode); } if (includesToggleButton && numOfEmailsInEnumerator < gNumOfEmailsToShowToggleButtonInFront) itemInDocument = parentDiv.insertBefore(item, child); else itemInDocument = parentDiv.appendChild(item); } else { itemInDocument = parentDiv.appendChild(item); } itemInDocument.setAttribute("value", fullAddress); itemInDocument.setTextAttribute("emailAddress", emailAddress); itemInDocument.setTextAttribute("fullAddress", fullAddress); itemInDocument.setTextAttribute("displayName", displayName); if (this.AddExtraAddressProcessing != undefined) AddExtraAddressProcessing(emailAddress, itemInDocument); hdrViewSetVisible(parentBox, true); } } }
span.setAttribute ("title", emoticon);
function insertSmiley (emoticon, containerTag){ var type = "error"; if (emoticon.search (/\;[-^v]?[\)>\]]/) != -1) type = "face-wink"; else if (emoticon.search (/[=:;][-^v]?[\)>\]]/) != -1) type = "face-smile"; else if (emoticon.search (/[=:;][-^v]?[\/\\]/) != -1) type = "face-screw"; else if (emoticon.search (/[=:;]\~[-^v]?\(/) != -1) type = "face-cry"; else if (emoticon.search (/[=:;][-^v]?[\(<\[]/) != -1) type = "face-frown"; else if (emoticon.search (/\<?[=:;][-^v]?[0oO]/) != -1) type = "face-surprise"; else if (emoticon.search (/[=:;][-^v]?[pP]/) != -1) type = "face-tongue"; else if (emoticon.search (/\>?[=:;][\-\^\v]?[\(\|]/) != -1) type = "face-angry"; var span = document.createElementNS ("http://www.w3.org/1999/xhtml", "html:span"); /* create a span to hold the emoticon text */ span.setAttribute ("class", "chatzilla-emote-txt"); span.setAttribute ("type", type); span.appendChild (document.createTextNode (emoticon)); containerTag.appendChild (span); /* create an empty span after the text. this span will have an image added * after it with a chatzilla-emote:after css rule. using * chatzilla-emote-txt:after is not good enough because it does not allow us * to turn off the emoticon text, but keep the image. ie. * chatzilla-emote-txt { display: none; } turns off chatzilla-emote-txt:after * as well.*/ span = document.createElementNS ("http://www.w3.org/1999/xhtml", "html:span"); span.setAttribute ("class", "chatzilla-emote"); span.setAttribute ("type", type); containerTag.appendChild (span); }