~ubuntu-branches/ubuntu/hardy/xulrunner-1.9/hardy-proposed

« back to all changes in this revision

Viewing changes to mozilla/extensions/inspector/resources/content/prefs/pref-inspector.js

  • Committer: Bazaar Package Importer
  • Author(s): Alexander Sack
  • Date: 2008-07-11 09:46:57 UTC
  • mfrom: (1.1.9 upstream)
  • Revision ID: james.westby@ubuntu.com-20080711094657-tck768vmv0ka84os
Tags: 1.9.0.1+build1+nobinonly-0ubuntu0.8.04.1
* LP: #247494 - new stability/security update (v1.9.0.1 build1)
  - see USN-623-1

(cherry pick rev303 from lp:~mozillateam/xulrunner/xulrunner-1.9.head)
* Make EM_TRANSLATION_VERSION follow upstream version now that strings are
  hard frozen and bump EM_TRANSLATION_MAX_VERSION to 1.9.0.*
  - update debian/rules

(cherry pick rev304 from lp:~mozillateam/xulrunner/xulrunner-1.9.head)
* Let EM_TRANSLATION_* be late evaluated so it helps embedded tarballs
  - update debian/rules

(cherry pick rev305 from lp:~mozillateam/xulrunner/xulrunner-1.9.head)
* link nss/nspr include directories to xulrunner-1.9 sdk in order to
  allow upstream extensions to be built against ubuntu xulrunner.
  - add debian/xulrunner-1.9-dev.links

(cherry pick rev312 from lp:~mozillateam/xulrunner/xulrunner-1.9.head)
* drop patches applied upstream
  - delete debian/patches/bz428848_att319775_fix_venkman_chrome_access.patch
  - update debian/patches/series

(cherry pick rev313 from lp:~mozillateam/xulrunner/xulrunner-1.9.head)
* hold back upgrade until firefox 3.0.1 is available; for that, we add a
  Breaks: firefox-3.0 (<< 3.0.1) to xulrunner-1.9 binary package 
  - update debian/control

(cherry pick rev314 from lp:~mozillateam/xulrunner/xulrunner-1.9.head)
* fix LP: #247132 - The Prism Refractor Extension (v0.2) causes file
  downloads to kill firefox 3; we fix this by introducing a NULL check
  in our bz368428 "XUL FastLoad cache corruption" patch
  - update debian/patches/bz368428_attachment_308130.patch

* dont use debhelper .links file to better guess the right path based
  on the xulrunner version and implement the linking manually in rules
  - delete debian/xulrunner-1.9-dev.links
  - update debian/rules
* fix .autoreg touch to use the right upstream version too
  - update debian/rules

Show diffs side-by-side

added added

removed removed

Lines of Context:
 
1
/* -*- Mode: Java; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*-
 
2
 * vim: ts=2 sw=2 sts=2
 
3
 * ***** BEGIN LICENSE BLOCK *****
 
4
 * Version: MPL 1.1/GPL 2.0/LGPL 2.1
 
5
 *
 
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/
 
10
 *
 
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
 
14
 * License.
 
15
 *
 
16
 * The Original Code is Mozilla.org Code.
 
17
 *
 
18
 * Contributor(s):
 
19
 *   Bruno Escherl <aqualon@aquachan.de>
 
20
 *
 
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.
 
32
 *
 
33
 * ***** END LICENSE BLOCK ***** */
 
34
 
 
35
function Startup()
 
36
{
 
37
  SidebarPrefs_initialize();
 
38
  enableBlinkPrefs(document.getElementById("inspector.blink.on").value);
 
39
}
 
40
 
 
41
function enableBlinkPrefs(aTruth)
 
42
{
 
43
  /* 
 
44
   * define the pair of label and control used in the prefpane to allow
 
45
   * disabling of both elements, if a pref is locked.
 
46
   */
 
47
  let els = {
 
48
    lbElBorderColor: "cprElBorderColor",
 
49
    lbElBorderWidth: "txfElBorderWidth",
 
50
    lbElDuration: "txfElDuration",
 
51
    lbElSpeed: "txfElSpeed",
 
52
    "": "cbElInvert"
 
53
  };
 
54
 
 
55
  for (let [label, control] in Iterator(els)) {
 
56
    let controlElem = document.getElementById(control);
 
57
 
 
58
    // only remove disabled attribute, if pref isn't locked
 
59
    if (aTruth && !isPrefLocked(controlElem)) {
 
60
      controlElem.removeAttribute("disabled");
 
61
      if (label)
 
62
        document.getElementById(label).removeAttribute("disabled");
 
63
    } else {
 
64
      controlElem.setAttribute("disabled", true);
 
65
      if (label)
 
66
        document.getElementById(label).setAttribute("disabled", true);
 
67
    }
 
68
  }
 
69
}
 
70
 
 
71
function isPrefLocked(elem)
 
72
{
 
73
  if (!elem.hasAttribute("preference"))
 
74
    return false;
 
75
 
 
76
  return document.getElementById(elem.getAttribute("preference")).locked;
 
77
}