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:
mats.palmgren%bredband.net 2007-01-26 20:51:12 +00:00
Родитель d6625887ea
Коммит fd61d7a689
6 изменённых файлов: 30 добавлений и 4 удалений

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

@ -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="&copyPref.label;" accesskey="&copyPref.accesskey;" oncommand="copyPref();"/>
<menuitem id="copyName" label="&copyName.label;" accesskey="&copyName.accesskey;" oncommand="copyName();"/>
<menuitem id="copyValue" label="&copyValue.label;" accesskey="&copyValue.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="&copyPref.label;" accesskey="&copyPref.accesskey;" oncommand="copyPref();"/>
<menuitem id="copyName" label="&copyName.label;" accesskey="&copyName.accesskey;" oncommand="copyName();"/>
<menuitem id="copyValue" label="&copyValue.label;" accesskey="&copyValue.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">