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