rem
stringlengths 0
126k
| add
stringlengths 0
441k
| context
stringlengths 15
136k
|
---|---|---|
args.eventSource = gEventSource; | function print(){ var args = new Object(); args.eventSource = gEventSource; args.selectedEvents = gCalendarWindow.EventSelection.selectedEvents ; args.selectedDate=gNewDateVariable = gCalendarWindow.getSelectedDate(); var Offset = getIntPref(gCalendarWindow.calendarPreferences.calendarPref, "week.start", gCalendarBundle.getString("defaultWeekStart" ) ); var WeeksInView = getIntPref(gCalendarWindow.calendarPreferences.calendarPref, "weeks.inview", gCalendarBundle.getString("defaultWeeksInView" ) ); WeeksInView = ( WeeksInView >= 6 ) ? 6 : WeeksInView ; var PreviousWeeksInView = getIntPref(gCalendarWindow.calendarPreferences.calendarPref, "previousweeks.inview", gCalendarBundle.getString("defaultPreviousWeeksInView" ) ); PreviousWeeksInView = ( PreviousWeeksInView >= WeeksInView - 1 ) ? WeeksInView - 1 : PreviousWeeksInView ; args.startOfWeek=Offset; args.weeksInView=WeeksInView; args.prevWeeksInView=PreviousWeeksInView; window.openDialog("chrome://calendar/content/printDialog.xul","printdialog","chrome",args);} |
|
var ccalendar = getDisplayComposite(); | var ccalendar = getCompositeCalendar(); | function printCalendar() { var ccalendar = getDisplayComposite(); var start; var end; var eventList; var listener = { mEventArray: new Array(), onOperationComplete: function (aCalendar, aStatus, aOperationType, aId, aDateTime) { printInitWindow(listener.mEventArray, start, end); }, onGetResult: function (aCalendar, aStatus, aItemType, aDetail, aCount, aItems) { for (var i = 0; i < aCount; i++) { listener.mEventArray.push(aItems[i]); } } }; var filter = ccalendar.ITEM_FILTER_TYPE_EVENT | ccalendar.ITEM_FILTER_CLASS_OCCURRENCES; var start; var end; switch (document.getElementById("view-field").selectedItem.value) { case 'currentview': case '': //just in case start = window.opener.document.getElementById("view-deck").selectedPanel.startDay; end = window.opener.document.getElementById("view-deck").selectedPanel.endDay; break; case 'selected' : eventList = gCalendarWindow.EventSelection.selectedEvents; break; case 'custom' : start = jsDateToDateTime(document.getElementById("start-date-picker").value); end = jsDateToDateTime(document.getElementById("end-date-picker").value); break ; default : dump("Error : no case in printDialog.js::printCalendar()"); } if (!eventList) { // end isn't exclusive, so we need to add one day end = end.clone(); end.day = end.day + 1; end.normalize(); ccalendar.getItems(filter, 0, start, end, listener); } else { printInitWindow(eventList, null, null); }} |
displayEnd = gCalendarWindow.currentView.lastDateOfView; | displayEnd = gCalendarWindow.currentView.endExDateOfView; | function printCalendar() { var ccalendar = getDisplayComposite(); var listener = { mEventArray: new Array(), onOperationComplete: function (aCalendar, aStatus, aOperationType, aId, aDateTime) { printInitWindow(listener.mEventArray); }, onGetResult: function (aCalendar, aStatus, aItemType, aDetail, aCount, aItems) { for (var i = 0; i < aCount; i++) { listener.mEventArray.push(aItems[i]); } } }; var filter = ccalendar.ITEM_FILTER_TYPE_EVENT | ccalendar.ITEM_FILTER_CLASS_OCCURRENCES; switch( document.getElementById("view-field").value ) { case 'currentview': case '': //just in case var displayStart = gCalendarWindow.currentView.displayStartDate; var displayEnd = gCalendarWindow.currentView.displayEndDate; //multiweek and month views call their display range something else if(!displayStart) { displayStart = gCalendarWindow.currentView.firstDateOfView; displayEnd = gCalendarWindow.currentView.lastDateOfView; } ccalendar.getItems(filter, 0, jsDateToDateTime(displayStart), jsDateToDateTime(displayEnd), listener); break; case 'list' : printInitWindow(gCalendarWindow.EventSelection.selectedEvents); break; case 'custom' : var start = document.getElementById("start-date-picker").value; var end = document.getElementById("end-date-picker").value; ccalendar.getItems(filter, 0, jsDateToDateTime(start), jsDateToDateTime(end), listener); break ; default : dump("Error : no case in printDialog.js::printCalendar()"); }} |
printEngine = Components.classes[printEngineProgID].createInstance(); | printEngine = Components.classes[printEngineContractID].createInstance(); | function PrintEngineCreateGlobals(){ /* get the print engine instance */ printEngine = Components.classes[printEngineProgID].createInstance(); printEngine = printEngine.QueryInterface(Components.interfaces.nsIMsgPrintEngine);} |
numMessages, messageList, statusFeedback); | numMessages, messageList, statusFeedback, gPrintSettings); | function PrintEnginePrint(){ var messageList = GetSelectedMessages(); var numMessages = messageList.length; if (numMessages == 0) { dump("PrintEnginePrint(): No messages selected.\n"); return false; } printEngineWindow = window.openDialog("chrome://messenger/content/msgPrintEngine.xul", "", "chrome,dialog=no,all", numMessages, messageList, statusFeedback); return true;} |
msg = msg.toString(); | function printStatus (msg){ var lines = msg.split ("\n"); var l; for (var i=0; i<lines.length; i++) writeLineToLog (STATUS + lines[i]);} |
|
msg = msg.toString(); | function printStatus (msg){ var lines = msg.split ("\n"); var l; for (var i=0; i<lines.length; i++) print (STATUS + lines[i]);} |
|
switch (target.getAttribute('id')) { case "priority_lowest": msgCompFields.priority = "lowest"; break; case "priority_low": msgCompFields.priority = "low"; break; case "priority_normal": msgCompFields.priority = "normal"; break; case "priority_high": msgCompFields.priority = "high"; break; case "priotity_highest": msgCompFields.priority = "highest"; break; } | msgCompFields.priority = target.getAttribute('value'); updatePriorityToolbarButton(target.getAttribute('value')); | function PriorityMenuSelect(target){ if (gMsgCompose) { var msgCompFields = gMsgCompose.compFields; if (msgCompFields) switch (target.getAttribute('id')) { case "priority_lowest": msgCompFields.priority = "lowest"; break; case "priority_low": msgCompFields.priority = "low"; break; case "priority_normal": msgCompFields.priority = "normal"; break; case "priority_high": msgCompFields.priority = "high"; break; case "priotity_highest": msgCompFields.priority = "highest"; break; } }} |
hideElement("alarm-length-field"); hideElement("alarm-length-units"); hideElement("alarm-box-email"); | disableElement("alarm-length-field"); disableElement("alarm-length-units"); disableElement("alarm-email-field-label"); disableElement("alarm-email-field"); | function processAlarmType(){ var alarmMenu = document.getElementById("alarm-type"); if( alarmMenu.selectedItem ) { debug("processAlarmType: " + alarmMenu.selectedItem.value ); switch( alarmMenu.selectedItem.value ) { case "none": hideElement("alarm-length-field"); hideElement("alarm-length-units"); hideElement("alarm-box-email"); break; //case "popupAndSound": case "popup": showElement("alarm-length-field"); showElement("alarm-length-units"); hideElement("alarm-box-email"); break; case "email": showElement("alarm-length-field"); showElement("alarm-length-units"); showElement("alarm-box-email"); break; } // Make the window big enough for all the fields and widgets window.sizeToContent(); } else dump("processAlarmType: no alarmMenu.selectedItem!\n");} |
showElement("alarm-length-field"); showElement("alarm-length-units"); hideElement("alarm-box-email"); | enableElement("alarm-length-field"); enableElement("alarm-length-units"); disableElement("alarm-email-field-label"); disableElement("alarm-email-field"); | function processAlarmType(){ var alarmMenu = document.getElementById("alarm-type"); if( alarmMenu.selectedItem ) { debug("processAlarmType: " + alarmMenu.selectedItem.value ); switch( alarmMenu.selectedItem.value ) { case "none": hideElement("alarm-length-field"); hideElement("alarm-length-units"); hideElement("alarm-box-email"); break; //case "popupAndSound": case "popup": showElement("alarm-length-field"); showElement("alarm-length-units"); hideElement("alarm-box-email"); break; case "email": showElement("alarm-length-field"); showElement("alarm-length-units"); showElement("alarm-box-email"); break; } // Make the window big enough for all the fields and widgets window.sizeToContent(); } else dump("processAlarmType: no alarmMenu.selectedItem!\n");} |
showElement("alarm-length-field"); showElement("alarm-length-units"); showElement("alarm-box-email"); | enableElement("alarm-length-field"); enableElement("alarm-length-units"); enableElement("alarm-email-field-label"); enableElement("alarm-email-field"); | function processAlarmType(){ var alarmMenu = document.getElementById("alarm-type"); if( alarmMenu.selectedItem ) { debug("processAlarmType: " + alarmMenu.selectedItem.value ); switch( alarmMenu.selectedItem.value ) { case "none": hideElement("alarm-length-field"); hideElement("alarm-length-units"); hideElement("alarm-box-email"); break; //case "popupAndSound": case "popup": showElement("alarm-length-field"); showElement("alarm-length-units"); hideElement("alarm-box-email"); break; case "email": showElement("alarm-length-field"); showElement("alarm-length-units"); showElement("alarm-box-email"); break; } // Make the window big enough for all the fields and widgets window.sizeToContent(); } else dump("processAlarmType: no alarmMenu.selectedItem!\n");} |
window.sizeToContent(); | function processAlarmType(){ var alarmMenu = document.getElementById("alarm-type"); if( alarmMenu.selectedItem ) { debug("processAlarmType: " + alarmMenu.selectedItem.value ); switch( alarmMenu.selectedItem.value ) { case "none": hideElement("alarm-length-field"); hideElement("alarm-length-units"); hideElement("alarm-box-email"); break; //case "popupAndSound": case "popup": showElement("alarm-length-field"); showElement("alarm-length-units"); hideElement("alarm-box-email"); break; case "email": showElement("alarm-length-field"); showElement("alarm-length-units"); showElement("alarm-box-email"); break; } // Make the window big enough for all the fields and widgets window.sizeToContent(); } else dump("processAlarmType: no alarmMenu.selectedItem!\n");} |
|
var title; | function processComponentType(componentType){ var title; var componentMenu = document.getElementById("component-type"); debug("processComponentType: " + componentType ); switch( componentType ) { case "event": // Set the menu properly if it isn't already if( componentMenu.selectedItem.value != "event") componentMenu.selectedItem.value = "event" // Hide and show the appropriate fields and widgets changeMenuState("todo", "event"); // calling just enableElement _should_ work here, but it doesn't document.getElementById("start-datetime").setAttribute( "disabled", "false" ); enableElement("start-datetime"); enableElement("end-datetime"); // Set menubar title correctly changeTitleBar("event") break; case "todo": // Hide and show the appropriate fields and widgets changeMenuState("event", "todo"); onDateTimeCheckbox("start-checkbox", "start-datetime") onDateTimeCheckbox("due-checkbox", "due-datetime") updateCompletedItemEnabled() // Set menubar title correctly changeTitleBar("todo") break; //case "journal": default: // We were passed an invalid value: dump("processComponentType: ERROR! Tried to select invalid component type: "+componentType+"\n"); break; } // Make the window big enough for all the fields and widgets window.sizeToContent();} |
|
window.sizeToContent(); | function processComponentType(componentType){ var title; var componentMenu = document.getElementById("component-type"); debug("processComponentType: " + componentType ); switch( componentType ) { case "event": // Set the menu properly if it isn't already if( componentMenu.selectedItem.value != "event") componentMenu.selectedItem.value = "event" // Hide and show the appropriate fields and widgets changeMenuState("todo", "event"); // calling just enableElement _should_ work here, but it doesn't document.getElementById("start-datetime").setAttribute( "disabled", "false" ); enableElement("start-datetime"); enableElement("end-datetime"); // Set menubar title correctly changeTitleBar("event") break; case "todo": // Hide and show the appropriate fields and widgets changeMenuState("event", "todo"); onDateTimeCheckbox("start-checkbox", "start-datetime") onDateTimeCheckbox("due-checkbox", "due-datetime") updateCompletedItemEnabled() // Set menubar title correctly changeTitleBar("todo") break; //case "journal": default: // We were passed an invalid value: dump("processComponentType: ERROR! Tried to select invalid component type: "+componentType+"\n"); break; } // Make the window big enough for all the fields and widgets window.sizeToContent();} |
|
profile.createNewProfile(aProfName, aProfDir, langcode, useExistingDir); | profile.createNewProfileWithLocales(aProfName, aProfDir, langcode, regioncode, useExistingDir); | function processCreateProfileData( aProfName, aProfDir, langcode, regioncode){ try { // note: deleted check for empty profName string here as this should be // done by panel. -bmg (31/10/99) // todo: move this check into the panel itself, activated ontyping :P // this should definetly be moved to that page.. but how about providing // user with some feedback about what's wrong. .. TOOLTIP! o_O // or.. some sort of onblur notification. like a dialog then, or a // dropout layery thing. yeah. something like that to tell them when // it happens, not when the whole wizard is complete. blah. if (profile.profileExists(aProfName)) { alert(gCreateProfileWizardBundle.getString("profileExists")); // this is a bad but probably acceptable solution for now. // when we add more panels, we will want a better solution. window.frames["content"].document.getElementById("ProfileName").focus(); return false; } var invalidChars = ["/", "\\", "*", ":"]; for( var i = 0; i < invalidChars.length; i++ ) { if( aProfName.indexOf( invalidChars[i] ) != -1 ) { var aString = gProfileManagerBundle.getString("invalidCharA"); var bString = gProfileManagerBundle.getString("invalidCharB"); bString = bString.replace(/\s*<html:br\/>/g,"\n"); var lString = aString + invalidChars[i] + bString; alert( lString ); window.frames["content"].document.getElementById("ProfileName").focus(); return false; } } // Adding code to see if the profile directory already exists.... // XXXX - Further modifications like adding propmt dialog are required - XXXX var useExistingDir = false; var fileSpec = Components.classes["@mozilla.org/file/local;1"].createInstance(); if ( fileSpec ) fileSpec = fileSpec.QueryInterface( Components.interfaces.nsILocalFile ); if (aProfDir == null) fileSpec.initWithUnicodePath(profile.defaultProfileParentDir.unicodePath); else fileSpec.initWithUnicodePath(aProfDir); fileSpec.appendUnicode(aProfName); if (fileSpec != null && fileSpec.exists()) useExistingDir = true; dump("*** going to create a new profile called " + aProfName + " in folder: " + aProfDir + "\n"); profile.createNewProfile(aProfName, aProfDir, langcode, useExistingDir); return true; } catch(e) { dump("*** Failed to create a profile\n"); }} |
dump("*** going to create a new profile called " + aProfName + " in folder: " + aProfDir + "\n"); | function processCreateProfileData( aProfName, aProfDir ){ try { // note: deleted check for empty profName string here as this should be // done by panel. -bmg (31/10/99) // todo: move this check into the panel itself, activated ontyping :P // this should definetly be moved to that page.. but how about providing // user with some feedback about what's wrong. .. TOOLTIP! o_O // or.. some sort of onblur notification. like a dialog then, or a // dropout layery thing. yeah. something like that to tell them when // it happens, not when the whole wizard is complete. blah. if( profile.profileExists( aProfName ) ) { alert( bundle.GetStringFromName( "profileExists" ) ); // this is a bad but probably acceptable solution for now. // when we add more panels, we will want a better solution. window.frames["content"].document.getElementById("ProfileName").focus(); return false; } var invalidChars = ["/", "\\", "*", ":"]; for( var i = 0; i < invalidChars.length; i++ ) { if( aProfName.indexOf( invalidChars[i] ) != -1 ) { var aString = pmbundle.GetStringFromName("invalidCharA"); var bString = pmbundle.GetStringFromName("invalidCharB"); bString = bString.replace(/\s*<html:br\/>/g,"\n"); var lString = aString + invalidChars[i] + bString; alert( lString ); window.frames["content"].document.getElementById("ProfileName").focus(); return false; } } profile.createNewProfile( aProfName, aProfDir ); return true; } catch(e) { dump("*** Failed to create a profile\n"); }} |
|
var fileSpec = Components.classes["component: | var fileSpec = Components.classes["@mozilla.org/file/local;1"].createInstance(); | function processCreateProfileData( aProfName, aProfDir, langcode){ try { // note: deleted check for empty profName string here as this should be // done by panel. -bmg (31/10/99) // todo: move this check into the panel itself, activated ontyping :P // this should definetly be moved to that page.. but how about providing // user with some feedback about what's wrong. .. TOOLTIP! o_O // or.. some sort of onblur notification. like a dialog then, or a // dropout layery thing. yeah. something like that to tell them when // it happens, not when the whole wizard is complete. blah. if( profile.profileExists( aProfName ) ) { alert( bundle.GetStringFromName( "profileExists" ) ); // this is a bad but probably acceptable solution for now. // when we add more panels, we will want a better solution. window.frames["content"].document.getElementById("ProfileName").focus(); return false; } var invalidChars = ["/", "\\", "*", ":"]; for( var i = 0; i < invalidChars.length; i++ ) { if( aProfName.indexOf( invalidChars[i] ) != -1 ) { var aString = pmbundle.GetStringFromName("invalidCharA"); var bString = pmbundle.GetStringFromName("invalidCharB"); bString = bString.replace(/\s*<html:br\/>/g,"\n"); var lString = aString + invalidChars[i] + bString; alert( lString ); window.frames["content"].document.getElementById("ProfileName").focus(); return false; } } // Adding code to see if the profile directory already exists.... // XXXX - Further modifications like adding propmt dialog are required - XXXX var useExistingDir = false; var fileSpec = Components.classes["component://mozilla/file/local"].createInstance(); if ( fileSpec ) fileSpec = fileSpec.QueryInterface( Components.interfaces.nsILocalFile ); if (aProfDir == null) fileSpec.initWithUnicodePath(profile.defaultProfileParentDir.path); else fileSpec.initWithUnicodePath(aProfDir); fileSpec.appendUnicode(aProfName); if (fileSpec != null && fileSpec.exists()) useExistingDir = true; dump("*** going to create a new profile called " + aProfName + " in folder: " + aProfDir + "\n"); profile.createNewProfile(aProfName, aProfDir, langcode, useExistingDir); return true; } catch(e) { dump("*** Failed to create a profile\n"); }} |
setTagHeader(); | processHeaders: function(headerNameEnumerator, headerValueEnumerator, dontCollectAddress) { this.onStartHeaders(); const kMailboxSeparator = ", "; var index = 0; while (headerNameEnumerator.hasMore()) { var header = new Object; header.headerValue = headerValueEnumerator.getNext(); header.headerName = headerNameEnumerator.getNext(); // for consistancy sake, let's force all header names to be lower case so // we don't have to worry about looking for: Cc and CC, etc. var lowerCaseHeaderName = header.headerName.toLowerCase(); // if we have an x-mailer or x-mimeole string, put it in the user-agent slot which we know how to handle // already. if (lowerCaseHeaderName == "x-mailer" || lowerCaseHeaderName == "x-mimeole") lowerCaseHeaderName = "user-agent"; if (this.mDummyMsgHeader) { if (lowerCaseHeaderName == "from") this.mDummyMsgHeader.author = header.headerValue; else if (lowerCaseHeaderName == "to") this.mDummyMsgHeader.recipients = header.headerValue; else if (lowerCaseHeaderName == "cc") this.mDummyMsgHeader.ccList = header.headerValue; else if (lowerCaseHeaderName == "subject") this.mDummyMsgHeader.subject = header.headerValue; else if (lowerCaseHeaderName == "reply-to") this.mDummyMsgHeader.replyTo = header.headerValue; else if (lowerCaseHeaderName == "message-id") this.mDummyMsgHeader.messageId = header.headerValue; } // according to RFC 2822, certain headers // can occur "unlimited" times if (lowerCaseHeaderName in currentHeaderData) { // sometimes, you can have multiple To or Cc lines.... // in this case, we want to append these headers into one. if (lowerCaseHeaderName == 'to' || lowerCaseHeaderName == 'cc') currentHeaderData[lowerCaseHeaderName].headerValue = currentHeaderData[lowerCaseHeaderName].headerValue + ',' + header.headerValue; else { // use the index to create a unique header name like: // received5, received6, etc currentHeaderData[lowerCaseHeaderName + index++] = header; } } else currentHeaderData[lowerCaseHeaderName] = header; } // while we have more headers to parse if (("from" in currentHeaderData) && ("sender" in currentHeaderData) && msgHeaderParser) { var senderMailbox = kMailboxSeparator + msgHeaderParser.extractHeaderAddressMailboxes(null, currentHeaderData.sender.headerValue) + kMailboxSeparator; var fromMailboxes = kMailboxSeparator + msgHeaderParser.extractHeaderAddressMailboxes(null, currentHeaderData.from.headerValue) + kMailboxSeparator; if (fromMailboxes.indexOf(senderMailbox) >= 0) delete currentHeaderData.sender; } this.onEndHeaders(); }, |
|
currentHeaderData[lowerCaseHeaderName + index] = header; | currentHeaderData[lowerCaseHeaderName + index++] = header; | processHeaders: function(headerNameEnumerator, headerValueEnumerator, dontCollectAddress) { this.onStartHeaders(); while (headerNameEnumerator.hasMore()) { var header = new Object; header.headerValue = headerValueEnumerator.getNext(); header.headerName = headerNameEnumerator.getNext(); // for consistancy sake, let's force all header names to be lower case so // we don't have to worry about looking for: Cc and CC, etc. var lowerCaseHeaderName = header.headerName.toLowerCase(); // if we have an x-mailer or x-mimeole string, put it in the user-agent slot which we know how to handle // already. if (lowerCaseHeaderName == "x-mailer" || lowerCaseHeaderName == "x-mimeole") lowerCaseHeaderName = "user-agent"; // according to RFC 2822, certain headers // can occur "unlimited" times if (lowerCaseHeaderName in currentHeaderData) { // sometimes, you can have multiple To or Cc lines.... // in this case, we want to append these headers into one. if (lowerCaseHeaderName == 'to' || lowerCaseHeaderName == 'cc') currentHeaderData[lowerCaseHeaderName].headerValue = currentHeaderData[lowerCaseHeaderName].headerValue + ',' + header.headerValue; else { // use the index to create a unique header name like: // received5, received6, etc currentHeaderData[lowerCaseHeaderName + index] = header; } } else currentHeaderData[lowerCaseHeaderName] = header; if (lowerCaseHeaderName == "from") { if (header.value && abAddressCollector) { if ((gCollectIncoming && !dontCollectAddress) || (gCollectNewsgroup && dontCollectAddress)) { gCollectAddress = header.headerValue; // collect, and add card if doesn't exist, unknown preferred send format gCollectAddressTimer = setTimeout('abAddressCollector.collectUnicodeAddress(gCollectAddress, true, Components.interfaces.nsIAbPreferMailFormat.unknown);', 2000); } else if (gCollectOutgoing) { // collect, but only update existing cards, unknown preferred send format gCollectAddress = header.headerValue; gCollectAddressTimer = setTimeout('abAddressCollector.collectUnicodeAddress(gCollectAddress, false, Components.interfaces.nsIAbPreferMailFormat.unknown);', 2000); } } } // if lowerCaseHeaderName == "from" } // while we have more headers to parse this.onEndHeaders(); }, |
if (url.search(/^irc:\/?\/?$/i) == -1) | if (url.search(/^irc:\/?\/?\/?$/i) == -1) | function processStartupURLs(){ var wentSomewhere = false; if ("arguments" in window && 0 in window.arguments && typeof window.arguments[0] == "object" && "url" in window.arguments[0]) { var url = window.arguments[0].url; if (url.search(/^irc:\/?\/?$/i) == -1) { /* if the url is not irc: irc:/ or irc://, then go to it. */ gotoIRCURL(url); wentSomewhere = true; } } if (!wentSomewhere) { /* if we had nowhere else to go, connect to any default urls */ var ary = client.prefs["initialURLs"]; for (var i = 0; i < ary.length; ++i) { if (ary[i] && ary[i] != "irc://") gotoIRCURL(ary[i]); } } if (client.viewsArray.length > 1 && !isStartupURL("irc://")) { var tb = getTabForObject(client); deleteTab(tb); client.deck.removeChild(client.frame); client.deck.selectedIndex = 0; }} |
if (rule.selectorText) | if (rule instanceof CSSStyleRule) | function processStyleRules(rules) { for (var i = 0; i < rules.length; ++i) { var rule = rules.item(i); if (rule.selectorText) { ary = rule.selectorText. match(/\.chatzilla-highlight\[name=\"?([^\"]+)\"?\]/i); if (ary) { menuitem = document.createElement("menuitem"); menuitem.setAttribute ("class", "highlight-menu-item"); menuitem.setAttribute ("label", ary[1]); menuitem.setAttribute ("oncommand", "onPopupHighlight('" + rule.style.cssText + "');"); menuitem.setAttribute ("style", rule.style.cssText); menu.appendChild(menuitem); } } else if (rule.styleSheet) { processStyleRules(rule.styleSheet.rules); } } } |
ary = rule.selectorText. | var ary = rule.selectorText. | function processStyleRules(rules) { for (var i = 0; i < rules.length; ++i) { var rule = rules.item(i); if (rule.selectorText) { ary = rule.selectorText. match(/\.chatzilla-highlight\[name=\"?([^\"]+)\"?\]/i); if (ary) { menuitem = document.createElement("menuitem"); menuitem.setAttribute ("class", "highlight-menu-item"); menuitem.setAttribute ("label", ary[1]); menuitem.setAttribute ("oncommand", "onPopupHighlight('" + rule.style.cssText + "');"); menuitem.setAttribute ("style", rule.style.cssText); menu.appendChild(menuitem); } } else if (rule.styleSheet) { processStyleRules(rule.styleSheet.rules); } } } |
else if (rule.styleSheet) | else if (rule instanceof CSSImportRule) | function processStyleRules(rules) { for (var i = 0; i < rules.length; ++i) { var rule = rules.item(i); if (rule.selectorText) { ary = rule.selectorText. match(/\.chatzilla-highlight\[name=\"?([^\"]+)\"?\]/i); if (ary) { menuitem = document.createElement("menuitem"); menuitem.setAttribute ("class", "highlight-menu-item"); menuitem.setAttribute ("label", ary[1]); menuitem.setAttribute ("oncommand", "onPopupHighlight('" + rule.style.cssText + "');"); menuitem.setAttribute ("style", rule.style.cssText); menu.appendChild(menuitem); } } else if (rule.styleSheet) { processStyleRules(rule.styleSheet.rules); } } } |
processStyleRules(rule.styleSheet.rules); | processStyleRules(rule.styleSheet.cssRules); | function processStyleRules(rules) { for (var i = 0; i < rules.length; ++i) { var rule = rules.item(i); if (rule.selectorText) { ary = rule.selectorText. match(/\.chatzilla-highlight\[name=\"?([^\"]+)\"?\]/i); if (ary) { menuitem = document.createElement("menuitem"); menuitem.setAttribute ("class", "highlight-menu-item"); menuitem.setAttribute ("label", ary[1]); menuitem.setAttribute ("oncommand", "onPopupHighlight('" + rule.style.cssText + "');"); menuitem.setAttribute ("style", rule.style.cssText); menu.appendChild(menuitem); } } else if (rule.styleSheet) { processStyleRules(rule.styleSheet.rules); } } } |
else if (/\.csv\.tpl$/.test(this.reportTemplate.__url__)) this.escape = safeCSV; | function ProfileReport (reportTemplate, file, rangeList, scriptInstanceList){ this.reportTemplate = reportTemplate; this.file = file; this.rangeList = rangeList; this.scriptInstanceList = scriptInstanceList; this.key = "total"; // Escape bad characters for HTML and XML profiles. if (/\.(html|xml)\.tpl$/.test(this.reportTemplate.__url__)) this.escape = safeHTML; else this.escape = function _nop_escape(s) { return s };} |
|
var buttonPressed = {value:0}; | function PromptDownloadMessages(){ InitPrompts(); InitServices(); if(gPromptService) { var buttonPressed = {value:0}; var checkValue = {value:true}; gPromptService.confirmEx(window, gOfflinePromptsBundle.getString('downloadMessagesWindowTitle'), gOfflinePromptsBundle.getString('downloadMessagesLabel'), (gPromptService.BUTTON_TITLE_IS_STRING * gPromptService.BUTTON_POS_0) + (gPromptService.BUTTON_TITLE_IS_STRING * gPromptService.BUTTON_POS_2) + (gPromptService.BUTTON_TITLE_IS_STRING * gPromptService.BUTTON_POS_1), gOfflinePromptsBundle.getString('downloadMessagesDownloadButtonLabel'), gOfflinePromptsBundle.getString('downloadMessagesCancelButtonLabel'), gOfflinePromptsBundle.getString('downloadMessagesNoDownloadButtonLabel'), gOfflinePromptsBundle.getString('downloadMessagesCheckboxLabel'), checkValue, buttonPressed); if(buttonPressed) { if(buttonPressed.value == 0) { if(checkValue.value) gMailOfflinePrefs.setIntPref("offline.download.download_messages", 0); else gMailOfflinePrefs.setIntPref("offline.download.download_messages", 1); // download news, download mail, send unsent messages, go offline when done, msg window gOfflineManager.synchronizeForOffline(true, true, false, true, msgWindow); return true; } else if(buttonPressed.value == 1) { return false; } else if(buttonPressed.value == 2) { if(checkValue.value) gMailOfflinePrefs.setIntPref("offline.download.download_messages", 0); else gMailOfflinePrefs.setIntPref("offline.download.download_messages", 2); // download news, download mail, send unsent messages, go offline when done, msg window gOfflineManager.synchronizeForOffline(false, false, false, true, msgWindow); return true; } } }} |
|
gPromptService.confirmEx(window, gOfflinePromptsBundle.getString('downloadMessagesWindowTitle'), gOfflinePromptsBundle.getString('downloadMessagesLabel'), (gPromptService.BUTTON_TITLE_IS_STRING * gPromptService.BUTTON_POS_0) + (gPromptService.BUTTON_TITLE_IS_STRING * gPromptService.BUTTON_POS_2) + (gPromptService.BUTTON_TITLE_IS_STRING * gPromptService.BUTTON_POS_1), gOfflinePromptsBundle.getString('downloadMessagesDownloadButtonLabel'), gOfflinePromptsBundle.getString('downloadMessagesCancelButtonLabel'), gOfflinePromptsBundle.getString('downloadMessagesNoDownloadButtonLabel'), gOfflinePromptsBundle.getString('downloadMessagesCheckboxLabel'), checkValue, buttonPressed); if(buttonPressed) { if(buttonPressed.value == 0) { if(checkValue.value) gMailOfflinePrefs.setIntPref("offline.download.download_messages", 0); else gMailOfflinePrefs.setIntPref("offline.download.download_messages", 1); gOfflineManager.synchronizeForOffline(true, true, false, true, msgWindow); return true; } else if(buttonPressed.value == 1) { return false; } else if(buttonPressed.value == 2) { if(checkValue.value) gMailOfflinePrefs.setIntPref("offline.download.download_messages", 0); else gMailOfflinePrefs.setIntPref("offline.download.download_messages", 2); gOfflineManager.synchronizeForOffline(false, false, false, true, msgWindow); return true; } | var buttonPressed = gPromptService.confirmEx(window, gOfflinePromptsBundle.getString('downloadMessagesWindowTitle'), gOfflinePromptsBundle.getString('downloadMessagesLabel'), gPromptService.BUTTON_TITLE_IS_STRING * (gPromptService.BUTTON_POS_0 + gPromptService.BUTTON_POS_1 + gPromptService.BUTTON_POS_2), gOfflinePromptsBundle.getString('downloadMessagesDownloadButtonLabel'), gOfflinePromptsBundle.getString('downloadMessagesCancelButtonLabel'), gOfflinePromptsBundle.getString('downloadMessagesNoDownloadButtonLabel'), gOfflinePromptsBundle.getString('downloadMessagesCheckboxLabel'), checkValue); if(buttonPressed == 0) { gMailOfflinePrefs.setIntPref("offline.download.download_messages", !checkValue.value); gOfflineManager.synchronizeForOffline(true, true, false, true, msgWindow); return true; } if(buttonPressed == 1) { return false; } if(buttonPressed == 2) { gMailOfflinePrefs.setIntPref("offline.download.download_messages", 2*!checkValue.value); gOfflineManager.synchronizeForOffline(false, false, false, true, msgWindow); return true; | function PromptDownloadMessages(){ InitPrompts(); InitServices(); if(gPromptService) { var buttonPressed = {value:0}; var checkValue = {value:true}; gPromptService.confirmEx(window, gOfflinePromptsBundle.getString('downloadMessagesWindowTitle'), gOfflinePromptsBundle.getString('downloadMessagesLabel'), (gPromptService.BUTTON_TITLE_IS_STRING * gPromptService.BUTTON_POS_0) + (gPromptService.BUTTON_TITLE_IS_STRING * gPromptService.BUTTON_POS_2) + (gPromptService.BUTTON_TITLE_IS_STRING * gPromptService.BUTTON_POS_1), gOfflinePromptsBundle.getString('downloadMessagesDownloadButtonLabel'), gOfflinePromptsBundle.getString('downloadMessagesCancelButtonLabel'), gOfflinePromptsBundle.getString('downloadMessagesNoDownloadButtonLabel'), gOfflinePromptsBundle.getString('downloadMessagesCheckboxLabel'), checkValue, buttonPressed); if(buttonPressed) { if(buttonPressed.value == 0) { if(checkValue.value) gMailOfflinePrefs.setIntPref("offline.download.download_messages", 0); else gMailOfflinePrefs.setIntPref("offline.download.download_messages", 1); // download news, download mail, send unsent messages, go offline when done, msg window gOfflineManager.synchronizeForOffline(true, true, false, true, msgWindow); return true; } else if(buttonPressed.value == 1) { return false; } else if(buttonPressed.value == 2) { if(checkValue.value) gMailOfflinePrefs.setIntPref("offline.download.download_messages", 0); else gMailOfflinePrefs.setIntPref("offline.download.download_messages", 2); // download news, download mail, send unsent messages, go offline when done, msg window gOfflineManager.synchronizeForOffline(false, false, false, true, msgWindow); return true; } } }} |
return false; | function PromptDownloadMessages(){ InitPrompts(); InitServices(); if(gPromptService) { var buttonPressed = {value:0}; var checkValue = {value:true}; gPromptService.confirmEx(window, gOfflinePromptsBundle.getString('downloadMessagesWindowTitle'), gOfflinePromptsBundle.getString('downloadMessagesLabel'), (gPromptService.BUTTON_TITLE_IS_STRING * gPromptService.BUTTON_POS_0) + (gPromptService.BUTTON_TITLE_IS_STRING * gPromptService.BUTTON_POS_2) + (gPromptService.BUTTON_TITLE_IS_STRING * gPromptService.BUTTON_POS_1), gOfflinePromptsBundle.getString('downloadMessagesDownloadButtonLabel'), gOfflinePromptsBundle.getString('downloadMessagesCancelButtonLabel'), gOfflinePromptsBundle.getString('downloadMessagesNoDownloadButtonLabel'), gOfflinePromptsBundle.getString('downloadMessagesCheckboxLabel'), checkValue, buttonPressed); if(buttonPressed) { if(buttonPressed.value == 0) { if(checkValue.value) gMailOfflinePrefs.setIntPref("offline.download.download_messages", 0); else gMailOfflinePrefs.setIntPref("offline.download.download_messages", 1); // download news, download mail, send unsent messages, go offline when done, msg window gOfflineManager.synchronizeForOffline(true, true, false, true, msgWindow); return true; } else if(buttonPressed.value == 1) { return false; } else if(buttonPressed.value == 2) { if(checkValue.value) gMailOfflinePrefs.setIntPref("offline.download.download_messages", 0); else gMailOfflinePrefs.setIntPref("offline.download.download_messages", 2); // download news, download mail, send unsent messages, go offline when done, msg window gOfflineManager.synchronizeForOffline(false, false, false, true, msgWindow); return true; } } }} |
|
var value = prompt("Enter the attribute value:", attr.nodeValue); if (value) { | if (!gPromptService) { gPromptService = XPCU.getService(kPromptServiceCID, "nsIPromptService"); } var attrValue = { value: attr.nodeValue }; var dummy = { value: false }; var bundle = this.mPanel.panelset.stringBundle; var msg = bundle.getString("enterAttrName.message"); var title = bundle.getString("editAttribute.title"); if (gPromptService.prompt(window, title, msg, attrValue, null, dummy)) { | promptFor: function() { var attr = viewer.selectedAttribute; if (attr) { var value = prompt("Enter the attribute value:", attr.nodeValue); if (value) { this.subject = viewer.subject; this.newValue = value; this.previousValue = attr.nodeValue; this.subject.setAttribute(attr.nodeName, value); this.attr = this.subject.getAttributeNode(attr.nodeName); return false; } } return true; }, |
this.newValue = value; | this.newValue = attrValue.value; | promptFor: function() { var attr = viewer.selectedAttribute; if (attr) { var value = prompt("Enter the attribute value:", attr.nodeValue); if (value) { this.subject = viewer.subject; this.newValue = value; this.previousValue = attr.nodeValue; this.subject.setAttribute(attr.nodeName, value); this.attr = this.subject.getAttributeNode(attr.nodeName); return false; } } return true; }, |
this.subject.setAttribute(attr.nodeName, value); | this.subject.setAttribute(attr.nodeName, attrValue.value); | promptFor: function() { var attr = viewer.selectedAttribute; if (attr) { var value = prompt("Enter the attribute value:", attr.nodeValue); if (value) { this.subject = viewer.subject; this.newValue = value; this.previousValue = attr.nodeValue; this.subject.setAttribute(attr.nodeName, value); this.attr = this.subject.getAttributeNode(attr.nodeName); return false; } } return true; }, |
if (!gPromptService) { gPromptService = XPCU.getService(kPromptServiceCID, "nsIPromptService"); } | var bundle = viewer.pane.panelset.stringBundle; var title = bundle.getString("editAttribute.title"); var doc = attr.ownerDocument; var out = { name: attr.nodeName, value: attr.nodeValue, namespaceURI: attr.namespaceURI, accepted: false }; | promptFor: function() { var attr = viewer.selectedAttribute.node; if (attr) { if (!gPromptService) { gPromptService = XPCU.getService(kPromptServiceCID, "nsIPromptService"); } var attrValue = { value: attr.nodeValue }; var dummy = { value: false }; var bundle = viewer.pane.panelset.stringBundle; var msg = bundle.getString("enterAttrValue.message"); var title = bundle.getString("editAttribute.title"); if (gPromptService.prompt(window, title, msg, attrValue, null, dummy)) { this.subject = viewer.subject; this.newValue = attrValue.value; this.previousValue = attr.nodeValue; this.subject.setAttribute(attr.nodeName, attrValue.value); this.attr = this.subject.getAttributeNode(attr.nodeName); return false; } } return true; }, |
var attrValue = { value: attr.nodeValue }; var dummy = { value: false }; | window.openDialog("chrome: "edit", "chrome,modal,centerscreen", out, title, doc); | promptFor: function() { var attr = viewer.selectedAttribute.node; if (attr) { if (!gPromptService) { gPromptService = XPCU.getService(kPromptServiceCID, "nsIPromptService"); } var attrValue = { value: attr.nodeValue }; var dummy = { value: false }; var bundle = viewer.pane.panelset.stringBundle; var msg = bundle.getString("enterAttrValue.message"); var title = bundle.getString("editAttribute.title"); if (gPromptService.prompt(window, title, msg, attrValue, null, dummy)) { this.subject = viewer.subject; this.newValue = attrValue.value; this.previousValue = attr.nodeValue; this.subject.setAttribute(attr.nodeName, attrValue.value); this.attr = this.subject.getAttributeNode(attr.nodeName); return false; } } return true; }, |
var bundle = viewer.pane.panelset.stringBundle; var msg = bundle.getString("enterAttrValue.message"); var title = bundle.getString("editAttribute.title"); if (gPromptService.prompt(window, title, msg, attrValue, null, dummy)) { this.subject = viewer.subject; this.newValue = attrValue.value; this.previousValue = attr.nodeValue; this.subject.setAttribute(attr.nodeName, attrValue.value); | if (out.accepted) { this.subject = viewer.subject; this.newValue = out.value; this.newNamespaceURI = out.namespaceURI; this.previousValue = attr.nodeValue; this.previousNamespaceURI = attr.namespaceURI; if (this.previousNamespaceURI == this.newNamespaceURI) { this.subject.setAttributeNS(this.previousNamespaceURI, attr.nodeName, out.value); } else { this.subject.removeAttributeNS(this.previousNamespaceURI, attr.localName); this.subject.setAttributeNS(out.namespaceURI, attr.nodeName, out.value); } | promptFor: function() { var attr = viewer.selectedAttribute.node; if (attr) { if (!gPromptService) { gPromptService = XPCU.getService(kPromptServiceCID, "nsIPromptService"); } var attrValue = { value: attr.nodeValue }; var dummy = { value: false }; var bundle = viewer.pane.panelset.stringBundle; var msg = bundle.getString("enterAttrValue.message"); var title = bundle.getString("editAttribute.title"); if (gPromptService.prompt(window, title, msg, attrValue, null, dummy)) { this.subject = viewer.subject; this.newValue = attrValue.value; this.previousValue = attr.nodeValue; this.subject.setAttribute(attr.nodeName, attrValue.value); this.attr = this.subject.getAttributeNode(attr.nodeName); return false; } } return true; }, |
this.newNamespaceURI = out.namespaceURI; | this.newNamespaceURI = out.namespaceURI || null; | promptFor: function() { var attr = viewer.selectedAttribute.node; if (attr) { var bundle = viewer.pane.panelset.stringBundle; var title = bundle.getString("editAttribute.title"); var doc = attr.ownerDocument; var out = { name: attr.nodeName, value: attr.nodeValue, namespaceURI: attr.namespaceURI, accepted: false }; window.openDialog("chrome://inspector/content/viewers/domNode/domNodeDialog.xul", "edit", "chrome,modal,centerscreen", out, title, doc); if (out.accepted) { this.subject = viewer.subject; this.newValue = out.value; this.newNamespaceURI = out.namespaceURI; this.previousValue = attr.nodeValue; this.previousNamespaceURI = attr.namespaceURI; if (this.previousNamespaceURI == this.newNamespaceURI) { this.subject.setAttributeNS(this.previousNamespaceURI, attr.nodeName, out.value); } else { this.subject.removeAttributeNS(this.previousNamespaceURI, attr.localName); this.subject.setAttributeNS(out.namespaceURI, attr.nodeName, out.value); } this.attr = this.subject.getAttributeNode(attr.nodeName); return false; } } return true; }, |
var bundle = Components.classes[ "@mozilla.org/intl/stringbundle;1" ] .getService( Components.interfaces.nsIStringBundleService ) .createBundle( "chrome: | promptForSaveToFile: function(aLauncher, aContext, aDefaultFile, aSuggestedFileExtension) { var result = ""; // Use file picker to show dialog. var nsIFilePicker = Components.interfaces.nsIFilePicker; var picker = Components.classes[ "@mozilla.org/filepicker;1" ] .createInstance( nsIFilePicker ); var bundle = Components.classes[ "@mozilla.org/intl/stringbundle;1" ] .getService( Components.interfaces.nsIStringBundleService ) .createBundle( "chrome://global/locale/nsHelperAppDlg.properties"); var windowTitle = bundle.GetStringFromName( "saveDialogTitle" ); var parent = aContext .QueryInterface( Components.interfaces.nsIInterfaceRequestor ) .getInterface( Components.interfaces.nsIDOMWindowInternal ); picker.init( parent, windowTitle, nsIFilePicker.modeSave ); picker.defaultString = aDefaultFile; if (aSuggestedFileExtension) { // aSuggestedFileExtension includes the period, so strip it picker.defaultExtension = aSuggestedFileExtension.substring(1); } else { try { picker.defaultExtension = this.mLauncher.MIMEInfo.primaryExtension; } catch (ex) { } } var wildCardExtension = "*"; if ( aSuggestedFileExtension ) { wildCardExtension += aSuggestedFileExtension; picker.appendFilter( wildCardExtension, wildCardExtension ); } picker.appendFilters( nsIFilePicker.filterAll ); // Pull in the user's preferences and get the default download directory. var prefs = Components.classes[ "@mozilla.org/preferences-service;1" ] .getService( Components.interfaces.nsIPrefBranch ); try { var startDir = prefs.getComplexValue("browser.download.dir", Components.interfaces.nsILocalFile); if ( startDir.exists() ) { picker.displayDirectory = startDir; } } catch( exception ) { } var dlgResult = picker.show(); if ( dlgResult == nsIFilePicker.returnCancel ) { // Null result means user cancelled. return null; } // be sure to save the directory the user chose as the new browser.download.dir result = picker.file; if ( result ) { var newDir = result.parent; prefs.setComplexValue("browser.download.dir", Components.interfaces.nsILocalFile, newDir); } return result; }, |
|
var prefs = Components.classes[ "@mozilla.org/preferences-service;1" ] .getService( Components.interfaces.nsIPrefBranch ); | promptForSaveToFile: function(aLauncher, aContext, aDefaultFile, aSuggestedFileExtension) { var result = ""; // Use file picker to show dialog. var nsIFilePicker = Components.interfaces.nsIFilePicker; var picker = Components.classes[ "@mozilla.org/filepicker;1" ] .createInstance( nsIFilePicker ); var bundle = Components.classes[ "@mozilla.org/intl/stringbundle;1" ] .getService( Components.interfaces.nsIStringBundleService ) .createBundle( "chrome://global/locale/nsHelperAppDlg.properties"); var windowTitle = bundle.GetStringFromName( "saveDialogTitle" ); var parent = aContext .QueryInterface( Components.interfaces.nsIInterfaceRequestor ) .getInterface( Components.interfaces.nsIDOMWindowInternal ); picker.init( parent, windowTitle, nsIFilePicker.modeSave ); picker.defaultString = aDefaultFile; if (aSuggestedFileExtension) { // aSuggestedFileExtension includes the period, so strip it picker.defaultExtension = aSuggestedFileExtension.substring(1); } else { try { picker.defaultExtension = this.mLauncher.MIMEInfo.primaryExtension; } catch (ex) { } } var wildCardExtension = "*"; if ( aSuggestedFileExtension ) { wildCardExtension += aSuggestedFileExtension; picker.appendFilter( wildCardExtension, wildCardExtension ); } picker.appendFilters( nsIFilePicker.filterAll ); // Pull in the user's preferences and get the default download directory. var prefs = Components.classes[ "@mozilla.org/preferences-service;1" ] .getService( Components.interfaces.nsIPrefBranch ); try { var startDir = prefs.getComplexValue("browser.download.dir", Components.interfaces.nsILocalFile); if ( startDir.exists() ) { picker.displayDirectory = startDir; } } catch( exception ) { } var dlgResult = picker.show(); if ( dlgResult == nsIFilePicker.returnCancel ) { // Null result means user cancelled. return null; } // be sure to save the directory the user chose as the new browser.download.dir result = picker.file; if ( result ) { var newDir = result.parent; prefs.setComplexValue("browser.download.dir", Components.interfaces.nsILocalFile, newDir); } return result; }, |
|
var startDir = prefs.getComplexValue("browser.download.dir", Components.interfaces.nsILocalFile); if ( startDir.exists() ) { picker.displayDirectory = startDir; } } catch( exception ) { } | if (dir.exists()) picker.displayDirectory = dir; } catch (e) { } | promptForSaveToFile: function(aLauncher, aContext, aDefaultFile, aSuggestedFileExtension) { var result = ""; // Use file picker to show dialog. var nsIFilePicker = Components.interfaces.nsIFilePicker; var picker = Components.classes[ "@mozilla.org/filepicker;1" ] .createInstance( nsIFilePicker ); var bundle = Components.classes[ "@mozilla.org/intl/stringbundle;1" ] .getService( Components.interfaces.nsIStringBundleService ) .createBundle( "chrome://global/locale/nsHelperAppDlg.properties"); var windowTitle = bundle.GetStringFromName( "saveDialogTitle" ); var parent = aContext .QueryInterface( Components.interfaces.nsIInterfaceRequestor ) .getInterface( Components.interfaces.nsIDOMWindowInternal ); picker.init( parent, windowTitle, nsIFilePicker.modeSave ); picker.defaultString = aDefaultFile; if (aSuggestedFileExtension) { // aSuggestedFileExtension includes the period, so strip it picker.defaultExtension = aSuggestedFileExtension.substring(1); } else { try { picker.defaultExtension = this.mLauncher.MIMEInfo.primaryExtension; } catch (ex) { } } var wildCardExtension = "*"; if ( aSuggestedFileExtension ) { wildCardExtension += aSuggestedFileExtension; picker.appendFilter( wildCardExtension, wildCardExtension ); } picker.appendFilters( nsIFilePicker.filterAll ); // Pull in the user's preferences and get the default download directory. var prefs = Components.classes[ "@mozilla.org/preferences-service;1" ] .getService( Components.interfaces.nsIPrefBranch ); try { var startDir = prefs.getComplexValue("browser.download.dir", Components.interfaces.nsILocalFile); if ( startDir.exists() ) { picker.displayDirectory = startDir; } } catch( exception ) { } var dlgResult = picker.show(); if ( dlgResult == nsIFilePicker.returnCancel ) { // Null result means user cancelled. return null; } // be sure to save the directory the user chose as the new browser.download.dir result = picker.file; if ( result ) { var newDir = result.parent; prefs.setComplexValue("browser.download.dir", Components.interfaces.nsILocalFile, newDir); } return result; }, |
var dlgResult = picker.show(); if ( dlgResult == nsIFilePicker.returnCancel ) { | if (picker.show() == nsIFilePicker.returnCancel || !picker.file) { | promptForSaveToFile: function(aLauncher, aContext, aDefaultFile, aSuggestedFileExtension) { var result = ""; // Use file picker to show dialog. var nsIFilePicker = Components.interfaces.nsIFilePicker; var picker = Components.classes[ "@mozilla.org/filepicker;1" ] .createInstance( nsIFilePicker ); var bundle = Components.classes[ "@mozilla.org/intl/stringbundle;1" ] .getService( Components.interfaces.nsIStringBundleService ) .createBundle( "chrome://global/locale/nsHelperAppDlg.properties"); var windowTitle = bundle.GetStringFromName( "saveDialogTitle" ); var parent = aContext .QueryInterface( Components.interfaces.nsIInterfaceRequestor ) .getInterface( Components.interfaces.nsIDOMWindowInternal ); picker.init( parent, windowTitle, nsIFilePicker.modeSave ); picker.defaultString = aDefaultFile; if (aSuggestedFileExtension) { // aSuggestedFileExtension includes the period, so strip it picker.defaultExtension = aSuggestedFileExtension.substring(1); } else { try { picker.defaultExtension = this.mLauncher.MIMEInfo.primaryExtension; } catch (ex) { } } var wildCardExtension = "*"; if ( aSuggestedFileExtension ) { wildCardExtension += aSuggestedFileExtension; picker.appendFilter( wildCardExtension, wildCardExtension ); } picker.appendFilters( nsIFilePicker.filterAll ); // Pull in the user's preferences and get the default download directory. var prefs = Components.classes[ "@mozilla.org/preferences-service;1" ] .getService( Components.interfaces.nsIPrefBranch ); try { var startDir = prefs.getComplexValue("browser.download.dir", Components.interfaces.nsILocalFile); if ( startDir.exists() ) { picker.displayDirectory = startDir; } } catch( exception ) { } var dlgResult = picker.show(); if ( dlgResult == nsIFilePicker.returnCancel ) { // Null result means user cancelled. return null; } // be sure to save the directory the user chose as the new browser.download.dir result = picker.file; if ( result ) { var newDir = result.parent; prefs.setComplexValue("browser.download.dir", Components.interfaces.nsILocalFile, newDir); } return result; }, |
result = picker.file; if ( result ) { var newDir = result.parent; prefs.setComplexValue("browser.download.dir", Components.interfaces.nsILocalFile, newDir); } return result; | return picker.file; | promptForSaveToFile: function(aLauncher, aContext, aDefaultFile, aSuggestedFileExtension) { var result = ""; // Use file picker to show dialog. var nsIFilePicker = Components.interfaces.nsIFilePicker; var picker = Components.classes[ "@mozilla.org/filepicker;1" ] .createInstance( nsIFilePicker ); var bundle = Components.classes[ "@mozilla.org/intl/stringbundle;1" ] .getService( Components.interfaces.nsIStringBundleService ) .createBundle( "chrome://global/locale/nsHelperAppDlg.properties"); var windowTitle = bundle.GetStringFromName( "saveDialogTitle" ); var parent = aContext .QueryInterface( Components.interfaces.nsIInterfaceRequestor ) .getInterface( Components.interfaces.nsIDOMWindowInternal ); picker.init( parent, windowTitle, nsIFilePicker.modeSave ); picker.defaultString = aDefaultFile; if (aSuggestedFileExtension) { // aSuggestedFileExtension includes the period, so strip it picker.defaultExtension = aSuggestedFileExtension.substring(1); } else { try { picker.defaultExtension = this.mLauncher.MIMEInfo.primaryExtension; } catch (ex) { } } var wildCardExtension = "*"; if ( aSuggestedFileExtension ) { wildCardExtension += aSuggestedFileExtension; picker.appendFilter( wildCardExtension, wildCardExtension ); } picker.appendFilters( nsIFilePicker.filterAll ); // Pull in the user's preferences and get the default download directory. var prefs = Components.classes[ "@mozilla.org/preferences-service;1" ] .getService( Components.interfaces.nsIPrefBranch ); try { var startDir = prefs.getComplexValue("browser.download.dir", Components.interfaces.nsILocalFile); if ( startDir.exists() ) { picker.displayDirectory = startDir; } } catch( exception ) { } var dlgResult = picker.show(); if ( dlgResult == nsIFilePicker.returnCancel ) { // Null result means user cancelled. return null; } // be sure to save the directory the user chose as the new browser.download.dir result = picker.file; if ( result ) { var newDir = result.parent; prefs.setComplexValue("browser.download.dir", Components.interfaces.nsILocalFile, newDir); } return result; }, |
var buttonPressed = {value:0}; | function PromptGetMessagesOffline(){ InitPrompts(); if (gPromptService) { var buttonPressed = {value:0}; var checkValue = {value:false}; gPromptService.confirmEx(window, gOfflinePromptsBundle.getString('getMessagesOfflineWindowTitle'), gOfflinePromptsBundle.getString('getMessagesOfflineLabel'), (gPromptService.BUTTON_TITLE_IS_STRING * gPromptService.BUTTON_POS_0) + (gPromptService.BUTTON_TITLE_CANCEL * gPromptService.BUTTON_POS_1), gOfflinePromptsBundle.getString('getMessagesOfflineGoButtonLabel'), null, null, null, checkValue, buttonPressed); if(buttonPressed) { return buttonPressed.value; } }} |
|
gPromptService.confirmEx(window, | buttonPressed = gPromptService.confirmEx(window, | function PromptGetMessagesOffline(){ InitPrompts(); if (gPromptService) { var buttonPressed = {value:0}; var checkValue = {value:false}; gPromptService.confirmEx(window, gOfflinePromptsBundle.getString('getMessagesOfflineWindowTitle'), gOfflinePromptsBundle.getString('getMessagesOfflineLabel'), (gPromptService.BUTTON_TITLE_IS_STRING * gPromptService.BUTTON_POS_0) + (gPromptService.BUTTON_TITLE_CANCEL * gPromptService.BUTTON_POS_1), gOfflinePromptsBundle.getString('getMessagesOfflineGoButtonLabel'), null, null, null, checkValue, buttonPressed); if(buttonPressed) { return buttonPressed.value; } }} |
null, null, null, checkValue, buttonPressed); if(buttonPressed) { return buttonPressed.value; } | null, null, null, checkValue); | function PromptGetMessagesOffline(){ InitPrompts(); if (gPromptService) { var buttonPressed = {value:0}; var checkValue = {value:false}; gPromptService.confirmEx(window, gOfflinePromptsBundle.getString('getMessagesOfflineWindowTitle'), gOfflinePromptsBundle.getString('getMessagesOfflineLabel'), (gPromptService.BUTTON_TITLE_IS_STRING * gPromptService.BUTTON_POS_0) + (gPromptService.BUTTON_TITLE_CANCEL * gPromptService.BUTTON_POS_1), gOfflinePromptsBundle.getString('getMessagesOfflineGoButtonLabel'), null, null, null, checkValue, buttonPressed); if(buttonPressed) { return buttonPressed.value; } }} |
return buttonPressed; | function PromptGetMessagesOffline(){ InitPrompts(); if (gPromptService) { var buttonPressed = {value:0}; var checkValue = {value:false}; gPromptService.confirmEx(window, gOfflinePromptsBundle.getString('getMessagesOfflineWindowTitle'), gOfflinePromptsBundle.getString('getMessagesOfflineLabel'), (gPromptService.BUTTON_TITLE_IS_STRING * gPromptService.BUTTON_POS_0) + (gPromptService.BUTTON_TITLE_CANCEL * gPromptService.BUTTON_POS_1), gOfflinePromptsBundle.getString('getMessagesOfflineGoButtonLabel'), null, null, null, checkValue, buttonPressed); if(buttonPressed) { return buttonPressed.value; } }} |
|
var buttonPressed = {value:0}; | function PromptSendMessages(){ InitPrompts(); InitServices(); if (gPromptService) { var buttonPressed = {value:0}; var checkValue = {value:true}; gPromptService.confirmEx(window, gOfflinePromptsBundle.getString('sendMessagesWindowTitle'), gOfflinePromptsBundle.getString('sendMessagesLabel'), (gPromptService.BUTTON_TITLE_IS_STRING * gPromptService.BUTTON_POS_0) + (gPromptService.BUTTON_TITLE_IS_STRING * gPromptService.BUTTON_POS_2) + (gPromptService.BUTTON_TITLE_IS_STRING * gPromptService.BUTTON_POS_1), gOfflinePromptsBundle.getString('sendMessagesSendButtonLabel'), gOfflinePromptsBundle.getString('sendMessagesCancelButtonLabel'), gOfflinePromptsBundle.getString('sendMessagesNoSendButtonLabel'), gOfflinePromptsBundle.getString('sendMessagesCheckboxLabel'), checkValue, buttonPressed); if(buttonPressed) { if(buttonPressed.value == 0) { if(checkValue.value) gMailOfflinePrefs.setIntPref("offline.send.unsent_messages", 0); else gMailOfflinePrefs.setIntPref("offline.send.unsent_messages", 1); gOfflineManager.goOnline(true /* sendUnsentMessages */, true /* playbackOfflineImapOperations */, msgWindow); return true; } else if(buttonPressed.value == 1) { return false; } else if(buttonPressed.value == 2) { if(checkValue.value) gMailOfflinePrefs.setIntPref("offline.send.unsent_messages", 0); else gMailOfflinePrefs.setIntPref("offline.send.unsent_messages", 2); gOfflineManager.goOnline(false /* sendUnsentMessages */, true /* playbackOfflineImapOperations */, msgWindow); return true; } } }} |
|
gPromptService.confirmEx(window, gOfflinePromptsBundle.getString('sendMessagesWindowTitle'), gOfflinePromptsBundle.getString('sendMessagesLabel'), (gPromptService.BUTTON_TITLE_IS_STRING * gPromptService.BUTTON_POS_0) + (gPromptService.BUTTON_TITLE_IS_STRING * gPromptService.BUTTON_POS_2) + (gPromptService.BUTTON_TITLE_IS_STRING * gPromptService.BUTTON_POS_1), gOfflinePromptsBundle.getString('sendMessagesSendButtonLabel'), gOfflinePromptsBundle.getString('sendMessagesCancelButtonLabel'), gOfflinePromptsBundle.getString('sendMessagesNoSendButtonLabel'), gOfflinePromptsBundle.getString('sendMessagesCheckboxLabel'), checkValue, buttonPressed); if(buttonPressed) { if(buttonPressed.value == 0) { if(checkValue.value) gMailOfflinePrefs.setIntPref("offline.send.unsent_messages", 0); else gMailOfflinePrefs.setIntPref("offline.send.unsent_messages", 1); gOfflineManager.goOnline(true , true , msgWindow); return true; } else if(buttonPressed.value == 1) { return false; } else if(buttonPressed.value == 2) { if(checkValue.value) gMailOfflinePrefs.setIntPref("offline.send.unsent_messages", 0); else gMailOfflinePrefs.setIntPref("offline.send.unsent_messages", 2); gOfflineManager.goOnline(false , true , msgWindow); return true; } | var buttonPressed = gPromptService.confirmEx(window, gOfflinePromptsBundle.getString('sendMessagesWindowTitle'), gOfflinePromptsBundle.getString('sendMessagesLabel'), gPromptService.BUTTON_TITLE_IS_STRING * (gPromptService.BUTTON_POS_0 + gPromptService.BUTTON_POS_1 + gPromptService.BUTTON_POS_2), gOfflinePromptsBundle.getString('sendMessagesSendButtonLabel'), gOfflinePromptsBundle.getString('sendMessagesCancelButtonLabel'), gOfflinePromptsBundle.getString('sendMessagesNoSendButtonLabel'), gOfflinePromptsBundle.getString('sendMessagesCheckboxLabel'), checkValue); if(buttonPressed == 0) { gMailOfflinePrefs.setIntPref("offline.send.unsent_messages", !checkValue.value); gOfflineManager.goOnline(true, true, msgWindow); return true; } if(buttonPressed == 1) { return false; } if(buttonPressed == 2) { gMailOfflinePrefs.setIntPref("offline.send.unsent_messages", 2*!checkValue.value); gOfflineManager.goOnline(false, true, msgWindow); return true; | function PromptSendMessages(){ InitPrompts(); InitServices(); if (gPromptService) { var buttonPressed = {value:0}; var checkValue = {value:true}; gPromptService.confirmEx(window, gOfflinePromptsBundle.getString('sendMessagesWindowTitle'), gOfflinePromptsBundle.getString('sendMessagesLabel'), (gPromptService.BUTTON_TITLE_IS_STRING * gPromptService.BUTTON_POS_0) + (gPromptService.BUTTON_TITLE_IS_STRING * gPromptService.BUTTON_POS_2) + (gPromptService.BUTTON_TITLE_IS_STRING * gPromptService.BUTTON_POS_1), gOfflinePromptsBundle.getString('sendMessagesSendButtonLabel'), gOfflinePromptsBundle.getString('sendMessagesCancelButtonLabel'), gOfflinePromptsBundle.getString('sendMessagesNoSendButtonLabel'), gOfflinePromptsBundle.getString('sendMessagesCheckboxLabel'), checkValue, buttonPressed); if(buttonPressed) { if(buttonPressed.value == 0) { if(checkValue.value) gMailOfflinePrefs.setIntPref("offline.send.unsent_messages", 0); else gMailOfflinePrefs.setIntPref("offline.send.unsent_messages", 1); gOfflineManager.goOnline(true /* sendUnsentMessages */, true /* playbackOfflineImapOperations */, msgWindow); return true; } else if(buttonPressed.value == 1) { return false; } else if(buttonPressed.value == 2) { if(checkValue.value) gMailOfflinePrefs.setIntPref("offline.send.unsent_messages", 0); else gMailOfflinePrefs.setIntPref("offline.send.unsent_messages", 2); gOfflineManager.goOnline(false /* sendUnsentMessages */, true /* playbackOfflineImapOperations */, msgWindow); return true; } } }} |
return false; | function PromptSendMessages(){ InitPrompts(); InitServices(); if (gPromptService) { var buttonPressed = {value:0}; var checkValue = {value:true}; gPromptService.confirmEx(window, gOfflinePromptsBundle.getString('sendMessagesWindowTitle'), gOfflinePromptsBundle.getString('sendMessagesLabel'), (gPromptService.BUTTON_TITLE_IS_STRING * gPromptService.BUTTON_POS_0) + (gPromptService.BUTTON_TITLE_IS_STRING * gPromptService.BUTTON_POS_2) + (gPromptService.BUTTON_TITLE_IS_STRING * gPromptService.BUTTON_POS_1), gOfflinePromptsBundle.getString('sendMessagesSendButtonLabel'), gOfflinePromptsBundle.getString('sendMessagesCancelButtonLabel'), gOfflinePromptsBundle.getString('sendMessagesNoSendButtonLabel'), gOfflinePromptsBundle.getString('sendMessagesCheckboxLabel'), checkValue, buttonPressed); if(buttonPressed) { if(buttonPressed.value == 0) { if(checkValue.value) gMailOfflinePrefs.setIntPref("offline.send.unsent_messages", 0); else gMailOfflinePrefs.setIntPref("offline.send.unsent_messages", 1); gOfflineManager.goOnline(true /* sendUnsentMessages */, true /* playbackOfflineImapOperations */, msgWindow); return true; } else if(buttonPressed.value == 1) { return false; } else if(buttonPressed.value == 2) { if(checkValue.value) gMailOfflinePrefs.setIntPref("offline.send.unsent_messages", 0); else gMailOfflinePrefs.setIntPref("offline.send.unsent_messages", 2); gOfflineManager.goOnline(false /* sendUnsentMessages */, true /* playbackOfflineImapOperations */, msgWindow); return true; } } }} |
|
var buttonPressed = {value:0}; | function PromptSendMessagesOffline(){ InitPrompts(); if (gPromptService) { var buttonPressed = {value:0}; var checkValue= {value:false}; gPromptService.confirmEx(window, gOfflinePromptsBundle.getString('sendMessagesOfflineWindowTitle'), gOfflinePromptsBundle.getString('sendMessagesOfflineLabel'), (gPromptService.BUTTON_TITLE_IS_STRING * gPromptService.BUTTON_POS_0) + (gPromptService.BUTTON_TITLE_CANCEL * gPromptService.BUTTON_POS_1), gOfflinePromptsBundle.getString('sendMessagesOfflineGoButtonLabel'), null, null, null, checkValue, buttonPressed); if(buttonPressed) { return buttonPressed.value; } }} |
|
gPromptService.confirmEx(window, | buttonPressed = gPromptService.confirmEx(window, | function PromptSendMessagesOffline(){ InitPrompts(); if (gPromptService) { var buttonPressed = {value:0}; var checkValue= {value:false}; gPromptService.confirmEx(window, gOfflinePromptsBundle.getString('sendMessagesOfflineWindowTitle'), gOfflinePromptsBundle.getString('sendMessagesOfflineLabel'), (gPromptService.BUTTON_TITLE_IS_STRING * gPromptService.BUTTON_POS_0) + (gPromptService.BUTTON_TITLE_CANCEL * gPromptService.BUTTON_POS_1), gOfflinePromptsBundle.getString('sendMessagesOfflineGoButtonLabel'), null, null, null, checkValue, buttonPressed); if(buttonPressed) { return buttonPressed.value; } }} |
if(buttonPressed) { return buttonPressed.value; } | function PromptSendMessagesOffline(){ InitPrompts(); if (gPromptService) { var buttonPressed = {value:0}; var checkValue= {value:false}; gPromptService.confirmEx(window, gOfflinePromptsBundle.getString('sendMessagesOfflineWindowTitle'), gOfflinePromptsBundle.getString('sendMessagesOfflineLabel'), (gPromptService.BUTTON_TITLE_IS_STRING * gPromptService.BUTTON_POS_0) + (gPromptService.BUTTON_TITLE_CANCEL * gPromptService.BUTTON_POS_1), gOfflinePromptsBundle.getString('sendMessagesOfflineGoButtonLabel'), null, null, null, checkValue, buttonPressed); if(buttonPressed) { return buttonPressed.value; } }} |
|
return buttonPressed; | function PromptSendMessagesOffline(){ InitPrompts(); if (gPromptService) { var buttonPressed = {value:0}; var checkValue= {value:false}; gPromptService.confirmEx(window, gOfflinePromptsBundle.getString('sendMessagesOfflineWindowTitle'), gOfflinePromptsBundle.getString('sendMessagesOfflineLabel'), (gPromptService.BUTTON_TITLE_IS_STRING * gPromptService.BUTTON_POS_0) + (gPromptService.BUTTON_TITLE_CANCEL * gPromptService.BUTTON_POS_1), gOfflinePromptsBundle.getString('sendMessagesOfflineGoButtonLabel'), null, null, null, checkValue, buttonPressed); if(buttonPressed) { return buttonPressed.value; } }} |
|
this.prefs_.addObserver(kPhishWardenEnabledPref, BindToObject(this.loadDataProviderPrefs_, this)); | function PROT_DataProvider() { this.prefs_ = new G_Preferences(); this.loadDataProviderPrefs_(); // Watch for changes in the data provider and update accordingly. this.prefs_.addObserver(kDataProviderIdPref, BindToObject(this.loadDataProviderPrefs_, this));} |
|
this.updateserverURL_ = null; | this.updateserverURL_ = this.prefs_.getPref(kUpdateServerUrl, null); | function PROT_ListManager() { this.debugZone = "listmanager"; G_debugService.enableZone(this.debugZone); this.currentUpdateChecker_ = null; // set when we toggle updates this.prefs_ = new G_Preferences(); this.updateserverURL_ = null; // The lists we know about and the parses we can use to read // them. Default all to the earlies possible version (1.-1); this // version will get updated when successfully read from disk or // fetch updates. this.tablesKnown_ = {}; this.isTesting_ = false; if (this.isTesting_) { // populate with some tables for unittesting this.tablesKnown_ = { // A major version of zero means local, so don't ask for updates "test1-foo-domain" : new PROT_VersionParser("test1-foo-domain", 0, -1), "test2-foo-domain" : new PROT_VersionParser("test2-foo-domain", 0, -1), "test-white-domain" : new PROT_VersionParser("test-white-domain", 0, -1, true /* require mac*/), "test-mac-domain" : new PROT_VersionParser("test-mac-domain", 0, -1, true /* require mac */) }; // expose the object for unittesting this.wrappedJSObject = this; } this.tablesData = {}; this.observerServiceObserver_ = new G_ObserverServiceObserver( 'xpcom-shutdown', BindToObject(this.shutdown_, this), true /*only once*/); // Lazily create urlCrypto (see tr-fetcher.js) this.urlCrypto_ = null;} |
this.listManager_.setUpdateUrl(gDataProvider.getUpdateURL()); | function PROT_ListWarden() { this.debugZone = "listwarden"; var listManager = Cc["@mozilla.org/url-classifier/listmanager;1"] .getService(Ci.nsIUrlListManager); this.listManager_ = listManager; // If we add support for changing local data providers, we need to add a // pref observer that sets the update url accordingly. this.listManager_.setUpdateUrl(gDataProvider.getUpdateURL()); // Once we register tables, their respective names will be listed here. this.blackTables_ = []; this.whiteTables_ = [];} |
|
this.progressListener_.delay = 1500; | function PROT_PhishingWarden() { PROT_ListWarden.call(this); this.debugZone = "phishwarden"; this.testing_ = false; this.browserViews_ = []; // Use this to query preferences this.prefs_ = new G_Preferences(); // Only one displayer so far; perhaps we'll have others in the future this.displayers_ = { "afterload": PROT_PhishMsgDisplayer, }; // We use this dude to do lookups on our remote server this.fetcher_ = new PROT_TRFetcher(); // We need to know whether we're enabled and whether we're in advanced // mode, so reflect the appropriate preferences into our state. // Read state: should we be checking remote preferences? var checkRemotePrefName = PROT_GlobalStore.getServerCheckEnabledPrefName(); this.checkRemote_ = this.prefs_.getPref(checkRemotePrefName, null); // Get notifications when the remote check preference changes var checkRemotePrefObserver = BindToObject(this.onCheckRemotePrefChanged, this); this.prefs_.addObserver(checkRemotePrefName, checkRemotePrefObserver); // Global preference to enable the phishing warden var phishWardenPrefName = PROT_GlobalStore.getPhishWardenEnabledPrefName(); this.phishWardenEnabled_ = this.prefs_.getPref(phishWardenPrefName, null); // Get notifications when the phishing warden enabled pref changes var phishWardenPrefObserver = BindToObject(this.onPhishWardenEnabledPrefChanged, this); this.prefs_.addObserver(phishWardenPrefName, phishWardenPrefObserver); // We have a hardcoded URLs we let people navigate to in order to // check out the warning. this.testURLs_ = PROT_GlobalStore.getTestURLs(); // hook up our browser listener this.progressListener_ = Cc["@mozilla.org/browser/safebrowsing/navstartlistener;1"] .getService(Ci.nsIDocNavStartProgressListener); this.progressListener_.callback = this; this.progressListener_.enabled = this.phishWardenEnabled_; G_Debug(this, "phishWarden initialized");} |
|
wpService.addProgressListener(this, wp.NOTIFY_STATE_REQUEST); | wpService.addProgressListener(this, wp.NOTIFY_STATE_DOCUMENT); | function PROT_PhishingWarden() { PROT_ListWarden.call(this); this.debugZone = "phishwarden"; this.testing_ = false; this.browserViews_ = []; // Use this to query preferences this.prefs_ = new G_Preferences(); // Only one displayer so far; perhaps we'll have others in the future this.displayers_ = { "afterload": PROT_PhishMsgDisplayer, }; // We use this dude to do lookups on our remote server this.fetcher_ = new PROT_TRFetcher(); var wp = Ci.nsIWebProgress; var wpService = Cc["@mozilla.org/docloaderservice;1"].getService(wp); wpService.addProgressListener(this, wp.NOTIFY_STATE_REQUEST); // We need to know whether we're enabled and whether we're in advanced // mode, so reflect the appropriate preferences into our state. // Read state: should we be checking remote preferences? var checkRemotePrefName = PROT_GlobalStore.getServerCheckEnabledPrefName(); this.checkRemote_ = this.prefs_.getPref(checkRemotePrefName, null); // Get notifications when the remote check preference changes var checkRemotePrefObserver = BindToObject(this.onCheckRemotePrefChanged, this); this.prefs_.addObserver(checkRemotePrefName, checkRemotePrefObserver); // Global preference to enable the phishing warden var phishWardenPrefName = PROT_GlobalStore.getPhishWardenEnabledPrefName(); this.phishWardenEnabled_ = this.prefs_.getPref(phishWardenPrefName, null); // Get notifications when the phishing warden enabled pref changes var phishWardenPrefObserver = BindToObject(this.onPhishWardenEnabledPrefChanged, this); this.prefs_.addObserver(phishWardenPrefName, phishWardenPrefObserver); // We have a hardcoded URLs we let people navigate to in order to // check out the warning. this.testURLs_ = PROT_GlobalStore.getTestURLs(); G_Debug(this, "phishWarden initialized");} |
this.debugZone = "phisdisplayer"; | this.debugZone = "phishdisplayer"; | function PROT_PhishMsgDisplayerBase(msgDesc, browser, doc, url) { this.debugZone = "phisdisplayer"; this.msgDesc_ = msgDesc; // currently unused this.browser_ = browser; this.doc_ = doc; this.url_ = url; // We'll need to manipulate the XUL in safebrowsing-overlay.xul this.messageId_ = "safebrowsing-palm-message"; this.messageTailId_ = "safebrowsing-palm-message-tail-container"; this.messageContentId_ = "safebrowsing-palm-message-content"; this.extendedMessageId_ = "safebrowsing-palm-extended-message"; this.showmoreLinkId_ = "safebrowsing-palm-showmore-link"; this.urlbarIconId_ = "safebrowsing-urlbar-icon"; this.refElementId_ = this.urlbarIconId_; // We use this to report user actions to the server this.reporter_ = new PROT_Reporter(); // The active UI elements in our warning send these commands; bind them // to their handlers but don't register the commands until we start // (because another displayer might be active) this.commandHandlers_ = { "safebrowsing-palm-showmore": BindToObject(this.showMore_, this), }; this.windowWatcher_ = Components.classes["@mozilla.org/embedcomp/window-watcher;1"] .getService(Components.interfaces.nsIWindowWatcher);} |
this.faqLinkId_ = "safebrowsing-palm-faq-link"; | function PROT_PhishMsgDisplayerBase(msgDesc, browser, doc, url) { this.debugZone = "phishdisplayer"; this.msgDesc_ = msgDesc; // currently unused this.browser_ = browser; this.doc_ = doc; this.url_ = url; // We'll need to manipulate the XUL in safebrowsing-overlay.xul this.messageId_ = "safebrowsing-palm-message"; this.messageTailId_ = "safebrowsing-palm-message-tail-container"; this.messageContentId_ = "safebrowsing-palm-message-content"; this.extendedMessageId_ = "safebrowsing-palm-extended-message"; this.showmoreLinkId_ = "safebrowsing-palm-showmore-link"; this.urlbarIconId_ = "safebrowsing-urlbar-icon"; this.refElementId_ = this.urlbarIconId_; // We use this to report user actions to the server this.reporter_ = new PROT_Reporter(); // The active UI elements in our warning send these commands; bind them // to their handlers but don't register the commands until we start // (because another displayer might be active) this.commandHandlers_ = { "safebrowsing-palm-showmore": BindToObject(this.showMore_, this), }; this.windowWatcher_ = Components.classes["@mozilla.org/embedcomp/window-watcher;1"] .getService(Components.interfaces.nsIWindowWatcher);} |
|
this.contentStackId_ = "safebrowsing-content-stack"; | function PROT_PhishMsgDisplayerCanvas(msgDesc, browser, doc, url) { PROT_PhishMsgDisplayerBase.call(this, msgDesc, browser, doc, url); this.dimAreaId_ = "safebrowsing-dim-area-canvas"; this.contentStackId_ = "safebrowsing-content-stack"; this.pageCanvasId_ = "safebrowsing-page-canvas"; this.xhtmlNS_ = "http://www.w3.org/1999/xhtml"; // we create html:canvas} |
|
debug("Proxy = " + proxy); | ProxyForURL: function(url, host, port, type) { /* If we're not done loading the pac yet, wait (ideally). For now, just return DIRECT to avoid loops. A simple mutex between ProxyForURL and LoadPACFromURL locks-up the browser. */ if (!this.done) { host.value = null; type.value = "direct"; return; } var uri = url.QueryInterface(Components.interfaces.nsIURI); // Call the original function- var proxy = LocalFindProxyForURL(uri.spec, uri.host); debug("Proxy = " + proxy); if (proxy == "DIRECT") { host.value = null; type.value = "direct"; } else { // TODO warn about SOCKS // we ignore everything else past the first proxy. // we could theoretically check isResolvable now and continue // parsing. but for now... var hostport = /^PROXY ([^:]+):(\d+)/(proxy); host.value = hostport[1]; port.value = hostport[2]; type.value = "http"; //proxy (http, socks, direct, etc) } }, |
|
openDialog("chrome: | openDialog("chrome: "chrome,titlebar,modal,resizable", args ); | function publishCalendarData(){ var args = new Object(); args.onOk = self.publishCalendarDataDialogResponse; openDialog("chrome://calendar/content/publishDialog.xul", "caPublishEvents", "chrome,titlebar,modal", args );} |
openDialog("chrome: | openDialog("chrome: "chrome,titlebar,modal,resizable", args ); return; | function publishEntireCalendar(cal){ var args = new Object(); var publishObject = new Object( ); args.onOk = self.publishEntireCalendarDialogResponse; publishObject.calendar = cal; // restore the remote ics path preference from the calendar passed in var remotePath = getCalendarManager().getCalendarPref(cal, "remote-ics-path"); if (remotePath && remotePath.length && remotePath.length > 0) { publishObject.remotePath = remotePath; } args.publishObject = publishObject; openDialog("chrome://calendar/content/publishDialog.xul", "caPublishEvents", "chrome,titlebar,modal", args );} |
var sub = this.length; for (var i = 0; i < push.arguments.length; ++i) { this[sub] = push.arguments[i]; sub++; } | var sub = this.length; for (var i = 0; i < push.arguments.length; ++i) { this[sub] = push.arguments[i]; sub++; | Array.prototype.push = function() { var sub = this.length; for (var i = 0; i < push.arguments.length; ++i) { this[sub] = push.arguments[i]; sub++; } } |
} | Array.prototype.push = function() { var sub = this.length; for (var i = 0; i < push.arguments.length; ++i) { this[sub] = push.arguments[i]; sub++; } } |
|
var fn = args && args[args.length-1]; var fn2 = args && args[args.length-2]; | var fn = args && args.length > 1 && args[args.length-1]; var fn2 = args && args.length > 2 && args[args.length-2]; | pushStack: function(a,args) { var fn = args && args[args.length-1]; var fn2 = args && args[args.length-2]; if ( fn && fn.constructor != Function ) fn = null; if ( fn2 && fn2.constructor != Function ) fn2 = null; if ( !fn ) { if ( !this.stack ) this.stack = []; this.stack.push( this.get() ); this.set( a ); } else { var old = this.get(); this.set( a ); if ( fn2 && a.length || !fn2 ) this.each( fn2 || fn ).set( old ); else this.set( old ).each( fn ); } return this; } |
if ( fn.constructor == Function ) | if ( typeof fn == "function" ) | pushStack: function(a,args) { var fn = args && args[args.length-1]; if ( !fn || fn.constructor != Function ) { if ( !this.stack ) this.stack = []; this.stack.push( this.get() ); this.get( a ); } else { var old = this.get(); this.get( a ); if ( fn.constructor == Function ) this.each( fn ); this.get( old ); } return this; } |
pushStack: function(a,args) { var fn = args && args[args.length-1]; var fn2 = args && args[args.length-2]; if ( fn && fn.constructor != Function ) fn = null; if ( fn2 && fn2.constructor != Function ) fn2 = null; if ( !fn ) { if ( !this.stack ) this.stack = []; this.stack.push( this.get() ); this.get( a ); } else { var old = this.get(); this.get( a ); if ( fn2 && a.length || !fn2 ) this.each( fn2 || fn ).get( old ); else this.get( old ).each( fn ); } return this; | pushStack: function(a) { if ( !this.stack ) this.stack = []; this.stack.push( this.get() ); return this.set( a ); | pushStack: function(a,args) { var fn = args && args[args.length-1]; var fn2 = args && args[args.length-2]; if ( fn && fn.constructor != Function ) fn = null; if ( fn2 && fn2.constructor != Function ) fn2 = null; if ( !fn ) { if ( !this.stack ) this.stack = []; this.stack.push( this.get() ); this.get( a ); } else { var old = this.get(); this.get( a ); if ( fn2 && a.length || !fn2 ) this.each( fn2 || fn ).get( old ); else this.get( old ).each( fn ); } return this; } |
}, | } | pushStack: function(a,args) { var fn = args && args[args.length-1]; if ( !fn || fn.constructor != Function ) { if ( !this.stack ) this.stack = []; this.stack.push( this.get() ); this.get( a ); } else { var old = this.get(); this.get( a ); if ( fn.constructor == Function ) return this.each( fn ); this.get( old ); } return this; }, |
return this.each( fn ); | this.each( fn ); | pushStack: function(a,args) { var fn = args && args[args.length-1]; if ( !fn || fn.constructor != Function ) { if ( !this.stack ) this.stack = []; this.stack.push( this.get() ); this.get( a ); } else { var old = this.get(); this.get( a ); if ( fn.constructor == Function ) return this.each( fn ); this.get( old ); } return this; } |
if ( !fn || fn.constructor != Function ) { | if ( !fn ) { | pushStack: function(a,args) { var fn = args && args[args.length-1]; if ( !fn || fn.constructor != Function ) { if ( !this.stack ) this.stack = []; this.stack.push( this.get() ); this.get( a ); } else { var old = this.get(); this.get( a ); if ( typeof fn == "function" ) this.each( fn ); this.get( old ); } return this; } |
if ( typeof fn == "function" ) this.each( fn ); this.get( old ); | if ( fn2 && a.length || !fn2 ) this.each( fn2 || fn ).get( old ); else this.get( old ).each( fn ); | pushStack: function(a,args) { var fn = args && args[args.length-1]; if ( !fn || fn.constructor != Function ) { if ( !this.stack ) this.stack = []; this.stack.push( this.get() ); this.get( a ); } else { var old = this.get(); this.get( a ); if ( typeof fn == "function" ) this.each( fn ); this.get( old ); } return this; } |
var fn = args ? (args.constructor == Function ? args : args[args.length-1]) : function(){}; | var fn = args[args.length-1]; | pushStack: function(a,args) { var fn = args ? (args.constructor == Function ? args : args[args.length-1]) : function(){}; if ( !fn ) { if ( !this.stack ) this.stack = []; this.stack.push( this.get() ); this.get( a ); } else { var old = this.get(); this.get( a ); if ( fn.constructor == Function ) return this.each( fn ); this.get( old ); } return this; }, |
if ( !fn ) { | if ( !fn || fn.constructor != Function ) { | pushStack: function(a,args) { var fn = args ? (args.constructor == Function ? args : args[args.length-1]) : function(){}; if ( !fn ) { if ( !this.stack ) this.stack = []; this.stack.push( this.get() ); this.get( a ); } else { var old = this.get(); this.get( a ); if ( fn.constructor == Function ) return this.each( fn ); this.get( old ); } return this; }, |
for (var i = min; i < max; ++i) | min = min.value; max = max.value; dd ("range " + range + ", " + min + "..." + max); for (var i = min; i <= max; ++i) | function pv_getcx(cx){ 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 TOLabelRecord) { if (rec.label == MSG_BREAK_REC) cx.breakpointLabel = true; return cx; } if (rec instanceof BPRecord) { cx.breakpointRec = rec; cx.fileName = rec.fileName; cx.lineNumber = rec.line; cx.breakpointIndex = rec.childIndex; } var rangeCount = this.outliner.selection.getRangeCount(); if (rangeCount > 0) cx.breakpointRecList = 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 BPRecord) cx.breakpointRecList.push(rec); } } return cx;} |
cx.breakpointIndexList.push(rec.childIndex); } else dd ("row " + i + " is NOT a bprecord"); | function pv_getcx(cx){ 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 TOLabelRecord) { if (rec.label == MSG_BREAK_REC) cx.breakpointLabel = true; return cx; } if (rec instanceof BPRecord) { cx.breakpointRec = rec; cx.fileName = rec.fileName; cx.lineNumber = rec.line; cx.breakpointIndex = rec.childIndex; } var rangeCount = this.outliner.selection.getRangeCount(); if (rangeCount > 0) cx.breakpointRecList = 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 BPRecord) cx.breakpointRecList.push(rec); } } return cx;} |
|
dd ("get project context..."); | function pv_getcx(cx){ dd ("get project 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 TOLabelRecord) { if (rec.label == MSG_BREAK_REC) cx.breakpointLabel = true; return cx; } if (rec instanceof BPRecord) { cx.breakpointRec = rec; cx.fileName = rec.fileName; cx.lineNumber = rec.line; cx.breakpointIndex = rec.childIndex; } var rangeCount = this.outliner.selection.getRangeCount(); if (rangeCount > 0) cx.breakpointRecList = 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 BPRecord) cx.breakpointRecList.push(rec); } } return cx;} |
|
if (rv.reason != PICK_OK) | if (!rv.ok) | function pwin_onPrefBrowse(button){ var spec = "$all"; if (button.hasAttribute("spec")) spec = button.getAttribute("spec") + " " + spec; var type = button.getAttribute("kind"); var edit = button.previousSibling.lastChild; var rv; if (type == "folder") { var current = getFileFromURLSpec(edit.value); rv = pickGetFolder(MSG_PREFS_BROWSE_TITLE, current); } else { rv = pickOpen(MSG_PREFS_BROWSE_TITLE, spec); } if (rv.reason != PICK_OK) return; edit.value = (type == "file") ? rv.file.path : rv.picker.fileURL.spec;}, |
if (rv.reason == PICK_OK) | if (rv.ok) | function pwin_onPrefListAdd(object){ var list = getRelatedItem(object, "list"); var newItem; switch (list.getAttribute("kind")) { case "url": var item = prompt(MSG_PREFS_LIST_ADD); if (item) { newItem = document.createElement("listitem"); newItem.setAttribute("label", item); newItem.value = item; list.appendChild(newItem); this.onPrefListSelect(object); } break; case "file": case "fileurl": var spec = "$all"; var rv = pickOpen(MSG_PREFS_BROWSE_TITLE, spec); if (rv.reason == PICK_OK) { var data = { file: rv.file.path, fileurl: rv.picker.fileURL.spec }; var kind = list.getAttribute("kind"); newItem = document.createElement("listitem"); newItem.setAttribute("label", data[kind]); newItem.value = data[kind]; list.appendChild(newItem); this.onPrefListSelect(object); } break; }} |
return [f - d]; | return (f - d); | function q1(n) { var c = []; c[Math.pow(10, n)] = 1; c = c.join(" "); var d = Date.now(); var e = c.match(/(.*)foo$/); var f = Date.now(); return [f - d];} |
return [f - d]; | return (f - d); | function q2(n) { var c = []; c[Math.pow(10, n)] = 1; c = c.join(" "); var d = Date.now(); var e = /foo$/.test(c) && c.match(/(.*)foo$/); var f = Date.now(); return [f - d];} |
if (!iid.equals(nsISupports) && !iid.equals(nsIActiveXSecurityPolicy) && !iid.equals(nsIObserver)) throw Components.results.NS_ERROR_NO_INTERFACE; return this; | if (iid.equals(nsISupports) || iid.equals(nsIActiveXSecurityPolicy) || iid.equals(nsIObserver)) return this; Components.returnCode = Components.results.NS_ERROR_NO_INTERFACE; return null; | QueryInterface: function(iid) { if (!iid.equals(nsISupports) && !iid.equals(nsIActiveXSecurityPolicy) && !iid.equals(nsIObserver)) throw Components.results.NS_ERROR_NO_INTERFACE; return this; } |
if (!aIID.equals(Components.interfaces.nsIUpdateCheckListener) && !aIID.equals(Components.interfaces.nsISupports)) throw Components.results.NS_ERROR_NO_INTERFACE; return this; } | if (!iid.equals(Components.interfaces.nsIRequestObserver) && !iid.equals(Components.interfaces.nsIProgressEventSink) && !iid.equals(Components.interfaces.nsISupports)) throw Components.results.NS_ERROR_NO_INTERFACE; return this; } | QueryInterface: function(iid) { if (!aIID.equals(Components.interfaces.nsIUpdateCheckListener) && !aIID.equals(Components.interfaces.nsISupports)) throw Components.results.NS_ERROR_NO_INTERFACE; return this; } |
QueryInterface: function(iid) { if (iid.equals(Components.interfaces.nsIURIContentListener) || iid.equals(Components.interfaces.nsISupportsWeakReference) || iid.equals(Components.interfaces.nsISupports)) return this; throw Components.results.NS_NOINTERFACE; }, | QueryInterface : function(aIID) { if (aIID.equals(nsCI.nsIBrowserDOMWindow) || aIID.equals(nsCI.nsISupports)) return this; throw Components.results.NS_NOINTERFACE; }, | QueryInterface: function(iid) { if (iid.equals(Components.interfaces.nsIURIContentListener) || iid.equals(Components.interfaces.nsISupportsWeakReference) || iid.equals(Components.interfaces.nsISupports)) return this; throw Components.results.NS_NOINTERFACE; }, |
if (!iid.equals(Components.interfaces.nsISupports) && !iid.equals(Components.interfaces.nsIXPIProgressDialog)) throw Components.results.NS_ERROR_NO_INTERFACE; | if (iid.equals(Components.interfaces.nsISupports) || iid.equals(Components.interfaces.nsIXPIProgressDialog)) return this; | QueryInterface: function( iid ) { if (!iid.equals(Components.interfaces.nsISupports) && !iid.equals(Components.interfaces.nsIXPIProgressDialog)) throw Components.results.NS_ERROR_NO_INTERFACE; return this; } |
return this; | Components.returnCode = Components.results.NS_ERROR_NO_INTERFACE; return null; | QueryInterface: function( iid ) { if (!iid.equals(Components.interfaces.nsISupports) && !iid.equals(Components.interfaces.nsIXPIProgressDialog)) throw Components.results.NS_ERROR_NO_INTERFACE; return this; } |
if (!iid.equals(Components.interfaces.nsICmdLineHandler) && !iid.equals(Components.interfaces.nsISupports)) { throw Components.results.NS_ERROR_NO_INTERFACE; } return this; | if (iid.equals(Components.interfaces.nsICmdLineHandler) || iid.equals(Components.interfaces.nsISupports)) return this; Components.returnCode = Components.results.NS_ERROR_NO_INTERFACE; return null; | QueryInterface: function (iid) { if (!iid.equals(Components.interfaces.nsICmdLineHandler) && !iid.equals(Components.interfaces.nsISupports)) { throw Components.results.NS_ERROR_NO_INTERFACE; } return this; }, |
if (!iid.equals(Components.interfaces.nsIRequestObserver) && !iid.equals(Components.interfaces.nsISupports) && !iid.equals(Components.interfaces.nsIInterfaceRequestor)) { throw Components.results.NS_ERROR_NO_INTERFACE; } return this; | if (iid.equals(Components.interfaces.nsIRequestObserver) || iid.equals(Components.interfaces.nsISupports) || iid.equals(Components.interfaces.nsIInterfaceRequestor)) return this; Components.returnCode = Components.results.NS_ERROR_NO_INTERFACE; return null; | QueryInterface: function (iid) { if (!iid.equals(Components.interfaces.nsIRequestObserver) && !iid.equals(Components.interfaces.nsISupports) && !iid.equals(Components.interfaces.nsIInterfaceRequestor)) { throw Components.results.NS_ERROR_NO_INTERFACE; } return this; }, |
!aIID.equals(Components.interfaces.calICompositeObserver) && | QueryInterface: function (aIID) { if (!aIID.equals(Components.interfaces.nsISupports) && !aIID.equals(Components.interfaces.calIObserver)) { throw Components.results.NS_ERROR_NO_INTERFACE; } return this; }, |
|
if (!iid.equals(nsIObserver) && !iid.equals(nsIServerSocketListener) && !iid.equals(nsISupports)) throw Components.results.NS_ERROR_NO_INTERFACE; return this; | if (iid.equals(nsIObserver) || iid.equals(nsIServerSocketListener) || iid.equals(nsISupports)) return this; Components.returnCode = Components.results.NS_ERROR_NO_INTERFACE; return null; | QueryInterface: function(iid) { if (!iid.equals(nsIObserver) && !iid.equals(nsIServerSocketListener) && !iid.equals(nsISupports)) throw Components.results.NS_ERROR_NO_INTERFACE; return this; }, |
if (!aIID.equals(Components.interfaces.nsIObserver) && !aIID.equals(Components.interfaces.nsIProfileStartupListener) && !aIID.equals(Components.interfaces.nsISupports)) throw Components.results.NS_ERROR_NO_INTERFACE; | if (aIID.equals(Components.interfaces.nsIObserver) || aIID.equals(Components.interfaces.nsIProfileStartupListener) || aIID.equals(Components.interfaces.nsISupports)) return this; | QueryInterface: function(aIID) { if (!aIID.equals(Components.interfaces.nsIObserver) && !aIID.equals(Components.interfaces.nsIProfileStartupListener) && !aIID.equals(Components.interfaces.nsISupports)) throw Components.results.NS_ERROR_NO_INTERFACE; return this; } |
return this; | Components.returnCode = Components.results.NS_ERROR_NO_INTERFACE; return null; | QueryInterface: function(aIID) { if (!aIID.equals(Components.interfaces.nsIObserver) && !aIID.equals(Components.interfaces.nsIProfileStartupListener) && !aIID.equals(Components.interfaces.nsISupports)) throw Components.results.NS_ERROR_NO_INTERFACE; return this; } |
if (aIId.equals(Components.interfaces.nsIStreamListener)) | if (aIId.equals(Components.interfaces.nsIStreamListener) || aIId.equals(Components.interfaces.nsISupports)) | QueryInterface: function(aIId, instance) { if (aIId.equals(Components.interfaces.nsIStreamListener)) return this; if (aIId.equals(Components.interfaces.nsISupports)) return this; dump("QueryInterface " + aIId + "\n"); throw Components.results.NS_NOINTERFACE; }, |
if (aIId.equals(Components.interfaces.nsISupports)) return this; dump("QueryInterface " + aIId + "\n"); throw Components.results.NS_NOINTERFACE; | Components.returnCode = Components.results.NS_ERROR_NO_INTERFACE; return null; | QueryInterface: function(aIId, instance) { if (aIId.equals(Components.interfaces.nsIStreamListener)) return this; if (aIId.equals(Components.interfaces.nsISupports)) return this; dump("QueryInterface " + aIId + "\n"); throw Components.results.NS_NOINTERFACE; }, |
!iid.equals(Components.interfaces.nsIInterfaceRequestor) && !iid.equals(Components.interfaces.nsIAuthPrompt)) { | !iid.equals(Components.interfaces.nsIInterfaceRequestor)) { | QueryInterface: function (iid) { if (!iid.equals(Components.interfaces.nsIRequestObserver) && !iid.equals(Components.interfaces.nsISupports) && !iid.equals(Components.interfaces.nsIInterfaceRequestor) && !iid.equals(Components.interfaces.nsIAuthPrompt)) { throw Components.results.NS_ERROR_NO_INTERFACE; } return this; }, |
QueryInterface: function(theUID, theResult) | QueryInterface: function(aUID, theResult) | QueryInterface: function(theUID, theResult) { if (theUID == Components.interfaces.nsITransaction || theUID == Components.interfaces.nsISupports) return this; return nsnull; }, |
if (theUID == Components.interfaces.nsITransaction || theUID == Components.interfaces.nsISupports) return this; | if (aUID.equals(Components.interfaces.nsITransaction) || aUID.equals(Components.interfaces.nsISupports)) return this; | QueryInterface: function(theUID, theResult) { if (theUID == Components.interfaces.nsITransaction || theUID == Components.interfaces.nsISupports) return this; return nsnull; }, |
return nsnull; | Components.returnCode = Components.results.NS_ERROR_NO_INTERFACE; return null; | QueryInterface: function(theUID, theResult) { if (theUID == Components.interfaces.nsITransaction || theUID == Components.interfaces.nsISupports) return this; return nsnull; }, |
iid.equals(Components.interfaces.nsISupports)) { | iid.equals(Components.interfaces.nsISupports)) | QueryInterface: function (iid) { if (iid.equals(Components.interfaces.nsISupportsWeakReference) || iid.equals(Components.interfaces.nsISupports)) { return this; } throw Components.results.NS_ERROR_NO_INTERFACE; } |
} throw Components.results.NS_ERROR_NO_INTERFACE; | Components.returnCode = Components.results.NS_ERROR_NO_INTERFACE; return null; | QueryInterface: function (iid) { if (iid.equals(Components.interfaces.nsISupportsWeakReference) || iid.equals(Components.interfaces.nsISupports)) { return this; } throw Components.results.NS_ERROR_NO_INTERFACE; } |
if (!iid.equals(Components.interfaces.nsICloseAllWindows) && !iid.equals(Components.interfaces.nsISupports)) { throw Components.results.NS_ERROR_NO_INTERFACE; } return this; | if (iid.equals(Components.interfaces.nsICloseAllWindows) || iid.equals(Components.interfaces.nsISupports)) return this; Components.returnCode = Components.results.NS_ERROR_NO_INTERFACE; return null; | QueryInterface: function (iid) { if (!iid.equals(Components.interfaces.nsICloseAllWindows) && !iid.equals(Components.interfaces.nsISupports)) { throw Components.results.NS_ERROR_NO_INTERFACE; } return this; }, |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.