rem
stringlengths
0
126k
add
stringlengths
0
441k
context
stringlengths
15
136k
appCore.Init( coreName );
appCore.Init( appCoreName );
function StartupViewSource() { // Generate unique name. coreName = "ViewSource." + ( new Date() ).getTime().toString(); // Create and initialize the browser app core. appCore = new BrowserAppCore(); appCore.Init( coreName ); appCore.setContentWindow(window.frames[0]); appCore.setWebShellWindow(window); appCore.setToolbarWindow(window); // Get url whose source to view. var url = document.getElementById("args").getAttribute("value"); // Load the source (the app core will magically know what to do). XPAppCoresManager.Find( coreName ).loadUrl(url); }
XPAppCoresManager.Find( coreName ).loadUrl(url);
appCore.loadUrl(url);
function StartupViewSource() { // Generate unique name. coreName = "ViewSource." + ( new Date() ).getTime().toString(); // Create and initialize the browser app core. appCore = new BrowserAppCore(); appCore.Init( coreName ); appCore.setContentWindow(window.frames[0]); appCore.setWebShellWindow(window); appCore.setToolbarWindow(window); // Get url whose source to view. var url = document.getElementById("args").getAttribute("value"); // Load the source (the app core will magically know what to do). XPAppCoresManager.Find( coreName ).loadUrl(url); }
window.title = "xmlterm: "+window.arguments;
document.title = "xmlterm: "+window.arguments;
function StartupXMLTerm() { //dump("StartupXMLTerm:"+window.frames.length+"\n"); //dump("StartupXMLTerm:"+window.frames[0].name+"\n"); if (window.frames.length == 2) { xmltwin = window.frames[1]; xmltwin.xmltbrowser = window.frames[0]; } else { xmltwin = window.frames[0]; } // Determine telnet URL, if any, from query portion of chrome URL // For security reasons, only the protocol/host portion of the URL should be // used to open a new connection var url = ""; if (document.location.search) { url = document.location.search.substr(1); } //dump("StartupXMLterm: URL="+url+"\n"); //dump("StartupXMLterm: WINDOW.ARGUMENTS="+window.arguments+"\n"); dump("Trying to make an XMLTerm Shell through the component manager...\n"); var xmltshell = Components.classes["@mozilla.org/xmlterm/xmltermshell;1"].createInstance(); xmltshell = xmltshell.QueryInterface(Components.interfaces.mozIXMLTermShell); //dump("Interface xmltshell2 = " + xmltshell + "\n"); if (!xmltshell) { dump("Failed to create XMLTerm shell\n"); window.close(); return; } // Store the XMLTerm shell in current window and in the XMLTerm frame window.xmlterm = xmltshell; xmltwin.xmlterm = xmltshell; if (window.arguments != null) window.title = "xmlterm: "+window.arguments; // Initialize XMLTerm shell in content window with argvals window.xmlterm.init(xmltwin, "", window.arguments);}
var xmltshell = Components.classes["component:
var xmltshell = Components.classes["@mozilla.org/xmlterm/xmltermshell;1"].createInstance();
function StartupXMLTerm() { dump("StartupXMLTerm:\n"); dump("StartupXMLTerm:"+window.frames.length+"\n"); dump("StartupXMLTerm:"+window.frames[0].name+"\n"); if (window.frames.length == 2) { xmltwin = window.frames[1]; xmltwin.xmltbrowser = window.frames[0]; } else { xmltwin = window.frames[0]; } // Determine telnet URL, if any, from query portion of chrome URL // For security reasons, only the protocol/host portion of the URL should be // used to open a new connection var url = ""; if (document.location.search) { url = document.location.search.substr(1); } dump("StartupXMLterm: URL="+url+"\n"); dump("StartupXMLterm: WINDOW.ARGUMENTS="+window.arguments+"\n"); dump("Trying to make an XMLTerm Shell through the component manager...\n"); var xmltshell = Components.classes["component://mozilla/xmlterm/xmltermshell"].createInstance(); dump("Interface xmltshell1 = " + xmltshell + "\n"); xmltshell = xmltshell.QueryInterface(Components.interfaces.mozIXMLTermShell); dump("Interface xmltshell2 = " + xmltshell + "\n"); if (!xmltshell) { dump("Failed to create XMLTerm shell\n"); window.close(); return; } // Store the XMLTerm shell in current window and in the XMLTerm frame window.xmlterm = xmltshell; xmltwin.xmlterm = xmltshell; if (window.arguments != null) window.title = "xmlterm: "+window.arguments; // Initialize XMLTerm shell in content window with argvals window.xmlterm.Init(xmltwin, "", window.arguments);}
var formsArray;
function stateFound(content, threshhold) { var captureStateFound = false; var prefillStateFound = false; if (!content || !content.document) { return {capture: false, prefill: false}; } var document = content.document; if (!("forms" in document)) { // this will occur if document is xul document instead of html document for example return {capture: false, prefill: false}; } // test for wallet service being available if (gWalletService == -1) gWalletService = Components.classes["@mozilla.org/wallet/wallet-service;1"] .getService(Components.interfaces.nsIWalletService); if (!gWalletService) { return {capture: true, prefill: true}; } // process frames if any var formsArray; var framesArray = content.frames; var rv; if (framesArray.length != 0) { var frame; for (frame=0; frame<framesArray.length; ++frame) { // recursively process each frame for additional documents rv = stateFound(framesArray[frame], threshhold); captureStateFound |= rv.capture; prefillStateFound |= rv.prefill; if (captureStateFound && prefillStateFound) { return {capture: true, prefill: true}; } // process the document of this frame var frameContent = framesArray[frame]; if (frameContent.document) { rv = stateFoundInFormsArray(frameContent, threshhold); captureStateFound |= rv.capture; prefillStateFound |= rv.prefill; if (captureStateFound && prefillStateFound) { gIsEncrypted = -1; return {capture: true, prefill: true}; } } } } // process top-level document gIsEncrypted = -1; rv = stateFoundInFormsArray(content, threshhold); captureStateFound |= rv.capture; prefillStateFound |= rv.prefill; if (captureStateFound && prefillStateFound) { return {capture: true, prefill: true}; } // if we got here, then there was no text (or select) element with a value // or there were too few text (or select) elements if (elementCount > threshhold) { // no text (or select) element with a value return rv; } // too few text (or select) elements bestState = {capture: hide, prefill: hide}; return rv; }
if ( z.o.hide ) y.display = 'none';
z.el.curAnim[ prop ] = true; var done = true; for ( var i in z.el.curAnim ) if ( z.el.curAnim[i] !== true ) done = false; if ( done ) { y.overflow = z.el.oldOverflow; if ( z.o.hide ) y.display = 'none'; if ( z.o.hide ) { for ( var p in z.el.curAnim ) { y[ p ] = z.el.orig[p] + ( p == "opacity" ? "" : "px" );
z.step = function(firstNum, lastNum){ var t = (new Date()).getTime(); if (t > z.o.duration + z.startTime) { // Stop the timer clearInterval(z.timer); z.timer = null; z.now = lastNum; z.a(); // Hide the element if the "hide" operation was done if ( z.o.hide ) y.display = 'none'; // Reset the overflow y.overflow = z.el.oldOverflow; // Reset the property, if the item has been hidden if ( z.o.hide ) y[ prop ] = z.el.orig[ prop ].constructor == Number && prop != "opacity" ? z.el.orig[prop] + "px" : z.el.orig[prop]; // set its height and/or width to auto if ( prop == 'height' || prop == 'width' ) jQuery.setAuto( z.el, prop ); // If a callback was provided, execute it if( z.o.complete && z.o.complete.constructor == Function ) // Execute the complete function z.o.complete.apply( z.el ); } else { // Figure out where in the animation we are and set the number var p = (t - this.startTime) / z.o.duration; z.now = ((-Math.cos(p*Math.PI)/2) + 0.5) * (lastNum-firstNum) + firstNum; // Perform the next step of the animation z.a(); } };
y.overflow = z.el.oldOverflow; if ( z.o.hide ) y[ prop ] = z.el.orig[ prop ].constructor == Number && prop != "opacity" ? z.el.orig[prop] + "px" : z.el.orig[prop]; if ( prop == 'height' || prop == 'width' ) jQuery.setAuto( z.el, prop );
if ( p == 'height' || p == 'width' ) jQuery.setAuto( z.el, p ); } } }
z.step = function(firstNum, lastNum){ var t = (new Date()).getTime(); if (t > z.o.duration + z.startTime) { // Stop the timer clearInterval(z.timer); z.timer = null; z.now = lastNum; z.a(); // Hide the element if the "hide" operation was done if ( z.o.hide ) y.display = 'none'; // Reset the overflow y.overflow = z.el.oldOverflow; // Reset the property, if the item has been hidden if ( z.o.hide ) y[ prop ] = z.el.orig[ prop ].constructor == Number && prop != "opacity" ? z.el.orig[prop] + "px" : z.el.orig[prop]; // set its height and/or width to auto if ( prop == 'height' || prop == 'width' ) jQuery.setAuto( z.el, prop ); // If a callback was provided, execute it if( z.o.complete && z.o.complete.constructor == Function ) // Execute the complete function z.o.complete.apply( z.el ); } else { // Figure out where in the animation we are and set the number var p = (t - this.startTime) / z.o.duration; z.now = ((-Math.cos(p*Math.PI)/2) + 0.5) * (lastNum-firstNum) + firstNum; // Perform the next step of the animation z.a(); } };
if( z.o.complete && z.o.complete.constructor == Function )
if( done && z.o.complete && z.o.complete.constructor == Function )
z.step = function(firstNum, lastNum){ var t = (new Date()).getTime(); if (t > z.o.duration + z.startTime) { // Stop the timer clearInterval(z.timer); z.timer = null; z.now = lastNum; z.a(); // Hide the element if the "hide" operation was done if ( z.o.hide ) y.display = 'none'; // Reset the overflow y.overflow = z.el.oldOverflow; // Reset the property, if the item has been hidden if ( z.o.hide ) y[ prop ] = z.el.orig[ prop ].constructor == Number && prop != "opacity" ? z.el.orig[prop] + "px" : z.el.orig[prop]; // set its height and/or width to auto if ( prop == 'height' || prop == 'width' ) jQuery.setAuto( z.el, prop ); // If a callback was provided, execute it if( z.o.complete && z.o.complete.constructor == Function ) // Execute the complete function z.o.complete.apply( z.el ); } else { // Figure out where in the animation we are and set the number var p = (t - this.startTime) / z.o.duration; z.now = ((-Math.cos(p*Math.PI)/2) + 0.5) * (lastNum-firstNum) + firstNum; // Perform the next step of the animation z.a(); } };
z.step = function(f,tt){
z.step = function(firstNum, lastNum){
z.step = function(f,tt){ var t = (new Date()).getTime(); var p = (t - z.s) / z.o.duration; if (t >= z.o.duration+z.s) { z.now = tt; z.clear(); setTimeout(function(){ y.overflow = z.oo; if(y.height=="0px"||y.width=="0px"){z.ss("none");} if ( ty != "opacity" && z.o.auto ) { $.setAuto( z.el, "height" ); $.setAuto( z.el, "width" ); } if(z.o.onComplete.constructor == Function){z.el.$_ = z.o.onComplete;z.el.$_();} },13); } else { z.now = ((-Math.cos(p*Math.PI)/2) + 0.5) * (tt-f) + f; } z.a(); };
var p = (t - z.s) / z.o.duration; if (t >= z.o.duration+z.s) { z.now = tt; z.clear(); setTimeout(function(){ y.overflow = z.oo; if(y.height=="0px"||y.width=="0px"){z.ss("none");} if ( ty != "opacity" && z.o.auto ) { $.setAuto( z.el, "height" ); $.setAuto( z.el, "width" ); } if(z.o.onComplete.constructor == Function){z.el.$_ = z.o.onComplete;z.el.$_();} },13);
if (t > z.o.duration + z.startTime) { clearInterval(z.timer); z.timer = null; y.overflow = z.oldOverflow; if( y.height == "0px" || y.width == "0px" ) { y.display = "none"; } if ( ty != "opacity" && z.o.auto ) { $.setAuto( z.el, 'height' ); $.setAuto( z.el, 'width' ); } if( z.o.onComplete.constructor == Function ) { $.apply( z.el, z.onComplete ); }
z.step = function(f,tt){ var t = (new Date()).getTime(); var p = (t - z.s) / z.o.duration; if (t >= z.o.duration+z.s) { z.now = tt; z.clear(); setTimeout(function(){ y.overflow = z.oo; if(y.height=="0px"||y.width=="0px"){z.ss("none");} if ( ty != "opacity" && z.o.auto ) { $.setAuto( z.el, "height" ); $.setAuto( z.el, "width" ); } if(z.o.onComplete.constructor == Function){z.el.$_ = z.o.onComplete;z.el.$_();} },13); } else { z.now = ((-Math.cos(p*Math.PI)/2) + 0.5) * (tt-f) + f; } z.a(); };
z.now = ((-Math.cos(p*Math.PI)/2) + 0.5) * (tt-f) + f;
var p = (t - this.startTime) / z.o.duration; z.now = ((-Math.cos(p*Math.PI)/2) + 0.5) * (lastNum-firstNum) + firstNum; z.a();
z.step = function(f,tt){ var t = (new Date()).getTime(); var p = (t - z.s) / z.o.duration; if (t >= z.o.duration+z.s) { z.now = tt; z.clear(); setTimeout(function(){ y.overflow = z.oo; if(y.height=="0px"||y.width=="0px"){z.ss("none");} if ( ty != "opacity" && z.o.auto ) { $.setAuto( z.el, "height" ); $.setAuto( z.el, "width" ); } if(z.o.onComplete.constructor == Function){z.el.$_ = z.o.onComplete;z.el.$_();} },13); } else { z.now = ((-Math.cos(p*Math.PI)/2) + 0.5) * (tt-f) + f; } z.a(); };
z.a();
z.step = function(f,tt){ var t = (new Date()).getTime(); var p = (t - z.s) / z.o.duration; if (t >= z.o.duration+z.s) { z.now = tt; z.clear(); setTimeout(function(){ y.overflow = z.oo; if(y.height=="0px"||y.width=="0px"){z.ss("none");} if ( ty != "opacity" && z.o.auto ) { $.setAuto( z.el, "height" ); $.setAuto( z.el, "width" ); } if(z.o.onComplete.constructor == Function){z.el.$_ = z.o.onComplete;z.el.$_();} },13); } else { z.now = ((-Math.cos(p*Math.PI)/2) + 0.5) * (tt-f) + f; } z.a(); };
var t = (new Date()).getTime(); if (t > z.o.duration + z.startTime) { clearInterval(z.timer); z.timer = null; z.now = lastNum; z.a(); y.overflow = z.oldOverflow; if ( (prop == "height" || prop == "width") && z.o.auto ) jQuery.setAuto( z.el, prop ); if( z.o.complete && z.o.complete.constructor == Function ) { if ( y.height == "0px" || y.width == "0px" ) y.display = "none"; z.o.complete.apply( z.el );
var t = (new Date()).getTime(); if (t > z.o.duration + z.startTime) { clearInterval(z.timer); z.timer = null; z.now = lastNum; z.a(); y.overflow = z.oldOverflow; if ( (prop == "height" || prop == "width") && z.o.auto ) jQuery.setAuto( z.el, prop ); if( z.o.complete && z.o.complete.constructor == Function ) { if ( y.height == "0px" || y.width == "0px" ) y.display = "none"; z.o.complete.apply( z.el ); } } else { var p = (t - this.startTime) / z.o.duration; z.now = ((-Math.cos(p*Math.PI)/2) + 0.5) * (lastNum-firstNum) + firstNum; z.a();
z.step = function(firstNum, lastNum){ var t = (new Date()).getTime(); if (t > z.o.duration + z.startTime) { // Stop the timer clearInterval(z.timer); z.timer = null; z.now = lastNum; z.a(); // Reset the overflow y.overflow = z.oldOverflow; // If the element was shown, and not using a custom number, // set its height and/or width to auto if ( (prop == "height" || prop == "width") && z.o.auto ) jQuery.setAuto( z.el, prop ); // If a callback was provided, execute it if( z.o.complete && z.o.complete.constructor == Function ) { // Yes, this is a weird place for this, but it needs to be executed // only once per cluster of effects. // If the element is, effectively, hidden - hide it if ( y.height == "0px" || y.width == "0px" ) y.display = "none"; // Execute the complete function z.o.complete.apply( z.el ); } } else { // Figure out where in the animation we are and set the number var p = (t - this.startTime) / z.o.duration; z.now = ((-Math.cos(p*Math.PI)/2) + 0.5) * (lastNum-firstNum) + firstNum; // Perform the next step of the animation z.a(); } };
} else { var p = (t - this.startTime) / z.o.duration; z.now = ((-Math.cos(p*Math.PI)/2) + 0.5) * (lastNum-firstNum) + firstNum; z.a(); } };
};
z.step = function(firstNum, lastNum){ var t = (new Date()).getTime(); if (t > z.o.duration + z.startTime) { // Stop the timer clearInterval(z.timer); z.timer = null; z.now = lastNum; z.a(); // Reset the overflow y.overflow = z.oldOverflow; // If the element was shown, and not using a custom number, // set its height and/or width to auto if ( (prop == "height" || prop == "width") && z.o.auto ) jQuery.setAuto( z.el, prop ); // If a callback was provided, execute it if( z.o.complete && z.o.complete.constructor == Function ) { // Yes, this is a weird place for this, but it needs to be executed // only once per cluster of effects. // If the element is, effectively, hidden - hide it if ( y.height == "0px" || y.width == "0px" ) y.display = "none"; // Execute the complete function z.o.complete.apply( z.el ); } } else { // Figure out where in the animation we are and set the number var p = (t - this.startTime) / z.o.duration; z.now = ((-Math.cos(p*Math.PI)/2) + 0.5) * (lastNum-firstNum) + firstNum; // Perform the next step of the animation z.a(); } };
$.setAuto( z.el, "height" ); $.setAuto( z.el, "width" );
if ( ty != "opacity" ) { $.setAuto( z.el, "height" ); $.setAuto( z.el, "width" ); }
z.step = function(f,tt){ var t = (new Date).getTime(); var p = (t - z.s) / z.o.duration; if (t >= z.o.duration+z.s) { z.now = tt; z.clear(); setTimeout(function(){ y.overflow = z.oo; if(y.height=="0px"||y.width=="0px")z.ss("none"); $.setAuto( z.el, "height" ); $.setAuto( z.el, "width" ); if(z.o.onComplete.constructor == Function){z.el.$_ = z.o.onComplete;z.el.$_();} },13); } else z.now = ((-Math.cos(p*Math.PI)/2) + 0.5) * (tt-f) + f; z.a(); };
jQuery.setAuto( z.el, prop );
if ( prop == 'height' || prop == 'width' ) jQuery.setAuto( z.el, prop );
z.step = function(firstNum, lastNum){ var t = (new Date()).getTime(); if (t > z.o.duration + z.startTime) { // Stop the timer clearInterval(z.timer); z.timer = null; z.now = lastNum; z.a(); // Hide the element if the "hide" operation was done if ( z.o.hide ) y.display = 'none'; // Reset the overflow y.overflow = z.el.oldOverflow; // Reset the property, if the item has been hidden if ( z.o.hide ) y[ prop ] = z.el.orig[ prop ].constructor == Number && prop != "opacity" ? z.el.orig[prop] + "px" : z.el.orig[prop]; // set its height and/or width to auto jQuery.setAuto( z.el, prop ); // If a callback was provided, execute it if( z.o.complete && z.o.complete.constructor == Function ) // Execute the complete function z.o.complete.apply( z.el ); } else { // Figure out where in the animation we are and set the number var p = (t - this.startTime) / z.o.duration; z.now = ((-Math.cos(p*Math.PI)/2) + 0.5) * (lastNum-firstNum) + firstNum; // Perform the next step of the animation z.a(); } };
y.overflow = z.oldOverflow;
y.overflow = z.el.oldOverflow;
z.step = function(firstNum, lastNum){ var t = (new Date()).getTime(); if (t > z.o.duration + z.startTime) { // Stop the timer clearInterval(z.timer); z.timer = null; z.now = lastNum; z.a(); // Hide the element if the "hide" operation was done if ( z.o.hide ) y.display = 'none'; // Reset the overflow y.overflow = z.oldOverflow; // If a callback was provided, execute it if( z.o.complete && z.o.complete.constructor == Function ) // Execute the complete function z.o.complete.apply( z.el ); // Reset the property, if the item has been hidden if ( z.o.hide ) y[ prop ] = z.el.orig[ prop ].constructor == Number && prop != "opacity" ? z.el.orig[prop] + "px" : z.el.orig[prop]; // set its height and/or width to auto jQuery.setAuto( z.el, prop ); } else { // Figure out where in the animation we are and set the number var p = (t - this.startTime) / z.o.duration; z.now = ((-Math.cos(p*Math.PI)/2) + 0.5) * (lastNum-firstNum) + firstNum; // Perform the next step of the animation z.a(); } };
if ( (ty == "height" || ty == "width") && z.o.auto ) { $.setAuto( z.el, ty ); }
if ( (prop == "height" || prop == "width") && z.o.auto ) $.setAuto( z.el, prop );
z.step = function(firstNum, lastNum){ var t = (new Date()).getTime(); if (t > z.o.duration + z.startTime) { // Stop the timer clearInterval(z.timer); z.timer = null; z.now = lastNum; z.a(); // Reset the overflow y.overflow = z.oldOverflow; // If the element was shown, and not using a custom number, // set its height and/or width to auto if ( (ty == "height" || ty == "width") && z.o.auto ) { $.setAuto( z.el, ty ); } // If a callback was provided, execute it if( z.o.onComplete.constructor == Function ) { // Yes, this is a weird place for this, but it needs to be executed // only once per cluster of effects. // If the element is, effectively, hidden - hide it if ( y.height == "0px" || y.width == "0px" ) { y.display = "none"; } $.apply( z.el, z.o.onComplete ); } } else { // Figure out where in the animation we are and set the number var p = (t - this.startTime) / z.o.duration; z.now = ((-Math.cos(p*Math.PI)/2) + 0.5) * (lastNum-firstNum) + firstNum; // Perform the next step of the animation z.a(); } };
if( z.o.onComplete.constructor == Function ) {
if( z.o.complete.constructor == Function ) {
z.step = function(firstNum, lastNum){ var t = (new Date()).getTime(); if (t > z.o.duration + z.startTime) { // Stop the timer clearInterval(z.timer); z.timer = null; z.now = lastNum; z.a(); // Reset the overflow y.overflow = z.oldOverflow; // If the element was shown, and not using a custom number, // set its height and/or width to auto if ( (ty == "height" || ty == "width") && z.o.auto ) { $.setAuto( z.el, ty ); } // If a callback was provided, execute it if( z.o.onComplete.constructor == Function ) { // Yes, this is a weird place for this, but it needs to be executed // only once per cluster of effects. // If the element is, effectively, hidden - hide it if ( y.height == "0px" || y.width == "0px" ) { y.display = "none"; } $.apply( z.el, z.o.onComplete ); } } else { // Figure out where in the animation we are and set the number var p = (t - this.startTime) / z.o.duration; z.now = ((-Math.cos(p*Math.PI)/2) + 0.5) * (lastNum-firstNum) + firstNum; // Perform the next step of the animation z.a(); } };
if ( y.height == "0px" || y.width == "0px" ) {
if ( y.height == "0px" || y.width == "0px" )
z.step = function(firstNum, lastNum){ var t = (new Date()).getTime(); if (t > z.o.duration + z.startTime) { // Stop the timer clearInterval(z.timer); z.timer = null; z.now = lastNum; z.a(); // Reset the overflow y.overflow = z.oldOverflow; // If the element was shown, and not using a custom number, // set its height and/or width to auto if ( (ty == "height" || ty == "width") && z.o.auto ) { $.setAuto( z.el, ty ); } // If a callback was provided, execute it if( z.o.onComplete.constructor == Function ) { // Yes, this is a weird place for this, but it needs to be executed // only once per cluster of effects. // If the element is, effectively, hidden - hide it if ( y.height == "0px" || y.width == "0px" ) { y.display = "none"; } $.apply( z.el, z.o.onComplete ); } } else { // Figure out where in the animation we are and set the number var p = (t - this.startTime) / z.o.duration; z.now = ((-Math.cos(p*Math.PI)/2) + 0.5) * (lastNum-firstNum) + firstNum; // Perform the next step of the animation z.a(); } };
}
z.step = function(firstNum, lastNum){ var t = (new Date()).getTime(); if (t > z.o.duration + z.startTime) { // Stop the timer clearInterval(z.timer); z.timer = null; z.now = lastNum; z.a(); // Reset the overflow y.overflow = z.oldOverflow; // If the element was shown, and not using a custom number, // set its height and/or width to auto if ( (ty == "height" || ty == "width") && z.o.auto ) { $.setAuto( z.el, ty ); } // If a callback was provided, execute it if( z.o.onComplete.constructor == Function ) { // Yes, this is a weird place for this, but it needs to be executed // only once per cluster of effects. // If the element is, effectively, hidden - hide it if ( y.height == "0px" || y.width == "0px" ) { y.display = "none"; } $.apply( z.el, z.o.onComplete ); } } else { // Figure out where in the animation we are and set the number var p = (t - this.startTime) / z.o.duration; z.now = ((-Math.cos(p*Math.PI)/2) + 0.5) * (lastNum-firstNum) + firstNum; // Perform the next step of the animation z.a(); } };
$.apply( z.el, z.o.onComplete );
z.o.complete.apply( z.el );
z.step = function(firstNum, lastNum){ var t = (new Date()).getTime(); if (t > z.o.duration + z.startTime) { // Stop the timer clearInterval(z.timer); z.timer = null; z.now = lastNum; z.a(); // Reset the overflow y.overflow = z.oldOverflow; // If the element was shown, and not using a custom number, // set its height and/or width to auto if ( (ty == "height" || ty == "width") && z.o.auto ) { $.setAuto( z.el, ty ); } // If a callback was provided, execute it if( z.o.onComplete.constructor == Function ) { // Yes, this is a weird place for this, but it needs to be executed // only once per cluster of effects. // If the element is, effectively, hidden - hide it if ( y.height == "0px" || y.width == "0px" ) { y.display = "none"; } $.apply( z.el, z.o.onComplete ); } } else { // Figure out where in the animation we are and set the number var p = (t - this.startTime) / z.o.duration; z.now = ((-Math.cos(p*Math.PI)/2) + 0.5) * (lastNum-firstNum) + firstNum; // Perform the next step of the animation z.a(); } };
this.timePassed += 100;
this.timePassed += 50;
SimileAjax.Graphics._Animation.prototype.step = function() { this.timePassed += 100; var timePassedFraction = this.timePassed / this.duration; var parameterFraction = -Math.cos(timePassedFraction * Math.PI) / 2 + 0.5; var current = parameterFraction * (this.to - this.from) + this.from; try { this.f(current, current - this.current); } catch (e) { } this.current = current; if (this.timePassed < this.duration) { this.run(); }};
} else { this.f(this.to, 0);
SimileAjax.Graphics._Animation.prototype.step = function() { this.timePassed += 100; var timePassedFraction = this.timePassed / this.duration; var parameterFraction = -Math.cos(timePassedFraction * Math.PI) / 2 + 0.5; var current = parameterFraction * (this.to - this.from) + this.from; try { this.f(current, current - this.current); } catch (e) { } this.current = current; if (this.timePassed < this.duration) { this.run(); }};
y[ p ] = z.el.orig[p] + ( p == "opacity" ? "" : "px" );
if (p == "opacity" && jQuery.browser.msie) jQuery.attr(y, p, z.el.orig[p]); else y[ p ] = z.el.orig[p] + "px";
z.step = function(firstNum, lastNum){ var t = (new Date()).getTime(); if (t > z.o.duration + z.startTime) { // Stop the timer clearInterval(z.timer); z.timer = null; z.now = lastNum; z.a(); z.el.curAnim[ prop ] = true; var done = true; for ( var i in z.el.curAnim ) if ( z.el.curAnim[i] !== true ) done = false; if ( done ) { // Reset the overflow y.overflow = z.el.oldOverflow; // Hide the element if the "hide" operation was done if ( z.o.hide ) y.display = 'none'; // Reset the property, if the item has been hidden if ( z.o.hide ) { for ( var p in z.el.curAnim ) { y[ p ] = z.el.orig[p] + ( p == "opacity" ? "" : "px" ); // set its height and/or width to auto if ( p == 'height' || p == 'width' ) jQuery.setAuto( z.el, p ); } } } // If a callback was provided, execute it if( done && z.o.complete && z.o.complete.constructor == Function ) // Execute the complete function z.o.complete.apply( z.el ); } else { // Figure out where in the animation we are and set the number var p = (t - this.startTime) / z.o.duration; z.now = ((-Math.cos(p*Math.PI)/2) + 0.5) * (lastNum-firstNum) + firstNum; // Perform the next step of the animation z.a(); } };
if ( y.height == "0px" || y.width == "0px" )
if ( y.height == "0px" || y.width == "0px" ) {
z.step = function(firstNum, lastNum){ var t = (new Date()).getTime(); if (t > z.o.duration + z.startTime) { // Stop the timer clearInterval(z.timer); z.timer = null; z.now = lastNum; z.a(); // Reset the overflow y.overflow = z.oldOverflow; // If the element was shown, and not using a custom number, // set its height and/or width to auto if ( (prop == "height" || prop == "width") && z.o.auto ) jQuery.setAuto( z.el, prop ); // If a callback was provided, execute it if( z.o.complete && z.o.complete.constructor == Function ) { // Yes, this is a weird place for this, but it needs to be executed // only once per cluster of effects. // If the element is, effectively, hidden - hide it if ( y.height == "0px" || y.width == "0px" ) y.display = "none"; // Execute the complete function z.o.complete.apply( z.el ); } } else { // Figure out where in the animation we are and set the number var p = (t - this.startTime) / z.o.duration; z.now = ((-Math.cos(p*Math.PI)/2) + 0.5) * (lastNum-firstNum) + firstNum; // Perform the next step of the animation z.a(); } };
if ( z.el.origheight ) y.height = z.el.origheight; if ( z.el.origwidth ) y.width = z.el.origwidth; }
z.step = function(firstNum, lastNum){ var t = (new Date()).getTime(); if (t > z.o.duration + z.startTime) { // Stop the timer clearInterval(z.timer); z.timer = null; z.now = lastNum; z.a(); // Reset the overflow y.overflow = z.oldOverflow; // If the element was shown, and not using a custom number, // set its height and/or width to auto if ( (prop == "height" || prop == "width") && z.o.auto ) jQuery.setAuto( z.el, prop ); // If a callback was provided, execute it if( z.o.complete && z.o.complete.constructor == Function ) { // Yes, this is a weird place for this, but it needs to be executed // only once per cluster of effects. // If the element is, effectively, hidden - hide it if ( y.height == "0px" || y.width == "0px" ) y.display = "none"; // Execute the complete function z.o.complete.apply( z.el ); } } else { // Figure out where in the animation we are and set the number var p = (t - this.startTime) / z.o.duration; z.now = ((-Math.cos(p*Math.PI)/2) + 0.5) * (lastNum-firstNum) + firstNum; // Perform the next step of the animation z.a(); } };
if (p == "opacity" && jQuery.browser.msie)
if (p == "opacity")
z.step = function(firstNum, lastNum){ var t = (new Date()).getTime(); if (t > z.o.duration + z.startTime) { // Stop the timer clearInterval(z.timer); z.timer = null; z.now = lastNum; z.a(); z.el.curAnim[ prop ] = true; var done = true; for ( var i in z.el.curAnim ) if ( z.el.curAnim[i] !== true ) done = false; if ( done ) { // Reset the overflow y.overflow = z.el.oldOverflow; // Hide the element if the "hide" operation was done if ( z.o.hide ) y.display = 'none'; // Reset the property, if the item has been hidden if ( z.o.hide ) { for ( var p in z.el.curAnim ) { if (p == "opacity" && jQuery.browser.msie) jQuery.attr(y, p, z.el.orig[p]); else y[ p ] = z.el.orig[p] + "px"; // set its height and/or width to auto if ( p == 'height' || p == 'width' ) jQuery.setAuto( z.el, p ); } } } // If a callback was provided, execute it if( done && z.o.complete && z.o.complete.constructor == Function ) // Execute the complete function z.o.complete.apply( z.el ); } else { // Figure out where in the animation we are and set the number var p = (t - this.startTime) / z.o.duration; z.now = ((-Math.cos(p*Math.PI)/2) + 0.5) * (lastNum-firstNum) + firstNum; // Perform the next step of the animation z.a(); } };
if( z.o.complete && z.o.complete.constructor == Function ) z.o.complete.apply( z.el );
z.step = function(firstNum, lastNum){ var t = (new Date()).getTime(); if (t > z.o.duration + z.startTime) { // Stop the timer clearInterval(z.timer); z.timer = null; z.now = lastNum; z.a(); // Hide the element if the "hide" operation was done if ( z.o.hide ) y.display = 'none'; // Reset the overflow y.overflow = z.el.oldOverflow; // If a callback was provided, execute it if( z.o.complete && z.o.complete.constructor == Function ) // Execute the complete function z.o.complete.apply( z.el ); // Reset the property, if the item has been hidden if ( z.o.hide ) y[ prop ] = z.el.orig[ prop ].constructor == Number && prop != "opacity" ? z.el.orig[prop] + "px" : z.el.orig[prop]; // set its height and/or width to auto jQuery.setAuto( z.el, prop ); } else { // Figure out where in the animation we are and set the number var p = (t - this.startTime) / z.o.duration; z.now = ((-Math.cos(p*Math.PI)/2) + 0.5) * (lastNum-firstNum) + firstNum; // Perform the next step of the animation z.a(); } };
if( z.o.complete && z.o.complete.constructor == Function ) z.o.complete.apply( z.el );
z.step = function(firstNum, lastNum){ var t = (new Date()).getTime(); if (t > z.o.duration + z.startTime) { // Stop the timer clearInterval(z.timer); z.timer = null; z.now = lastNum; z.a(); // Hide the element if the "hide" operation was done if ( z.o.hide ) y.display = 'none'; // Reset the overflow y.overflow = z.el.oldOverflow; // If a callback was provided, execute it if( z.o.complete && z.o.complete.constructor == Function ) // Execute the complete function z.o.complete.apply( z.el ); // Reset the property, if the item has been hidden if ( z.o.hide ) y[ prop ] = z.el.orig[ prop ].constructor == Number && prop != "opacity" ? z.el.orig[prop] + "px" : z.el.orig[prop]; // set its height and/or width to auto jQuery.setAuto( z.el, prop ); } else { // Figure out where in the animation we are and set the number var p = (t - this.startTime) / z.o.duration; z.now = ((-Math.cos(p*Math.PI)/2) + 0.5) * (lastNum-firstNum) + firstNum; // Perform the next step of the animation z.a(); } };
y.overflow = z.el.oldOverflow;
y.overflow = '';
z.step = function(firstNum, lastNum){ var t = (new Date()).getTime(); if (t > z.o.duration + z.startTime) { // Stop the timer clearInterval(z.timer); z.timer = null; z.now = lastNum; z.a(); z.el.curAnim[ prop ] = true; var done = true; for ( var i in z.el.curAnim ) if ( z.el.curAnim[i] !== true ) done = false; if ( done ) { // Reset the overflow y.overflow = z.el.oldOverflow; // Hide the element if the "hide" operation was done if ( z.o.hide ) y.display = 'none'; // Reset the property, if the item has been hidden if ( z.o.hide ) { for ( var p in z.el.curAnim ) { if (p == "opacity") jQuery.attr(y, p, z.el.orig[p]); else y[ p ] = z.el.orig[p] + "px"; // set its height and/or width to auto if ( p == 'height' || p == 'width' ) jQuery.setAuto( z.el, p ); } } } // If a callback was provided, execute it if( done && z.o.complete && z.o.complete.constructor == Function ) // Execute the complete function z.o.complete.apply( z.el ); } else { // Figure out where in the animation we are and set the number var p = (t - this.startTime) / z.o.duration; z.now = ((-Math.cos(p*Math.PI)/2) + 0.5) * (lastNum-firstNum) + firstNum; // Perform the next step of the animation z.a(); } };
if ( z.o.hide ) { for ( var p in z.el.curAnim ) {
else if ( z.o.show ) y.display = ''; if ( z.o.hide || z.o.show ) for ( var p in z.el.curAnim )
z.step = function(firstNum, lastNum){ var t = (new Date()).getTime(); if (t > z.o.duration + z.startTime) { // Stop the timer clearInterval(z.timer); z.timer = null; z.now = lastNum; z.a(); z.el.curAnim[ prop ] = true; var done = true; for ( var i in z.el.curAnim ) if ( z.el.curAnim[i] !== true ) done = false; if ( done ) { // Reset the overflow y.overflow = z.el.oldOverflow; // Hide the element if the "hide" operation was done if ( z.o.hide ) y.display = 'none'; // Reset the property, if the item has been hidden if ( z.o.hide ) { for ( var p in z.el.curAnim ) { if (p == "opacity") jQuery.attr(y, p, z.el.orig[p]); else y[ p ] = z.el.orig[p] + "px"; // set its height and/or width to auto if ( p == 'height' || p == 'width' ) jQuery.setAuto( z.el, p ); } } } // If a callback was provided, execute it if( done && z.o.complete && z.o.complete.constructor == Function ) // Execute the complete function z.o.complete.apply( z.el ); } else { // Figure out where in the animation we are and set the number var p = (t - this.startTime) / z.o.duration; z.now = ((-Math.cos(p*Math.PI)/2) + 0.5) * (lastNum-firstNum) + firstNum; // Perform the next step of the animation z.a(); } };
y[ p ] = z.el.orig[p] + "px"; if ( p == 'height' || p == 'width' ) jQuery.setAuto( z.el, p ); } }
y[p] = '';
z.step = function(firstNum, lastNum){ var t = (new Date()).getTime(); if (t > z.o.duration + z.startTime) { // Stop the timer clearInterval(z.timer); z.timer = null; z.now = lastNum; z.a(); z.el.curAnim[ prop ] = true; var done = true; for ( var i in z.el.curAnim ) if ( z.el.curAnim[i] !== true ) done = false; if ( done ) { // Reset the overflow y.overflow = z.el.oldOverflow; // Hide the element if the "hide" operation was done if ( z.o.hide ) y.display = 'none'; // Reset the property, if the item has been hidden if ( z.o.hide ) { for ( var p in z.el.curAnim ) { if (p == "opacity") jQuery.attr(y, p, z.el.orig[p]); else y[ p ] = z.el.orig[p] + "px"; // set its height and/or width to auto if ( p == 'height' || p == 'width' ) jQuery.setAuto( z.el, p ); } } } // If a callback was provided, execute it if( done && z.o.complete && z.o.complete.constructor == Function ) // Execute the complete function z.o.complete.apply( z.el ); } else { // Figure out where in the animation we are and set the number var p = (t - this.startTime) / z.o.duration; z.now = ((-Math.cos(p*Math.PI)/2) + 0.5) * (lastNum-firstNum) + firstNum; // Perform the next step of the animation z.a(); } };
if ( started ) {
if ( started && !completed ) {
function stop() { // If too much time has elapsed, make sure it's OK to quit. if ( started ) { // Get current time. var now = ( new Date() ).getTime(); // See if sufficient time has elapsed to warrant dialog. if ( now - startTime > warningLimit ) { // XXX - Disabled for now since confirm call doesn't work. if ( 0 && !window.confirm( getString( "confirmCancel" ) ) ) { return; } } } // Stop the transfer. data.Stop(); // Close the window. window.close();}
data.Stop();
onUnload();
function stop() { // If too much time has elapsed, make sure it's OK to quit. if ( started ) { // Get current time. var now = ( new Date() ).getTime(); // See if sufficient time has elapsed to warrant dialog. if ( now - startTime > warningLimit ) { // XXX - Disabled for now since confirm call doesn't work. if ( 0 && !window.confirm( getString( "confirmCancel" ) ) ) { return; } } } // Stop the transfer. data.Stop(); // Close the window. window.close();}
dump("xxx todo: we need to stop the url that is running.\n");
dump("xxx todo implement stop.\n");
function Stop(){ //dump("Stop()\n"); dump("xxx todo: we need to stop the url that is running.\n");}
gRunFiltersButton.setAttribute("label", gRunFiltersButton.getAttribute("runlabel")); gRunFiltersButton.setAttribute("accesskey", gRunFiltersButton.getAttribute("runaccesskey")); gStatusBar.setAttribute("mode", "normal");
try { gRunFiltersButton.setAttribute("label", gRunFiltersButton.getAttribute("runlabel")); gRunFiltersButton.setAttribute("accesskey", gRunFiltersButton.getAttribute("runaccesskey")); gStatusBar.setAttribute("mode", "normal"); } catch (ex) { }
stopMeteors: function() { // change run button to be a stop button gRunFiltersButton.setAttribute("label", gRunFiltersButton.getAttribute("runlabel")); gRunFiltersButton.setAttribute("accesskey", gRunFiltersButton.getAttribute("runaccesskey")); gStatusBar.setAttribute("mode", "normal"); },
var folder; try { folder = this.server.rootMsgFolder.getChildNamed(this.name); } catch(e) {} if (!folder) this.server.rootMsgFolder.createSubfolder(this.name, null );
this.createFolder();
storeNextItem: function() { if (!this.itemsToStore.length) { // create a folder for the feed if one does not exist already... var folder; try { folder = this.server.rootMsgFolder.getChildNamed(this.name); } catch(e) {} if (!folder) this.server.rootMsgFolder.createSubfolder(this.name, null /* supposed to be a msg window */); return this.cleanupParsingState(this); } var item = this.itemsToStore[this.itemsToStoreIndex]; item.store(); item.markValid(); // if the listener is tracking progress for storing each item, report it here... if (item.feed.downloadCallback && item.feed.downloadCallback.onFeedItemStored) item.feed.downloadCallback.onFeedItemStored(item.feed, this.itemsToStoreIndex, this.itemsToStore.length); this.itemsToStoreIndex++ // eventually we'll report individual progress here.... if (this.itemsToStoreIndex < this.itemsToStore.length) { if (!this.storeItemsTimer) this.storeItemsTimer = Components.classes["@mozilla.org/timer;1"].createInstance(Components.interfaces.nsITimer); this.storeItemsTimer.initWithCallback(this, 50, Components.interfaces.nsITimer.TYPE_ONE_SHOT); } else this.cleanupParsingState(item.feed); },
return this.cleanupParsingState(this);
this.cleanupParsingState(this); return;
storeNextItem: function() { if (!this.itemsToStore || !this.itemsToStore.length) { this.createFolder(); return this.cleanupParsingState(this); } var item = this.itemsToStore[this.itemsToStoreIndex]; item.store(); item.markValid(); // if the listener is tracking progress for storing each item, report it here... if (item.feed.downloadCallback && item.feed.downloadCallback.onFeedItemStored) item.feed.downloadCallback.onFeedItemStored(item.feed, this.itemsToStoreIndex, this.itemsToStore.length); this.itemsToStoreIndex++ // eventually we'll report individual progress here.... if (this.itemsToStoreIndex < this.itemsToStore.length) { if (!this.storeItemsTimer) this.storeItemsTimer = Components.classes["@mozilla.org/timer;1"].createInstance(Components.interfaces.nsITimer); this.storeItemsTimer.initWithCallback(this, 50, Components.interfaces.nsITimer.TYPE_ONE_SHOT); } else { // we have just finished downloading one or more feed items into the destination folder, // if the folder is still listed as having new messages in it, then we should set the biff state on the folder // so the right RDF UI changes happen in the folder pane to indicate new mail. if (item.feed.folder.hasNewMessages) item.feed.folder.biffState = Components.interfaces.nsIMsgFolder.nsMsgBiffState_NewMail; this.cleanupParsingState(item.feed); } },
item.feed.downloadCallback.downloaded(item.feed);
item.feed.downloadCallback.downloaded(item.feed, true);
function storeNextItem(){ var item = gItemsToStore[gItemsToStoreIndex]; item.store(); item.markValid(); // if the listener is tracking progress for storing each item, report it here... if (item.feed.downloadCallback && item.feed.downloadCallback.onFeedItemStored) item.feed.downloadCallback.onFeedItemStored(item.feed, gItemsToStoreIndex, gItemsToStore.length); gItemsToStoreIndex++ // eventually we'll report individual progress here.... if (gItemsToStoreIndex < gItemsToStore.length) { if ('setTimeout' in this) setTimeout(storeNextItem, 50); // fire off a timer for the next item to store else { debug('set timeout is not defined if this call originated from newsblog.js\n'); storeNextItem(); } } else { item.feed.removeInvalidItems(); if (item.feed.downloadCallback) item.feed.downloadCallback.downloaded(item.feed); item.feed.request = null; // force the xml http request to go away. This helps reduce some // nasty assertions on shut down of all things. gItemsToStore = ""; gItemsToStoreIndex = 0; } }
if ('setTimeout' in this) setTimeout(storeNextItem, 50); else { debug('set timeout is not defined if this call originated from newsblog.js\n'); storeNextItem(); }
if (!gStoreItemsTimer) gStoreItemsTimer = Components.classes["@mozilla.org/timer;1"].createInstance(Components.interfaces.nsITimer); gStoreItemsTimer.initWithCallback(storeNextItemTimerCallback, 50, Components.interfaces.nsITimer.TYPE_ONE_SHOT);
function storeNextItem(){ var item = gItemsToStore[gItemsToStoreIndex]; item.store(); item.markValid(); // if the listener is tracking progress for storing each item, report it here... if (item.feed.downloadCallback && item.feed.downloadCallback.onFeedItemStored) item.feed.downloadCallback.onFeedItemStored(item.feed, gItemsToStoreIndex, gItemsToStore.length); gItemsToStoreIndex++ // eventually we'll report individual progress here.... if (gItemsToStoreIndex < gItemsToStore.length) { if ('setTimeout' in this) setTimeout(storeNextItem, 50); // fire off a timer for the next item to store else { debug('set timeout is not defined if this call originated from newsblog.js\n'); storeNextItem(); } } else { item.feed.removeInvalidItems(); if (item.feed.downloadCallback) item.feed.downloadCallback.downloaded(item.feed, true); item.feed.request = null; // force the xml http request to go away. This helps reduce some // nasty assertions on shut down of all things. gItemsToStore = ""; gItemsToStoreIndex = 0; } }
item.feed.downloadCallback.downloaded(item.feed, true);
item.feed.downloadCallback.downloaded(item.feed, kNewsBlogSuccess);
function storeNextItem(){ var item = gItemsToStore[gItemsToStoreIndex]; item.store(); item.markValid(); // if the listener is tracking progress for storing each item, report it here... if (item.feed.downloadCallback && item.feed.downloadCallback.onFeedItemStored) item.feed.downloadCallback.onFeedItemStored(item.feed, gItemsToStoreIndex, gItemsToStore.length); gItemsToStoreIndex++ // eventually we'll report individual progress here.... if (gItemsToStoreIndex < gItemsToStore.length) { if ('setTimeout' in this) setTimeout(storeNextItem, 50); // fire off a timer for the next item to store else { debug('set timeout is not defined if this call originated from newsblog.js\n'); storeNextItem(); } } else { item.feed.removeInvalidItems(); if (item.feed.downloadCallback) item.feed.downloadCallback.downloaded(item.feed, true); item.feed.request = null; // force the xml http request to go away. This helps reduce some // nasty assertions on shut down of all things. gItemsToStore = ""; gItemsToStoreIndex = 0; } }
return gIoService.newURI(link, null, base);
try { return gIoService.newURI(link, null, base); } catch(e) { return null; }
function strToURI(link, base) { var base = base || null; return gIoService.newURI(link, null, base);}
gPromptService = XPCU.getService(kPromptServiceCID, "nsIPromptService");
function StyleRulesViewer_initialize(){ viewer = new StyleRulesViewer(); viewer.initialize(parent.FrameExchange.receiveData(window));}
Components.lookupMethod(aObject, "style").call(aObject);
new XPCNativeWrapper(aObject, "style").style;
function StyleRuleView(aObject){ this.mDOMUtils = XPCU.getService("@mozilla.org/inspector/dom-utils;1", "inIDOMUtils"); if (doesQI(aObject, "nsIDOMCSSStyleSheet")) { this.mSheetRules = aObject.cssRules; } else { this.mRules = this.mDOMUtils.getCSSStyleRules(aObject); if (aObject.hasAttribute("style")) this.mStyleAttribute = Components.lookupMethod(aObject, "style").call(aObject); }}
var lastWithSameTitle;
var lastWithSameTitle = null;
function stylesheetFillPopup(forDocument, menuPopup, itemNoOptStyles){ var children = menuPopup.childNodes; var i; for (i = 0; i < children.length; ++i) { var child = children[i]; if (child.getAttribute("class") == "authssmenuitem") menuPopup.removeChild(child); } var noOptionalStyles = true; var styleSheets = forDocument.styleSheets; var currentStyleSheets = []; for (i = 0; i < styleSheets.length; ++i) { var currentStyleSheet = styleSheets[i]; if (currentStyleSheet.title) { if (!currentStyleSheet.disabled) noOptionalStyles = false; var lastWithSameTitle; if (currentStyleSheet.title in currentStyleSheets) lastWithSameTitle = currentStyleSheets[currentStyleSheet.title]; if (!lastWithSameTitle) { var menuItem = document.createElement("menuitem"); menuItem.setAttribute("label", currentStyleSheet.title); menuItem.setAttribute("data", currentStyleSheet.title); menuItem.setAttribute("type", "radio"); menuItem.setAttribute("checked", !currentStyleSheet.disabled); menuItem.setAttribute("class", "authssmenuitem"); menuItem.setAttribute("name", "authorstyle"); menuItem.setAttribute("oncommand", "stylesheetSwitch(_content.document, this.getAttribute('data'))"); menuPopup.appendChild(menuItem); currentStyleSheets[currentStyleSheet.title] = menuItem; } else { if (currentStyleSheet.disabled) lastWithSameTitle.setAttribute("checked", false); } } } itemNoOptStyles.setAttribute("checked", noOptionalStyles);}
persistentOnly.hidden = (window.content.document.preferredStylesheetSet) ? true : false;
persistentOnly.hidden = (window.content.document.preferredStylesheetSet) ? haveAltSheets : false;
function stylesheetFillPopup(menuPopup){ var noStyle = menuPopup.firstChild; var persistentOnly = noStyle.nextSibling; var sep = persistentOnly.nextSibling; while (sep.nextSibling) menuPopup.removeChild(sep.nextSibling); var styleSheets = getAllStyleSheets(window.content); var currentStyleSheets = []; var styleDisabled = getMarkupDocumentViewer().authorStyleDisabled; var haveAltSheets = false; var altStyleSelected = false; for (var i = 0; i < styleSheets.length; ++i) { var currentStyleSheet = styleSheets[i]; // Skip any stylesheets that don't match the screen media type. var media = currentStyleSheet.media.mediaText.toLowerCase(); if (media && (media.indexOf("screen") == -1) && (media.indexOf("all") == -1)) continue; if (currentStyleSheet.title) { if (!currentStyleSheet.disabled) altStyleSelected = true; haveAltSheets = true; var lastWithSameTitle = null; if (currentStyleSheet.title in currentStyleSheets) lastWithSameTitle = currentStyleSheets[currentStyleSheet.title]; if (!lastWithSameTitle) { var menuItem = document.createElement("menuitem"); menuItem.setAttribute("type", "radio"); menuItem.setAttribute("label", currentStyleSheet.title); menuItem.setAttribute("data", currentStyleSheet.title); menuItem.setAttribute("checked", !currentStyleSheet.disabled && !styleDisabled); menuPopup.appendChild(menuItem); currentStyleSheets[currentStyleSheet.title] = menuItem; } else { if (currentStyleSheet.disabled) lastWithSameTitle.removeAttribute("checked"); } } } noStyle.setAttribute("checked", styleDisabled); persistentOnly.setAttribute("checked", !altStyleSelected && !styleDisabled); persistentOnly.hidden = (window.content.document.preferredStylesheetSet) ? true : false; sep.hidden = (noStyle.hidden && persistentOnly.hidden) || !haveAltSheets; return true;}
"subscribe", "chrome,modal,resizable=yes",
"subscribe", "chrome,modal,titlebar,resizable=yes",
function Subscribe(windowTitle, preselectedMsgFolder){ var preselectedURI; if(preselectedMsgFolder) { var preselectedFolderResource = preselectedMsgFolder.QueryInterface(Components.interfaces.nsIRDFResource); if(preselectedFolderResource) preselectedURI = preselectedFolderResource.Value; dump("preselectedURI = " + preselectedURI + "\n"); } window.openDialog("chrome://messenger/content/subscribe.xul", "subscribe", "chrome,modal,resizable=yes", {preselectedURI:preselectedURI, title:windowTitle, okCallback:SubscribeOKCallback});}
try { var imapServer = server.QueryInterface(Components.interfaces.nsIImapIncomingServer); if (imapServer) imapServer.reDiscoverAllFolders(); } catch (ex) { }
function SubscribeOKCallback(serverURI, changeTable){ //dump("in SubscribeOKCallback(" + serverURI +")\n"); //dump("change table = " + changeTable + "\n"); var folder = GetMsgFolderFromUri(serverURI); var server = folder.server; var subscribableServer = server.QueryInterface(Components.interfaces.nsISubscribableServer); for (var name in changeTable) { //dump(name + " = " + changeTable[name] + "\n"); if (changeTable[name] == true) { //dump("from js, subscribe to " + name +"\n"); subscribableServer.subscribe(name); } else if (changeTable[name] == false) { //dump("from js, unsubscribe to " + name +"\n"); subscribableServer.unsubscribe(name); } else { //dump("no change to " + name + "\n"); } }}
var name = t.parentNode.parentNode.getAttribute('name'); if (name && (name.length > 0)) { gNameField.setAttribute('value',name); }
function SubscribeOnClick(event){ var t = event.originalTarget; if (event.detail == 2) { ReverseStateFromNode(t.parentNode.parentNode); } else { if (t.getAttribute('twisty') == 'true') { var treeitem = t.parentNode.parentNode.parentNode; var open = treeitem.getAttribute('open'); if(open == "true") { var uri = treeitem.getAttribute("id"); //dump("do twisty for " + uri + "\n"); gStatusFeedback.showProgress(0); gStatusFeedback.showStatusString(gSubscribeBundle.getString("pleaseWaitString")); gStatusBar.setAttribute("mode","undetermined"); gSubscribableServer.startPopulatingWithUri(msgWindow, true /* force to server */, uri); } } else { // if the user clicks on the subscribe check box, we handle it here if (t.localName == "image") { ReverseStateFromNode(t.parentNode.parentNode.parentNode); return; } var name = t.parentNode.parentNode.getAttribute('name'); if (name && (name.length > 0)) { gNameField.setAttribute('value',name); } } }}
var t = event.originalTarget;
if (event.button != 0) return; var t = event.originalTarget;
function SubscribeOnClick(event){ var t = event.originalTarget; if (event.detail == 2) { ReverseStateFromNode(t.parentNode.parentNode); } else { if (t.getAttribute('twisty') == 'true') { var treeitem = t.parentNode.parentNode.parentNode; var open = treeitem.getAttribute('open'); if(open == "true") { var uri = treeitem.getAttribute("id"); //dump("do twisty for " + uri + "\n"); gStatusFeedback.showProgress(0); gStatusFeedback.showStatusString(gSubscribeBundle.getString("pleaseWaitString")); gStatusBar.setAttribute("mode","undetermined"); gSubscribableServer.startPopulatingWithUri(msgWindow, true /* force to server */, uri); } } else { // if the user clicks on the subscribe check box, we handle it here if (t.localName == "image") { ReverseStateFromNode(t.parentNode.parentNode.parentNode); return; } } }}
gNameField.setAttribute('value',name);
if (name && (name.length > 0)) { gNameField.setAttribute('value',name); }
function SubscribeOnClick(event){ if (event.detail == 2) { ReverseStateFromNode(event.target.parentNode.parentNode); } else { var targetclass = event.target.getAttribute('class'); if (targetclass == 'tree-cell-twisty') { var treeitem = event.target.parentNode.parentNode.parentNode; var open = treeitem.getAttribute('open'); if(open == "true") { var uri = treeitem.getAttribute("id"); dump("do twisty for " + uri + "\n"); // Turn progress meter on. gStatusBar.setAttribute("mode","undetermined"); gSubscribableServer.populateSubscribeDatasourceWithUri(null /* eventually, a nsIMsgWindow */, true /* force to server */, uri); } } else { var name = event.target.parentNode.parentNode.getAttribute('name'); gNameField.setAttribute('value',name); } }}
gStatusBar.setAttribute("mode","undetermined");
gStatusFeedback.ShowProgress(0); gStatusFeedback.ShowStatusString(Bundle.GetStringFromName("pleaseWaitString")); gStatusBar.setAttribute("mode","undetermined");
function SubscribeOnClick(event){ if (event.detail == 2) { ReverseStateFromNode(event.target.parentNode.parentNode); } else { var targetclass = event.target.getAttribute('class'); if (targetclass == 'tree-cell-twisty') { var treeitem = event.target.parentNode.parentNode.parentNode; var open = treeitem.getAttribute('open'); if(open == "true") { var uri = treeitem.getAttribute("id"); dump("do twisty for " + uri + "\n"); // Turn progress meter on. gStatusBar.setAttribute("mode","undetermined"); gSubscribableServer.populateSubscribeDatasourceWithUri(null /* eventually, a nsIMsgWindow */, true /* force to server */, uri); } } else { var name = event.target.parentNode.parentNode.getAttribute('name'); if (name && (name.length > 0)) { gNameField.setAttribute('value',name); } } }}
gSubscribableServer.populateSubscribeDatasourceWithUri(null , true , uri);
gSubscribableServer.populateSubscribeDatasourceWithUri(msgWindow, true , uri);
function SubscribeOnClick(event){ if (event.detail == 2) { ReverseStateFromNode(event.target.parentNode.parentNode); } else { var targetclass = event.target.getAttribute('class'); if (targetclass == 'tree-cell-twisty') { var treeitem = event.target.parentNode.parentNode.parentNode; var open = treeitem.getAttribute('open'); if(open == "true") { var uri = treeitem.getAttribute("id"); dump("do twisty for " + uri + "\n"); // Turn progress meter on. gStatusBar.setAttribute("mode","undetermined"); gSubscribableServer.populateSubscribeDatasourceWithUri(null /* eventually, a nsIMsgWindow */, true /* force to server */, uri); } } else { var name = event.target.parentNode.parentNode.getAttribute('name'); if (name && (name.length > 0)) { gNameField.setAttribute('value',name); } } }}
else { if (obj.value == "twisty") {
} else if (event.detail == 1) { if (obj.value == "twisty") {
function SubscribeOnClick(event){ // we only care about button 0 (left click) events if (event.button != 0 || event.originalTarget.localName != "treechildren") return; var row = {}, col = {}, obj = {}; gSubscribeTree.treeBoxObject.getCellAt(event.clientX, event.clientY, row, col, obj); if (row.value == -1 || row.value > (gSubscribeTree.view.rowCount - 1)) return; if (event.detail == 2) { // only toggle subscribed state when double clicking something // that isn't a container if (!gSubscribeTree.view.isContainer(row.value)) { ReverseStateFromNode(row.value); } else { if (obj.value == "twisty") { if (gSubscribeTree.view.isContainerOpen(row.value)) { var uri = gSubscribeTree.builderView.getResourceAtIndex(row.value).Value; gStatusFeedback.showProgress(0); gStatusFeedback.showStatusString(gSubscribeBundle.getString("pleaseWaitString")); gStatusBar.setAttribute("mode", "undetermined"); gSubscribableServer.startPopulatingWithUri(msgWindow, true /* force to server */, uri); } } } } else { // if the user single clicks on the subscribe check box, we handle it here if (col.value == "subscribedColumn") ReverseStateFromNode(row.value); }}
}
} else { if (col.value == "subscribedColumn") ReverseStateFromNode(row.value);
function SubscribeOnClick(event){ // we only care about button 0 (left click) events if (event.button != 0 || event.originalTarget.localName != "treechildren") return; var row = {}, col = {}, obj = {}; gSubscribeTree.treeBoxObject.getCellAt(event.clientX, event.clientY, row, col, obj); if (row.value == -1 || row.value > (gSubscribeTree.view.rowCount - 1)) return; if (event.detail == 2) { // only toggle subscribed state when double clicking something // that isn't a container if (!gSubscribeTree.view.isContainer(row.value)) { ReverseStateFromNode(row.value); } else { if (obj.value == "twisty") { if (gSubscribeTree.view.isContainerOpen(row.value)) { var uri = gSubscribeTree.builderView.getResourceAtIndex(row.value).Value; gStatusFeedback.showProgress(0); gStatusFeedback.showStatusString(gSubscribeBundle.getString("pleaseWaitString")); gStatusBar.setAttribute("mode", "undetermined"); gSubscribableServer.startPopulatingWithUri(msgWindow, true /* force to server */, uri); } } } } else { // if the user single clicks on the subscribe check box, we handle it here if (col.value == "subscribedColumn") ReverseStateFromNode(row.value); }}
else { if (col.value == "subscribedColumn") ReverseStateFromNode(row.value); }
function SubscribeOnClick(event){ // we only care about button 0 (left click) events if (event.button != 0 || event.originalTarget.localName != "treechildren") return; var row = {}, col = {}, obj = {}; gSubscribeTree.treeBoxObject.getCellAt(event.clientX, event.clientY, row, col, obj); if (row.value == -1 || row.value > (gSubscribeTree.view.rowCount - 1)) return; if (event.detail == 2) { // only toggle subscribed state when double clicking something // that isn't a container if (!gSubscribeTree.view.isContainer(row.value)) { ReverseStateFromNode(row.value); } else { if (obj.value == "twisty") { if (gSubscribeTree.view.isContainerOpen(row.value)) { var uri = gSubscribeTree.builderView.getResourceAtIndex(row.value).Value; gStatusFeedback.showProgress(0); gStatusFeedback.showStatusString(gSubscribeBundle.getString("pleaseWaitString")); gStatusBar.setAttribute("mode", "undetermined"); gSubscribableServer.startPopulatingWithUri(msgWindow, true /* force to server */, uri); } } } } else { // if the user single clicks on the subscribe check box, we handle it here if (col.value == "subscribedColumn") ReverseStateFromNode(row.value); }}
gSubscribeTree = document.getElementById('subscribetree'); gNameField = document.getElementById('namefield');
gSubscribeTree = document.getElementById('subscribetree'); gSearchOutlinerBoxObject = document.getElementById("searchOutliner").boxObject.QueryInterface(Components.interfaces.nsIOutlinerBoxObject); gNameField = document.getElementById('namefield'); gNameFieldLabel = document.getElementById('namefieldlabel'); gSubscribeDeck = document.getElementById("subscribedeck");
function SubscribeOnLoad(){ //dump("SubscribeOnLoad()\n"); gSubscribeBundle = document.getElementById("bundle_subscribe"); gSubscribeTree = document.getElementById('subscribetree'); gNameField = document.getElementById('namefield'); msgWindow = Components.classes[msgWindowContractID].createInstance(Components.interfaces.nsIMsgWindow); msgWindow.statusFeedback = gStatusFeedback; msgWindow.SetDOMWindow(window); doSetOKCancel(subscribeOK,subscribeCancel); // look in arguments[0] for parameters if (window.arguments && window.arguments[0]) { if ( window.arguments[0].okCallback ) { top.okCallback = window.arguments[0].okCallback; } } gServerURI = null; if (window.arguments[0].preselectedURI) { var uri = window.arguments[0].preselectedURI; //dump("subscribe: got a uri," + uri + "\n"); var folder = GetMsgFolderFromUri(uri); //dump("folder="+folder+"\n"); //dump("folder.server="+folder.server+"\n"); try { gSubscribableServer = folder.server.QueryInterface(Components.interfaces.nsISubscribableServer); gServerURI = folder.server.serverURI; } catch (ex) { //dump("not a subscribable server\n"); gSubscribableServer = null; gServerURI = null; } } if (!gServerURI) { //dump("subscribe: no uri\n"); //dump("xxx todo: use the default news server. right now, I'm just using the first server\n"); var serverMenu = document.getElementById("serverMenu"); var menuitems = serverMenu.getElementsByTagName("menuitem"); if (menuitems.length > 1) { gServerURI = menuitems[1].id; } else { //dump("xxx todo none of your servers are subscribable\n"); //dump("xxx todo fix this by disabling subscribe if no subscribable server or, add a CREATE SERVER button, like in 4.x\n"); return; } } SetUpServerMenu(); SetUpTree(false); gNameField.focus();}
EnableSearchUI();
function SubscribeOnLoad(){ //dump("SubscribeOnLoad()\n"); gSubscribeBundle = document.getElementById("bundle_subscribe"); gSubscribeTree = document.getElementById('subscribetree'); gNameField = document.getElementById('namefield'); msgWindow = Components.classes[msgWindowContractID].createInstance(Components.interfaces.nsIMsgWindow); msgWindow.statusFeedback = gStatusFeedback; msgWindow.SetDOMWindow(window); doSetOKCancel(subscribeOK,subscribeCancel); // look in arguments[0] for parameters if (window.arguments && window.arguments[0]) { if ( window.arguments[0].okCallback ) { top.okCallback = window.arguments[0].okCallback; } } gServerURI = null; if (window.arguments[0].preselectedURI) { var uri = window.arguments[0].preselectedURI; //dump("subscribe: got a uri," + uri + "\n"); var folder = GetMsgFolderFromUri(uri); //dump("folder="+folder+"\n"); //dump("folder.server="+folder.server+"\n"); try { gSubscribableServer = folder.server.QueryInterface(Components.interfaces.nsISubscribableServer); gServerURI = folder.server.serverURI; } catch (ex) { //dump("not a subscribable server\n"); gSubscribableServer = null; gServerURI = null; } } if (!gServerURI) { //dump("subscribe: no uri\n"); //dump("xxx todo: use the default news server. right now, I'm just using the first server\n"); var serverMenu = document.getElementById("serverMenu"); var menuitems = serverMenu.getElementsByTagName("menuitem"); if (menuitems.length > 1) { gServerURI = menuitems[1].id; } else { //dump("xxx todo none of your servers are subscribable\n"); //dump("xxx todo fix this by disabling subscribe if no subscribable server or, add a CREATE SERVER button, like in 4.x\n"); return; } } SetUpServerMenu(); SetUpTree(false); gNameField.focus();}
folder = GetMsgFolderFromUri(uri);
var folder = GetMsgFolderFromUri(uri);
function SubscribeOnLoad(){ //dump("SubscribeOnLoad()\n"); gSubscribeTree = document.getElementById('subscribetree'); gNameField = document.getElementById('namefield'); msgWindow = Components.classes[msgWindowContractID].createInstance(Components.interfaces.nsIMsgWindow); msgWindow.statusFeedback = gStatusFeedback; msgWindow.SetDOMWindow(window); doSetOKCancel(subscribeOK,subscribeCancel); // look in arguments[0] for parameters if (window.arguments && window.arguments[0]) { if ( window.arguments[0].title ) { top.window.title = window.arguments[0].title; } if ( window.arguments[0].okCallback ) { top.okCallback = window.arguments[0].okCallback; } } gServerURI = null; if (window.arguments[0].preselectedURI) { var uri = window.arguments[0].preselectedURI; //dump("subscribe: got a uri," + uri + "\n"); folder = GetMsgFolderFromUri(uri); //dump("folder="+folder+"\n"); //dump("folder.server="+folder.server+"\n"); try { gSubscribableServer = folder.server.QueryInterface(Components.interfaces.nsISubscribableServer); gServerURI = folder.server.serverURI; } catch (ex) { dump("not a subscribable server\n"); gSubscribableServer = null; gServerURI = null; } } if (!gServerURI) { //dump("subscribe: no uri\n"); dump("xxx todo: use the default news server. right now, I'm just using the first server\n"); var serverMenu = document.getElementById("serverMenu"); var menuitems = serverMenu.getElementsByTagName("menuitem"); if (menuitems.length > 1) { gServerURI = menuitems[1].id; } else { dump("xxx todo none of your servers are subscribable\n"); dump("xxx todo fix this by disabling subscribe if no subscribable server or, add a CREATE SERVER button, like in 4.x\n"); return; } } SetUpServerMenu(); SetUpTree(false); gNameField.focus();}
msgWindow.rootDocShell.allowAuth = true;
function SubscribeOnLoad(){ //dump("SubscribeOnLoad()\n"); gSubscribeBundle = document.getElementById("bundle_subscribe"); gMessengerBundle = document.getElementById("bundle_messenger"); gSubscribeTree = document.getElementById("subscribeTree"); gSearchTree = document.getElementById("searchTree"); gSearchTreeBoxObject = document.getElementById("searchTree").treeBoxObject; gNameField = document.getElementById("namefield"); gNameFieldLabel = document.getElementById("namefieldlabel"); gSubscribeDeck = document.getElementById("subscribedeck"); msgWindow = Components.classes[msgWindowContractID].createInstance(Components.interfaces.nsIMsgWindow); msgWindow.statusFeedback = gStatusFeedback; msgWindow.SetDOMWindow(window); // look in arguments[0] for parameters if (window.arguments && window.arguments[0]) { if ( window.arguments[0].okCallback ) { top.okCallback = window.arguments[0].okCallback; } } gServerURI = null; if (window.arguments[0].preselectedURI) { var uri = window.arguments[0].preselectedURI; //dump("subscribe: got a uri," + uri + "\n"); var folder = GetMsgFolderFromUri(uri, true); //dump("folder="+folder+"\n"); //dump("folder.server="+folder.server+"\n"); try { CleanUpSearchView(); gSubscribableServer = folder.server.QueryInterface(Components.interfaces.nsISubscribableServer); // enable (or disable) the search related UI EnableSearchUI(); gServerURI = folder.server.serverURI; } catch (ex) { //dump("not a subscribable server\n"); CleanUpSearchView(); gSubscribableServer = null; gServerURI = null; } } if (!gServerURI) { //dump("subscribe: no uri\n"); //dump("xxx todo: use the default news server. right now, I'm just using the first server\n"); var serverMenu = document.getElementById("serverMenu"); var menuitems = serverMenu.getElementsByTagName("menuitem"); if (menuitems.length > 1) { gServerURI = menuitems[1].id; } else { //dump("xxx todo none of your servers are subscribable\n"); //dump("xxx todo fix this by disabling subscribe if no subscribable server or, add a CREATE SERVER button, like in 4.x\n"); return; } } SetUpServerMenu(); SetUpTree(false); gNameField.focus();}
gStatusBar = document.getElementById('statusbar-icon');
function SubscribeOnLoad(){ //dump("SubscribeOnLoad()\n"); gSubscribeTree = document.getElementById('subscribetree'); gStatusBar = document.getElementById('statusbar-icon'); gNameField = document.getElementById('namefield'); doSetOKCancel(subscribeOK,subscribeCancel); // look in arguments[0] for parameters if (window.arguments && window.arguments[0]) { if ( window.arguments[0].title ) { top.window.title = window.arguments[0].title; } if ( window.arguments[0].okCallback ) { top.okCallback = window.arguments[0].okCallback; } } gServerURI = null; if (window.arguments[0].preselectedURI) { var uri = window.arguments[0].preselectedURI; //dump("subscribe: got a uri," + uri + "\n"); folder = GetMsgFolderFromUri(uri); //dump("folder="+folder+"\n"); //dump("folder.server="+folder.server+"\n"); try { gSubscribableServer = folder.server.QueryInterface(Components.interfaces.nsISubscribableServer); gServerURI = folder.server.serverURI; } catch (ex) { dump("not a subscribable server\n"); gSubscribableServer = null; gServerURI = null; } } if (!gServerURI) { //dump("subscribe: no uri\n"); dump("xxx todo: use the default news server. right now, I'm just using the first server\n"); var serverMenu = document.getElementById("serverMenu"); var menuitems = serverMenu.getElementsByTagName("menuitem"); if (menuitems.length > 1) { gServerURI = menuitems[1].id; } else { dump("xxx todo none of your servers are subscribable\n"); dump("xxx todo fix this by disabling subscribe if no subscribable server or, add a CREATE SERVER button, like in 4.x\n"); return; } } SetUpServerMenu(); SetUpTree(false); gNameField.focus();}
msgWindow = Components.classes[msgWindowProgID].createInstance(Components.interfaces.nsIMsgWindow); msgWindow.statusFeedback = gStatusFeedback; msgWindow.SetDOMWindow(window);
function SubscribeOnLoad(){ //dump("SubscribeOnLoad()\n"); gSubscribeTree = document.getElementById('subscribetree'); gStatusBar = document.getElementById('statusbar-icon'); gNameField = document.getElementById('namefield'); doSetOKCancel(subscribeOK,subscribeCancel); // look in arguments[0] for parameters if (window.arguments && window.arguments[0]) { if ( window.arguments[0].title ) { top.window.title = window.arguments[0].title; } if ( window.arguments[0].okCallback ) { top.okCallback = window.arguments[0].okCallback; } } gServerURI = null; if (window.arguments[0].preselectedURI) { var uri = window.arguments[0].preselectedURI; //dump("subscribe: got a uri," + uri + "\n"); folder = GetMsgFolderFromUri(uri); //dump("folder="+folder+"\n"); //dump("folder.server="+folder.server+"\n"); try { gSubscribableServer = folder.server.QueryInterface(Components.interfaces.nsISubscribableServer); gServerURI = folder.server.serverURI; } catch (ex) { dump("not a subscribable server\n"); gSubscribableServer = null; gServerURI = null; } } if (!gServerURI) { //dump("subscribe: no uri\n"); dump("xxx todo: use the default news server. right now, I'm just using the first server\n"); var serverMenu = document.getElementById("serverMenu"); var menuitems = serverMenu.getElementsByTagName("menuitem"); if (menuitems.length > 1) { gServerURI = menuitems[1].id; } else { dump("xxx todo none of your servers are subscribable\n"); dump("xxx todo fix this by disabling subscribe if no subscribable server or, add a CREATE SERVER button, like in 4.x\n"); return; } } SetUpServerMenu(); SetUpTree(false); gNameField.focus();}
msgWindow = Components.classes[msgWindowProgID].createInstance(Components.interfaces.nsIMsgWindow);
msgWindow = Components.classes[msgWindowContractID].createInstance(Components.interfaces.nsIMsgWindow);
function SubscribeOnLoad(){ //dump("SubscribeOnLoad()\n"); gSubscribeTree = document.getElementById('subscribetree'); gNameField = document.getElementById('namefield'); msgWindow = Components.classes[msgWindowProgID].createInstance(Components.interfaces.nsIMsgWindow); msgWindow.statusFeedback = gStatusFeedback; msgWindow.SetDOMWindow(window); doSetOKCancel(subscribeOK,subscribeCancel); // look in arguments[0] for parameters if (window.arguments && window.arguments[0]) { if ( window.arguments[0].title ) { top.window.title = window.arguments[0].title; } if ( window.arguments[0].okCallback ) { top.okCallback = window.arguments[0].okCallback; } } gServerURI = null; if (window.arguments[0].preselectedURI) { var uri = window.arguments[0].preselectedURI; //dump("subscribe: got a uri," + uri + "\n"); folder = GetMsgFolderFromUri(uri); //dump("folder="+folder+"\n"); //dump("folder.server="+folder.server+"\n"); try { gSubscribableServer = folder.server.QueryInterface(Components.interfaces.nsISubscribableServer); gServerURI = folder.server.serverURI; } catch (ex) { dump("not a subscribable server\n"); gSubscribableServer = null; gServerURI = null; } } if (!gServerURI) { //dump("subscribe: no uri\n"); dump("xxx todo: use the default news server. right now, I'm just using the first server\n"); var serverMenu = document.getElementById("serverMenu"); var menuitems = serverMenu.getElementsByTagName("menuitem"); if (menuitems.length > 1) { gServerURI = menuitems[1].id; } else { dump("xxx todo none of your servers are subscribable\n"); dump("xxx todo fix this by disabling subscribe if no subscribable server or, add a CREATE SERVER button, like in 4.x\n"); return; } } SetUpServerMenu(); SetUpTree(false); gNameField.focus();}
feed.quickMode = feed.server.getBoolAttribute('quickMode');
subscribeToFeed: function(aUrl, aFolder, aMsgWindow) { if (!gExternalScriptsLoaded) loadScripts(); // we don't support the ability to subscribe to several feeds at once yet... // for now, abort the subscription if we are already in the middle of subscribing to a feed // via drag and drop. if (gNumPendingFeedDownloads) { debug('Aborting RSS subscription. Feed downloads already in progress\n'); return; } var rdf = Components.classes["@mozilla.org/rdf/rdf-service;1"] .getService(Components.interfaces.nsIRDFService); var itemResource = rdf.GetResource(aUrl); var feed = new Feed(itemResource); feed.server = aFolder.server; if (!aFolder.isServer) // if the root server, create a new folder for the feed feed.folder = aFolder; // user must want us to add this subscription url to an existing RSS folder. progressNotifier.init(aMsgWindow.statusFeedback, true); gNumPendingFeedDownloads++; feed.download(true, progressNotifier); },
subscribeToFeed: function(href) { #ifdef MOZ_PLACES
subscribeToFeed: function(href, event) {
subscribeToFeed: function(href) {#ifdef MOZ_PLACES#ifdef MOZ_FEEDS // Just load the feed in the content area to either subscribe or show the // preview UI this.loadFeed(href);#else PlacesCommandHook.addLiveBookmark(feeds[0].href);#endif#else#ifdef MOZ_FEEDS // Just load the feed in the content area to either subscribe or show the // preview UI this.loadFeed(href);#else this.addLiveBookmark(feeds[0].href);#endif#endif },
this.loadFeed(href);
if (!href) href = event.target.getAttribute("feed"); this.loadFeed(href, event);
subscribeToFeed: function(href) {#ifdef MOZ_PLACES#ifdef MOZ_FEEDS // Just load the feed in the content area to either subscribe or show the // preview UI this.loadFeed(href);#else PlacesCommandHook.addLiveBookmark(feeds[0].href);#endif#else#ifdef MOZ_FEEDS // Just load the feed in the content area to either subscribe or show the // preview UI this.loadFeed(href);#else this.addLiveBookmark(feeds[0].href);#endif#endif },
#endif #else #ifdef MOZ_FEEDS this.loadFeed(href);
subscribeToFeed: function(href) {#ifdef MOZ_PLACES#ifdef MOZ_FEEDS // Just load the feed in the content area to either subscribe or show the // preview UI this.loadFeed(href);#else PlacesCommandHook.addLiveBookmark(feeds[0].href);#endif#else#ifdef MOZ_FEEDS // Just load the feed in the content area to either subscribe or show the // preview UI this.loadFeed(href);#else this.addLiveBookmark(feeds[0].href);#endif#endif },
urlSecurityCheck(href, gBrowser.currentURI.spec, Ci.nsIScriptSecurityManager.DISALLOW_SCRIPT_OR_DATA);
subscribeToFeed: function(href, event) { // Just load the feed in the content area to either subscribe or show the // preview UI if (!href) href = event.target.getAttribute("feed"); this.loadFeed(href, event); },
loadURI(href, null, null, false);
this.loadFeed(href);
subscribeToFeed: function(href) {#ifdef MOZ_PLACES#ifdef MOZ_FEEDS // Just load the feed in the content area to either subscribe or show the // preview UI loadURI(href, null, null, false);#else PlacesCommandHook.addLiveBookmark(feeds[0].href);#endif#else#ifdef MOZ_FEEDS // Just load the feed in the content area to either subscribe or show the // preview UI loadURI(href, null, null, false);#else this.addLiveBookmark(feeds[0].href);#endif#endif },
$.ajax({url: "data/json.php", async: false, success: function(data) { result = data; } });
$.ajax({url: "data/json.php", async: false, success: function(data) { ok(true, "sucess callback executed"); result = data; } });
$.ajax({url: "data/json.php", async: false, success: function(data) { result = data; } });
case "cmd_tag":
supportsCommand: function(command) { switch ( command ) { case "cmd_delete": case "cmd_undo": case "cmd_redo": case "cmd_killThread": case "cmd_watchThread": case "button_delete": case "button_junk": case "cmd_shiftDelete": case "cmd_saveAsFile": case "cmd_saveAsTemplate": case "cmd_viewPageSource": case "cmd_getMsgsForAuthAccounts": case "button_mark": case "cmd_markAsRead": case "cmd_markAllRead": case "cmd_markThreadAsRead": case "cmd_markReadByDate": case "cmd_markAsFlagged": case "cmd_label0": case "cmd_label1": case "cmd_label2": case "cmd_label3": case "cmd_label4": case "cmd_label5": case "button_file": case "cmd_file": case "cmd_markAsJunk": case "cmd_markAsNotJunk": case "cmd_recalculateJunkScore": case "cmd_applyFilters": case "cmd_runJunkControls": case "cmd_deleteJunk": case "cmd_nextMsg": case "button_next": case "button_previous": case "cmd_nextUnreadMsg": case "cmd_nextFlaggedMsg": case "cmd_nextUnreadThread": case "cmd_previousMsg": case "cmd_previousUnreadMsg": case "cmd_previousFlaggedMsg": return !(gDBView.keyForFirstSelectedMessage == nsMsgKey_None); case "cmd_reply": case "button_reply": case "cmd_replySender": case "cmd_replyGroup": case "cmd_replyall": case "button_replyall": case "cmd_forward": case "button_forward": case "cmd_forwardInline": case "cmd_forwardAttachment": case "cmd_editAsNew": case "cmd_getNextNMessages": case "cmd_find": case "cmd_findAgain": case "cmd_findPrevious": case "cmd_search": case "cmd_reload": case "cmd_getNewMessages": case "button_getNewMessages": case "button_print": case "cmd_print": case "cmd_printpreview": case "cmd_printSetup": case "cmd_close": case "cmd_settingsOffline": case "cmd_createFilterFromPopup": case "cmd_createFilterFromMenu": return true; case "cmd_synchronizeOffline": case "cmd_downloadFlagged": case "cmd_downloadSelected": return CheckOnline(); default: return false; } },
case "cmd_markReadByDate":
supportsCommand: function(command) { switch (command) { case "cmd_reply": case "button_reply": case "cmd_replySender": case "cmd_replyGroup": case "cmd_replyall": case "button_replyall": case "cmd_forward": case "button_forward": case "cmd_forwardInline": case "cmd_forwardAttachment": case "cmd_editAsNew": case "cmd_delete": case "cmd_undo": case "cmd_redo": case "cmd_killThread": case "cmd_watchThread": case "button_delete": case "button_junk": case "cmd_shiftDelete": case "cmd_saveAsFile": case "cmd_saveAsTemplate": case "cmd_viewPageSource": case "cmd_getMsgsForAuthAccounts": case "button_mark": case "cmd_markAsRead": case "cmd_markAllRead": case "cmd_markThreadAsRead": case "cmd_markAsFlagged": case "cmd_label0": case "cmd_label1": case "cmd_label2": case "cmd_label3": case "cmd_label4": case "cmd_label5": case "button_file": case "cmd_file": case "cmd_markAsJunk": case "cmd_markAsNotJunk": case "cmd_applyFilters": case "cmd_runJunkControls": case "cmd_deleteJunk": case "cmd_nextMsg": case "button_next": case "cmd_nextUnreadMsg": case "cmd_nextFlaggedMsg": case "cmd_nextUnreadThread": case "cmd_previousMsg": case "cmd_previousUnreadMsg": case "cmd_previousFlaggedMsg": return !(gDBView.keyForFirstSelectedMessage == nsMsgKey_None); case "cmd_getNextNMessages": case "cmd_find": case "cmd_findAgain": case "cmd_findPrev": case "cmd_search": case "cmd_reload": case "cmd_getNewMessages": case "button_getNewMessages": case "button_print": case "cmd_print": case "cmd_printpreview": case "cmd_printSetup": case "cmd_close": case "cmd_settingsOffline": case "cmd_createFilterFromPopup": case "cmd_createFilterFromMenu": return true; case "cmd_synchronizeOffline": case "cmd_downloadFlagged": case "cmd_downloadSelected": return CheckOnline(); default: return false; } },
case "cmd_getNewMessages": case "cmd_find": case "cmd_findAgain": case "cmd_markAsRead": case "cmd_markAllRead": case "cmd_markThreadAsRead": case "cmd_markAsFlagged": case "cmd_file":
supportsCommand: function(command) { switch ( command ) { case "cmd_delete": case "button_delete": case "cmd_shiftDelete": case "cmd_print": case "cmd_saveAsFile": case "cmd_saveAsTemplate": case "cmd_viewPageSource": case "cmd_reload": return true; default: return false; } },
case "button_delete":
supportsCommand: function(command) { switch ( command ) { case "cmd_selectAll": case "cmd_delete": return true; default: return false; } },
case "cmd_replySenderAndGroup": case "cmd_replyAllRecipients":
supportsCommand: function(command) { switch (command) { case "cmd_delete": case "cmd_undo": case "cmd_redo": case "cmd_killThread": case "cmd_watchThread": case "button_delete": case "button_junk": case "cmd_shiftDelete": case "cmd_saveAsFile": case "cmd_saveAsTemplate": case "cmd_viewPageSource": case "cmd_getMsgsForAuthAccounts": case "button_mark": case "cmd_markAsRead": case "cmd_markAllRead": case "cmd_markThreadAsRead": case "cmd_markReadByDate": case "cmd_markAsFlagged": case "button_file": case "cmd_file": case "cmd_markAsJunk": case "cmd_markAsNotJunk": case "cmd_recalculateJunkScore": case "cmd_markAsShowRemote": case "cmd_markAsNotPhish": case "cmd_applyFilters": case "cmd_runJunkControls": case "cmd_deleteJunk": case "cmd_nextMsg": case "button_next": case "cmd_nextUnreadMsg": case "cmd_nextFlaggedMsg": case "cmd_nextUnreadThread": case "cmd_previousMsg": case "cmd_previousUnreadMsg": case "cmd_previousFlaggedMsg": return (gDBView.keyForFirstSelectedMessage != nsMsgKey_None); case "cmd_reply": case "button_reply": case "cmd_replySender": case "cmd_replyGroup": case "cmd_replyall": case "button_replyall": case "cmd_forward": case "button_forward": case "cmd_forwardInline": case "cmd_forwardAttachment": case "cmd_editAsNew": case "cmd_getNextNMessages": case "cmd_find": case "cmd_findAgain": case "cmd_findPrev": case "cmd_search": case "cmd_reload": case "cmd_getNewMessages": case "button_getNewMessages": case "button_print": case "cmd_print": case "cmd_printpreview": case "cmd_printSetup": case "cmd_close": case "cmd_settingsOffline": case "cmd_createFilterFromPopup": case "cmd_createFilterFromMenu": return true; case "cmd_synchronizeOffline": case "cmd_downloadFlagged": case "cmd_downloadSelected": return CheckOnline(); default: return false; } },
case "cmd_delete": case "cmd_selectAll":
supportsCommand: function(command) { switch (command) { //File Menu case "cmd_attachFile": case "cmd_attachPage": case "cmd_close": case "cmd_saveDefault": case "cmd_saveAsFile": case "cmd_saveAsDraft": case "cmd_saveAsTemplate": case "cmd_sendButton": case "cmd_sendNow": case "cmd_sendWithCheck": case "cmd_sendLater": case "cmd_printSetup": case "cmd_print": case "cmd_quit": //Edit Menu case "cmd_pasteQuote": case "cmd_find": case "cmd_findNext": case "cmd_account": case "cmd_preferences": //View Menu case "cmd_showComposeToolbar": case "cmd_showFormatToolbar": //Insert Menu case "cmd_renderedHTMLEnabler": case "cmd_insert": case "cmd_link": case "cmd_anchor": case "cmd_image": case "cmd_hline": case "cmd_table": case "cmd_insertHTML": case "cmd_insertChars": case "cmd_insertBreak": case "cmd_insertBreakAll": //Format Menu case "cmd_decreaseFont": case "cmd_increaseFont": case "cmd_bold": case "cmd_italic": case "cmd_underline": case "cmd_strikethrough": case "cmd_superscript": case "cmd_subscript": case "cmd_nobreak": case "cmd_em": case "cmd_strong": case "cmd_cite": case "cmd_abbr": case "cmd_acronym": case "cmd_code": case "cmd_samp": case "cmd_var": case "cmd_removeList": case "cmd_ul": case "cmd_ol": case "cmd_dt": case "cmd_dd": case "cmd_listProperties": case "cmd_indent": case "cmd_outdent": case "cmd_objectProperties": case "cmd_InsertTable": case "cmd_InsertRowAbove": case "cmd_InsertRowBelow": case "cmd_InsertColumnBefore": case "cmd_InsertColumnAfter": case "cmd_SelectTable": case "cmd_SelectRow": case "cmd_SelectColumn": case "cmd_SelectCell": case "cmd_SelectAllCells": case "cmd_DeleteTable": case "cmd_DeleteRow": case "cmd_DeleteColumn": case "cmd_DeleteCell": case "cmd_DeleteCellContents": case "cmd_NormalizeTable": case "cmd_tableJoinCells": case "cmd_tableSplitCell": case "cmd_editTable": //Options Menu case "cmd_selectAddress": case "cmd_spelling": case "cmd_outputFormat":// case "cmd_quoteMessage": case "cmd_rewrap": return true; default:// dump("##MsgCompose: command " + command + "no supported!\n"); return false; } },
case "cmd_sendWithCheck":
supportsCommand: function(command) { switch (command) { //File Menu case "cmd_attachFile": case "cmd_attachPage": case "cmd_close": case "cmd_saveDefault": case "cmd_saveAsFile": case "cmd_saveAsDraft": case "cmd_saveAsTemplate": case "cmd_sendButton": case "cmd_sendNow": case "cmd_sendLater":// case "cmd_printSetup": case "cmd_print": case "cmd_quit": //Edit Menu case "cmd_pasteQuote": case "cmd_find": case "cmd_findNext": case "cmd_account": case "cmd_preferences": //View Menu case "cmd_showComposeToolbar": case "cmd_showFormatToolbar": //Insert Menu case "cmd_renderedHTMLEnabler": case "cmd_insert": case "cmd_link": case "cmd_anchor": case "cmd_image": case "cmd_hline": case "cmd_table": case "cmd_insertHTML": case "cmd_insertChars": case "cmd_insertBreak": case "cmd_insertBreakAll": //Format Menu case "cmd_decreaseFont": case "cmd_increaseFont": case "cmd_bold": case "cmd_italic": case "cmd_underline": case "cmd_strikethrough": case "cmd_superscript": case "cmd_subscript": case "cmd_nobreak": case "cmd_em": case "cmd_strong": case "cmd_cite": case "cmd_abbr": case "cmd_acronym": case "cmd_code": case "cmd_samp": case "cmd_var": case "cmd_removeList": case "cmd_ul": case "cmd_ol": case "cmd_dt": case "cmd_dd": case "cmd_listProperties": case "cmd_indent": case "cmd_outdent": case "cmd_objectProperties": case "cmd_InsertTable": case "cmd_InsertRowAbove": case "cmd_InsertRowBelow": case "cmd_InsertColumnBefore": case "cmd_InsertColumnAfter": case "cmd_SelectTable": case "cmd_SelectRow": case "cmd_SelectColumn": case "cmd_SelectCell": case "cmd_SelectAllCells": case "cmd_DeleteTable": case "cmd_DeleteRow": case "cmd_DeleteColumn": case "cmd_DeleteCell": case "cmd_DeleteCellContents": case "cmd_NormalizeTable": case "cmd_tableJoinCells": case "cmd_tableSplitCell": case "cmd_editTable": //Options Menu case "cmd_selectAddress": case "cmd_spelling": case "cmd_outputFormat":// case "cmd_quoteMessage": case "cmd_rewrap": return true; default:// dump("##MsgCompose: command " + command + "no supported!\n"); return false; } },
return CheckOnline();
return MailOfflineMgr.isOnline();
supportsCommand: function(command) { switch ( command ) { case "cmd_delete": case "cmd_undo": case "cmd_redo": case "cmd_killThread": case "cmd_watchThread": case "button_delete": case "button_junk": case "cmd_shiftDelete": case "cmd_saveAsFile": case "cmd_saveAsTemplate": case "cmd_viewPageSource": case "cmd_getMsgsForAuthAccounts": case "cmd_tag": case "button_mark": case "cmd_markAsRead": case "cmd_markAllRead": case "cmd_markThreadAsRead": case "cmd_markReadByDate": case "cmd_markAsFlagged": case "button_file": case "cmd_file": case "cmd_markAsJunk": case "cmd_markAsNotJunk": case "cmd_recalculateJunkScore": case "cmd_applyFilters": case "cmd_runJunkControls": case "cmd_deleteJunk": case "cmd_nextMsg": case "button_next": case "button_previous": case "cmd_nextUnreadMsg": case "cmd_nextFlaggedMsg": case "cmd_nextUnreadThread": case "cmd_previousMsg": case "cmd_previousUnreadMsg": case "cmd_previousFlaggedMsg": case "cmd_goForward": case "cmd_goBack": case "button_goForward": case "button_goBack": return !(gDBView.keyForFirstSelectedMessage == nsMsgKey_None); case "cmd_reply": case "button_reply": case "cmd_replySender": case "cmd_replyGroup": case "cmd_replyall": case "button_replyall": case "cmd_forward": case "button_forward": case "cmd_forwardInline": case "cmd_forwardAttachment": case "cmd_editAsNew": case "cmd_getNextNMessages": case "cmd_find": case "cmd_findAgain": case "cmd_findPrevious": case "cmd_search": case "cmd_reload": case "cmd_getNewMessages": case "button_getNewMessages": case "button_print": case "cmd_print": case "cmd_printpreview": case "cmd_printSetup": case "cmd_close": case "cmd_settingsOffline": case "cmd_createFilterFromPopup": case "cmd_createFilterFromMenu": case "cmd_moveToFolderAgain": return true; case "cmd_synchronizeOffline": case "cmd_downloadFlagged": case "cmd_downloadSelected": return CheckOnline(); default: return false; } },
case "cmd_label0": case "cmd_label1": case "cmd_label2": case "cmd_label3": case "cmd_label4": case "cmd_label5":
supportsCommand: function(command) { switch ( command ) { case "cmd_close": case "cmd_reply": case "button_reply": case "cmd_replySender": case "cmd_replyGroup": case "cmd_replyall": case "button_replyall": case "cmd_forward": case "button_forward": case "cmd_forwardInline": case "cmd_forwardAttachment": case "cmd_editAsNew": case "cmd_createFilterFromPopup": case "cmd_createFilterFromMenu": case "cmd_delete": case "cmd_undo": case "cmd_redo": case "cmd_killThread": case "cmd_watchThread": case "button_delete": case "cmd_shiftDelete": case "button_print": case "cmd_print": case "cmd_printSetup": case "cmd_saveAsFile": case "cmd_saveAsTemplate": case "cmd_viewPageSource": case "cmd_reload": case "cmd_getNewMessages": case "button_getNewMessages": case "cmd_getMsgsForAuthAccounts": case "cmd_getNextNMessages": case "cmd_find": case "cmd_findAgain": case "cmd_search": case "button_mark": case "cmd_markAsRead": case "cmd_markAllRead": case "cmd_markThreadAsRead": case "cmd_markAsFlagged": case "button_file": case "cmd_file": case "cmd_settingsOffline": case "cmd_nextMsg": case "button_next": case "cmd_nextUnreadMsg": case "cmd_nextFlaggedMsg": case "cmd_nextUnreadThread": case "cmd_previousMsg": case "cmd_previousUnreadMsg": case "cmd_previousFlaggedMsg": return true; case "cmd_synchronizeOffline": case "cmd_downloadFlagged": case "cmd_downloadSelected": return CheckOnline(); default: return false; } },
case "cmd_getMsgsForAuthAccounts":
supportsCommand: function(command) { switch ( command ) { case "cmd_reply": case "button_reply": case "cmd_replySender": case "cmd_replyGroup": case "cmd_replyall": case "button_replyall": case "cmd_forward": case "button_forward": case "cmd_forwardInline": case "cmd_forwardAttachment": case "cmd_editAsNew": case "cmd_delete": case "button_delete": case "cmd_shiftDelete": case "cmd_print": case "cmd_saveAsFile": case "cmd_saveAsTemplate": case "cmd_viewPageSource": case "cmd_reload": case "cmd_getNewMessages": case "cmd_getNextNMessages": case "cmd_find": case "cmd_findAgain": case "cmd_markAsRead": case "cmd_markAllRead": case "cmd_markThreadAsRead": case "cmd_markAsFlagged": case "cmd_file": case "cmd_downloadFlagged": return true; default: return false; } },
dd ("get stack context...");
function sv_getcx(cx){ dd ("get stack context..."); if (!cx) cx = new Object(); var selection = this.outliner.selection; var rec = this.childData.locateChildByVisualRow(selection.currentIndex); if (!rec) { dd ("no current index."); return cx; } cx.target = rec; if (rec instanceof FrameRecord) { cx.frameIndex = rec.childIndex; } else if (rec instanceof ValueRecord) { cx.jsdValue = rec.value; } if (!("frameIndex" in cx)) { var parent = rec.parentRecord; if (!parent) dd ("no parent!"); while (parent && !(parent instanceof FrameRecord)) parent = parent.parentRecord; if (parent instanceof FrameRecord) cx.frameIndex = parent.childIndex; } var rangeCount = this.outliner.selection.getRangeCount(); if (rangeCount > 0) cx.jsdValueList = new Array(); for (var range = 0; range < rangeCount; ++range) { var min = new Object(); var max = new Object(); this.outliner.selection.getRangeAt(range, min, max); for (var i = min; i < max; ++i) { rec = this.childData.locateChildByVisualRow(i); if (rec instanceof ValueRecord) cx.jsdValueList.push(rec.value); } } return cx;}
if (!parent) dd ("no parent!");
function sv_getcx(cx){ dd ("get stack context..."); if (!cx) cx = new Object(); var selection = this.outliner.selection; var rec = this.childData.locateChildByVisualRow(selection.currentIndex); if (!rec) { dd ("no current index."); return cx; } cx.target = rec; if (rec instanceof FrameRecord) { cx.frameIndex = rec.childIndex; } else if (rec instanceof ValueRecord) { cx.jsdValue = rec.value; } if (!("frameIndex" in cx)) { var parent = rec.parentRecord; if (!parent) dd ("no parent!"); while (parent && !(parent instanceof FrameRecord)) parent = parent.parentRecord; if (parent instanceof FrameRecord) cx.frameIndex = parent.childIndex; } var rangeCount = this.outliner.selection.getRangeCount(); if (rangeCount > 0) cx.jsdValueList = new Array(); for (var range = 0; range < rangeCount; ++range) { var min = new Object(); var max = new Object(); this.outliner.selection.getRangeAt(range, min, max); for (var i = min; i < max; ++i) { rec = this.childData.locateChildByVisualRow(i); if (rec instanceof ValueRecord) cx.jsdValueList.push(rec.value); } } return cx;}
var prefs = [ ["sourceView.enableMenuItem", false] ];
console.prefManager.addPref("sourceView.enableMenuItem", false); this.enableMenuItem = console.prefs["sourceView.enableMenuItem"];
function sv_init(){ this.savedState = new Object(); var prefs = [ ["sourceView.enableMenuItem", false] ]; console.menuSpecs["context:source"] = { getContext: this.getContext, items: [ ["break", {enabledif: "cx.lineIsExecutable && !has('hasBreak')"}], ["clear", {enabledif: "has('hasBreak')"}], ["fbreak", {enabledif: "!has('hasFBreak')"}], ["fclear", {enabledif: "has('hasFBreak')"}], ["-"], ["run-to"], ["cont"], ["next"], ["step"], ["finish"], ["-"], ["toggle-pprint", {type: "checkbox", checkedif: "console.prefs['prettyprint']"}], ["-"], ["break-props"] ] }; this.caption = MSG_VIEW_SOURCE; this.enableMenuItem = console.prefs["sourceView.enableMenuItem"]; var atomsvc = console.atomService; this.atomCurrent = atomsvc.getAtom("current-line"); this.atomHighlightStart = atomsvc.getAtom("highlight-start"); this.atomHighlightRange = atomsvc.getAtom("highlight-range"); this.atomHighlightEnd = atomsvc.getAtom("highlight-end"); this.atomBreak = atomsvc.getAtom("breakpoint"); this.atomFBreak = atomsvc.getAtom("future-breakpoint"); this.atomCode = atomsvc.getAtom("code"); this.atomPrettyPrint = atomsvc.getAtom("prettyprint"); this.atomWhitespace = atomsvc.getAtom("whitespace");}
this.enableMenuItem = console.prefs["sourceView.enableMenuItem"];
function sv_init(){ this.savedState = new Object(); var prefs = [ ["sourceView.enableMenuItem", false] ]; console.menuSpecs["context:source"] = { getContext: this.getContext, items: [ ["break", {enabledif: "cx.lineIsExecutable && !has('hasBreak')"}], ["clear", {enabledif: "has('hasBreak')"}], ["fbreak", {enabledif: "!has('hasFBreak')"}], ["fclear", {enabledif: "has('hasFBreak')"}], ["-"], ["run-to"], ["cont"], ["next"], ["step"], ["finish"], ["-"], ["toggle-pprint", {type: "checkbox", checkedif: "console.prefs['prettyprint']"}], ["-"], ["break-props"] ] }; this.caption = MSG_VIEW_SOURCE; this.enableMenuItem = console.prefs["sourceView.enableMenuItem"]; var atomsvc = console.atomService; this.atomCurrent = atomsvc.getAtom("current-line"); this.atomHighlightStart = atomsvc.getAtom("highlight-start"); this.atomHighlightRange = atomsvc.getAtom("highlight-range"); this.atomHighlightEnd = atomsvc.getAtom("highlight-end"); this.atomBreak = atomsvc.getAtom("breakpoint"); this.atomFBreak = atomsvc.getAtom("future-breakpoint"); this.atomCode = atomsvc.getAtom("code"); this.atomPrettyPrint = atomsvc.getAtom("prettyprint"); this.atomWhitespace = atomsvc.getAtom("whitespace");}
if (!this.childData || !this.childData.isLoaded)
if (!("childData" in this) || !this.childData.isLoaded)
function sv_lscroll (line){ if (!this.childData || !this.childData.isLoaded) { /* the source hasn't been loaded yet, queue the scroll for later. */ this.pendingScroll = [line, 0]; return; } var first = this.outliner.getFirstVisibleRow(); var last = this.outliner.getLastVisibleRow(); var fuzz = 2; if (line < (first + fuzz) || line > (last - fuzz)) this.scrollTo (line, 0);}
if (!this.childData || !this.childData.isLoaded)
if (!("childData" in this) || !this.childData.isLoaded)
function sv_scrollto (line, align){ if (!this.childData || !this.childData.isLoaded) { /* the source hasn't been loaded yet, store line/align for processing * when the load is done. */ this.pendingScroll = [line, align]; return; } this._scrollTo(line, align);}
id = this.id.replace("img_","") part = FetchElement("part_"+id) disp = part.style.display
id = this.id.replace("img_",""); part = FetchElement("part_"+id); disp = part.style.display;
function Switch(switchimg) { switchimg.onclick = function() { id = this.id.replace("img_","") part = FetchElement("part_"+id) disp = part.style.display if(disp == 'none') { switchimg.src = box_img_minus part.style.display = '' KillCookie(id) } else { switchimg.src = box_img_plus part.style.display = 'none' SetCookie(id) } }}
switchimg.src = box_img_minus part.style.display = '' KillCookie(id)
switchimg.src = box_img_minus; part.style.display = ''; KillCookie(id);
function Switch(switchimg) { switchimg.onclick = function() { id = this.id.replace("img_","") part = FetchElement("part_"+id) disp = part.style.display if(disp == 'none') { switchimg.src = box_img_minus part.style.display = '' KillCookie(id) } else { switchimg.src = box_img_plus part.style.display = 'none' SetCookie(id) } }}
switchimg.src = box_img_plus part.style.display = 'none' SetCookie(id)
switchimg.src = box_img_plus; part.style.display = 'none'; SetCookie(id);
function Switch(switchimg) { switchimg.onclick = function() { id = this.id.replace("img_","") part = FetchElement("part_"+id) disp = part.style.display if(disp == 'none') { switchimg.src = box_img_minus part.style.display = '' KillCookie(id) } else { switchimg.src = box_img_plus part.style.display = 'none' SetCookie(id) } }}
var calendarNode = gCalendarWindow.calendarManager.rdf.getNode( event.currentTarget.getAttribute( "id" ) );
function switchCalendar( event ){ dump( "\nRemoveCalendar in calendarManager.js: button is "+event.button ); if (event.button != 0) { return; } //document.getElementById( "calendar-list-item-"+ThisCalendarObject.serverNumber ); if( event.currentTarget.childNodes[0].getAttribute( "checked" ) != "true" ) { gCalendarWindow.calendarManager.addCalendar( event.currentTarget.calendarObject ); event.currentTarget.calendarObject.active = true; event.currentTarget.childNodes[0].setAttribute( "checked", "true" ); } else { gCalendarWindow.calendarManager.removeCalendar( event.currentTarget.calendarObject ); event.currentTarget.calendarObject.active = false; event.currentTarget.childNodes[0].removeAttribute( "checked" ); } refreshEventTree( false ); refreshToDoTree( false ); gCalendarWindow.currentView.refreshEvents();}
gCalendarWindow.calendarManager.addCalendar( event.currentTarget.calendarObject ); event.currentTarget.calendarObject.active = true;
gCalendarWindow.eventSource.gICalLib.addCalendar( calendarNode.getAttribute( "http: calendarNode.setAttribute( "http:
function switchCalendar( event ){ dump( "\nRemoveCalendar in calendarManager.js: button is "+event.button ); if (event.button != 0) { return; } //document.getElementById( "calendar-list-item-"+ThisCalendarObject.serverNumber ); if( event.currentTarget.childNodes[0].getAttribute( "checked" ) != "true" ) { gCalendarWindow.calendarManager.addCalendar( event.currentTarget.calendarObject ); event.currentTarget.calendarObject.active = true; event.currentTarget.childNodes[0].setAttribute( "checked", "true" ); } else { gCalendarWindow.calendarManager.removeCalendar( event.currentTarget.calendarObject ); event.currentTarget.calendarObject.active = false; event.currentTarget.childNodes[0].removeAttribute( "checked" ); } refreshEventTree( false ); refreshToDoTree( false ); gCalendarWindow.currentView.refreshEvents();}
gCalendarWindow.calendarManager.removeCalendar( event.currentTarget.calendarObject ); event.currentTarget.calendarObject.active = false;
gCalendarWindow.eventSource.gICalLib.removeCalendar( calendarNode.getAttribute( "http: calendarNode.setAttribute( "http:
function switchCalendar( event ){ dump( "\nRemoveCalendar in calendarManager.js: button is "+event.button ); if (event.button != 0) { return; } //document.getElementById( "calendar-list-item-"+ThisCalendarObject.serverNumber ); if( event.currentTarget.childNodes[0].getAttribute( "checked" ) != "true" ) { gCalendarWindow.calendarManager.addCalendar( event.currentTarget.calendarObject ); event.currentTarget.calendarObject.active = true; event.currentTarget.childNodes[0].setAttribute( "checked", "true" ); } else { gCalendarWindow.calendarManager.removeCalendar( event.currentTarget.calendarObject ); event.currentTarget.calendarObject.active = false; event.currentTarget.childNodes[0].removeAttribute( "checked" ); } refreshEventTree( false ); refreshToDoTree( false ); gCalendarWindow.currentView.refreshEvents();}
gCalendarWindow.calendarManager.rdf.flush();
function switchCalendar( event ){ dump( "\nRemoveCalendar in calendarManager.js: button is "+event.button ); if (event.button != 0) { return; } //document.getElementById( "calendar-list-item-"+ThisCalendarObject.serverNumber ); if( event.currentTarget.childNodes[0].getAttribute( "checked" ) != "true" ) { gCalendarWindow.calendarManager.addCalendar( event.currentTarget.calendarObject ); event.currentTarget.calendarObject.active = true; event.currentTarget.childNodes[0].setAttribute( "checked", "true" ); } else { gCalendarWindow.calendarManager.removeCalendar( event.currentTarget.calendarObject ); event.currentTarget.calendarObject.active = false; event.currentTarget.childNodes[0].removeAttribute( "checked" ); } refreshEventTree( false ); refreshToDoTree( false ); gCalendarWindow.currentView.refreshEvents();}
var windowManager = Components.classes['component:
var windowManager = Components.classes['@mozilla.org/rdf/datasource;1?name=window-mediator'].getService();
function SwitchInsertCharToAnotherEditorOrClose(){ if (window.InsertCharWindow) { var windowManager = Components.classes['component://netscape/rdf/datasource?name=window-mediator'].getService(); var windowManagerInterface = windowManager.QueryInterface( Components.interfaces.nsIWindowMediator); var enumerator = windowManagerInterface.getEnumerator( null ); // TODO: Fix this to search for command controllers and look for "cmd_InsertChars" // For now, detect just Web Composer and HTML Mail Composer while ( enumerator.hasMoreElements() ) { var tempWindow = enumerator.getNext(); if (tempWindow != window && tempWindow.editorShell && tempWindow.gIsHTMLEditor || tempWindow.editorShell.editorType == "htmlmail")// tempWindow.editorShell.editorDocument.commandDispatcher.getControllerForCommand("cmd_InsertChars")) { tempWindow.InsertCharWindow = window.InsertCharWindow; window.InsertCharWindow = null; tempWindow.InsertCharWindow.editorShell = tempWindow.editorShell; tempWindow.InsertCharWindow.opener = tempWindow; return; } } // Didn't find another editor - close the dialog window.InsertCharWindow.close(); }}
var focusedElement = WhichPaneHasFocus();
function SwitchPaneFocus(event){ var focusedElement = WhichPaneHasFocus(); var folderTree = GetFolderTree(); var threadTree = GetThreadTree(); var searchInput = GetSearchInput(); var messagePane = GetMessagePane(); if (event && event.shiftKey) { if (focusedElement == threadTree && searchInput.parentNode.getAttribute('hidden') != 'true') searchInput.focus(); else if ((focusedElement == threadTree || focusedElement == searchInput) && !IsFolderPaneCollapsed()) folderTree.focus(); else if (focusedElement != messagePane && !IsMessagePaneCollapsed()) SetFocusMessagePane(); else threadTree.focus(); } else { if (focusedElement == searchInput) threadTree.focus(); else if (focusedElement == threadTree && !IsMessagePaneCollapsed()) SetFocusMessagePane(); else if (focusedElement != folderTree && !IsFolderPaneCollapsed()) folderTree.focus(); else if (searchInput.parentNode.getAttribute('hidden') != 'true') searchInput.focus(); else threadTree.focus(); }}
var searchInput = GetSearchInput();
function SwitchPaneFocus(event){ var focusedElement = WhichPaneHasFocus(); var folderTree = GetFolderTree(); var threadTree = GetThreadTree(); var searchInput = GetSearchInput(); var messagePane = GetMessagePane(); if (event && event.shiftKey) { if (focusedElement == threadTree && searchInput.parentNode.getAttribute('hidden') != 'true') searchInput.focus(); else if ((focusedElement == threadTree || focusedElement == searchInput) && !IsFolderPaneCollapsed()) folderTree.focus(); else if (focusedElement != messagePane && !IsMessagePaneCollapsed()) SetFocusMessagePane(); else threadTree.focus(); } else { if (focusedElement == searchInput) threadTree.focus(); else if (focusedElement == threadTree && !IsMessagePaneCollapsed()) SetFocusMessagePane(); else if (focusedElement != folderTree && !IsFolderPaneCollapsed()) folderTree.focus(); else if (searchInput.parentNode.getAttribute('hidden') != 'true') searchInput.focus(); else threadTree.focus(); }}
if (focusedElement == threadTree && searchInput.parentNode.getAttribute('hidden') != 'true') searchInput.focus(); else if ((focusedElement == threadTree || focusedElement == searchInput) && !IsFolderPaneCollapsed())
if (focusedElement == threadTree && !IsFolderPaneCollapsed())
function SwitchPaneFocus(event){ var focusedElement = WhichPaneHasFocus(); var folderTree = GetFolderTree(); var threadTree = GetThreadTree(); var searchInput = GetSearchInput(); var messagePane = GetMessagePane(); if (event && event.shiftKey) { if (focusedElement == threadTree && searchInput.parentNode.getAttribute('hidden') != 'true') searchInput.focus(); else if ((focusedElement == threadTree || focusedElement == searchInput) && !IsFolderPaneCollapsed()) folderTree.focus(); else if (focusedElement != messagePane && !IsMessagePaneCollapsed()) SetFocusMessagePane(); else threadTree.focus(); } else { if (focusedElement == searchInput) threadTree.focus(); else if (focusedElement == threadTree && !IsMessagePaneCollapsed()) SetFocusMessagePane(); else if (focusedElement != folderTree && !IsFolderPaneCollapsed()) folderTree.focus(); else if (searchInput.parentNode.getAttribute('hidden') != 'true') searchInput.focus(); else threadTree.focus(); }}
if (focusedElement == searchInput) threadTree.focus(); else if (focusedElement == threadTree && !IsMessagePaneCollapsed())
if (focusedElement == threadTree && !IsMessagePaneCollapsed())
function SwitchPaneFocus(event){ var focusedElement = WhichPaneHasFocus(); var folderTree = GetFolderTree(); var threadTree = GetThreadTree(); var searchInput = GetSearchInput(); var messagePane = GetMessagePane(); if (event && event.shiftKey) { if (focusedElement == threadTree && searchInput.parentNode.getAttribute('hidden') != 'true') searchInput.focus(); else if ((focusedElement == threadTree || focusedElement == searchInput) && !IsFolderPaneCollapsed()) folderTree.focus(); else if (focusedElement != messagePane && !IsMessagePaneCollapsed()) SetFocusMessagePane(); else threadTree.focus(); } else { if (focusedElement == searchInput) threadTree.focus(); else if (focusedElement == threadTree && !IsMessagePaneCollapsed()) SetFocusMessagePane(); else if (focusedElement != folderTree && !IsFolderPaneCollapsed()) folderTree.focus(); else if (searchInput.parentNode.getAttribute('hidden') != 'true') searchInput.focus(); else threadTree.focus(); }}
else if (searchInput.parentNode.getAttribute('hidden') != 'true') searchInput.focus();
function SwitchPaneFocus(event){ var focusedElement = WhichPaneHasFocus(); var folderTree = GetFolderTree(); var threadTree = GetThreadTree(); var searchInput = GetSearchInput(); var messagePane = GetMessagePane(); if (event && event.shiftKey) { if (focusedElement == threadTree && searchInput.parentNode.getAttribute('hidden') != 'true') searchInput.focus(); else if ((focusedElement == threadTree || focusedElement == searchInput) && !IsFolderPaneCollapsed()) folderTree.focus(); else if (focusedElement != messagePane && !IsMessagePaneCollapsed()) SetFocusMessagePane(); else threadTree.focus(); } else { if (focusedElement == searchInput) threadTree.focus(); else if (focusedElement == threadTree && !IsMessagePaneCollapsed()) SetFocusMessagePane(); else if (focusedElement != folderTree && !IsFolderPaneCollapsed()) folderTree.focus(); else if (searchInput.parentNode.getAttribute('hidden') != 'true') searchInput.focus(); else threadTree.focus(); }}