Skip to content

Commit

Permalink
Add "Copy item IDs" (#271)
Browse files Browse the repository at this point in the history
* feat: copy item IDs

* docs: for the copy item IDs feature
  • Loading branch information
davidk55 authored Jul 21, 2024
1 parent 8d53047 commit e78f476
Show file tree
Hide file tree
Showing 14 changed files with 57 additions and 1 deletion.
4 changes: 4 additions & 0 deletions addon/chrome/content/zutilo/keys.js
Original file line number Diff line number Diff line change
Expand Up @@ -138,6 +138,10 @@ keys.categories.copyZoteroSelectLink = 'copying'
keys.shortcuts.copyZoteroSelectLink = function(win) {
win.ZutiloChrome.zoteroOverlay.copyZoteroSelectLink()
};
keys.categories.copyZoteroItemID = 'copying'
keys.shortcuts.copyZoteroItemID = function(win) {
win.ZutiloChrome.zoteroOverlay.copyZoteroItemID()
};
keys.categories.copyZoteroItemURI = 'copying'
keys.shortcuts.copyZoteroItemURI = function(win) {
win.ZutiloChrome.zoteroOverlay.copyZoteroItemURI()
Expand Down
19 changes: 19 additions & 0 deletions addon/chrome/content/zutilo/zoteroOverlay.js
Original file line number Diff line number Diff line change
Expand Up @@ -794,6 +794,25 @@ ZutiloChrome.zoteroOverlay = {
return true;
},

copyZoteroItemID: function() {
var zitems = this.getSelectedItems();
var ids = [];

if (!this.checkItemNumber(zitems, 'regularNoteAttachment1')) {
return false;
}

for (var ii = 0; ii < zitems.length; ii++) {

ids.push(zitems[ii].key)
}

var clipboardText = ids.join('\r\n');

this._copyToClipboard(clipboardText)

return true;
},
_getZoteroItemURI: function() {
let zitems = this.getSelectedItems();
let links = [];
Expand Down
2 changes: 1 addition & 1 deletion addon/chrome/content/zutilo/zutilo.js
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@ var Zutilo = {
_itemMenuItems_static: ['copyTags', 'removeTags', 'pasteTags', 'relateItems',
'showAttachments', 'modifyAttachments', 'modifyURLAttachments',
'copyAttachmentPaths', 'copyCreators', 'copyItems',
'copyZoteroSelectLink', 'copyZoteroItemURI', 'createBookSection',
'copyZoteroSelectLink', 'copyZoteroItemID', 'copyZoteroItemURI', 'createBookSection',
'createBookItem', 'copyChildIDs', 'relocateChildren', 'copyJSON',
'pasteJSONIntoEmptyFields', 'pasteJSONFromNonEmptyFields',
'pasteJSONAll', 'pasteJSONItemType', 'openZoteroItemURI'
Expand Down
3 changes: 3 additions & 0 deletions addon/chrome/locale/de/zutilo/zutilo.properties
Original file line number Diff line number Diff line change
Expand Up @@ -43,6 +43,7 @@ zutilo.itemmenu.copyAttachmentPaths = Copy attachment paths
zutilo.itemmenu.copyItems = Einträge in die Zwischenablage mit Quick-Copy kopieren
zutilo.itemmenu.copyItems_alt = QuickCopy items to clipboard (alt. %S)
zutilo.itemmenu.copyZoteroSelectLink = Copy select item links
zutilo.itemmenu.copyZoteroItemID = Copy Zotero IDs
zutilo.itemmenu.copyZoteroItemURI = Copy Zotero URIs
zutilo.itemmenu.openZoteroItemURI = Open Zotero URIs
zutilo.itemmenu.createBookSection = Create book section
Expand Down Expand Up @@ -74,6 +75,7 @@ zutilo.preferences.itemmenu.copyCreators = Autoren kopieren
zutilo.preferences.itemmenu.copyItems = Einträge mit Quick-Copy kopieren
zutilo.preferences.itemmenu.copyItems_alt = QuickCopy items (alt %S)
zutilo.preferences.itemmenu.copyZoteroSelectLink = Copy select item links
zutilo.preferences.itemmenu.copyZoteroItemID = Copy Zotero IDs
zutilo.preferences.itemmenu.copyZoteroItemURI = Copy Zotero URIs
zutilo.preferences.itemmenu.openZoteroItemURI = Open Zotero URIs
zutilo.preferences.itemmenu.createBookSection = Create book section
Expand Down Expand Up @@ -124,6 +126,7 @@ zutilo.shortcuts.name.copyAttachmentPaths = Copy attachment paths
zutilo.shortcuts.name.copyItems = Einträge mit Quick-Copy kopieren
zutilo.shortcuts.name.copyItems_alt = QuickCopy items (alt %S)
zutilo.shortcuts.name.copyZoteroSelectLink = Copy select item links
zutilo.shortcuts.name.copyZoteroItemID = Copy Zotero IDs
zutilo.shortcuts.name.copyZoteroItemURI = Copy Zotero URIs
zutilo.shortcuts.name.openZoteroItemURI = Open Zotero URIs
zutilo.shortcuts.name.createBookSection = Create book section
Expand Down
3 changes: 3 additions & 0 deletions addon/chrome/locale/en-US/zutilo/zutilo.properties
Original file line number Diff line number Diff line change
Expand Up @@ -43,6 +43,7 @@ zutilo.itemmenu.copyAttachmentPaths = Copy attachment paths
zutilo.itemmenu.copyItems = QuickCopy items to clipboard
zutilo.itemmenu.copyItems_alt = QuickCopy items to clipboard (alt. %S)
zutilo.itemmenu.copyZoteroSelectLink = Copy select item links
zutilo.itemmenu.copyZoteroItemID = Copy Zotero IDs
zutilo.itemmenu.copyZoteroItemURI = Copy Zotero URIs
zutilo.itemmenu.openZoteroItemURI = Open Zotero URIs
zutilo.itemmenu.createBookSection = Create book section
Expand Down Expand Up @@ -74,6 +75,7 @@ zutilo.preferences.itemmenu.copyCreators = Copy creators
zutilo.preferences.itemmenu.copyItems = QuickCopy items
zutilo.preferences.itemmenu.copyItems_alt = QuickCopy items (alt %S)
zutilo.preferences.itemmenu.copyZoteroSelectLink = Copy select item links
zutilo.preferences.itemmenu.copyZoteroItemID = Copy Zotero IDs
zutilo.preferences.itemmenu.copyZoteroItemURI = Copy Zotero URIs
zutilo.preferences.itemmenu.openZoteroItemURI = Open Zotero URIs
zutilo.preferences.itemmenu.createBookSection = Create book section
Expand Down Expand Up @@ -124,6 +126,7 @@ zutilo.shortcuts.name.copyAttachmentPaths = Copy attachment paths
zutilo.shortcuts.name.copyItems = QuickCopy items
zutilo.shortcuts.name.copyItems_alt = QuickCopy items (alt %S)
zutilo.shortcuts.name.copyZoteroSelectLink = Copy select item links
zutilo.shortcuts.name.copyZoteroItemID = Copy Zotero IDs
zutilo.shortcuts.name.copyZoteroItemURI = Copy Zotero URIs
zutilo.shortcuts.name.openZoteroItemURI = Open Zotero URIs
zutilo.shortcuts.name.createBookSection = Create book section
Expand Down
3 changes: 3 additions & 0 deletions addon/chrome/locale/es/zutilo/zutilo.properties
Original file line number Diff line number Diff line change
Expand Up @@ -43,6 +43,7 @@ zutilo.itemmenu.copyAttachmentPaths = Copy attachment paths
zutilo.itemmenu.copyItems = Copiar ítems a portapapeles con la copia rápida
zutilo.itemmenu.copyItems_alt = QuickCopy items to clipboard (alt. %S)
zutilo.itemmenu.copyZoteroSelectLink = Copy select item links
zutilo.itemmenu.copyZoteroItemID = Copy Zotero IDs
zutilo.itemmenu.copyZoteroItemURI = Copy Zotero URIs
zutilo.itemmenu.openZoteroItemURI = Open Zotero URIs
zutilo.itemmenu.createBookSection = Create book section
Expand Down Expand Up @@ -74,6 +75,7 @@ zutilo.preferences.itemmenu.copyCreators = Copiar creadores
zutilo.preferences.itemmenu.copyItems = Copiar ítems con copia rápida
zutilo.preferences.itemmenu.copyItems_alt = QuickCopy items (alt %S)
zutilo.preferences.itemmenu.copyZoteroSelectLink = Copy select item links
zutilo.preferences.itemmenu.copyZoteroItemID = Copy Zotero IDs
zutilo.preferences.itemmenu.copyZoteroItemURI = Copy Zotero URIs
zutilo.preferences.itemmenu.openZoteroItemURI = Open Zotero URIs
zutilo.preferences.itemmenu.createBookSection = Create book section
Expand Down Expand Up @@ -124,6 +126,7 @@ zutilo.shortcuts.name.copyAttachmentPaths = Copy attachment paths
zutilo.shortcuts.name.copyItems = Copiar ítems con copia rápida
zutilo.shortcuts.name.copyItems_alt = QuickCopy items (alt %S)
zutilo.shortcuts.name.copyZoteroSelectLink = Copy select item links
zutilo.shortcuts.name.copyZoteroItemID = Copy Zotero IDs
zutilo.shortcuts.name.copyZoteroItemURI = Copy Zotero URIs
zutilo.shortcuts.name.openZoteroItemURI = Open Zotero URIs
zutilo.shortcuts.name.createBookSection = Create book section
Expand Down
3 changes: 3 additions & 0 deletions addon/chrome/locale/fr/zutilo/zutilo.properties
Original file line number Diff line number Diff line change
Expand Up @@ -43,6 +43,7 @@ zutilo.itemmenu.copyAttachmentPaths = Copier les chemins vers les pièces jointe
zutilo.itemmenu.copyItems = Copie rapide des documents
zutilo.itemmenu.copyItems_alt = Copie rapide des documents (alt. %S)
zutilo.itemmenu.copyZoteroSelectLink = Copier les liens zotero://… des documents
zutilo.itemmenu.copyZoteroItemID = Copier les identifiants des documents
zutilo.itemmenu.copyZoteroItemURI = Copier les liens zotero.org/… des documents
zutilo.itemmenu.openZoteroItemURI = Ouvrir les liens zotero://… des documents
zutilo.itemmenu.createBookSection = Créer une notice "Chapitre de livre"
Expand Down Expand Up @@ -74,6 +75,7 @@ zutilo.preferences.itemmenu.copyCreators = Copier les créateurs
zutilo.preferences.itemmenu.copyItems = Copie rapide des documents
zutilo.preferences.itemmenu.copyItems_alt = Copie rapide des documents (alt %S)
zutilo.preferences.itemmenu.copyZoteroSelectLink = Copier les liens zotero://… des documents
zutilo.preferences.itemmenu.copyZoteroItemID = Copier les identifiants des documents
zutilo.preferences.itemmenu.copyZoteroItemURI = Copier les liens zotero.org/… des documents
zutilo.preferences.itemmenu.openZoteroItemURI = Ouvrir les liens zotero://… des documents
zutilo.preferences.itemmenu.createBookSection = Créer une notice "Chapitre de livre"
Expand Down Expand Up @@ -124,6 +126,7 @@ zutilo.shortcuts.name.copyAttachmentPaths = Copier les chemins vers les pièce
zutilo.shortcuts.name.copyItems = Copie rapide des documents
zutilo.shortcuts.name.copyItems_alt = Copie rapide des documents (alt %S)
zutilo.shortcuts.name.copyZoteroSelectLink = Copier les liens zotero://… des documents
zutilo.shortcuts.name.copyZoteroItemID = Copier les identifiants des documents
zutilo.shortcuts.name.copyZoteroItemURI = Copier les liens zotero.org/… des documents
zutilo.shortcuts.name.openZoteroItemURI = Ouvrir les liens zotero://… des documents
zutilo.shortcuts.name.createBookSection = Créer une notice "Chapitre de livre"
Expand Down
3 changes: 3 additions & 0 deletions addon/chrome/locale/zh-CN/zutilo/zutilo.properties
Original file line number Diff line number Diff line change
Expand Up @@ -43,6 +43,7 @@ zutilo.itemmenu.copyAttachmentPaths = 复制附件路径
zutilo.itemmenu.copyItems = 快捷复制条目到剪切板
zutilo.itemmenu.copyItems_alt = 快捷复制条目到剪切板 (Alt. %S)
zutilo.itemmenu.copyZoteroSelectLink = 复制选中的条目链接
zutilo.itemmenu.copyZoteroItemID = 复制 Zotero IDs
zutilo.itemmenu.copyZoteroItemURI = 复制 Zotero URI
zutilo.itemmenu.openZoteroItemURI = Open Zotero URIs
zutilo.itemmenu.createBookSection = 新建图书章节条目
Expand Down Expand Up @@ -74,6 +75,7 @@ zutilo.preferences.itemmenu.copyCreators = 复制创建者
zutilo.preferences.itemmenu.copyItems = 快捷复制条目
zutilo.preferences.itemmenu.copyItems_alt = 快捷复制条目 (Alt %S)
zutilo.preferences.itemmenu.copyZoteroSelectLink = 复制选中条目链接
zutilo.preferences.itemmenu.copyZoteroItemID = 复制 Zotero IDs
zutilo.preferences.itemmenu.copyZoteroItemURI = 复制 Zotero URI
zutilo.preferences.itemmenu.openZoteroItemURI = Open Zotero URIs
zutilo.preferences.itemmenu.createBookSection = 新建图书章节条目
Expand Down Expand Up @@ -124,6 +126,7 @@ zutilo.shortcuts.name.copyAttachmentPaths = Copy attachment paths
zutilo.shortcuts.name.copyItems = QuickCopy items
zutilo.shortcuts.name.copyItems_alt = QuickCopy items (alt %S)
zutilo.shortcuts.name.copyZoteroSelectLink = Copy select item links
zutilo.shortcuts.name.copyZoteroItemID = 复制 Zotero IDs
zutilo.shortcuts.name.copyZoteroItemURI = Copy Zotero URIs
zutilo.shortcuts.name.openZoteroItemURI = Open Zotero URIs
zutilo.shortcuts.name.createBookSection = Create book section
Expand Down
3 changes: 3 additions & 0 deletions docs/COMMANDS.md
Original file line number Diff line number Diff line change
Expand Up @@ -55,6 +55,9 @@ In the Zutilo preferences (accessed from Zotero "Tools" menu), each of these fun
Copy links of the form "zotero://select/library/items/ITEM_ID" to the clipboard for each selected item.
Following links from other applications can select items in the Zotero client but might require additional set up.

* __Copy Zotero IDs:__
Copy the ID of each selected item to the clipboard.

* __Copy Zotero URIs:__
Copy (www.zotero.org) links to the clipboard for each selected item.
If you have a (www.zotero.org) profile, following such a link will open the page for the corresponding item in profile on (www.zotero.org).
Expand Down
3 changes: 3 additions & 0 deletions i18n/de/readme/docs/COMMANDS.md
Original file line number Diff line number Diff line change
Expand Up @@ -55,6 +55,9 @@ In the Zutilo preferences (accessed from Zotero "Tools" menu), each of these fun
Copy links of the form "zotero://select/library/items/ITEM_ID" to the clipboard for each selected item.
Following links from other applications can select items in the Zotero client but might require additional set up.

* __Copy Zotero IDs:__
Copy the ID of each selected item to the clipboard.

* __Copy Zotero URIs:__
Copy (www.zotero.org) links to the clipboard for each selected item.
If you have a (www.zotero.org) profile, following such a link will open the page for the corresponding item in profile on (www.zotero.org).
Expand Down
3 changes: 3 additions & 0 deletions i18n/en-US/readme/docs/COMMANDS.md
Original file line number Diff line number Diff line change
Expand Up @@ -55,6 +55,9 @@ In the Zutilo preferences (accessed from Zotero "Tools" menu), each of these fun
Copy links of the form "zotero://select/library/items/ITEM_ID" to the clipboard for each selected item.
Following links from other applications can select items in the Zotero client but might require additional set up.

* __Copy Zotero IDs:__
Copy the ID of each selected item to the clipboard.

* __Copy Zotero URIs:__
Copy (www.zotero.org) links to the clipboard for each selected item.
If you have a (www.zotero.org) profile, following such a link will open the page for the corresponding item in profile on (www.zotero.org).
Expand Down
3 changes: 3 additions & 0 deletions i18n/es/readme/docs/COMMANDS.md
Original file line number Diff line number Diff line change
Expand Up @@ -55,6 +55,9 @@ In the Zutilo preferences (accessed from Zotero "Tools" menu), each of these fun
Copy links of the form "zotero://select/library/items/ITEM_ID" to the clipboard for each selected item.
Following links from other applications can select items in the Zotero client but might require additional set up.

* __Copy Zotero IDs:__
Copy the ID of each selected item to the clipboard.

* __Copy Zotero URIs:__
Copy (www.zotero.org) links to the clipboard for each selected item.
If you have a (www.zotero.org) profile, following such a link will open the page for the corresponding item in profile on (www.zotero.org).
Expand Down
3 changes: 3 additions & 0 deletions i18n/fr/readme/docs/COMMANDS.md
Original file line number Diff line number Diff line change
Expand Up @@ -55,6 +55,9 @@ Dans les préférences de Zutilo (accessibles depuis le menu "Outils" de Zotero)
Copie dans le presse-papiers les liens sous la forme "zotero://select/library/items/ITEM_ID" pour chaque document sélectionné.
Suivre des liens depuis d'autres applications peut sélectionner des documents dans le client Zotero, mais cela peut nécessiter une configuration supplémentaire.

* __Copier les identifiants des documents :__
Copier l'ID de chaque élément sélectionné dans le presse-papiers.

* __Copier les liens zotero.org/… des documents :__
Copie dans le presse-papiers les liens (www.zotero.org) pour chaque document sélectionné.
Si vous avez un profil (www.zotero.org), suivre un tel lien ouvrira la page du document correspondant dans le profil sur (www.zotero.org).
Expand Down
3 changes: 3 additions & 0 deletions i18n/zh-CN/readme/docs/COMMANDS.md
Original file line number Diff line number Diff line change
Expand Up @@ -55,6 +55,9 @@ In the Zutilo preferences (accessed from Zotero "Tools" menu), each of these fun
Copy links of the form "zotero://select/library/items/ITEM_ID" to the clipboard for each selected item.
Following links from other applications can select items in the Zotero client but might require additional set up.

* __Copy Zotero IDs:__
Copy the ID of each selected item to the clipboard.

* __Copy Zotero URIs:__
Copy (www.zotero.org) links to the clipboard for each selected item.
If you have a (www.zotero.org) profile, following such a link will open the page for the corresponding item in profile on (www.zotero.org).
Expand Down

0 comments on commit e78f476

Please sign in to comment.