%preferencesDTD; %globalKeysDTD; ]> # # = Preferences Window Framework # # The syntax for use looks something like: # # # # # # # # # # # elements is constructed. Its purpose is to propagate // the values to the associated form elements var elements = this.getElementsByTagName("preference"); for (let element of elements) { if (!element._constructed) { return; } } for (let element of elements) { element.updateElements(); } ]]> Components.classes["@mozilla.org/preferences-service;1"] .getService(Components.interfaces.nsIPrefService); Components.classes["@mozilla.org/preferences-service;1"] .getService(Components.interfaces.nsIPrefBranch); this.service.getDefaultBranch(""); Components.classes["@mozilla.org/preferences-service;1"] .getService(Components.interfaces.nsIPrefBranchInternal); this.preferences.rootBranchInternal .removeObserver(this.name, this.preferences); false if (this.getAttribute("instantApply") == "false") return false; return this.getAttribute("instantApply") == "true" || this.preferences.instantApply; if (val == this.name) return val; this.preferences.rootBranchInternal .removeObserver(this.name, this.preferences); this.setAttribute('name', val); this.preferences.rootBranchInternal .addObserver(val, this.preferences, false); return val; null return this.preferences.rootBranch.prefIsLocked(this.name); return this.getAttribute("disabled") == "true"; return parseInt(this.getAttribute("tabindex")); // defer reset until preference update this.value = undefined; false return this._useDefault ? this.preferences.defaultBranch : this.preferences.rootBranch; false with id='" + this.id + "' and name='" + this.name + "' has unknown type '" + this.type + "'."; consoleService.logStringMessage(msg); ]]> this.updateElements(); #else title="&preferencesDefaultTitleMac.title;"> #endif #ifdef XP_UNIX false false this.setAttribute("lastSelected", val); document.persist(this.id, "lastSelected"); return val; if (!this._currentPane) this._currentPane = this.preferencePanes[0]; return this._currentPane; null false 1) aPaneElement.removeAttribute("flex"); // Calling sizeToContent after the first prefpane is loaded // will size the windows contents so style information is // available to calculate correct sizing. if (!this._initialized && prefpanes.length > 1) { if (this._shouldAnimate) this.style.minHeight = 0; window.sizeToContent(); } var oldPane = this.lastSelected ? document.getElementById(this.lastSelected) : this.preferencePanes[0]; oldPane.selected = !(aPaneElement.selected = true); this.lastSelected = aPaneElement.id; this.currentPane = aPaneElement; this._initialized = true; // Only animate if we've switched between prefpanes if (this._shouldAnimate && oldPane.id != aPaneElement.id) { aPaneElement.style.opacity = 0.0; this.animate(oldPane, aPaneElement); } else if (!this._shouldAnimate && prefpanes.length > 1) { var targetHeight = parseInt(window.getComputedStyle(this._paneDeckContainer, "").height); var verticalPadding = parseInt(window.getComputedStyle(aPaneElement, "").paddingTop); verticalPadding += parseInt(window.getComputedStyle(aPaneElement, "").paddingBottom); if (aPaneElement.contentHeight > targetHeight - verticalPadding) { // To workaround the bottom border of a groupbox from being // cutoff an hbox with a class of bottomBox may enclose it. // This needs to include its padding to resize properly. // See bug 394433 var bottomPadding = 0; var bottomBox = aPaneElement.getElementsByAttribute("class", "bottomBox")[0]; if (bottomBox) bottomPadding = parseInt(window.getComputedStyle(bottomBox, "").paddingBottom); window.innerHeight += bottomPadding + verticalPadding + aPaneElement.contentHeight - targetHeight; } // XXX rstrong - extend the contents of the prefpane to // prevent elements from being cutoff (see bug 349098). if (aPaneElement.contentHeight + verticalPadding < targetHeight) aPaneElement._content.style.height = targetHeight - verticalPadding + "px"; } } break; } } ]]> oldHeight ? 1 : -1; var sizeDelta = Math.abs(oldHeight - aNewPane.contentHeight); this._animateRemainder = sizeDelta % this._animateIncrement; this._setUpAnimationTimer(oldHeight); ]]> 0 && this._currentHeight >= lastSelectedPane.contentHeight) || (this._multiplier < 0 && this._currentHeight <= lastSelectedPane.contentHeight)) return 0; if ((this._multiplier > 0 && newHeight > lastSelectedPane.contentHeight) || (this._multiplier < 0 && newHeight < lastSelectedPane.contentHeight)) increment = this._animateRemainder * this._multiplier; return increment; ]]> null null 15 40 5 0.40 0 0 0 return openDialog(aURL, "", "modal,centerscreen,resizable=no" + (aFeatures != "" ? ("," + aFeatures) : ""), aParams); if (event.originalTarget.hasAttribute("pane")) { var pane = document.getElementById(event.originalTarget.getAttribute("pane")); this.showPane(pane); } false return document.getElementById(aElement.getAttribute("preference")); new Set(); var targetHeight = parseInt(window.getComputedStyle(this._content, "").height); targetHeight += parseInt(window.getComputedStyle(this._content, "").marginTop); targetHeight += parseInt(window.getComputedStyle(this._content, "").marginBottom); return targetHeight; document.getAnonymousElementByAttribute(this, "class", "content-box"); // This "command" event handler tracks changes made to preferences by // the user in this window. if (event.sourceEvent) event = event.sourceEvent; this.userChangedValue(event.target); // This "select" event handler tracks changes made to colorpicker // preferences by the user in this window. if (event.target.localName == "colorpicker") this.userChangedValue(event.target); // This "change" event handler tracks changes made to preferences by // the user in this window. this.userChangedValue(event.target); // This "input" event handler tracks changes made to preferences by // the user in this window. this.userChangedValue(event.target); # -*- Mode: Java; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- # This Source Code Form is subject to the terms of the Mozilla Public # License, v. 2.0. If a copy of the MPL was not distributed with this # file, You can obtain one at http://mozilla.org/MPL/2.0/. # # This is PrefWindow 6. The Code Could Well Be Ready, Are You? # # Historical References: # PrefWindow V (February 1, 2003) # PrefWindow IV (April 24, 2000) # PrefWindow III (January 6, 2000) # PrefWindow II (???) # PrefWindow I (June 4, 1999) #