From 11c1277ea7ca056767b7b97a8fc998e1c3800a48 Mon Sep 17 00:00:00 2001 From: Dan Stillman Date: Mon, 14 Sep 2009 04:18:58 +0000 Subject: [PATCH] - Changed toolbar note button to context-sensitive menu for adding standalone and child notes - Added toolbar button with context-sensitive menu for adding child attachments --- chrome/content/zotero/overlay.js | 58 +++++++++++++++++++++++++ chrome/content/zotero/overlay.xul | 26 ++++++++--- chrome/skin/default/zotero/attach.png | Bin 0 -> 391 bytes chrome/skin/default/zotero/overlay.css | 15 +++++-- 4 files changed, 89 insertions(+), 10 deletions(-) create mode 100644 chrome/skin/default/zotero/attach.png diff --git a/chrome/content/zotero/overlay.js b/chrome/content/zotero/overlay.js index d5eeb1c79..f4ac8be92 100644 --- a/chrome/content/zotero/overlay.js +++ b/chrome/content/zotero/overlay.js @@ -1118,6 +1118,55 @@ var ZoteroPane = new function() } + this.updateNoteButtonMenu = function () { + var items = ZoteroPane.getSelectedItems(); + var button = document.getElementById('zotero-tb-add-child-note'); + button.disabled = this.canEdit() && !(items.length == 1 + && (items[0].isRegularItem() || !items[0].isTopLevelItem())); + } + + + this.updateAttachmentButtonMenu = function (popup) { + var items = ZoteroPane.getSelectedItems(); + + var disabled = !this.canEdit() || !(items.length == 1 && items[0].isRegularItem()); + + if (disabled) { + for each(var node in popup.childNodes) { + node.disabled = true; + } + return; + } + + var itemgroup = this.collectionsView._getItemAtRow(this.collectionsView.selection.currentIndex); + var canEditFiles = this.canEditFiles(); + + var prefix = "menuitem-iconic zotero-menuitem-attachments-"; + + for (var i=0; i - - - - - + + + + + @@ -222,7 +222,21 @@ - + + + + + + + + + + + + + + + diff --git a/chrome/skin/default/zotero/attach.png b/chrome/skin/default/zotero/attach.png new file mode 100644 index 0000000000000000000000000000000000000000..ea897cc9f18ca49aa0f30bad4e6b67e4afc7f498 GIT binary patch literal 391 zcmV;20eJq2P)`oHYyCmI1nr3DC<^9@PyNudrDc9~P$75b!T6T2tv<*K=EzTZ+r6P_ zRz+%oP}