michael@0: # -*- Mode: Java; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- michael@0: # This Source Code Form is subject to the terms of the Mozilla Public michael@0: # License, v. 2.0. If a copy of the MPL was not distributed with this michael@0: # file, You can obtain one at http://mozilla.org/MPL/2.0/. michael@0: michael@0: var gTabsPane = { michael@0: michael@0: /* michael@0: * Preferences: michael@0: * michael@0: * browser.link.open_newwindow michael@0: * - determines where pages which would open in a new window are opened: michael@0: * 1 opens such links in the most recent window or tab, michael@0: * 2 opens such links in a new window, michael@0: * 3 opens such links in a new tab michael@0: * browser.tabs.loadInBackground michael@0: * - true if display should switch to a new tab which has been opened from a michael@0: * link, false if display shouldn't switch michael@0: * browser.tabs.warnOnClose michael@0: * - true if when closing a window with multiple tabs the user is warned and michael@0: * allowed to cancel the action, false to just close the window michael@0: * browser.tabs.warnOnOpen michael@0: * - true if the user should be warned if he attempts to open a lot of tabs at michael@0: * once (e.g. a large folder of bookmarks), false otherwise michael@0: * browser.taskbar.previews.enable michael@0: * - true if tabs are to be shown in the Windows 7 taskbar michael@0: */ michael@0: michael@0: #ifdef XP_WIN michael@0: /** michael@0: * Initialize any platform-specific UI. michael@0: */ michael@0: init: function () { michael@0: const Cc = Components.classes; michael@0: const Ci = Components.interfaces; michael@0: try { michael@0: let sysInfo = Cc["@mozilla.org/system-info;1"]. michael@0: getService(Ci.nsIPropertyBag2); michael@0: let ver = parseFloat(sysInfo.getProperty("version")); michael@0: let showTabsInTaskbar = document.getElementById("showTabsInTaskbar"); michael@0: showTabsInTaskbar.hidden = ver < 6.1; michael@0: } catch (ex) {} michael@0: }, michael@0: #endif michael@0: michael@0: /** michael@0: * Determines where a link which opens a new window will open. michael@0: * michael@0: * @returns |true| if such links should be opened in new tabs michael@0: */ michael@0: readLinkTarget: function() { michael@0: var openNewWindow = document.getElementById("browser.link.open_newwindow"); michael@0: return openNewWindow.value != 2; michael@0: }, michael@0: michael@0: /** michael@0: * Determines where a link which opens a new window will open. michael@0: * michael@0: * @returns 2 if such links should be opened in new windows, michael@0: * 3 if such links should be opened in new tabs michael@0: */ michael@0: writeLinkTarget: function() { michael@0: var linkTargeting = document.getElementById("linkTargeting"); michael@0: return linkTargeting.checked ? 3 : 2; michael@0: } michael@0: };