www

Unnamed repository; edit this file 'description' to name the repository.
Log | Files | Refs | Submodules | README | LICENSE

commit eb42152c420c3c8017c5be97105ffe21949a76aa
parent be7cc45c0ecc38c4b129d42e40c228d8c0b96bea
Author: Dan Stillman <dstillman@zotero.org>
Date:   Fri, 12 May 2017 19:59:27 -0400

UI fixes for read-only notes

- Don't show toolbar in read-only note editor
- Get rid of "undefined" button in CR window
- Better padding/alignment in CR window

Diffstat:
Mchrome/content/zotero/bindings/attachmentbox.xml | 101++++++++++++++++++++++++++++++++++++++-----------------------------------------
Mchrome/content/zotero/bindings/merge.xml | 8++++----
Mchrome/skin/default/zotero/bindings/attachmentbox.css | 12++++++------
Mchrome/skin/default/zotero/merge.css | 8++++++++
Mresource/tinymce/css/note-ui.css | 9+++++++++
Mresource/tinymce/noteview.html | 6+++++-
6 files changed, 81 insertions(+), 63 deletions(-)

diff --git a/chrome/content/zotero/bindings/attachmentbox.xml b/chrome/content/zotero/bindings/attachmentbox.xml @@ -99,7 +99,6 @@ this.displayFileName = true; this.displayAccessed = true; this.displayNote = true; - this.displayButton = true; this.displayDateModified = true; break; @@ -346,28 +345,24 @@ // Note editor var noteEditor = this._id('attachment-note-editor'); - if (this.displayNote) { - if (this.displayNoteIfEmpty || this.item.getNote() != '') { - Zotero.debug("setting links on top"); - noteEditor.linksOnTop = true; - noteEditor.hidden = false; - - // Don't make note editable (at least for now) - if (this.mode == 'merge' || this.mode == 'mergeedit') { - noteEditor.mode = 'merge'; - noteEditor.displayButton = false; - } - else { - noteEditor.mode = this.mode; - } - noteEditor.parent = null; - noteEditor.item = this.item; + if (this.displayNote && (this.displayNoteIfEmpty || this.item.getNote() != '')) { + noteEditor.linksOnTop = true; + noteEditor.hidden = false; + + // Don't make note editable (at least for now) + if (this.mode == 'merge' || this.mode == 'mergeedit') { + noteEditor.mode = 'merge'; + noteEditor.displayButton = false; + } + else { + noteEditor.mode = this.mode; } + noteEditor.parent = null; + noteEditor.item = this.item; } else { noteEditor.hidden = true; } - if (this.displayButton) { selectButton.label = this.buttonCaption; @@ -572,40 +567,42 @@ <content> <vbox id="attachment-box" flex="1" orient="vertical" xmlns="http://www.mozilla.org/keymaster/gatekeeper/there.is.only.xul"> - <label id="title"/> - <label id="url" crop="end" - ondragstart="var dt = event.dataTransfer; dt.setData('text/x-moz-url', this.value); dt.setData('text/uri-list', this.value); dt.setData('text/plain', this.value);"/> - <grid> - <columns> - <column/> - <column flex="1"/> - </columns> - <rows> - <row id="fileNameRow"> - <label id="fileName-label"/> - <label id="fileName" crop="end"/> - </row> - <row id="accessedRow"> - <label id="accessed-label"/> - <label id="accessed"/> - </row> - <row id="pagesRow"> - <label id="pages-label"/> - <label id="pages"/> - </row> - <row id="dateModifiedRow" hidden="true"> - <label id="dateModified-label"/> - <label id="dateModified"/> - </row> - <row id="indexStatusRow"> - <label id="index-status-label"/> - <hbox> - <label id="index-status"/> - <image id="reindex" onclick="this.hidden = true; setTimeout(function () { ZoteroPane_Local.reindexItem(); }, 50)"/> - </hbox> - </row> - </rows> - </grid> + <vbox id="metadata"> + <label id="title"/> + <label id="url" crop="end" + ondragstart="var dt = event.dataTransfer; dt.setData('text/x-moz-url', this.value); dt.setData('text/uri-list', this.value); dt.setData('text/plain', this.value);"/> + <grid> + <columns> + <column/> + <column flex="1"/> + </columns> + <rows> + <row id="fileNameRow"> + <label id="fileName-label"/> + <label id="fileName" crop="end"/> + </row> + <row id="accessedRow"> + <label id="accessed-label"/> + <label id="accessed"/> + </row> + <row id="pagesRow"> + <label id="pages-label"/> + <label id="pages"/> + </row> + <row id="dateModifiedRow" hidden="true"> + <label id="dateModified-label"/> + <label id="dateModified"/> + </row> + <row id="indexStatusRow"> + <label id="index-status-label"/> + <hbox> + <label id="index-status"/> + <image id="reindex" onclick="this.hidden = true; setTimeout(function () { ZoteroPane_Local.reindexItem(); }, 50)"/> + </hbox> + </row> + </rows> + </grid> + </vbox> <zoteronoteeditor id="attachment-note-editor" notitle="1" flex="1"/> diff --git a/chrome/content/zotero/bindings/merge.xml b/chrome/content/zotero/bindings/merge.xml @@ -308,13 +308,13 @@ this._data = val; var button = this._id('choose-button'); + button.label = Zotero.getString('sync.conflict.chooseThisVersion'); if (this.showButton) { - button.label = Zotero.getString('sync.conflict.chooseThisVersion'); button.onclick = () => this.parent.choosePane(this); - button.hidden = false; + button.style.visibility = 'visible'; } else { - button.hidden = true; + button.style.visibility = 'hidden'; } if (val.deleted) { @@ -418,7 +418,7 @@ <xul:label value="&zotero.merge.deleted;"/> </xul:hbox> </xul:groupbox> - <xul:button anonid="choose-button" hidden="true"/> + <xul:button anonid="choose-button"/> </xul:vbox> </content> </binding> diff --git a/chrome/skin/default/zotero/bindings/attachmentbox.css b/chrome/skin/default/zotero/bindings/attachmentbox.css @@ -1,16 +1,16 @@ +#metadata { + padding: 5px 2px 2px 2px; +} + #title { font-weight: bold; - margin: 4px 5px 1px 5px !important; - padding: 0 2px 0 2px; /* Don't collapse blank attachment titles, since it prevents renaming */ min-height: 1.25em; } -#url -{ - margin: 1px 5px 2px 5px !important; - padding: 0 2px 0 2px !important; +#metadata > label { + margin: 6px 10px 4px !important; } #index-box diff --git a/chrome/skin/default/zotero/merge.css b/chrome/skin/default/zotero/merge.css @@ -74,6 +74,10 @@ zoteromergepane *[anonid="delete-box"] { -moz-box-pack: center; } +zoteromergepane .groupbox-body { + padding: 0; +} + zoteromergepane[selected=true] groupbox caption { color: red; font-weight: bold; @@ -96,3 +100,7 @@ zoteromergepane div[anonid=parent-row] { zoteromergepane div[anonid=parent-row] span { font-weight: bold; } + +zoteromergepane zoteronoteeditor { + margin: 10px 0 0; +} diff --git a/resource/tinymce/css/note-ui.css b/resource/tinymce/css/note-ui.css @@ -24,6 +24,15 @@ html, body { right: 0; } +/* Adjustments for read-only mode */ +.mce-container.readonly .mce-container-body .mce-edit-area { + top: 0; +} + +.mce-container.readonly .mce-panel { + border: 0; +} + /* Shrink the buttons a bit */ .mce-btn-small button { padding-left: 3px !important; diff --git a/resource/tinymce/noteview.html b/resource/tinymce/noteview.html @@ -11,15 +11,19 @@ content_css: "css/note-content.css", entity_encoding: "raw", fix_list_elements: true, - readonly: true, + toolbar: false, menubar: false, resize: false, statusbar: false, init_instance_callback: function (ed) { + ed.setMode('readonly'); + setLocale(ed); zoteroInit(ed); + + ed.getContainer().classList.add('readonly'); }, // More restrictive version of default set, with JS/etc. removed