# # = Preferences Window Framework # # The syntax for use looks something like: # # # # # # # # # # # 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); return this.getAttribute("instantApply") == "true" || document.documentElement.instantApply; null return this.preferences.rootBranch.prefIsLocked(this.name); return this.getAttribute("disabled") == "true"; return this.preferences.rootBranch.prefHasUserValue(this.name); this.preferences.rootBranch.clearUserPref(this.name); false return this._useDefault ? this.preferences.defaultBranch : this.preferences.rootBranch; false this.updateElements(); #else xul:title="&preferencesDefaultTitleMac.title;"> #endif false this.setAttribute("lastSelected", val); document.persist(this.id, "lastSelected"); return val; null false aOldPane.contentHeight ? 1 : -1; var sizeDelta = Math.abs(aOldPane.contentHeight - aNewPane.contentHeight); this._needsSizing = sizeDelta > this._animateIncrement; this._animateRemainder = sizeDelta % this._animateIncrement; // Compute the opacity step, using 0.2 as a maximum step size. this._opacityStepSize = sizeDelta != 0 ? this._animateIncrement / sizeDelta : 1.0; if (this._opacityStepSize > 0.2) this._opacityStepSize = 0.2; this._setUpTimer(aOldPane.contentHeight); ]]> 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; ]]> 0 null 50 10 0 0 0 0 0 return openDialog(aURL, "", "modal,centerscreen" + (aFeatures != "" ? ("," + aFeatures) : ""), aParams); var wm = Components.classes["@mozilla.org/appshell/window-mediator;1"] .getService(Components.interfaces.nsIWindowMediator); var win = aWindowType ? wm.getMostRecentWindow(aWindowType) : null; if (win) { if ("initWithParams" in win) win.initWithParams(aParams); win.focus(); } else { var features = "resizable,dialog=no,centerscreen" + (aFeatures != "" ? ("," + aFeatures) : ""); var parentWindow = this.instantApply ? window : window.opener; win = parentWindow.openDialog(aURL, "_blank", features, aParams); } return win; if (event.originalTarget.hasAttribute("pane")) { var pane = document.getElementById(event.originalTarget.getAttribute("pane")); event.originalTarget.parentNode.parentNode.showPane(pane); } false return document.getElementById(aElement.getAttribute("preference")); 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. 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); # -*- Mode: Java; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- # Version: MPL 1.1/GPL 2.0/LGPL 2.1 # # The contents of this file are subject to the Mozilla Public License Version # 1.1 (the "License"); you may not use this file except in compliance with # the License. You may obtain a copy of the License at # http://www.mozilla.org/MPL/ # # Software distributed under the License is distributed on an "AS IS" basis, # WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License # for the specific language governing rights and limitations under the # License. # # The Original Code is the Preferences System. # # The Initial Developer of the Original Code is Ben Goodger. # Portions created by the Initial Developer are Copyright (C) 2005 # the Initial Developer. All Rights Reserved. # # Contributor(s): # Ben Goodger # # Alternatively, the contents of this file may be used under the terms of # either the GNU General Public License Version 2 or later (the "GPL"), or # the GNU Lesser General Public License Version 2.1 or later (the "LGPL"), # in which case the provisions of the GPL or the LGPL are applicable instead # of those above. If you wish to allow use of your version of this file only # under the terms of either the GPL or the LGPL, and not to allow others to # use your version of this file under the terms of the MPL, indicate your # decision by deleting the provisions above and replace them with the notice # and other provisions required by the GPL or the LGPL. If you do not delete # the provisions above, a recipient may use your version of this file under # the terms of any one of the MPL, the GPL or the LGPL. # # ***** END LICENSE BLOCK ***** # # 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) #