diff --git a/chrome/content/zotero/bindings/tagsbox.xml b/chrome/content/zotero/bindings/tagsbox.xml index 49ad462d0..fc0e8d51a 100644 --- a/chrome/content/zotero/bindings/tagsbox.xml +++ b/chrome/content/zotero/bindings/tagsbox.xml @@ -28,16 +28,49 @@ xmlns:xul="http://www.mozilla.org/keymaster/gatekeeper/there.is.only.xul"> - - + + + + "view" + + + + + + + + + + + + + + + @@ -95,11 +133,11 @@ + + + + + + + 29 ) || firstSpace > 29) { + valueElement.setAttribute('crop', 'end'); + valueElement.setAttribute('value',valueText); + } + else { + // Wrap to multiple lines + valueElement.appendChild(document.createTextNode(valueText)); + } + + return valueElement; + ]]> + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + @@ -196,6 +515,8 @@ ]]> + + @@ -204,6 +525,8 @@ ]]> + + @@ -235,14 +558,8 @@ ]]> - - - - - - + + + + - + + + + + + + + + + + + + + + + + + + + + + + diff --git a/chrome/content/zotero/bindings/tagselector.xml b/chrome/content/zotero/bindings/tagselector.xml index 0f736b9c0..9e2f33559 100644 --- a/chrome/content/zotero/bindings/tagselector.xml +++ b/chrome/content/zotero/bindings/tagselector.xml @@ -181,7 +181,7 @@ for (var tagID in this._tags) { // If the last tag was the same, add this tagID and tagType to it if (tagsToggleBox.lastChild && - tagsToggleBox.lastChild.getAttribute('value') == this._tags[tagID].tag) { + tagsToggleBox.lastChild.getAttribute('value') == this._tags[tagID].name) { tagsToggleBox.lastChild.setAttribute('tagID', tagsToggleBox.lastChild.getAttribute('tagID') + '-' + tagID); tagsToggleBox.lastChild.setAttribute('tagType', tagsToggleBox.lastChild.getAttribute('tagType') + '-' + this._tags[tagID].type); continue; @@ -190,7 +190,7 @@ var label = document.createElement('label'); label.setAttribute('onclick', "this.parentNode.parentNode.parentNode.handleTagClick(event, this)"); label.className = 'zotero-clicky'; - label.setAttribute('value', this._tags[tagID].tag); + label.setAttribute('value', this._tags[tagID].name); label.setAttribute('tagID', tagID); label.setAttribute('tagType', this._tags[tagID].type); label.setAttribute('context', 'tag-menu'); diff --git a/chrome/content/zotero/itemPane.js b/chrome/content/zotero/itemPane.js index c90a0b966..63807c6f4 100644 --- a/chrome/content/zotero/itemPane.js +++ b/chrome/content/zotero/itemPane.js @@ -120,16 +120,15 @@ var ZoteroItemPane = new function() { // Info pane if (index == 0) { - var itembox = document.getElementById('zotero-editpane-item-box'); // Hack to allow read-only mode in right pane -- probably a better // way to allow access to this if (mode) { - itembox.mode = mode; + _itemBox.mode = mode; } else { - itembox.mode = 'edit'; + _itemBox.mode = 'edit'; } - itembox.item = _itemBeingEdited; + _itemBox.item = _itemBeingEdited; } // Notes pane @@ -147,7 +146,9 @@ var ZoteroItemPane = new function() { icon.setAttribute('src','chrome://zotero/skin/treeitem-note.png'); var label = document.createElement('label'); - label.setAttribute('value',_noteToTitle(notes[i].getNote())); + 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'); @@ -236,6 +237,13 @@ var ZoteroItemPane = new function() { // Tags pane else if(index == 3) { + if (mode) { + _tagsBox.mode = mode; + } + else { + _tagsBox.mode = 'edit'; + } + var focusMode = 'tags'; var focusBox = _tagsBox; _tagsBox.item = _itemBeingEdited; @@ -269,27 +277,6 @@ var ZoteroItemPane = new function() { ZoteroPane.openNoteWindow(null, null, _itemBeingEdited.id); } - function _noteToTitle(text) - { - var MAX_LENGTH = 100; - - var t = text.substring(0, MAX_LENGTH); - var ln = t.indexOf("\n"); - if (ln>-1 && ln +