rem
stringlengths 0
126k
| add
stringlengths 0
441k
| context
stringlengths 15
136k
|
---|---|---|
function handleHover(e) { var p = (e.type == "mouseover" ? e.fromElement : e.toElement) || e.relatedTarget; while ( p && p != this ) p = p.parentNode; | while ( p && p != this ) p = p.parentNode; if ( p == this ) return false; return (e.type == "mouseover" ? f : g).apply(this, [e]); } | jQuery.prototype.hover = function(f,g) { // A private function for haandling mouse 'hovering' function handleHover(e) { // Check if mouse(over|out) are still within the same parent element var p = (e.type == "mouseover" ? e.fromElement : e.toElement) || e.relatedTarget; // Traverse up the tree while ( p && p != this ) p = p.parentNode; // If we actually just moused on to a sub-element, ignore it if ( p == this ) return false; // Execute the right function return (e.type == "mouseover" ? f : g).apply(this, [e]); } // Bind the function to the two event listeners return this.mouseover(handleHover).mouseout(handleHover);}; |
if ( p == this ) return false; return (e.type == "mouseover" ? f : g).apply(this, [e]); } return this.mouseover(handleHover).mouseout(handleHover); }; | return this.mouseover(handleHover).mouseout(handleHover); }, | jQuery.prototype.hover = function(f,g) { // A private function for haandling mouse 'hovering' function handleHover(e) { // Check if mouse(over|out) are still within the same parent element var p = (e.type == "mouseover" ? e.fromElement : e.toElement) || e.relatedTarget; // Traverse up the tree while ( p && p != this ) p = p.parentNode; // If we actually just moused on to a sub-element, ignore it if ( p == this ) return false; // Execute the right function return (e.type == "mouseover" ? f : g).apply(this, [e]); } // Bind the function to the two event listeners return this.mouseover(handleHover).mouseout(handleHover);}; |
while ( p && p != this ) p = p.parentNode; | while ( p && p != this ) try { p = p.parentNode } catch(e) { p = null; }; | hover: function(f,g) { // A private function for haandling mouse 'hovering' function handleHover(e) { // Check if mouse(over|out) are still within the same parent element var p = (e.type == "mouseover" ? e.fromElement : e.toElement) || e.relatedTarget; // Traverse up the tree while ( p && p != this ) p = p.parentNode; // If we actually just moused on to a sub-element, ignore it if ( p == this ) return false; // Execute the right function return (e.type == "mouseover" ? f : g).apply(this, [e]); } // Bind the function to the two event listeners return this.mouseover(handleHover).mouseout(handleHover); }, |
function hrefAndLinkNodeForClickEvent(aParams) | function hrefAndLinkNodeForClickEvent(event) | function hrefAndLinkNodeForClickEvent(aParams) { var event = aParams.event; var target = event.target; var href = aParams.href; var linkNode = aParams.linkNode; var isKeyPress = (event.type == "keypress"); if ( target instanceof HTMLAnchorElement || target instanceof HTMLAreaElement || target instanceof HTMLLinkElement ) { if (target.hasAttribute("href")) linkNode = target; } else if ( target instanceof HTMLInputElement && (event.target.type == "text") // text field && !isKeyPress // not a key event && event.detail == 2 // double click && event.button == 0 // left mouse button && event.target.value.length == 0 // no text has been entered && "@mozilla.org/wallet/wallet-service;1" in Components.classes // wallet is available ) { prefillTextBox(target); // prefill the empty text field if possible } else { linkNode = event.originalTarget; while (linkNode && !(linkNode instanceof HTMLAnchorElement)) linkNode = linkNode.parentNode; // <a> cannot be nested. So if we find an anchor without an // href, there is no useful <a> around the target if (linkNode && !linkNode.hasAttribute("href")) linkNode = null; } if (linkNode) { href = linkNode.href; } else { // Try simple XLink linkNode = target; while (linkNode) { if (linkNode.nodeType == Node.ELEMENT_NODE) { href = linkNode.getAttributeNS("http://www.w3.org/1999/xlink", "href"); break; } linkNode = linkNode.parentNode; } if (href) { href = makeURLAbsolute(linkNode.baseURI, href); } } aParams.href = href; aParams.linkNode = linkNode; } |
var event = aParams.event; | function hrefAndLinkNodeForClickEvent(aParams) { var event = aParams.event; var target = event.target; var href = aParams.href; var linkNode = aParams.linkNode; var isKeyPress = (event.type == "keypress"); if ( target instanceof HTMLAnchorElement || target instanceof HTMLAreaElement || target instanceof HTMLLinkElement ) { if (target.hasAttribute("href")) linkNode = target; } else if ( target instanceof HTMLInputElement && (event.target.type == "text") // text field && !isKeyPress // not a key event && event.detail == 2 // double click && event.button == 0 // left mouse button && event.target.value.length == 0 // no text has been entered && "@mozilla.org/wallet/wallet-service;1" in Components.classes // wallet is available ) { prefillTextBox(target); // prefill the empty text field if possible } else { linkNode = event.originalTarget; while (linkNode && !(linkNode instanceof HTMLAnchorElement)) linkNode = linkNode.parentNode; // <a> cannot be nested. So if we find an anchor without an // href, there is no useful <a> around the target if (linkNode && !linkNode.hasAttribute("href")) linkNode = null; } if (linkNode) { href = linkNode.href; } else { // Try simple XLink linkNode = target; while (linkNode) { if (linkNode.nodeType == Node.ELEMENT_NODE) { href = linkNode.getAttributeNS("http://www.w3.org/1999/xlink", "href"); break; } linkNode = linkNode.parentNode; } if (href) { href = makeURLAbsolute(linkNode.baseURI, href); } } aParams.href = href; aParams.linkNode = linkNode; } |
|
var href = aParams.href; var linkNode = aParams.linkNode; | var href = ""; var linkNode = null; | function hrefAndLinkNodeForClickEvent(aParams) { var event = aParams.event; var target = event.target; var href = aParams.href; var linkNode = aParams.linkNode; var isKeyPress = (event.type == "keypress"); if ( target instanceof HTMLAnchorElement || target instanceof HTMLAreaElement || target instanceof HTMLLinkElement ) { if (target.hasAttribute("href")) linkNode = target; } else if ( target instanceof HTMLInputElement && (event.target.type == "text") // text field && !isKeyPress // not a key event && event.detail == 2 // double click && event.button == 0 // left mouse button && event.target.value.length == 0 // no text has been entered && "@mozilla.org/wallet/wallet-service;1" in Components.classes // wallet is available ) { prefillTextBox(target); // prefill the empty text field if possible } else { linkNode = event.originalTarget; while (linkNode && !(linkNode instanceof HTMLAnchorElement)) linkNode = linkNode.parentNode; // <a> cannot be nested. So if we find an anchor without an // href, there is no useful <a> around the target if (linkNode && !linkNode.hasAttribute("href")) linkNode = null; } if (linkNode) { href = linkNode.href; } else { // Try simple XLink linkNode = target; while (linkNode) { if (linkNode.nodeType == Node.ELEMENT_NODE) { href = linkNode.getAttributeNS("http://www.w3.org/1999/xlink", "href"); break; } linkNode = linkNode.parentNode; } if (href) { href = makeURLAbsolute(linkNode.baseURI, href); } } aParams.href = href; aParams.linkNode = linkNode; } |
aParams.href = href; aParams.linkNode = linkNode; | return linkNode ? {href: href, linkNode: linkNode} : null; | function hrefAndLinkNodeForClickEvent(aParams) { var event = aParams.event; var target = event.target; var href = aParams.href; var linkNode = aParams.linkNode; var isKeyPress = (event.type == "keypress"); if ( target instanceof HTMLAnchorElement || target instanceof HTMLAreaElement || target instanceof HTMLLinkElement ) { if (target.hasAttribute("href")) linkNode = target; } else if ( target instanceof HTMLInputElement && (event.target.type == "text") // text field && !isKeyPress // not a key event && event.detail == 2 // double click && event.button == 0 // left mouse button && event.target.value.length == 0 // no text has been entered && "@mozilla.org/wallet/wallet-service;1" in Components.classes // wallet is available ) { prefillTextBox(target); // prefill the empty text field if possible } else { linkNode = event.originalTarget; while (linkNode && !(linkNode instanceof HTMLAnchorElement)) linkNode = linkNode.parentNode; // <a> cannot be nested. So if we find an anchor without an // href, there is no useful <a> around the target if (linkNode && !linkNode.hasAttribute("href")) linkNode = null; } if (linkNode) { href = linkNode.href; } else { // Try simple XLink linkNode = target; while (linkNode) { if (linkNode.nodeType == Node.ELEMENT_NODE) { href = linkNode.getAttributeNS("http://www.w3.org/1999/xlink", "href"); break; } linkNode = linkNode.parentNode; } if (href) { href = makeURLAbsolute(linkNode.baseURI, href); } } aParams.href = href; aParams.linkNode = linkNode; } |
return typeof h == 'undefined' && this.size() ? this.get(0).innerHTML : this.set( "innerHTML", h ); }, | return h == undefined && this.size() ? this.get(0).innerHTML : this.set( "innerHTML", h ); }, | html: function(h) { return typeof h == 'undefined' && this.size() ? this.get(0).innerHTML : this.set( "innerHTML", h ); }, |
return str.replace('&','&').replace('<','<').replace('>','>').replace('"','"').replace('+',' '); | return str.replace(/&/g,'&').replace(/</g,'<').replace(/>/g,'>').replace(/"/g,'"').replace(/\+/g,' '); | function htmlEntities(str){ return str.replace('&','&').replace('<','<').replace('>','>').replace('"','"').replace('+',' ');} |
html += indent + "<" + node.GetTagName() | html += "\n" + indent + "<" + node.GetTagName() | function htmlString(node, indent){ var html = "" indent += " " var type = node.GetNodeType() if (type == Node.ELEMENT) { // open tag html += indent + "<" + node.GetTagName() // dump the attributes if any attributes = node.GetAttributes() if (null != attributes) { html += " " var countAttrs = attributes.GetLength() var index = 0 while(index < countAttrs) { att = attributes.Item(index) if (null != att) { html += att.ToString() } index++ } } // end tag html += ">" // recursively dump the children if (node.HasChildNodes()) { // get the children var children = node.GetChildNodes() var length = children.GetLength() var child = children.GetNextNode() var count = 0; while(count < length) { html += htmlString(child, indent) child = children.GetNextNode() count++ } } // close tag html += "</" + node.GetTagName() + ">" } // if it's a piece of text just dump the text else if (type == Node.TEXT) { html += node.data } return html;} |
html += "</" + node.GetTagName() + ">" | html += "\n" + indent + "</" + node.GetTagName() + ">" | function htmlString(node, indent){ var html = "" indent += " " var type = node.GetNodeType() if (type == Node.ELEMENT) { // open tag html += indent + "<" + node.GetTagName() // dump the attributes if any attributes = node.GetAttributes() if (null != attributes) { html += " " var countAttrs = attributes.GetLength() var index = 0 while(index < countAttrs) { att = attributes.Item(index) if (null != att) { html += att.ToString() } index++ } } // end tag html += ">" // recursively dump the children if (node.HasChildNodes()) { // get the children var children = node.GetChildNodes() var length = children.GetLength() var child = children.GetNextNode() var count = 0; while(count < length) { html += htmlString(child, indent) child = children.GetNextNode() count++ } } // close tag html += "</" + node.GetTagName() + ">" } // if it's a piece of text just dump the text else if (type == Node.TEXT) { html += node.data } return html;} |
jQuery.httpData = function(r,type) { var ct = r.getResponseHeader("content-type"); var xml = ( !type || type == "xml" ) && ct && ct.indexOf("xml") >= 0; return xml ? r.responseXML : r.responseText; }; | httpData: function(r,type) { var ct = r.getResponseHeader("content-type"); var xml = ( !type || type == "xml" ) && ct && ct.indexOf("xml") >= 0; return xml ? r.responseXML : r.responseText; }, | jQuery.httpData = function(r,type) { var ct = r.getResponseHeader("content-type"); var xml = ( !type || type == "xml" ) && ct && ct.indexOf("xml") >= 0; return xml ? r.responseXML : r.responseText;}; |
if ( type == "script" ) eval.call( window, data ); | if ( type == "script" ) { if (window.execScript) window.execScript( data ); else window.setTimeout( data, 0 ); } | httpData: function(r,type) { var ct = r.getResponseHeader("content-type"); var data = !type && ct && ct.indexOf("xml") >= 0; data = type == "xml" || data ? r.responseXML : r.responseText; // If the type is "script", eval it if ( type == "script" ) eval.call( window, data ); // Get the JavaScript object, if JSON is used. if ( type == "json" ) eval( "data = " + data ); // evaluate scripts within html if ( type == "html" ) jQuery("<div>").html(data).evalScripts(); return data; }, |
var data = ( !type || type == "xml" ) && ct && ct.indexOf("xml") >= 0; data = data ? r.responseXML : r.responseText; | var data = !type && ct && ct.indexOf("xml") >= 0; data = type == "xml" || data ? r.responseXML : r.responseText; | httpData: function(r,type) { var ct = r.getResponseHeader("content-type"); var data = ( !type || type == "xml" ) && ct && ct.indexOf("xml") >= 0; data = data ? r.responseXML : r.responseText; // If the type is "script", eval it if ( type == "script" ) eval.call( window, data ); return data; }, |
if ( type == "html" ) $("<div>").html(data).evalScripts(); | httpData: function(r,type) { var ct = r.getResponseHeader("content-type"); var data = !type && ct && ct.indexOf("xml") >= 0; data = type == "xml" || data ? r.responseXML : r.responseText; // If the type is "script", eval it if ( type == "script" ) eval.call( window, data ); // Get the JavaScript object, if JSON is used. if ( type == "json" ) eval( "data = " + data ); return data; }, |
|
var xml = ( !type || type == "xml" ) && r.getResponseHeader("content-type").indexOf("xml") >= 0; | var ct = r.getResponseHeader("content-type"); var xml = ( !type || type == "xml" ) && ct && ct.indexOf("xml") >= 0; | jQuery.httpData = function(r,type) { var xml = ( !type || type == "xml" ) && r.getResponseHeader("content-type").indexOf("xml") >= 0; return xml ? r.responseXML : r.responseText;}; |
return r.getResponseHeader("content-type").indexOf("xml") > 0 || type == "xml" ? r.responseXML : r.responseText; | var xml = ( !type || type == "xml" ) && r.getResponseHeader("content-type").indexOf("xml") >= 0; return xml ? r.responseXML : r.responseText; | jQuery.httpData = function(r,type) { // Check the headers, or watch for a force override return r.getResponseHeader("content-type").indexOf("xml") > 0 || type == "xml" ? r.responseXML : r.responseText;}; |
var xml = ( !type || type == "xml" ) && ct && ct.indexOf("xml") >= 0; return xml ? r.responseXML : r.responseText; | var data = ( !type || type == "xml" ) && ct && ct.indexOf("xml") >= 0; data = data ? r.responseXML : r.responseText; if ( type == "script" ) eval.call( window, data ); return data; | httpData: function(r,type) { var ct = r.getResponseHeader("content-type"); var xml = ( !type || type == "xml" ) && ct && ct.indexOf("xml") >= 0; return xml ? r.responseXML : r.responseText; }, |
jQuery.eval( data ); | jQuery.globalEval( data ); | httpData: function(r,type) { var ct = r.getResponseHeader("content-type"); var data = !type && ct && ct.indexOf("xml") >= 0; data = type == "xml" || data ? r.responseXML : r.responseText; // If the type is "script", eval it in global context if ( type == "script" ) { jQuery.eval( data ); } // Get the JavaScript object, if JSON is used. if ( type == "json" ) eval( "data = " + data ); // evaluate scripts within html if ( type == "html" ) jQuery("<div>").html(data).evalScripts(); return data; }, |
if (window.execScript) window.execScript( data ); else window.setTimeout( data, 0 ); | jQuery.eval( data ); | httpData: function(r,type) { var ct = r.getResponseHeader("content-type"); var data = !type && ct && ct.indexOf("xml") >= 0; data = type == "xml" || data ? r.responseXML : r.responseText; // If the type is "script", eval it in global context // TODO extract as $.eval if ( type == "script" ) { if (window.execScript) window.execScript( data ); else window.setTimeout( data, 0 ); } // Get the JavaScript object, if JSON is used. if ( type == "json" ) eval( "data = " + data ); // evaluate scripts within html if ( type == "html" ) jQuery("<div>").html(data).evalScripts(); return data; }, |
if (xmlhttp.readyState == 4) { | if ((xmlhttp)&&(xmlhttp.readyState == 4)) { | this.HTTPloaded = function () { if (xmlhttp.readyState == 4) { me.inputText = this.value; me.getEligible(); if (me.eligible.length>0) { me.createDiv(); me.positionDiv(); me.showDiv(); } else { me.hideDiv(); } } } |
me.createDiv(); me.positionDiv(); me.showDiv(); | if (me.eligible.length>0) { me.createDiv(); me.positionDiv(); me.showDiv(); } else { me.hideDiv(); } | this.HTTPloaded = function () { if (xmlhttp.readyState == 4) { me.inputText = this.value; me.getEligible(); me.createDiv(); me.positionDiv(); me.showDiv(); } } |
if( xml.status == 304 || xmlRes == jQuery.lastModified[url] ) return true; | return xml.status == 304 || xmlRes == jQuery.lastModified[url] || jQuery.browser.safari && xml.status == undefined; | httpNotModified: function(xml, url) { try { var xmlRes = xml.getResponseHeader("Last-Modified"); // Firefox always returns 200. check Last-Modified date if( xml.status == 304 || xmlRes == jQuery.lastModified[url] ) return true; } catch(e){} return false; }, |
jQuery.httpSuccess = function(r) { try { return r.status ? ( r.status >= 200 && r.status < 300 ) || r.status == 304 : location.protocol == "file:"; } catch(e){} return false; }; | httpSuccess: function(r) { try { return r.status ? ( r.status >= 200 && r.status < 300 ) || r.status == 304 : location.protocol == "file:"; } catch(e){} return false; }, | jQuery.httpSuccess = function(r) { try { return r.status ? ( r.status >= 200 && r.status < 300 ) || r.status == 304 : location.protocol == "file:"; } catch(e){} return false;}; |
return r.status ? ( r.status >= 200 && r.status < 300 ) || r.status == 304 : location.protocol == "file:"; | return !r.status && location.protocol == "file:" || ( r.status >= 200 && r.status < 300 ) || r.status == 304 || jQuery.browser.safari && r.status == undefined; | httpSuccess: function(r) { try { return r.status ? ( r.status >= 200 && r.status < 300 ) || r.status == 304 : location.protocol == "file:"; } catch(e){} return false; }, |
r.status == 304 ) || !r.status && location.protocol == 'file:'; | r.status == 304 ) || !r.status && location.protocol == "file:"; | $.httpSuccess = function(r) { return ( r.status && ( r.status >= 200 && r.status < 300 ) || r.status == 304 ) || !r.status && location.protocol == 'file:';}; |
return ( r.status && ( r.status >= 200 && r.status < 300 ) || r.status == 304 ) || !r.status && location.protocol == "file:"; | return r.status ? ( r.status >= 200 && r.status < 300 ) || r.status == 304 : location.protocol == "file:"; | jQuery.httpSuccess = function(r) { return ( r.status && ( r.status >= 200 && r.status < 300 ) || r.status == 304 ) || !r.status && location.protocol == "file:";}; |
function hyphenateWord (str, length, hyphen) | function hyphenateWord (str, pos, hyphen) | function hyphenateWord (str, length, hyphen){ if (typeof hyphen == "undefined") hyphen = " "; if (str.length <= length) return str; var left = str.substr (0, (length)); var right = hyphenateWord(str.substr (length), length, hyphen); return left + hyphen + right;} |
if (str.length <= length) return str; | function hyphenateWord (str, length, hyphen){ if (typeof hyphen == "undefined") hyphen = " "; if (str.length <= length) return str; var left = str.substr (0, (length)); var right = hyphenateWord(str.substr (length), length, hyphen); return left + hyphen + right;} |
|
var left = str.substr (0, (length)); var right = hyphenateWord(str.substr (length), length, hyphen); | var splitPos = str.substring(pos - 5, pos + 5).search(/[^A-Za-z0-9]/); splitPos = (splitPos != -1) ? pos - 4 + splitPos : pos; var left = str.substr (0, splitPos); var right = hyphenateWord(str.substr (splitPos), pos, hyphen); | function hyphenateWord (str, length, hyphen){ if (typeof hyphen == "undefined") hyphen = " "; if (str.length <= length) return str; var left = str.substr (0, (length)); var right = hyphenateWord(str.substr (length), length, hyphen); return left + hyphen + right;} |
var calComp = icssrv.parseICS(str); var subComp = calComp.getFirstSubcomponent("ANY"); while (subComp) { switch (subComp.componentType) { case "VEVENT": var event = Components.classes["@mozilla.org/calendar/event;1"] .createInstance(Components.interfaces.calIEvent); event.icalComponent = subComp; items.push(event); break; case "VTODO": var todo = Components.classes["@mozilla.org/calendar/todo;1"] .createInstance(Components.interfaces.calITodo); todo.icalComponent = subComp; items.push(todo); break; default: | var rootComp = icssrv.parseICS(str); var calComp; if (rootComp.componentType == 'VCALENDAR') { calComp = rootComp; } else { calComp = rootComp.getFirstSubcomponent('VCALENDAR'); } while (calComp) { var subComp = calComp.getFirstSubcomponent("ANY"); while (subComp) { switch (subComp.componentType) { case "VEVENT": var event = Components.classes["@mozilla.org/calendar/event;1"] .createInstance(Components.interfaces.calIEvent); event.icalComponent = subComp; items.push(event); break; case "VTODO": var todo = Components.classes["@mozilla.org/calendar/todo;1"] .createInstance(Components.interfaces.calITodo); todo.icalComponent = subComp; items.push(todo); break; default: } subComp = calComp.getNextSubcomponent("ANY"); | function ics_importFromStream(aStream, aCount) { var items = new Array(); // Interpret the byte-array as an utf8 string, and convert into a // javascript string. var convStream = Components.classes["@mozilla.org/intl/converter-input-stream;1"] .getService(Components.interfaces.nsIConverterInputStream); convStream.init(aStream, 'UTF-8', 0, 0x0000); var tmpStr = {}; var str = ""; while (convStream.readString(-1, tmpStr)) { str += tmpStr.value; } icssrv = Components.classes["@mozilla.org/calendar/ics-service;1"] .getService(Components.interfaces.calIICSService); var calComp = icssrv.parseICS(str); var subComp = calComp.getFirstSubcomponent("ANY"); while (subComp) { switch (subComp.componentType) { case "VEVENT": var event = Components.classes["@mozilla.org/calendar/event;1"] .createInstance(Components.interfaces.calIEvent); event.icalComponent = subComp; items.push(event); break; case "VTODO": var todo = Components.classes["@mozilla.org/calendar/todo;1"] .createInstance(Components.interfaces.calITodo); todo.icalComponent = subComp; items.push(todo); break; default: // Nothing } subComp = calComp.getNextSubcomponent("ANY"); } aCount.value = items.length; return items;}; |
subComp = calComp.getNextSubcomponent("ANY"); | calComp = rootComp.getNextSubcomponent('VCALENDAR'); | function ics_importFromStream(aStream, aCount) { var items = new Array(); // Interpret the byte-array as an utf8 string, and convert into a // javascript string. var convStream = Components.classes["@mozilla.org/intl/converter-input-stream;1"] .getService(Components.interfaces.nsIConverterInputStream); convStream.init(aStream, 'UTF-8', 0, 0x0000); var tmpStr = {}; var str = ""; while (convStream.readString(-1, tmpStr)) { str += tmpStr.value; } icssrv = Components.classes["@mozilla.org/calendar/ics-service;1"] .getService(Components.interfaces.calIICSService); var calComp = icssrv.parseICS(str); var subComp = calComp.getFirstSubcomponent("ANY"); while (subComp) { switch (subComp.componentType) { case "VEVENT": var event = Components.classes["@mozilla.org/calendar/event;1"] .createInstance(Components.interfaces.calIEvent); event.icalComponent = subComp; items.push(event); break; case "VTODO": var todo = Components.classes["@mozilla.org/calendar/todo;1"] .createInstance(Components.interfaces.calITodo); todo.icalComponent = subComp; items.push(todo); break; default: // Nothing } subComp = calComp.getNextSubcomponent("ANY"); } aCount.value = items.length; return items;}; |
if (MisspelledWord) { spellChecker.IgnoreWordAllOccurrences(MisspelledWord); | if (gMisspelledWord) { spellChecker.IgnoreWordAllOccurrences(gMisspelledWord); | function IgnoreAll(){ if (MisspelledWord) { spellChecker.IgnoreWordAllOccurrences(MisspelledWord); } NextWord();} |
"chrome,modal", | "chrome,modal,titlebar", | function ImportAddress( module, success, error) { if (top.progressInfo.importInterface || top.progressInfo.intervalState) { error.data = GetBundleString( 'ImportAlreadyInProgress'); return( false); } top.progressInfo.importSuccess = false; var addInterface = module.GetImportInterface( "addressbook"); if (addInterface != null) addInterface = addInterface.QueryInterface( Components.interfaces.nsIImportGeneric); if (addInterface == null) { error.data = GetBundleString( 'ImportAddressBadModule'); return( false); } var loc = addInterface.GetStatus( "autoFind"); if (loc == false) { loc = addInterface.GetData( "addressLocation"); if (loc != null) { loc = loc.QueryInterface( Components.interfaces.nsIFileSpec); if (loc != null) { if (!loc.exists) loc = null; } } } if (loc == null) { // Couldn't find the address book, see if we can // as the user for the location or not? if (addInterface.GetStatus( "canUserSetLocation") == 0) { // an autofind address book that could not be found! error.data = GetBundleString( 'ImportAddressNotFound'); return( false); } var filePicker = Components.classes["component://netscape/filespecwithui"].createInstance(); if (filePicker != null) { filePicker = filePicker.QueryInterface( Components.interfaces.nsIFileSpecWithUI); if (filePicker == null) { error.data = GetBundleString( 'ImportAddressNotFound'); return( false); } } else { error.data = GetBundleString( 'ImportAddressNotFound'); return( false); } // The address book location was not found. // Determine if we need to ask for a directory // or a single file. var file = null; if (addInterface.GetStatus( "supportsMultiple") != 0) { // ask for dir try { filePicker.chooseDirectory( GetBundleString( 'ImportSelectAddrDir')); file = filePicker.QueryInterface( Components.interfaces.nsIFileSpec); } catch( ex) { file = null; } } else { // ask for file try { filePicker.chooseInputFile( GetBundleString( 'ImportSelectAddrFile'), filePicker.eAllFiles, null, null); file = filePicker.QueryInterface( Components.interfaces.nsIFileSpec); } catch( ex) { file = null; } } if (file == null) { return( false); } file = CreateNewFileSpec( file); addInterface.SetData( "addressLocation", file); } var map = addInterface.GetData( "fieldMap"); if (map != null) { map = map.QueryInterface( Components.interfaces.nsIImportFieldMap); if (map != null) { var result = new Object(); result.ok = false; top.window.openDialog( "chrome://messenger/content/fieldMapImport.xul", "", "chrome,modal", {fieldMap: map, addInterface: addInterface, result: result}); } if (result.ok == false) return( false); } if (addInterface.WantsProgress()) { if (addInterface.BeginImport( success, error)) { top.progressInfo.importInterface = addInterface; // top.intervalState = setInterval( "ContinueImport()", 100); return( true); } else { return( false); } } else { if (addInterface.BeginImport( success, error)) { return( true); } else { return( false); } }} |
var filePicker = Components.classes["component: | var filePicker = Components.classes["@mozilla.org/filepicker;1"].createInstance(); | function ImportAddress( module, success, error) { if (top.progressInfo.importInterface || top.progressInfo.intervalState) { error.data = GetBundleString( 'ImportAlreadyInProgress'); return( false); } top.progressInfo.importSuccess = false; var addInterface = module.GetImportInterface( "addressbook"); if (addInterface != null) addInterface = addInterface.QueryInterface( Components.interfaces.nsIImportGeneric); if (addInterface == null) { error.data = GetBundleString( 'ImportAddressBadModule'); return( false); } var loc = addInterface.GetStatus( "autoFind"); if (loc == false) { loc = addInterface.GetData( "addressLocation"); if (loc != null) { loc = loc.QueryInterface( Components.interfaces.nsIFileSpec); if (loc != null) { if (!loc.exists) loc = null; } } } if (loc == null) { // Couldn't find the address book, see if we can // as the user for the location or not? if (addInterface.GetStatus( "canUserSetLocation") == 0) { // an autofind address book that could not be found! error.data = GetBundleString( 'ImportAddressNotFound'); return( false); } var filePicker = Components.classes["component://mozilla/filepicker"].createInstance(); if (filePicker != null) { filePicker = filePicker.QueryInterface( Components.interfaces.nsIFilePicker); if (filePicker == null) { error.data = GetBundleString( 'ImportAddressNotFound'); return( false); } } else { error.data = GetBundleString( 'ImportAddressNotFound'); return( false); } // The address book location was not found. // Determine if we need to ask for a directory // or a single file. var file = null; if (addInterface.GetStatus( "supportsMultiple") != 0) { // ask for dir try { filePicker.init( top.window, GetBundleString( 'ImportSelectAddrDir'), Components.interfaces.nsIFilePicker.modeGetFolder); filePicker.appendFilters( Components.interfaces.nsIFilePicker.filterAll); filePicker.show(); if (filePicker.file && (filePicker.file.path.length > 0)) file = filePicker.file.path; else file = null; } catch( ex) { file = null; } } else { // ask for file try { filePicker.init( top.window, GetBundleString( 'ImportSelectAddrFile'), Components.interfaces.nsIFilePicker.modeOpen); filePicker.appendFilters( Components.interfaces.nsIFilePicker.filterAll); filePicker.show(); if (filePicker.file && (filePicker.file.path.length > 0)) file = filePicker.file.path; else file = null; } catch( ex) { file = null; } } if (file == null) { return( false); } file = CreateNewFileSpecFromPath( file); addInterface.SetData( "addressLocation", file); } var map = addInterface.GetData( "fieldMap"); if (map != null) { map = map.QueryInterface( Components.interfaces.nsIImportFieldMap); if (map != null) { var result = new Object(); result.ok = false; top.window.openDialog( "chrome://messenger/content/fieldMapImport.xul", "", "chrome,modal,titlebar", {fieldMap: map, addInterface: addInterface, result: result}); } if (result.ok == false) return( false); } if (addInterface.WantsProgress()) { if (addInterface.BeginImport( success, error)) { top.progressInfo.importInterface = addInterface; // top.intervalState = setInterval( "ContinueImport()", 100); return( true); } else { return( false); } } else { if (addInterface.BeginImport( success, error)) { return( true); } else { return( false); } }} |
var transaction = new Bookmarktransaction("insert"); | var transaction = new BookmarkImportTransaction("import"); | importBookmarks: function () { ///transaction... try { const kFilePickerContractID = "@mozilla.org/filepicker;1"; const kFilePickerIID = Components.interfaces.nsIFilePicker; const kFilePicker = Components.classes[kFilePickerContractID].createInstance(kFilePickerIID); const kTitle = BookmarksUtils.getLocaleString("SelectImport"); kFilePicker.init(window, kTitle, kFilePickerIID["modeOpen"]); kFilePicker.appendFilters(kFilePickerIID.filterHTML | kFilePickerIID.filterAll); var fileName; if (kFilePicker.show() != kFilePickerIID.returnCancel) { fileName = kFilePicker.fileURL.spec; if (!fileName) return; } else return; } catch (e) { return; } rTarget = RDF.GetResource("NC:BookmarksRoot"); RDFC.Init(BMDS, rTarget); var countBefore = parseInt(BookmarksUtils.getProperty(rTarget, RDF_NS+"nextVal")); var args = [{ property: NC_NS+"URL", literal: fileName}]; this.doBookmarksCommand(rTarget, NC_NS_CMD+"import", args); var countAfter = parseInt(BookmarksUtils.getProperty(rTarget, RDF_NS+"nextVal")); var transaction = new Bookmarktransaction("insert"); for (var index = countBefore; index < countAfter; index++) { var nChildArc = RDF.GetResource(RDF_NS+"_"+String(index)); var rChild = BMDS.GetTarget(rTarget, nChildArc, true); transaction.item .push(rChild); transaction.parent.push(rTarget); transaction.index .push(index); transaction.isPerformed.push(true); } transaction.length = transaction.item.length; transaction.update(); aTransactionSet.push(transaction); aTransaction.type = "import"; }, |
var nChildArc = RDF.GetResource(RDF_NS+"_"+String(index)); var rChild = BMDS.GetTarget(rTarget, nChildArc, true); transaction.item .push(rChild); transaction.parent.push(rTarget); transaction.index .push(index); transaction.isPerformed.push(true); | var nChildArc = RDF.GetResource(RDF_NS+"_"+String(index)); var rChild = BMDS.GetTarget(rTarget, nChildArc, true); transaction.item .push(rChild); transaction.parent .push(rTarget); transaction.index .push(index); transaction.isValid.push(true); | importBookmarks: function () { ///transaction... try { const kFilePickerContractID = "@mozilla.org/filepicker;1"; const kFilePickerIID = Components.interfaces.nsIFilePicker; const kFilePicker = Components.classes[kFilePickerContractID].createInstance(kFilePickerIID); const kTitle = BookmarksUtils.getLocaleString("SelectImport"); kFilePicker.init(window, kTitle, kFilePickerIID["modeOpen"]); kFilePicker.appendFilters(kFilePickerIID.filterHTML | kFilePickerIID.filterAll); var fileName; if (kFilePicker.show() != kFilePickerIID.returnCancel) { fileName = kFilePicker.fileURL.spec; if (!fileName) return; } else return; } catch (e) { return; } rTarget = RDF.GetResource("NC:BookmarksRoot"); RDFC.Init(BMDS, rTarget); var countBefore = parseInt(BookmarksUtils.getProperty(rTarget, RDF_NS+"nextVal")); var args = [{ property: NC_NS+"URL", literal: fileName}]; this.doBookmarksCommand(rTarget, NC_NS_CMD+"import", args); var countAfter = parseInt(BookmarksUtils.getProperty(rTarget, RDF_NS+"nextVal")); var transaction = new Bookmarktransaction("insert"); for (var index = countBefore; index < countAfter; index++) { var nChildArc = RDF.GetResource(RDF_NS+"_"+String(index)); var rChild = BMDS.GetTarget(rTarget, nChildArc, true); transaction.item .push(rChild); transaction.parent.push(rTarget); transaction.index .push(index); transaction.isPerformed.push(true); } transaction.length = transaction.item.length; transaction.update(); aTransactionSet.push(transaction); aTransaction.type = "import"; }, |
transaction.length = transaction.item.length; transaction.update(); aTransactionSet.push(transaction); aTransaction.type = "import"; | var isCancelled = !BookmarksUtils.any(transaction.isValid) if (!isCancelled) { gBMtxmgr.doTransaction(transaction); BookmarksUtils.flushDataSource(); } | importBookmarks: function () { ///transaction... try { const kFilePickerContractID = "@mozilla.org/filepicker;1"; const kFilePickerIID = Components.interfaces.nsIFilePicker; const kFilePicker = Components.classes[kFilePickerContractID].createInstance(kFilePickerIID); const kTitle = BookmarksUtils.getLocaleString("SelectImport"); kFilePicker.init(window, kTitle, kFilePickerIID["modeOpen"]); kFilePicker.appendFilters(kFilePickerIID.filterHTML | kFilePickerIID.filterAll); var fileName; if (kFilePicker.show() != kFilePickerIID.returnCancel) { fileName = kFilePicker.fileURL.spec; if (!fileName) return; } else return; } catch (e) { return; } rTarget = RDF.GetResource("NC:BookmarksRoot"); RDFC.Init(BMDS, rTarget); var countBefore = parseInt(BookmarksUtils.getProperty(rTarget, RDF_NS+"nextVal")); var args = [{ property: NC_NS+"URL", literal: fileName}]; this.doBookmarksCommand(rTarget, NC_NS_CMD+"import", args); var countAfter = parseInt(BookmarksUtils.getProperty(rTarget, RDF_NS+"nextVal")); var transaction = new Bookmarktransaction("insert"); for (var index = countBefore; index < countAfter; index++) { var nChildArc = RDF.GetResource(RDF_NS+"_"+String(index)); var rChild = BMDS.GetTarget(rTarget, nChildArc, true); transaction.item .push(rChild); transaction.parent.push(rTarget); transaction.index .push(index); transaction.isPerformed.push(true); } transaction.length = transaction.item.length; transaction.update(); aTransactionSet.push(transaction); aTransaction.type = "import"; }, |
fileName = kFilePicker.fileURL.spec; | fileName = kFilePicker.file.path; | importBookmarks: function () { ///transaction... try { const kFilePickerContractID = "@mozilla.org/filepicker;1"; const kFilePickerIID = Components.interfaces.nsIFilePicker; const kFilePicker = Components.classes[kFilePickerContractID].createInstance(kFilePickerIID); const kTitle = BookmarksUtils.getLocaleString("SelectImport"); kFilePicker.init(window, kTitle, kFilePickerIID["modeOpen"]); kFilePicker.appendFilters(kFilePickerIID.filterHTML | kFilePickerIID.filterAll); var fileName; if (kFilePicker.show() != kFilePickerIID.returnCancel) { fileName = kFilePicker.fileURL.spec; if (!fileName) return; } else return; } catch (e) { return; } rTarget = RDF.GetResource("NC:BookmarksRoot"); RDFC.Init(BMDS, rTarget); var countBefore = parseInt(BookmarksUtils.getProperty(rTarget, RDF_NS+"nextVal")); var args = [{ property: NC_NS+"URL", literal: fileName}]; this.doBookmarksCommand(rTarget, NC_NS_CMD+"import", args); var countAfter = parseInt(BookmarksUtils.getProperty(rTarget, RDF_NS+"nextVal")); var transaction = new BookmarkImportTransaction("import"); for (var index = countBefore; index < countAfter; index++) { var nChildArc = RDFCU.IndexToOrdinalResource(index); var rChild = BMDS.GetTarget(rTarget, nChildArc, true); transaction.item .push(rChild); transaction.parent .push(rTarget); transaction.index .push(index); transaction.isValid.push(true); } var isCancelled = !BookmarksUtils.any(transaction.isValid); if (!isCancelled) { BMSVC.transactionManager.doTransaction(transaction); BookmarksUtils.flushDataSource(); } }, |
var nChildArc = RDF.GetResource(RDF_NS+"_"+String(index)); | var nChildArc = RDFCU.IndexToOrdinalResource(index); | importBookmarks: function () { ///transaction... try { const kFilePickerContractID = "@mozilla.org/filepicker;1"; const kFilePickerIID = Components.interfaces.nsIFilePicker; const kFilePicker = Components.classes[kFilePickerContractID].createInstance(kFilePickerIID); const kTitle = BookmarksUtils.getLocaleString("SelectImport"); kFilePicker.init(window, kTitle, kFilePickerIID["modeOpen"]); kFilePicker.appendFilters(kFilePickerIID.filterHTML | kFilePickerIID.filterAll); var fileName; if (kFilePicker.show() != kFilePickerIID.returnCancel) { fileName = kFilePicker.fileURL.spec; if (!fileName) return; } else return; } catch (e) { return; } rTarget = RDF.GetResource("NC:BookmarksRoot"); RDFC.Init(BMDS, rTarget); var countBefore = parseInt(BookmarksUtils.getProperty(rTarget, RDF_NS+"nextVal")); var args = [{ property: NC_NS+"URL", literal: fileName}]; this.doBookmarksCommand(rTarget, NC_NS_CMD+"import", args); var countAfter = parseInt(BookmarksUtils.getProperty(rTarget, RDF_NS+"nextVal")); var transaction = new BookmarkImportTransaction("import"); for (var index = countBefore; index < countAfter; index++) { var nChildArc = RDF.GetResource(RDF_NS+"_"+String(index)); var rChild = BMDS.GetTarget(rTarget, nChildArc, true); transaction.item .push(rChild); transaction.parent .push(rTarget); transaction.index .push(index); transaction.isValid.push(true); } var isCancelled = !BookmarksUtils.any(transaction.isValid) if (!isCancelled) { gBMtxmgr.doTransaction(transaction); BookmarksUtils.flushDataSource(); } }, |
transaction.isValid.push(true); | importBookmarks: function () { ///transaction... try { const kFilePickerContractID = "@mozilla.org/filepicker;1"; const kFilePickerIID = Components.interfaces.nsIFilePicker; const kFilePicker = Components.classes[kFilePickerContractID].createInstance(kFilePickerIID); const kTitle = BookmarksUtils.getLocaleString("SelectImport"); kFilePicker.init(window, kTitle, kFilePickerIID["modeOpen"]); kFilePicker.appendFilters(kFilePickerIID.filterHTML | kFilePickerIID.filterAll); var fileName; if (kFilePicker.show() != kFilePickerIID.returnCancel) { fileName = kFilePicker.file.path; if (!fileName) return; } else return; } catch (e) { return; } rTarget = RDF.GetResource("NC:BookmarksRoot"); RDFC.Init(BMDS, rTarget); var countBefore = parseInt(BookmarksUtils.getProperty(rTarget, RDF_NS+"nextVal")); var args = [{ property: NC_NS+"URL", literal: fileName}]; this.doBookmarksCommand(rTarget, NC_NS_CMD+"import", args); var countAfter = parseInt(BookmarksUtils.getProperty(rTarget, RDF_NS+"nextVal")); var transaction = new BookmarkImportTransaction("import"); for (var index = countBefore; index < countAfter; index++) { var nChildArc = RDFCU.IndexToOrdinalResource(index); var rChild = BMDS.GetTarget(rTarget, nChildArc, true); transaction.item .push(rChild); transaction.parent .push(rTarget); transaction.index .push(index); transaction.isValid.push(true); } var isCancelled = !BookmarksUtils.any(transaction.isValid); if (!isCancelled) { BMSVC.transactionManager.doTransaction(transaction); BookmarksUtils.flushDataSource(); } }, |
|
var isCancelled = !BookmarksUtils.any(transaction.isValid); if (!isCancelled) { BMSVC.transactionManager.doTransaction(transaction); BookmarksUtils.flushDataSource(); } | BMSVC.transactionManager.doTransaction(transaction); BookmarksUtils.flushDataSource(); | importBookmarks: function () { ///transaction... try { const kFilePickerContractID = "@mozilla.org/filepicker;1"; const kFilePickerIID = Components.interfaces.nsIFilePicker; const kFilePicker = Components.classes[kFilePickerContractID].createInstance(kFilePickerIID); const kTitle = BookmarksUtils.getLocaleString("SelectImport"); kFilePicker.init(window, kTitle, kFilePickerIID["modeOpen"]); kFilePicker.appendFilters(kFilePickerIID.filterHTML | kFilePickerIID.filterAll); var fileName; if (kFilePicker.show() != kFilePickerIID.returnCancel) { fileName = kFilePicker.file.path; if (!fileName) return; } else return; } catch (e) { return; } rTarget = RDF.GetResource("NC:BookmarksRoot"); RDFC.Init(BMDS, rTarget); var countBefore = parseInt(BookmarksUtils.getProperty(rTarget, RDF_NS+"nextVal")); var args = [{ property: NC_NS+"URL", literal: fileName}]; this.doBookmarksCommand(rTarget, NC_NS_CMD+"import", args); var countAfter = parseInt(BookmarksUtils.getProperty(rTarget, RDF_NS+"nextVal")); var transaction = new BookmarkImportTransaction("import"); for (var index = countBefore; index < countAfter; index++) { var nChildArc = RDFCU.IndexToOrdinalResource(index); var rChild = BMDS.GetTarget(rTarget, nChildArc, true); transaction.item .push(rChild); transaction.parent .push(rTarget); transaction.index .push(index); transaction.isValid.push(true); } var isCancelled = !BookmarksUtils.any(transaction.isValid); if (!isCancelled) { BMSVC.transactionManager.doTransaction(transaction); BookmarksUtils.flushDataSource(); } }, |
"chrome,modal", | "chrome,modal,titlebar", | function ImportDialogOKButton(){ var tree = document.getElementById('moduleList'); if ( tree && tree.selectedItems && (tree.selectedItems.length == 1) ) { var index = tree.selectedItems[0].getAttribute('list-index'); var module = top.importService.GetModule( top.importType, index); var name = top.importService.GetModuleName( top.importType, index); top.selectedModuleName = name; if (module != null) { switch( top.importType ) { case "mail": top.successStr = Components.classes["component://netscape/supports-wstring"].createInstance(); if (top.successStr != null) { top.successStr = top.successStr.QueryInterface( Components.interfaces.nsISupportsWString); } top.errorStr = Components.classes["component://netscape/supports-wstring"].createInstance(); if (top.errorStr != null) top.errorStr = top.errorStr.QueryInterface( Components.interfaces.nsISupportsWString); if (ImportMail( module, top.successStr, top.errorStr) == true) { // We think it was a success, either, we need to // wait for the import to finish // or we are done! if (top.progressInfo.importInterface == null) { ShowMailComplete( true); return( true); } else { var meterText = GetFormattedBundleString( 'MailProgressMeterText', name); // show the progress window... top.window.openDialog( "chrome://messenger/content/importProgress.xul", "", "chrome,modal", {windowTitle: GetBundleString( 'MailProgressTitle'), progressTitle: meterText, progressStatus: "", progressInfo: top.progressInfo}); dump( "*** Returned from progress window\n"); return( true); } } else { ShowMailComplete( false); return( false); } break; case "addressbook": top.successStr = Components.classes["component://netscape/supports-wstring"].createInstance(); if (top.successStr != null) { top.successStr = top.successStr.QueryInterface( Components.interfaces.nsISupportsWString); } top.errorStr = Components.classes["component://netscape/supports-wstring"].createInstance(); if (top.errorStr != null) top.errorStr = top.errorStr.QueryInterface( Components.interfaces.nsISupportsWString); if (ImportAddress( module, top.successStr, top.errorStr) == true) { // We think it was a success, either, we need to // wait for the import to finish // or we are done! if (top.progressInfo.importInterface == null) { ShowAddressComplete( true); return( true); } else { var meterText = GetFormattedBundleString( 'AddrProgressMeterText', name); var titleText = GetBundleString( 'AddrProgressTitle'); // show the progress window... top.window.openDialog( "chrome://messenger/content/importProgress.xul", "", "chrome,modal", {windowTitle: titleText, progressTitle: meterText, progressStatus: "", progressInfo: top.progressInfo}); return( true); } } else { ShowAddressComplete( false); return( false); } break; case "settings": var error = new Object(); error.value = null; var newAccount = new Object(); if (!ImportSettings( module, newAccount, error)) { if (error.value != null) { // Show error alert with error // information alert( GetBundleString( 'ImportSettingsFailed')); } // the user canceled the operation, shoud we dismiss // this dialog or not? return false; } else { // Alert to show success alert( GetFormattedBundleString( 'ImportSettingsSuccess', name)); } break; } } } return true;} |
top.successStr = Components.classes["component: | top.successStr = Components.classes["@mozilla.org/supports-wstring;1"].createInstance(); | function ImportDialogOKButton(){ var tree = document.getElementById('moduleList'); var deck = document.getElementById("stateDeck"); var header = document.getElementById("header"); var progressMeterEl = document.getElementById("progressMeter"); var progressStatusEl = document.getElementById("progressStatus"); var progressTitleEl = document.getElementById("progressTitle"); // better not mess around with navigation at this point var nextButton = document.getElementById("forward"); nextButton.setAttribute("disabled", "true"); var backButton = document.getElementById("back"); backButton.setAttribute("disabled", "true"); if ( tree && tree.selectedItems && (tree.selectedItems.length == 1) ) { var index = tree.selectedItems[0].getAttribute('list-index'); var module = top.importService.GetModule( top.importType, index); var name = top.importService.GetModuleName( top.importType, index); top.selectedModuleName = name; if (module) { switch( top.importType ) { case "mail": top.successStr = Components.classes["component://netscape/supports-wstring"].createInstance(); if (top.successStr) { top.successStr = top.successStr.QueryInterface( Components.interfaces.nsISupportsWString); } top.errorStr = Components.classes["component://netscape/supports-wstring"].createInstance(); if (top.errorStr) top.errorStr = top.errorStr.QueryInterface( Components.interfaces.nsISupportsWString); if (ImportMail( module, top.successStr, top.errorStr) == true) { // We think it was a success, either, we need to // wait for the import to finish // or we are done! if (top.progressInfo.importInterface == null) { ShowImportResults(true, 'Mail'); return( true); } else { var meterText = GetFormattedBundleString('MailProgressMeterText', name); header.setAttribute("description", meterText); progressStatusEl.setAttribute("value", ""); progressTitleEl.setAttribute("value", meterText); deck.setAttribute("index", "2"); progressInfo.progressWindow = top.window; progressInfo.intervalState = setInterval("ContinueImportCallback()", 100); return( true); } } else { ShowImportResults(false, 'Mail'); return( false); } break; case "addressbook": top.successStr = Components.classes["component://netscape/supports-wstring"].createInstance(); if (top.successStr) top.successStr = top.successStr.QueryInterface( Components.interfaces.nsISupportsWString); top.errorStr = Components.classes["component://netscape/supports-wstring"].createInstance(); if (top.errorStr) top.errorStr = top.errorStr.QueryInterface( Components.interfaces.nsISupportsWString); if (ImportAddress( module, top.successStr, top.errorStr) == true) { // We think it was a success, either, we need to // wait for the import to finish // or we are done! if (top.progressInfo.importInterface == null) { ShowImportResults(true, 'Address'); return( true); } else { var meterText = GetFormattedBundleString('MailProgressMeterText', name); header.setAttribute("description", meterText); progressStatusEl.setAttribute("value", ""); progressTitleEl.setAttribute("value", meterText); deck.setAttribute("index", "2"); progressInfo.progressWindow = top.window; progressInfo.intervalState = setInterval("ContinueImportCallback()", 100); return( true); } } else { ShowImportResults(false, 'Address'); return( false); } break; case "settings": var error = new Object(); error.value = null; var newAccount = new Object(); if (!ImportSettings( module, newAccount, error)) { if (error.value) ShowImportResultsRaw(GetBundleString( 'ImportSettingsFailed'), null); // the user canceled the operation, shoud we dismiss // this dialog or not? return false; } else ShowImportResultsRaw(GetFormattedBundleString( 'ImportSettingsSuccess', name), null); break; } } } return true;} |
top.errorStr = Components.classes["component: | top.errorStr = Components.classes["@mozilla.org/supports-wstring;1"].createInstance(); | function ImportDialogOKButton(){ var tree = document.getElementById('moduleList'); var deck = document.getElementById("stateDeck"); var header = document.getElementById("header"); var progressMeterEl = document.getElementById("progressMeter"); var progressStatusEl = document.getElementById("progressStatus"); var progressTitleEl = document.getElementById("progressTitle"); // better not mess around with navigation at this point var nextButton = document.getElementById("forward"); nextButton.setAttribute("disabled", "true"); var backButton = document.getElementById("back"); backButton.setAttribute("disabled", "true"); if ( tree && tree.selectedItems && (tree.selectedItems.length == 1) ) { var index = tree.selectedItems[0].getAttribute('list-index'); var module = top.importService.GetModule( top.importType, index); var name = top.importService.GetModuleName( top.importType, index); top.selectedModuleName = name; if (module) { switch( top.importType ) { case "mail": top.successStr = Components.classes["component://netscape/supports-wstring"].createInstance(); if (top.successStr) { top.successStr = top.successStr.QueryInterface( Components.interfaces.nsISupportsWString); } top.errorStr = Components.classes["component://netscape/supports-wstring"].createInstance(); if (top.errorStr) top.errorStr = top.errorStr.QueryInterface( Components.interfaces.nsISupportsWString); if (ImportMail( module, top.successStr, top.errorStr) == true) { // We think it was a success, either, we need to // wait for the import to finish // or we are done! if (top.progressInfo.importInterface == null) { ShowImportResults(true, 'Mail'); return( true); } else { var meterText = GetFormattedBundleString('MailProgressMeterText', name); header.setAttribute("description", meterText); progressStatusEl.setAttribute("value", ""); progressTitleEl.setAttribute("value", meterText); deck.setAttribute("index", "2"); progressInfo.progressWindow = top.window; progressInfo.intervalState = setInterval("ContinueImportCallback()", 100); return( true); } } else { ShowImportResults(false, 'Mail'); return( false); } break; case "addressbook": top.successStr = Components.classes["component://netscape/supports-wstring"].createInstance(); if (top.successStr) top.successStr = top.successStr.QueryInterface( Components.interfaces.nsISupportsWString); top.errorStr = Components.classes["component://netscape/supports-wstring"].createInstance(); if (top.errorStr) top.errorStr = top.errorStr.QueryInterface( Components.interfaces.nsISupportsWString); if (ImportAddress( module, top.successStr, top.errorStr) == true) { // We think it was a success, either, we need to // wait for the import to finish // or we are done! if (top.progressInfo.importInterface == null) { ShowImportResults(true, 'Address'); return( true); } else { var meterText = GetFormattedBundleString('MailProgressMeterText', name); header.setAttribute("description", meterText); progressStatusEl.setAttribute("value", ""); progressTitleEl.setAttribute("value", meterText); deck.setAttribute("index", "2"); progressInfo.progressWindow = top.window; progressInfo.intervalState = setInterval("ContinueImportCallback()", 100); return( true); } } else { ShowImportResults(false, 'Address'); return( false); } break; case "settings": var error = new Object(); error.value = null; var newAccount = new Object(); if (!ImportSettings( module, newAccount, error)) { if (error.value) ShowImportResultsRaw(GetBundleString( 'ImportSettingsFailed'), null); // the user canceled the operation, shoud we dismiss // this dialog or not? return false; } else ShowImportResultsRaw(GetFormattedBundleString( 'ImportSettingsSuccess', name), null); break; } } } return true;} |
if (module != null) | if (module) | function ImportDialogOKButton(){ var tree = document.getElementById('moduleList'); if ( tree && tree.selectedItems && (tree.selectedItems.length == 1) ) { var index = tree.selectedItems[0].getAttribute('list-index'); var module = top.importService.GetModule( top.importType, index); var name = top.importService.GetModuleName( top.importType, index); top.selectedModuleName = name; if (module != null) { switch( top.importType ) { case "mail": top.successStr = Components.classes["component://netscape/supports-wstring"].createInstance(); if (top.successStr != null) { top.successStr = top.successStr.QueryInterface( Components.interfaces.nsISupportsWString); } top.errorStr = Components.classes["component://netscape/supports-wstring"].createInstance(); if (top.errorStr != null) top.errorStr = top.errorStr.QueryInterface( Components.interfaces.nsISupportsWString); if (ImportMail( module, top.successStr, top.errorStr) == true) { // We think it was a success, either, we need to // wait for the import to finish // or we are done! if (top.progressInfo.importInterface == null) { ShowMailComplete( true); return( true); } else { var meterText = GetFormattedBundleString( 'MailProgressMeterText', name); // show the progress window... top.window.openDialog( "chrome://messenger/content/importProgress.xul", "", "chrome,modal,titlebar", {windowTitle: GetBundleString( 'MailProgressTitle'), progressTitle: meterText, progressStatus: "", progressInfo: top.progressInfo}); dump( "*** Returned from progress window\n"); return( true); } } else { ShowMailComplete( false); return( false); } break; case "addressbook": top.successStr = Components.classes["component://netscape/supports-wstring"].createInstance(); if (top.successStr != null) { top.successStr = top.successStr.QueryInterface( Components.interfaces.nsISupportsWString); } top.errorStr = Components.classes["component://netscape/supports-wstring"].createInstance(); if (top.errorStr != null) top.errorStr = top.errorStr.QueryInterface( Components.interfaces.nsISupportsWString); if (ImportAddress( module, top.successStr, top.errorStr) == true) { // We think it was a success, either, we need to // wait for the import to finish // or we are done! if (top.progressInfo.importInterface == null) { ShowAddressComplete( true); return( true); } else { var meterText = GetFormattedBundleString( 'AddrProgressMeterText', name); var titleText = GetBundleString( 'AddrProgressTitle'); // show the progress window... top.window.openDialog( "chrome://messenger/content/importProgress.xul", "", "chrome,modal,titlebar", {windowTitle: titleText, progressTitle: meterText, progressStatus: "", progressInfo: top.progressInfo}); return( true); } } else { ShowAddressComplete( false); return( false); } break; case "settings": var error = new Object(); error.value = null; var newAccount = new Object(); if (!ImportSettings( module, newAccount, error)) { if (error.value != null) { // Show error alert with error // information alert( GetBundleString( 'ImportSettingsFailed')); } // the user canceled the operation, shoud we dismiss // this dialog or not? return false; } else { // Alert to show success alert( GetFormattedBundleString( 'ImportSettingsSuccess', name)); } break; } } } return true;} |
if (top.successStr != null) { | if (top.successStr) { | function ImportDialogOKButton(){ var tree = document.getElementById('moduleList'); if ( tree && tree.selectedItems && (tree.selectedItems.length == 1) ) { var index = tree.selectedItems[0].getAttribute('list-index'); var module = top.importService.GetModule( top.importType, index); var name = top.importService.GetModuleName( top.importType, index); top.selectedModuleName = name; if (module != null) { switch( top.importType ) { case "mail": top.successStr = Components.classes["component://netscape/supports-wstring"].createInstance(); if (top.successStr != null) { top.successStr = top.successStr.QueryInterface( Components.interfaces.nsISupportsWString); } top.errorStr = Components.classes["component://netscape/supports-wstring"].createInstance(); if (top.errorStr != null) top.errorStr = top.errorStr.QueryInterface( Components.interfaces.nsISupportsWString); if (ImportMail( module, top.successStr, top.errorStr) == true) { // We think it was a success, either, we need to // wait for the import to finish // or we are done! if (top.progressInfo.importInterface == null) { ShowMailComplete( true); return( true); } else { var meterText = GetFormattedBundleString( 'MailProgressMeterText', name); // show the progress window... top.window.openDialog( "chrome://messenger/content/importProgress.xul", "", "chrome,modal,titlebar", {windowTitle: GetBundleString( 'MailProgressTitle'), progressTitle: meterText, progressStatus: "", progressInfo: top.progressInfo}); dump( "*** Returned from progress window\n"); return( true); } } else { ShowMailComplete( false); return( false); } break; case "addressbook": top.successStr = Components.classes["component://netscape/supports-wstring"].createInstance(); if (top.successStr != null) { top.successStr = top.successStr.QueryInterface( Components.interfaces.nsISupportsWString); } top.errorStr = Components.classes["component://netscape/supports-wstring"].createInstance(); if (top.errorStr != null) top.errorStr = top.errorStr.QueryInterface( Components.interfaces.nsISupportsWString); if (ImportAddress( module, top.successStr, top.errorStr) == true) { // We think it was a success, either, we need to // wait for the import to finish // or we are done! if (top.progressInfo.importInterface == null) { ShowAddressComplete( true); return( true); } else { var meterText = GetFormattedBundleString( 'AddrProgressMeterText', name); var titleText = GetBundleString( 'AddrProgressTitle'); // show the progress window... top.window.openDialog( "chrome://messenger/content/importProgress.xul", "", "chrome,modal,titlebar", {windowTitle: titleText, progressTitle: meterText, progressStatus: "", progressInfo: top.progressInfo}); return( true); } } else { ShowAddressComplete( false); return( false); } break; case "settings": var error = new Object(); error.value = null; var newAccount = new Object(); if (!ImportSettings( module, newAccount, error)) { if (error.value != null) { // Show error alert with error // information alert( GetBundleString( 'ImportSettingsFailed')); } // the user canceled the operation, shoud we dismiss // this dialog or not? return false; } else { // Alert to show success alert( GetFormattedBundleString( 'ImportSettingsSuccess', name)); } break; } } } return true;} |
if (top.errorStr != null) | if (top.errorStr) | function ImportDialogOKButton(){ var tree = document.getElementById('moduleList'); if ( tree && tree.selectedItems && (tree.selectedItems.length == 1) ) { var index = tree.selectedItems[0].getAttribute('list-index'); var module = top.importService.GetModule( top.importType, index); var name = top.importService.GetModuleName( top.importType, index); top.selectedModuleName = name; if (module != null) { switch( top.importType ) { case "mail": top.successStr = Components.classes["component://netscape/supports-wstring"].createInstance(); if (top.successStr != null) { top.successStr = top.successStr.QueryInterface( Components.interfaces.nsISupportsWString); } top.errorStr = Components.classes["component://netscape/supports-wstring"].createInstance(); if (top.errorStr != null) top.errorStr = top.errorStr.QueryInterface( Components.interfaces.nsISupportsWString); if (ImportMail( module, top.successStr, top.errorStr) == true) { // We think it was a success, either, we need to // wait for the import to finish // or we are done! if (top.progressInfo.importInterface == null) { ShowMailComplete( true); return( true); } else { var meterText = GetFormattedBundleString( 'MailProgressMeterText', name); // show the progress window... top.window.openDialog( "chrome://messenger/content/importProgress.xul", "", "chrome,modal,titlebar", {windowTitle: GetBundleString( 'MailProgressTitle'), progressTitle: meterText, progressStatus: "", progressInfo: top.progressInfo}); dump( "*** Returned from progress window\n"); return( true); } } else { ShowMailComplete( false); return( false); } break; case "addressbook": top.successStr = Components.classes["component://netscape/supports-wstring"].createInstance(); if (top.successStr != null) { top.successStr = top.successStr.QueryInterface( Components.interfaces.nsISupportsWString); } top.errorStr = Components.classes["component://netscape/supports-wstring"].createInstance(); if (top.errorStr != null) top.errorStr = top.errorStr.QueryInterface( Components.interfaces.nsISupportsWString); if (ImportAddress( module, top.successStr, top.errorStr) == true) { // We think it was a success, either, we need to // wait for the import to finish // or we are done! if (top.progressInfo.importInterface == null) { ShowAddressComplete( true); return( true); } else { var meterText = GetFormattedBundleString( 'AddrProgressMeterText', name); var titleText = GetBundleString( 'AddrProgressTitle'); // show the progress window... top.window.openDialog( "chrome://messenger/content/importProgress.xul", "", "chrome,modal,titlebar", {windowTitle: titleText, progressTitle: meterText, progressStatus: "", progressInfo: top.progressInfo}); return( true); } } else { ShowAddressComplete( false); return( false); } break; case "settings": var error = new Object(); error.value = null; var newAccount = new Object(); if (!ImportSettings( module, newAccount, error)) { if (error.value != null) { // Show error alert with error // information alert( GetBundleString( 'ImportSettingsFailed')); } // the user canceled the operation, shoud we dismiss // this dialog or not? return false; } else { // Alert to show success alert( GetFormattedBundleString( 'ImportSettingsSuccess', name)); } break; } } } return true;} |
ShowMailComplete( true); | ShowImportResults(true, 'Mail'); | function ImportDialogOKButton(){ var tree = document.getElementById('moduleList'); if ( tree && tree.selectedItems && (tree.selectedItems.length == 1) ) { var index = tree.selectedItems[0].getAttribute('list-index'); var module = top.importService.GetModule( top.importType, index); var name = top.importService.GetModuleName( top.importType, index); top.selectedModuleName = name; if (module != null) { switch( top.importType ) { case "mail": top.successStr = Components.classes["component://netscape/supports-wstring"].createInstance(); if (top.successStr != null) { top.successStr = top.successStr.QueryInterface( Components.interfaces.nsISupportsWString); } top.errorStr = Components.classes["component://netscape/supports-wstring"].createInstance(); if (top.errorStr != null) top.errorStr = top.errorStr.QueryInterface( Components.interfaces.nsISupportsWString); if (ImportMail( module, top.successStr, top.errorStr) == true) { // We think it was a success, either, we need to // wait for the import to finish // or we are done! if (top.progressInfo.importInterface == null) { ShowMailComplete( true); return( true); } else { var meterText = GetFormattedBundleString( 'MailProgressMeterText', name); // show the progress window... top.window.openDialog( "chrome://messenger/content/importProgress.xul", "", "chrome,modal,titlebar", {windowTitle: GetBundleString( 'MailProgressTitle'), progressTitle: meterText, progressStatus: "", progressInfo: top.progressInfo}); dump( "*** Returned from progress window\n"); return( true); } } else { ShowMailComplete( false); return( false); } break; case "addressbook": top.successStr = Components.classes["component://netscape/supports-wstring"].createInstance(); if (top.successStr != null) { top.successStr = top.successStr.QueryInterface( Components.interfaces.nsISupportsWString); } top.errorStr = Components.classes["component://netscape/supports-wstring"].createInstance(); if (top.errorStr != null) top.errorStr = top.errorStr.QueryInterface( Components.interfaces.nsISupportsWString); if (ImportAddress( module, top.successStr, top.errorStr) == true) { // We think it was a success, either, we need to // wait for the import to finish // or we are done! if (top.progressInfo.importInterface == null) { ShowAddressComplete( true); return( true); } else { var meterText = GetFormattedBundleString( 'AddrProgressMeterText', name); var titleText = GetBundleString( 'AddrProgressTitle'); // show the progress window... top.window.openDialog( "chrome://messenger/content/importProgress.xul", "", "chrome,modal,titlebar", {windowTitle: titleText, progressTitle: meterText, progressStatus: "", progressInfo: top.progressInfo}); return( true); } } else { ShowAddressComplete( false); return( false); } break; case "settings": var error = new Object(); error.value = null; var newAccount = new Object(); if (!ImportSettings( module, newAccount, error)) { if (error.value != null) { // Show error alert with error // information alert( GetBundleString( 'ImportSettingsFailed')); } // the user canceled the operation, shoud we dismiss // this dialog or not? return false; } else { // Alert to show success alert( GetFormattedBundleString( 'ImportSettingsSuccess', name)); } break; } } } return true;} |
var meterText = GetFormattedBundleString( 'MailProgressMeterText', name); top.window.openDialog( "chrome: "", "chrome,modal,titlebar", {windowTitle: GetBundleString( 'MailProgressTitle'), progressTitle: meterText, progressStatus: "", progressInfo: top.progressInfo}); dump( "*** Returned from progress window\n"); | var meterText = GetFormattedBundleString('MailProgressMeterText', name); header.setAttribute("description", meterText); progressStatusEl.setAttribute("value", ""); progressTitleEl.setAttribute("value", meterText); deck.setAttribute("index", "2"); progressInfo.progressWindow = top.window; progressInfo.intervalState = setInterval("ContinueImportCallback()", 100); | function ImportDialogOKButton(){ var tree = document.getElementById('moduleList'); if ( tree && tree.selectedItems && (tree.selectedItems.length == 1) ) { var index = tree.selectedItems[0].getAttribute('list-index'); var module = top.importService.GetModule( top.importType, index); var name = top.importService.GetModuleName( top.importType, index); top.selectedModuleName = name; if (module != null) { switch( top.importType ) { case "mail": top.successStr = Components.classes["component://netscape/supports-wstring"].createInstance(); if (top.successStr != null) { top.successStr = top.successStr.QueryInterface( Components.interfaces.nsISupportsWString); } top.errorStr = Components.classes["component://netscape/supports-wstring"].createInstance(); if (top.errorStr != null) top.errorStr = top.errorStr.QueryInterface( Components.interfaces.nsISupportsWString); if (ImportMail( module, top.successStr, top.errorStr) == true) { // We think it was a success, either, we need to // wait for the import to finish // or we are done! if (top.progressInfo.importInterface == null) { ShowMailComplete( true); return( true); } else { var meterText = GetFormattedBundleString( 'MailProgressMeterText', name); // show the progress window... top.window.openDialog( "chrome://messenger/content/importProgress.xul", "", "chrome,modal,titlebar", {windowTitle: GetBundleString( 'MailProgressTitle'), progressTitle: meterText, progressStatus: "", progressInfo: top.progressInfo}); dump( "*** Returned from progress window\n"); return( true); } } else { ShowMailComplete( false); return( false); } break; case "addressbook": top.successStr = Components.classes["component://netscape/supports-wstring"].createInstance(); if (top.successStr != null) { top.successStr = top.successStr.QueryInterface( Components.interfaces.nsISupportsWString); } top.errorStr = Components.classes["component://netscape/supports-wstring"].createInstance(); if (top.errorStr != null) top.errorStr = top.errorStr.QueryInterface( Components.interfaces.nsISupportsWString); if (ImportAddress( module, top.successStr, top.errorStr) == true) { // We think it was a success, either, we need to // wait for the import to finish // or we are done! if (top.progressInfo.importInterface == null) { ShowAddressComplete( true); return( true); } else { var meterText = GetFormattedBundleString( 'AddrProgressMeterText', name); var titleText = GetBundleString( 'AddrProgressTitle'); // show the progress window... top.window.openDialog( "chrome://messenger/content/importProgress.xul", "", "chrome,modal,titlebar", {windowTitle: titleText, progressTitle: meterText, progressStatus: "", progressInfo: top.progressInfo}); return( true); } } else { ShowAddressComplete( false); return( false); } break; case "settings": var error = new Object(); error.value = null; var newAccount = new Object(); if (!ImportSettings( module, newAccount, error)) { if (error.value != null) { // Show error alert with error // information alert( GetBundleString( 'ImportSettingsFailed')); } // the user canceled the operation, shoud we dismiss // this dialog or not? return false; } else { // Alert to show success alert( GetFormattedBundleString( 'ImportSettingsSuccess', name)); } break; } } } return true;} |
ShowMailComplete( false); | ShowImportResults(false, 'Mail'); | function ImportDialogOKButton(){ var tree = document.getElementById('moduleList'); if ( tree && tree.selectedItems && (tree.selectedItems.length == 1) ) { var index = tree.selectedItems[0].getAttribute('list-index'); var module = top.importService.GetModule( top.importType, index); var name = top.importService.GetModuleName( top.importType, index); top.selectedModuleName = name; if (module != null) { switch( top.importType ) { case "mail": top.successStr = Components.classes["component://netscape/supports-wstring"].createInstance(); if (top.successStr != null) { top.successStr = top.successStr.QueryInterface( Components.interfaces.nsISupportsWString); } top.errorStr = Components.classes["component://netscape/supports-wstring"].createInstance(); if (top.errorStr != null) top.errorStr = top.errorStr.QueryInterface( Components.interfaces.nsISupportsWString); if (ImportMail( module, top.successStr, top.errorStr) == true) { // We think it was a success, either, we need to // wait for the import to finish // or we are done! if (top.progressInfo.importInterface == null) { ShowMailComplete( true); return( true); } else { var meterText = GetFormattedBundleString( 'MailProgressMeterText', name); // show the progress window... top.window.openDialog( "chrome://messenger/content/importProgress.xul", "", "chrome,modal,titlebar", {windowTitle: GetBundleString( 'MailProgressTitle'), progressTitle: meterText, progressStatus: "", progressInfo: top.progressInfo}); dump( "*** Returned from progress window\n"); return( true); } } else { ShowMailComplete( false); return( false); } break; case "addressbook": top.successStr = Components.classes["component://netscape/supports-wstring"].createInstance(); if (top.successStr != null) { top.successStr = top.successStr.QueryInterface( Components.interfaces.nsISupportsWString); } top.errorStr = Components.classes["component://netscape/supports-wstring"].createInstance(); if (top.errorStr != null) top.errorStr = top.errorStr.QueryInterface( Components.interfaces.nsISupportsWString); if (ImportAddress( module, top.successStr, top.errorStr) == true) { // We think it was a success, either, we need to // wait for the import to finish // or we are done! if (top.progressInfo.importInterface == null) { ShowAddressComplete( true); return( true); } else { var meterText = GetFormattedBundleString( 'AddrProgressMeterText', name); var titleText = GetBundleString( 'AddrProgressTitle'); // show the progress window... top.window.openDialog( "chrome://messenger/content/importProgress.xul", "", "chrome,modal,titlebar", {windowTitle: titleText, progressTitle: meterText, progressStatus: "", progressInfo: top.progressInfo}); return( true); } } else { ShowAddressComplete( false); return( false); } break; case "settings": var error = new Object(); error.value = null; var newAccount = new Object(); if (!ImportSettings( module, newAccount, error)) { if (error.value != null) { // Show error alert with error // information alert( GetBundleString( 'ImportSettingsFailed')); } // the user canceled the operation, shoud we dismiss // this dialog or not? return false; } else { // Alert to show success alert( GetFormattedBundleString( 'ImportSettingsSuccess', name)); } break; } } } return true;} |
if (top.successStr != null) { | if (top.successStr) | function ImportDialogOKButton(){ var tree = document.getElementById('moduleList'); if ( tree && tree.selectedItems && (tree.selectedItems.length == 1) ) { var index = tree.selectedItems[0].getAttribute('list-index'); var module = top.importService.GetModule( top.importType, index); var name = top.importService.GetModuleName( top.importType, index); top.selectedModuleName = name; if (module != null) { switch( top.importType ) { case "mail": top.successStr = Components.classes["component://netscape/supports-wstring"].createInstance(); if (top.successStr != null) { top.successStr = top.successStr.QueryInterface( Components.interfaces.nsISupportsWString); } top.errorStr = Components.classes["component://netscape/supports-wstring"].createInstance(); if (top.errorStr != null) top.errorStr = top.errorStr.QueryInterface( Components.interfaces.nsISupportsWString); if (ImportMail( module, top.successStr, top.errorStr) == true) { // We think it was a success, either, we need to // wait for the import to finish // or we are done! if (top.progressInfo.importInterface == null) { ShowMailComplete( true); return( true); } else { var meterText = GetFormattedBundleString( 'MailProgressMeterText', name); // show the progress window... top.window.openDialog( "chrome://messenger/content/importProgress.xul", "", "chrome,modal,titlebar", {windowTitle: GetBundleString( 'MailProgressTitle'), progressTitle: meterText, progressStatus: "", progressInfo: top.progressInfo}); dump( "*** Returned from progress window\n"); return( true); } } else { ShowMailComplete( false); return( false); } break; case "addressbook": top.successStr = Components.classes["component://netscape/supports-wstring"].createInstance(); if (top.successStr != null) { top.successStr = top.successStr.QueryInterface( Components.interfaces.nsISupportsWString); } top.errorStr = Components.classes["component://netscape/supports-wstring"].createInstance(); if (top.errorStr != null) top.errorStr = top.errorStr.QueryInterface( Components.interfaces.nsISupportsWString); if (ImportAddress( module, top.successStr, top.errorStr) == true) { // We think it was a success, either, we need to // wait for the import to finish // or we are done! if (top.progressInfo.importInterface == null) { ShowAddressComplete( true); return( true); } else { var meterText = GetFormattedBundleString( 'AddrProgressMeterText', name); var titleText = GetBundleString( 'AddrProgressTitle'); // show the progress window... top.window.openDialog( "chrome://messenger/content/importProgress.xul", "", "chrome,modal,titlebar", {windowTitle: titleText, progressTitle: meterText, progressStatus: "", progressInfo: top.progressInfo}); return( true); } } else { ShowAddressComplete( false); return( false); } break; case "settings": var error = new Object(); error.value = null; var newAccount = new Object(); if (!ImportSettings( module, newAccount, error)) { if (error.value != null) { // Show error alert with error // information alert( GetBundleString( 'ImportSettingsFailed')); } // the user canceled the operation, shoud we dismiss // this dialog or not? return false; } else { // Alert to show success alert( GetFormattedBundleString( 'ImportSettingsSuccess', name)); } break; } } } return true;} |
} | function ImportDialogOKButton(){ var tree = document.getElementById('moduleList'); if ( tree && tree.selectedItems && (tree.selectedItems.length == 1) ) { var index = tree.selectedItems[0].getAttribute('list-index'); var module = top.importService.GetModule( top.importType, index); var name = top.importService.GetModuleName( top.importType, index); top.selectedModuleName = name; if (module != null) { switch( top.importType ) { case "mail": top.successStr = Components.classes["component://netscape/supports-wstring"].createInstance(); if (top.successStr != null) { top.successStr = top.successStr.QueryInterface( Components.interfaces.nsISupportsWString); } top.errorStr = Components.classes["component://netscape/supports-wstring"].createInstance(); if (top.errorStr != null) top.errorStr = top.errorStr.QueryInterface( Components.interfaces.nsISupportsWString); if (ImportMail( module, top.successStr, top.errorStr) == true) { // We think it was a success, either, we need to // wait for the import to finish // or we are done! if (top.progressInfo.importInterface == null) { ShowMailComplete( true); return( true); } else { var meterText = GetFormattedBundleString( 'MailProgressMeterText', name); // show the progress window... top.window.openDialog( "chrome://messenger/content/importProgress.xul", "", "chrome,modal,titlebar", {windowTitle: GetBundleString( 'MailProgressTitle'), progressTitle: meterText, progressStatus: "", progressInfo: top.progressInfo}); dump( "*** Returned from progress window\n"); return( true); } } else { ShowMailComplete( false); return( false); } break; case "addressbook": top.successStr = Components.classes["component://netscape/supports-wstring"].createInstance(); if (top.successStr != null) { top.successStr = top.successStr.QueryInterface( Components.interfaces.nsISupportsWString); } top.errorStr = Components.classes["component://netscape/supports-wstring"].createInstance(); if (top.errorStr != null) top.errorStr = top.errorStr.QueryInterface( Components.interfaces.nsISupportsWString); if (ImportAddress( module, top.successStr, top.errorStr) == true) { // We think it was a success, either, we need to // wait for the import to finish // or we are done! if (top.progressInfo.importInterface == null) { ShowAddressComplete( true); return( true); } else { var meterText = GetFormattedBundleString( 'AddrProgressMeterText', name); var titleText = GetBundleString( 'AddrProgressTitle'); // show the progress window... top.window.openDialog( "chrome://messenger/content/importProgress.xul", "", "chrome,modal,titlebar", {windowTitle: titleText, progressTitle: meterText, progressStatus: "", progressInfo: top.progressInfo}); return( true); } } else { ShowAddressComplete( false); return( false); } break; case "settings": var error = new Object(); error.value = null; var newAccount = new Object(); if (!ImportSettings( module, newAccount, error)) { if (error.value != null) { // Show error alert with error // information alert( GetBundleString( 'ImportSettingsFailed')); } // the user canceled the operation, shoud we dismiss // this dialog or not? return false; } else { // Alert to show success alert( GetFormattedBundleString( 'ImportSettingsSuccess', name)); } break; } } } return true;} |
|
ShowAddressComplete( true); | ShowImportResults(true, 'Address'); | function ImportDialogOKButton(){ var tree = document.getElementById('moduleList'); if ( tree && tree.selectedItems && (tree.selectedItems.length == 1) ) { var index = tree.selectedItems[0].getAttribute('list-index'); var module = top.importService.GetModule( top.importType, index); var name = top.importService.GetModuleName( top.importType, index); top.selectedModuleName = name; if (module != null) { switch( top.importType ) { case "mail": top.successStr = Components.classes["component://netscape/supports-wstring"].createInstance(); if (top.successStr != null) { top.successStr = top.successStr.QueryInterface( Components.interfaces.nsISupportsWString); } top.errorStr = Components.classes["component://netscape/supports-wstring"].createInstance(); if (top.errorStr != null) top.errorStr = top.errorStr.QueryInterface( Components.interfaces.nsISupportsWString); if (ImportMail( module, top.successStr, top.errorStr) == true) { // We think it was a success, either, we need to // wait for the import to finish // or we are done! if (top.progressInfo.importInterface == null) { ShowMailComplete( true); return( true); } else { var meterText = GetFormattedBundleString( 'MailProgressMeterText', name); // show the progress window... top.window.openDialog( "chrome://messenger/content/importProgress.xul", "", "chrome,modal,titlebar", {windowTitle: GetBundleString( 'MailProgressTitle'), progressTitle: meterText, progressStatus: "", progressInfo: top.progressInfo}); dump( "*** Returned from progress window\n"); return( true); } } else { ShowMailComplete( false); return( false); } break; case "addressbook": top.successStr = Components.classes["component://netscape/supports-wstring"].createInstance(); if (top.successStr != null) { top.successStr = top.successStr.QueryInterface( Components.interfaces.nsISupportsWString); } top.errorStr = Components.classes["component://netscape/supports-wstring"].createInstance(); if (top.errorStr != null) top.errorStr = top.errorStr.QueryInterface( Components.interfaces.nsISupportsWString); if (ImportAddress( module, top.successStr, top.errorStr) == true) { // We think it was a success, either, we need to // wait for the import to finish // or we are done! if (top.progressInfo.importInterface == null) { ShowAddressComplete( true); return( true); } else { var meterText = GetFormattedBundleString( 'AddrProgressMeterText', name); var titleText = GetBundleString( 'AddrProgressTitle'); // show the progress window... top.window.openDialog( "chrome://messenger/content/importProgress.xul", "", "chrome,modal,titlebar", {windowTitle: titleText, progressTitle: meterText, progressStatus: "", progressInfo: top.progressInfo}); return( true); } } else { ShowAddressComplete( false); return( false); } break; case "settings": var error = new Object(); error.value = null; var newAccount = new Object(); if (!ImportSettings( module, newAccount, error)) { if (error.value != null) { // Show error alert with error // information alert( GetBundleString( 'ImportSettingsFailed')); } // the user canceled the operation, shoud we dismiss // this dialog or not? return false; } else { // Alert to show success alert( GetFormattedBundleString( 'ImportSettingsSuccess', name)); } break; } } } return true;} |
var meterText = GetFormattedBundleString( 'AddrProgressMeterText', name); var titleText = GetBundleString( 'AddrProgressTitle'); top.window.openDialog( "chrome: "", "chrome,modal,titlebar", {windowTitle: titleText, progressTitle: meterText, progressStatus: "", progressInfo: top.progressInfo}); | function ImportDialogOKButton(){ var tree = document.getElementById('moduleList'); if ( tree && tree.selectedItems && (tree.selectedItems.length == 1) ) { var index = tree.selectedItems[0].getAttribute('list-index'); var module = top.importService.GetModule( top.importType, index); var name = top.importService.GetModuleName( top.importType, index); top.selectedModuleName = name; if (module != null) { switch( top.importType ) { case "mail": top.successStr = Components.classes["component://netscape/supports-wstring"].createInstance(); if (top.successStr != null) { top.successStr = top.successStr.QueryInterface( Components.interfaces.nsISupportsWString); } top.errorStr = Components.classes["component://netscape/supports-wstring"].createInstance(); if (top.errorStr != null) top.errorStr = top.errorStr.QueryInterface( Components.interfaces.nsISupportsWString); if (ImportMail( module, top.successStr, top.errorStr) == true) { // We think it was a success, either, we need to // wait for the import to finish // or we are done! if (top.progressInfo.importInterface == null) { ShowMailComplete( true); return( true); } else { var meterText = GetFormattedBundleString( 'MailProgressMeterText', name); // show the progress window... top.window.openDialog( "chrome://messenger/content/importProgress.xul", "", "chrome,modal,titlebar", {windowTitle: GetBundleString( 'MailProgressTitle'), progressTitle: meterText, progressStatus: "", progressInfo: top.progressInfo}); dump( "*** Returned from progress window\n"); return( true); } } else { ShowMailComplete( false); return( false); } break; case "addressbook": top.successStr = Components.classes["component://netscape/supports-wstring"].createInstance(); if (top.successStr != null) { top.successStr = top.successStr.QueryInterface( Components.interfaces.nsISupportsWString); } top.errorStr = Components.classes["component://netscape/supports-wstring"].createInstance(); if (top.errorStr != null) top.errorStr = top.errorStr.QueryInterface( Components.interfaces.nsISupportsWString); if (ImportAddress( module, top.successStr, top.errorStr) == true) { // We think it was a success, either, we need to // wait for the import to finish // or we are done! if (top.progressInfo.importInterface == null) { ShowAddressComplete( true); return( true); } else { var meterText = GetFormattedBundleString( 'AddrProgressMeterText', name); var titleText = GetBundleString( 'AddrProgressTitle'); // show the progress window... top.window.openDialog( "chrome://messenger/content/importProgress.xul", "", "chrome,modal,titlebar", {windowTitle: titleText, progressTitle: meterText, progressStatus: "", progressInfo: top.progressInfo}); return( true); } } else { ShowAddressComplete( false); return( false); } break; case "settings": var error = new Object(); error.value = null; var newAccount = new Object(); if (!ImportSettings( module, newAccount, error)) { if (error.value != null) { // Show error alert with error // information alert( GetBundleString( 'ImportSettingsFailed')); } // the user canceled the operation, shoud we dismiss // this dialog or not? return false; } else { // Alert to show success alert( GetFormattedBundleString( 'ImportSettingsSuccess', name)); } break; } } } return true;} |
|
ShowAddressComplete( false); | ShowImportResults(false, 'Address'); | function ImportDialogOKButton(){ var tree = document.getElementById('moduleList'); if ( tree && tree.selectedItems && (tree.selectedItems.length == 1) ) { var index = tree.selectedItems[0].getAttribute('list-index'); var module = top.importService.GetModule( top.importType, index); var name = top.importService.GetModuleName( top.importType, index); top.selectedModuleName = name; if (module != null) { switch( top.importType ) { case "mail": top.successStr = Components.classes["component://netscape/supports-wstring"].createInstance(); if (top.successStr != null) { top.successStr = top.successStr.QueryInterface( Components.interfaces.nsISupportsWString); } top.errorStr = Components.classes["component://netscape/supports-wstring"].createInstance(); if (top.errorStr != null) top.errorStr = top.errorStr.QueryInterface( Components.interfaces.nsISupportsWString); if (ImportMail( module, top.successStr, top.errorStr) == true) { // We think it was a success, either, we need to // wait for the import to finish // or we are done! if (top.progressInfo.importInterface == null) { ShowMailComplete( true); return( true); } else { var meterText = GetFormattedBundleString( 'MailProgressMeterText', name); // show the progress window... top.window.openDialog( "chrome://messenger/content/importProgress.xul", "", "chrome,modal,titlebar", {windowTitle: GetBundleString( 'MailProgressTitle'), progressTitle: meterText, progressStatus: "", progressInfo: top.progressInfo}); dump( "*** Returned from progress window\n"); return( true); } } else { ShowMailComplete( false); return( false); } break; case "addressbook": top.successStr = Components.classes["component://netscape/supports-wstring"].createInstance(); if (top.successStr != null) { top.successStr = top.successStr.QueryInterface( Components.interfaces.nsISupportsWString); } top.errorStr = Components.classes["component://netscape/supports-wstring"].createInstance(); if (top.errorStr != null) top.errorStr = top.errorStr.QueryInterface( Components.interfaces.nsISupportsWString); if (ImportAddress( module, top.successStr, top.errorStr) == true) { // We think it was a success, either, we need to // wait for the import to finish // or we are done! if (top.progressInfo.importInterface == null) { ShowAddressComplete( true); return( true); } else { var meterText = GetFormattedBundleString( 'AddrProgressMeterText', name); var titleText = GetBundleString( 'AddrProgressTitle'); // show the progress window... top.window.openDialog( "chrome://messenger/content/importProgress.xul", "", "chrome,modal,titlebar", {windowTitle: titleText, progressTitle: meterText, progressStatus: "", progressInfo: top.progressInfo}); return( true); } } else { ShowAddressComplete( false); return( false); } break; case "settings": var error = new Object(); error.value = null; var newAccount = new Object(); if (!ImportSettings( module, newAccount, error)) { if (error.value != null) { // Show error alert with error // information alert( GetBundleString( 'ImportSettingsFailed')); } // the user canceled the operation, shoud we dismiss // this dialog or not? return false; } else { // Alert to show success alert( GetFormattedBundleString( 'ImportSettingsSuccess', name)); } break; } } } return true;} |
if (error.value != null) { alert( GetBundleString( 'ImportSettingsFailed')); } | if (error.value) ShowImportResultsRaw(GetBundleString( 'ImportSettingsFailed'), null); | function ImportDialogOKButton(){ var tree = document.getElementById('moduleList'); if ( tree && tree.selectedItems && (tree.selectedItems.length == 1) ) { var index = tree.selectedItems[0].getAttribute('list-index'); var module = top.importService.GetModule( top.importType, index); var name = top.importService.GetModuleName( top.importType, index); top.selectedModuleName = name; if (module != null) { switch( top.importType ) { case "mail": top.successStr = Components.classes["component://netscape/supports-wstring"].createInstance(); if (top.successStr != null) { top.successStr = top.successStr.QueryInterface( Components.interfaces.nsISupportsWString); } top.errorStr = Components.classes["component://netscape/supports-wstring"].createInstance(); if (top.errorStr != null) top.errorStr = top.errorStr.QueryInterface( Components.interfaces.nsISupportsWString); if (ImportMail( module, top.successStr, top.errorStr) == true) { // We think it was a success, either, we need to // wait for the import to finish // or we are done! if (top.progressInfo.importInterface == null) { ShowMailComplete( true); return( true); } else { var meterText = GetFormattedBundleString( 'MailProgressMeterText', name); // show the progress window... top.window.openDialog( "chrome://messenger/content/importProgress.xul", "", "chrome,modal,titlebar", {windowTitle: GetBundleString( 'MailProgressTitle'), progressTitle: meterText, progressStatus: "", progressInfo: top.progressInfo}); dump( "*** Returned from progress window\n"); return( true); } } else { ShowMailComplete( false); return( false); } break; case "addressbook": top.successStr = Components.classes["component://netscape/supports-wstring"].createInstance(); if (top.successStr != null) { top.successStr = top.successStr.QueryInterface( Components.interfaces.nsISupportsWString); } top.errorStr = Components.classes["component://netscape/supports-wstring"].createInstance(); if (top.errorStr != null) top.errorStr = top.errorStr.QueryInterface( Components.interfaces.nsISupportsWString); if (ImportAddress( module, top.successStr, top.errorStr) == true) { // We think it was a success, either, we need to // wait for the import to finish // or we are done! if (top.progressInfo.importInterface == null) { ShowAddressComplete( true); return( true); } else { var meterText = GetFormattedBundleString( 'AddrProgressMeterText', name); var titleText = GetBundleString( 'AddrProgressTitle'); // show the progress window... top.window.openDialog( "chrome://messenger/content/importProgress.xul", "", "chrome,modal,titlebar", {windowTitle: titleText, progressTitle: meterText, progressStatus: "", progressInfo: top.progressInfo}); return( true); } } else { ShowAddressComplete( false); return( false); } break; case "settings": var error = new Object(); error.value = null; var newAccount = new Object(); if (!ImportSettings( module, newAccount, error)) { if (error.value != null) { // Show error alert with error // information alert( GetBundleString( 'ImportSettingsFailed')); } // the user canceled the operation, shoud we dismiss // this dialog or not? return false; } else { // Alert to show success alert( GetFormattedBundleString( 'ImportSettingsSuccess', name)); } break; } } } return true;} |
{ alert( GetFormattedBundleString( 'ImportSettingsSuccess', name)); } | ShowImportResultsRaw(GetFormattedBundleString( 'ImportSettingsSuccess', name), null); | function ImportDialogOKButton(){ var tree = document.getElementById('moduleList'); if ( tree && tree.selectedItems && (tree.selectedItems.length == 1) ) { var index = tree.selectedItems[0].getAttribute('list-index'); var module = top.importService.GetModule( top.importType, index); var name = top.importService.GetModuleName( top.importType, index); top.selectedModuleName = name; if (module != null) { switch( top.importType ) { case "mail": top.successStr = Components.classes["component://netscape/supports-wstring"].createInstance(); if (top.successStr != null) { top.successStr = top.successStr.QueryInterface( Components.interfaces.nsISupportsWString); } top.errorStr = Components.classes["component://netscape/supports-wstring"].createInstance(); if (top.errorStr != null) top.errorStr = top.errorStr.QueryInterface( Components.interfaces.nsISupportsWString); if (ImportMail( module, top.successStr, top.errorStr) == true) { // We think it was a success, either, we need to // wait for the import to finish // or we are done! if (top.progressInfo.importInterface == null) { ShowMailComplete( true); return( true); } else { var meterText = GetFormattedBundleString( 'MailProgressMeterText', name); // show the progress window... top.window.openDialog( "chrome://messenger/content/importProgress.xul", "", "chrome,modal,titlebar", {windowTitle: GetBundleString( 'MailProgressTitle'), progressTitle: meterText, progressStatus: "", progressInfo: top.progressInfo}); dump( "*** Returned from progress window\n"); return( true); } } else { ShowMailComplete( false); return( false); } break; case "addressbook": top.successStr = Components.classes["component://netscape/supports-wstring"].createInstance(); if (top.successStr != null) { top.successStr = top.successStr.QueryInterface( Components.interfaces.nsISupportsWString); } top.errorStr = Components.classes["component://netscape/supports-wstring"].createInstance(); if (top.errorStr != null) top.errorStr = top.errorStr.QueryInterface( Components.interfaces.nsISupportsWString); if (ImportAddress( module, top.successStr, top.errorStr) == true) { // We think it was a success, either, we need to // wait for the import to finish // or we are done! if (top.progressInfo.importInterface == null) { ShowAddressComplete( true); return( true); } else { var meterText = GetFormattedBundleString( 'AddrProgressMeterText', name); var titleText = GetBundleString( 'AddrProgressTitle'); // show the progress window... top.window.openDialog( "chrome://messenger/content/importProgress.xul", "", "chrome,modal,titlebar", {windowTitle: titleText, progressTitle: meterText, progressStatus: "", progressInfo: top.progressInfo}); return( true); } } else { ShowAddressComplete( false); return( false); } break; case "settings": var error = new Object(); error.value = null; var newAccount = new Object(); if (!ImportSettings( module, newAccount, error)) { if (error.value != null) { // Show error alert with error // information alert( GetBundleString( 'ImportSettingsFailed')); } // the user canceled the operation, shoud we dismiss // this dialog or not? return false; } else { // Alert to show success alert( GetFormattedBundleString( 'ImportSettingsSuccess', name)); } break; } } } return true;} |
var filePicker = Components.classes["component: | var filePicker = Components.classes["@mozilla.org/filepicker;1"].createInstance(); | function ImportMail( module, success, error) { if (top.progressInfo.importInterface || top.progressInfo.intervalState) { error.data = GetBundleString( 'ImportAlreadyInProgress'); return( false); } top.progressInfo.importSuccess = false; var mailInterface = module.GetImportInterface( "mail"); if (mailInterface != null) mailInterface = mailInterface.QueryInterface( Components.interfaces.nsIImportGeneric); if (mailInterface == null) { error.data = GetBundleString( 'ImportMailBadModule'); return( false); } var loc = mailInterface.GetData( "mailLocation"); if (loc == null) { // No location found, check to see if we can ask the user. if (mailInterface.GetStatus( "canUserSetLocation") != 0) { var filePicker = Components.classes["component://mozilla/filepicker"].createInstance(); if (filePicker != null) { filePicker = filePicker.QueryInterface( Components.interfaces.nsIFilePicker); if (filePicker != null) { try { filePicker.init( top.window, GetBundleString( 'ImportSelectMailDir'), Components.interfaces.nsIFilePicker.modeGetFolder); filePicker.appendFilters( Components.interfaces.nsIFilePicker.filterAll); filePicker.show(); if (filePicker.file && (filePicker.file.path.length > 0)) mailInterface.SetData( "mailLocation", CreateNewFileSpecFromPath( filePicker.file.path)); else return( false); } catch( ex) { // don't show an error when we return! return( false); } } else { error.data = GetBundleString( 'ImportMailNotFound'); return( false); } } else { error.data = GetBundleString( 'ImportMailNotFound'); return( false); } } else { error.data = GetBundleString( 'ImportMailNotFound'); return( false); } } if (mailInterface.WantsProgress()) { if (mailInterface.BeginImport( success, error)) { top.progressInfo.importInterface = mailInterface; // top.intervalState = setInterval( "ContinueImport()", 100); return true; } else return false; } else return mailInterface.BeginImport( success, error) ? true : false;} |
return( true); | return true; | function ImportMail( module, success, error) { if (top.progressInfo.importInterface || top.progressInfo.intervalState) { error.data = GetBundleString( 'ImportAlreadyInProgress'); return( false); } top.progressInfo.importSuccess = false; var mailInterface = module.GetImportInterface( "mail"); if (mailInterface != null) mailInterface = mailInterface.QueryInterface( Components.interfaces.nsIImportGeneric); if (mailInterface == null) { error.data = GetBundleString( 'ImportMailBadModule'); return( false); } var loc = mailInterface.GetData( "mailLocation"); if (loc == null) { // No location found, check to see if we can ask the user. if (mailInterface.GetStatus( "canUserSetLocation") != 0) { var filePicker = Components.classes["component://mozilla/filepicker"].createInstance(); if (filePicker != null) { filePicker = filePicker.QueryInterface( Components.interfaces.nsIFilePicker); if (filePicker != null) { try { filePicker.init( top.window, GetBundleString( 'ImportSelectMailDir'), Components.interfaces.nsIFilePicker.modeGetFolder); filePicker.appendFilters( Components.interfaces.nsIFilePicker.filterAll); filePicker.show(); if (filePicker.file && (filePicker.file.path.length > 0)) mailInterface.SetData( "mailLocation", CreateNewFileSpecFromPath( filePicker.file.path)); else return( false); } catch( ex) { // don't show an error when we return! return( false); } } else { error.data = GetBundleString( 'ImportMailNotFound'); return( false); } } else { error.data = GetBundleString( 'ImportMailNotFound'); return( false); } } else { error.data = GetBundleString( 'ImportMailNotFound'); return( false); } } if (mailInterface.WantsProgress()) { if (mailInterface.BeginImport( success, error)) { top.progressInfo.importInterface = mailInterface; // top.intervalState = setInterval( "ContinueImport()", 100); return( true); } else { return( false); } } else { dump( "*** WantsProgress returned false\n"); if (mailInterface.BeginImport( success, error)) { return( true); } else { return( false); } }} |
else { return( false); } | else return false; | function ImportMail( module, success, error) { if (top.progressInfo.importInterface || top.progressInfo.intervalState) { error.data = GetBundleString( 'ImportAlreadyInProgress'); return( false); } top.progressInfo.importSuccess = false; var mailInterface = module.GetImportInterface( "mail"); if (mailInterface != null) mailInterface = mailInterface.QueryInterface( Components.interfaces.nsIImportGeneric); if (mailInterface == null) { error.data = GetBundleString( 'ImportMailBadModule'); return( false); } var loc = mailInterface.GetData( "mailLocation"); if (loc == null) { // No location found, check to see if we can ask the user. if (mailInterface.GetStatus( "canUserSetLocation") != 0) { var filePicker = Components.classes["component://mozilla/filepicker"].createInstance(); if (filePicker != null) { filePicker = filePicker.QueryInterface( Components.interfaces.nsIFilePicker); if (filePicker != null) { try { filePicker.init( top.window, GetBundleString( 'ImportSelectMailDir'), Components.interfaces.nsIFilePicker.modeGetFolder); filePicker.appendFilters( Components.interfaces.nsIFilePicker.filterAll); filePicker.show(); if (filePicker.file && (filePicker.file.path.length > 0)) mailInterface.SetData( "mailLocation", CreateNewFileSpecFromPath( filePicker.file.path)); else return( false); } catch( ex) { // don't show an error when we return! return( false); } } else { error.data = GetBundleString( 'ImportMailNotFound'); return( false); } } else { error.data = GetBundleString( 'ImportMailNotFound'); return( false); } } else { error.data = GetBundleString( 'ImportMailNotFound'); return( false); } } if (mailInterface.WantsProgress()) { if (mailInterface.BeginImport( success, error)) { top.progressInfo.importInterface = mailInterface; // top.intervalState = setInterval( "ContinueImport()", 100); return( true); } else { return( false); } } else { dump( "*** WantsProgress returned false\n"); if (mailInterface.BeginImport( success, error)) { return( true); } else { return( false); } }} |
else { dump( "*** WantsProgress returned false\n"); if (mailInterface.BeginImport( success, error)) { return( true); } else { return( false); } } | else return mailInterface.BeginImport( success, error) ? true : false; | function ImportMail( module, success, error) { if (top.progressInfo.importInterface || top.progressInfo.intervalState) { error.data = GetBundleString( 'ImportAlreadyInProgress'); return( false); } top.progressInfo.importSuccess = false; var mailInterface = module.GetImportInterface( "mail"); if (mailInterface != null) mailInterface = mailInterface.QueryInterface( Components.interfaces.nsIImportGeneric); if (mailInterface == null) { error.data = GetBundleString( 'ImportMailBadModule'); return( false); } var loc = mailInterface.GetData( "mailLocation"); if (loc == null) { // No location found, check to see if we can ask the user. if (mailInterface.GetStatus( "canUserSetLocation") != 0) { var filePicker = Components.classes["component://mozilla/filepicker"].createInstance(); if (filePicker != null) { filePicker = filePicker.QueryInterface( Components.interfaces.nsIFilePicker); if (filePicker != null) { try { filePicker.init( top.window, GetBundleString( 'ImportSelectMailDir'), Components.interfaces.nsIFilePicker.modeGetFolder); filePicker.appendFilters( Components.interfaces.nsIFilePicker.filterAll); filePicker.show(); if (filePicker.file && (filePicker.file.path.length > 0)) mailInterface.SetData( "mailLocation", CreateNewFileSpecFromPath( filePicker.file.path)); else return( false); } catch( ex) { // don't show an error when we return! return( false); } } else { error.data = GetBundleString( 'ImportMailNotFound'); return( false); } } else { error.data = GetBundleString( 'ImportMailNotFound'); return( false); } } else { error.data = GetBundleString( 'ImportMailNotFound'); return( false); } } if (mailInterface.WantsProgress()) { if (mailInterface.BeginImport( success, error)) { top.progressInfo.importInterface = mailInterface; // top.intervalState = setInterval( "ContinueImport()", 100); return( true); } else { return( false); } } else { dump( "*** WantsProgress returned false\n"); if (mailInterface.BeginImport( success, error)) { return( true); } else { return( false); } }} |
var file = new LocalFile(rv.file, MODE_RDONLY); | importOPML: function() { var rv = pickOpen(this.mBundle.getString("subscribe-OPMLImportTitle"), '$xml $opml $all'); if(rv.reason == PICK_CANCEL) return; var file = new LocalFile(rv.file, MODE_RDONLY); var promptService = Components.classes["@mozilla.org/embedcomp/prompt-service;1"].getService(IPS); // return if we couldn't open the file at all... if(!file) return promptService.alert(window, null, this.mBundle.getString("subscribe-errorOpeningFile")); var text = file.read(); var parser = new DOMParser(); var opmlDom = parser.parseFromString(text, 'application/xml'); // return if the user didn't give us an OPML file if(!opmlDom || !(opmlDom.documentElement.tagName == "opml")) return promptService.alert(window, null, this.mBundle.getFormattedString("subscribe-errorInvalidOPMLFile", [rv.file.leafName])); var outlines = opmlDom.getElementsByTagName("body")[0].getElementsByTagName("outline"); var feedsAdded = false; for (var index = 0; index < outlines.length; index++) { var outline = outlines[index]; // XXX only dealing with flat OPML files for now. // We still need to add support for grouped files. if(outline.hasAttribute("xmlUrl") || outline.hasAttribute("url")) { var userAddedFeed = false; var newFeedUrl = outline.getAttribute("xmlUrl") || outline.getAttribute("url") var defaultQuickMode = this.mRSSServer.getBoolAttribute('quickMode'); var feedProperties = { feedName: this.findOutlineTitle(outline), feedLocation: newFeedUrl, serverURI: this.mRSSServer.serverURI, serverPrettyName: this.mRSSServer.prettyName, folderURI: "", quickMode: this.mRSSServer.getBoolAttribute('quickMode')}; debug("importing feed: "+ feedProperties.feedName); // Silently skip feeds that are already subscribed to. if (!feedAlreadyExists(feedProperties.feedLocation, this.mRSSServer)) { var feed = this.storeFeed(feedProperties); if(feed) { feed.title = feedProperties.feedName; if(outline.hasAttribute("htmlUrl")) feed.link = outline.getAttribute("htmlUrl"); feed.createFolder(); updateFolderFeedUrl(feed.folder, feed.url, false); // add feed adds the feed we have validated and downloaded to our datasource // it also flushes the subscription datasource addFeed(feed.url, feed.name, feed.folder); feedsAdded = true; } } } } if (!outlines.length || !feedsAdded) return promptService.alert(window, null, this.mBundle.getFormattedString("subscribe-errorInvalidOPMLFile", [rv.file.leafName])); //add the new feeds to our view refreshSubscriptionView(); }, |
|
if(!file) | var stream = Components.classes["@mozilla.org/network/file-input-stream;1"].createInstance(Components.interfaces.nsIFileInputStream); var opmlDom = null; try{ stream.init(rv.file, MODE_RDONLY, PERM_IROTH, 0); var parser = new DOMParser(); opmlDom = parser.parseFromStream(stream, null, stream.available(), 'application/xml'); }catch(e){ | importOPML: function() { var rv = pickOpen(this.mBundle.getString("subscribe-OPMLImportTitle"), '$xml $opml $all'); if(rv.reason == PICK_CANCEL) return; var file = new LocalFile(rv.file, MODE_RDONLY); var promptService = Components.classes["@mozilla.org/embedcomp/prompt-service;1"].getService(IPS); // return if we couldn't open the file at all... if(!file) return promptService.alert(window, null, this.mBundle.getString("subscribe-errorOpeningFile")); var text = file.read(); var parser = new DOMParser(); var opmlDom = parser.parseFromString(text, 'application/xml'); // return if the user didn't give us an OPML file if(!opmlDom || !(opmlDom.documentElement.tagName == "opml")) return promptService.alert(window, null, this.mBundle.getFormattedString("subscribe-errorInvalidOPMLFile", [rv.file.leafName])); var outlines = opmlDom.getElementsByTagName("body")[0].getElementsByTagName("outline"); var feedsAdded = false; for (var index = 0; index < outlines.length; index++) { var outline = outlines[index]; // XXX only dealing with flat OPML files for now. // We still need to add support for grouped files. if(outline.hasAttribute("xmlUrl") || outline.hasAttribute("url")) { var userAddedFeed = false; var newFeedUrl = outline.getAttribute("xmlUrl") || outline.getAttribute("url") var defaultQuickMode = this.mRSSServer.getBoolAttribute('quickMode'); var feedProperties = { feedName: this.findOutlineTitle(outline), feedLocation: newFeedUrl, serverURI: this.mRSSServer.serverURI, serverPrettyName: this.mRSSServer.prettyName, folderURI: "", quickMode: this.mRSSServer.getBoolAttribute('quickMode')}; debug("importing feed: "+ feedProperties.feedName); // Silently skip feeds that are already subscribed to. if (!feedAlreadyExists(feedProperties.feedLocation, this.mRSSServer)) { var feed = this.storeFeed(feedProperties); if(feed) { feed.title = feedProperties.feedName; if(outline.hasAttribute("htmlUrl")) feed.link = outline.getAttribute("htmlUrl"); feed.createFolder(); updateFolderFeedUrl(feed.folder, feed.url, false); // add feed adds the feed we have validated and downloaded to our datasource // it also flushes the subscription datasource addFeed(feed.url, feed.name, feed.folder); feedsAdded = true; } } } } if (!outlines.length || !feedsAdded) return promptService.alert(window, null, this.mBundle.getFormattedString("subscribe-errorInvalidOPMLFile", [rv.file.leafName])); //add the new feeds to our view refreshSubscriptionView(); }, |
var text = file.read(); var parser = new DOMParser(); var opmlDom = parser.parseFromString(text, 'application/xml'); | }finally{ stream.close(); } | importOPML: function() { var rv = pickOpen(this.mBundle.getString("subscribe-OPMLImportTitle"), '$xml $opml $all'); if(rv.reason == PICK_CANCEL) return; var file = new LocalFile(rv.file, MODE_RDONLY); var promptService = Components.classes["@mozilla.org/embedcomp/prompt-service;1"].getService(IPS); // return if we couldn't open the file at all... if(!file) return promptService.alert(window, null, this.mBundle.getString("subscribe-errorOpeningFile")); var text = file.read(); var parser = new DOMParser(); var opmlDom = parser.parseFromString(text, 'application/xml'); // return if the user didn't give us an OPML file if(!opmlDom || !(opmlDom.documentElement.tagName == "opml")) return promptService.alert(window, null, this.mBundle.getFormattedString("subscribe-errorInvalidOPMLFile", [rv.file.leafName])); var outlines = opmlDom.getElementsByTagName("body")[0].getElementsByTagName("outline"); var feedsAdded = false; for (var index = 0; index < outlines.length; index++) { var outline = outlines[index]; // XXX only dealing with flat OPML files for now. // We still need to add support for grouped files. if(outline.hasAttribute("xmlUrl") || outline.hasAttribute("url")) { var userAddedFeed = false; var newFeedUrl = outline.getAttribute("xmlUrl") || outline.getAttribute("url") var defaultQuickMode = this.mRSSServer.getBoolAttribute('quickMode'); var feedProperties = { feedName: this.findOutlineTitle(outline), feedLocation: newFeedUrl, serverURI: this.mRSSServer.serverURI, serverPrettyName: this.mRSSServer.prettyName, folderURI: "", quickMode: this.mRSSServer.getBoolAttribute('quickMode')}; debug("importing feed: "+ feedProperties.feedName); // Silently skip feeds that are already subscribed to. if (!feedAlreadyExists(feedProperties.feedLocation, this.mRSSServer)) { var feed = this.storeFeed(feedProperties); if(feed) { feed.title = feedProperties.feedName; if(outline.hasAttribute("htmlUrl")) feed.link = outline.getAttribute("htmlUrl"); feed.createFolder(); updateFolderFeedUrl(feed.folder, feed.url, false); // add feed adds the feed we have validated and downloaded to our datasource // it also flushes the subscription datasource addFeed(feed.url, feed.name, feed.folder); feedsAdded = true; } } } } if (!outlines.length || !feedsAdded) return promptService.alert(window, null, this.mBundle.getFormattedString("subscribe-errorInvalidOPMLFile", [rv.file.leafName])); //add the new feeds to our view refreshSubscriptionView(); }, |
var filePicker = Components.classes["component: | var filePicker = Components.classes["@mozilla.org/filepicker;1"].createInstance(); | function ImportSettings( module, newAccount, error) { var setIntf = module.GetImportInterface( "settings"); if (setIntf != null) setIntf = setIntf.QueryInterface( Components.interfaces.nsIImportSettings); if (setIntf == null) { error.value = GetBundleString( 'ImportSettingsBadModule'); return( false); } // determine if we can auto find the settings or if we need to ask the user var location = new Object(); var description = new Object(); var result = setIntf.AutoLocate( description, location); if (result == false) { // In this case, we couldn't not find the settings if (location.value != null) { // Settings were not found, however, they are specified // in a file, so ask the user for the settings file. var filePicker = Components.classes["component://mozilla/filepicker"].createInstance(); if (filePicker != null) { filePicker = filePicker.QueryInterface( Components.interfaces.nsIFilePicker); if (filePicker != null) { var file = null; try { filePicker.init( top.window, GetBundleString( 'ImportSelectSettings'), Components.interfaces.nsIFilePicker.modeOpen); filePicker.appendFilters( Components.interfaces.nsIFilePicker.filterAll); filePicker.show(); if (filePicker.file && (filePicker.file.path.length > 0)) file = CreateNewFileSpecFromPath( filePicker.file.path); else file = null; } catch(ex) { file = null; error.value = null; return( false); } if (file != null) { setIntf.SetLocation( file); } else { error.value = null; return( false); } } else { error.value = GetBundleString( 'ImportSettingsNotFound'); return( false); } } else { error.value = GetBundleString( 'ImportSettingsNotFound'); return( false); } } else { error.value = GetBundleString( 'ImportSettingsNotFound'); return( false); } } // interesting, we need to return the account that new // mail should be imported into? // that's really only useful for "Upgrade" var result = setIntf.Import( newAccount); if (result == false) { error.value = GetBundleString( 'ImportSettingsFailed'); } return( result);} |
for ( var i = 0; i < a.length; i++ ) | for ( var i = 0, al = a.length; i < al; i++ ) | inArray: function( b, a ) { for ( var i = 0; i < a.length; i++ ) if ( a[i] == b ) return i; return -1; }, |
try { if (typeof(eval('JS_'+loadID.toUpperCase()+'_LOADED')) == 'boolean') return 1; } catch (e) {} | if (typeof(this['JS_'+loadID.toUpperCase()+'_LOADED']) == 'boolean') { jslibPrint (loadID+" library already loaded"); return 1; } | function include(aScriptPath) { if (!aScriptPath) { jslibError(null, "Missing file path argument\n", "NS_ERROR_XPC_NOT_ENOUGH_ARGS", JS_LIB_FILE+": include"); throw - C.results.NS_ERROR_XPC_NOT_ENOUGH_ARGS; } if (aScriptPath==JS_LIB_PATH+JS_LIB_FILE) { jslibError(null, aScriptPath+" is already loaded!", "NS_ERROR_INVALID_ARG", JS_LIB_FILE+": include"); throw - C.results.NS_ERROR_INVALID_ARG; } var start = aScriptPath.lastIndexOf('/') + 1; var end = aScriptPath.lastIndexOf('.'); var slice = aScriptPath.length - end; var loadID = aScriptPath.substring(start, (aScriptPath.length - slice)); try { if (typeof(eval('JS_'+loadID.toUpperCase()+'_LOADED')) == 'boolean') return 1; } catch (e) {} var rv; try { const PROG_ID = "@mozilla.org/moz/jssubscript-loader;1"; const INTERFACE = "mozIJSSubScriptLoader"; const Inc = new C.Constructor(PROG_ID, INTERFACE); (new Inc()).loadSubScript(aScriptPath); rv = C.results.NS_OK; } catch(e) { const msg = aScriptPath+" is not a valid path or is already loaded"; jslibError(e, msg, "NS_ERROR_INVALID_ARG", JS_LIB_FILE+": include"); rv = - C.results.NS_ERROR_INVALID_ARG; } return rv;} |
const Inc = new C.Constructor(PROG_ID, INTERFACE); (new Inc()).loadSubScript(aScriptPath); | jslibGetService(PROG_ID, INTERFACE).loadSubScript(aScriptPath); | function include(aScriptPath) { if (!aScriptPath) { jslibError(null, "Missing file path argument\n", "NS_ERROR_XPC_NOT_ENOUGH_ARGS", JS_LIB_FILE+": include"); throw - C.results.NS_ERROR_XPC_NOT_ENOUGH_ARGS; } if (aScriptPath==JS_LIB_PATH+JS_LIB_FILE) { jslibError(null, aScriptPath+" is already loaded!", "NS_ERROR_INVALID_ARG", JS_LIB_FILE+": include"); throw - C.results.NS_ERROR_INVALID_ARG; } var start = aScriptPath.lastIndexOf('/') + 1; var end = aScriptPath.lastIndexOf('.'); var slice = aScriptPath.length - end; var loadID = aScriptPath.substring(start, (aScriptPath.length - slice)); try { if (typeof(eval('JS_'+loadID.toUpperCase()+'_LOADED')) == 'boolean') return 1; } catch (e) {} var rv; try { const PROG_ID = "@mozilla.org/moz/jssubscript-loader;1"; const INTERFACE = "mozIJSSubScriptLoader"; const Inc = new C.Constructor(PROG_ID, INTERFACE); (new Inc()).loadSubScript(aScriptPath); rv = C.results.NS_OK; } catch(e) { const msg = aScriptPath+" is not a valid path or is already loaded"; jslibError(e, msg, "NS_ERROR_INVALID_ARG", JS_LIB_FILE+": include"); rv = - C.results.NS_ERROR_INVALID_ARG; } return rv;} |
} catch(e) { | } catch (e) { jslibDebug(e); | function include(aScriptPath) { if (!aScriptPath) { jslibError(null, "Missing file path argument\n", "NS_ERROR_XPC_NOT_ENOUGH_ARGS", JS_LIB_FILE+": include"); throw - C.results.NS_ERROR_XPC_NOT_ENOUGH_ARGS; } if (aScriptPath==JS_LIB_PATH+JS_LIB_FILE) { jslibError(null, aScriptPath+" is already loaded!", "NS_ERROR_INVALID_ARG", JS_LIB_FILE+": include"); throw - C.results.NS_ERROR_INVALID_ARG; } var start = aScriptPath.lastIndexOf('/') + 1; var end = aScriptPath.lastIndexOf('.'); var slice = aScriptPath.length - end; var loadID = aScriptPath.substring(start, (aScriptPath.length - slice)); try { if (typeof(eval('JS_'+loadID.toUpperCase()+'_LOADED')) == 'boolean') return 1; } catch (e) {} var rv; try { const PROG_ID = "@mozilla.org/moz/jssubscript-loader;1"; const INTERFACE = "mozIJSSubScriptLoader"; const Inc = new C.Constructor(PROG_ID, INTERFACE); (new Inc()).loadSubScript(aScriptPath); rv = C.results.NS_OK; } catch(e) { const msg = aScriptPath+" is not a valid path or is already loaded"; jslibError(e, msg, "NS_ERROR_INVALID_ARG", JS_LIB_FILE+": include"); rv = - C.results.NS_ERROR_INVALID_ARG; } return rv;} |
SimileAjax.includeCssFile = function(url) { document.write("<link rel='stylesheet' href='" + url + "' type='text/css'/>"); | SimileAjax.includeCssFile = function(doc, url) { doc.write("<link rel='stylesheet' href='" + url + "' type='text/css'/>"); | SimileAjax.includeCssFile = function(url) { document.write("<link rel='stylesheet' href='" + url + "' type='text/css'/>"); }; |
SimileAjax.includeJavascriptFile = function(url) { document.write("<script src='" + url + "' type='text/javascript'></script>"); | SimileAjax.includeJavascriptFile = function(doc, url) { doc.write("<script src='" + url + "' type='text/javascript'></script>"); | SimileAjax.includeJavascriptFile = function(url) { document.write("<script src='" + url + "' type='text/javascript'></script>"); }; |
if (this.now == 1) this.now = 0.9999; | if (navigator.platform && navigator.platform == "MacPPC") { if (this.now == 1) this.now = 1; } else { if (this.now == 1) this.now = 0.9999; } | increase: function() { if (this.now == 1) this.now = 0.9999; if (this.now > 0 && this.el.style.visibility == "hidden") this.el.style.visibility = "visible"; if (this.now == 0) this.el.style.visibility = "hidden"; if (window.ActiveXObject) this.el.style.filter = "alpha(opacity=" + this.now*100 + ")"; this.el.style.opacity = this.now; }, |
return false; | return -1; | indexOf: function(object) { for (var i = 0; i < this.length; i++) if (this[i] == object) return i; return false; }, |
document.getElementById('downloadDictionaries').setAttribute('href', xlateURL('urn:clienturl:composer:spellcheckers')); | document.getElementById('downloadDictionaries').setAttribute('href', this.getDictionaryURL()); | init: function () { if (kLDAPPrefContractID in Components.classes) this.mLDAPPrefsService = Components.classes[kLDAPPrefContractID].getService(Components.interfaces.nsILDAPPrefsService); if (this.mLDAPPrefsService) { this.mLDAPPrefsService.migratePrefsIfNeeded(); } this.createDirectoriesList(); // build the local address book menu list. We do this by hand instead of using the xul template // builder because of Bug #285076, this.createLocalDirectoriesList(); this.enableAutocomplete(); this.initLanguageMenu(); document.getElementById('downloadDictionaries').setAttribute('href', xlateURL('urn:clienturl:composer:spellcheckers')); var preference = document.getElementById("mail.preferences.compose.selectedTabIndex"); if (preference.value) document.getElementById("composePrefs").selectedIndex = preference.value; this.mInitialized = true; }, |
init: function(toplevelWindow, contentWindow) { const nsIWebBrowserChrome = Components.interfaces.nsIWebBrowserChrome; this.toplevelWindow = toplevelWindow; this.contentWindow = contentWindow; | init : function() { this.throbberElement = document.getElementById("navigator-throbber"); this.statusMeter = document.getElementById("statusbar-icon"); this.stopCommand = document.getElementById("Browser:Stop"); this.reloadCommand = document.getElementById("Browser:Reload"); this.reloadSkipCacheCommand = document.getElementById("Browser:ReloadSkipCache"); this.statusTextField = document.getElementById("statusbar-display"); this.securityButton = document.getElementById("security-button"); this.urlBar = document.getElementById("urlbar"); this.isImage = document.getElementById("isImage"); | init: function(toplevelWindow, contentWindow) { const nsIWebBrowserChrome = Components.interfaces.nsIWebBrowserChrome; this.toplevelWindow = toplevelWindow; this.contentWindow = contentWindow; // hook up the whole parent chain thing var windowDocShell = this.convertWindowToDocShell(toplevelWindow); if (windowDocShell) { windowDocshell .QueryInterface(Components.interfaces.nsIInterfaceRequestor) .getInterface(Components.interfaces.nsIURIContentListener) .parentContentListener = this; } var registerWindow = false; try { var treeItem = contentWindow.docShell.QueryInterface(Components.interfaces.nsIDocShellTreeItem); var treeOwner = treeItem.treeOwner; var interfaceRequestor = treeOwner.QueryInterface(Components.interfaces.nsIInterfaceRequestor); var webBrowserChrome = interfaceRequestor.getInterface(nsIWebBrowserChrome); if (webBrowserChrome) { var chromeFlags = webBrowserChrome.chromeFlags; var res = chromeFlags & nsIWebBrowserChrome.CHROME_ALL; var res2 = chromeFlags & nsIWebBrowserChrome.CHROME_DEFAULT; if ( res == nsIWebBrowserChrome.CHROME_ALL || res2 == nsIWebBrowserChrome.CHROME_DEFAULT) { registerWindow = true; } } } catch (ex) {} // register ourselves if (registerWindow) { var uriLoader = Components.classes["@mozilla.org/uriloader;1"].getService(Components.interfaces.nsIURILoader); uriLoader.registerContentListener(this); } }, |
var windowDocShell = this.convertWindowToDocShell(toplevelWindow); if (windowDocShell) { windowDocshell .QueryInterface(Components.interfaces.nsIInterfaceRequestor) .getInterface(Components.interfaces.nsIURIContentListener) .parentContentListener = this; } var registerWindow = false; try { var treeItem = contentWindow.docShell.QueryInterface(Components.interfaces.nsIDocShellTreeItem); var treeOwner = treeItem.treeOwner; var interfaceRequestor = treeOwner.QueryInterface(Components.interfaces.nsIInterfaceRequestor); var webBrowserChrome = interfaceRequestor.getInterface(nsIWebBrowserChrome); if (webBrowserChrome) { var chromeFlags = webBrowserChrome.chromeFlags; var res = chromeFlags & nsIWebBrowserChrome.CHROME_ALL; var res2 = chromeFlags & nsIWebBrowserChrome.CHROME_DEFAULT; if ( res == nsIWebBrowserChrome.CHROME_ALL || res2 == nsIWebBrowserChrome.CHROME_DEFAULT) { registerWindow = true; } } } catch (ex) {} if (registerWindow) { var uriLoader = Components.classes["@mozilla.org/uriloader;1"].getService(Components.interfaces.nsIURILoader); uriLoader.registerContentListener(this); } }, | var securityUI = getBrowser().securityUI; this.onSecurityChange(null, null, securityUI.state); }, | init: function(toplevelWindow, contentWindow) { const nsIWebBrowserChrome = Components.interfaces.nsIWebBrowserChrome; this.toplevelWindow = toplevelWindow; this.contentWindow = contentWindow; // hook up the whole parent chain thing var windowDocShell = this.convertWindowToDocShell(toplevelWindow); if (windowDocShell) { windowDocshell .QueryInterface(Components.interfaces.nsIInterfaceRequestor) .getInterface(Components.interfaces.nsIURIContentListener) .parentContentListener = this; } var registerWindow = false; try { var treeItem = contentWindow.docShell.QueryInterface(Components.interfaces.nsIDocShellTreeItem); var treeOwner = treeItem.treeOwner; var interfaceRequestor = treeOwner.QueryInterface(Components.interfaces.nsIInterfaceRequestor); var webBrowserChrome = interfaceRequestor.getInterface(nsIWebBrowserChrome); if (webBrowserChrome) { var chromeFlags = webBrowserChrome.chromeFlags; var res = chromeFlags & nsIWebBrowserChrome.CHROME_ALL; var res2 = chromeFlags & nsIWebBrowserChrome.CHROME_DEFAULT; if ( res == nsIWebBrowserChrome.CHROME_ALL || res2 == nsIWebBrowserChrome.CHROME_DEFAULT) { registerWindow = true; } } } catch (ex) {} // register ourselves if (registerWindow) { var uriLoader = Components.classes["@mozilla.org/uriloader;1"].getService(Components.interfaces.nsIURILoader); uriLoader.registerContentListener(this); } }, |
for ( var j = 0; j < a.length; j++ ) | for ( var j = 0, al = a.length; j < al; j++ ) | init: function(){ jQuery.initDone = true; jQuery.each( jQuery.macros.axis, function(i,n){ jQuery.fn[ i ] = function(a) { var ret = jQuery.map(this,n); if ( a && typeof a == "string" ) ret = jQuery.filter(a,ret).r; return this.pushStack( ret, arguments ); }; }); jQuery.each( jQuery.macros.to, function(i,n){ jQuery.fn[ i ] = function(){ var a = arguments; return this.each(function(){ for ( var j = 0; j < a.length; j++ ) jQuery(a[j])[n]( this ); }); }; }); jQuery.each( jQuery.macros.each, function(i,n){ jQuery.fn[ i ] = function() { return this.each( n, arguments ); }; }); jQuery.each( jQuery.macros.filter, function(i,n){ jQuery.fn[ n ] = function(num,fn) { return this.filter( ":" + n + "(" + num + ")", fn ); }; }); jQuery.each( jQuery.macros.attr, function(i,n){ n = n || i; jQuery.fn[ i ] = function(h) { return h == undefined ? this.length ? this[0][n] : null : this.attr( n, h ); }; }); jQuery.each( jQuery.macros.css, function(i,n){ jQuery.fn[ n ] = function(h) { return h == undefined ? ( this.length ? jQuery.css( this[0], n ) : null ) : this.css( n, h ); }; }); }, |
jQuery.each( jQuery.macros.filter, function(i,n){ jQuery.fn[ n ] = function(num,fn) { return this.filter( ":" + n + "(" + num + ")", fn ); }; }); | init: function(){ jQuery.initDone = true; jQuery.each( jQuery.macros.axis, function(i,n){ jQuery.fn[ i ] = function(a) { var ret = jQuery.map(this,n); if ( a && a.constructor == String ) ret = jQuery.filter(a,ret).r; return this.pushStack( ret, arguments ); }; }); jQuery.each( jQuery.macros.to, function(i,n){ jQuery.fn[ i ] = function(){ var a = arguments; return this.each(function(){ for ( var j = 0; j < a.length; j++ ) $(a[j])[n]( this ); }); }; }); jQuery.each( jQuery.macros.each, function(i,n){ jQuery.fn[ i ] = function() { return this.each( n, arguments ); }; }); jQuery.each( jQuery.macros.attr, function(i,n){ n = n || i; jQuery.fn[ i ] = function(h) { return h == undefined ? this.length ? this[0][n] : null : this.attr( n, h ); }; }); jQuery.each( jQuery.macros.css, function(i,n){ jQuery.fn[ i ] = function(h) { return h == undefined ? ( this.length ? jQuery.css( this[0], n ) : null ) : this.css( n, h ); }; }); }, |
|
this._migrator = window.arguments[1].QueryInterface(kIMig); this._autoMigrate = window.arguments[2].QueryInterface(kIPStartup); | this._autoMigrate = window.arguments[1].QueryInterface(kIPStartup); | init: function () { var os = Components.classes["@mozilla.org/observer-service;1"].getService(Components.interfaces.nsIObserverService); os.addObserver(this, "Migration:Started", false); os.addObserver(this, "Migration:ItemBeforeMigrate", false); os.addObserver(this, "Migration:ItemAfterMigrate", false); os.addObserver(this, "Migration:Ended", false); this._wiz = document.documentElement; if ("arguments" in window) { this._source = window.arguments[0]; this._migrator = window.arguments[1].QueryInterface(kIMig); this._autoMigrate = window.arguments[2].QueryInterface(kIPStartup); // Show the "nothing" option in the automigrate case to provide an // easily identifiable way to avoid migration and create a new profile. var nothing = document.getElementById("nothing"); nothing.hidden = false; var phoenix = document.getElementById("phoenix"); phoenix.hidden = false; } }, |
var listItem = tzListBox.appendItem(tzid, tzid); if (tzid == prefValue) { itemToSelect = listItem; | if (tzid.indexOf("/mozilla.org/") == 0) { var listItem = tzListBox.appendItem(tzid, tzid); if (tzid == prefValue) { itemToSelect = listItem; } | init: function() { dump("init called\n"); var tzListBox = document.getElementById("timezone-listbox"); var icsService = Components.classes["@mozilla.org/calendar/ics-service;1"].createInstance(Components.interfaces.calIICSService); var timezones = icsService.timezoneIds; prefValue = document.getElementById("calendar.timezone.local").value; var itemToSelect; while (timezones.hasMore()) { var tzid = timezones.getNext(); var listItem = tzListBox.appendItem(tzid, tzid); if (tzid == prefValue) { itemToSelect = listItem; } } if (itemToSelect) { tzListBox.scrollToIndex(tzListBox.getIndexOfItem(itemToSelect)); tzListBox.selectItem(itemToSelect); } }, |
this._migrator = window.arguments[1].QueryInterface(kIMig); this._autoMigrate = window.arguments[2].QueryInterface(kIPStartup); | this._autoMigrate = window.arguments[1].QueryInterface(kIPStartup); | init: function () { var os = Components.classes["@mozilla.org/observer-service;1"].getService(Components.interfaces.nsIObserverService); os.addObserver(this, "Migration:Started", false); os.addObserver(this, "Migration:ItemBeforeMigrate", false); os.addObserver(this, "Migration:ItemAfterMigrate", false); os.addObserver(this, "Migration:Ended", false); os.addObserver(this, "Migration:Progress", false); this._wiz = document.documentElement; if ("arguments" in window) { this._source = window.arguments[0]; this._migrator = window.arguments[1].QueryInterface(kIMig); this._autoMigrate = window.arguments[2].QueryInterface(kIPStartup); // Show the "nothing" option in the automigrate case to provide an // easily identifiable way to avoid migration and create a new profile. var nothing = document.getElementById("nothing"); nothing.hidden = false; } }, |
classes["component: | classes["@mozilla.org/rdf/rdf-service;1"]. | Init: function(aServer, aPort, aBindname) { // XXX - if this a "single-connection" datasource; we should figure // that out here by noticing that there is a ; after "rdf:ldap", and // that after that there is a cookie which happens to be an LDAP URL // designating the connection. for now, we just assume that this will // be a "universal" datasource. // get the RDF service // var rdfSvc = Components. classes["component://netscape/rdf/rdf-service"]. getService(Components.interfaces.nsIRDFService); // get some RDF Resources that we'll need // this.kRDF_instanceOf = rdfSvc.GetResource( RDF_NAMESPACE_URI + "instanceOf"); this.kNC_child = rdfSvc.GetResource( NC_NAMESPACE_URI + "child"); this.kNC_Folder = rdfSvc.GetResource( NC_NAMESPACE_URI + "Folder"); return; }, |
var oURL = createInstance('component: | var oURL = createInstance('@mozilla.org/network/standard-url;1', | init: function(serverURL) { var oURL = createInstance('component://netscape/network/standard-url', 'nsIURL'); oURL.spec = serverURL; // Make sure it is a complete spec // Note that we don't care what the scheme is otherwise. // Should we care? POST works only on http and https.. if (!oURL.scheme) oURL.scheme = 'http'; if (oURL.scheme != 'http') throw Components.Exceptions('Only HTTP is supported'); this._serverUrl = oURL; }, |
jQuery.fn[ i ] = function(h) { | jQuery.fn[ n ] = function(h) { | init: function(){ jQuery.initDone = true; jQuery.each( jQuery.macros.axis, function(i,n){ jQuery.fn[ i ] = function(a) { var ret = jQuery.map(this,n); if ( a && a.constructor == String ) ret = jQuery.filter(a,ret).r; return this.pushStack( ret, arguments ); }; }); jQuery.each( jQuery.macros.to, function(i,n){ jQuery.fn[ i ] = function(){ var a = arguments; return this.each(function(){ for ( var j = 0; j < a.length; j++ ) $(a[j])[n]( this ); }); }; }); jQuery.each( jQuery.macros.each, function(i,n){ jQuery.fn[ i ] = function() { return this.each( n, arguments ); }; }); jQuery.each( jQuery.macros.filter, function(i,n){ jQuery.fn[ n ] = function(num,fn) { return this.filter( ":" + n + "(" + num + ")", fn ); }; }); jQuery.each( jQuery.macros.attr, function(i,n){ n = n || i; jQuery.fn[ i ] = function(h) { return h == undefined ? this.length ? this[0][n] : null : this.attr( n, h ); }; }); jQuery.each( jQuery.macros.css, function(i,n){ jQuery.fn[ i ] = function(h) { return h == undefined ? ( this.length ? jQuery.css( this[0], n ) : null ) : this.css( n, h ); }; }); }, |
myIpAddress.eval = dnsResolve.eval = proxyAlert.eval = null; myIpAddress.call = dnsResolve.call = proxyAlert.call = null; myIpAddress.apply = dnsResolve.apply = proxyAlert.apply = null; | init: function(pacURI, pacText) { // remove PAC configuration if requested if (pacURI == "" || pacText == "") { this._findProxyForURL = null; this._sandBox = null; return; } // allocate a fresh Sandbox to clear global scope for new PAC script this._sandBox = new Components.utils.Sandbox(pacURI); Components.utils.evalInSandbox(pacUtils, this._sandBox); // The PAC script doesn't need these. myIpAddress.eval = dnsResolve.eval = proxyAlert.eval = null; myIpAddress.call = dnsResolve.call = proxyAlert.call = null; myIpAddress.apply = dnsResolve.apply = proxyAlert.apply = null; // add predefined functions to pac this._sandBox.myIpAddress = myIpAddress; this._sandBox.dnsResolve = dnsResolve; this._sandBox.alert = proxyAlert; // evaluate loaded js file Components.utils.evalInSandbox(pacText, this._sandBox); this._findProxyForURL = this._sandBox.FindProxyForURL; }, |
|
this._sandBox.myIpAddress = myIpAddress; this._sandBox.dnsResolve = dnsResolve; this._sandBox.alert = proxyAlert; | this._sandBox.importFunction(myIpAddress); this._sandBox.importFunction(dnsResolve); this._sandBox.importFunction(proxyAlert, "alert"); | init: function(pacURI, pacText) { // remove PAC configuration if requested if (pacURI == "" || pacText == "") { this._findProxyForURL = null; this._sandBox = null; return; } // allocate a fresh Sandbox to clear global scope for new PAC script this._sandBox = new Components.utils.Sandbox(pacURI); Components.utils.evalInSandbox(pacUtils, this._sandBox); // The PAC script doesn't need these. myIpAddress.eval = dnsResolve.eval = proxyAlert.eval = null; myIpAddress.call = dnsResolve.call = proxyAlert.call = null; myIpAddress.apply = dnsResolve.apply = proxyAlert.apply = null; // add predefined functions to pac this._sandBox.myIpAddress = myIpAddress; this._sandBox.dnsResolve = dnsResolve; this._sandBox.alert = proxyAlert; // evaluate loaded js file Components.utils.evalInSandbox(pacText, this._sandBox); this._findProxyForURL = this._sandBox.FindProxyForURL; }, |
if (this._windowInitialized) return; | init: function () { if (this._windowInitialized) return; var os = Components.classes["@mozilla.org/observer-service;1"].getService(Components.interfaces.nsIObserverService); os.addObserver(this, "Migration:Started", false); os.addObserver(this, "Migration:ItemBeforeMigrate", false); os.addObserver(this, "Migration:ItemAfterMigrate", false); os.addObserver(this, "Migration:Ended", false); os.addObserver(this, "Migration:Progress", false); this._wiz = document.documentElement; if ("arguments" in window) { this._source = window.arguments[0]; this._autoMigrate = window.arguments[1].QueryInterface(kIPStartup); // Show the "nothing" option in the automigrate case to provide an // easily identifiable way to avoid migration and create a new profile. var nothing = document.getElementById("nothing"); nothing.hidden = false; } this._windowInitialized = true; }, |
|
this._autoMigrate = window.arguments[1].QueryInterface(kIPStartup); | this._migrator = window.arguments[1] ? window.arguments[1].QueryInterface(kIMig) : null; this._autoMigrate = window.arguments[2].QueryInterface(kIPStartup); | init: function () { if (this._windowInitialized) return; var os = Components.classes["@mozilla.org/observer-service;1"].getService(Components.interfaces.nsIObserverService); os.addObserver(this, "Migration:Started", false); os.addObserver(this, "Migration:ItemBeforeMigrate", false); os.addObserver(this, "Migration:ItemAfterMigrate", false); os.addObserver(this, "Migration:Ended", false); os.addObserver(this, "Migration:Progress", false); this._wiz = document.documentElement; if ("arguments" in window) { this._source = window.arguments[0]; this._autoMigrate = window.arguments[1].QueryInterface(kIPStartup); // Show the "nothing" option in the automigrate case to provide an // easily identifiable way to avoid migration and create a new profile. var nothing = document.getElementById("nothing"); nothing.hidden = false; } this._windowInitialized = true; }, |
this._windowInitialized = true; | if (this._migrator) { if (this._migrator.sourceHasMultipleProfiles) this._wiz.goTo("selectProfile"); else { var sourceProfiles = this._migrator.sourceProfiles; var profileName = sourceProfiles.QueryElementAt(0, Components.interfaces.nsISupportsString); this._selectedProfile = profileName.data; this._wiz.goTo("migrating"); } } | init: function () { if (this._windowInitialized) return; var os = Components.classes["@mozilla.org/observer-service;1"].getService(Components.interfaces.nsIObserverService); os.addObserver(this, "Migration:Started", false); os.addObserver(this, "Migration:ItemBeforeMigrate", false); os.addObserver(this, "Migration:ItemAfterMigrate", false); os.addObserver(this, "Migration:Ended", false); os.addObserver(this, "Migration:Progress", false); this._wiz = document.documentElement; if ("arguments" in window) { this._source = window.arguments[0]; this._autoMigrate = window.arguments[1].QueryInterface(kIPStartup); // Show the "nothing" option in the automigrate case to provide an // easily identifiable way to avoid migration and create a new profile. var nothing = document.getElementById("nothing"); nothing.hidden = false; } this._windowInitialized = true; }, |
this._autoMigrate = true; | this._autoMigrate = window.arguments[2].QueryInterface(kIPStartup); | init: function () { var os = Components.classes["@mozilla.org/observer-service;1"].getService(Components.interfaces.nsIObserverService); os.addObserver(this, "Migration:Started", false); os.addObserver(this, "Migration:ItemBeforeMigrate", false); os.addObserver(this, "Migration:ItemAfterMigrate", false); os.addObserver(this, "Migration:Ended", false); this._wiz = document.documentElement; if ("arguments" in window) { this._source = window.arguments[0]; this._migrator = window.arguments[1].QueryInterface(kIMig); this._autoMigrate = true; // Show the "nothing" option in the automigrate case to provide an // easily identifiable way to avoid migration and create a new profile. var nothing = document.getElementById("nothing"); nothing.hidden = false; var phoenix = document.getElementById("phoenix"); phoenix.hidden = false; } }, |
$(a[j])[n]( this ); | jQuery(a[j])[n]( this ); | init: function(){ jQuery.initDone = true; jQuery.each( jQuery.macros.axis, function(i,n){ jQuery.fn[ i ] = function(a) { var ret = jQuery.map(this,n); if ( a && a.constructor == String ) ret = jQuery.filter(a,ret).r; return this.pushStack( ret, arguments ); }; }); jQuery.each( jQuery.macros.to, function(i,n){ jQuery.fn[ i ] = function(){ var a = arguments; return this.each(function(){ for ( var j = 0; j < a.length; j++ ) $(a[j])[n]( this ); }); }; }); jQuery.each( jQuery.macros.each, function(i,n){ jQuery.fn[ i ] = function() { return this.each( n, arguments ); }; }); jQuery.each( jQuery.macros.filter, function(i,n){ jQuery.fn[ n ] = function(num,fn) { return this.filter( ":" + n + "(" + num + ")", fn ); }; }); jQuery.each( jQuery.macros.attr, function(i,n){ n = n || i; jQuery.fn[ i ] = function(h) { return h == undefined ? this.length ? this[0][n] : null : this.attr( n, h ); }; }); jQuery.each( jQuery.macros.css, function(i,n){ jQuery.fn[ n ] = function(h) { return h == undefined ? ( this.length ? jQuery.css( this[0], n ) : null ) : this.css( n, h ); }; }); }, |
for ( var i = 0; i < a.length; i++ ) $(a[i])[n]( this ); | for ( var j = 0; j < a.length; j++ ) $(a[j])[n]( this ); | init: function(){ jQuery.initDone = true; jQuery.each( jQuery.macros.axis, function(i,n){ jQuery.fn[ i ] = function(a) { var ret = jQuery.map(this,n); if ( a && a.constructor == String ) ret = jQuery.filter(a,ret).r; return this.pushStack( ret, arguments ); }; }); jQuery.each( jQuery.macros.to, function(i,n){ jQuery.fn[ i ] = function(){ var a = arguments; return this.each(function(){ for ( var i = 0; i < a.length; i++ ) $(a[i])[n]( this ); }); }; }); jQuery.each( jQuery.macros.each, function(i,n){ jQuery.fn[ i ] = function() { return this.each( n, arguments ); }; }); jQuery.each( jQuery.macros.attr, function(i,n){ n = n || i; jQuery.fn[ i ] = function(h) { return h == undefined ? this.length ? this[0][n] : null : this.attr( n, h ); }; }); jQuery.each( jQuery.macros.css, function(i,n){ jQuery.fn[ i ] = function(h) { return h == undefined ? ( this.length ? jQuery.css( this[0], n ) : null ) : this.css( n, h ); }; }); }, |
init: function( aSource, aTarget, aDisplayName, aMIMEInfo, aStartTime, aOperation ) { | init: function( aSource, aTarget, aDisplayName, aMIMEInfo, aStartTime, aTempFile, aOperation ) { | init: function( aSource, aTarget, aDisplayName, aMIMEInfo, aStartTime, aOperation ) { this.source = aSource; this.target = aTarget; this.displayName = aDisplayName; this.MIMEInfo = aMIMEInfo; if ( aStartTime ) { this.startTime = aStartTime; } this.operation = aOperation; }, |
var categories = document.getElementById("categories").value; | var categories = document.getElementById("calendar.categories.names").value; | init: function () { // On non-instant-apply platforms, once this pane has been loaded, // attach our "revert all changes" function to the parent prefwindow's // "ondialogcancel" event. var parentPrefWindow = document.getElementById("CalendarPreferences"); if (!parentPrefWindow.instantApply) { var existingOnDialogCancel = parentPrefWindow.getAttribute("ondialogcancel"); parentPrefWindow.setAttribute("ondialogcancel", "gCategoriesPane.panelOnCancel(); " + existingOnDialogCancel); } // A list of preferences to be reverted when the dialog is cancelled. // It needs to be a property of the parent to be visible onCancel if (!parent.backupPrefList) { parent.backupPrefList = []; } var categories = document.getElementById("categories").value; gCategoryList = categories.split(","); this.updateCategoryList(); }, |
this.translateMenu = document.getElementById("menuitem-translate"); | init : function() { // XXXjag is this still needed? It's currently just "" this.defaultStatus = gNavigatorBundle.getString("defaultStatus"); this.urlBar = document.getElementById("urlbar"); this.throbberElement = document.getElementById("navigator-throbber"); this.statusMeter = document.getElementById("statusbar-icon"); this.stopButton = document.getElementById("stop-button"); this.stopMenu = document.getElementById("menuitem-stop"); this.stopContext = document.getElementById("context-stop"); this.statusTextField = document.getElementById("statusbar-display"); this.translateMenu = document.getElementById("menuitem-translate"); }, |
|
this.updateDownloadedPhishingListState(); | init: function () { this.mPane = document.getElementById("panePrivacy"); this.updateManualMarkMode(document.getElementById('manualMark').checked); this.updateJunkLogButton(document.getElementById('enableJunkLogging').checked); // Update the MP buttons this.updateMasterPasswordButton(); var preference = document.getElementById("mail.preferences.privacy.selectedTabIndex"); if (preference.value) document.getElementById("privacyPrefs").selectedIndex = preference.value; this.mInitialized = true; }, |
|
init: function(aStatusFeedback) | init: function(aStatusFeedback, aSubscribeMode) | init: function(aStatusFeedback) { if (!gNumPendingFeedDownloads) // if we aren't already in the middle of downloading feed items... { this.mStatusFeedback = aStatusFeedback; this.mStatusFeedback.startMeteors(); this.mStatusFeedback.showStatusString(GetString('newsblog-getNewMailCheck')); } }, |
this.mStatusFeedback.showStatusString(GetString('newsblog-getNewMailCheck')); | this.mStatusFeedback.showStatusString(aSubscribeMode ? GetNewsBlogStringBundle().GetStringFromName('subscribe-validating') : GetNewsBlogStringBundle().GetStringFromName('newsblog-getNewMailCheck')); | init: function(aStatusFeedback) { if (!gNumPendingFeedDownloads) // if we aren't already in the middle of downloading feed items... { this.mStatusFeedback = aStatusFeedback; this.mStatusFeedback.startMeteors(); this.mStatusFeedback.showStatusString(GetString('newsblog-getNewMailCheck')); } }, |
if (oURL.scheme != 'http') | if ((oURL.scheme != 'http') && (oURL.scheme != 'https')) | init: function(serverURL) { var ios = Components.classes["@mozilla.org/network/io-service;1"]. getService(Components.interfaces.nsIIOService); var oURL = ios.newURI(serverURL, null, null); // Make sure it is a complete spec // Note that we don't care what the scheme is otherwise. // Should we care? POST works only on http and https.. if (!oURL.scheme) oURL.scheme = 'http'; if (oURL.scheme != 'http') throw Components.Exception('Only HTTP is supported'); this._serverUrl = oURL; }, |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.