rem
stringlengths 0
126k
| add
stringlengths 0
441k
| context
stringlengths 15
136k
|
---|---|---|
aFilePicker.appendFilter(bundle.GetStringFromName("AllFilesFilter"), "*.*"); | aFilePicker.appendFilters(Components.interfaces.nsIFilePicker.filterAll); | function appendFiltersForContentType(aFilePicker, aContentType, aSaveMode){ var bundle = getStringBundle(); switch (aContentType) { case "text/html": if (aSaveMode == MODE_COMPLETE) aFilePicker.appendFilter(bundle.GetStringFromName("WebPageCompleteFilter"), "*.htm; *.html"); aFilePicker.appendFilter(bundle.GetStringFromName("WebPageHTMLOnlyFilter"), "*.htm; *.html"); if (aSaveMode == MODE_COMPLETE) aFilePicker.appendFilter(bundle.GetStringFromName("TextOnlyFilter"), "*.txt"); break; default: var mimeInfo = getMIMEInfoForType(aContentType); if (mimeInfo) { var extCount = { }; var extList = { }; mimeInfo.GetFileExtensions(extCount, extList); var extString = ""; for (var i = 0; i < extCount.value; ++i) { if (i > 0) extString += "; "; // If adding more than one extension, separate by semi-colon extString += "*." + extList.value[i]; } if (extCount.value > 0) { aFilePicker.appendFilter(mimeInfo.Description, extString); } else { aFilePicker.appendFilter(bundle.GetStringFromName("AllFilesFilter"), "*.*"); } } else aFilePicker.appendFilter(bundle.GetStringFromName("AllFilesFilter"), "*.*"); break; }} |
case "application/xhtml+xml": if (aSaveMode == MODE_COMPLETE) aFilePicker.appendFilter(bundle.GetStringFromName("WebPageCompleteFilter"), "*.xht; *.xhtml"); aFilePicker.appendFilter(bundle.GetStringFromName("WebPageXHTMLOnlyFilter"), "*.xht; *.xhtml"); if (aSaveMode == MODE_COMPLETE) aFilePicker.appendFilters(Components.interfaces.nsIFilePicker.filterText); break; case "text/xml": case "application/xml": if (aSaveMode == MODE_COMPLETE) aFilePicker.appendFilter(bundle.GetStringFromName("WebPageCompleteFilter"), "*.xml"); aFilePicker.appendFilter(bundle.GetStringFromName("WebPageXMLOnlyFilter"), "*.xml"); break; | function appendFiltersForContentType(aFilePicker, aContentType, aSaveMode){ var bundle = getStringBundle(); switch (aContentType) { case "text/html": if (aSaveMode == MODE_COMPLETE) aFilePicker.appendFilter(bundle.GetStringFromName("WebPageCompleteFilter"), "*.htm; *.html"); aFilePicker.appendFilter(bundle.GetStringFromName("WebPageHTMLOnlyFilter"), "*.htm; *.html"); if (aSaveMode == MODE_COMPLETE) aFilePicker.appendFilters(Components.interfaces.nsIFilePicker.filterText); break; default: var mimeInfo = getMIMEInfoForType(aContentType); if (mimeInfo) { var extCount = { }; var extList = { }; mimeInfo.GetFileExtensions(extCount, extList); var extString = ""; for (var i = 0; i < extCount.value; ++i) { if (i > 0) extString += "; "; // If adding more than one extension, separate by semi-colon extString += "*." + extList.value[i]; } if (extCount.value > 0) { aFilePicker.appendFilter(mimeInfo.Description, extString); } else { aFilePicker.appendFilters(Components.interfaces.nsIFilePicker.filterAll); } } else aFilePicker.appendFilters(Components.interfaces.nsIFilePicker.filterAll); break; }} |
|
list.push(info.getInfoForParam(i, p).name); | var name; try { name = info.getInfoForParam(i, p).name; } catch(e) { name = MISSING_INTERFACE; } list.push(name); | function appendForwardDeclarations(list, info){ list.push(info.name); if(info.parent) appendForwardDeclarations(list, info.parent); var i, k, m, p; for(i = 0; i < info.methodCount; i++) { m = info.getMethodInfo(i); for(k = 0; k < m.paramCount; k++) { p = m.getParam(k); if(p.type.dataType == nsIDataType.VTYPE_INTERFACE) { list.push(info.getInfoForParam(i, p).name); } } }} |
head.appendChild(element); | { var position = 0; if (head.hasChildNodes()) position = head.childNodes.length; editorShell.InsertElement(element, head, position); } | function AppendHeadElement(element){ var head = GetHeadElement(); if (head) head.appendChild(element);} |
num_errors++; | function appendMessage(messageObject){ if(messageObject.message == "__CLEAR__") {return;} var c = document.getElementById("consoleTreeChildren"); var item = document.createElement("treeitem"); var row = document.createElement("treerow"); var cell = document.createElement("treecell"); cell.setAttribute("class", "treecell-error"); var msgContent; var text; try { // Try to QI it to a script error to get more info. var nsIScriptError = Components.interfaces.nsIScriptError; var scriptError = messageObject.QueryInterface(nsIScriptError); // Is this error actually just a non-fatal warning? var warning = scriptError.flags & nsIScriptError.warningFlag != 0; // Is this error or warning a result of JavaScript's strict mode, // and therefore something we might decide to be lenient about? var strict = scriptError.flags & nsIScriptError.strictFlag != 0; // If true, this error led to the creation of a (catchable!) javascript // exception, and should probably be ignored. // This is worth checking, as I'm not sure how the behavior falls // out. Does an uncaught exception result in this flag being raised? var isexn = scriptError.flags & nsIScriptError.exceptionFlag != 0; /* * It'd be nice to do something graphical with our column information, * like what the old js console did, and the js shell does: * js> var scooby = "I am an unterminated string! * 1: unterminated string literal: * 1: var scooby = "I am an unterminated string! * 1: .............^ * * But for now, I'm just pushing it out the door. */ cell.setAttribute("type", warning ? "warning" : "error"); // XXX localize cell.setAttribute("typetext", warning ? "Warning: " : "Error: "); cell.setAttribute("url", scriptError.sourceName); cell.setAttribute("line", scriptError.lineNumber); cell.setAttribute("col", scriptError.columnNumber); cell.setAttribute("msg", scriptError.message); cell.setAttribute("error", scriptError.sourceLine); } catch (exn) {// dump(exn + '\n'); // QI failed, just try to treat it as an nsIConsoleMessage cell.setAttribute("msg", messageObject.message); } row.appendChild(cell); item.appendChild(row); c.appendChild(item); num_errors++; //Deletes top error if error console is long if(num_errors>250) { deleteOne(); }} |
|
if(num_errors>250) { deleteOne(); } | num_errors++; if(num_errors>250) { deleteOne(); } | function appendMessage(messageObject){ if(messageObject.message == "__CLEAR__") {return;} var c = document.getElementById("consoleTreeChildren"); var item = document.createElement("treeitem"); var row = document.createElement("treerow"); var cell = document.createElement("treecell"); cell.setAttribute("class", "treecell-error"); var msgContent; var text; try { // Try to QI it to a script error to get more info. var nsIScriptError = Components.interfaces.nsIScriptError; var scriptError = messageObject.QueryInterface(nsIScriptError); // Is this error actually just a non-fatal warning? var warning = scriptError.flags & nsIScriptError.warningFlag != 0; // Is this error or warning a result of JavaScript's strict mode, // and therefore something we might decide to be lenient about? var strict = scriptError.flags & nsIScriptError.strictFlag != 0; // If true, this error led to the creation of a (catchable!) javascript // exception, and should probably be ignored. // This is worth checking, as I'm not sure how the behavior falls // out. Does an uncaught exception result in this flag being raised? var isexn = scriptError.flags & nsIScriptError.exceptionFlag != 0; /* * It'd be nice to do something graphical with our column information, * like what the old js console did, and the js shell does: * js> var scooby = "I am an unterminated string! * 1: unterminated string literal: * 1: var scooby = "I am an unterminated string! * 1: .............^ * * But for now, I'm just pushing it out the door. */ cell.setAttribute("type", warning ? "warning" : "error"); // XXX localize cell.setAttribute("typetext", warning ? "Warning: " : "Error: "); cell.setAttribute("url", scriptError.sourceName); cell.setAttribute("line", scriptError.lineNumber); cell.setAttribute("col", scriptError.columnNumber); cell.setAttribute("msg", scriptError.message); cell.setAttribute("error", scriptError.sourceLine); } catch (exn) {// dump(exn + '\n'); // QI failed, just try to treat it as an nsIConsoleMessage cell.setAttribute("msg", messageObject.message); } row.appendChild(cell); item.appendChild(row); c.appendChild(item); num_errors++; //Deletes top error if error console is long if(num_errors>250) { deleteOne(); }} |
appendOption: function appendOption(child, parent) { var index = itemArray.length; treeBoxObject.invalidateRange(this.lastChild(), index); itemArray.push(new optionObject(child, 1)); treeBoxObject.rowCountChanged(index, 1); selectTreeIndex(index, false); }, | optgroupObject.prototype.appendOption = function appendOption(child, parent) { var index = gDialog.nextChild(parent); treeBoxObject.invalidatePrimaryCell(index - 1); itemArray.splice(index, 0, new optionObject(child, 2)); treeBoxObject.rowCountChanged(index, 1); selectTreeIndex(index, false); }; | appendOption: function appendOption(child, parent) { var index = itemArray.length; // XXX need to repaint the lines, tree won't do this treeBoxObject.invalidateRange(this.lastChild(), index); // append the wrapped object itemArray.push(new optionObject(child, 1)); treeBoxObject.rowCountChanged(index, 1); selectTreeIndex(index, false); }, |
this.listElement.appendChild(popupNode); | this.paperListElement.appendChild(popupNode); | appendPaperNames: function (aDataObject) { var popupNode = document.createElement("menupopup"); for (var i=0;i<aDataObject.length;i++) { var paperObj = aDataObject[i]; var itemNode = document.createElement("menuitem"); var label; try { label = gStringBundle.GetStringFromName(paperObj.name) } catch (e) { /* No name in string bundle ? Then build one manually (this * usually happens when gPaperArray was build by createPaperArrayFromPrinterFeatures() ...) */ if (paperObj.inches) { label = paperObj.name + " (" + round10(paperObj.width) + "x" + round10(paperObj.height) + " inch)"; } else { label = paperObj.name + " (" + paperObj.width + "x" + paperObj.height + " mm)"; } } itemNode.setAttribute("label", label); itemNode.setAttribute("value", i); popupNode.appendChild(itemNode); } this.listElement.appendChild(popupNode); } |
menuItem.setAttribute("value", itemString); menuItem.setAttribute("data", url); | menuItem.setAttribute("label", itemString); menuItem.setAttribute("value", url); | function AppendRecentMenuitem(menupopup, title, url, menuIndex){ if (menupopup) { var menuItem = document.createElementNS("http://www.mozilla.org/keymaster/gatekeeper/there.is.only.xul", "menuitem"); if (menuItem) { var accessKey; if (menuIndex <= 9) accessKey = String(menuIndex); else if (menuIndex == 10) accessKey = "0"; else accessKey = " "; var itemString = accessKey+" "; // Show "title [url]" or just the URL if (title) { itemString += title; itemString += " ["; } itemString += url; if (title) itemString += "]"; menuItem.setAttribute("value", itemString); menuItem.setAttribute("data", url); if (accessKey != " ") menuItem.setAttribute("accesskey", accessKey); menuItem.setAttribute("oncommand", "EditorOpenUrl(getAttribute('data'))"); menupopup.appendChild(menuItem); } }} |
menuItem.setAttribute("accesskey", accessKey); menuItem.setAttribute("oncommand", "EditorOpenUrl(getAttribute('data'))"); | menuItem.setAttribute("accesskey", accessKey); menuItem.setAttribute("oncommand", "EditorOpenUrl(getAttribute('value'))"); | function AppendRecentMenuitem(menupopup, title, url, menuIndex){ if (menupopup) { var menuItem = document.createElementNS("http://www.mozilla.org/keymaster/gatekeeper/there.is.only.xul", "menuitem"); if (menuItem) { var accessKey; if (menuIndex <= 9) accessKey = String(menuIndex); else if (menuIndex == 10) accessKey = "0"; else accessKey = " "; var itemString = accessKey+" "; // Show "title [url]" or just the URL if (title) { itemString += title; itemString += " ["; } itemString += url; if (title) itemString += "]"; menuItem.setAttribute("value", itemString); menuItem.setAttribute("data", url); if (accessKey != " ") menuItem.setAttribute("accesskey", accessKey); menuItem.setAttribute("oncommand", "EditorOpenUrl(getAttribute('data'))"); menupopup.appendChild(menuItem); } }} |
menuItemNode.setAttribute( "value", aString ); | menuItemNode.setAttribute( "label", aString ); | appendString: function ( aString ) { var menuItemNode = document.createElement( "menuitem" ); if( menuItemNode ) { menuItemNode.setAttribute( "value", aString ); this.listElement.firstChild.appendChild( menuItemNode ); } }, |
var itemNode = document.createElement( "menuitem" ); | appendStrings: function ( aDataObject ) { var popupNode = document.createElement( "menupopup" ); faces = aDataObject.toString().split(","); faces.sort(); for( var i = 0; i < faces.length; i++ ) { var itemNode = document.createElement( "menuitem" ); if( faces[i] == "" ) { itemNode.setAttribute( "data", faces[i] ); itemNode.setAttribute( "value", bundle.GetStringFromName("nofontsforlang") ); } else { itemNode.setAttribute( "data", faces[i] ); itemNode.setAttribute( "value", faces[i] ); } popupNode.appendChild( itemNode ); } this.listElement.appendChild( popupNode ); } |
|
itemNode.setAttribute( "data", faces[i] ); itemNode.setAttribute( "value", bundle.GetStringFromName("nofontsforlang") ); | this.listElement.setAttribute( "data", faces[i] ); this.listElement.setAttribute( "value", bundle.GetStringFromName("nofontsforlang") ); this.listElement.setAttribute( "disabled", "true" ); gNoFontsForThisLang = true; | appendStrings: function ( aDataObject ) { var popupNode = document.createElement( "menupopup" ); faces = aDataObject.toString().split(","); faces.sort(); for( var i = 0; i < faces.length; i++ ) { var itemNode = document.createElement( "menuitem" ); if( faces[i] == "" ) { itemNode.setAttribute( "data", faces[i] ); itemNode.setAttribute( "value", bundle.GetStringFromName("nofontsforlang") ); } else { itemNode.setAttribute( "data", faces[i] ); itemNode.setAttribute( "value", faces[i] ); } popupNode.appendChild( itemNode ); } this.listElement.appendChild( popupNode ); } |
popupNode.appendChild( itemNode ); | appendStrings: function ( aDataObject ) { var popupNode = document.createElement( "menupopup" ); faces = aDataObject.toString().split(","); faces.sort(); for( var i = 0; i < faces.length; i++ ) { var itemNode = document.createElement( "menuitem" ); if( faces[i] == "" ) { itemNode.setAttribute( "data", faces[i] ); itemNode.setAttribute( "value", bundle.GetStringFromName("nofontsforlang") ); } else { itemNode.setAttribute( "data", faces[i] ); itemNode.setAttribute( "value", faces[i] ); } popupNode.appendChild( itemNode ); } this.listElement.appendChild( popupNode ); } |
|
this.listElement.setAttribute( "data", faces[i] ); this.listElement.setAttribute("value", gPrefutilitiesBundle.getString("nofontsforlang")); | this.listElement.setAttribute( "value", faces[i] ); this.listElement.setAttribute( "label", gPrefutilitiesBundle.getString("nofontsforlang") ); | appendStrings: function ( aDataObject ) { var popupNode = document.createElement( "menupopup" ); faces = aDataObject.toString().split(","); faces.sort(); for( var i = 0; i < faces.length; i++ ) { if( faces[i] == "" ) { this.listElement.setAttribute( "data", faces[i] ); this.listElement.setAttribute("value", gPrefutilitiesBundle.getString("nofontsforlang")); this.listElement.setAttribute( "disabled", "true" ); gNoFontsForThisLang = true; // hack, hack hack! } else { var itemNode = document.createElement( "menuitem" ); itemNode.setAttribute( "data", faces[i] ); itemNode.setAttribute( "value", faces[i] ); this.listElement.removeAttribute( "disabled" ); gNoFontsForThisLang = false; // hack, hack hack! popupNode.appendChild( itemNode ); } } this.listElement.appendChild( popupNode ); } |
itemNode.setAttribute( "data", faces[i] ); | appendStrings: function ( aDataObject ) { var popupNode = document.createElement( "menupopup" ); faces = aDataObject.toString().split(","); faces.sort(); for( var i = 0; i < faces.length; i++ ) { if( faces[i] == "" ) { this.listElement.setAttribute( "data", faces[i] ); this.listElement.setAttribute("value", gPrefutilitiesBundle.getString("nofontsforlang")); this.listElement.setAttribute( "disabled", "true" ); gNoFontsForThisLang = true; // hack, hack hack! } else { var itemNode = document.createElement( "menuitem" ); itemNode.setAttribute( "data", faces[i] ); itemNode.setAttribute( "value", faces[i] ); this.listElement.removeAttribute( "disabled" ); gNoFontsForThisLang = false; // hack, hack hack! popupNode.appendChild( itemNode ); } } this.listElement.appendChild( popupNode ); } |
|
itemNode.setAttribute( "label", faces[i] ); | appendStrings: function ( aDataObject ) { var popupNode = document.createElement( "menupopup" ); faces = aDataObject.toString().split(","); faces.sort(); for( var i = 0; i < faces.length; i++ ) { if( faces[i] == "" ) { this.listElement.setAttribute( "data", faces[i] ); this.listElement.setAttribute("value", gPrefutilitiesBundle.getString("nofontsforlang")); this.listElement.setAttribute( "disabled", "true" ); gNoFontsForThisLang = true; // hack, hack hack! } else { var itemNode = document.createElement( "menuitem" ); itemNode.setAttribute( "data", faces[i] ); itemNode.setAttribute( "value", faces[i] ); this.listElement.removeAttribute( "disabled" ); gNoFontsForThisLang = false; // hack, hack hack! popupNode.appendChild( itemNode ); } } this.listElement.appendChild( popupNode ); } |
|
this.listElement.setAttribute( "value", bundle.GetStringFromName("nofontsforlang") ); | this.listElement.setAttribute("value", gPrefutilitiesBundle.getString("nofontsforlang")); | appendStrings: function ( aDataObject ) { var popupNode = document.createElement( "menupopup" ); faces = aDataObject.toString().split(","); faces.sort(); for( var i = 0; i < faces.length; i++ ) { if( faces[i] == "" ) { this.listElement.setAttribute( "data", faces[i] ); this.listElement.setAttribute( "value", bundle.GetStringFromName("nofontsforlang") ); this.listElement.setAttribute( "disabled", "true" ); gNoFontsForThisLang = true; // hack, hack hack! } else { var itemNode = document.createElement( "menuitem" ); itemNode.setAttribute( "data", faces[i] ); itemNode.setAttribute( "value", faces[i] ); this.listElement.removeAttribute( "disabled" ); gNoFontsForThisLang = false; // hack, hack hack! popupNode.appendChild( itemNode ); } } this.listElement.appendChild( popupNode ); } |
dump("**** Append String = "+string+"\n"); | function AppendStringToList(list, string){ dump("**** Append String = "+string+"\n"); // THIS DOESN'T WORK! Result is a XULElement -- namespace problem //optionNode1 = document.createElement("option"); // "Unsanctioned method from Vidur: // createElementWithNamespace("http://... [the HTML4 URL], "option); // This works - Thanks to Vidur! Params = name, value optionNode = new Option(string, string); if (optionNode) { list.add(optionNode, null); } else { dump("Failed to create OPTION node. String content="+string+"\n"); }} |
|
optionNode = new Option(string, string); | function AppendStringToList(list, string){ dump("**** Append String = "+string+"\n"); // THIS DOESN'T WORK! Result is a XULElement -- namespace problem //optionNode1 = document.createElement("option"); // "Unsanctioned method from Vidur: // createElementWithNamespace("http://... [the HTML4 URL], "option); // This works - Thanks to Vidur! Params = name, value optionNode = new Option(string, string); if (optionNode) { list.add(optionNode, null); } else { dump("Failed to create OPTION node. String content="+string+"\n"); }} |
|
optionNode = new Option(string, string); | function AppendStringToList(list, string){ dump("**** Append String = "+string+"\n"); // THIS DOESN'T WORK! Result is a XULElement -- namespace problem //optionNode1 = document.createElement("option"); // "Unsanctioned method from Vidur: // createElementWithNamespace("http://... [the HTML4 URL], "option); // This works - Thanks to Vidur! Params = name, value optionNode = new Option(string, string); if (optionNode) { list.add(optionNode, null); } else { dump("Failed to create OPTION node. String content="+string+"\n"); }} |
|
menuItem.setAttribute("value", string); | menuItem.setAttribute("label", string); | function AppendStringToMenulist(menulist, string){ if (menulist) { var menupopup = menulist.firstChild; // May not have any popup yet -- so create one if (!menupopup) { menupopup = document.createElementNS("http://www.mozilla.org/keymaster/gatekeeper/there.is.only.xul", "menupopup"); if (menupopup) menulist.appendChild(menupopup); else { dump("Failed to create menupoup\n"); return null; } } var menuItem = document.createElementNS("http://www.mozilla.org/keymaster/gatekeeper/there.is.only.xul", "menuitem"); if (menuItem) { menuItem.setAttribute("value", string); menupopup.appendChild(menuItem); return menuItem; } } return null;} |
dump("AppendStringToTreelist: string="+string+"\n"); | function AppendStringToTreelist(tree, string){dump("AppendStringToTreelist: string="+string+"\n"); if (tree) { var treecols = tree.firstChild; if (!treecols) { dump("Bad XUL: Must have <treecolgroup> as first child\n"); } var treechildren = treecols.nextSibling; if (!treechildren) { treechildren = document.createElementNS("http://www.mozilla.org/keymaster/gatekeeper/there.is.only.xul", "treechildren"); if (treechildren) { treechildren.setAttribute("flex","1"); tree.appendChild(treechildren); } else { dump("Failed to create <treechildren>\n"); return null; } } var treeitem = document.createElementNS("http://www.mozilla.org/keymaster/gatekeeper/there.is.only.xul", "treeitem"); var treerow = document.createElementNS("http://www.mozilla.org/keymaster/gatekeeper/there.is.only.xul", "treerow"); var treecell = document.createElementNS("http://www.mozilla.org/keymaster/gatekeeper/there.is.only.xul", "treecell"); if (treeitem && treerow && treecell) { treerow.appendChild(treecell); treeitem.appendChild(treerow); treechildren.appendChild(treeitem) treecell.setAttribute("value", string); var len = Number(tree.getAttribute("length")); if (!len) len = -1; tree.setAttribute("length",len+1); return treeitem; } } return null;} |
|
var len = Number(tree.getAttribute("length")); if (!len) len = -1; tree.setAttribute("length",len+1); | tree.setAttribute("length", treechildren.childNodes.length); | function AppendStringToTreelist(tree, string){dump("AppendStringToTreelist: string="+string+"\n"); if (tree) { var treecols = tree.firstChild; if (!treecols) { dump("Bad XUL: Must have <treecolgroup> as first child\n"); } var treechildren = treecols.nextSibling; if (!treechildren) { treechildren = document.createElementNS("http://www.mozilla.org/keymaster/gatekeeper/there.is.only.xul", "treechildren"); if (treechildren) { treechildren.setAttribute("flex","1"); tree.appendChild(treechildren); } else { dump("Failed to create <treechildren>\n"); return null; } } var treeitem = document.createElementNS("http://www.mozilla.org/keymaster/gatekeeper/there.is.only.xul", "treeitem"); var treerow = document.createElementNS("http://www.mozilla.org/keymaster/gatekeeper/there.is.only.xul", "treerow"); var treecell = document.createElementNS("http://www.mozilla.org/keymaster/gatekeeper/there.is.only.xul", "treecell"); if (treeitem && treerow && treecell) { treerow.appendChild(treecell); treeitem.appendChild(treerow); treechildren.appendChild(treeitem) treecell.setAttribute("value", string); var len = Number(tree.getAttribute("length")); if (!len) len = -1; tree.setAttribute("length",len+1); return treeitem; } } return null;} |
treeeitem.appendChild(treerow); | treeitem.appendChild(treerow); | function AppendStringToTreelist(tree, string){ if (tree) { var treechildren = tree.firstChild; if (!treechildren) { treechildren = document.createElement("treechildren"); if (treechildren) tree.appendChild(treechildren); else {dump("Failed to create <treechildren>\n"); return null; } } var treeitem = document.createElement("treeitem"); var treerow = document.createElement("treerow"); var treecell = document.createElement("treecell"); if (treeitem && treerow && treecell) { treerow.appendChild(treecell); treeeitem.appendChild(treerow); treechildren.appendChild(treeitem) treecell.setAttribute("value", string); return menuItem; } } return null;} |
return menuItem; | var len = Number(tree.getAttribute("length")); if (!len) len = -1; tree.setAttribute("length",len+1); return treeitem; | function AppendStringToTreelist(tree, string){ if (tree) { var treechildren = tree.firstChild; if (!treechildren) { treechildren = document.createElement("treechildren"); if (treechildren) tree.appendChild(treechildren); else {dump("Failed to create <treechildren>\n"); return null; } } var treeitem = document.createElement("treeitem"); var treerow = document.createElement("treerow"); var treecell = document.createElement("treecell"); if (treeitem && treerow && treecell) { treerow.appendChild(treecell); treeeitem.appendChild(treerow); treechildren.appendChild(treeitem) treecell.setAttribute("value", string); return menuItem; } } return null;} |
treecell.setAttribute("value", string); | treecell.setAttribute("label", string); | function AppendStringToTreelist(tree, string){ if (tree) { var treechildren = document.getElementById('child'); var treeitem = document.createElementNS("http://www.mozilla.org/keymaster/gatekeeper/there.is.only.xul", "treeitem"); var treerow = document.createElementNS("http://www.mozilla.org/keymaster/gatekeeper/there.is.only.xul", "treerow"); var treecell = document.createElementNS("http://www.mozilla.org/keymaster/gatekeeper/there.is.only.xul", "treecell"); if (treeitem && treerow && treecell) { treecell.setAttribute("value", string); treerow.appendChild(treecell); treeitem.appendChild(treerow); treechildren.appendChild(treeitem) var len = Number(tree.getAttribute("length")); if (!len) len = -1; tree.setAttribute("length",len+1); return treeitem; } } return null;} |
treecell.setAttribute("value", string); | treecell.setAttribute("label", string); | function AppendStringToTreelist(tree, string){ if (tree) { var treecols = tree.firstChild; if (!treecols) { dump("Bad XUL: Must have <treecolgroup> as first child\n"); } var treechildren = treecols.nextSibling; if (!treechildren) { treechildren = document.createElementNS("http://www.mozilla.org/keymaster/gatekeeper/there.is.only.xul", "treechildren"); if (treechildren) { treechildren.setAttribute("flex","1"); tree.appendChild(treechildren); } else { dump("Failed to create <treechildren>\n"); return null; } } var treeitem = document.createElementNS("http://www.mozilla.org/keymaster/gatekeeper/there.is.only.xul", "treeitem"); var treerow = document.createElementNS("http://www.mozilla.org/keymaster/gatekeeper/there.is.only.xul", "treerow"); var treecell = document.createElementNS("http://www.mozilla.org/keymaster/gatekeeper/there.is.only.xul", "treecell"); if (treeitem && treerow && treecell) { treerow.appendChild(treecell); treeitem.appendChild(treerow); treechildren.appendChild(treeitem) treecell.setAttribute("value", string); //var len = Number(tree.getAttribute("length")); //if (!len) len = -1; tree.setAttribute("length", treechildren.childNodes.length); return treeitem; } } return null;} |
menuItem = document.createElementNS("http: | var menuItem = document.createElementNS("http: | function AppendValueAndDataToMenulist(menulist, valueStr, dataStr){ if (menulist) { var menupopup = menulist.firstChild; // May not have any popup yet -- so create one if (!menupopup) { menupopup = document.createElementNS("http://www.mozilla.org/keymaster/gatekeeper/there.is.only.xul", "menupopup"); if (menupopup) menulist.appendChild(menupopup); else { dump("Failed to create menupoup\n"); return null; } } menuItem = document.createElementNS("http://www.mozilla.org/keymaster/gatekeeper/there.is.only.xul", "menuitem"); if (menuItem) { menuItem.setAttribute("value", valueStr); menuItem.setAttribute("data", dataStr); menupopup.appendChild(menuItem); return menuItem; } } return null;} |
if (dialog.CellImageCheckbox.checked) CloneAttribute(destElement, globalCellElement, "background"); | function ApplyAttributesToOneCell(destElement){ if (dialog.CellHeightCheckbox.checked) CloneAttribute(destElement, globalCellElement, "height"); if (dialog.CellWidthCheckbox.checked) CloneAttribute(destElement, globalCellElement, "width"); if (dialog.RowSpanCheckbox.checked && dialog.RowSpanCheckbox.getAttribute("disabled") != "true") CloneAttribute(destElement, globalCellElement, "rowspan"); if (dialog.ColSpanCheckbox.checked && dialog.ColSpanCheckbox.getAttribute("disabled") != "true") CloneAttribute(destElement, globalCellElement, "colspan"); if (dialog.CellHAlignCheckbox.checked) { CloneAttribute(destElement, globalCellElement, "align"); CloneAttribute(destElement, globalCellElement, charStr); } if (dialog.CellVAlignCheckbox.checked) CloneAttribute(destElement, globalCellElement, "valign"); if (dialog.TextWrapCheckbox.checked) CloneAttribute(destElement, globalCellElement, "nowrap"); if (dialog.CellColorCheckbox.checked) CloneAttribute(destElement, globalCellElement, "bgcolor"); if (dialog.CellImageCheckbox.checked) CloneAttribute(destElement, globalCellElement, "background"); if (dialog.CellStyleCheckbox.checked) { var newStyleIndex = dialog.CellStyleList.selectedIndex; var currentStyleIndex = (destElement.nodeName == "TH") ? 1 : 0; if (newStyleIndex != currentStyleIndex) { // Switch cell types // (replaces with new cell and copies attributes and contents) destElement = editorShell.SwitchTableCellHeaderType(destElement); CurrentStyleIndex = newStyleIndex; } }} |
|
var appShell = Components.classes['@mozilla.org/appshell/appShellService;1'].getService(); appShell = appShell.QueryInterface(Components.interfaces.nsIAppShellService); | var appStartup = Components.classes["@mozilla.org/toolkit/app-startup;1"] .getService(Components.interfaces.nsIAppStartup); | function applySkin(){ var data = parent.hPrefWindow.wsm.dataManager.pageData["chrome://communicator/content/pref/pref-themes.xul"]; if (data.name == null) return; var theme = null; try { theme = parent.hPrefWindow.pref.getComplexValue("general.skins.selectedSkin", Components.interfaces.nsISupportsString).data; } catch (e) { } if (theme == data.name) return; try { var reg = Components.classes["@mozilla.org/chrome/chrome-registry;1"]. getService(Components.interfaces.nsIChromeRegistrySea); } catch(e) {} var inUse = reg.isSkinSelected(data.name, true); if (!theme && inUse == Components.interfaces.nsIChromeRegistry.FULL) return; parent.hPrefWindow.setPref("string", "general.skins.selectedSkin", data.name); // shut down quicklaunch so the next launch will have the new skin var appShell = Components.classes['@mozilla.org/appshell/appShellService;1'].getService(); appShell = appShell.QueryInterface(Components.interfaces.nsIAppShellService); try { appShell.nativeAppSupport.isServerMode = false; } catch(ex) { } var promptService = Components.classes["@mozilla.org/embedcomp/prompt-service;1"].getService(Components.interfaces.nsIPromptService); var strBundleService = Components.classes["@mozilla.org/intl/stringbundle;1"].getService(); strBundleService = strBundleService.QueryInterface(Components.interfaces.nsIStringBundleService); var navbundle = strBundleService.createBundle("chrome://navigator/locale/navigator.properties"); var brandbundle = strBundleService.createBundle("chrome://global/locale/brand.properties"); if (promptService && navbundle && brandbundle) { var dialogTitle = navbundle.GetStringFromName("switchskinstitle"); var brandName = brandbundle.GetStringFromName("brandShortName"); var msg = navbundle.formatStringFromName("switchskins", [brandName], 1); promptService.alert(window, dialogTitle, msg); }} |
appShell.nativeAppSupport.isServerMode = false; | appStartup.nativeAppSupport.isServerMode = false; | function applySkin(){ var data = parent.hPrefWindow.wsm.dataManager.pageData["chrome://communicator/content/pref/pref-themes.xul"]; if (data.name == null) return; var theme = null; try { theme = parent.hPrefWindow.pref.getComplexValue("general.skins.selectedSkin", Components.interfaces.nsISupportsString).data; } catch (e) { } if (theme == data.name) return; try { var reg = Components.classes["@mozilla.org/chrome/chrome-registry;1"]. getService(Components.interfaces.nsIChromeRegistrySea); } catch(e) {} var inUse = reg.isSkinSelected(data.name, true); if (!theme && inUse == Components.interfaces.nsIChromeRegistry.FULL) return; parent.hPrefWindow.setPref("string", "general.skins.selectedSkin", data.name); // shut down quicklaunch so the next launch will have the new skin var appShell = Components.classes['@mozilla.org/appshell/appShellService;1'].getService(); appShell = appShell.QueryInterface(Components.interfaces.nsIAppShellService); try { appShell.nativeAppSupport.isServerMode = false; } catch(ex) { } var promptService = Components.classes["@mozilla.org/embedcomp/prompt-service;1"].getService(Components.interfaces.nsIPromptService); var strBundleService = Components.classes["@mozilla.org/intl/stringbundle;1"].getService(); strBundleService = strBundleService.QueryInterface(Components.interfaces.nsIStringBundleService); var navbundle = strBundleService.createBundle("chrome://navigator/locale/navigator.properties"); var brandbundle = strBundleService.createBundle("chrome://global/locale/brand.properties"); if (promptService && navbundle && brandbundle) { var dialogTitle = navbundle.GetStringFromName("switchskinstitle"); var brandName = brandbundle.GetStringFromName("brandShortName"); var msg = navbundle.formatStringFromName("switchskins", [brandName], 1); promptService.alert(window, dialogTitle, msg); }} |
chromeRegistry.selectSkin( skinName, DEBUG_USE_PROFILE ); chromeRegistry.refreshSkins(); | if (!chromeRegistry.isSkinSelected(skinName, DEBUG_USE_PROFILE)) { chromeRegistry.selectSkin( skinName, DEBUG_USE_PROFILE ); chromeRegistry.refreshSkins(); } | function applySkin(){ var tree = document.getElementById( "skinsTree" ); var selectedSkinItem = tree.selectedItems[0]; var skinName = selectedSkinItem.getAttribute( "name" ); chromeRegistry.selectSkin( skinName, DEBUG_USE_PROFILE ); chromeRegistry.refreshSkins();} |
var observerService = Components.classes["@mozilla.org/observer-service;1"].getService(Components.interfaces.nsIObserverService); observerService.Notify(null, "skin-selected", null); | function applySkin(){ var tree = document.getElementById("skinsTree"); var selectedSkinItem = tree.selectedItems[0]; var skinName = selectedSkinItem.getAttribute("name"); // XXX - this sucks and should only be temporary. kPrefSvc.SetUnicharPref("general.skins.selectedSkin", skinName); tree.selectItem(selectedSkinItem); var promptService = Components.classes["@mozilla.org/embedcomp/prompt-service;1"].getService(Components.interfaces.nsIPromptService); try { var strbundle = srGetStrBundle("chrome://navigator/locale/navigator.properties"); var brandbundle = srGetStrBundle("chrome://global/locale/brand.properties"); } catch(e) { return; } if (promptService) { var dialogTitle = strbundle.GetStringFromName("switchskinstitle"); var brandName = brandbundle.GetStringFromName("brandShortName"); var msg = strbundle.formatStringFromName("switchskins", [brandName], 1); promptService.alert(window, dialogTitle, msg); }} |
|
kPrefSvc.SetUnicharPref("general.skins.selectedSkin", skinName); tree.selectItem(selectedSkinItem); var observerService = Components.classes["@mozilla.org/observer-service;1"].getService(Components.interfaces.nsIObserverService); observerService.notifyObservers(null, "skin-selected", null); var promptService = Components.classes["@mozilla.org/embedcomp/prompt-service;1"].getService(Components.interfaces.nsIPromptService); if (promptService) { var navbundle = document.getElementById("bundle_navigator"); var brandbundle = document.getElementById("bundle_brand"); var dialogTitle = navbundle.getString("switchskinstitle"); var brandName = brandbundle.getString("brandShortName"); var msg = navbundle.getFormattedString("switchskins", [brandName]); promptService.alert(window, dialogTitle, msg); } | chromeRegistry.selectSkin(skinName, DEBUG_USE_PROFILE); chromeRegistry.refreshSkins(); | function applySkin(){ var tree = document.getElementById("skinsTree"); var selectedSkinItem = tree.selectedItems[0]; var skinName = selectedSkinItem.getAttribute("name"); // XXX - this sucks and should only be temporary. kPrefSvc.SetUnicharPref("general.skins.selectedSkin", skinName); tree.selectItem(selectedSkinItem); var observerService = Components.classes["@mozilla.org/observer-service;1"].getService(Components.interfaces.nsIObserverService); observerService.notifyObservers(null, "skin-selected", null); var promptService = Components.classes["@mozilla.org/embedcomp/prompt-service;1"].getService(Components.interfaces.nsIPromptService); if (promptService) { var navbundle = document.getElementById("bundle_navigator"); var brandbundle = document.getElementById("bundle_brand"); var dialogTitle = navbundle.getString("switchskinstitle"); var brandName = brandbundle.getString("brandShortName"); var msg = navbundle.getFormattedString("switchskins", [brandName]); promptService.alert(window, dialogTitle, msg); }} |
reg = reg.QueryInterface(Components.interfaces.nsIChromeRegistry); | reg = reg.QueryInterface(Components.interfaces.nsIXULChromeRegistry); | function applySkin(){ var data = parent.hPrefWindow.wsm.dataManager.pageData["chrome://communicator/content/pref/pref-themes.xul"]; if (data.name == null) return; const kPrefSvcContractID = "@mozilla.org/preferences;1"; const kPrefSvcIID = Components.interfaces.nsIPref; const kPrefSvc = Components.classes[kPrefSvcContractID].getService(kPrefSvcIID); var theme = null; try { theme = kPrefSvc.getComplexValue("general.skins.selectedSkin", Components.interfaces.nsISupportsWString).data; } catch (e) { } if (theme == data.name) return; try { var reg = Components.classes["@mozilla.org/chrome/chrome-registry;1"].getService(); if (reg) reg = reg.QueryInterface(Components.interfaces.nsIChromeRegistry); } catch(e) {} var inUse = reg.isSkinSelected(data.name, true); if (!theme && inUse == Components.interfaces.nsIChromeRegistry.FULL) return; var str = Components.classes["@mozilla.org/supports-wstring;1"] .createInstance(Components.interfaces.nsISupportsWString); str.data = data.name; kPrefSvc.setComplexValue("general.skins.selectedSkin", Components.interfaces.nsISupportsWString, str); var promptService = Components.classes["@mozilla.org/embedcomp/prompt-service;1"].getService(Components.interfaces.nsIPromptService); var strBundleService = Components.classes["@mozilla.org/intl/stringbundle;1"].getService(); strBundleService = strBundleService.QueryInterface(Components.interfaces.nsIStringBundleService); var navbundle = strBundleService.createBundle("chrome://navigator/locale/navigator.properties"); var brandbundle = strBundleService.createBundle("chrome://global/locale/brand.properties"); if (promptService && navbundle && brandbundle) { var dialogTitle = navbundle.GetStringFromName("switchskinstitle"); var brandName = brandbundle.GetStringFromName("brandShortName"); var msg = navbundle.formatStringFromName("switchskins", [brandName], 1); promptService.alert(window, dialogTitle, msg); }} |
.getService(Components.interfaces.nsIChromeRegistry); | .getService(Components.interfaces.nsIXULChromeRegistry); | function applyTheme(themeName){ var name = themeName.getAttribute("name"); if (!name) return; var chromeRegistry = Components.classes["@mozilla.org/chrome/chrome-registry;1"] .getService(Components.interfaces.nsIChromeRegistry); var oldTheme = false; try { oldTheme = !chromeRegistry.checkThemeVersion(name); } catch(e) { } var str = Components.classes["@mozilla.org/supports-wstring;1"] .createInstance(Components.interfaces.nsISupportsWString); var promptService = Components.classes["@mozilla.org/embedcomp/prompt-service;1"].getService(Components.interfaces.nsIPromptService); if (oldTheme) { var title = gNavigatorBundle.getString("oldthemetitle"); var message = gNavigatorBundle.getString("oldTheme"); message = message.replace(/%theme_name%/, themeName.getAttribute("displayName")); message = message.replace(/%brand%/g, gBrandBundle.getString("brandShortName")); if (promptService.confirm(window, title, message)){ var inUse = chromeRegistry.isSkinSelected(name, true); chromeRegistry.uninstallSkin( name, true ); // XXX - this sucks and should only be temporary. str.data = true; pref.setComplexValue("general.skins.removelist." + name, Components.interfaces.nsISupportsWString, str); if (inUse) chromeRegistry.refreshSkins(); } return; } // XXX XXX BAD BAD BAD BAD !! XXX XXX // we STILL haven't fixed editor skin switch problems // hacking around it yet again str.data = themeName.getAttribute("name"); pref.setComplexValue("general.skins.selectedSkin", Components.interfaces.nsISupportsWString, str); if (promptService) { var dialogTitle = gNavigatorBundle.getString("switchskinstitle"); var brandName = gBrandBundle.getString("brandShortName"); var msg = gNavigatorBundle.getFormattedString("switchskins", [brandName]); promptService.alert(window, dialogTitle, msg); } } |
var str = Components.classes["@mozilla.org/supports-wstring;1"] .createInstance(Components.interfaces.nsISupportsWString); | var str = Components.classes["@mozilla.org/supports-string;1"] .createInstance(Components.interfaces.nsISupportsString); | function applyTheme(themeName){ var id = themeName.getAttribute('id'); var name=id.substring('urn:mozilla.skin.'.length, id.length); if (!name) return; var chromeRegistry = Components.classes["@mozilla.org/chrome/chrome-registry;1"] .getService(Components.interfaces.nsIXULChromeRegistry); var oldTheme = false; try { oldTheme = !chromeRegistry.checkThemeVersion(name); } catch(e) { } var str = Components.classes["@mozilla.org/supports-wstring;1"] .createInstance(Components.interfaces.nsISupportsWString); var promptService = Components.classes["@mozilla.org/embedcomp/prompt-service;1"].getService(Components.interfaces.nsIPromptService); if (oldTheme) { var title = gNavigatorBundle.getString("oldthemetitle"); var message = gNavigatorBundle.getString("oldTheme"); message = message.replace(/%theme_name%/, themeName.getAttribute("displayName")); message = message.replace(/%brand%/g, gBrandBundle.getString("brandShortName")); if (promptService.confirm(window, title, message)){ var inUse = chromeRegistry.isSkinSelected(name, true); chromeRegistry.uninstallSkin( name, true ); // XXX - this sucks and should only be temporary. str.data = true; pref.setComplexValue("general.skins.removelist." + name, Components.interfaces.nsISupportsWString, str); if (inUse) chromeRegistry.refreshSkins(); } return; } // XXX XXX BAD BAD BAD BAD !! XXX XXX // we STILL haven't fixed editor skin switch problems // hacking around it yet again str.data = name; pref.setComplexValue("general.skins.selectedSkin", Components.interfaces.nsISupportsWString, str); // shut down quicklaunch so the next launch will have the new skin var appShell = Components.classes['@mozilla.org/appshell/appShellService;1'].getService(); appShell = appShell.QueryInterface(Components.interfaces.nsIAppShellService); try { appShell.nativeAppSupport.isServerMode = false; } catch(ex) { } if (promptService) { var dialogTitle = gNavigatorBundle.getString("switchskinstitle"); var brandName = gBrandBundle.getString("brandShortName"); var msg = gNavigatorBundle.getFormattedString("switchskins", [brandName]); promptService.alert(window, dialogTitle, msg); } } |
Components.interfaces.nsISupportsWString, str); | Components.interfaces.nsISupportsString, str); | function applyTheme(themeName){ var id = themeName.getAttribute('id'); var name=id.substring('urn:mozilla.skin.'.length, id.length); if (!name) return; var chromeRegistry = Components.classes["@mozilla.org/chrome/chrome-registry;1"] .getService(Components.interfaces.nsIXULChromeRegistry); var oldTheme = false; try { oldTheme = !chromeRegistry.checkThemeVersion(name); } catch(e) { } var str = Components.classes["@mozilla.org/supports-wstring;1"] .createInstance(Components.interfaces.nsISupportsWString); var promptService = Components.classes["@mozilla.org/embedcomp/prompt-service;1"].getService(Components.interfaces.nsIPromptService); if (oldTheme) { var title = gNavigatorBundle.getString("oldthemetitle"); var message = gNavigatorBundle.getString("oldTheme"); message = message.replace(/%theme_name%/, themeName.getAttribute("displayName")); message = message.replace(/%brand%/g, gBrandBundle.getString("brandShortName")); if (promptService.confirm(window, title, message)){ var inUse = chromeRegistry.isSkinSelected(name, true); chromeRegistry.uninstallSkin( name, true ); // XXX - this sucks and should only be temporary. str.data = true; pref.setComplexValue("general.skins.removelist." + name, Components.interfaces.nsISupportsWString, str); if (inUse) chromeRegistry.refreshSkins(); } return; } // XXX XXX BAD BAD BAD BAD !! XXX XXX // we STILL haven't fixed editor skin switch problems // hacking around it yet again str.data = name; pref.setComplexValue("general.skins.selectedSkin", Components.interfaces.nsISupportsWString, str); // shut down quicklaunch so the next launch will have the new skin var appShell = Components.classes['@mozilla.org/appshell/appShellService;1'].getService(); appShell = appShell.QueryInterface(Components.interfaces.nsIAppShellService); try { appShell.nativeAppSupport.isServerMode = false; } catch(ex) { } if (promptService) { var dialogTitle = gNavigatorBundle.getString("switchskinstitle"); var brandName = gBrandBundle.getString("brandShortName"); var msg = gNavigatorBundle.getFormattedString("switchskins", [brandName]); promptService.alert(window, dialogTitle, msg); } } |
pref.setComplexValue("general.skins.selectedSkin", Components.interfaces.nsISupportsWString, str); | pref.setComplexValue("general.skins.selectedSkin", Components.interfaces.nsISupportsString, str); | function applyTheme(themeName){ var id = themeName.getAttribute('id'); var name=id.substring('urn:mozilla.skin.'.length, id.length); if (!name) return; var chromeRegistry = Components.classes["@mozilla.org/chrome/chrome-registry;1"] .getService(Components.interfaces.nsIXULChromeRegistry); var oldTheme = false; try { oldTheme = !chromeRegistry.checkThemeVersion(name); } catch(e) { } var str = Components.classes["@mozilla.org/supports-wstring;1"] .createInstance(Components.interfaces.nsISupportsWString); var promptService = Components.classes["@mozilla.org/embedcomp/prompt-service;1"].getService(Components.interfaces.nsIPromptService); if (oldTheme) { var title = gNavigatorBundle.getString("oldthemetitle"); var message = gNavigatorBundle.getString("oldTheme"); message = message.replace(/%theme_name%/, themeName.getAttribute("displayName")); message = message.replace(/%brand%/g, gBrandBundle.getString("brandShortName")); if (promptService.confirm(window, title, message)){ var inUse = chromeRegistry.isSkinSelected(name, true); chromeRegistry.uninstallSkin( name, true ); // XXX - this sucks and should only be temporary. str.data = true; pref.setComplexValue("general.skins.removelist." + name, Components.interfaces.nsISupportsWString, str); if (inUse) chromeRegistry.refreshSkins(); } return; } // XXX XXX BAD BAD BAD BAD !! XXX XXX // we STILL haven't fixed editor skin switch problems // hacking around it yet again str.data = name; pref.setComplexValue("general.skins.selectedSkin", Components.interfaces.nsISupportsWString, str); // shut down quicklaunch so the next launch will have the new skin var appShell = Components.classes['@mozilla.org/appshell/appShellService;1'].getService(); appShell = appShell.QueryInterface(Components.interfaces.nsIAppShellService); try { appShell.nativeAppSupport.isServerMode = false; } catch(ex) { } if (promptService) { var dialogTitle = gNavigatorBundle.getString("switchskinstitle"); var brandName = gBrandBundle.getString("brandShortName"); var msg = gNavigatorBundle.getFormattedString("switchskins", [brandName]); promptService.alert(window, dialogTitle, msg); } } |
}, | } | ArcLabelsOut: function(aSource) { if (DEBUG) { dump("ArcLabelsOut() called with args: \n\t" + aSource.Value + "\n\n"); } return new ArrayEnumerator(new Array()); }, |
var canShowCreateAccount = ! nsPrefBranch.prefIsLocked("mail.accountmanager.accounts"); SetItemDisplay("CreateAccount", canShowCreateAccount); | function ArrangeAccountCentralItems(server, protocolInfo, msgFolder){ try { /***** Email header and items : Begin *****/ // Read Messages var canGetMessages = protocolInfo.canGetMessages; SetItemDisplay("ReadMessages", canGetMessages); // Compose Messages link var showComposeMsgLink = protocolInfo.showComposeMsgLink; SetItemDisplay("ComposeMessage", showComposeMsgLink); var displayEmailHeader = canGetMessages || showComposeMsgLink; // Display Email header, only if any of the items are displayed SetItemDisplay("EmailHeader", displayEmailHeader); /***** Email header and items : End *****/ /***** News header and items : Begin *****/ // Subscribe to Newsgroups var canSubscribe = (msgFolder.canSubscribe) && !(protocolInfo.canGetMessages); SetItemDisplay("SubscribeNewsgroups", canSubscribe); // Display News header, only if any of the items are displayed SetItemDisplay("NewsHeader", canSubscribe); /***** News header and items : End *****/ // If neither of above sections exist, collapse section separators if (!(canSubscribe || displayEmailHeader)) { CollapseSectionSeparators("MessagesSection.separator", false); } /***** Advanced Features header and items : Begin *****/ // Search Messages var canSearchMessages = server.canSearchMessages; SetItemDisplay("SearchMessages", canSearchMessages); // Create Filters var canHaveFilters = server.canHaveFilters; SetItemDisplay("CreateFilters", canHaveFilters); var displayAdvFeatures = canSearchMessages || canHaveFilters; // Display Adv Features header, only if any of the items are displayed SetItemDisplay("AdvancedFeaturesHeader", displayAdvFeatures); /***** Advanced Featuers header and items : End *****/ } catch (ex) { dump("Error is setting AccountCentral Items : " + ex + "\n"); }} |
|
if (!ary) return -1; | function arrayIndexOf (ary, elem){ for (var i in ary) if (ary[i] == elem) return i; return -1;} |
|
top.globals.document.setupPlugin.FlushCache(); alert("This file is saved as " + top.globals.getConfigFolder(self) + fName); | function askIASFileNameAndSave(){ var sName = getGlobal("SiteName"); var save = null; netscape.security.PrivilegeManager.enablePrivilege( "AccountSetup" ); //flush data from currenly open tab into globals if (parent.tabs && parent.tabs.tabbody && parent.tabs.tabbody.saveData) { parent.tabs.tabbody.saveData(); } //first check if there is a sitename, if not, prompt for one if ((sName == null) || (sName == "")) { var pName = prompt("Please enter a name for this configuration (this will be shown to the end user):", ""); if ((pName != null) && (pName != "")) { setGlobal("SiteName", pName); setGlobal("Description", pName); sName = pName; } else { save = false; } } //now, if there is a sitename, suggest an IAS fileName, prompt for confirmation //debug( "about to suggest..." ); while (save == null) { //debug( "in that while loop..." ); if ((sName != null) && (sName != "")) { var sgName = getGlobal("IASFileName"); if ((sgName == null) || (sgName == "") || (sgName == "_new_")) sgName = suggestIASFileName(null); var fName = prompt("Enter the file name for this configuration (must end with .IAS)", sgName); //if they entered an improper suffix, prompt again, and again while ((fName != null) && ((fName.substring(fName.length-4, fName.length) != ".IAS") && (fName.substring(fName.length-4, fName.length) != ".ias"))) { sgName = suggestIASFileName(fName); fName = prompt("Enter the fileName for this configuration (must end with .IAS)", sgName); } // if the name exists, prompt to replace if ((fName != null) && (checkIfIASFileExists(fName))) { var conf = confirm("The file: " + fName + " already exists. Replace?"); if (conf) { save = true; } else save = null; } else if(fName != null) { //fileName doesn't exist - we can save save = true; } else { //user canceled - name = null save = false; } } } //now save the file if the user didn't cancel if (save == true) { //save the file writeToFile(fName); refreshConfigFrame(fName); top.globals.document.setupPlugin.FlushCache(); alert("This file is saved as " + top.globals.getConfigFolder(self) + fName); return fName; } else { //alert("Could not save this configuration because you did not provide a Name"); return null; }} |
|
SetRow( toRow, fromRow.getAttribute( 'field-index'), fromRow.firstChild.firstChild.firstChild.checked, fromRow.firstChild.firstChild.firstChild.getAttribute( "value")); | SetRow( toRow, fromRow.getAttribute( 'field-index'), fromRow.firstChild.firstChild.firstChild.checked, fromRow.firstChild.firstChild.firstChild.getAttribute( "label")); | function AssignRow( toRow, fromRow){ /* SetRow( toRow, fromRow.getAttribute( 'field-index'), fromRow.firstChild.firstChild.firstChild.checked, fromRow.firstChild.childNodes[1].getAttribute( "value")); */ SetRow( toRow, fromRow.getAttribute( 'field-index'), fromRow.firstChild.firstChild.firstChild.checked, fromRow.firstChild.firstChild.firstChild.getAttribute( "value"));} |
methodArgs.splice(0, 3); | methodArgs = methodArgs.slice(3); | asyncCall: function(listener, context, methodName) { debug('asyncCall'); // Check for call in progress. if (this._inProgress) throw Components.Exception('Call in progress!'); // Check for the server URL; if (!this._serverUrl) throw Components.Exception('Not initilized'); this._inProgress = true; // Clear state. this._status = null; this._errorMsg = null; var internalContext = { listener: listener, context: context, seenStart: false, } var methodArgs = [].concat(arguments); methodArgs.splice(0, 3); debug('Arguments: ' + methodArgs); // Generate request body var xmlWriter = new XMLWriter(); this._generateRequestBody(xmlWriter, methodName, methodArgs); var requestBody = xmlWriter.data; debug('Request: ' + requestBody); var chann = this._getChannel(requestBody); // And...... call! chann.asyncRead(this, internalContext); }, |
this.xmlhttp = new XMLHttpRequest(); | this.xmlhttp = Components.classes[XMLHTTPREQUEST_CONTRACTID] .createInstance(Components.interfaces.nsIXMLHttpRequest); | asyncCall: function(listener, context, methodName, methodArgs, count) { debug('asyncCall'); // Check for call in progress. if (this._inProgress) throw Components.Exception('Call in progress!'); // Check for the server URL; if (!this._serverUrl) throw Components.Exception('Not initialized'); this._inProgress = true; // Clear state. this._foundFault = false; this._passwordTried = false; this._result = null; this._fault = null; this._status = null; this._responseStatus = null; this._responseString = null; this._listener = listener; this._seenStart = false; this._context = context; debug('Arguments: ' + methodArgs); // Generate request body var xmlWriter = new XMLWriter(this._encoding); this._generateRequestBody(xmlWriter, methodName, methodArgs); var requestBody = xmlWriter.data; debug('Request: ' + requestBody); this.xmlhttp = new XMLHttpRequest(); if (this._useAuth) { this.xmlhttp.open('POST', this._serverUrl, true, this._username, this._password); } else { this.xmlhttp.open('POST', this._serverUrl); } this.xmlhttp.onload = this._onload; this.xmlhttp.onerror = this._onerror; this.xmlhttp.parent = this; this.xmlhttp.setRequestHeader('Content-Type','text/xml'); this.xmlhttp.send(requestBody); var chan = this.xmlhttp.channel.QueryInterface(NSICHANNEL); chan.notificationCallbacks = this; }, |
dump("AttachFile()\n"); | function AttachFile(){ dump("AttachFile()\n"); currentAttachment = ""; //Get file using nsIFilePicker and convert to URL try { var fp = Components.classes["@mozilla.org/filepicker;1"].createInstance(nsIFilePicker); fp.init(window, Bundle.GetStringFromName("chooseFileToAttach"), nsIFilePicker.modeOpen); fp.appendFilters(nsIFilePicker.filterAll); if (fp.show() == nsIFilePicker.returnOK) { currentAttachment = fp.fileURL.spec; dump("nsIFilePicker - "+currentAttachment+"\n"); } } catch (ex) { dump("failed to get the local file to attach\n"); } AddAttachment(currentAttachment, null);} |
|
AddAttachment(currentAttachment, null); | if (!(DuplicateFileCheck(currentAttachment))) AddAttachment(currentAttachment, null); else { dump("###ERROR ADDING DUPLICATE FILE \n"); var errorTitle = Bundle.GetStringFromName("DuplicateFileErrorDlogTitle"); var errorMsg = Bundle.GetStringFromName("DuplicateFileErrorDlogMessage"); if (commonDialogsService) commonDialogsService.Alert(window, errorTitle, errorMsg); else window.alert(errorMsg); } | function AttachFile(){ dump("AttachFile()\n"); currentAttachment = ""; //Get file using nsIFilePicker and convert to URL try { var fp = Components.classes["@mozilla.org/filepicker;1"].createInstance(nsIFilePicker); fp.init(window, Bundle.GetStringFromName("chooseFileToAttach"), nsIFilePicker.modeOpen); fp.appendFilters(nsIFilePicker.filterAll); if (fp.show() == nsIFilePicker.returnOK) { currentAttachment = fp.fileURL.spec; dump("nsIFilePicker - "+currentAttachment+"\n"); } } catch (ex) { dump("failed to get the local file to attach\n"); } AddAttachment(currentAttachment, null);} |
if (promptService) promptService.alert(window, errorTitle, errorMsg); | if (!gPromptService) { gPromptService = Components.classes["@mozilla.org/embedcomp/prompt-service;1"].getService(); gPromptService = gPromptService.QueryInterface(Components.interfaces.nsIPromptService); } if (gPromptService) gPromptService.alert(window, errorTitle, errorMsg); | function AttachFile(){// dump("AttachFile()\n"); currentAttachment = ""; //Get file using nsIFilePicker and convert to URL try { var fp = Components.classes["@mozilla.org/filepicker;1"].createInstance(nsIFilePicker); fp.init(window, gComposeMsgsBundle.getString("chooseFileToAttach"), nsIFilePicker.modeOpen); fp.appendFilters(nsIFilePicker.filterAll); if (fp.show() == nsIFilePicker.returnOK) { currentAttachment = fp.fileURL.spec; dump("nsIFilePicker - "+currentAttachment+"\n"); } } catch (ex) { dump("failed to get the local file to attach\n"); } if (!(DuplicateFileCheck(currentAttachment))) AddAttachment(currentAttachment, null); else { dump("###ERROR ADDING DUPLICATE FILE \n"); var errorTitle = gComposeMsgsBundle.getString("DuplicateFileErrorDlogTitle"); var errorMsg = gComposeMsgsBundle.getString("DuplicateFileErrorDlogMessage"); if (promptService) promptService.alert(window, errorTitle, errorMsg); else window.alert(errorMsg); }} |
if (event.target.localName != 'treecell') | if (event.originalTarget.localName == 'treechildren') | function AttachmentBucketClicked(event){ if (event.target.localName != 'treecell') goDoCommand('cmd_attachFile');} |
var target = event.originalTarget; item = target.parentNode.parentNode; | var target = event.originalTarget; var item = target.parentNode.parentNode; | function attachmentTreeClick(event){ // we only care about button 0 (left click) events if (event.button != 0) return; if(event.detail == 2) // double click { var target = event.originalTarget; item = target.parentNode.parentNode; if (item.localName == "treeitem") { var commandStringSuffix = item.getAttribute("commandSuffix"); var openString = 'openAttachment' + commandStringSuffix; eval(openString); } }} |
var attachmentBox = document.getElementById("attachments-box"); attachmentBox.hidden = false; document.getElementById("attachmentbucket-sizer").hidden=false; | function AttachPage(){ if (gPromptService) { var result = {value:"http://"}; if (gPromptService.prompt( window, sComposeMsgsBundle.getString("attachPageDlogTitle"), sComposeMsgsBundle.getString("attachPageDlogMessage"), result, null, {value:0})) { var attachment = Components.classes["@mozilla.org/messengercompose/attachment;1"].createInstance(Components.interfaces.nsIMsgAttachment); attachment.url = result.value; AddAttachment(attachment); } }} |
|
if (gPromptService) { var result = {value:"http: if (gPromptService.prompt( window, sComposeMsgsBundle.getString("attachPageDlogTitle"), sComposeMsgsBundle.getString("attachPageDlogMessage"), result, null, {value:0})) { var attachment = Components.classes["@mozilla.org/messengercompose/attachment;1"].createInstance(Components.interfaces.nsIMsgAttachment); attachment.url = result.value; AddAttachment(attachment); } } | var result = { attachment: null }; window.openDialog("chrome: if (result.attachment) AddAttachment(result.attachment); | function AttachPage(){ if (gPromptService) { var result = {value:"http://"}; if (gPromptService.prompt( window, sComposeMsgsBundle.getString("attachPageDlogTitle"), sComposeMsgsBundle.getString("attachPageDlogMessage"), result, null, {value:0})) { var attachment = Components.classes["@mozilla.org/messengercompose/attachment;1"].createInstance(Components.interfaces.nsIMsgAttachment); attachment.url = result.value; AddAttachment(attachment); } }} |
var result = {value:0}; | var result = {value:""}; | function AttachPage(){ if (promptService) { var result = {value:0}; if (promptService.prompt( window, gComposeMsgsBundle.getString("attachPageDlogTitle"), gComposeMsgsBundle.getString("attachPageDlogMessage"), result, null, {value:0})) { AddAttachment(result.value, null); } }} |
var result = {value:""}; | var result = {value:"http: | function AttachPage(){ if (promptService) { var result = {value:""}; if (promptService.prompt( window, gComposeMsgsBundle.getString("attachPageDlogTitle"), gComposeMsgsBundle.getString("attachPageDlogMessage"), result, null, {value:0})) { AddAttachment(result.value, null); } }} |
if (promptService) { | if (!gPromptService) { gPromptService = Components.classes["@mozilla.org/embedcomp/prompt-service;1"].getService(); gPromptService = gPromptService.QueryInterface(Components.interfaces.nsIPromptService); } if (gPromptService) { | function AttachPage(){ if (promptService) { var result = {value:"http://"}; if (promptService.prompt( window, gComposeMsgsBundle.getString("attachPageDlogTitle"), gComposeMsgsBundle.getString("attachPageDlogMessage"), result, null, {value:0})) { AddAttachment(result.value, null); } }} |
if (promptService.prompt( | if (gPromptService.prompt( | function AttachPage(){ if (promptService) { var result = {value:"http://"}; if (promptService.prompt( window, gComposeMsgsBundle.getString("attachPageDlogTitle"), gComposeMsgsBundle.getString("attachPageDlogMessage"), result, null, {value:0})) { AddAttachment(result.value, null); } }} |
window.openDialog("chrome: | var result = {url: ""}; window.openDialog("chrome: if (result.url != "") AddAttachment(result.url); | function AttachPage(){ window.openDialog("chrome://messengercompose/content/MsgAttachPage.xul", "attachPageDialog", "chrome", {addattachmentfunction:AddAttachment});} |
if (addattachmentfunction) { addattachmentfunction(document.getElementById('attachurl').value); } return true; | result.url = document.getElementById('attachurl').value; return true; | function AttachPageOKCallback(){ /* dump("attach this: " + document.getElementById('attachurl').value + "\n"); */ if (addattachmentfunction) { addattachmentfunction(document.getElementById('attachurl').value); } return true;} |
if (select.value == "") return; | function AutoCompleteAddress(inputElement){ ///////////// (select_doc_id, doc_id) dump("inputElement = " + inputElement + "\n"); var row = awGetRowByInputElement(inputElement); var select = awGetPopupElement(row); dump("select = " + select + "\n"); dump("select.value = " + select.value + "\n"); if (select.value == "addr_newsgroups") { dump("don't autocomplete, it's a newsgroup"); return; } var ac = Components.classes['component://netscape/messenger/autocomplete&type=addrbook']; if (ac) { ac = ac.getService(); } if (ac) { ac = ac.QueryInterface(Components.interfaces.nsIAutoCompleteSession); } ac.autoComplete(inputElement, inputElement.value, AddressAutoCompleteListener);} |
|
input[0].setAttribute("value", ""); input[0].value = ""; | input[0].setAttribute("value", ""); | function awAppendNewRow(setFocus){ var body = document.getElementById('addressWidgetBody'); var treeitem1 = awGetTreeItem(1); if ( body && treeitem1 ) { var lastRecipientType = awGetPopupElement(top.MAX_RECIPIENTS).selectedItem.getAttribute("data"); newNode = awCopyNode(treeitem1, body, 0); top.MAX_RECIPIENTS++; var input = newNode.getElementsByTagName(awInputElementName()); if ( input && input.length == 1 ) { //We need to set the value using both setAttribute and .value else we will // loose the content when the field is not visible. See bug 37435 input[0].setAttribute("value", ""); input[0].value = ""; input[0].setAttribute("id", "msgRecipient#" + top.MAX_RECIPIENTS); } var select = newNode.getElementsByTagName(awSelectElementName()); if ( select && select.length == 1 ) { select[0].selectedItem = select[0].childNodes[0].childNodes[awGetSelectItemIndex(lastRecipientType)]; select[0].setAttribute("id", "msgRecipientType#" + top.MAX_RECIPIENTS); if (input) _awDisableAutoComplete(select[0], input[0]); } // focus on new input widget if (setFocus && input[0] ) awSetFocus(top.MAX_RECIPIENTS, input[0]); }} |
if (input) _awDisableAutoComplete(select[0], input[0]); | function awAppendNewRow(setFocus){ var body = document.getElementById('addressWidgetBody'); var treeitem1 = awGetTreeItem(1); if ( body && treeitem1 ) { var lastRecipientType = awGetPopupElement(top.MAX_RECIPIENTS).selectedItem.getAttribute("data"); newNode = awCopyNode(treeitem1, body, 0); top.MAX_RECIPIENTS++; var input = newNode.getElementsByTagName(awInputElementName()); if ( input && input.length == 1 ) { //We need to set the value using both setAttribute and .value else we will // loose the content when the field is not visible. See bug 37435 input[0].setAttribute("value", ""); input[0].value = ""; input[0].setAttribute("id", "msgRecipient#" + top.MAX_RECIPIENTS); } var select = newNode.getElementsByTagName(awSelectElementName()); if ( select && select.length == 1 ) { select[0].selectedItem = select[0].childNodes[0].childNodes[awGetSelectItemIndex(lastRecipientType)]; select[0].setAttribute("id", "msgRecipientType#" + top.MAX_RECIPIENTS); } // focus on new input widget if (setFocus && input[0] ) awSetFocus(top.MAX_RECIPIENTS, input[0]); }} |
|
var lastRecipientType = awGetPopupElement(top.MAX_RECIPIENTS).value; | var lastRecipientType = awGetPopupElement(top.MAX_RECIPIENTS).selectedItem.getAttribute("data"); | function awAppendNewRow(setFocus){ var body = document.getElementById('addressWidgetBody'); var treeitem1 = awGetTreeItem(1); if ( body && treeitem1 ) { var lastRecipientType = awGetPopupElement(top.MAX_RECIPIENTS).value; newNode = awCopyNode(treeitem1, body, 0); top.MAX_RECIPIENTS++; var input = newNode.getElementsByTagName(awInputElementName()); if ( input && input.length == 1 ) { input[0].setAttribute("value", ""); input[0].setAttribute("id", "msgRecipient#" + top.MAX_RECIPIENTS); } var select = newNode.getElementsByTagName(awSelectElementName()); if ( select && select.length == 1 ) {//doesn't work! select[0].setAttribute("value", lastRecipientType); select[0].value = lastRecipientType; select[0].setAttribute("id", "msgRecipientType#" + top.MAX_RECIPIENTS); } // focus on new input widget if (setFocus && input[0] ) awSetFocus(top.MAX_RECIPIENTS, input[0]); }} |
select[0].value = lastRecipientType; | select[0].selectedItem = select[0].childNodes[0].childNodes[awGetSelectItemIndex(lastRecipientType)]; | function awAppendNewRow(setFocus){ var body = document.getElementById('addressWidgetBody'); var treeitem1 = awGetTreeItem(1); if ( body && treeitem1 ) { var lastRecipientType = awGetPopupElement(top.MAX_RECIPIENTS).value; newNode = awCopyNode(treeitem1, body, 0); top.MAX_RECIPIENTS++; var input = newNode.getElementsByTagName(awInputElementName()); if ( input && input.length == 1 ) { input[0].setAttribute("value", ""); input[0].setAttribute("id", "msgRecipient#" + top.MAX_RECIPIENTS); } var select = newNode.getElementsByTagName(awSelectElementName()); if ( select && select.length == 1 ) {//doesn't work! select[0].setAttribute("value", lastRecipientType); select[0].value = lastRecipientType; select[0].setAttribute("id", "msgRecipientType#" + top.MAX_RECIPIENTS); } // focus on new input widget if (setFocus && input[0] ) awSetFocus(top.MAX_RECIPIENTS, input[0]); }} |
input[0].value = ""; | function awAppendNewRow(setFocus){ var body = document.getElementById("addressingWidget"); var listitem1 = awGetListItem(1); if ( body && listitem1 ) { var nextDummy = awGetNextDummyRow(); var newNode = listitem1.cloneNode(true); if (nextDummy) body.replaceChild(newNode, nextDummy); else body.appendChild(newNode); top.MAX_RECIPIENTS++; var input = newNode.getElementsByTagName(awInputElementName()); if ( input && input.length == 1 ) { input[0].setAttribute("value", ""); // XXX TODO // band-aid for bug #190153 which was caused by a // band-aid for #90337 input[0].value = ""; input[0].setAttribute("id", "addressCol1#" + top.MAX_RECIPIENTS); if (input[0].getAttribute('focused') != '') input[0].removeAttribute('focused'); } // focus on new input widget if (setFocus && input ) awSetFocus(top.MAX_RECIPIENTS, input[0]); }} |
|
input[0].value = ""; | function awAppendNewRow(setFocus){ var listbox = document.getElementById('addressingWidget'); var listitem1 = awGetListItem(1); if ( listbox && listitem1 ) { var lastRecipientType = awGetPopupElement(top.MAX_RECIPIENTS).selectedItem.getAttribute("value"); var nextDummy = awGetNextDummyRow(); var newNode = listitem1.cloneNode(true); if (nextDummy) listbox.replaceChild(newNode, nextDummy); else listbox.appendChild(newNode); top.MAX_RECIPIENTS++; var input = newNode.getElementsByTagName(awInputElementName()); if ( input && input.length == 1 ) { input[0].setAttribute("value", ""); // XXX TODO // band-aid for bug #190153 which was caused by a // band-aid for #90337 input[0].value = ""; input[0].setAttribute("id", "addressCol2#" + top.MAX_RECIPIENTS); //this copies the autocomplete sessions list from recipient#1 input[0].syncSessions(document.getElementById('addressCol2#1')); // also clone the showCommentColumn setting // input[0].showCommentColumn = document.getElementById("addressCol2#1").showCommentColumn; // We always clone the first row. The problem is that the first row // could be focused. When we clone that row, we end up with a cloned // XUL textbox that has a focused attribute set. Therefore we think // we're focused and don't properly refocus. The best solution to this // would be to clone a template row that didn't really have any presentation, // rather than using the real visible first row of the listbox. // // For now we'll just put in a hack that ensures the focused attribute // is never copied when the node is cloned. if (input[0].getAttribute('focused') != '') input[0].removeAttribute('focused'); } var select = newNode.getElementsByTagName(awSelectElementName()); if ( select && select.length == 1 ) { select[0].selectedItem = select[0].childNodes[0].childNodes[awGetSelectItemIndex(lastRecipientType)]; select[0].setAttribute("id", "addressCol1#" + top.MAX_RECIPIENTS); if (input) _awSetAutoComplete(select[0], input[0]); } // focus on new input widget if (setFocus && input[0] ) awSetFocus(top.MAX_RECIPIENTS, input[0]); }} |
|
select[0].selectedItem = select[0].childNodes[0].childNodes[awGetSelectItemIndex(lastRecipientType)]; | switch (lastRecipientType) { case "addr_reply": case "addr_other": select[0].selectedIndex = awGetSelectItemIndex("addr_to"); break; case "addr_followup": select[0].selectedIndex = awGetSelectItemIndex("addr_newsgroups"); break; default: select[0].selectedIndex = awGetSelectItemIndex(lastRecipientType); } | function awAppendNewRow(setFocus){ var listbox = document.getElementById('addressingWidget'); var listitem1 = awGetListItem(1); if ( listbox && listitem1 ) { var lastRecipientType = awGetPopupElement(top.MAX_RECIPIENTS).selectedItem.getAttribute("value"); var nextDummy = awGetNextDummyRow(); var newNode = listitem1.cloneNode(true); if (nextDummy) listbox.replaceChild(newNode, nextDummy); else listbox.appendChild(newNode); top.MAX_RECIPIENTS++; var input = newNode.getElementsByTagName(awInputElementName()); if ( input && input.length == 1 ) { input[0].setAttribute("value", ""); input[0].setAttribute("id", "addressCol2#" + top.MAX_RECIPIENTS); //this copies the autocomplete sessions list from recipient#1 input[0].syncSessions(document.getElementById('addressCol2#1')); // also clone the showCommentColumn setting // input[0].showCommentColumn = document.getElementById("addressCol2#1").showCommentColumn; // We always clone the first row. The problem is that the first row // could be focused. When we clone that row, we end up with a cloned // XUL textbox that has a focused attribute set. Therefore we think // we're focused and don't properly refocus. The best solution to this // would be to clone a template row that didn't really have any presentation, // rather than using the real visible first row of the listbox. // // For now we'll just put in a hack that ensures the focused attribute // is never copied when the node is cloned. if (input[0].getAttribute('focused') != '') input[0].removeAttribute('focused'); } var select = newNode.getElementsByTagName(awSelectElementName()); if ( select && select.length == 1 ) { select[0].selectedItem = select[0].childNodes[0].childNodes[awGetSelectItemIndex(lastRecipientType)]; select[0].setAttribute("id", "addressCol1#" + top.MAX_RECIPIENTS); if (input) _awSetAutoComplete(select[0], input[0]); } // focus on new input widget if (setFocus && input[0] ) awSetFocus(top.MAX_RECIPIENTS, input[0]); }} |
var body = document.getElementById('addressWidgetBody'); var treeitem1 = awGetTreeItem(1); if ( body && treeitem1 ) { var lastRecipientType = awGetPopupElement(top.MAX_RECIPIENTS).selectedItem.getAttribute("data"); | var body = document.getElementById('addressWidgetBody'); var treeitem1 = awGetTreeItem(1); if ( body && treeitem1 ) { var lastRecipientType = awGetPopupElement(top.MAX_RECIPIENTS).selectedItem.getAttribute("value"); | function awAppendNewRow(setFocus){ var body = document.getElementById('addressWidgetBody'); var treeitem1 = awGetTreeItem(1); if ( body && treeitem1 ) { var lastRecipientType = awGetPopupElement(top.MAX_RECIPIENTS).selectedItem.getAttribute("data"); var nextDummy = awGetNextDummyRow(); var newNode = awCopyNode(treeitem1, body, nextDummy); if (nextDummy) body.removeChild(nextDummy); top.MAX_RECIPIENTS++; var input = newNode.getElementsByTagName(awInputElementName()); if ( input && input.length == 1 ) { input[0].setAttribute("value", ""); input[0].setAttribute("id", "msgRecipient#" + top.MAX_RECIPIENTS); // We always clone the first row. The problem is that the first row // could be focused. When we clone that row, we end up with a cloned // XUL textbox that has a focused attribute set. Therefore we think // we're focused and don't properly refocus. The best solution to this // would be to clone a template row that didn't really have any presentation, // rather than using the real visible first row of the tree. // // For now we'll just put in a hack that ensures the focused attribute // is never copied when the node is cloned. if (input[0].getAttribute('focused') != '') input[0].removeAttribute('focused'); } var select = newNode.getElementsByTagName(awSelectElementName()); if ( select && select.length == 1 ) { select[0].selectedItem = select[0].childNodes[0].childNodes[awGetSelectItemIndex(lastRecipientType)]; select[0].setAttribute("id", "msgRecipientType#" + top.MAX_RECIPIENTS); if (input) _awSetAutoComplete(select[0], input[0]); } // focus on new input widget if (setFocus && input[0] ) awSetFocus(top.MAX_RECIPIENTS, input[0]); }} |
if (targ.localName != 'treechildren') | if ("localName" in targ && targ.localName != 'treechildren') | function awClickEmptySpace(targ, setFocus){ if (targ.localName != 'treechildren') return; dump("awClickEmptySpace\n"); var lastInput = awGetInputElement(top.MAX_RECIPIENTS); if ( lastInput && lastInput.value ) awAppendNewRow(setFocus); else if (setFocus) awSetFocus(top.MAX_RECIPIENTS, lastInput);} |
function awClickEmptySpace(setFocus) | function awClickEmptySpace(targ, setFocus) | function awClickEmptySpace(setFocus){ dump("awClickEmptySpace\n"); var lastInput = awGetInputElement(top.MAX_RECIPIENTS); if ( lastInput && lastInput.value ) awAppendNewRow(setFocus); else if (setFocus) awSetFocus(top.MAX_RECIPIENTS, lastInput);} |
if (targ.localName != 'treechildren') return; | function awClickEmptySpace(setFocus){ dump("awClickEmptySpace\n"); var lastInput = awGetInputElement(top.MAX_RECIPIENTS); if ( lastInput && lastInput.value ) awAppendNewRow(setFocus); else if (setFocus) awSetFocus(top.MAX_RECIPIENTS, lastInput);} |
|
var aData = selectElem.childNodes[0].childNodes[i].getAttribute("data"); | var aData = selectElem.childNodes[0].childNodes[i].getAttribute("value"); | function awGetSelectItemIndex(itemData){ if (selectElementIndexTable == null) { selectElementIndexTable = new Object(); var selectElem = document.getElementById("msgRecipientType#1"); for (var i = 0; i < selectElem.childNodes[0].childNodes.length; i ++) { var aData = selectElem.childNodes[0].childNodes[i].getAttribute("data"); selectElementIndexTable[aData] = i; } } return selectElementIndexTable[itemData];} |
if (!element.value) | if (!document.getAnonymousNodes(element)[0].firstChild.value) | function awRecipientKeyDown(event, element){ switch(event.keyCode) { case 46: case 8: if (!element.value) awDeleteHit(element); event.preventBubble(); //We need to stop the event else the tree will receive it and the function //awKeyDown will be executed! break; }} |
if (popup.selectedItem.getAttribute("data") == recipientType) | if (popup.selectedItem.getAttribute("value") == recipientType) | function awRemoveRecipients(msgCompFields, recipientType, recipientsList){ if (!msgCompFields) return; var recipientArray = msgCompFields.SplitRecipients(recipientsList, false); if (! recipientArray) return; for ( var index = 0; index < recipientArray.count; index++ ) for (var row = 1; row <= top.MAX_RECIPIENTS; row ++) { var popup = awGetPopupElement(row); if (popup.selectedItem.getAttribute("data") == recipientType) { var input = awGetInputElement(row); if (input.value == recipientArray.StringAt(index)) { awSetInputAndPopupValue(input, "", popup, "addr_to", -1); break; } } } } |
var body = document.getElementById('addressList'); awRemoveNodeAndChildren(body, awGetTreeItem(row)); | var body = document.getElementById('addressList'); | function awRemoveRow(row){ var body = document.getElementById('addressList'); awRemoveNodeAndChildren(body, awGetTreeItem(row)); top.MAX_RECIPIENTS--;} |
top.MAX_RECIPIENTS--; | awRemoveNodeAndChildren(body, awGetTreeItem(row)); top.MAX_RECIPIENTS--; | function awRemoveRow(row){ var body = document.getElementById('addressList'); awRemoveNodeAndChildren(body, awGetTreeItem(row)); top.MAX_RECIPIENTS--;} |
nextButton.value = nextButton.getAttribute("nextval"); | nextButton.label = nextButton.getAttribute("nextval"); | function back(){ var deck = document.getElementById("stateDeck"); if (deck.getAttribute("index") == "1") { var backButton = document.getElementById("back"); backButton.setAttribute("disabled", "true"); var nextButton = document.getElementById("forward"); nextButton.value = nextButton.getAttribute("nextval"); nextButton.removeAttribute("disabled"); deck.setAttribute("index", "0"); }} |
selected_certs = []; | function backupCerts(){ getSelectedCerts(); var numcerts = selected_certs.length; var bundle = srGetStrBundle("chrome://pippki/locale/pippki.properties"); var fp = Components.classes[nsFilePicker].createInstance(nsIFilePicker); fp.init(window, bundle.GetStringFromName("chooseP12BackupFileDialog"), nsIFilePicker.modeSave); fp.appendFilter("PKCS12 Files", "*.p12"); fp.appendFilters(nsIFilePicker.filterAll); var rv = fp.show(); if (rv == nsIFilePicker.returnOK || rv == nsIFilePicker.returnReplace) { certdb.exportPKCS12File(null, fp.file, selected_certs.length, selected_certs); }} |
|
var padding = (data.charAt(i) == base64Pad); | var padding = (data[i] == base64Pad); | function base64ToString(data) { var result = ''; var leftbits = 0; // number of bits decoded, but yet to be appended var leftdata = 0; // bits decoded, bt yet to be appended // Convert one by one. for (var i in data) { var c = toBinaryTable[data.charCodeAt(i) & 0x7f]; var padding = (data.charAt(i) == base64Pad); // Skip illegal characters and whitespace if (c == -1) continue; // Collect data into leftdata, update bitcount leftdata = (leftdata << 6) | c; leftbits += 6; // If we have 8 or more bits, append 8 bits to the result if (leftbits >= 8) { leftbits -= 8; // Append if not padding. if (!padding) result += String.fromCharCode((leftdata >> leftbits) & 0xff); leftdata &= (1 << leftbits) - 1; } } // If there are any bits left, the base64 string was corrupted if (leftbits) throw Components.Exception('Corrupted base64 string'); return result;} |
this._inputStream = toScriptableInputStream(this._transport.openInputStream(0, -1, 0)); | this._sOutputStream = toSOutputStream(this._outputStream, this.binaryMode); this._inputStream = this._transport.openInputStream(0, -1, 0); | function bc_connect(host, port, bind, tcp_flag, observer){ if (typeof tcp_flag == "undefined") tcp_flag = false; this.host = host.toLowerCase(); this.port = port; this.bind = bind; this.tcp_flag = tcp_flag; // Lets get a transportInfo for this var cls = Components.classes["@mozilla.org/network/protocol-proxy-service;1"]; var pps = cls.getService(Components.interfaces.nsIProtocolProxyService); if (!pps) throw ("Couldn't get protocol proxy service"); var ios = Components.classes["@mozilla.org/network/io-service;1"]. getService(Components.interfaces.nsIIOService); var spec = "irc://" + host + ':' + port; var uri = ios.newURI(spec,null,null); var info = pps.examineForProxy(uri); if (jsenv.HAS_STREAM_PROVIDER) { this._transport = this._sockService.createTransport (host, port, info, 0, 0); if (!this._transport) throw ("Error creating transport."); if (jsenv.HAS_NSPR_EVENTQ) { /* we've got an event queue, so start up an async write */ this._streamProvider = new StreamProvider (observer); this._write_req = this._transport.asyncWrite (this._streamProvider, this, 0, -1, 0); } else { /* no nspr event queues in this environment, we can't use async * calls, so set up the streams. */ this._outputStream = this._transport.openOutputStream(0, -1, 0); if (!this._outputStream) throw "Error getting output stream."; this._inputStream = toScriptableInputStream(this._transport.openInputStream(0, -1, 0)); if (!this._inputStream) throw "Error getting input stream."; } } else { /* use new necko interfaces */ this._transport = this._sockService.createTransport(null, 0, host, port, info); if (!this._transport) throw ("Error creating transport."); /* if we don't have an event queue, then all i/o must be blocking */ var openFlags; if (jsenv.HAS_NSPR_EVENTQ) openFlags = 0; else openFlags = Components.interfaces.nsITransport.OPEN_BLOCKING; /* no limit on the output stream buffer */ this._outputStream = this._transport.openOutputStream(openFlags, 4096, -1); if (!this._outputStream) throw "Error getting output stream."; this._inputStream = this._transport.openInputStream(openFlags, 0, 0); if (!this._inputStream) throw "Error getting input stream."; } this.connectDate = new Date(); this.isConnected = true; return this.isConnected; } |
} | this._sInputStream = toSInputStream(this._inputStream, this.binaryMode); } | function bc_connect(host, port, bind, tcp_flag, observer){ if (typeof tcp_flag == "undefined") tcp_flag = false; this.host = host.toLowerCase(); this.port = port; this.bind = bind; this.tcp_flag = tcp_flag; // Lets get a transportInfo for this var cls = Components.classes["@mozilla.org/network/protocol-proxy-service;1"]; var pps = cls.getService(Components.interfaces.nsIProtocolProxyService); if (!pps) throw ("Couldn't get protocol proxy service"); var ios = Components.classes["@mozilla.org/network/io-service;1"]. getService(Components.interfaces.nsIIOService); var spec = "irc://" + host + ':' + port; var uri = ios.newURI(spec,null,null); var info = pps.examineForProxy(uri); if (jsenv.HAS_STREAM_PROVIDER) { this._transport = this._sockService.createTransport (host, port, info, 0, 0); if (!this._transport) throw ("Error creating transport."); if (jsenv.HAS_NSPR_EVENTQ) { /* we've got an event queue, so start up an async write */ this._streamProvider = new StreamProvider (observer); this._write_req = this._transport.asyncWrite (this._streamProvider, this, 0, -1, 0); } else { /* no nspr event queues in this environment, we can't use async * calls, so set up the streams. */ this._outputStream = this._transport.openOutputStream(0, -1, 0); if (!this._outputStream) throw "Error getting output stream."; this._inputStream = toScriptableInputStream(this._transport.openInputStream(0, -1, 0)); if (!this._inputStream) throw "Error getting input stream."; } } else { /* use new necko interfaces */ this._transport = this._sockService.createTransport(null, 0, host, port, info); if (!this._transport) throw ("Error creating transport."); /* if we don't have an event queue, then all i/o must be blocking */ var openFlags; if (jsenv.HAS_NSPR_EVENTQ) openFlags = 0; else openFlags = Components.interfaces.nsITransport.OPEN_BLOCKING; /* no limit on the output stream buffer */ this._outputStream = this._transport.openOutputStream(openFlags, 4096, -1); if (!this._outputStream) throw "Error getting output stream."; this._inputStream = this._transport.openInputStream(openFlags, 0, 0); if (!this._inputStream) throw "Error getting input stream."; } this.connectDate = new Date(); this.isConnected = true; return this.isConnected; } |
this._sInputStream = toSInputStream(this._inputStream, this.binaryMode); | function bc_connect(host, port, bind, tcp_flag, observer){ if (typeof tcp_flag == "undefined") tcp_flag = false; this.host = host.toLowerCase(); this.port = port; this.bind = bind; this.tcp_flag = tcp_flag; // Lets get a transportInfo for this var cls = Components.classes["@mozilla.org/network/protocol-proxy-service;1"]; var pps = cls.getService(Components.interfaces.nsIProtocolProxyService); if (!pps) throw ("Couldn't get protocol proxy service"); var ios = Components.classes["@mozilla.org/network/io-service;1"]. getService(Components.interfaces.nsIIOService); var spec = "irc://" + host + ':' + port; var uri = ios.newURI(spec,null,null); var info = pps.examineForProxy(uri); if (jsenv.HAS_STREAM_PROVIDER) { this._transport = this._sockService.createTransport (host, port, info, 0, 0); if (!this._transport) throw ("Error creating transport."); if (jsenv.HAS_NSPR_EVENTQ) { /* we've got an event queue, so start up an async write */ this._streamProvider = new StreamProvider (observer); this._write_req = this._transport.asyncWrite (this._streamProvider, this, 0, -1, 0); } else { /* no nspr event queues in this environment, we can't use async * calls, so set up the streams. */ this._outputStream = this._transport.openOutputStream(0, -1, 0); if (!this._outputStream) throw "Error getting output stream."; this._inputStream = toScriptableInputStream(this._transport.openInputStream(0, -1, 0)); if (!this._inputStream) throw "Error getting input stream."; } } else { /* use new necko interfaces */ this._transport = this._sockService.createTransport(null, 0, host, port, info); if (!this._transport) throw ("Error creating transport."); /* if we don't have an event queue, then all i/o must be blocking */ var openFlags; if (jsenv.HAS_NSPR_EVENTQ) openFlags = 0; else openFlags = Components.interfaces.nsITransport.OPEN_BLOCKING; /* no limit on the output stream buffer */ this._outputStream = this._transport.openOutputStream(openFlags, 4096, -1); if (!this._outputStream) throw "Error getting output stream."; this._inputStream = this._transport.openInputStream(openFlags, 0, 0); if (!this._inputStream) throw "Error getting input stream."; } this.connectDate = new Date(); this.isConnected = true; return this.isConnected; } |
|
var uri = Components.classes["@mozilla.org/network/simple-uri;1"]. createInstance(Components.interfaces.nsIURI); uri.spec = "irc:" + host + ':' + port; | var ios = Components.classes["@mozilla.org/network/io-service;1"]. getService(Components.interfaces.nsIIOService); var spec = "irc: var uri = ios.newURI(spec,null); | function bc_connect(host, port, bind, tcp_flag, observer){ if (typeof tcp_flag == "undefined") tcp_flag = false; this.host = host.toLowerCase(); this.port = port; this.bind = bind; this.tcp_flag = tcp_flag; // Lets get a transportInfo for this var pps = Components.classes["@mozilla.org/network/protocol-proxy-service;1"]. getService(). QueryInterface(Components.interfaces.nsIProtocolProxyService); if (!pps) throw ("Couldn't get protocol proxy service"); var uri = Components.classes["@mozilla.org/network/simple-uri;1"]. createInstance(Components.interfaces.nsIURI); uri.spec = "irc:" + host + ':' + port; var info = pps.examineForProxy(uri); this._transport = this._sockService.createTransport (host, port, info, 0, 0); if (!this._transport) throw ("Error creating transport."); if (jsenv.HAS_NSPR_EVENTQ) { /* we've got an event queue, so start up an async write */ this._streamProvider = new StreamProvider (observer); this._write_req = this._transport.asyncWrite (this._streamProvider, this, 0, -1, 0); } else { /* no nspr event queues in this environment, we can't use async calls, * so set up the streams. */ this._outputStream = this._transport.openOutputStream(0, -1, 0); if (!this._outputStream) throw "Error getting output stream."; this._inputStream = toScriptableInputStream(this._transport.openInputStream (0, -1, 0)); if (!this._inputStream) throw "Error getting input stream."; } this.connectDate = new Date(); this.isConnected = true; return this.isConnected; } |
rv = this._scriptableInputStream.read (count); | if (this.binaryMode) rv = this._sInputStream.readBytes(count); else rv = this._sInputStream.read(count); | function bc_readdata(timeout, count){ if (!this.isConnected) throw "Not Connected."; var rv; try { rv = this._scriptableInputStream.read (count); } catch (ex) { dd ("*** Caught " + ex + " while reading."); this.disconnect(); throw (ex); } return rv;} |
this._outputStream.write(str, str.length); | if (this.binaryMode) this._sOutputStream.writeBytes(str, str.length); else this._sOutputStream.write(str, str.length); | function bc_senddatanow(str){ var rv = false; try { this._outputStream.write(str, str.length); rv = true; } catch (ex) { dd ("*** Caught " + ex + " while sending."); this.disconnect(); throw (ex); } return rv;} |
var indexStr = ("" + index); genData.data = indexStr; trans.setTransferData ( top.transferType, genData, indexStr.length * 2); | var indexStr = ("" + index); genData.data = indexStr; | function BeginDrag( event){ top.dragStart = false; var tree = document.getElementById("fieldList"); if ( event.target == tree ) { return( true); // continue propagating the event } if (!tree) { return( false); } var dragService = Components.classes["@mozilla.org/widget/dragservice;1"].getService(); if ( dragService ) dragService = dragService.QueryInterface(Components.interfaces.nsIDragService); if ( !dragService ) { return(false); } var trans = Components.classes["@mozilla.org/widget/transferable;1"].createInstance(); if ( trans ) trans = trans.QueryInterface(Components.interfaces.nsITransferable); if ( !trans ) { return(false); } var genData = Components.classes["@mozilla.org/supports-wstring;1"].createInstance(); if ( genData ) genData = genData.QueryInterface(Components.interfaces.nsISupportsWString); if (!genData) { return(false); } // trans.addDataFlavor( "text/unicode"); trans.addDataFlavor( top.transferType); // the index is on the <treeitem> which is two levels above the <treecell> which is // the target of the event. if (event.target.getAttribute( 'noDrag') == "true") { return( false); } var index = event.target.parentNode.parentNode.getAttribute("field-index"); if (!index) index = event.target.parentNode.parentNode.parentNode.getAttribute( "field-index"); if (!index) return( false); var indexStr = ("" + index); genData.data = indexStr; // trans.setTransferData ( "text/unicode", genData, indexStr.length * 2); trans.setTransferData ( top.transferType, genData, indexStr.length * 2); var transArray = Components.classes["@mozilla.org/supports-array;1"].createInstance(); if ( transArray ) transArray = transArray.QueryInterface(Components.interfaces.nsISupportsArray); if ( !transArray ) { return(false); } // put it into the transferable as an |nsISupports| var genTrans = trans.QueryInterface(Components.interfaces.nsISupports); transArray.AppendElement(genTrans); var nsIDragService = Components.interfaces.nsIDragService; top.dragStart = true; dragService.invokeDragSession ( event.target, transArray, null, nsIDragService.DRAGDROP_ACTION_MOVE); return( false); // don't propagate the event if a drag has begun} |
var transArray = Components.classes["@mozilla.org/supports-array;1"].createInstance(); if ( transArray ) transArray = transArray.QueryInterface(Components.interfaces.nsISupportsArray); if ( !transArray ) { return(false); } | trans.setTransferData ( top.transferType, genData, indexStr.length * 2); | function BeginDrag( event){ top.dragStart = false; var tree = document.getElementById("fieldList"); if ( event.target == tree ) { return( true); // continue propagating the event } if (!tree) { return( false); } var dragService = Components.classes["@mozilla.org/widget/dragservice;1"].getService(); if ( dragService ) dragService = dragService.QueryInterface(Components.interfaces.nsIDragService); if ( !dragService ) { return(false); } var trans = Components.classes["@mozilla.org/widget/transferable;1"].createInstance(); if ( trans ) trans = trans.QueryInterface(Components.interfaces.nsITransferable); if ( !trans ) { return(false); } var genData = Components.classes["@mozilla.org/supports-wstring;1"].createInstance(); if ( genData ) genData = genData.QueryInterface(Components.interfaces.nsISupportsWString); if (!genData) { return(false); } // trans.addDataFlavor( "text/unicode"); trans.addDataFlavor( top.transferType); // the index is on the <treeitem> which is two levels above the <treecell> which is // the target of the event. if (event.target.getAttribute( 'noDrag') == "true") { return( false); } var index = event.target.parentNode.parentNode.getAttribute("field-index"); if (!index) index = event.target.parentNode.parentNode.parentNode.getAttribute( "field-index"); if (!index) return( false); var indexStr = ("" + index); genData.data = indexStr; // trans.setTransferData ( "text/unicode", genData, indexStr.length * 2); trans.setTransferData ( top.transferType, genData, indexStr.length * 2); var transArray = Components.classes["@mozilla.org/supports-array;1"].createInstance(); if ( transArray ) transArray = transArray.QueryInterface(Components.interfaces.nsISupportsArray); if ( !transArray ) { return(false); } // put it into the transferable as an |nsISupports| var genTrans = trans.QueryInterface(Components.interfaces.nsISupports); transArray.AppendElement(genTrans); var nsIDragService = Components.interfaces.nsIDragService; top.dragStart = true; dragService.invokeDragSession ( event.target, transArray, null, nsIDragService.DRAGDROP_ACTION_MOVE); return( false); // don't propagate the event if a drag has begun} |
var genTrans = trans.QueryInterface(Components.interfaces.nsISupports); transArray.AppendElement(genTrans); var nsIDragService = Components.interfaces.nsIDragService; top.dragStart = true; | var transArray = Components.classes["@mozilla.org/supports-array;1"].createInstance(); if ( transArray ) transArray = transArray.QueryInterface(Components.interfaces.nsISupportsArray); if ( !transArray ) { return(false); } | function BeginDrag( event){ top.dragStart = false; var tree = document.getElementById("fieldList"); if ( event.target == tree ) { return( true); // continue propagating the event } if (!tree) { return( false); } var dragService = Components.classes["@mozilla.org/widget/dragservice;1"].getService(); if ( dragService ) dragService = dragService.QueryInterface(Components.interfaces.nsIDragService); if ( !dragService ) { return(false); } var trans = Components.classes["@mozilla.org/widget/transferable;1"].createInstance(); if ( trans ) trans = trans.QueryInterface(Components.interfaces.nsITransferable); if ( !trans ) { return(false); } var genData = Components.classes["@mozilla.org/supports-wstring;1"].createInstance(); if ( genData ) genData = genData.QueryInterface(Components.interfaces.nsISupportsWString); if (!genData) { return(false); } // trans.addDataFlavor( "text/unicode"); trans.addDataFlavor( top.transferType); // the index is on the <treeitem> which is two levels above the <treecell> which is // the target of the event. if (event.target.getAttribute( 'noDrag') == "true") { return( false); } var index = event.target.parentNode.parentNode.getAttribute("field-index"); if (!index) index = event.target.parentNode.parentNode.parentNode.getAttribute( "field-index"); if (!index) return( false); var indexStr = ("" + index); genData.data = indexStr; // trans.setTransferData ( "text/unicode", genData, indexStr.length * 2); trans.setTransferData ( top.transferType, genData, indexStr.length * 2); var transArray = Components.classes["@mozilla.org/supports-array;1"].createInstance(); if ( transArray ) transArray = transArray.QueryInterface(Components.interfaces.nsISupportsArray); if ( !transArray ) { return(false); } // put it into the transferable as an |nsISupports| var genTrans = trans.QueryInterface(Components.interfaces.nsISupports); transArray.AppendElement(genTrans); var nsIDragService = Components.interfaces.nsIDragService; top.dragStart = true; dragService.invokeDragSession ( event.target, transArray, null, nsIDragService.DRAGDROP_ACTION_MOVE); return( false); // don't propagate the event if a drag has begun} |
dragService.invokeDragSession ( event.target, transArray, null, nsIDragService.DRAGDROP_ACTION_MOVE); | var genTrans = trans.QueryInterface(Components.interfaces.nsISupports); transArray.AppendElement(genTrans); | function BeginDrag( event){ top.dragStart = false; var tree = document.getElementById("fieldList"); if ( event.target == tree ) { return( true); // continue propagating the event } if (!tree) { return( false); } var dragService = Components.classes["@mozilla.org/widget/dragservice;1"].getService(); if ( dragService ) dragService = dragService.QueryInterface(Components.interfaces.nsIDragService); if ( !dragService ) { return(false); } var trans = Components.classes["@mozilla.org/widget/transferable;1"].createInstance(); if ( trans ) trans = trans.QueryInterface(Components.interfaces.nsITransferable); if ( !trans ) { return(false); } var genData = Components.classes["@mozilla.org/supports-wstring;1"].createInstance(); if ( genData ) genData = genData.QueryInterface(Components.interfaces.nsISupportsWString); if (!genData) { return(false); } // trans.addDataFlavor( "text/unicode"); trans.addDataFlavor( top.transferType); // the index is on the <treeitem> which is two levels above the <treecell> which is // the target of the event. if (event.target.getAttribute( 'noDrag') == "true") { return( false); } var index = event.target.parentNode.parentNode.getAttribute("field-index"); if (!index) index = event.target.parentNode.parentNode.parentNode.getAttribute( "field-index"); if (!index) return( false); var indexStr = ("" + index); genData.data = indexStr; // trans.setTransferData ( "text/unicode", genData, indexStr.length * 2); trans.setTransferData ( top.transferType, genData, indexStr.length * 2); var transArray = Components.classes["@mozilla.org/supports-array;1"].createInstance(); if ( transArray ) transArray = transArray.QueryInterface(Components.interfaces.nsISupportsArray); if ( !transArray ) { return(false); } // put it into the transferable as an |nsISupports| var genTrans = trans.QueryInterface(Components.interfaces.nsISupports); transArray.AppendElement(genTrans); var nsIDragService = Components.interfaces.nsIDragService; top.dragStart = true; dragService.invokeDragSession ( event.target, transArray, null, nsIDragService.DRAGDROP_ACTION_MOVE); return( false); // don't propagate the event if a drag has begun} |
return( false); | var nsIDragService = Components.interfaces.nsIDragService; top.dragStart = true; dragService.invokeDragSession ( event.target, transArray, null, nsIDragService.DRAGDROP_ACTION_MOVE); return( false); | function BeginDrag( event){ top.dragStart = false; var tree = document.getElementById("fieldList"); if ( event.target == tree ) { return( true); // continue propagating the event } if (!tree) { return( false); } var dragService = Components.classes["@mozilla.org/widget/dragservice;1"].getService(); if ( dragService ) dragService = dragService.QueryInterface(Components.interfaces.nsIDragService); if ( !dragService ) { return(false); } var trans = Components.classes["@mozilla.org/widget/transferable;1"].createInstance(); if ( trans ) trans = trans.QueryInterface(Components.interfaces.nsITransferable); if ( !trans ) { return(false); } var genData = Components.classes["@mozilla.org/supports-wstring;1"].createInstance(); if ( genData ) genData = genData.QueryInterface(Components.interfaces.nsISupportsWString); if (!genData) { return(false); } // trans.addDataFlavor( "text/unicode"); trans.addDataFlavor( top.transferType); // the index is on the <treeitem> which is two levels above the <treecell> which is // the target of the event. if (event.target.getAttribute( 'noDrag') == "true") { return( false); } var index = event.target.parentNode.parentNode.getAttribute("field-index"); if (!index) index = event.target.parentNode.parentNode.parentNode.getAttribute( "field-index"); if (!index) return( false); var indexStr = ("" + index); genData.data = indexStr; // trans.setTransferData ( "text/unicode", genData, indexStr.length * 2); trans.setTransferData ( top.transferType, genData, indexStr.length * 2); var transArray = Components.classes["@mozilla.org/supports-array;1"].createInstance(); if ( transArray ) transArray = transArray.QueryInterface(Components.interfaces.nsISupportsArray); if ( !transArray ) { return(false); } // put it into the transferable as an |nsISupports| var genTrans = trans.QueryInterface(Components.interfaces.nsISupports); transArray.AppendElement(genTrans); var nsIDragService = Components.interfaces.nsIDragService; top.dragStart = true; dragService.invokeDragSession ( event.target, transArray, null, nsIDragService.DRAGDROP_ACTION_MOVE); return( false); // don't propagate the event if a drag has begun} |
dragService.invokeDragSession ( transArray, null, nsIDragService.DRAGDROP_ACTION_MOVE); | dragService.invokeDragSession ( event.target, transArray, null, nsIDragService.DRAGDROP_ACTION_MOVE); | function BeginDrag( event){ top.dragStart = false; var tree = document.getElementById("fieldList"); if ( event.target == tree ) { return( true); // continue propagating the event } if (!tree) { return( false); } var dragService = Components.classes["component://netscape/widget/dragservice"].getService(); if ( dragService ) dragService = dragService.QueryInterface(Components.interfaces.nsIDragService); if ( !dragService ) { return(false); } var trans = Components.classes["component://netscape/widget/transferable"].createInstance(); if ( trans ) trans = trans.QueryInterface(Components.interfaces.nsITransferable); if ( !trans ) { return(false); } var genData = Components.classes["component://netscape/supports-wstring"].createInstance(); if ( genData ) genData = genData.QueryInterface(Components.interfaces.nsISupportsWString); if (!genData) { return(false); } // trans.addDataFlavor( "text/unicode"); trans.addDataFlavor( top.transferType); // the index is on the <treeitem> which is two levels above the <treecell> which is // the target of the event. if (event.target.getAttribute( 'noDrag') == "true") { return( false); } var index = event.target.parentNode.parentNode.getAttribute("field-index"); if (!index) index = event.target.parentNode.parentNode.parentNode.getAttribute( "field-index"); if (!index) return( false); var indexStr = ("" + index); genData.data = indexStr; // trans.setTransferData ( "text/unicode", genData, indexStr.length * 2); trans.setTransferData ( top.transferType, genData, indexStr.length * 2); var transArray = Components.classes["component://netscape/supports-array"].createInstance(); if ( transArray ) transArray = transArray.QueryInterface(Components.interfaces.nsISupportsArray); if ( !transArray ) { return(false); } // put it into the transferable as an |nsISupports| var genTrans = trans.QueryInterface(Components.interfaces.nsISupports); transArray.AppendElement(genTrans); var nsIDragService = Components.interfaces.nsIDragService; top.dragStart = true; dragService.invokeDragSession ( transArray, null, nsIDragService.DRAGDROP_ACTION_MOVE); return( false); // don't propagate the event if a drag has begun} |
return; | function BeginDragContentArea ( event ){ if ( event.target == null ) return; var dragService = Components.classes["component://netscape/widget/dragservice"].getService(Components.interfaces.nsIDragService); if ( dragService == null ) return; var trans = Components.classes["component://netscape/widget/transferable"].createInstance(Components.interfaces.nsITransferable); if ( trans == null ) return; var genTextData = Components.classes["component://netscape/supports-wstring"].createInstance(Components.interfaces.nsISupportsWString); var htmlData = Components.classes["component://netscape/supports-wstring"].createInstance(Components.interfaces.nsISupportsWString); if ( (genTextData == null) || (htmlData == null) ) return; var htmlstring = null; var textstring = null; var domselection = window.content.getSelection(); if ( domselection && !domselection.isCollapsed) { // the window has a selection so we should grab that rather than looking for specific elements// dump(domselection); htmlstring = domselection.toString("text/html", 128+256, 0); textstring = domselection.toString("text/plain", 0, 0); // The following return disables the ability to drag & drop // the current selection. This temporarily fixes bug #39821 // so that others are unblocked. Remove it when drag & drop and // selection cooperate better. return; } else { switch (event.target.nodeName) { case 'AREA': case 'IMG': var imgsrc = event.target.getAttribute("src"); var baseurl = window.content.location.href; textstring = imgsrc; htmlstring = "<img src=\"" + textstring + "\">"; break; case 'HR': break; case 'A': if ( event.target.href ) { // link textstring = event.target.getAttribute("href"); htmlstring = "<a href=\"" + textstring + "\">" + textstring + "</a>"; } else if (event.target.name ) { // named anchor textstring = event.target.getAttribute("name"); htmlstring = "<a name=\"" + textstring + "\">" + textstring + "</a>" } break; default: case '#text': case 'LI': case 'OL': case 'DD': textstring = enclosingLink(event.target); if ( textstring != "" ) htmlstring = "<a href=\"" + textstring + "\">" + textstring + "</a>"; else return; break; } } htmlData.data = htmlstring; trans.addDataFlavor("text/html"); trans.setTransferData ( "text/html", htmlData, htmlstring.length * 2 ); // double byte data if ( textstring && (textstring != "") ) { genTextData.data = textstring; trans.addDataFlavor("text/unicode"); trans.setTransferData ( "text/unicode", genTextData, textstring.length * 2 ); // double byte data } var transArray = Components.classes["component://netscape/supports-array"].createInstance(Components.interfaces.nsISupportsArray); if ( transArray ) { // put it into the transferable as an |nsISupports| var genTrans = trans.QueryInterface(Components.interfaces.nsISupports); transArray.AppendElement(genTrans); var nsIDragService = Components.interfaces.nsIDragService; dragService.invokeDragSession ( event.target, transArray, null, nsIDragService.DRAGDROP_ACTION_COPY + nsIDragService.DRAGDROP_ACTION_MOVE ); event.preventBubble(); }} |
|
if (row.value == -1) return; | function BeginDragFolderOutliner(event){ debugDump("BeginDragFolderOutliner\n"); var folderOutliner = GetFolderOutliner(); var row = {}; var col = {}; var elt = {}; folderOutliner.outlinerBoxObject.getCellAt(event.clientX, event.clientY, row, col, elt); var folderResource = GetFolderResource(folderOutliner, row.value); if (GetFolderAttribute(folderOutliner, folderResource, "IsServer") == "true") { debugDump("***IsServer == true\n"); return false; } // do not allow the drag when news is the source if (GetFolderAttribute(folderOutliner, folderResource, "ServerType") == "nntp") { debugDump("***ServerType == nntp\n"); return false; } var selectedFolders = GetSelectedFolders(); return BeginDragOutliner(event, folderOutliner, selectedFolders, "text/x-moz-message-or-folder");} |
|
dragService.invokeDragSession ( transArray, null, nsIDragService.DRAGDROP_ACTION_COPY + | dragService.invokeDragSession ( event.target, transArray, null, nsIDragService.DRAGDROP_ACTION_COPY + | function BeginDragResultTree(event){ debugDump("BeginDragResultTree\n"); //XXX we rely on a capturer to already have determined which item the mouse was over //XXX and have set an attribute. // if the click is on the tree proper, ignore it. We only care about clicks on items. var tree = resultsTree; if ( event.target == tree ) return(true); // continue propagating the event var childWithDatabase = tree; if ( ! childWithDatabase ) return(false); var database = childWithDatabase.database; var rdf = GetRDFService(); if ((!rdf) || (!database)) { debugDump("CAN'T GET DATABASE\n"); return(false); } var dragStarted = false; var dragService = GetDragService(); if ( !dragService ) return(false); var transArray = Components.classes["component://netscape/supports-array"].createInstance(Components.interfaces.nsISupportsArray); if ( !transArray ) return(false); var selArray = tree.selectedItems; var count = selArray.length; debugDump("selArray.length = " + count + "\n"); for ( var i = 0; i < count; ++i ) { var trans = Components.classes["component://netscape/widget/transferable"].createInstance(Components.interfaces.nsITransferable); if ( !trans ) return(false); var genTextData = Components.classes["component://netscape/supports-wstring"].createInstance(Components.interfaces.nsISupportsWString); if (!genTextData) return(false); trans.addDataFlavor("text/nsabcard"); // get id (url) var id = selArray[i].getAttribute("id"); genTextData.data = id; debugDump(" ID #" + i + " = " + id + "\n"); trans.setTransferData ( "text/nsabcard", genTextData, id.length * 2 ); // doublebyte byte data // put it into the transferable as an |nsISupports| var genTrans = trans.QueryInterface(Components.interfaces.nsISupports); transArray.AppendElement(genTrans); } var nsIDragService = Components.interfaces.nsIDragService; dragService.invokeDragSession ( transArray, null, nsIDragService.DRAGDROP_ACTION_COPY + nsIDragService.DRAGDROP_ACTION_MOVE ); dragStarted = true; return(!dragStarted); // don't propagate the event if a drag has begun} |
if (!selectedMessages) return false; | function BeginDragThreadPane(event){ debugDump("BeginDragThreadPane\n"); var threadTree = GetThreadTree(); var selectedMessages = GetSelectedMessages(); //A message can be dragged from one window and dropped on another window //therefore setNextMessageAfterDelete() here //no major disadvantage even if it is a copy operation SetNextMessageAfterDelete(); return BeginDragTree(event, threadTree, selectedMessages, "text/x-moz-message");} |
|
dragService.invokeDragSession ( transArray, null, nsIDragService.DRAGDROP_ACTION_COPY + | dragService.invokeDragSession ( event.target, transArray, null, nsIDragService.DRAGDROP_ACTION_COPY + | function BeginDragThreadTree(event){ debugDump("BeginDragThreadTree\n"); //XXX we rely on a capturer to already have determined which item the mouse was over //XXX and have set an attribute. // if the click is on the tree proper, ignore it. We only care about clicks on items. var tree = GetThreadTree(); if ( event.target == tree ) return(true); // continue propagating the event var childWithDatabase = tree; if ( ! childWithDatabase ) return(false); var database = childWithDatabase.database; var rdf = GetRDFService(); if ((!rdf) || (!database)) { debugDump("CAN'T GET DATABASE\n"); return(false); } var dragStarted = false; var dragService = GetDragService(); if ( !dragService ) return(false); var transArray = Components.classes["component://netscape/supports-array"].createInstance(Components.interfaces.nsISupportsArray); if ( !transArray ) return(false); var selArray = tree.selectedItems; var count = selArray.length; debugDump("selArray.length = " + count + "\n"); for ( var i = 0; i < count; ++i ) { var trans = Components.classes["component://netscape/widget/transferable"].createInstance(Components.interfaces.nsITransferable); if ( !trans ) return(false); var genTextData = Components.classes["component://netscape/supports-wstring"].createInstance(Components.interfaces.nsISupportsWString); if (!genTextData) return(false); trans.addDataFlavor("text/nsmessage"); // get id (url) var id = selArray[i].getAttribute("id"); genTextData.data = id; debugDump(" ID #" + i + " = " + id + "\n"); trans.setTransferData ( "text/nsmessage", genTextData, id.length * 2 ); // doublebyte byte data // put it into the transferable as an |nsISupports| var genTrans = trans.QueryInterface(Components.interfaces.nsISupports); transArray.AppendElement(genTrans); } var nsIDragService = Components.interfaces.nsIDragService; dragService.invokeDragSession ( transArray, null, nsIDragService.DRAGDROP_ACTION_COPY + nsIDragService.DRAGDROP_ACTION_MOVE ); dragStarted = true; return(!dragStarted); // don't propagate the event if a drag has begun} |
var trans = | var transferable = | function BeginDragTree ( event ){ var tree = document.getElementById("tree"); if ( event.target == tree ) return(true); // continue propagating the event // only <treeitem>s can be dragged out if ( event.target.parentNode.parentNode.tagName != "treeitem") return(false); var database = tree.database; if (!database) return(false); var RDF = Components.classes[RDFSERVICE_CONTRACTID].getService(nsIRDFService); if (!RDF) return(false); var dragStarted = false; var trans = Components.classes[TRANSFERABLE_CONTRACTID].createInstance(nsITransferable); if ( !trans ) return(false); var genData = Components.classes[WSTRING_CONTRACTID].createInstance(nsISupportsWString); if (!genData) return(false); var genDataURL = Components.classes[WSTRING_CONTRACTID].createInstance(nsISupportsWString); if (!genDataURL) return(false); trans.addDataFlavor("text/unicode"); trans.addDataFlavor("moz/rdfitem"); // ref/id (url) is on the <treeitem> which is two levels above the <treecell> which is // the target of the event. var id = event.target.parentNode.parentNode.getAttribute("ref"); if (!id || id=="") { id = event.target.parentNode.parentNode.getAttribute("id"); } var parentID = event.target.parentNode.parentNode.parentNode.parentNode.getAttribute("ref"); if (!parentID || parentID == "") { parentID = event.target.parentNode.parentNode.parentNode.parentNode.getAttribute("id"); } // if we can get node's name, append (space) name to url var src = RDF.GetResource(id, true); var prop = RDF.GetResource(NC_NAME, true); var target = database.GetTarget(src, prop, true); if (target) target = target.QueryInterface(nsIRDFLiteral); if (target) target = target.Value; if (target && (target != "")) { id = id + " " + target; } var trueID = id; if (parentID != null) { trueID += "\n" + parentID; } genData.data = trueID; genDataURL.data = id; trans.setTransferData ( "moz/rdfitem", genData, genData.data.length * 2); // double byte data trans.setTransferData ( "text/unicode", genDataURL, genDataURL.data.length * 2); // double byte data var transArray = Components.classes[ARRAY_CONTRACTID].createInstance(nsISupportsArray); if ( !transArray ) return(false); // put it into the transferable as an |nsISupports| var genTrans = trans.QueryInterface(Components.interfaces.nsISupports); transArray.AppendElement(genTrans); var dragService = Components.classes[DRAGSERVICE_CONTRACTID].getService(nsIDragService); if ( !dragService ) return(false); dragService.invokeDragSession ( event.target, transArray, null, nsIDragService.DRAGDROP_ACTION_COPY + nsIDragService.DRAGDROP_ACTION_MOVE ); dragStarted = true; return(!dragStarted);} |
if ( !trans ) return(false); | if ( !transferable ) return(false); | function BeginDragTree ( event ){ var tree = document.getElementById("tree"); if ( event.target == tree ) return(true); // continue propagating the event // only <treeitem>s can be dragged out if ( event.target.parentNode.parentNode.tagName != "treeitem") return(false); var database = tree.database; if (!database) return(false); var RDF = Components.classes[RDFSERVICE_CONTRACTID].getService(nsIRDFService); if (!RDF) return(false); var dragStarted = false; var trans = Components.classes[TRANSFERABLE_CONTRACTID].createInstance(nsITransferable); if ( !trans ) return(false); var genData = Components.classes[WSTRING_CONTRACTID].createInstance(nsISupportsWString); if (!genData) return(false); var genDataURL = Components.classes[WSTRING_CONTRACTID].createInstance(nsISupportsWString); if (!genDataURL) return(false); trans.addDataFlavor("text/unicode"); trans.addDataFlavor("moz/rdfitem"); // ref/id (url) is on the <treeitem> which is two levels above the <treecell> which is // the target of the event. var id = event.target.parentNode.parentNode.getAttribute("ref"); if (!id || id=="") { id = event.target.parentNode.parentNode.getAttribute("id"); } var parentID = event.target.parentNode.parentNode.parentNode.parentNode.getAttribute("ref"); if (!parentID || parentID == "") { parentID = event.target.parentNode.parentNode.parentNode.parentNode.getAttribute("id"); } // if we can get node's name, append (space) name to url var src = RDF.GetResource(id, true); var prop = RDF.GetResource(NC_NAME, true); var target = database.GetTarget(src, prop, true); if (target) target = target.QueryInterface(nsIRDFLiteral); if (target) target = target.Value; if (target && (target != "")) { id = id + " " + target; } var trueID = id; if (parentID != null) { trueID += "\n" + parentID; } genData.data = trueID; genDataURL.data = id; trans.setTransferData ( "moz/rdfitem", genData, genData.data.length * 2); // double byte data trans.setTransferData ( "text/unicode", genDataURL, genDataURL.data.length * 2); // double byte data var transArray = Components.classes[ARRAY_CONTRACTID].createInstance(nsISupportsArray); if ( !transArray ) return(false); // put it into the transferable as an |nsISupports| var genTrans = trans.QueryInterface(Components.interfaces.nsISupports); transArray.AppendElement(genTrans); var dragService = Components.classes[DRAGSERVICE_CONTRACTID].getService(nsIDragService); if ( !dragService ) return(false); dragService.invokeDragSession ( event.target, transArray, null, nsIDragService.DRAGDROP_ACTION_COPY + nsIDragService.DRAGDROP_ACTION_MOVE ); dragStarted = true; return(!dragStarted);} |
trans.addDataFlavor("text/unicode"); trans.addDataFlavor("moz/rdfitem"); | transferable.addDataFlavor("text/unicode"); transferable.addDataFlavor("moz/rdfitem"); | function BeginDragTree ( event ){ var tree = document.getElementById("tree"); if ( event.target == tree ) return(true); // continue propagating the event // only <treeitem>s can be dragged out if ( event.target.parentNode.parentNode.tagName != "treeitem") return(false); var database = tree.database; if (!database) return(false); var RDF = Components.classes[RDFSERVICE_CONTRACTID].getService(nsIRDFService); if (!RDF) return(false); var dragStarted = false; var trans = Components.classes[TRANSFERABLE_CONTRACTID].createInstance(nsITransferable); if ( !trans ) return(false); var genData = Components.classes[WSTRING_CONTRACTID].createInstance(nsISupportsWString); if (!genData) return(false); var genDataURL = Components.classes[WSTRING_CONTRACTID].createInstance(nsISupportsWString); if (!genDataURL) return(false); trans.addDataFlavor("text/unicode"); trans.addDataFlavor("moz/rdfitem"); // ref/id (url) is on the <treeitem> which is two levels above the <treecell> which is // the target of the event. var id = event.target.parentNode.parentNode.getAttribute("ref"); if (!id || id=="") { id = event.target.parentNode.parentNode.getAttribute("id"); } var parentID = event.target.parentNode.parentNode.parentNode.parentNode.getAttribute("ref"); if (!parentID || parentID == "") { parentID = event.target.parentNode.parentNode.parentNode.parentNode.getAttribute("id"); } // if we can get node's name, append (space) name to url var src = RDF.GetResource(id, true); var prop = RDF.GetResource(NC_NAME, true); var target = database.GetTarget(src, prop, true); if (target) target = target.QueryInterface(nsIRDFLiteral); if (target) target = target.Value; if (target && (target != "")) { id = id + " " + target; } var trueID = id; if (parentID != null) { trueID += "\n" + parentID; } genData.data = trueID; genDataURL.data = id; trans.setTransferData ( "moz/rdfitem", genData, genData.data.length * 2); // double byte data trans.setTransferData ( "text/unicode", genDataURL, genDataURL.data.length * 2); // double byte data var transArray = Components.classes[ARRAY_CONTRACTID].createInstance(nsISupportsArray); if ( !transArray ) return(false); // put it into the transferable as an |nsISupports| var genTrans = trans.QueryInterface(Components.interfaces.nsISupports); transArray.AppendElement(genTrans); var dragService = Components.classes[DRAGSERVICE_CONTRACTID].getService(nsIDragService); if ( !dragService ) return(false); dragService.invokeDragSession ( event.target, transArray, null, nsIDragService.DRAGDROP_ACTION_COPY + nsIDragService.DRAGDROP_ACTION_MOVE ); dragStarted = true; return(!dragStarted);} |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.