From 2487f74f8ce873dd4bc019f71eae1bfe6284671a Mon Sep 17 00:00:00 2001 From: Simon Kornblith Date: Sun, 13 Feb 2011 06:47:33 +0000 Subject: [PATCH] merge r8103-8124 to 2.1 branch --- .../zotero-platform/mac/attachmentbox.css | 5 - .../content/zotero-platform/mac/itembox.css | 5 + .../zotero-platform/mac/noteeditor.css | 5 - .../content/zotero-platform/mac/overlay.css | 67 +-- chrome/content/zotero-platform/mac/tab.css | 4 + .../content/zotero/bindings/attachmentbox.xml | 20 +- chrome/content/zotero/bindings/itembox.xml | 49 +- chrome/content/zotero/bindings/noteeditor.xml | 13 +- chrome/content/zotero/locateMenu.js | 62 +-- chrome/content/zotero/overlay.xul | 2 + chrome/content/zotero/standalone.xul | 1 - chrome/content/zotero/tab.xul | 2 + chrome/content/zotero/tinymce/note.html | 7 + chrome/content/zotero/tinymce/noteview.html | 5 + chrome/content/zotero/xpcom/cite.js | 4 +- chrome/content/zotero/xpcom/citeproc.js | 5 +- chrome/content/zotero/zoteroPane.js | 25 +- chrome/content/zotero/zoteroPane.xul | 507 +++++++++--------- chrome/locale/en-US/zotero/zotero.properties | 2 +- .../default/zotero/bindings/attachmentbox.css | 55 +- .../skin/default/zotero/bindings/itembox.css | 31 +- .../default/zotero/bindings/noteeditor.css | 42 +- .../default/zotero/bindings/tagselector.css | 4 +- chrome/skin/default/zotero/overlay.css | 5 +- chrome/skin/default/zotero/tab.css | 3 + chrome/skin/default/zotero/zotero.css | 4 + 26 files changed, 518 insertions(+), 416 deletions(-) create mode 100644 chrome/content/zotero-platform/mac/tab.css create mode 100644 chrome/skin/default/zotero/tab.css diff --git a/chrome/content/zotero-platform/mac/attachmentbox.css b/chrome/content/zotero-platform/mac/attachmentbox.css index 6206fe8397..2bd0977f95 100644 --- a/chrome/content/zotero-platform/mac/attachmentbox.css +++ b/chrome/content/zotero-platform/mac/attachmentbox.css @@ -1,9 +1,4 @@ row > label:first-child { color: #7f7f7f; -} - -*[zoteroFontSize=small] #attachment-box -{ - font-size: 10px; } \ No newline at end of file diff --git a/chrome/content/zotero-platform/mac/itembox.css b/chrome/content/zotero-platform/mac/itembox.css index ca726d93eb..ec8c9d9d3b 100644 --- a/chrome/content/zotero-platform/mac/itembox.css +++ b/chrome/content/zotero-platform/mac/itembox.css @@ -1,3 +1,8 @@ +scrollbox +{ + padding-top: 3px; +} + row > label:first-child, .creator-type-label { color: #7f7f7f; diff --git a/chrome/content/zotero-platform/mac/noteeditor.css b/chrome/content/zotero-platform/mac/noteeditor.css index 9c23d1e91b..2bd0977f95 100644 --- a/chrome/content/zotero-platform/mac/noteeditor.css +++ b/chrome/content/zotero-platform/mac/noteeditor.css @@ -1,9 +1,4 @@ row > label:first-child { color: #7f7f7f; -} - -*[zoteroFontSize=small] #note-editor -{ - font-size: 10px; } \ No newline at end of file diff --git a/chrome/content/zotero-platform/mac/overlay.css b/chrome/content/zotero-platform/mac/overlay.css index 5d6842ec77..0599dd20e5 100644 --- a/chrome/content/zotero-platform/mac/overlay.css +++ b/chrome/content/zotero-platform/mac/overlay.css @@ -12,14 +12,6 @@ background-image: none; } -#zotero-pane .toolbar { - /* This will be ignored on FF <3.5 */ - -moz-appearance: -moz-mac-unified-toolbar; - /* This will be ignored on FF >=3.5 */ - background: url("chrome://zotero/skin/mac/toolbar-background.png") left center repeat-x; - margin-left: -1px; -} - #zotero-items-toolbar[state=collapsed] { margin-left: -8px !important; @@ -104,7 +96,6 @@ #zotero-view-tabbox { background-color: #fff; padding: 0; - margin: 0; } #zotero-item-pane-content .groupbox-body { @@ -116,13 +107,9 @@ color: #7f7f7f; } -#zotero-view-tabbox > tabpanels { - margin: 0; - padding: 0; -} - #zotero-view-tabbox > tabpanels { margin: 12px 0 0 0; + padding: 0; -moz-appearance: none; } @@ -183,12 +170,12 @@ } /* Since Fx < 4 doesn't recognize the -moz-window-inactive pseudoclass as valid, these have to be separate (duplicate) rules to be parsed */ -:root:not([active]) #zotero-pane:not([isFx4]) > #zotero-item-pane > #zotero-item-pane-content > #zotero-view-tabbox > tabs > * { +:root:not([active]) #zotero-pane:not([ignoreActiveAttribute]) > #zotero-item-pane > #zotero-item-pane-content > #zotero-view-tabbox > tabs > * { color: #7C7C7C !important; -moz-border-image: url("chrome://zotero/skin/mac/viewbutton-middle-inactive.png") 0 4 0 5 repeat stretch; } -:root:not([active]) #zotero-pane:not([isFx4]) > #zotero-item-pane > #zotero-item-pane-content > #zotero-view-tabbox > tabs > tab[selected=true] { +:root:not([active]) #zotero-pane:not([ignoreActiveAttribute]) > #zotero-item-pane > #zotero-item-pane-content > #zotero-view-tabbox > tabs > tab[selected=true] { color: #C5C5C5 !important; -moz-border-image: url("chrome://zotero/skin/mac/viewbutton-middle-selected-inactive.png") 0 4 0 5 repeat stretch; } @@ -231,10 +218,10 @@ /* Since Fx4 doesn't recognize the -moz-window-inactive pseudoclass as valid, these have to be separate (duplicate) rules to be parsed */ -:root:not([active]) #zotero-pane:not([isFx4]) #zotero-view-tabbox > tabs > :first-child, -:root:not([active]) #zotero-pane:not([isFx4]) #zotero-view-tabbox > tabs > [first-visible], -:root:not([active]) #zotero-pane:not([isFx4]) #zotero-view-tabbox > tabs[chromedir=rtl] > :last-child, -:root:not([active]) #zotero-pane:not([isFx4]) #zotero-view-tabbox > tabs[chromedir=rtl] > [last-visible] { +:root:not([active]) #zotero-pane:not([ignoreActiveAttribute]) #zotero-view-tabbox > tabs > :first-child, +:root:not([active]) #zotero-pane:not([ignoreActiveAttribute]) #zotero-view-tabbox > tabs > [first-visible], +:root:not([active]) #zotero-pane:not([ignoreActiveAttribute]) #zotero-view-tabbox > tabs[chromedir=rtl] > :last-child, +:root:not([active]) #zotero-pane:not([ignoreActiveAttribute]) #zotero-view-tabbox > tabs[chromedir=rtl] > [last-visible] { -moz-border-image: url("chrome://zotero/skin/mac/viewbutton-left-inactive.png") 0 4 0 6 repeat stretch; } @@ -245,10 +232,10 @@ -moz-border-image: url("chrome://zotero/skin/mac/viewbutton-left-selected-inactive.png") 0 4 0 6 repeat stretch; } -:root:not([active]) #zotero-pane:not([isFx4]) #zotero-view-tabbox > tabs > tab:first-child[selected=true], -:root:not([active]) #zotero-pane:not([isFx4]) #zotero-view-tabbox > tabs > tab[first-visible][selected=true], -:root:not([active]) #zotero-pane:not([isFx4]) #zotero-view-tabbox > tabs[chromedir=rtl] > tab:last-child[selected=true], -:root:not([active]) #zotero-pane:not([isFx4]) #zotero-view-tabbox > tabs[chromedir=rtl] > tab[last-visible][selected=true] { +:root:not([active]) #zotero-pane:not([ignoreActiveAttribute]) #zotero-view-tabbox > tabs > tab:first-child[selected=true], +:root:not([active]) #zotero-pane:not([ignoreActiveAttribute]) #zotero-view-tabbox > tabs > tab[first-visible][selected=true], +:root:not([active]) #zotero-pane:not([ignoreActiveAttribute]) #zotero-view-tabbox > tabs[chromedir=rtl] > tab:last-child[selected=true], +:root:not([active]) #zotero-pane:not([ignoreActiveAttribute]) #zotero-view-tabbox > tabs[chromedir=rtl] > tab[last-visible][selected=true] { -moz-border-image: url("chrome://zotero/skin/mac/viewbutton-left-selected-inactive.png") 0 4 0 6 repeat stretch; } @@ -288,10 +275,10 @@ -moz-border-image: url("chrome://zotero/skin/mac/viewbutton-right-inactive.png") 0 6 0 5 repeat stretch; } -:root:not([active]) #zotero-pane:not([isFx4]) #zotero-view-tabbox > tabs > :last-child, -:root:not([active]) #zotero-pane:not([isFx4]) #zotero-view-tabbox > tabs > [last-visible], -:root:not([active]) #zotero-pane:not([isFx4]) #zotero-view-tabbox > tabs[chromedir=rtl] > :first-child, -:root:not([active]) #zotero-pane:not([isFx4]) #zotero-view-tabbox > tabs[chromedir=rtl] > [first-visible] { +:root:not([active]) #zotero-pane:not([ignoreActiveAttribute]) #zotero-view-tabbox > tabs > :last-child, +:root:not([active]) #zotero-pane:not([ignoreActiveAttribute]) #zotero-view-tabbox > tabs > [last-visible], +:root:not([active]) #zotero-pane:not([ignoreActiveAttribute]) #zotero-view-tabbox > tabs[chromedir=rtl] > :first-child, +:root:not([active]) #zotero-pane:not([ignoreActiveAttribute]) #zotero-view-tabbox > tabs[chromedir=rtl] > [first-visible] { -moz-border-image: url("chrome://zotero/skin/mac/viewbutton-right-inactive.png") 0 6 0 5 repeat stretch; } @@ -301,10 +288,10 @@ #zotero-view-tabbox:-moz-window-inactive > tabs[chromedir=rtl] > tab[first-visible][selected=true] { -moz-border-image: url("chrome://zotero/skin/mac/viewbutton-right-selected-inactive.png") 0 6 0 5 repeat stretch; } -:root:not([active]) #zotero-pane:not([isFx4]) #zotero-view-tabbox > tabs > tab:last-child[selected=true], -:root:not([active]) #zotero-pane:not([isFx4]) #zotero-view-tabbox > tabs > tab[last-visible][selected=true], -:root:not([active]) #zotero-pane:not([isFx4]) #zotero-view-tabbox > tabs[chromedir=rtl] > tab:first-child[selected=true], -:root:not([active]) #zotero-pane:not([isFx4]) #zotero-view-tabbox > tabs[chromedir=rtl] > tab[first-visible][selected=true] { +:root:not([active]) #zotero-pane:not([ignoreActiveAttribute]) #zotero-view-tabbox > tabs > tab:last-child[selected=true], +:root:not([active]) #zotero-pane:not([ignoreActiveAttribute]) #zotero-view-tabbox > tabs > tab[last-visible][selected=true], +:root:not([active]) #zotero-pane:not([ignoreActiveAttribute]) #zotero-view-tabbox > tabs[chromedir=rtl] > tab:first-child[selected=true], +:root:not([active]) #zotero-pane:not([ignoreActiveAttribute]) #zotero-view-tabbox > tabs[chromedir=rtl] > tab[first-visible][selected=true] { -moz-border-image: url("chrome://zotero/skin/mac/viewbutton-right-selected-inactive.png") 0 6 0 5 repeat stretch; } @@ -321,7 +308,7 @@ background-color: rgb(232, 232, 232); } -:root:not([active]) #zotero-pane:not([isFx4]) #zotero-collections-tree { +:root:not([active]) #zotero-pane:not([ignoreActiveAttribute]) #zotero-collections-tree { background-color: rgb(232, 232, 232); } @@ -450,22 +437,12 @@ treechilren::-moz-tree-twisty(active) { } */ -#zotero-pane:not(:-moz-window-inactive) treechildren::-moz-tree-twisty(selected) { +tree:focus treechildren::-moz-tree-twisty(selected) { -moz-appearance: none; list-style-image: url("chrome://zotero/skin/mac/twisty-selected.png"); } -:root[active] treechildren::-moz-tree-twisty(selected) { - -moz-appearance: none; - list-style-image: url("chrome://zotero/skin/mac/twisty-selected.png"); -} - -#zotero-pane:not(:-moz-window-inactive) treechildren::-moz-tree-twisty(selected, open) { - -moz-appearance: none; - list-style-image: url("chrome://zotero/skin/mac/twisty-selected-open.png"); -} - -:root[active] treechildren::-moz-tree-twisty(selected, open) { +tree:focus treechildren::-moz-tree-twisty(selected, open) { -moz-appearance: none; list-style-image: url("chrome://zotero/skin/mac/twisty-selected-open.png"); } diff --git a/chrome/content/zotero-platform/mac/tab.css b/chrome/content/zotero-platform/mac/tab.css new file mode 100644 index 0000000000..9d6de9b3a6 --- /dev/null +++ b/chrome/content/zotero-platform/mac/tab.css @@ -0,0 +1,4 @@ +#zotero-toolbar { + -moz-appearance: none !important; + background: url("chrome://zotero/skin/mac/toolbar-background.png") left center repeat-x; +} \ No newline at end of file diff --git a/chrome/content/zotero/bindings/attachmentbox.xml b/chrome/content/zotero/bindings/attachmentbox.xml index b952541611..ae01fca88a 100644 --- a/chrome/content/zotero/bindings/attachmentbox.xml +++ b/chrome/content/zotero/bindings/attachmentbox.xml @@ -187,13 +187,6 @@ // Metadata for URL's if (this.item.attachmentLinkMode == Zotero.Attachments.LINK_MODE_LINKED_URL || isImportedURL) { - // "View Page"/"View Snapshot" label - if (isImportedURL) { - var str = Zotero.getString('pane.item.attachments.view.snapshot'); - } - else { - var str = Zotero.getString('pane.item.attachments.view.link'); - } // URL if (this.displayURL) { @@ -217,7 +210,7 @@ // Access date if (this.displayAccessed) { - this._id("accessed-label").value = Zotero.getString('itemFields.accessDate')+": "; + this._id("accessed-label").value = Zotero.getString('itemFields.accessDate')+":"; this._id("accessed").value = Zotero.Date.sqlToDate( this.item.getField('accessDate'), true ).toLocaleString(); @@ -229,7 +222,6 @@ } // Metadata for files else { - var str = Zotero.getString('pane.item.attachments.view.file'); urlField.hidden = true; accessed.hidden = true; } @@ -242,7 +234,7 @@ if (fileName) { // TODO: localize - this._id("fileName-label").value = "Filename: "; + this._id("fileName-label").value = "Filename:"; this._id("fileName").value = fileName; fileNameRow.hidden = false; } @@ -260,7 +252,7 @@ var pages = pages ? pages.total : null; if (pages) { // TODO: localize colon - this._id("pages-label").value = Zotero.getString('itemFields.pages') + ': '; + this._id("pages-label").value = Zotero.getString('itemFields.pages') + ':'; this._id("pages").value = pages; pagesRow.hidden = false; } @@ -273,7 +265,7 @@ } if (this.displayDateModified) { - this._id("dateModified-label").value = Zotero.getString('itemFields.dateModified')+': '; + this._id("dateModified-label").value = Zotero.getString('itemFields.dateModified')+':'; var mtime = this.item.attachmentModificationTime; if (mtime) { this._id("dateModified").value = new Date(mtime).toLocaleString(); @@ -304,6 +296,8 @@ var noteEditor = this._id('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) @@ -478,7 +472,7 @@ str = 'general.yes'; break; } - this._id("index-status-label").value = Zotero.getString('fulltext.indexState.indexed') + ': '; + this._id("index-status-label").value = Zotero.getString('fulltext.indexState.indexed') + ':'; indexStatus.value = Zotero.getString(str); // Reindex button tooltip (string stored in zotero.properties) diff --git a/chrome/content/zotero/bindings/itembox.xml b/chrome/content/zotero/bindings/itembox.xml index 35fcce1b47..e28f0a438f 100644 --- a/chrome/content/zotero/bindings/itembox.xml +++ b/chrome/content/zotero/bindings/itembox.xml @@ -706,12 +706,12 @@ label.setAttribute("fieldname", field); label.setAttribute("onclick", "this.nextSibling.firstChild.blur()"); - var hbox = document.createElement("hbox"); var elem = this.createValueElement( Zotero.Date.multipartToStr(value), field, tabindex ); + elem.setAttribute('flex', 1); // y-m-d status indicator var datebox = document.createElement('hbox'); @@ -735,6 +735,7 @@ var hbox = document.createElement('hbox'); hbox.setAttribute('flex', 1); + hbox.className = "date-box"; hbox.appendChild(elem); hbox.appendChild(datebox); @@ -765,6 +766,8 @@ lastName.setAttribute('fieldMode', '1'); button.setAttribute('onclick', "document.getBindingParent(this).switchCreatorMode(Zotero.getAncestorByTagName(this, 'row'), 0)"); lastName.setAttribute('flex', '1'); + delete lastName.style.width; + delete lastName.style.maxWidth; // Remove firstname field from tabindex var tab = parseInt(firstName.getAttribute('ztabindex')); @@ -797,6 +800,34 @@ button.setAttribute('onclick', "document.getBindingParent(this).switchCreatorMode(Zotero.getAncestorByTagName(this, 'row'), 1)"); lastName.setAttribute('flex', '0'); + // appropriately truncate lastName + + // get item box width + var computedStyle = window.getComputedStyle(this, null); + var boxWidth = computedStyle.getPropertyValue('width'); + // get field label width + var computedStyle = window.getComputedStyle(row.firstChild, null); + var leftHboxWidth = computedStyle.getPropertyValue('width'); + // get last name width + computedStyle = window.getComputedStyle(lastName, null); + var lastNameWidth = computedStyle.getPropertyValue('width'); + if(boxWidth.substr(-2) === 'px' + && leftHboxWidth.substr(-2) === 'px' + && lastNameWidth.substr(-2) === "px") { + // compute a maximum width + boxWidth = parseInt(boxWidth); + leftHboxWidth = parseInt(leftHboxWidth); + lastNameWidth = parseInt(lastNameWidth); + var maxWidth = boxWidth-leftHboxWidth-140; + if(lastNameWidth > maxWidth) { + lastName.style.width = maxWidth+"px"; + lastName.style.maxWidth = maxWidth+"px"; + } else { + delete lastName.style.width; + delete lastName.style.maxWidth; + } + } + // Add firstname field to tabindex var tab = parseInt(lastName.getAttribute('ztabindex')); firstName.setAttribute('ztabindex', tab + 1); @@ -865,9 +896,6 @@ + + + + + + @@ -368,7 +379,7 @@ - +