зеркало из https://github.com/mozilla/pjs.git
Add a "Copy" context menu item that copies pref name and value in about:config list. b=239940 (part 1) r+sr=neil@httl.net
This commit is contained in:
Родитель
d6625887ea
Коммит
fd61d7a689
|
@ -477,6 +477,9 @@ function updateContextMenu()
|
|||
copyDisabled = false;
|
||||
}
|
||||
|
||||
var copyPref = document.getElementById("copyPref");
|
||||
copyPref.setAttribute("disabled", copyDisabled);
|
||||
|
||||
var copyName = document.getElementById("copyName");
|
||||
copyName.setAttribute("disabled", copyDisabled);
|
||||
|
||||
|
@ -502,6 +505,12 @@ function updateContextMenu()
|
|||
document.getElementById("unlockSelected").hidden = !isLocked;
|
||||
}
|
||||
|
||||
function copyPref()
|
||||
{
|
||||
var pref = gPrefView[view.selection.currentIndex];
|
||||
gClipboardHelper.copyString(pref.prefCol + ';' + pref.valueCol);
|
||||
}
|
||||
|
||||
function copyName()
|
||||
{
|
||||
gClipboardHelper.copyString(gPrefView[view.selection.currentIndex].prefCol);
|
||||
|
|
|
@ -56,6 +56,7 @@
|
|||
<stringbundle id="configBundle" src="chrome://global/locale/config.properties"/>
|
||||
|
||||
<popup id="configContext" onpopupshowing="if (event.target == this) updateContextMenu();">
|
||||
<menuitem id="copyPref" label="©Pref.label;" accesskey="©Pref.accesskey;" oncommand="copyPref();"/>
|
||||
<menuitem id="copyName" label="©Name.label;" accesskey="©Name.accesskey;" oncommand="copyName();"/>
|
||||
<menuitem id="copyValue" label="©Value.label;" accesskey="©Value.accesskey;" oncommand="copyValue();"/>
|
||||
<menu label="&new.label;" accesskey="&new.accesskey;">
|
||||
|
|
|
@ -57,8 +57,11 @@
|
|||
<!ENTITY columnChooser.tooltip "Click to select columns to display">
|
||||
|
||||
<!-- Context Menu -->
|
||||
<!ENTITY copyPref.key "C">
|
||||
<!ENTITY copyPref.label "Copy">
|
||||
<!ENTITY copyPref.accesskey "C">
|
||||
<!ENTITY copyName.label "Copy Name">
|
||||
<!ENTITY copyName.accesskey "C">
|
||||
<!ENTITY copyName.accesskey "N">
|
||||
<!ENTITY copyValue.label "Copy Value">
|
||||
<!ENTITY copyValue.accesskey "V">
|
||||
<!ENTITY modify.label "Modify">
|
||||
|
@ -68,7 +71,7 @@
|
|||
<!ENTITY reset.label "Reset">
|
||||
<!ENTITY reset.accesskey "R">
|
||||
<!ENTITY new.label "New">
|
||||
<!ENTITY new.accesskey "N">
|
||||
<!ENTITY new.accesskey "w">
|
||||
<!ENTITY string.label "String">
|
||||
<!ENTITY string.accesskey "S">
|
||||
<!ENTITY integer.label "Integer">
|
||||
|
|
|
@ -478,6 +478,9 @@ function updateContextMenu()
|
|||
copyDisabled = false;
|
||||
}
|
||||
|
||||
var copyPref = document.getElementById("copyPref");
|
||||
copyPref.setAttribute("disabled", copyDisabled);
|
||||
|
||||
var copyName = document.getElementById("copyName");
|
||||
copyName.setAttribute("disabled", copyDisabled);
|
||||
|
||||
|
@ -498,6 +501,12 @@ function updateContextMenu()
|
|||
toggleSelected.hidden = !canToggle;
|
||||
}
|
||||
|
||||
function copyPref()
|
||||
{
|
||||
var pref = gPrefView[view.selection.currentIndex];
|
||||
gClipboardHelper.copyString(pref.prefCol + ';' + pref.valueCol);
|
||||
}
|
||||
|
||||
function copyName()
|
||||
{
|
||||
gClipboardHelper.copyString(gPrefView[view.selection.currentIndex].prefCol);
|
||||
|
|
|
@ -57,6 +57,7 @@
|
|||
<stringbundle id="configBundle" src="chrome://global/locale/config.properties"/>
|
||||
|
||||
<popup id="configContext" onpopupshowing="if (event.target == this) updateContextMenu();">
|
||||
<menuitem id="copyPref" label="©Pref.label;" accesskey="©Pref.accesskey;" oncommand="copyPref();"/>
|
||||
<menuitem id="copyName" label="©Name.label;" accesskey="©Name.accesskey;" oncommand="copyName();"/>
|
||||
<menuitem id="copyValue" label="©Value.label;" accesskey="©Value.accesskey;" oncommand="copyValue();"/>
|
||||
<menu label="&new.label;" accesskey="&new.accesskey;">
|
||||
|
|
|
@ -58,8 +58,11 @@
|
|||
<!ENTITY columnChooser.tooltip "Click to select columns to display">
|
||||
|
||||
<!--Context Menu-->
|
||||
<!ENTITY copyPref.key "C">
|
||||
<!ENTITY copyPref.label "Copy">
|
||||
<!ENTITY copyPref.accesskey "C">
|
||||
<!ENTITY copyName.label "Copy Name">
|
||||
<!ENTITY copyName.accesskey "C">
|
||||
<!ENTITY copyName.accesskey "N">
|
||||
<!ENTITY copyValue.label "Copy Value">
|
||||
<!ENTITY copyValue.accesskey "V">
|
||||
<!ENTITY modify.label "Modify">
|
||||
|
@ -69,7 +72,7 @@
|
|||
<!ENTITY reset.label "Reset">
|
||||
<!ENTITY reset.accesskey "R">
|
||||
<!ENTITY new.label "New">
|
||||
<!ENTITY new.accesskey "N">
|
||||
<!ENTITY new.accesskey "w">
|
||||
<!ENTITY string.label "String">
|
||||
<!ENTITY string.accesskey "S">
|
||||
<!ENTITY integer.label "Integer">
|
||||
|
|
Загрузка…
Ссылка в новой задаче