зеркало из https://github.com/mozilla/pjs.git
fix middle-click in bookmarks
+ make it honour the pref
This commit is contained in:
Родитель
a5a83d6715
Коммит
aed4b21956
|
@ -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";
|
||||||
|
|
Загрузка…
Ссылка в новой задаче