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