Support copying from about:config using the browser's Edit/Copy and the Accel+C shortcut as well as the context menu b=239940 r=mats,mano
This commit is contained in:
Родитель
f7564f4c71
Коммит
0197c885eb
|
@ -363,7 +363,9 @@ function ShowPrefs()
|
|||
|
||||
gPrefBranch.addObserver("", gPrefListener, false);
|
||||
|
||||
document.getElementById("configTree").view = view;
|
||||
var configTree = document.getElementById("configTree");
|
||||
configTree.view = view;
|
||||
configTree.controllers.insertControllerAt(0, configController);
|
||||
|
||||
document.getElementById("configDeck").setAttribute("selectedIndex", 1);
|
||||
if (!document.getElementById("showWarningNextTime").checked)
|
||||
|
@ -376,7 +378,9 @@ function onConfigUnload()
|
|||
{
|
||||
if (document.getElementById("configDeck").getAttribute("selectedIndex") == 1) {
|
||||
gPrefBranch.removeObserver("", gPrefListener);
|
||||
document.getElementById("configTree").view = null;
|
||||
var configTree = document.getElementById("configTree");
|
||||
configTree.view = null;
|
||||
configTree.controllers.removeController(configController);
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -462,6 +466,20 @@ const gSortFunctions =
|
|||
valueCol: valueColSortFunction
|
||||
};
|
||||
|
||||
const configController = {
|
||||
supportsCommand: function supportsCommand(command) {
|
||||
return command == "cmd_copy";
|
||||
},
|
||||
isCommandEnabled: function isCommandEnabled(command) {
|
||||
return view.selection && view.selection.currentIndex >= 0;
|
||||
},
|
||||
doCommand: function doCommand(command) {
|
||||
copyPref();
|
||||
},
|
||||
onEvent: function onEvent(event) {
|
||||
}
|
||||
}
|
||||
|
||||
function updateContextMenu()
|
||||
{
|
||||
var lockCol = PREF_IS_LOCKED;
|
||||
|
|
|
@ -101,6 +101,7 @@
|
|||
</hbox>
|
||||
|
||||
<tree id="configTree" flex="1" class="plain focusring" seltype="single"
|
||||
onselect="updateCommands('select');"
|
||||
enableColumnDrag="true" context="configContext">
|
||||
<treecols>
|
||||
<treecol id="prefCol" label="&prefColumn.label;" flex="7"
|
||||
|
|
|
@ -364,7 +364,9 @@ function ShowPrefs()
|
|||
|
||||
gPrefBranch.addObserver("", gPrefListener, false);
|
||||
|
||||
document.getElementById("configTree").view = view;
|
||||
var configTree = document.getElementById("configTree");
|
||||
configTree.view = view;
|
||||
configTree.controllers.insertControllerAt(0, configController);
|
||||
|
||||
document.getElementById("configDeck").setAttribute("selectedIndex", 1);
|
||||
if (!document.getElementById("showWarningNextTime").checked)
|
||||
|
@ -377,7 +379,9 @@ function onConfigUnload()
|
|||
{
|
||||
if (document.getElementById("configDeck").getAttribute("selectedIndex") == 1) {
|
||||
gPrefBranch.removeObserver("", gPrefListener);
|
||||
document.getElementById("configTree").view = null;
|
||||
var configTree = document.getElementById("configTree");
|
||||
configTree.view = null;
|
||||
configTree.controllers.removeController(configController);
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -463,6 +467,20 @@ const gSortFunctions =
|
|||
valueCol: valueColSortFunction
|
||||
};
|
||||
|
||||
const configController = {
|
||||
supportsCommand: function supportsCommand(command) {
|
||||
return command == "cmd_copy";
|
||||
},
|
||||
isCommandEnabled: function isCommandEnabled(command) {
|
||||
return view.selection && view.selection.currentIndex >= 0;
|
||||
},
|
||||
doCommand: function doCommand(command) {
|
||||
copyPref();
|
||||
},
|
||||
onEvent: function onEvent(event) {
|
||||
}
|
||||
}
|
||||
|
||||
function updateContextMenu()
|
||||
{
|
||||
var lockCol = PREF_IS_LOCKED;
|
||||
|
|
|
@ -100,6 +100,7 @@
|
|||
</hbox>
|
||||
|
||||
<tree id="configTree" flex="1" class="plain focusring" seltype="single"
|
||||
onselect="updateCommands('select');"
|
||||
enableColumnDrag="true" context="configContext">
|
||||
<treecols>
|
||||
<treecol id="prefCol" label="&prefColumn.label;" flex="7"
|
||||
|
|
Загрузка…
Ссылка в новой задаче