Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add copyZoteroPDFLink #264

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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.copyZoteroPDFLink = 'copying'
keys.shortcuts.copyZoteroPDFLink = function(win) {
win.ZutiloChrome.zoteroOverlay.copyZoteroPDFLink()
};
keys.categories.copyZoteroItemURI = 'copying'
keys.shortcuts.copyZoteroItemURI = function(win) {
win.ZutiloChrome.zoteroOverlay.copyZoteroItemURI()
Expand Down
36 changes: 36 additions & 0 deletions addon/chrome/content/zutilo/zoteroOverlay.js
Original file line number Diff line number Diff line change
Expand Up @@ -794,6 +794,42 @@ ZutiloChrome.zoteroOverlay = {
return true;
},

copyZoteroPDFLink: function () {
var zitems = this.getSelectedItems();
var links = [];

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

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

libraryType = Zotero.Libraries.get(zitems[ii].libraryID).libraryType

switch (libraryType) {
case 'group':
path = Zotero.URI.getLibraryPath(zitems[ii].libraryID)
break;
case 'user':
path = 'library'
break;
default:
// Feeds?
continue
}

links.push('zotero://open-pdf/' + path + '/items/' + zitems[ii].key + '?page=')
}

var clipboardText = links.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', 'copyZoteroPDFLink', '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.copyZoteroPDFLink = Copy PDF links
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.copyZoteroPDFLink = Copy PDF links
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.copyZoteroPDFLink = Copy PDF links
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.copyZoteroPDFLink = Copy PDF links
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.copyZoteroPDFLink = Copy PDF links
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.copyZoteroPDFLink = Copy PDF links
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.copyZoteroPDFLink = Copy PDF links
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.copyZoteroPDFLink = Copy PDF links
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.copyZoteroPDFLink = Copy PDF links
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.copyZoteroPDFLink = Copier les liens PDF
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.copyZoteroPDFLink = Copier les liens PDF
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.copyZoteroPDFLink = Copier les liens PDF
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.copyZoteroPDFLink = 复制 PDF 链接
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.copyZoteroPDFLink = 复制 PDF 链接
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.copyZoteroPDFLink = Copy PDF links
zutilo.shortcuts.name.copyZoteroItemURI = Copy Zotero URIs
zutilo.shortcuts.name.openZoteroItemURI = Open Zotero URIs
zutilo.shortcuts.name.createBookSection = Create book section
Expand Down