+ make it honour the pref
This commit is contained in:
chanial%noos.fr 2002-10-20 08:55:17 +00:00
Родитель a5a83d6715
Коммит aed4b21956
1 изменённых файлов: 13 добавлений и 6 удалений

Просмотреть файл

@ -56,6 +56,10 @@ var RDFCU;
var BMDS;
var BMSVC;
var kPREFContractID;
var kPREFIID;
var PREF;
var kSOUNDContractID;
var kSOUNDIID;
var SOUND;
@ -88,6 +92,11 @@ function initServices()
kRDFCUIID = Components.interfaces.nsIRDFContainerUtils;
RDFCU = Components.classes[kRDFCUContractID].getService(kRDFCUIID);
kPREFContractID = "@mozilla.org/preferences-service;1";
kPREFIID = Components.interfaces.nsIPrefService;
PREF = Components.classes[kPREFContractID].getService(kPREFIID)
.getBranch(null)
kSOUNDContractID = "@mozilla.org/sound;1";
kSOUNDIID = Components.interfaces.nsISound;
SOUND = Components.classes[kSOUNDContractID].createInstance(kSOUNDIID);
@ -559,11 +568,7 @@ var BookmarksCommand = {
var containerChildren = RDFC.GetElements();
var tabPanels = browser.mPanelContainer.childNodes;
var tabCount = tabPanels.length;
// Get the preferences service
var prefService = Components.classes["@mozilla.org/preferences-service;1"]
.getService(Components.interfaces.nsIPrefService);
var doReplace = prefService.getBranch(null)
.getBoolPref("browser.tabs.loadFolderAndReplace");
var doReplace = PREF.getBoolPref("browser.tabs.loadFolderAndReplace");
var index0;
if (doReplace)
index0 = 0;
@ -1607,7 +1612,9 @@ var BookmarksUtils = {
getBrowserTargetFromEvent: function (aEvent)
{
var button = (aEvent.type == "command" || aEvent.type == "keypress") ? 0 :aEvent.button;
if (aEvent.shiftKey)
if (button == 1)
return PREF.getBoolPref("browser.tabs.opentabfor.middleclick")? "tab":"window"
else if (aEvent.shiftKey)
return "window";
else if (aEvent.ctrlKey)
return "tab";