browser/components/preferences/tabs.js

branch
TOR_BUG_3246
changeset 6
8bccb770b82d
equal deleted inserted replaced
-1:000000000000 0:4d794e740db3
1 # -*- Mode: Java; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*-
2 # This Source Code Form is subject to the terms of the Mozilla Public
3 # License, v. 2.0. If a copy of the MPL was not distributed with this
4 # file, You can obtain one at http://mozilla.org/MPL/2.0/.
5
6 var gTabsPane = {
7
8 /*
9 * Preferences:
10 *
11 * browser.link.open_newwindow
12 * - determines where pages which would open in a new window are opened:
13 * 1 opens such links in the most recent window or tab,
14 * 2 opens such links in a new window,
15 * 3 opens such links in a new tab
16 * browser.tabs.loadInBackground
17 * - true if display should switch to a new tab which has been opened from a
18 * link, false if display shouldn't switch
19 * browser.tabs.warnOnClose
20 * - true if when closing a window with multiple tabs the user is warned and
21 * allowed to cancel the action, false to just close the window
22 * browser.tabs.warnOnOpen
23 * - true if the user should be warned if he attempts to open a lot of tabs at
24 * once (e.g. a large folder of bookmarks), false otherwise
25 * browser.taskbar.previews.enable
26 * - true if tabs are to be shown in the Windows 7 taskbar
27 */
28
29 #ifdef XP_WIN
30 /**
31 * Initialize any platform-specific UI.
32 */
33 init: function () {
34 const Cc = Components.classes;
35 const Ci = Components.interfaces;
36 try {
37 let sysInfo = Cc["@mozilla.org/system-info;1"].
38 getService(Ci.nsIPropertyBag2);
39 let ver = parseFloat(sysInfo.getProperty("version"));
40 let showTabsInTaskbar = document.getElementById("showTabsInTaskbar");
41 showTabsInTaskbar.hidden = ver < 6.1;
42 } catch (ex) {}
43 },
44 #endif
45
46 /**
47 * Determines where a link which opens a new window will open.
48 *
49 * @returns |true| if such links should be opened in new tabs
50 */
51 readLinkTarget: function() {
52 var openNewWindow = document.getElementById("browser.link.open_newwindow");
53 return openNewWindow.value != 2;
54 },
55
56 /**
57 * Determines where a link which opens a new window will open.
58 *
59 * @returns 2 if such links should be opened in new windows,
60 * 3 if such links should be opened in new tabs
61 */
62 writeLinkTarget: function() {
63 var linkTargeting = document.getElementById("linkTargeting");
64 return linkTargeting.checked ? 3 : 2;
65 }
66 };

mercurial