rem
stringlengths 0
126k
| add
stringlengths 0
441k
| context
stringlengths 15
136k
|
---|---|---|
var rv = picker.show(); if (rv != PICK_CANCEL) | var rv = getPickerChoice(picker); if (rv.ok) | function pickOpen (title, typeList, defaultFile, defaultDir){ if (!defaultDir && "lastOpenDir" in futils) defaultDir = futils.lastOpenDir; var picker = futils.getPicker (defaultDir, typeList, {defaultString: defaultFile}); picker.init (window, title ? title : futils.MSG_OPEN, Components.interfaces.nsIFilePicker.modeOpen); var rv = picker.show(); if (rv != PICK_CANCEL) futils.lastOpenDir = picker.file.parent; return {reason: rv, file: picker.file, picker: picker};} |
return {reason: rv, file: picker.file, picker: picker}; | return rv; | function pickOpen (title, typeList, defaultFile, defaultDir){ if (!defaultDir && "lastOpenDir" in futils) defaultDir = futils.lastOpenDir; var picker = futils.getPicker (defaultDir, typeList, {defaultString: defaultFile}); picker.init (window, title ? title : futils.MSG_OPEN, Components.interfaces.nsIFilePicker.modeOpen); var rv = picker.show(); if (rv != PICK_CANCEL) futils.lastOpenDir = picker.file.parent; return {reason: rv, file: picker.file, picker: picker};} |
var reason; | var rv = getPickerChoice(picker); if (rv.ok) futils.lastSaveAsDir = picker.file.parent; | function pickSaveAs (title, typeList, defaultFile, defaultDir, defaultExt){ if (!defaultDir && "lastSaveAsDir" in futils) defaultDir = futils.lastSaveAsDir; var picker = futils.getPicker (defaultDir, typeList, {defaultString: defaultFile, defaultExtension: defaultExt}); picker.init (window, title ? title : futils.MSG_SAVE_AS, Components.interfaces.nsIFilePicker.modeSave); var reason; try { reason = picker.show(); } catch (ex) { dd ("caught exception from file picker: " + ex); } var obj = new Object(); obj.reason = reason; obj.picker = picker; if (reason != PICK_CANCEL) { obj.file = picker.file; futils.lastSaveAsDir = picker.file.parent; } else { obj.file = null; } return obj;} |
try { reason = picker.show(); } catch (ex) { dd ("caught exception from file picker: " + ex); } var obj = new Object(); obj.reason = reason; obj.picker = picker; if (reason != PICK_CANCEL) { obj.file = picker.file; futils.lastSaveAsDir = picker.file.parent; } else { obj.file = null; } return obj; | return rv; | function pickSaveAs (title, typeList, defaultFile, defaultDir, defaultExt){ if (!defaultDir && "lastSaveAsDir" in futils) defaultDir = futils.lastSaveAsDir; var picker = futils.getPicker (defaultDir, typeList, {defaultString: defaultFile, defaultExtension: defaultExt}); picker.init (window, title ? title : futils.MSG_SAVE_AS, Components.interfaces.nsIFilePicker.modeSave); var reason; try { reason = picker.show(); } catch (ex) { dd ("caught exception from file picker: " + ex); } var obj = new Object(); obj.reason = reason; obj.picker = picker; if (reason != PICK_CANCEL) { obj.file = picker.file; futils.lastSaveAsDir = picker.file.parent; } else { obj.file = null; } return obj;} |
this.pageTransaction = PlacesController.activeView.filterTransactions; NS_ASSERT(this.pageTransaction !== undefined, "Don't know if this transaction must be filtered"); | function PlacesAggregateTransaction(name, transactions) { this._transactions = transactions; this._name = name; this.redoTransaction = this.doTransaction; this.pageTransaction = PlacesController.activeView.filterTransactions; NS_ASSERT(this.pageTransaction !== undefined, "Don't know if this transaction must be filtered");} |
|
this.pageTransaction = PlacesController.activeView.filterTransactions; NS_ASSERT(this.pageTransaction !== undefined, "Don't know if this transaction must be filtered"); | function PlacesCreateFolderTransaction(name, container, index) { this._name = name; this._container = container; this._index = index; this._id = null; this.redoTransaction = this.doTransaction; this.pageTransaction = PlacesController.activeView.filterTransactions; NS_ASSERT(this.pageTransaction !== undefined, "Don't know if this transaction must be filtered");} |
|
this.pageTransaction = PlacesController.activeView.filterTransactions; NS_ASSERT(this.pageTransaction !== undefined, "Don't know if this transaction must be filtered"); | function PlacesCreateItemTransaction(uri, container, index) { this._uri = uri; this._container = container; this._index = index; this.redoTransaction = this.doTransaction; this.pageTransaction = PlacesController.activeView.filterTransactions; NS_ASSERT(this.pageTransaction !== undefined, "Don't know if this transaction must be filtered");} |
|
this.pageTransaction = PlacesController.activeView.filterTransactions; NS_ASSERT(this.pageTransaction !== undefined, "Don't know if this transaction must be filtered"); | function PlacesEditFolderTransaction(id, oldAttributes, newAttributes) { this._id = id; this._oldAttributes = oldAttributes; this._newAttributes = newAttributes; this.redoTransaction = this.doTransaction; this.pageTransaction = PlacesController.activeView.filterTransactions; NS_ASSERT(this.pageTransaction !== undefined, "Don't know if this transaction must be filtered");} |
|
this.pageTransaction = PlacesController.activeView.filterTransactions; NS_ASSERT(this.pageTransaction !== undefined, "Don't know if this transaction must be filtered"); | function PlacesEditItemTransaction(uri, newAttributes) { this._uri = uri; this._newAttributes = newAttributes; this._oldAttributes = { }; this.redoTransaction = this.doTransaction; this.pageTransaction = PlacesController.activeView.filterTransactions; NS_ASSERT(this.pageTransaction !== undefined, "Don't know if this transaction must be filtered");} |
|
this.pageTransaction = PlacesController.activeView.filterTransactions; NS_ASSERT(this.pageTransaction !== undefined, "Don't know if this transaction must be filtered"); | function PlacesMoveFolderTransaction(id, oldContainer, oldIndex, newContainer, newIndex) { NS_ASSERT(!isNaN(id + oldContainer + oldIndex + newContainer + newIndex), "Parameter is NaN!"); this._id = id; this._oldContainer = oldContainer; this._oldIndex = oldIndex; this._newContainer = newContainer; this._newIndex = newIndex; this.redoTransaction = this.doTransaction; this.pageTransaction = PlacesController.activeView.filterTransactions; NS_ASSERT(this.pageTransaction !== undefined, "Don't know if this transaction must be filtered");} |
|
this.pageTransaction = PlacesController.activeView.filterTransactions; NS_ASSERT(this.pageTransaction !== undefined, "Don't know if this transaction must be filtered"); | function PlacesMoveItemTransaction(uri, oldContainer, oldIndex, newContainer, newIndex) { this._uri = uri; this._oldContainer = oldContainer; this._oldIndex = oldIndex; this._newContainer = newContainer; this._newIndex = newIndex; this.redoTransaction = this.doTransaction; this.pageTransaction = PlacesController.activeView.filterTransactions; NS_ASSERT(this.pageTransaction !== undefined, "Don't know if this transaction must be filtered");} |
|
this.pageTransaction = PlacesController.activeView.filterTransactions; NS_ASSERT(this.pageTransaction !== undefined, "Don't know if this transaction must be filtered"); | function PlacesRemoveFolderTransaction(id, oldContainer, oldIndex) { this._id = id; this._oldContainer = oldContainer; this._oldIndex = oldIndex; this._oldFolderTitle = null; this._contents = null; // The encoded contents of this folder this.redoTransaction = this.doTransaction; this.pageTransaction = PlacesController.activeView.filterTransactions; NS_ASSERT(this.pageTransaction !== undefined, "Don't know if this transaction must be filtered");} |
|
this.pageTransaction = PlacesController.activeView.filterTransactions; NS_ASSERT(this.pageTransaction !== undefined, "Don't know if this transaction must be filtered"); | function PlacesRemoveItemTransaction(uri, oldContainer, oldIndex) { this._uri = uri; this._oldContainer = oldContainer; this._oldIndex = oldIndex; this.redoTransaction = this.doTransaction; this.pageTransaction = PlacesController.activeView.filterTransactions; NS_ASSERT(this.pageTransaction !== undefined, "Don't know if this transaction must be filtered");} |
|
var playSound = document.getElementById("newMailNotification").checked; var playSoundType = document.getElementById("newMailNotificationType"); playSoundType.disabled = !playSound; | var playSound = document.getElementById("finishedNotificationSound").checked; | function PlaySoundCheck(){ var playSound = document.getElementById("newMailNotification").checked; var playSoundType = document.getElementById("newMailNotificationType"); playSoundType.disabled = !playSound; var disableCustomUI = !(playSound && playSoundType.value == 1); var mailnewsSoundFileUrl = document.getElementById("mailnewsSoundFileUrl"); mailnewsSoundFileUrl.disabled = disableCustomUI document.getElementById("preview").disabled = disableCustomUI || (mailnewsSoundFileUrl.value == ""); document.getElementById("browse").disabled = disableCustomUI;} |
var disableCustomUI = !(playSound && playSoundType.value == 1); var mailnewsSoundFileUrl = document.getElementById("mailnewsSoundFileUrl"); | var disableCustomUI = !playSound; var finishedSoundUrl = document.getElementById("finishedSoundUrl"); | function PlaySoundCheck(){ var playSound = document.getElementById("newMailNotification").checked; var playSoundType = document.getElementById("newMailNotificationType"); playSoundType.disabled = !playSound; var disableCustomUI = !(playSound && playSoundType.value == 1); var mailnewsSoundFileUrl = document.getElementById("mailnewsSoundFileUrl"); mailnewsSoundFileUrl.disabled = disableCustomUI document.getElementById("preview").disabled = disableCustomUI || (mailnewsSoundFileUrl.value == ""); document.getElementById("browse").disabled = disableCustomUI;} |
mailnewsSoundFileUrl.disabled = disableCustomUI document.getElementById("preview").disabled = disableCustomUI || (mailnewsSoundFileUrl.value == ""); | finishedSoundUrl.disabled = disableCustomUI; document.getElementById("preview").disabled = disableCustomUI || (finishedSoundUrl.value == ""); | function PlaySoundCheck(){ var playSound = document.getElementById("newMailNotification").checked; var playSoundType = document.getElementById("newMailNotificationType"); playSoundType.disabled = !playSound; var disableCustomUI = !(playSound && playSoundType.value == 1); var mailnewsSoundFileUrl = document.getElementById("mailnewsSoundFileUrl"); mailnewsSoundFileUrl.disabled = disableCustomUI document.getElementById("preview").disabled = disableCustomUI || (mailnewsSoundFileUrl.value == ""); document.getElementById("browse").disabled = disableCustomUI;} |
var playSound = document.getElementById("finishedNotificationSound").checked; | var disableCustomUI = !document.getElementById("finishedNotificationSound").checked; | function PlaySoundCheck(){ var playSound = document.getElementById("finishedNotificationSound").checked; var disableCustomUI = !playSound; var finishedSoundUrl = document.getElementById("finishedSoundUrl"); finishedSoundUrl.disabled = disableCustomUI; document.getElementById("preview").disabled = disableCustomUI || (finishedSoundUrl.value == ""); document.getElementById("browse").disabled = disableCustomUI;} |
var disableCustomUI = !playSound; var finishedSoundUrl = document.getElementById("finishedSoundUrl"); finishedSoundUrl.disabled = disableCustomUI; document.getElementById("preview").disabled = disableCustomUI || (finishedSoundUrl.value == ""); document.getElementById("browse").disabled = disableCustomUI; | gFinishedSound.disabled = disableCustomUI || gFinishedSoundLocked; document.getElementById("preview").disabled = disableCustomUI; document.getElementById("browse").disabled = disableCustomUI || gFinishedSoundLocked; | function PlaySoundCheck(){ var playSound = document.getElementById("finishedNotificationSound").checked; var disableCustomUI = !playSound; var finishedSoundUrl = document.getElementById("finishedSoundUrl"); finishedSoundUrl.disabled = disableCustomUI; document.getElementById("preview").disabled = disableCustomUI || (finishedSoundUrl.value == ""); document.getElementById("browse").disabled = disableCustomUI;} |
escapedAry[i] = escape(ary[i]); | escapedAry[i] = escape(fromUnicode(ary[i], PREF_CHARSET)); | function pm_a2s(ary){ var escapedAry = new Array() for (var i = 0; i < ary.length; ++i) escapedAry[i] = escape(ary[i]); return escapedAry.join("; ");} |
realValue = this.prefBranch.getCharPref(prefName); | realValue = toUnicode(this.prefBranch.getCharPref(prefName), PREF_CHARSET); | function pm_getpref(prefName, reload){ var prefManager = this; function updateArrayPref() { prefManager.updateArrayPref(prefName); }; var record = this.prefRecords[prefName]; if (!ASSERT(record, "Unknown pref: " + prefName)) return null; var defaultValue; if (typeof record.defaultValue == "function") { // deferred pref, call the getter, and don't cache the result. defaultValue = record.defaultValue(prefName); } else { if (!reload && record.realValue != null) return record.realValue; defaultValue = record.defaultValue; } var realValue = null; try { if (typeof defaultValue == "boolean") { realValue = this.prefBranch.getBoolPref(prefName); } else if (typeof defaultValue == "number") { realValue = this.prefBranch.getIntPref(prefName); } else if (defaultValue instanceof Array) { realValue = this.prefBranch.getCharPref(prefName); realValue = this.stringToArray(realValue); realValue.update = updateArrayPref; } else if (typeof defaultValue == "string" || defaultValue == null) { realValue = this.prefBranch.getCharPref(prefName); } } catch (ex) { // if the pref doesn't exist, ignore the exception. } if (realValue == null) return defaultValue; record.realValue = realValue; return realValue;} |
if (!(prefName in this.prefRecords)) return; | function pm_prefchanged(prefName, realValue, oldValue){ for (var i = 0; i < this.observers.length; i++) this.observers[i].onPrefChanged(prefName, realValue, oldValue);} |
|
ary[i] = unescape(ary[i]); | ary[i] = toUnicode(unescape(ary[i]), PREF_CHARSET); | function pm_s2a(string){ if (string.search(/\S/) == -1) return []; var ary = string.split(/\s*;\s*/); for (var i = 0; i < ary.length; ++i) ary[i] = unescape(ary[i]); return ary;} |
this.prefBranch.setCharPref(prefName, value); | this.prefBranch.setCharPref(prefName, fromUnicode(value, PREF_CHARSET)); | function pm_setpref(prefName, value){ var prefManager = this; function updateArrayPref() { prefManager.updateArrayPref(prefName); }; var record = this.prefRecords[prefName]; if (!ASSERT(record, "Unknown pref: " + prefName)) return null; if ((record.realValue == null && value == record.defaultValue) || record.realValue == value) { // no realvalue, and value is the same as default value ... OR ... // no change at all. just bail. return record.realValue; } if (value == record.defaultValue) { this.clearPref(prefName); return value; } var defaultValue = record.defaultValue; if (typeof defaultValue == "function") defaultValue = defaultValue(prefName); if (typeof defaultValue == "boolean") { this.prefBranch.setBoolPref(prefName, value); } else if (typeof defaultValue == "number") { this.prefBranch.setIntPref(prefName, value); } else if (defaultValue instanceof Array) { var str = this.arrayToString(value); this.prefBranch.setCharPref(prefName, str); value.update = updateArrayPref; } else { this.prefBranch.setCharPref(prefName, value); } this.prefService.savePrefFile(null); record.realValue = value; return value;} |
} else { document.getElementById('editform_regression_bug_id').value = ""; | function populateTestcase(data) { testcase=data; document.getElementById('editform_testcase_id').value = testcase.testcase_id; document.getElementById('editform_testcase_id_display').innerHTML = testcase.testcase_id; document.getElementById('editform_summary').value = testcase.summary; document.getElementById('editform_steps').value = testcase.steps; document.getElementById('editform_results').value = testcase.expected_results; document.getElementById('testcase_id_display').innerHTML = testcase.testcase_id; document.getElementById('summary_text').innerHTML = testcase.summary; document.getElementById('steps_text').innerHTML = testcase.steps_formatted; document.getElementById('results_text').innerHTML = testcase.expected_results_formatted; var product_box = document.getElementById('product'); var options = product_box.getElementsByTagName('option'); var found_product = 0; for (var i=0; i<options.length; i++) { if (options[i].value == testcase.product_id.product_id) { options[i].selected = true; document.getElementById('product_text').innerHTML = options[i].text; found_product=1; } else { options[i].selected = false; } } if (found_product == 0 && options[0]) { options[0].selected = true; } changeProduct(); var testgroups_text = ""; var testgroups_link_text = ""; for (var i in testcase.testgroups) { if (testcase.testgroups[i].name != '') { testgroups_text = testgroups_text + testcase.testgroups[i].name + ', '; testgroups_link_text = testgroups_link_text + '<a target="manage_testgroups" href="manage_testgroups.cgi?testgroup_id=' + testcase.testgroups[i].testgroup_id + '">'+ testcase.testgroups[i].name + '</a>, '; } } if (testgroups_text != '') { testgroups_text = testgroups_text.replace(/, $/g,''); testgroups_link_text = testgroups_link_text.replace(/, $/g,''); document.getElementById('testgroups_display').innerHTML = testgroups_text; document.getElementById('testgroups_link_display').innerHTML = testgroups_link_text; } else { document.getElementById('testgroups_display').innerHTML = '<span class="errorHeading">This testcase does not belong to any testgroups that are currently enabled.</span>'; document.getElementById('testgroups_link_display').innerHTML = '<span class="errorHeading">This testcase does not belong to any testgroups that are currently enabled ⇒ <a target="manage_testgroups" href="manage_testgroups.cgi">Jump to Manage Testgroups</a>.</span>'; } var subgroups_text = ""; var subgroups_link_text = ""; for (var i in testcase.subgroups) { if (testcase.subgroups[i].name != '') { subgroups_text = subgroups_text + testcase.subgroups[i].name + ', '; subgroups_link_text = subgroups_link_text + '<a target="manage_subgroups" href="manage_subgroups.cgi?subgroup_id=' + testcase.subgroups[i].subgroup_id + '">'+ testcase.subgroups[i].name + '</a>, '; } } if (subgroups_text != '') { subgroups_text = subgroups_text.replace(/, $/g,''); subgroups_link_text = subgroups_link_text.replace(/, $/g,''); document.getElementById('subgroups_display').innerHTML = subgroups_text; document.getElementById('subgroups_link_display').innerHTML = subgroups_link_text; } else { document.getElementById('subgroups_display').innerHTML = '<span class="errorHeading">This testcase does not belong to any subgroups that are currently enabled.</span>'; document.getElementById('subgroups_link_display').innerHTML = '<span class="errorHeading">This testcase does not belong to any subgroups that are currently enabled ⇒ <a target="manage_subgroups" href="manage_subgroups.cgi">Jump to Manage Subgroups</a>.</span>'; } var enabled_em = document.getElementById('editform_enabled') if (testcase.enabled == 1) { enabled_em.checked = true; } else { enabled_em.checked = false; } var communityenabled_em = document.getElementById('editform_communityenabled') if (testcase.community_enabled == 1) { communityenabled_em.checked = true; } else { communityenabled_em.checked = false; } if (testcase.regression_bug_id) { document.getElementById('editform_regression_bug_id').value = testcase.regression_bug_id; } setAuthor(testcase.author_id.user_id); document.getElementById('editform_creation_date').innerHTML = testcase.creation_date; document.getElementById('editform_last_updated').innerHTML = testcase.last_updated; document.getElementById('editform_litmus_version').innerHTML = testcase.version; document.getElementById('editform_testrunner_case_id').innerHTML = testcase.testrunner_case_id; document.getElementById('editform_testrunner_case_version').innerHTML = testcase.testrunner_case_version; document.getElementById('editform_div').style.display = 'none'; document.getElementById('testcase_display_div').style.display = 'block'; enableModeButtons(); if (firstPassEdit) { firstPassEdit = 0; switchToEdit(); }} |
|
window.open(uri, "", target.getAttribute("features")); | window.content.open(uri, "", target.getAttribute("features")); | function popupBlockerMenuCommand(target) { var uri = target.getAttribute("uri"); if (uri) { window.open(uri, "", target.getAttribute("features")); }} |
var fp = aFpP.fp; | function poseFilePicker(aFpP){ var titleKey = aFpP.fpTitleKey || "SaveLinkTitle"; var bundle = getStringBundle(); var fp = aFpP.fp; // simply for smaller readable code fp.init(window, bundle.GetStringFromName(titleKey), Components.interfaces.nsIFilePicker.modeSave); var prefs = getPrefsBrowserDownload("browser.download."); const nsILocalFile = Components.interfaces.nsILocalFile; try { fp.displayDirectory = prefs.getComplexValue("dir", nsILocalFile); } catch (e) { } fp.defaultExtension = aFpP.fileInfo.fileExt; fp.defaultString = getNormalizedLeafName(aFpP.fileInfo.fileName, aFpP.fileInfo.fileExt); appendFiltersForContentType(fp, aFpP.contentType, aFpP.fileInfo.fileExt, aFpP.saveMode); if (aFpP.isDocument) { try { fp.filterIndex = prefs.getIntPref("save_converter_index"); } catch (e) { } } if (fp.show() == Components.interfaces.nsIFilePicker.returnCancel || !fp.file) return false; if (aFpP.isDocument) prefs.setIntPref("save_converter_index", fp.filterIndex); // Now that the user has had a chance to change the directory and/or filename, // re-read those values... var directory = fp.file.parent.QueryInterface(nsILocalFile); prefs.setComplexValue("dir", nsILocalFile, directory); fp.file.leafName = validateFileName(fp.file.leafName); return true;} |
|
var prefs = getPrefsBrowserDownload("browser.download."); const nsILocalFile = Components.interfaces.nsILocalFile; | function poseFilePicker(aFpP){ var titleKey = aFpP.fpTitleKey || "SaveLinkTitle"; var bundle = getStringBundle(); var fp = aFpP.fp; // simply for smaller readable code fp.init(window, bundle.GetStringFromName(titleKey), Components.interfaces.nsIFilePicker.modeSave); var prefs = getPrefsBrowserDownload("browser.download."); const nsILocalFile = Components.interfaces.nsILocalFile; try { fp.displayDirectory = prefs.getComplexValue("dir", nsILocalFile); } catch (e) { } fp.defaultExtension = aFpP.fileInfo.fileExt; fp.defaultString = getNormalizedLeafName(aFpP.fileInfo.fileName, aFpP.fileInfo.fileExt); appendFiltersForContentType(fp, aFpP.contentType, aFpP.fileInfo.fileExt, aFpP.saveMode); if (aFpP.isDocument) { try { fp.filterIndex = prefs.getIntPref("save_converter_index"); } catch (e) { } } if (fp.show() == Components.interfaces.nsIFilePicker.returnCancel || !fp.file) return false; if (aFpP.isDocument) prefs.setIntPref("save_converter_index", fp.filterIndex); // Now that the user has had a chance to change the directory and/or filename, // re-read those values... var directory = fp.file.parent.QueryInterface(nsILocalFile); prefs.setComplexValue("dir", nsILocalFile, directory); fp.file.leafName = validateFileName(fp.file.leafName); return true;} |
|
fp.displayDirectory = prefs.getComplexValue("dir", nsILocalFile); } catch (e) { } | if (dir.exists()) fp.displayDirectory = dir; } catch (e) { } | function poseFilePicker(aFpP){ var titleKey = aFpP.fpTitleKey || "SaveLinkTitle"; var bundle = getStringBundle(); var fp = aFpP.fp; // simply for smaller readable code fp.init(window, bundle.GetStringFromName(titleKey), Components.interfaces.nsIFilePicker.modeSave); var prefs = getPrefsBrowserDownload("browser.download."); const nsILocalFile = Components.interfaces.nsILocalFile; try { fp.displayDirectory = prefs.getComplexValue("dir", nsILocalFile); } catch (e) { } fp.defaultExtension = aFpP.fileInfo.fileExt; fp.defaultString = getNormalizedLeafName(aFpP.fileInfo.fileName, aFpP.fileInfo.fileExt); appendFiltersForContentType(fp, aFpP.contentType, aFpP.fileInfo.fileExt, aFpP.saveMode); if (aFpP.isDocument) { try { fp.filterIndex = prefs.getIntPref("save_converter_index"); } catch (e) { } } if (fp.show() == Components.interfaces.nsIFilePicker.returnCancel || !fp.file) return false; if (aFpP.isDocument) prefs.setIntPref("save_converter_index", fp.filterIndex); // Now that the user has had a chance to change the directory and/or filename, // re-read those values... var directory = fp.file.parent.QueryInterface(nsILocalFile); prefs.setComplexValue("dir", nsILocalFile, directory); fp.file.leafName = validateFileName(fp.file.leafName); return true;} |
fp.filterIndex = prefs.getIntPref("save_converter_index"); | fp.filterIndex = branch.getIntPref("save_converter_index"); | function poseFilePicker(aFpP){ var titleKey = aFpP.fpTitleKey || "SaveLinkTitle"; var bundle = getStringBundle(); var fp = aFpP.fp; // simply for smaller readable code fp.init(window, bundle.GetStringFromName(titleKey), Components.interfaces.nsIFilePicker.modeSave); var prefs = getPrefsBrowserDownload("browser.download."); const nsILocalFile = Components.interfaces.nsILocalFile; try { fp.displayDirectory = prefs.getComplexValue("dir", nsILocalFile); } catch (e) { } fp.defaultExtension = aFpP.fileInfo.fileExt; fp.defaultString = getNormalizedLeafName(aFpP.fileInfo.fileName, aFpP.fileInfo.fileExt); appendFiltersForContentType(fp, aFpP.contentType, aFpP.fileInfo.fileExt, aFpP.saveMode); if (aFpP.isDocument) { try { fp.filterIndex = prefs.getIntPref("save_converter_index"); } catch (e) { } } if (fp.show() == Components.interfaces.nsIFilePicker.returnCancel || !fp.file) return false; if (aFpP.isDocument) prefs.setIntPref("save_converter_index", fp.filterIndex); // Now that the user has had a chance to change the directory and/or filename, // re-read those values... var directory = fp.file.parent.QueryInterface(nsILocalFile); prefs.setComplexValue("dir", nsILocalFile, directory); fp.file.leafName = validateFileName(fp.file.leafName); return true;} |
prefs.setIntPref("save_converter_index", fp.filterIndex); | branch.setIntPref("save_converter_index", fp.filterIndex); | function poseFilePicker(aFpP){ var titleKey = aFpP.fpTitleKey || "SaveLinkTitle"; var bundle = getStringBundle(); var fp = aFpP.fp; // simply for smaller readable code fp.init(window, bundle.GetStringFromName(titleKey), Components.interfaces.nsIFilePicker.modeSave); var prefs = getPrefsBrowserDownload("browser.download."); const nsILocalFile = Components.interfaces.nsILocalFile; try { fp.displayDirectory = prefs.getComplexValue("dir", nsILocalFile); } catch (e) { } fp.defaultExtension = aFpP.fileInfo.fileExt; fp.defaultString = getNormalizedLeafName(aFpP.fileInfo.fileName, aFpP.fileInfo.fileExt); appendFiltersForContentType(fp, aFpP.contentType, aFpP.fileInfo.fileExt, aFpP.saveMode); if (aFpP.isDocument) { try { fp.filterIndex = prefs.getIntPref("save_converter_index"); } catch (e) { } } if (fp.show() == Components.interfaces.nsIFilePicker.returnCancel || !fp.file) return false; if (aFpP.isDocument) prefs.setIntPref("save_converter_index", fp.filterIndex); // Now that the user has had a chance to change the directory and/or filename, // re-read those values... var directory = fp.file.parent.QueryInterface(nsILocalFile); prefs.setComplexValue("dir", nsILocalFile, directory); fp.file.leafName = validateFileName(fp.file.leafName); return true;} |
var directory = fp.file.parent.QueryInterface(nsILocalFile); prefs.setComplexValue("dir", nsILocalFile, directory); | if (branch.getBoolPref("lastLocation") || autoDownload) { var directory = fp.file.parent.QueryInterface(nsILocalFile); branch.setComplexValue(kDownloadDirPref, nsILocalFile, directory); } | function poseFilePicker(aFpP){ var titleKey = aFpP.fpTitleKey || "SaveLinkTitle"; var bundle = getStringBundle(); var fp = aFpP.fp; // simply for smaller readable code fp.init(window, bundle.GetStringFromName(titleKey), Components.interfaces.nsIFilePicker.modeSave); var prefs = getPrefsBrowserDownload("browser.download."); const nsILocalFile = Components.interfaces.nsILocalFile; try { fp.displayDirectory = prefs.getComplexValue("dir", nsILocalFile); } catch (e) { } fp.defaultExtension = aFpP.fileInfo.fileExt; fp.defaultString = getNormalizedLeafName(aFpP.fileInfo.fileName, aFpP.fileInfo.fileExt); appendFiltersForContentType(fp, aFpP.contentType, aFpP.fileInfo.fileExt, aFpP.saveMode); if (aFpP.isDocument) { try { fp.filterIndex = prefs.getIntPref("save_converter_index"); } catch (e) { } } if (fp.show() == Components.interfaces.nsIFilePicker.returnCancel || !fp.file) return false; if (aFpP.isDocument) prefs.setIntPref("save_converter_index", fp.filterIndex); // Now that the user has had a chance to change the directory and/or filename, // re-read those values... var directory = fp.file.parent.QueryInterface(nsILocalFile); prefs.setComplexValue("dir", nsILocalFile, directory); fp.file.leafName = validateFileName(fp.file.leafName); return true;} |
aFpP.saveAsType = fp.filterIndex; aFpP.file = fp.file; aFpP.fileURL = fp.fileURL; | function poseFilePicker(aFpP){ var titleKey = aFpP.fpTitleKey || "SaveLinkTitle"; var bundle = getStringBundle(); var fp = aFpP.fp; // simply for smaller readable code fp.init(window, bundle.GetStringFromName(titleKey), Components.interfaces.nsIFilePicker.modeSave); var prefs = getPrefsBrowserDownload("browser.download."); const nsILocalFile = Components.interfaces.nsILocalFile; try { fp.displayDirectory = prefs.getComplexValue("dir", nsILocalFile); } catch (e) { } fp.defaultExtension = aFpP.fileInfo.fileExt; fp.defaultString = getNormalizedLeafName(aFpP.fileInfo.fileName, aFpP.fileInfo.fileExt); appendFiltersForContentType(fp, aFpP.contentType, aFpP.fileInfo.fileExt, aFpP.saveMode); if (aFpP.isDocument) { try { fp.filterIndex = prefs.getIntPref("save_converter_index"); } catch (e) { } } if (fp.show() == Components.interfaces.nsIFilePicker.returnCancel || !fp.file) return false; if (aFpP.isDocument) prefs.setIntPref("save_converter_index", fp.filterIndex); // Now that the user has had a chance to change the directory and/or filename, // re-read those values... var directory = fp.file.parent.QueryInterface(nsILocalFile); prefs.setComplexValue("dir", nsILocalFile, directory); fp.file.leafName = validateFileName(fp.file.leafName); return true;} |
|
if (dir && autoDownload) { | if (autoDownload && dir && dir.exists()) { | function poseFilePicker(aFpP){ const nsILocalFile = Components.interfaces.nsILocalFile; const kDownloadDirPref = "dir"; var branch = getPrefsBrowserDownload("browser.download."); var dir = null; // Try and pull in download directory pref try { dir = branch.getComplexValue(kDownloadDirPref, nsILocalFile); } catch (e) { } var autoDownload = branch.getBoolPref("autoDownload"); if (dir && autoDownload) { dir.append(getNormalizedLeafName(aFpP.fileInfo.fileName, aFpP.fileInfo.fileExt)); aFpP.file = uniqueFile(dir); return true; } // Show the file picker that allows the user to confirm the target filename: var fp = makeFilePicker(); var titleKey = aFpP.fpTitleKey || "SaveLinkTitle"; var bundle = getStringBundle(); fp.init(window, bundle.GetStringFromName(titleKey), Components.interfaces.nsIFilePicker.modeSave); try { if (dir.exists()) fp.displayDirectory = dir; } catch (e) { } fp.defaultExtension = aFpP.fileInfo.fileExt; fp.defaultString = getNormalizedLeafName(aFpP.fileInfo.fileName, aFpP.fileInfo.fileExt); appendFiltersForContentType(fp, aFpP.contentType, aFpP.fileInfo.fileExt, aFpP.saveMode); if (aFpP.isDocument) { try { fp.filterIndex = branch.getIntPref("save_converter_index"); } catch (e) { } } if (fp.show() == Components.interfaces.nsIFilePicker.returnCancel || !fp.file) return false; if (aFpP.isDocument) branch.setIntPref("save_converter_index", fp.filterIndex); // Now that the user has had a chance to change the directory and/or filename, // re-read those values... if (branch.getBoolPref("lastLocation") || autoDownload) { var directory = fp.file.parent.QueryInterface(nsILocalFile); branch.setComplexValue(kDownloadDirPref, nsILocalFile, directory); } fp.file.leafName = validateFileName(fp.file.leafName); aFpP.saveAsType = fp.filterIndex; aFpP.file = fp.file; aFpP.fileURL = fp.fileURL; return true;} |
jQuery.post = function( url, data, callback, type ) { jQuery.ajax( "POST", url, jQuery.param(data), function(r) { if ( callback ) callback( jQuery.httpData(r,type) ); }); }; | post: function( url, data, callback, type ) { jQuery.ajax( "POST", url, jQuery.param(data), function(r) { if ( callback ) callback( jQuery.httpData(r,type) ); }); }, | jQuery.post = function( url, data, callback, type ) { // Build and start the HTTP Request jQuery.ajax( "POST", url, jQuery.param(data), function(r) { if ( callback ) callback( jQuery.httpData(r,type) ); });}; |
jQuery.ajax({ | return jQuery.ajax({ | post: function( url, data, callback, type ) { // Delegate jQuery.ajax({ type: "POST", url: url, data: data, success: callback, dataType: type }); }, |
$.post = function( url, data, ret, type ) { $.xml( "POST", url, $.param(data), function(r) { if ( ret ) { ret( $.httpData(r,type) ); } | $.post = function( url, data, callback, type ) { $.ajax( "POST", url, $.param(data), function(r) { if ( callback ) callback( $.httpData(r,type) ); | $.post = function( url, data, ret, type ) { $.xml( "POST", url, $.param(data), function(r) { if ( ret ) { ret( $.httpData(r,type) ); } });}; |
jQuery.ajax( "POST", url, jQuery.param(data), function(r) { if ( callback ) callback( jQuery.httpData(r,type) ); | jQuery.ajax( "POST", url, jQuery.param(data), function(r, status) { if ( callback ) callback( jQuery.httpData(r,type), status ); | post: function( url, data, callback, type ) { // Build and start the HTTP Request jQuery.ajax( "POST", url, jQuery.param(data), function(r) { if ( callback ) callback( jQuery.httpData(r,type) ); }); }, |
var url = _content.location.href; | var url = getWebNavigation().currentURI.spec; | function postURLToNativeWidget(){ if (urlWidgetService) { // XXX This somehow causes a big leak, back to the old way // till we figure out why. See bug 61886. // var url = getWebNavigation().currentURI.spec; var url = _content.location.href; try { urlWidgetService.SetURLToHiddenControl(url, window); } catch(ex) { } }} |
dump( " SetURLToHiddenControl failed: " + exception + "\n" ); | debug(" SetURLToHiddenControl failed: " + exception + "\n"); | function postURLToNativeWidget() { if ( urlWidgetService ) { var url = window._content.location.href; try { urlWidgetService.SetURLToHiddenControl( url, window ); } catch( exception ) { dump( " SetURLToHiddenControl failed: " + exception + "\n" ); } }} |
var urlWidgetService = Components.classes["@mozilla.org/urlwidget;1"] .getService(Components.interfaces.nsIUrlWidget); var url = _content.location.href; try { urlWidgetService.SetURLToHiddenControl(url, window); } catch(ex) { | if (urlWidgetService) { var url = _content.location.href; try { urlWidgetService.SetURLToHiddenControl(url, window); } catch(ex) { } | function postURLToNativeWidget(){ var urlWidgetService = Components.classes["@mozilla.org/urlwidget;1"] .getService(Components.interfaces.nsIUrlWidget); // XXX This somehow causes a big leak, back to the old way // till we figure out why. See bug 61886. // var url = getWebNavigation().currentURI.spec; var url = _content.location.href; try { urlWidgetService.SetURLToHiddenControl(url, window); } catch(ex) { }} |
this.pref.SavePrefFile(); | function PREF_DoSavePrefs(){ for( var i in window.handle.wsm.PageData ) { for ( var k in window.handle.wsm.PageData[i] ) { window.handle.ParsePref( k, window.handle.wsm.PageData[i][k] ); } }} |
|
return escape(name.replace(/\./g, "-").replace(/:/g, "_").toLowerCase()); | var safeName = name.replace(/\./g, "-").replace(/:/g, "_").toLowerCase(); return ecmaEscape(safeName); | function pref_mungeName(name){ return escape(name.replace(/\./g, "-").replace(/:/g, "_").toLowerCase());} |
window.opener.prefWindow = 0; | function PREF_oncancel(){ window.close();} |
|
this.pref = Components.classes["component: | this.pref = Components.classes["@mozilla.org/preferences;1"].getService(); | function PREF_onload(){ // set ok/cancel handlers doSetOKCancel( this.onok, null ); // create pref object try { this.pref = Components.classes["component://netscape/preferences"].getService(); if(this.pref) this.pref = this.pref.QueryInterface( Components.interfaces.nsIPref ); } catch(e) { dump("*** Failed to create prefs object\n"); return; } // this.wsm.PageData.splice(0); // brutally empty the PageData Array if( window.queuedTag ) this.onpageload( window.queuedTag ); // enable image blocker if "imageblocker.enabled" pref is true try { if (this.pref.GetBoolPref("imageblocker.enabled")) { element = document.getElementById("cookiesCell"); valueWithImages = element.getAttribute("valueWithImages"); element.setAttribute("value",valueWithImages); } } catch(e) { dump("imageblocker.enabled pref is missing from all.js"); }} |
window.opener.prefWindow = 0; | function PREF_onok(){ var url = document.getElementById( window.handle.contentFrame ).getAttribute("src"); var tag = window.handle.wsm.GetTagFromURL( url, window.handle.folder.content, ".xul" ); var extras = ["pref", "preftype", "prefstring", "prefindex"]; window.handle.wsm.SavePageData( tag, extras, false, false ); // save data from the current page. window.handle.DoSavePrefs(); window.close();} |
|
case "color": var r, g, b, color = elementObject.value; if( color.indexOf("#") != -1 ) { color = color.substring( color.indexOf("#"), color.length ); r = "0x" + color.substring( 0, 2 ); g = "0x" + color.substring( 2, 4 ); b = "0x" + color.substring( 4, 6 ); var value = r + "," + g + "," + b; dump("*** COLOR VALUE: " + value + "\n"); } whp.SetColorPref( elementObject.prefstring, r, g, b ); break; | function PREF_ParsePref( elementID, elementObject ){ var whp = window.handle.pref; // shortcut // since we no longer use the convoluted id strings, we now use the id passed // in as an argument to this function to grab the appropriate element in the //dump("*** elementObject.prefString: " + elementObject.prefstring + "; value: " + elementObject.value + "; id: " + elementID + "\n" ); if( elementObject.pref ) { switch( elementObject.preftype ) { case "bool": whp.SetBoolPref( elementObject.prefstring, elementObject.value ); // bool pref break; case "int": if( elementObject.value ) { // only want checked radio items! if( elementObject.nodeName.toLowerCase() == "select" ) { // may need to add extra elements here if they do not have easily // gleanable idxes as radio buttons do. elementObject.prefindex = elementObject.value; } if( !elementObject.prefindex ) { var prefvalue = elementObject.value; } else { var prefvalue = elementObject.prefindex; } whp.SetIntPref( elementObject.prefstring, prefvalue ); // integer pref } break; case "string": dump("*** SetCharPref: " + elementObject.prefstring + "; value: " + elementObject.value + "\n"); //XXX there's some kind of bug here with this such that this throws an UNEXPECTED //XXX exception. look into this later. whp.SetCharPref( elementObject.prefstring, elementObject.value ); // string pref break; case "color": var r, g, b, color = elementObject.value; if( color.indexOf("#") != -1 ) { color = color.substring( color.indexOf("#"), color.length ); r = "0x" + color.substring( 0, 2 ); g = "0x" + color.substring( 2, 4 ); b = "0x" + color.substring( 4, 6 ); var value = r + "," + g + "," + b; dump("*** COLOR VALUE: " + value + "\n"); } whp.SetColorPref( elementObject.prefstring, r, g, b ); break; default: // TODO: insert implementation for other pref types; break; } }} |
|
dump("*** going to set a " + typeof( elementObject.prefindex ) + " pref: " + elementObject.prefindex + "\n"); var tempPref = elementObject.prefindex; whp.SetBoolPref( elementObject.prefstring, tempPref ); dump("*** just set a " + typeof( tempPref ) + " pref: " + tempPref + "\n"); | try { var oldPref = whp.GetBoolPref( elementObject.prefstring ) } catch(e) { var oldPref = false; } if( oldPref != elementObject.prefindex ); whp.SetBoolPref( elementObject.prefstring, elementObject.prefindex ); | function PREF_ParsePref( elementID, elementObject ){ var whp = window.handle.pref; // shortcut // since we no longer use the convoluted id strings, we now use the id passed // in as an argument to this function to grab the appropriate element in the if( elementObject.pref ) { switch( elementObject.preftype ) { case "bool": if( elementObject.prefindex === "true" || elementObject.prefindex === "false" ) { // bool prefs with a prefindex, e.g. boolean radios. the value we set // is actually the prefindex, not the checked value. if( elementObject.value == true ) { if( typeof( elementObject.prefindex ) == "string" ) { if( elementObject.prefindex == "true" ) elementObject.prefindex = true; else elementObject.prefindex = false; } dump("*** going to set a " + typeof( elementObject.prefindex ) + " pref: " + elementObject.prefindex + "\n"); var tempPref = elementObject.prefindex; whp.SetBoolPref( elementObject.prefstring, tempPref ); // bool pref dump("*** just set a " + typeof( tempPref ) + " pref: " + tempPref + "\n"); break; } } whp.SetBoolPref( elementObject.prefstring, elementObject.value ); // bool pref break; case "int": if( elementObject.value ) { // only want checked radio items! if( !elementObject.prefindex ) { // element object does not have a prefindex (e.g. select widgets) var prefvalue = elementObject.value; } else { // element object has prefindex attribute (e.g. radio buttons) var prefvalue = elementObject.prefindex; } whp.SetIntPref( elementObject.prefstring, prefvalue ); // integer pref } break; case "string": whp.SetCharPref( elementObject.prefstring, elementObject.value ); // string pref break; default: // TODO: insert implementation for other pref types; break; } }} |
whp.SetBoolPref( elementObject.prefstring, elementObject.value ); | try { var oldPref = whp.GetBoolPref( elementObject.prefstring ) } catch(e) { var oldPref = false; } if( oldPref != elementObject.prefindex ); whp.SetBoolPref( elementObject.prefstring, elementObject.value ); | function PREF_ParsePref( elementID, elementObject ){ var whp = window.handle.pref; // shortcut // since we no longer use the convoluted id strings, we now use the id passed // in as an argument to this function to grab the appropriate element in the if( elementObject.pref ) { switch( elementObject.preftype ) { case "bool": if( elementObject.prefindex === "true" || elementObject.prefindex === "false" ) { // bool prefs with a prefindex, e.g. boolean radios. the value we set // is actually the prefindex, not the checked value. if( elementObject.value == true ) { if( typeof( elementObject.prefindex ) == "string" ) { if( elementObject.prefindex == "true" ) elementObject.prefindex = true; else elementObject.prefindex = false; } dump("*** going to set a " + typeof( elementObject.prefindex ) + " pref: " + elementObject.prefindex + "\n"); var tempPref = elementObject.prefindex; whp.SetBoolPref( elementObject.prefstring, tempPref ); // bool pref dump("*** just set a " + typeof( tempPref ) + " pref: " + tempPref + "\n"); break; } } whp.SetBoolPref( elementObject.prefstring, elementObject.value ); // bool pref break; case "int": if( elementObject.value ) { // only want checked radio items! if( !elementObject.prefindex ) { // element object does not have a prefindex (e.g. select widgets) var prefvalue = elementObject.value; } else { // element object has prefindex attribute (e.g. radio buttons) var prefvalue = elementObject.prefindex; } whp.SetIntPref( elementObject.prefstring, prefvalue ); // integer pref } break; case "string": whp.SetCharPref( elementObject.prefstring, elementObject.value ); // string pref break; default: // TODO: insert implementation for other pref types; break; } }} |
if( elementObject.value ) { if( !elementObject.prefindex ) { var prefvalue = elementObject.value; } else { var prefvalue = elementObject.prefindex; } | dump("*** elementObject.elType = " + elementObject.elType + "\n"); if( elementObject.elType.toLowerCase() == "radio" && !elementObject.value ) return false; if( !elementObject.prefindex ) { var prefvalue = elementObject.value; } else { var prefvalue = elementObject.prefindex; } try { var oldPref = whp.GetIntPref( elementObject.prefstring ); } catch(e) { var oldPref = 0; } dump("*** going to set int pref: " + elementObject.prefstring + " = " + prefvalue + "\n"); if( oldPref != prefvalue ) | function PREF_ParsePref( elementID, elementObject ){ var whp = window.handle.pref; // shortcut // since we no longer use the convoluted id strings, we now use the id passed // in as an argument to this function to grab the appropriate element in the if( elementObject.pref ) { switch( elementObject.preftype ) { case "bool": if( elementObject.prefindex === "true" || elementObject.prefindex === "false" ) { // bool prefs with a prefindex, e.g. boolean radios. the value we set // is actually the prefindex, not the checked value. if( elementObject.value == true ) { if( typeof( elementObject.prefindex ) == "string" ) { if( elementObject.prefindex == "true" ) elementObject.prefindex = true; else elementObject.prefindex = false; } dump("*** going to set a " + typeof( elementObject.prefindex ) + " pref: " + elementObject.prefindex + "\n"); var tempPref = elementObject.prefindex; whp.SetBoolPref( elementObject.prefstring, tempPref ); // bool pref dump("*** just set a " + typeof( tempPref ) + " pref: " + tempPref + "\n"); break; } } whp.SetBoolPref( elementObject.prefstring, elementObject.value ); // bool pref break; case "int": if( elementObject.value ) { // only want checked radio items! if( !elementObject.prefindex ) { // element object does not have a prefindex (e.g. select widgets) var prefvalue = elementObject.value; } else { // element object has prefindex attribute (e.g. radio buttons) var prefvalue = elementObject.prefindex; } whp.SetIntPref( elementObject.prefstring, prefvalue ); // integer pref } break; case "string": whp.SetCharPref( elementObject.prefstring, elementObject.value ); // string pref break; default: // TODO: insert implementation for other pref types; break; } }} |
break; case "string": whp.SetCharPref( elementObject.prefstring, elementObject.value ); | catch(e) { var charPref = ""; } if( elementObject.preftype == "color" && charPref == "" ) { dump("*** empty string color pref was going to be set, but we're avoiding this just in the nick of time...\n"); break; } if( charPref != elementObject.value ) whp.SetCharPref( elementObject.prefstring, elementObject.value ); | function PREF_ParsePref( elementID, elementObject ){ var whp = window.handle.pref; // shortcut // since we no longer use the convoluted id strings, we now use the id passed // in as an argument to this function to grab the appropriate element in the if( elementObject.pref ) { switch( elementObject.preftype ) { case "bool": if( elementObject.prefindex === "true" || elementObject.prefindex === "false" ) { // bool prefs with a prefindex, e.g. boolean radios. the value we set // is actually the prefindex, not the checked value. if( elementObject.value == true ) { if( typeof( elementObject.prefindex ) == "string" ) { if( elementObject.prefindex == "true" ) elementObject.prefindex = true; else elementObject.prefindex = false; } dump("*** going to set a " + typeof( elementObject.prefindex ) + " pref: " + elementObject.prefindex + "\n"); var tempPref = elementObject.prefindex; whp.SetBoolPref( elementObject.prefstring, tempPref ); // bool pref dump("*** just set a " + typeof( tempPref ) + " pref: " + tempPref + "\n"); break; } } whp.SetBoolPref( elementObject.prefstring, elementObject.value ); // bool pref break; case "int": if( elementObject.value ) { // only want checked radio items! if( !elementObject.prefindex ) { // element object does not have a prefindex (e.g. select widgets) var prefvalue = elementObject.value; } else { // element object has prefindex attribute (e.g. radio buttons) var prefvalue = elementObject.prefindex; } whp.SetIntPref( elementObject.prefstring, prefvalue ); // integer pref } break; case "string": whp.SetCharPref( elementObject.prefstring, elementObject.value ); // string pref break; default: // TODO: insert implementation for other pref types; break; } }} |
dump("prefCacheSelectFolder \n"); | function prefCacheSelectFolder(){ dump("prefCacheSelectFolder \n"); bundle = srGetStrBundle("chrome://pref/locale/prefutilities.properties"); var folderField = document.getElementById("browserCacheDirectory"); var url = getFileOrFolderURL( bundle.GetStringFromName("cachefolder"), true ); if( url != -1 ) folderField.value = url;} |
|
var url = getFileOrFolderURL( bundle.GetStringFromName("cachefolder"), true ); | var url = getFileOrFolderSpec( bundle.GetStringFromName("cachefolder"), true ); | function prefCacheSelectFolder(){ dump("prefCacheSelectFolder \n"); bundle = srGetStrBundle("chrome://pref/locale/prefutilities.properties"); var folderField = document.getElementById("browserCacheDirectory"); var url = getFileOrFolderURL( bundle.GetStringFromName("cachefolder"), true ); if( url != -1 ) folderField.value = url;} |
folderField.value = url; | folderField.value = url.URLString; | function prefCacheSelectFolder(){ dump("prefCacheSelectFolder \n"); bundle = srGetStrBundle("chrome://pref/locale/prefutilities.properties"); var folderField = document.getElementById("browserCacheDirectory"); var url = getFileOrFolderURL( bundle.GetStringFromName("cachefolder"), true ); if( url != -1 ) folderField.value = url;} |
var fp = Components.classes["component: | var fp = Components.classes["@mozilla.org/filepicker;1"].createInstance(nsIFilePicker); | function PrefCacheSelectFolder() { // Get filespecwithui component. try { var fp = Components.classes["component://mozilla/filepicker"].createInstance(nsIFilePicker); /* XXX no title here */ fp.init(window, "", nsIFilePicker.modeGetFolder); fp.appendFilters(nsIFilePicker.filterAll); fp.show(); var field = document.getElementById("pref:string:browser.cache.directory"); field.setAttribute("value", fp.file.unicodePath); } catch(ex) { }} |
var initialDir = prefWindow.getPref("localfile", kCacheParentDirPref); if (initialDir != "!/!ERROR_UNDEFINED_PREF!/!") fp.displayDirectory = initialDir; | fp.displayDirectory = dir; | function prefCacheSelectFolder(){ var fp = Components.classes["@mozilla.org/filepicker;1"] .createInstance(nsIFilePicker); var prefWindow = parent.hPrefWindow; var prefutilitiesBundle = document.getElementById("bundle_prefutilities"); var title = prefutilitiesBundle.getString("cachefolder"); fp.init(window, title, nsIFilePicker.modeGetFolder); var initialDir = prefWindow.getPref("localfile", kCacheParentDirPref); // Pref should always be set but just in case... if (initialDir != "!/!ERROR_UNDEFINED_PREF!/!") fp.displayDirectory = initialDir; fp.appendFilters(nsIFilePicker.filterAll); var ret = fp.show(); if (ret == nsIFilePicker.returnOK) { var localFile = fp.file.QueryInterface(nsILocalFile); prefWindow.setPref("localfile", kCacheParentDirPref, localFile); gFolderField.value = (/Mac/.test(navigator.platform)) ? fp.file.leafName : fp.file.path; }} |
fp.setFilters(nsIFilePicker.filterAll); | fp.appendFilters(nsIFilePicker.filterAll); | function PrefCacheSelectFolder() { // Get filespecwithui component. try { var fp = Components.classes["component://mozilla/filepicker"].createInstance(nsIFilePicker); /* XXX no title here */ fp.init(window, "", nsIFilePicker.modeGetFolder); fp.setFilters(nsIFilePicker.filterAll); fp.show(); var field = document.getElementById("pref:string:browser.cache.directory"); field.setAttribute("value", fp.file.unicodePath); } catch(ex) { }} |
delete this.prefManager.onPrefChanged; | this.prefManager.onPrefChanged = function(){}; | function PrefChannel(parent, name, force, show){ if (name in parent.channels) return parent.channels[name]; this.parent = parent; this.unicodeName = name; this.viewName = name; this.canonicalName = name; this.encodedName = name; this.prettyName = getMsg(MSG_PREFS_FMT_DISPLAY_CHANNEL, [this.parent.parent.unicodeName, this.unicodeName]); this.prefManager = getChannelPrefManager(this); this.prefs = this.prefManager.prefs; delete this.prefManager.onPrefChanged; if (force) this.prefs["hasPrefs"] = true; if (this.prefs["hasPrefs"] || show) this.parent.channels[this.canonicalName] = this; return this;}; |
cacheService.Clear( 12 ); | cacheService.clear( 12 ); | function prefClearDiskCache(){ dump("prefClearDiskCache \n"); var cache = Components.classes['component://netscape/network/cache?name=manager'].getService(); var cacheService = cache.QueryInterface( Components.interfaces.nsINetDataCacheManager); cacheService.Clear( 12 );} |
var cache = Components.classes['component: | var cache = Components.classes['@mozilla.org/network/cache;1?name=manager'].getService(); | function prefClearDiskCache(){ dump("prefClearDiskCache \n"); var cache = Components.classes['component://netscape/network/cache?name=manager'].getService(); var cacheService = cache.QueryInterface( Components.interfaces.nsINetDataCacheManager); cacheService.clear( 12 );} |
cacheService.Clear( 2 ); | cacheService.clear( 2 ); | function prefClearMemCache(){ dump("prefClearMemCache \n"); var cache = Components.classes['component://netscape/network/cache?name=manager'].getService(); var cacheService = cache.QueryInterface( Components.interfaces.nsINetDataCacheManager); cacheService.Clear( 2 );} |
var cache = Components.classes['component: | var cache = Components.classes['@mozilla.org/network/cache;1?name=manager'].getService(); | function prefClearMemCache(){ dump("prefClearMemCache \n"); var cache = Components.classes['component://netscape/network/cache?name=manager'].getService(); var cacheService = cache.QueryInterface( Components.interfaces.nsINetDataCacheManager); cacheService.clear( 2 );} |
var urlBarHist = nsJSComponentManager.getService("component: | var urlBarHist = nsJSComponentManager.getService("@mozilla.org/browser/urlbarhistory;1", | function prefClearUrlbarHistory(){ var button = document.getElementById("ClearUrlBarHistoryButton"); var urlBarHist = nsJSComponentManager.getService("component://netscape/browser/urlbarhistory", "nsIUrlbarHistory"); if ( urlBarHist ) { urlBarHist.clearHistory(); dump("Now history should be empty. \n"); button.setAttribute("disabled","true"); }} |
return stringSortFunction(x.prefCol, y.prefCol); | if (x.prefCol > y.prefCol) return gSortDirection; if (x.prefCol < y.prefCol) return -gSortDirection; return 0; | function prefColSortFunction(x,y){ return stringSortFunction(x.prefCol, y.prefCol);} |
var type = this.prefBranch.getPrefType (prefName); try { switch (type) | if (typeof realValue == "undefined") { var type = this.prefBranch.getPrefType (prefName); try | function prefGetter () { var type = this.prefBranch.getPrefType (prefName); try { switch (type) { case nsIPrefBranch.PREF_STRING: return this.prefBranch.getCharPref (prefName); case nsIPrefBranch.PREF_INT: return this.prefBranch.getIntPref (prefName); case nsIPrefBranch.PREF_BOOL: return this.prefBranch.getBoolPref (prefName); default: return defaultValue; } return null; } catch (ex) { dd ("caught exception reading pref ``" + prefName + "'' " + type + "\n" + ex); return defaultValue; } } |
case nsIPrefBranch.PREF_STRING: return this.prefBranch.getCharPref (prefName); case nsIPrefBranch.PREF_INT: return this.prefBranch.getIntPref (prefName); case nsIPrefBranch.PREF_BOOL: return this.prefBranch.getBoolPref (prefName); default: return defaultValue; | switch (type) { case nsIPrefBranch.PREF_STRING: realValue = this.prefBranch.getCharPref (prefName); break; case nsIPrefBranch.PREF_INT: realValue = this.prefBranch.getIntPref (prefName); break; case nsIPrefBranch.PREF_BOOL: realValue = this.prefBranch.getBoolPref (prefName); break; default: realValue = defaultValue; } | function prefGetter () { var type = this.prefBranch.getPrefType (prefName); try { switch (type) { case nsIPrefBranch.PREF_STRING: return this.prefBranch.getCharPref (prefName); case nsIPrefBranch.PREF_INT: return this.prefBranch.getIntPref (prefName); case nsIPrefBranch.PREF_BOOL: return this.prefBranch.getBoolPref (prefName); default: return defaultValue; } return null; } catch (ex) { dd ("caught exception reading pref ``" + prefName + "'' " + type + "\n" + ex); return defaultValue; } } |
return null; | catch (ex) { dd ("caught exception reading pref ``" + prefName + "'' " + type + "\n" + ex); realValue = defaultValue; } | function prefGetter () { var type = this.prefBranch.getPrefType (prefName); try { switch (type) { case nsIPrefBranch.PREF_STRING: return this.prefBranch.getCharPref (prefName); case nsIPrefBranch.PREF_INT: return this.prefBranch.getIntPref (prefName); case nsIPrefBranch.PREF_BOOL: return this.prefBranch.getBoolPref (prefName); default: return defaultValue; } return null; } catch (ex) { dd ("caught exception reading pref ``" + prefName + "'' " + type + "\n" + ex); return defaultValue; } } |
catch (ex) { dd ("caught exception reading pref ``" + prefName + "'' " + type + "\n" + ex); return defaultValue; } | return realValue; | function prefGetter () { var type = this.prefBranch.getPrefType (prefName); try { switch (type) { case nsIPrefBranch.PREF_STRING: return this.prefBranch.getCharPref (prefName); case nsIPrefBranch.PREF_INT: return this.prefBranch.getIntPref (prefName); case nsIPrefBranch.PREF_BOOL: return this.prefBranch.getBoolPref (prefName); default: return defaultValue; } return null; } catch (ex) { dd ("caught exception reading pref ``" + prefName + "'' " + type + "\n" + ex); return defaultValue; } } |
switch (type) | try { switch (type) { case nsIPrefBranch.PREF_STRING: return this.prefBranch.getCharPref (prefName); case nsIPrefBranch.PREF_INT: return this.prefBranch.getIntPref (prefName); case nsIPrefBranch.PREF_BOOL: return this.prefBranch.getBoolPref (prefName); default: return defaultValue; } return null; } catch (ex) | function prefGetter () { var type = this.prefBranch.getPrefType (prefName); switch (type) { case nsIPrefBranch.PREF_STRING: return this.prefBranch.getCharPref (prefName); case nsIPrefBranch.PREF_INT: return this.prefBranch.getIntPref (prefName); case nsIPrefBranch.PREF_BOOL: return this.prefBranch.getCharPref (prefName); default: return defaultValue; } return null; } |
case nsIPrefBranch.PREF_STRING: return this.prefBranch.getCharPref (prefName); case nsIPrefBranch.PREF_INT: return this.prefBranch.getIntPref (prefName); case nsIPrefBranch.PREF_BOOL: return this.prefBranch.getCharPref (prefName); default: return defaultValue; | dd ("caught exception reading pref ``" + prefName + "'' " + type + "\n" + ex); return defaultValue; | function prefGetter () { var type = this.prefBranch.getPrefType (prefName); switch (type) { case nsIPrefBranch.PREF_STRING: return this.prefBranch.getCharPref (prefName); case nsIPrefBranch.PREF_INT: return this.prefBranch.getIntPref (prefName); case nsIPrefBranch.PREF_BOOL: return this.prefBranch.getCharPref (prefName); default: return defaultValue; } return null; } |
return null; | function prefGetter () { var type = this.prefBranch.getPrefType (prefName); switch (type) { case nsIPrefBranch.PREF_STRING: return this.prefBranch.getCharPref (prefName); case nsIPrefBranch.PREF_INT: return this.prefBranch.getIntPref (prefName); case nsIPrefBranch.PREF_BOOL: return this.prefBranch.getCharPref (prefName); default: return defaultValue; } return null; } |
|
var commonDialogService = Components.classes["@mozilla.org/appshell/commonDialogs;1"].getService(); commonDialogService = commonDialogService.QueryInterface(Components.interfaces.nsICommonDialogs); | var promptService = Components.classes["@mozilla.org/embedcomp/prompt-service;1"].getService(); promptService = promptService.QueryInterface(Components.interfaces.nsIPromptService); | function prefillTextBox(target) { // obtain values to be used for prefilling var walletService = Components.classes["@mozilla.org/wallet/wallet-service;1"].getService(Components.interfaces.nsIWalletService); var value = walletService.WALLET_PrefillOneElement(window._content, target); if (value) { // result is a linear sequence of values, each preceded by a separator character // convert linear sequence of values into an array of values var separator = value[0]; var valueList = value.substring(1, value.length).split(separator); target.value = valueList[0];/* * Following code is a replacement for above line. In the case of multiple values, it * presents the user with a dialog containing a list from which he can select the value * he wants. However it is being commented out for now because of several problems, namely * * 1. There is no easy way to put localizable strings for the title and message of * the dialog without introducing a .properties file which currently doesn't exist * 2. Using blank title and messages as shown below have a problem because a zero-length * title is being displayed as some garbage characters (which is why the code below * has a title of " " instead of ""). This is a separate bug which will have to be * investigated further. * 3. The current wallet tables present alternate values for items such as shipping * address -- namely billing address and home address. Up until now, these alternate * values have never been a problem because the preferred value is always first and is * all the user sees when doing a prefill. However now he will be presented with a * list showing all these values and asking him to pick one, even though the wallet * code was clearly able to determine that he meant shipping address and not billing * address. * 4. There is a relatively long delay before the dialog come up whereas values are * filled in quickly when no dialog is involved. * * Once this feature is checked in, a separate bug will be opened asking that the above * problems be examined and this dialog turned on if (valueList.length == 1) { // only one value, use it for prefilling target.value = valueList[0]; } else { // more than one value, have user select the one he wants var commonDialogService = Components.classes["@mozilla.org/appshell/commonDialogs;1"].getService(); commonDialogService = commonDialogService.QueryInterface(Components.interfaces.nsICommonDialogs); var position = {}; var title = " "; var message = ""; var ok = commonDialogService.Select (window, title, message, valueList.length, valueList, position) if (ok) { target.value = valueList[position.value]; } } * End of commented out code */ } } |
commonDialogService.Select | promptService.Select | function prefillTextBox(target) { // obtain values to be used for prefilling var walletService = Components.classes["@mozilla.org/wallet/wallet-service;1"].getService(Components.interfaces.nsIWalletService); var value = walletService.WALLET_PrefillOneElement(window._content, target); if (value) { // result is a linear sequence of values, each preceded by a separator character // convert linear sequence of values into an array of values var separator = value[0]; var valueList = value.substring(1, value.length).split(separator); target.value = valueList[0];/* * Following code is a replacement for above line. In the case of multiple values, it * presents the user with a dialog containing a list from which he can select the value * he wants. However it is being commented out for now because of several problems, namely * * 1. There is no easy way to put localizable strings for the title and message of * the dialog without introducing a .properties file which currently doesn't exist * 2. Using blank title and messages as shown below have a problem because a zero-length * title is being displayed as some garbage characters (which is why the code below * has a title of " " instead of ""). This is a separate bug which will have to be * investigated further. * 3. The current wallet tables present alternate values for items such as shipping * address -- namely billing address and home address. Up until now, these alternate * values have never been a problem because the preferred value is always first and is * all the user sees when doing a prefill. However now he will be presented with a * list showing all these values and asking him to pick one, even though the wallet * code was clearly able to determine that he meant shipping address and not billing * address. * 4. There is a relatively long delay before the dialog come up whereas values are * filled in quickly when no dialog is involved. * * Once this feature is checked in, a separate bug will be opened asking that the above * problems be examined and this dialog turned on if (valueList.length == 1) { // only one value, use it for prefilling target.value = valueList[0]; } else { // more than one value, have user select the one he wants var commonDialogService = Components.classes["@mozilla.org/appshell/commonDialogs;1"].getService(); commonDialogService = commonDialogService.QueryInterface(Components.interfaces.nsICommonDialogs); var position = {}; var title = " "; var message = ""; var ok = commonDialogService.Select (window, title, message, valueList.length, valueList, position) if (ok) { target.value = valueList[position.value]; } } * End of commented out code */ } } |
var tempFileSpec = Components.classes["component: | var tempFileSpec = Components.classes["@mozilla.org/filespec;1"].createInstance(Components.interfaces.nsIFileSpec); | function prefNavSelectFile(folderFieldId, stringId, useNative){ var folderField = document.getElementById(folderFieldId); var dlgString = stringId ? bundle.GetStringFromName(stringId) : ''; var file = getFileOrFolderSpec( dlgString, false ); if( file != -1 ) { /* XXX nsILocalFile doesn't have a URL string */ if (useNative) { folderField.value = file.unicodePath; } else { // Hack to get a file: url from an nsIFile var tempFileSpec = Components.classes["component://netscape/filespec"].createInstance(Components.interfaces.nsIFileSpec); tempFileSpec.nativePath = file.unicodePath; try { var url = tempFileSpec.URLString; if( url ) folderField.value = url; } catch(e) { } } }} |
var fp = Components.classes["component: | var fp = Components.classes["@mozilla.org/filepicker;1"].createInstance(nsIFilePicker); | function PrefNavSelectFile(prefID) { try { var fp = Components.classes["component://mozilla/filepicker"].createInstance(nsIFilePicker); /* XXX no title here */ fp.init(window, "", nsIFilePicker.modeOpen); fp.appendFilters(nsIFilePicker.filterAll); fp.show(); var field = document.getElementById(prefID); field.setAttribute("value", fp.file.unicodePath); } catch(ex) { }} |
bundle = srGetStrBundle("chrome: | function prefNavSelectFile(){ bundle = srGetStrBundle("chrome://pref/locale/prefutilities.properties"); var folderField = document.getElementById("browserStartupHomepage"); var url = getFileOrFolderURL( bundle.GetStringFromName("choosehomepage"), false ); if( url != -1 ) folderField.value = url;} |
|
fp.setFilters(nsIFilePicker.filterAll); | fp.appendFilters(nsIFilePicker.filterAll); | function PrefNavSelectFile(prefID) { try { var fp = Components.classes["component://mozilla/filepicker"].createInstance(nsIFilePicker); /* XXX no title here */ fp.init(window, "", nsIFilePicker.modeOpen); fp.setFilters(nsIFilePicker.filterAll); fp.show(); var field = document.getElementById(prefID); field.setAttribute("value", fp.file.unicodePath); } catch(ex) { }} |
delete this.prefManager.onPrefChanged; | this.prefManager.onPrefChanged = function(){}; | function PrefNetwork(parent, name, force, show){ if (name in parent.networks) return parent.networks[name]; this.parent = parent; this.unicodeName = name; this.viewName = name; this.canonicalName = name; this.encodedName = name; this.prettyName = getMsg(MSG_PREFS_FMT_DISPLAY_NETWORK, this.unicodeName); this.servers = new Object(); this.primServ = new PrefServer(this, "dummy server"); this.channels = this.primServ.channels; this.users = this.primServ.users; this.prefManager = getNetworkPrefManager(this); this.prefs = this.prefManager.prefs; delete this.prefManager.onPrefChanged; if (force) this.prefs["hasPrefs"] = true; if (this.prefs["hasPrefs"] || show) this.parent.networks[this.canonicalName] = this; return this;}; |
} else { prefSETValue=elRef.value; | function PrefOkay() { for(var strCurKey in gPrefQueue) { var elRef=gPrefQueue[strCurKey]; var prefName=elRef.getAttribute("preference"); var transValidator=elRef.getAttribute("onsynctopreference"); var prefSETValue=null; if(transValidator!="") { prefSETValue=eval(transValidator); } if (gPref.getPrefType(prefName) == gPref.PREF_STRING){ gPref.setCharPref(prefName, prefSETValue); } if (gPref.getPrefType(prefName) == gPref.PREF_INT) { gPref.setIntPref(prefName, prefSETValue); } if (gPref.getPrefType(prefName) == gPref.PREF_BOOL) { gPref.setBoolPref(prefName, prefSETValue); } }} |
|
realValue = value; | function prefSetter (value) { try { switch (typeof value) { case "int": this.prefBranch.setIntPref (prefName, value); break; case "boolean": this.prefBranch.setBoolPref (prefName, value); break; default: this.prefBranch.setCharPref (prefName, value); break; } this.prefService.savePrefFile(null); } catch (ex) { dd ("caught exception writing pref ``" + prefName + "''\n" + ex); } return value; } |
|
switch (typeof value) | try { switch (typeof value) { case "int": this.prefBranch.setIntPref (prefName, value); break; case "boolean": this.prefBranch.setBoolPref (prefName, value); break; default: this.prefBranch.setCharPref (prefName, value); break; } this.prefService.savePrefFile(null); } catch (ex) | function prefSetter (value) { switch (typeof value) { case "int": this.prefBranch.setIntPref (prefName, value); break; case "boolean": this.prefBranch.setBoolPref (prefName, value); break; default: this.prefBranch.setCharPref (prefName, value); break; } this.prefService.savePrefFile(null); return value; } |
case "int": this.prefBranch.setIntPref (prefName, value); break; case "boolean": this.prefBranch.setBoolPref (prefName, value); break; default: this.prefBranch.setCharPref (prefName, value); break; | dd ("caught exception writing pref ``" + prefName + "''\n" + ex); | function prefSetter (value) { switch (typeof value) { case "int": this.prefBranch.setIntPref (prefName, value); break; case "boolean": this.prefBranch.setBoolPref (prefName, value); break; default: this.prefBranch.setCharPref (prefName, value); break; } this.prefService.savePrefFile(null); return value; } |
this.prefService.savePrefFile(null); | function prefSetter (value) { switch (typeof value) { case "int": this.prefBranch.setIntPref (prefName, value); break; case "boolean": this.prefBranch.setBoolPref (prefName, value); break; default: this.prefBranch.setCharPref (prefName, value); break; } this.prefService.savePrefFile(null); return value; } |
|
delete this.prefManager.onPrefChanged; | this.prefManager.onPrefChanged = function(){}; | function PrefUser(parent, name, force, show){ if (name in parent.users) return parent.users[name]; this.parent = parent; this.unicodeName = name; this.viewName = name; this.canonicalName = name; this.encodedName = name; this.prettyName = getMsg(MSG_PREFS_FMT_DISPLAY_USER, [this.parent.parent.unicodeName, this.unicodeName]); this.prefManager = getUserPrefManager(this); this.prefs = this.prefManager.prefs; delete this.prefManager.onPrefChanged; if (force) this.prefs["hasPrefs"] = true; if (this.prefs["hasPrefs"] || show) this.parent.users[this.canonicalName] = this; return this;}; |
var ccalendar = getDisplayComposite(); | var ccalendar = getCompositeCalendar(); | function prepareCalendarToDoUnifinder(){ var ccalendar = getDisplayComposite(); ccalendar.addObserver(unifinderToDoDataSourceObserver); toDoUnifinderRefresh();} |
var ccalendar = getDisplayComposite(); | var ccalendar = getCompositeCalendar(); | function prepareCalendarUnifinder( ){ // tell the unifinder to get ready var unifinderEventSelectionObserver = { onSelectionChanged : function( EventSelectionArray ) { selectSelectedEventsInTree( EventSelectionArray ); } } gCalendarWindow.EventSelection.addObserver( unifinderEventSelectionObserver ); // set up our calendar event observer var ccalendar = getDisplayComposite(); ccalendar.addObserver(unifinderObserver); kDefaultTimezone = calendarDefaultTimezone(); // Listen for changes in the selected day, so we can update if need be var viewDeck = document.getElementById("view-deck") viewDeck.addEventListener("dayselect", unifinderOnDaySelect, false); refreshEventTree(); //Display something upon first load. onLoad doesn't work properly for observers} |
window.browserContentListener = new nsBrowserContentListener(window, gBrowser); | function prepareForStartup(){ gURLBar = document.getElementById("urlbar"); gNavigatorBundle = document.getElementById("bundle_browser"); gProgressMeterPanel = document.getElementById("statusbar-progresspanel"); gBrowser.addEventListener("DOMUpdatePageReport", gPopupBlockerObserver.onUpdatePageReport, false); // Note: we need to listen to untrusted events, because the pluginfinder XBL // binding can't fire trusted ones (runs with page privileges). gBrowser.addEventListener("PluginNotFound", gMissingPluginInstaller.newMissingPlugin, false, true); gBrowser.addEventListener("NewTab", BrowserOpenTab, false); var webNavigation; try { // Create the browser instance component. appCore = Components.classes["@mozilla.org/appshell/component/browser/instance;1"] .createInstance(Components.interfaces.nsIBrowserInstance); if (!appCore) throw "couldn't create a browser instance"; webNavigation = getWebNavigation(); if (!webNavigation) throw "no XBL binding for browser"; } catch (e) { alert("Error launching browser window:" + e); window.close(); // Give up. return; } // initialize observers and listeners // and give C++ access to gBrowser window.XULBrowserWindow = new nsBrowserStatusHandler(); window.QueryInterface(nsCI.nsIInterfaceRequestor) .getInterface(nsIWebNavigation) .QueryInterface(nsCI.nsIDocShellTreeItem).treeOwner .QueryInterface(nsCI.nsIInterfaceRequestor) .getInterface(nsCI.nsIXULWindow) .XULBrowserWindow = window.XULBrowserWindow; window.QueryInterface(nsCI.nsIDOMChromeWindow).browserDOMWindow = new nsBrowserAccess(); window.browserContentListener = new nsBrowserContentListener(window, gBrowser); // set default character set if provided if ("arguments" in window && window.arguments.length > 1 && window.arguments[1]) { if (window.arguments[1].indexOf("charset=") != -1) { var arrayArgComponents = window.arguments[1].split("="); if (arrayArgComponents) { //we should "inherit" the charset menu setting in a new window getMarkupDocumentViewer().defaultCharacterSet = arrayArgComponents[1]; } } } // Initialize browser instance.. appCore.setWebShellWindow(window); // Manually hook up session and global history for the first browser // so that we don't have to load global history before bringing up a // window. // Wire up session and global history before any possible // progress notifications for back/forward button updating webNavigation.sessionHistory = Components.classes["@mozilla.org/browser/shistory;1"] .createInstance(Components.interfaces.nsISHistory); var os = Components.classes["@mozilla.org/observer-service;1"].getService(Components.interfaces.nsIObserverService); os.addObserver(gBrowser.browsers[0], "browser:purge-session-history", false); // remove the disablehistory attribute so the browser cleans up, as // though it had done this work itself gBrowser.browsers[0].removeAttribute("disablehistory"); // enable global history gBrowser.docShell.QueryInterface(Components.interfaces.nsIDocShellHistory).useGlobalHistory = true; // hook up UI through progress listener gBrowser.addProgressListener(window.XULBrowserWindow, Components.interfaces.nsIWebProgress.NOTIFY_ALL); // Initialize the feedhandler FeedHandler.init();} |
|
gBrowser.addEventListener("NewTab", BrowserOpenTab, false); | function prepareForStartup(){ gURLBar = document.getElementById("urlbar"); gNavigatorBundle = document.getElementById("bundle_browser"); gProgressMeterPanel = document.getElementById("statusbar-progresspanel"); gBrowser.addEventListener("DOMUpdatePageReport", gPopupBlockerObserver.onUpdatePageReport, false); gBrowser.addEventListener("DOMLinkAdded", livemarkOnLinkAdded, false); gBrowser.addEventListener("PluginNotFound", gMissingPluginInstaller.newMissingPlugin, false); var webNavigation; try { // Create the browser instance component. appCore = Components.classes["@mozilla.org/appshell/component/browser/instance;1"] .createInstance(Components.interfaces.nsIBrowserInstance); if (!appCore) throw "couldn't create a browser instance"; webNavigation = getWebNavigation(); if (!webNavigation) throw "no XBL binding for browser"; } catch (e) { alert("Error launching browser window:" + e); window.close(); // Give up. return; } // initialize observers and listeners // and give C++ access to gBrowser window.XULBrowserWindow = new nsBrowserStatusHandler(); window.QueryInterface(nsCI.nsIInterfaceRequestor) .getInterface(nsIWebNavigation) .QueryInterface(nsCI.nsIDocShellTreeItem).treeOwner .QueryInterface(nsCI.nsIInterfaceRequestor) .getInterface(nsCI.nsIXULWindow) .XULBrowserWindow = window.XULBrowserWindow; window.QueryInterface(nsCI.nsIDOMChromeWindow).browserDOMWindow = new nsBrowserAccess(); window.browserContentListener = new nsBrowserContentListener(window, gBrowser); // set default character set if provided if ("arguments" in window && window.arguments.length > 1 && window.arguments[1]) { if (window.arguments[1].indexOf("charset=") != -1) { var arrayArgComponents = window.arguments[1].split("="); if (arrayArgComponents) { //we should "inherit" the charset menu setting in a new window getMarkupDocumentViewer().defaultCharacterSet = arrayArgComponents[1]; } } } // Initialize browser instance.. appCore.setWebShellWindow(window); // Manually hook up session and global history for the first browser // so that we don't have to load global history before bringing up a // window. // Wire up session and global history before any possible // progress notifications for back/forward button updating webNavigation.sessionHistory = Components.classes["@mozilla.org/browser/shistory;1"] .createInstance(Components.interfaces.nsISHistory); var os = Components.classes["@mozilla.org/observer-service;1"].getService(Components.interfaces.nsIObserverService); os.addObserver(gBrowser.browsers[0], "browser:purge-session-history", false); // remove the disablehistory attribute so the browser cleans up, as // though it had done this work itself gBrowser.browsers[0].removeAttribute("disablehistory"); // enable global history gBrowser.docShell.QueryInterface(Components.interfaces.nsIDocShellHistory).useGlobalHistory = true; // hook up UI through progress listener gBrowser.addProgressListener(window.XULBrowserWindow, Components.interfaces.nsIWebProgress.NOTIFY_ALL);} |
|
gBrowser.addEventListener("PluginNotFound", gMissingPluginInstaller.newMissingPlugin, false); | gBrowser.addEventListener("PluginNotFound", gMissingPluginInstaller.newMissingPlugin, false, true); | function prepareForStartup(){ gURLBar = document.getElementById("urlbar"); gNavigatorBundle = document.getElementById("bundle_browser"); gProgressMeterPanel = document.getElementById("statusbar-progresspanel"); gBrowser.addEventListener("DOMUpdatePageReport", gPopupBlockerObserver.onUpdatePageReport, false); gBrowser.addEventListener("PluginNotFound", gMissingPluginInstaller.newMissingPlugin, false); gBrowser.addEventListener("NewTab", BrowserOpenTab, false); var webNavigation; try { // Create the browser instance component. appCore = Components.classes["@mozilla.org/appshell/component/browser/instance;1"] .createInstance(Components.interfaces.nsIBrowserInstance); if (!appCore) throw "couldn't create a browser instance"; webNavigation = getWebNavigation(); if (!webNavigation) throw "no XBL binding for browser"; } catch (e) { alert("Error launching browser window:" + e); window.close(); // Give up. return; } // initialize observers and listeners // and give C++ access to gBrowser window.XULBrowserWindow = new nsBrowserStatusHandler(); window.QueryInterface(nsCI.nsIInterfaceRequestor) .getInterface(nsIWebNavigation) .QueryInterface(nsCI.nsIDocShellTreeItem).treeOwner .QueryInterface(nsCI.nsIInterfaceRequestor) .getInterface(nsCI.nsIXULWindow) .XULBrowserWindow = window.XULBrowserWindow; window.QueryInterface(nsCI.nsIDOMChromeWindow).browserDOMWindow = new nsBrowserAccess(); window.browserContentListener = new nsBrowserContentListener(window, gBrowser); // set default character set if provided if ("arguments" in window && window.arguments.length > 1 && window.arguments[1]) { if (window.arguments[1].indexOf("charset=") != -1) { var arrayArgComponents = window.arguments[1].split("="); if (arrayArgComponents) { //we should "inherit" the charset menu setting in a new window getMarkupDocumentViewer().defaultCharacterSet = arrayArgComponents[1]; } } } // Initialize browser instance.. appCore.setWebShellWindow(window); // Manually hook up session and global history for the first browser // so that we don't have to load global history before bringing up a // window. // Wire up session and global history before any possible // progress notifications for back/forward button updating webNavigation.sessionHistory = Components.classes["@mozilla.org/browser/shistory;1"] .createInstance(Components.interfaces.nsISHistory); var os = Components.classes["@mozilla.org/observer-service;1"].getService(Components.interfaces.nsIObserverService); os.addObserver(gBrowser.browsers[0], "browser:purge-session-history", false); // remove the disablehistory attribute so the browser cleans up, as // though it had done this work itself gBrowser.browsers[0].removeAttribute("disablehistory"); // enable global history gBrowser.docShell.QueryInterface(Components.interfaces.nsIDocShellHistory).useGlobalHistory = true; // hook up UI through progress listener gBrowser.addProgressListener(window.XULBrowserWindow, Components.interfaces.nsIWebProgress.NOTIFY_ALL);} |
gBrowser.addEventListener("PluginNotFound", gMissingPluginInstaller.newMissingPlugin, false, true); | gBrowser.addEventListener("PluginNotFound", gMissingPluginInstaller.newMissingPlugin, true, true); | function prepareForStartup(){ gURLBar = document.getElementById("urlbar"); gNavigatorBundle = document.getElementById("bundle_browser"); gProgressMeterPanel = document.getElementById("statusbar-progresspanel"); gBrowser.addEventListener("DOMUpdatePageReport", gPopupBlockerObserver.onUpdatePageReport, false); // Note: we need to listen to untrusted events, because the pluginfinder XBL // binding can't fire trusted ones (runs with page privileges). gBrowser.addEventListener("PluginNotFound", gMissingPluginInstaller.newMissingPlugin, false, true); gBrowser.addEventListener("NewTab", BrowserOpenTab, false); var webNavigation; try { // Create the browser instance component. appCore = Components.classes["@mozilla.org/appshell/component/browser/instance;1"] .createInstance(Components.interfaces.nsIBrowserInstance); if (!appCore) throw "couldn't create a browser instance"; webNavigation = getWebNavigation(); if (!webNavigation) throw "no XBL binding for browser"; } catch (e) { alert("Error launching browser window:" + e); window.close(); // Give up. return; } // initialize observers and listeners // and give C++ access to gBrowser window.XULBrowserWindow = new nsBrowserStatusHandler(); window.QueryInterface(nsCI.nsIInterfaceRequestor) .getInterface(nsIWebNavigation) .QueryInterface(nsCI.nsIDocShellTreeItem).treeOwner .QueryInterface(nsCI.nsIInterfaceRequestor) .getInterface(nsCI.nsIXULWindow) .XULBrowserWindow = window.XULBrowserWindow; window.QueryInterface(nsCI.nsIDOMChromeWindow).browserDOMWindow = new nsBrowserAccess(); // set default character set if provided if ("arguments" in window && window.arguments.length > 1 && window.arguments[1]) { if (window.arguments[1].indexOf("charset=") != -1) { var arrayArgComponents = window.arguments[1].split("="); if (arrayArgComponents) { //we should "inherit" the charset menu setting in a new window getMarkupDocumentViewer().defaultCharacterSet = arrayArgComponents[1]; } } } // Initialize browser instance.. appCore.setWebShellWindow(window); // Manually hook up session and global history for the first browser // so that we don't have to load global history before bringing up a // window. // Wire up session and global history before any possible // progress notifications for back/forward button updating webNavigation.sessionHistory = Components.classes["@mozilla.org/browser/shistory;1"] .createInstance(Components.interfaces.nsISHistory); var os = Components.classes["@mozilla.org/observer-service;1"].getService(Components.interfaces.nsIObserverService); os.addObserver(gBrowser.browsers[0], "browser:purge-session-history", false); // remove the disablehistory attribute so the browser cleans up, as // though it had done this work itself gBrowser.browsers[0].removeAttribute("disablehistory"); // enable global history gBrowser.docShell.QueryInterface(Components.interfaces.nsIDocShellHistory).useGlobalHistory = true; // hook up UI through progress listener gBrowser.addProgressListener(window.XULBrowserWindow, Components.interfaces.nsIWebProgress.NOTIFY_ALL); // Initialize the feedhandler FeedHandler.init(); // Initialize the searchbar BrowserSearch.init();} |
prepareRegistry: function() | prepareRegistry: function prepareRegistry() | prepareRegistry: function() { this.mViewerDS = RDFArray.fromContainer(this.mDS, "inspector:viewers", kInspectorNSURI); // create and cache the filter functions var js, fn; this.mFilters = []; for (var i = 0; i < this.mViewerDS.length; ++i) { js = this.getEntryProperty(i, "filter"); try { fn = new Function("object", js); } catch (ex) { fn = new Function("return false"); debug("### ERROR - Syntax error in filter for viewer \"" + this.getEntryProperty(i, "description") + "\"\n"); } this.mFilters.push(fn); } }, |
fn = new Function("object", js); | fn = new Function("object", "linkedViewer", js); | prepareRegistry: function() { this.mViewerDS = RDFArray.fromContainer(this.mDS, "inspector:viewers", kInspectorNSURI); // create and cache the filter functions var js, fn; this.mFilters = []; for (var i = 0; i < this.mViewerDS.length; ++i) { js = this.getEntryProperty(i, "filter"); try { fn = new Function("object", js); } catch (ex) { fn = new Function("return false"); debug("### ERROR - Syntax error in filter for viewer \"" + this.getEntryProperty(i, "description") + "\"\n"); } this.mFilters.push(fn); } }, |
this.mStyle.load(sheet, "text/xml"); | this.mStyle.load(sheet); | preTransform : function () { try { this.mStyle = document.implementation.createDocument("", "", null); this.mAction = DO_TRANSFORM; this.mStyle.addEventListener("load", this, false); var sheet = null; var ns = this.getDocument().documentElement.namespaceURI; if (ns == "http://www.w3.org/2002/01/P3Pv1") { sheet = STYLESHEET_URL_200201; } else if (ns == "http://www.w3.org/2001/09/P3Pv1") { sheet = STYLESHEET_URL_200109; } else if (ns == "http://www.w3.org/2000/12/P3Pv1") { sheet = STYLESHEET_URL_200012; } else if (ns == "http://www.w3.org/2000/10/18/P3Pv1") { sheet = STYLESHEET_URL_200010; } else if (ns == "http://www.w3.org/2000/P3Pv1") { sheet = STYLESHEET_URL_200005; } else { this.reportError(SUMMARY_ERROR); } if (sheet) { this.mStyle.load(sheet, "text/xml"); } } catch(ex) { this.reportError(LOAD_SUMMARY); } }, |
gDialog.PreviewSize.setAttribute("collapsed", "false"); gDialog.ImageHolder.setAttribute("collapsed", "false"); | gDialog.PreviewSize.collapsed = false; gDialog.ImageHolder.collapsed = false; | function PreviewImageLoaded(){ if (gDialog.PreviewImage) { // Image loading has completed -- we can get actual width gActualWidth = gDialog.PreviewImage.naturalWidth; gActualHeight = gDialog.PreviewImage.naturalHeight; if (gActualWidth && gActualHeight) { // Use actual size or scale to fit preview if either dimension is too large var width = gActualWidth; var height = gActualHeight; if (gActualWidth > gPreviewImageWidth) { width = gPreviewImageWidth; height = gActualHeight * (gPreviewImageWidth / gActualWidth); } if (height > gPreviewImageHeight) { height = gPreviewImageHeight; width = gActualWidth * (gPreviewImageHeight / gActualHeight); } gDialog.PreviewImage.width = width; gDialog.PreviewImage.height = height; gDialog.PreviewWidth.setAttribute("value", gActualWidth); gDialog.PreviewHeight.setAttribute("value", gActualHeight); gDialog.PreviewSize.setAttribute("collapsed", "false"); gDialog.ImageHolder.setAttribute("collapsed", "false"); SetSizeWidgets(gDialog.widthInput.value, gDialog.heightInput.value); } if (gDialog.actualSizeRadio.selected) SetActualSize(); }} |
var sel = tree.treeBoxObject.selection; | var sel = tree.view.selection; | function PreviewPanel(){ var tree = document.getElementById('other-panels'); var database = tree.database; var sel = tree.treeBoxObject.selection; var rangeCount = sel.getRangeCount(); for (var range = 0; range < rangeCount; ++range) { var min = {}, max = {}; sel.getRangeAt(range, min, max); for (var index = min.value; index <= max.value; ++index) { var item = tree.contentView.getItemAtIndex(index); var res = RDF.GetResource(item.id); var preview_name = get_attr(database, res, 'title'); var preview_URL = get_attr(database, res, 'content'); if (!preview_URL || !preview_name) continue; window.openDialog("chrome://communicator/content/sidebar/preview.xul", "_blank", "chrome,resizable,close,dialog=no", preview_name, preview_URL); } }} |
if (node.getAttribute('folder') == 'true') { continue; } | function PreviewPanel() { var tree = document.getElementById('other-panels'); var database = tree.database; var select_list = tree.selectedItems for (var nodeIndex=0; nodeIndex<select_list.length; nodeIndex++) { var node = select_list[nodeIndex]; if (!node) break; var id = node.getAttribute("id"); if (!id) break; var rdfNode = RDF.GetResource(id); if (!rdfNode) break; var preview_name = getAttr(database, rdfNode, 'title'); var preview_URL = getAttr(database, rdfNode, 'content'); if (!preview_URL || !preview_name) break; var preview = window.open("chrome://sidebar/content/preview.xul", "_blank", "chrome"); preview.panel_name = preview_name; preview.panel_URL = preview_URL; }} |
|
if (node.getAttribute('folder') == 'true') { | if (node.getAttribute('container') == 'true') { | function PreviewPanel() { var tree = document.getElementById('other-panels'); var database = tree.database; var select_list = tree.selectedItems for (var nodeIndex=0; nodeIndex<select_list.length; nodeIndex++) { var node = select_list[nodeIndex]; if (!node) break; // Skip folders if (node.getAttribute('folder') == 'true') { continue; } var id = node.getAttribute("id"); if (!id) break; var rdfNode = RDF.GetResource(id); if (!rdfNode) break; var preview_name = getAttr(database, rdfNode, 'title'); var preview_URL = getAttr(database, rdfNode, 'content'); if (!preview_URL || !preview_name) break; var preview = window.open("chrome://sidebar/content/preview.xul", "_blank", "chrome,resizable"); preview.panel_name = preview_name; preview.panel_URL = preview_URL; }} |
var preview_name = getAttr(database, rdfNode, 'title'); var preview_URL = getAttr(database, rdfNode, 'content'); | var preview_name = get_attr(database, rdfNode, 'title'); var preview_URL = get_attr(database, rdfNode, 'content'); | function PreviewPanel() { var tree = document.getElementById('other-panels'); var database = tree.database; var select_list = tree.selectedItems for (var nodeIndex=0; nodeIndex<select_list.length; nodeIndex++) { var node = select_list[nodeIndex]; if (!node) break; // Skip folders if (node.getAttribute('container') == 'true') { continue; } var id = node.getAttribute("id"); if (!id) break; var rdfNode = RDF.GetResource(id); if (!rdfNode) break; var preview_name = getAttr(database, rdfNode, 'title'); var preview_URL = getAttr(database, rdfNode, 'content'); if (!preview_URL || !preview_name) break; var preview = window.open("chrome://sidebar/content/preview.xul", "_blank", "chrome,resizable"); preview.panel_name = preview_name; preview.panel_URL = preview_URL; }} |
var soundURL = document.getElementById("mailnewsSoundFileUrl").value; | var soundURL = document.getElementById("finishedSoundUrl").value; | function PreviewSound(){ var soundURL = document.getElementById("mailnewsSoundFileUrl").value; if (!gSound) gSound = Components.classes["@mozilla.org/sound;1"].createInstance(Components.interfaces.nsISound); if (soundURL.indexOf("file://") == -1) { // XXX todo see if we can create a nsIURL from the native file path // otherwise, play a system sound gSound.playSystemSound(soundURL); } else { var ioService = Components.classes["@mozilla.org/network/io-service;1"] .getService(Components.interfaces.nsIIOService); var url = ioService.newURI(soundURL, null, null); gSound.play(url) }} |
var soundURL = document.getElementById("finishedSoundUrl").value; | function PreviewSound(){ var soundURL = document.getElementById("finishedSoundUrl").value; if (!gSound) gSound = Components.classes["@mozilla.org/sound;1"].createInstance(Components.interfaces.nsISound); if (soundURL.indexOf("file://") == -1) { // XXX todo see if we can create a nsIURL from the native file path // otherwise, play a system sound gSound.playSystemSound(soundURL); } else { var ioService = Components.classes["@mozilla.org/network/io-service;1"] .getService(Components.interfaces.nsIIOService); var url = ioService.newURI(soundURL, null, null); gSound.play(url) }} |
|
if (soundURL.indexOf("file: gSound.playSystemSound(soundURL); } else { var ioService = Components.classes["@mozilla.org/network/io-service;1"] .getService(Components.interfaces.nsIIOService); var url = ioService.newURI(soundURL, null, null); gSound.play(url) } | if (gFinishedSound.value != "") gSound.play(gIOService.newURI(gFinishedSound.value, null, null)); else gSound.beep(); | function PreviewSound(){ var soundURL = document.getElementById("finishedSoundUrl").value; if (!gSound) gSound = Components.classes["@mozilla.org/sound;1"].createInstance(Components.interfaces.nsISound); if (soundURL.indexOf("file://") == -1) { // XXX todo see if we can create a nsIURL from the native file path // otherwise, play a system sound gSound.playSystemSound(soundURL); } else { var ioService = Components.classes["@mozilla.org/network/io-service;1"] .getService(Components.interfaces.nsIIOService); var url = ioService.newURI(soundURL, null, null); gSound.play(url) }} |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.