1
/* -*- Mode: Java; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*-
3
* ***** BEGIN LICENSE BLOCK *****
4
* Version: MPL 1.1/GPL 2.0/LGPL 2.1
6
* The contents of this file are subject to the Mozilla Public License Version
7
* 1.1 (the "License"); you may not use this file except in compliance with
8
* the License. You may obtain a copy of the License at
9
* http://www.mozilla.org/MPL/
11
* Software distributed under the License is distributed on an "AS IS" basis,
12
* WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License
13
* for the specific language governing rights and limitations under the
16
* The Original Code is Mozilla.org Code.
19
* Bruno Escherl <aqualon@aquachan.de>
21
* Alternatively, the contents of this file may be used under the terms of
22
* either the GNU General Public License Version 2 or later (the "GPL"), or
23
* the GNU Lesser General Public License Version 2.1 or later (the "LGPL"),
24
* in which case the provisions of the GPL or the LGPL are applicable instead
25
* of those above. If you wish to allow use of your version of this file only
26
* under the terms of either the GPL or the LGPL, and not to allow others to
27
* use your version of this file under the terms of the MPL, indicate your
28
* decision by deleting the provisions above and replace them with the notice
29
* and other provisions required by the GPL or the LGPL. If you do not delete
30
* the provisions above, a recipient may use your version of this file under
31
* the terms of any one of the MPL, the GPL or the LGPL.
33
* ***** END LICENSE BLOCK ***** */
37
SidebarPrefs_initialize();
38
enableBlinkPrefs(document.getElementById("inspector.blink.on").value);
41
function enableBlinkPrefs(aTruth)
44
* define the pair of label and control used in the prefpane to allow
45
* disabling of both elements, if a pref is locked.
48
lbElBorderColor: "cprElBorderColor",
49
lbElBorderWidth: "txfElBorderWidth",
50
lbElDuration: "txfElDuration",
51
lbElSpeed: "txfElSpeed",
55
for (let [label, control] in Iterator(els)) {
56
let controlElem = document.getElementById(control);
58
// only remove disabled attribute, if pref isn't locked
59
if (aTruth && !isPrefLocked(controlElem)) {
60
controlElem.removeAttribute("disabled");
62
document.getElementById(label).removeAttribute("disabled");
64
controlElem.setAttribute("disabled", true);
66
document.getElementById(label).setAttribute("disabled", true);
71
function isPrefLocked(elem)
73
if (!elem.hasAttribute("preference"))
76
return document.getElementById(elem.getAttribute("preference")).locked;