From 31d9e4f2edd5ee55690cd6ae55e0fdfdfa88ca2f Mon Sep 17 00:00:00 2001 From: Robert Kaiser Date: Tue, 17 Jun 2008 14:48:25 +0200 Subject: [PATCH] bug 399031 - Convert xpfe prefpane to toolkit version (DOMi), p=aqualon@aquachan.de r=sdwilsh sr=Neil --- extensions/inspector/jar.mn | 3 +- extensions/inspector/resources/Makefile.in | 3 - .../resources/content/prefs/pref-inspector.js | 77 ++++++++ .../content/prefs/pref-inspector.xul | 175 +++++++++++------- .../resources/content/prefs/pref-sidebar.js | 2 - .../resources/content/prefs/prefsOverlay.xul | 15 +- .../resources/locale/en-US/prefs.dtd | 8 + 7 files changed, 199 insertions(+), 84 deletions(-) create mode 100644 extensions/inspector/resources/content/prefs/pref-inspector.js diff --git a/extensions/inspector/jar.mn b/extensions/inspector/jar.mn index 70d2950e233..600bf91ae96 100644 --- a/extensions/inspector/jar.mn +++ b/extensions/inspector/jar.mn @@ -3,7 +3,7 @@ inspector.jar: % overlay chrome://inspector/content/inspector.xul chrome://communicator/content/utilityOverlay.xul application={92650c4d-4b8e-4d2a-b7eb-24ecf4f6b63a} % overlay chrome://inspector/content/inspector.xul chrome://communicator/content/tasksOverlay.xul application={92650c4d-4b8e-4d2a-b7eb-24ecf4f6b63a} % overlay chrome://communicator/content/tasksOverlay.xul chrome://inspector/content/tasksOverlay.xul application={92650c4d-4b8e-4d2a-b7eb-24ecf4f6b63a} -% overlay chrome://communicator/content/pref/preftree.xul chrome://inspector/content/prefs/prefsOverlay.xul application={92650c4d-4b8e-4d2a-b7eb-24ecf4f6b63a} +% overlay chrome://communicator/content/pref/preferences.xul chrome://inspector/content/prefs/prefsOverlay.xul application={92650c4d-4b8e-4d2a-b7eb-24ecf4f6b63a} % overlay chrome://browser/content/browser.xul chrome://inspector/content/tasksOverlay-ff.xul application={ec8030f7-c20a-464f-9b0e-13a3a9e97384} % overlay chrome://browser/content/macBrowserOverlay.xul chrome://inspector/content/tasksOverlay-ff.xul application={ec8030f7-c20a-464f-9b0e-13a3a9e97384} % overlay chrome://inspector/content/inspector.xul chrome://browser/content/baseMenuOverlay.xul application={ec8030f7-c20a-464f-9b0e-13a3a9e97384} @@ -61,6 +61,7 @@ inspector.jar: content/inspector/jsutil/xul/inBaseTreeView.js (resources/content/jsutil/xul/inBaseTreeView.js) content/inspector/jsutil/events/ObserverManager.js (resources/content/jsutil/events/ObserverManager.js) content/inspector/prefs/pref-inspector.xul (resources/content/prefs/pref-inspector.xul) + content/inspector/prefs/pref-inspector.js (resources/content/prefs/pref-inspector.js) content/inspector/prefs/prefsOverlay.xul (resources/content/prefs/prefsOverlay.xul) content/inspector/prefs/pref-sidebar.js (resources/content/prefs/pref-sidebar.js) content/inspector/tests/allskin.xul (resources/content/tests/allskin.xul) diff --git a/extensions/inspector/resources/Makefile.in b/extensions/inspector/resources/Makefile.in index b09c4246ad7..24d68e8cf7f 100644 --- a/extensions/inspector/resources/Makefile.in +++ b/extensions/inspector/resources/Makefile.in @@ -45,10 +45,7 @@ VPATH=@srcdir@ include $(DEPTH)/config/autoconf.mk ALL_LOCALES = \ - de \ en-US \ - fr \ - sk \ $(NULL) include $(topsrcdir)/config/config.mk diff --git a/extensions/inspector/resources/content/prefs/pref-inspector.js b/extensions/inspector/resources/content/prefs/pref-inspector.js new file mode 100644 index 00000000000..73ef2fcc233 --- /dev/null +++ b/extensions/inspector/resources/content/prefs/pref-inspector.js @@ -0,0 +1,77 @@ +/* -*- Mode: Java; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- + * vim: ts=2 sw=2 sts=2 + * ***** BEGIN LICENSE BLOCK ***** + * 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 Mozilla.org Code. + * + * Contributor(s): + * Bruno Escherl + * + * 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 ***** */ + +function Startup() +{ + SidebarPrefs_initialize(); + enableBlinkPrefs(document.getElementById("inspector.blink.on").value); +} + +function enableBlinkPrefs(aTruth) +{ + /* + * define the pair of label and control used in the prefpane to allow + * disabling of both elements, if a pref is locked. + */ + let els = { + lbElBorderColor: "cprElBorderColor", + lbElBorderWidth: "txfElBorderWidth", + lbElDuration: "txfElDuration", + lbElSpeed: "txfElSpeed", + "": "cbElInvert" + }; + + for (let [label, control] in Iterator(els)) { + let controlElem = document.getElementById(control); + + // only remove disabled attribute, if pref isn't locked + if (aTruth && !isPrefLocked(controlElem)) { + controlElem.removeAttribute("disabled"); + if (label) + document.getElementById(label).removeAttribute("disabled"); + } else { + controlElem.setAttribute("disabled", true); + if (label) + document.getElementById(label).setAttribute("disabled", true); + } + } +} + +function isPrefLocked(elem) +{ + if (!elem.hasAttribute("preference")) + return false; + + return document.getElementById(elem.getAttribute("preference")).locked; +} diff --git a/extensions/inspector/resources/content/prefs/pref-inspector.xul b/extensions/inspector/resources/content/prefs/pref-inspector.xul index 3af2302bf6b..bbe9ff9ecb5 100644 --- a/extensions/inspector/resources/content/prefs/pref-inspector.xul +++ b/extensions/inspector/resources/content/prefs/pref-inspector.xul @@ -1,63 +1,89 @@ - + + + - + + - + - - - - + - + @@ -65,62 +91,75 @@ - - - - + preference="inspector.blink.invert" + accesskey="&invertColors.accesskey;"/> - - + + &installHowTo.label; -