Add Edit button for site-specific Quick Copy settings
This commit is contained in:
parent
8352934009
commit
5833d87169
2 changed files with 29 additions and 4 deletions
|
@ -145,6 +145,21 @@ Zotero_Preferences.Export = {
|
||||||
checkbox.disabled = mode != 'bibliography';
|
checkbox.disabled = mode != 'bibliography';
|
||||||
},
|
},
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Disables UI buttons when no site-specific quick copy entries are selected
|
||||||
|
*/
|
||||||
|
disableQuickCopySiteButtons: function () {
|
||||||
|
document.getElementById('quickCopy-edit').disabled = true;
|
||||||
|
document.getElementById('quickCopy-delete').disabled = true;
|
||||||
|
},
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Enables UI buttons when a site-specific quick copy entry is selected
|
||||||
|
*/
|
||||||
|
enableQuickCopySiteButtons: function () {
|
||||||
|
document.getElementById('quickCopy-edit').disabled = false;
|
||||||
|
document.getElementById('quickCopy-delete').disabled = false;
|
||||||
|
},
|
||||||
|
|
||||||
showQuickCopySiteEditor: function (index) {
|
showQuickCopySiteEditor: function (index) {
|
||||||
var treechildren = document.getElementById('quickCopy-siteSettings-rows');
|
var treechildren = document.getElementById('quickCopy-siteSettings-rows');
|
||||||
|
@ -212,6 +227,8 @@ Zotero_Preferences.Export = {
|
||||||
treeitem.appendChild(treerow);
|
treeitem.appendChild(treerow);
|
||||||
treechildren.appendChild(treeitem);
|
treechildren.appendChild(treeitem);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
this.disableQuickCopySiteButtons();
|
||||||
},
|
},
|
||||||
|
|
||||||
|
|
||||||
|
|
|
@ -23,7 +23,10 @@
|
||||||
|
|
||||||
***** END LICENSE BLOCK *****
|
***** END LICENSE BLOCK *****
|
||||||
-->
|
-->
|
||||||
<!DOCTYPE prefwindow SYSTEM "chrome://zotero/locale/preferences.dtd">
|
<!DOCTYPE prefwindow [
|
||||||
|
<!ENTITY % preferencesDTD SYSTEM "chrome://zotero/locale/preferences.dtd"> %preferencesDTD;
|
||||||
|
<!ENTITY % zoteroDTD SYSTEM "chrome://zotero/locale/zotero.dtd"> %zoteroDTD;
|
||||||
|
]>
|
||||||
|
|
||||||
<overlay xmlns="http://www.mozilla.org/keymaster/gatekeeper/there.is.only.xul">
|
<overlay xmlns="http://www.mozilla.org/keymaster/gatekeeper/there.is.only.xul">
|
||||||
<prefpane id="zotero-prefpane-export">
|
<prefpane id="zotero-prefpane-export">
|
||||||
|
@ -34,6 +37,7 @@
|
||||||
<label value="&zotero.preferences.quickCopy.siteEditor.setings;" control="quickCopy-siteSettings"/>
|
<label value="&zotero.preferences.quickCopy.siteEditor.setings;" control="quickCopy-siteSettings"/>
|
||||||
<tree flex="1" id="quickCopy-siteSettings" hidecolumnpicker="true" rows="6" seltype="single"
|
<tree flex="1" id="quickCopy-siteSettings" hidecolumnpicker="true" rows="6" seltype="single"
|
||||||
ondblclick="Zotero_Preferences.Export.showQuickCopySiteEditor(this.currentIndex)"
|
ondblclick="Zotero_Preferences.Export.showQuickCopySiteEditor(this.currentIndex)"
|
||||||
|
onselect="Zotero_Preferences.Export.enableQuickCopySiteButtons()"
|
||||||
onkeypress="if (event.keyCode == event.DOM_VK_DELETE) { Zotero_Preferences.Export.deleteSelectedQuickCopySite(); }">
|
onkeypress="if (event.keyCode == event.DOM_VK_DELETE) { Zotero_Preferences.Export.deleteSelectedQuickCopySite(); }">
|
||||||
<treecols>
|
<treecols>
|
||||||
<treecol id="quickCopy-urlColumn" label="&zotero.preferences.quickCopy.siteEditor.domainPath;" flex="1"/>
|
<treecol id="quickCopy-urlColumn" label="&zotero.preferences.quickCopy.siteEditor.domainPath;" flex="1"/>
|
||||||
|
@ -43,9 +47,13 @@
|
||||||
<treechildren id="quickCopy-siteSettings-rows"/>
|
<treechildren id="quickCopy-siteSettings-rows"/>
|
||||||
</tree>
|
</tree>
|
||||||
<separator class="thin"/>
|
<separator class="thin"/>
|
||||||
<hbox pack="end">
|
<hbox>
|
||||||
<button label="-" onclick="Zotero_Preferences.Export.deleteSelectedQuickCopySite()"/>
|
<button disabled="true" id="quickCopy-edit" label="&zotero.general.edit;"
|
||||||
<button label="+" onclick="Zotero_Preferences.Export.showQuickCopySiteEditor()"/>
|
onclick="Zotero_Preferences.Export.showQuickCopySiteEditor(document.getElementById('quickCopy-siteSettings').currentIndex)"/>
|
||||||
|
<spacer flex="1"/>
|
||||||
|
<button disabled="true" id="quickCopy-delete" label="-" onclick="Zotero_Preferences.Export.deleteSelectedQuickCopySite()"/>
|
||||||
|
<button label="+"
|
||||||
|
onclick="Zotero_Preferences.Export.showQuickCopySiteEditor()"/>
|
||||||
</hbox>
|
</hbox>
|
||||||
</vbox>
|
</vbox>
|
||||||
</groupbox>
|
</groupbox>
|
||||||
|
|
Loading…
Reference in a new issue