1.1 --- /dev/null Thu Jan 01 00:00:00 1970 +0000 1.2 +++ b/browser/components/preferences/tabs.js Wed Dec 31 06:09:35 2014 +0100 1.3 @@ -0,0 +1,66 @@ 1.4 +# -*- Mode: Java; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- 1.5 +# This Source Code Form is subject to the terms of the Mozilla Public 1.6 +# License, v. 2.0. If a copy of the MPL was not distributed with this 1.7 +# file, You can obtain one at http://mozilla.org/MPL/2.0/. 1.8 + 1.9 +var gTabsPane = { 1.10 + 1.11 + /* 1.12 + * Preferences: 1.13 + * 1.14 + * browser.link.open_newwindow 1.15 + * - determines where pages which would open in a new window are opened: 1.16 + * 1 opens such links in the most recent window or tab, 1.17 + * 2 opens such links in a new window, 1.18 + * 3 opens such links in a new tab 1.19 + * browser.tabs.loadInBackground 1.20 + * - true if display should switch to a new tab which has been opened from a 1.21 + * link, false if display shouldn't switch 1.22 + * browser.tabs.warnOnClose 1.23 + * - true if when closing a window with multiple tabs the user is warned and 1.24 + * allowed to cancel the action, false to just close the window 1.25 + * browser.tabs.warnOnOpen 1.26 + * - true if the user should be warned if he attempts to open a lot of tabs at 1.27 + * once (e.g. a large folder of bookmarks), false otherwise 1.28 + * browser.taskbar.previews.enable 1.29 + * - true if tabs are to be shown in the Windows 7 taskbar 1.30 + */ 1.31 + 1.32 +#ifdef XP_WIN 1.33 + /** 1.34 + * Initialize any platform-specific UI. 1.35 + */ 1.36 + init: function () { 1.37 + const Cc = Components.classes; 1.38 + const Ci = Components.interfaces; 1.39 + try { 1.40 + let sysInfo = Cc["@mozilla.org/system-info;1"]. 1.41 + getService(Ci.nsIPropertyBag2); 1.42 + let ver = parseFloat(sysInfo.getProperty("version")); 1.43 + let showTabsInTaskbar = document.getElementById("showTabsInTaskbar"); 1.44 + showTabsInTaskbar.hidden = ver < 6.1; 1.45 + } catch (ex) {} 1.46 + }, 1.47 +#endif 1.48 + 1.49 + /** 1.50 + * Determines where a link which opens a new window will open. 1.51 + * 1.52 + * @returns |true| if such links should be opened in new tabs 1.53 + */ 1.54 + readLinkTarget: function() { 1.55 + var openNewWindow = document.getElementById("browser.link.open_newwindow"); 1.56 + return openNewWindow.value != 2; 1.57 + }, 1.58 + 1.59 + /** 1.60 + * Determines where a link which opens a new window will open. 1.61 + * 1.62 + * @returns 2 if such links should be opened in new windows, 1.63 + * 3 if such links should be opened in new tabs 1.64 + */ 1.65 + writeLinkTarget: function() { 1.66 + var linkTargeting = document.getElementById("linkTargeting"); 1.67 + return linkTargeting.checked ? 3 : 2; 1.68 + } 1.69 +};