diff --git a/chrome/content/zotero/itemPane.js b/chrome/content/zotero/itemPane.js
index 628abf3a5..ca0cf32de 100644
--- a/chrome/content/zotero/itemPane.js
+++ b/chrome/content/zotero/itemPane.js
@@ -23,10 +23,6 @@
var ZoteroItemPane = new function() {
var _itemBeingEdited;
- var _notesList;
- var _linksBox;
- var _notesLabel;
-
var _lastPane;
var _loaded;
@@ -37,11 +33,6 @@ var ZoteroItemPane = new function() {
this.onLoad = onLoad;
this.viewItem = viewItem;
this.loadPane = loadPane;
- this.removeNote = removeNote;
- this.addNote = addNote;
- this.removeAttachment = removeAttachment;
- this.addAttachmentFromDialog = addAttachmentFromDialog;
- this.addAttachmentFromPage = addAttachmentFromPage;
function onLoad()
@@ -57,10 +48,6 @@ var ZoteroItemPane = new function() {
_deck = document.getElementById('zotero-view-item');
_itemBox = document.getElementById('zotero-editpane-item-box');
- _notesList = document.getElementById('zotero-editpane-dynamic-notes');
- _notesLabel = document.getElementById('zotero-editpane-notes-label');
- _attachmentsList = document.getElementById('zotero-editpane-dynamic-attachments');
- _attachmentsLabel = document.getElementById('zotero-editpane-attachments-label');
_tagsBox = document.getElementById('zotero-editpane-tags');
_relatedBox = document.getElementById('zotero-editpane-related');
}
@@ -129,112 +116,9 @@ var ZoteroItemPane = new function() {
_itemBox.item = _itemBeingEdited;
}
- // Notes pane
- else if(index == 1)
- {
- while(_notesList.hasChildNodes())
- _notesList.removeChild(_notesList.firstChild);
-
- var notes = Zotero.Items.get(_itemBeingEdited.getNotes());
- if(notes.length)
- {
- for(var i = 0; i < notes.length; i++)
- {
- var icon = document.createElement('image');
- icon.setAttribute('src','chrome://zotero/skin/treeitem-note.png');
-
- var label = document.createElement('label');
- var title = Zotero.Notes.noteToTitle(notes[i].getNote());
- title = title ? title : Zotero.getString('pane.item.notes.untitled');
- label.setAttribute('value', title);
- label.setAttribute('flex','1'); //so that the long names will flex smaller
- label.setAttribute('crop','end');
-
- var box = document.createElement('box');
- box.setAttribute('onclick',"ZoteroPane.selectItem(" + notes[i].id + ");");
- box.setAttribute('class','zotero-clicky');
- box.appendChild(icon);
- box.appendChild(label);
-
- var removeButton = document.createElement('label');
- removeButton.setAttribute("value","-");
- removeButton.setAttribute("class","zotero-clicky");
- removeButton.setAttribute("onclick","ZoteroItemPane.removeNote(" + notes[i].id + ")");
-
- var row = document.createElement('row');
- row.appendChild(box);
- row.appendChild(removeButton);
-
- _notesList.appendChild(row);
- }
- }
-
- _updateNoteCount();
- }
-
- // Attachments pane
- else if(index == 2)
- {
- while(_attachmentsList.hasChildNodes())
- _attachmentsList.removeChild(_attachmentsList.firstChild);
-
- var attachments = Zotero.Items.get(_itemBeingEdited.getAttachments());
- if(attachments.length)
- {
- for(var i = 0; i < attachments.length; i++)
- {
- var icon = document.createElement('image');
- var linkMode = attachments[i].getAttachmentLinkMode();
- var itemType = '';
- if(linkMode == Zotero.Attachments.LINK_MODE_IMPORTED_FILE)
- {
- itemType = "-file";
- }
- else if(linkMode == Zotero.Attachments.LINK_MODE_LINKED_FILE)
- {
- itemType = "-link";
- }
- else if(linkMode == Zotero.Attachments.LINK_MODE_IMPORTED_URL)
- {
- itemType = "-snapshot";
- }
- else if(linkMode == Zotero.Attachments.LINK_MODE_LINKED_URL)
- {
- itemType = "-web-link";
- }
- icon.setAttribute('src','chrome://zotero/skin/treeitem-file'+itemType+'.png');
-
- var label = document.createElement('label');
- label.setAttribute('value',attachments[i].getField('title'));
- label.setAttribute('flex','1'); //so that the long names will flex smaller
- label.setAttribute('crop','end');
-
- var box = document.createElement('box');
- box.setAttribute('onclick',"ZoteroPane.selectItem('" + attachments[i].id + "')");
- box.setAttribute('class','zotero-clicky');
- box.appendChild(icon);
- box.appendChild(label);
-
- var removeButton = document.createElement('label');
- removeButton.setAttribute("value","-");
- removeButton.setAttribute("class","zotero-clicky");
- removeButton.setAttribute("onclick","ZoteroItemPane.removeAttachment(" + attachments[i].id + ")");
-
- var row = document.createElement('row');
- row.appendChild(box);
- row.appendChild(removeButton);
-
- _attachmentsList.appendChild(row);
- }
- }
-
- _updateAttachmentCount();
-
- }
// Tags pane
- else if(index == 3)
- {
+ else if (index == 1) {
if (mode) {
_tagsBox.mode = mode;
}
@@ -248,83 +132,10 @@ var ZoteroItemPane = new function() {
}
// Related pane
- else if(index == 4)
- {
+ else if (index == 2) {
_relatedBox.item = _itemBeingEdited;
}
}
-
-
- function removeNote(id)
- {
- var note = Zotero.Items.get(id);
- if(note)
- if(confirm(Zotero.getString('pane.item.notes.delete.confirm')))
- note.erase();
- }
-
- function addNote()
- {
- ZoteroPane.openNoteWindow(null, null, _itemBeingEdited.id);
- }
-
- function _updateNoteCount()
- {
- var c = _notesList.childNodes.length;
-
- var str = 'pane.item.notes.count.';
- switch (c){
- case 0:
- str += 'zero';
- break;
- case 1:
- str += 'singular';
- break;
- default:
- str += 'plural';
- break;
- }
-
- _notesLabel.value = Zotero.getString(str, [c]);
- }
-
- function _updateAttachmentCount()
- {
- var c = _attachmentsList.childNodes.length;
-
- var str = 'pane.item.attachments.count.';
- switch (c){
- case 0:
- str += 'zero';
- break;
- case 1:
- str += 'singular';
- break;
- default:
- str += 'plural';
- break;
- }
-
- _attachmentsLabel.value = Zotero.getString(str, [c]);
- }
-
- function removeAttachment(id)
- {
- var attachment = Zotero.Items.get(id);
- if(attachment)
- if(confirm(Zotero.getString('pane.item.attachments.delete.confirm')))
- attachment.erase();
- }
-
- function addAttachmentFromDialog(link)
- {
- ZoteroPane.addAttachmentFromDialog(link, _itemBeingEdited.id);
- }
-
- function addAttachmentFromPage(link)
- {
- ZoteroPane.addAttachmentFromPage(link, _itemBeingEdited.id);
- }
}
addEventListener("load", function(e) { ZoteroItemPane.onLoad(e); }, false);
diff --git a/chrome/content/zotero/itemPane.xul b/chrome/content/zotero/itemPane.xul
index cea560aad..d91572ee9 100644
--- a/chrome/content/zotero/itemPane.xul
+++ b/chrome/content/zotero/itemPane.xul
@@ -36,41 +36,6 @@
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
diff --git a/chrome/content/zotero/overlay.js b/chrome/content/zotero/overlay.js
index 125713339..d313d1f95 100644
--- a/chrome/content/zotero/overlay.js
+++ b/chrome/content/zotero/overlay.js
@@ -779,12 +779,10 @@ var ZoteroPane = new function()
function toggleTagSelector(){
var zoteroPane = document.getElementById('zotero-pane');
- var splitter = document.getElementById('zotero-tags-splitter');
var tagSelector = document.getElementById('zotero-tag-selector');
var showing = tagSelector.getAttribute('collapsed') == 'true';
tagSelector.setAttribute('collapsed', !showing);
- splitter.setAttribute('collapsed', !showing);
this.updateTagSelectorSize();
// If showing, set scope to items in current view
@@ -1669,21 +1667,20 @@ var ZoteroPane = new function()
showInLibrary: 0,
sep1: 1,
addNote: 2,
- attachSnapshot: 3,
- attachLink: 4,
- sep2: 5,
- duplicateItem: 6,
- deleteItem: 7,
- deleteFromLibrary: 8,
- sep3: 9,
- exportItems: 10,
- createBib: 11,
- loadReport: 12,
- sep4: 13,
- createParent: 14,
- recognizePDF: 15,
- renameAttachments: 16,
- reindexItem: 17
+ addAttachments: 3,
+ sep2: 4,
+ duplicateItem: 5,
+ deleteItem: 6,
+ deleteFromLibrary: 7,
+ sep3: 8,
+ exportItems: 9,
+ createBib: 10,
+ loadReport: 11,
+ sep4: 12,
+ createParent: 13,
+ recognizePDF: 14,
+ renameAttachments: 15,
+ reindexItem: 16
};
var menu = document.getElementById('zotero-itemmenu');
@@ -1698,15 +1695,15 @@ var ZoteroPane = new function()
}
else if (this.itemsView && this.itemsView.selection.count > 0) {
- enable.push(m.showInLibrary, m.addNote, m.attachSnapshot, m.attachLink,
+ enable.push(m.showInLibrary, m.addNote, m.addAttachments,
m.sep2, m.duplicateItem, m.deleteItem, m.deleteFromLibrary,
m.exportItems, m.createBib, m.loadReport);
// Multiple items selected
if (this.itemsView.selection.count > 1) {
var multiple = '.multiple';
- hide.push(m.showInLibrary, m.sep1, m.addNote, m.attachSnapshot,
- m.attachLink, m.sep2, m.duplicateItem);
+ hide.push(m.showInLibrary, m.sep1, m.addNote, m.addAttachments,
+ m.sep2, m.duplicateItem);
// If all items can be reindexed, or all items can be recognized, show option
var items = this.getSelectedItems();
@@ -1797,11 +1794,11 @@ var ZoteroPane = new function()
if (item.isRegularItem())
{
- show.push(m.addNote, m.attachSnapshot, m.attachLink, m.sep2);
+ show.push(m.addNote, m.addAttachments, m.sep2);
}
else
{
- hide.push(m.addNote, m.attachSnapshot, m.attachLink, m.sep2);
+ hide.push(m.addNote, m.addAttachments, m.sep2);
}
if (item.isAttachment()) {
@@ -1878,7 +1875,7 @@ var ZoteroPane = new function()
disable.push(m.showInLibrary, m.duplicateItem, m.deleteItem,
m.deleteFromLibrary, m.exportItems, m.createBib, m.loadReport);
- hide.push(m.addNote, m.attachSnapshot, m.attachLink, m.sep2, m.sep4, m.reindexItem,
+ hide.push(m.addNote, m.addAttachments, m.sep2, m.sep4, m.reindexItem,
m.createParent, m.recognizePDF, m.renameAttachments);
}
@@ -2274,6 +2271,7 @@ var ZoteroPane = new function()
}
}
+
function addTextToNote(text)
{
if (!this.canEdit()) {
diff --git a/chrome/content/zotero/overlay.xul b/chrome/content/zotero/overlay.xul
index 2e151ead9..8f6e29ebe 100644
--- a/chrome/content/zotero/overlay.xul
+++ b/chrome/content/zotero/overlay.xul
@@ -96,9 +96,17 @@