diff --git a/chrome/content/zotero-platform/mac/overlay.css b/chrome/content/zotero-platform/mac/overlay.css index 10bd317a40..ba5a5ae53c 100644 --- a/chrome/content/zotero-platform/mac/overlay.css +++ b/chrome/content/zotero-platform/mac/overlay.css @@ -246,7 +246,7 @@ background-color: #ffffff; } -#zotero-item-pane-message { +#zotero-item-pane-message-box description { color: #7f7f7f; } diff --git a/chrome/content/zotero/itemPane.xul b/chrome/content/zotero/itemPane.xul index 2176e7ebc1..70f89167e9 100644 --- a/chrome/content/zotero/itemPane.xul +++ b/chrome/content/zotero/itemPane.xul @@ -47,7 +47,7 @@ - diff --git a/chrome/content/zotero/xpcom/itemTreeView.js b/chrome/content/zotero/xpcom/itemTreeView.js index 012f5c2f25..2c73a8df4f 100644 --- a/chrome/content/zotero/xpcom/itemTreeView.js +++ b/chrome/content/zotero/xpcom/itemTreeView.js @@ -234,10 +234,38 @@ Zotero.ItemTreeView.prototype.setTree = Zotero.Promise.coroutine(function* (tree this.expandMatchParents(); if (this._ownerDocument.defaultView.ZoteroPane_Local) { - this._ownerDocument.defaultView.ZoteroPane_Local.clearItemsPaneMessage(); + // For My Publications, show intro text in middle pane if no items + if (this.collectionTreeRow && this.collectionTreeRow.isPublications() && !this.rowCount) { + let doc = this._ownerDocument; + let ns = 'http://www.w3.org/1999/xhtml' + let div = doc.createElementNS(ns, 'div'); + let p = doc.createElementNS(ns, 'p'); + p.textContent = Zotero.getString('publications.intro.text1', ZOTERO_CONFIG.DOMAIN_NAME); + div.appendChild(p); + + p = doc.createElementNS(ns, 'p'); + p.textContent = Zotero.getString('publications.intro.text2'); + div.appendChild(p); + + p = doc.createElementNS(ns, 'p'); + let html = Zotero.getString('publications.intro.text3'); + // Convert tags to placeholders + html = html.replace('', ':b:').replace('', ':/b:'); + // Encode any other special chars, which shouldn't exist + html = Zotero.Utilities.htmlSpecialChars(html); + // Restore bold text + html = html.replace(':b:', '').replace(':/b:', ''); + p.innerHTML = html; // AMO note: markup from hard-coded strings and filtered above + div.appendChild(p); + + content = div; + doc.defaultView.ZoteroPane_Local.setItemsPaneMessage(content); + } + else { + this._ownerDocument.defaultView.ZoteroPane_Local.clearItemsPaneMessage(); + } } - // Select a queued item from selectItem() if (this.collectionTreeRow && this.collectionTreeRow.itemToSelect) { var item = this.collectionTreeRow.itemToSelect; yield this.selectItem(item['id'], item['expand']); diff --git a/chrome/content/zotero/zoteroPane.js b/chrome/content/zotero/zoteroPane.js index feff5a1153..298d7ffac6 100644 --- a/chrome/content/zotero/zoteroPane.js +++ b/chrome/content/zotero/zoteroPane.js @@ -3047,21 +3047,24 @@ var ZoteroPane = new function() } - function setItemsPaneMessage(msg, lock) { + function setItemsPaneMessage(content, lock) { var elem = document.getElementById('zotero-items-pane-message-box'); if (elem.getAttribute('locked') == 'true') { return; } - while (elem.hasChildNodes()) { - elem.removeChild(elem.firstChild); + elem.textContent = ''; + if (typeof content == 'string') { + let contentParts = content.split("\n\n"); + for (let part of contentParts) { + var desc = document.createElement('description'); + desc.appendChild(document.createTextNode(part)); + elem.appendChild(desc); + } } - var msgParts = msg.split("\n\n"); - for (var i=0; iOnly add work you yourself have created, and only include files if you have the rights to distribute them publicly and wish to do so. + publications.sharing.keepRightsField = Keep the existing Rights field publications.sharing.keepRightsFieldWhereAvailable = Keep the existing Rights field where available publications.cc.moreInfo.text = Be sure you have read the Creative Commons %S before placing your work under a CC license. Note that the license you apply cannot be revoked, even if you later choose different terms or cease publishing the work. diff --git a/chrome/skin/default/zotero/itemPane.css b/chrome/skin/default/zotero/itemPane.css index 99a56d8fc6..27edc56603 100644 --- a/chrome/skin/default/zotero/itemPane.css +++ b/chrome/skin/default/zotero/itemPane.css @@ -1,4 +1,4 @@ -#zotero-item-pane-message { +.zotero-item-pane-message-box description { padding: 0 2em; } diff --git a/chrome/skin/default/zotero/overlay.css b/chrome/skin/default/zotero/overlay.css index f5d726c885..7b61d16d46 100644 --- a/chrome/skin/default/zotero/overlay.css +++ b/chrome/skin/default/zotero/overlay.css @@ -226,6 +226,23 @@ min-width: 290px; } +/* Used for intro text for My Publications */ +#zotero-items-pane-message-box { + overflow-y: auto; + cursor: default; +} + +#zotero-items-pane-message-box div { + padding: 0 35px; +} + +#zotero-items-pane-message-box p { + max-width: 800px; + font-size: 1.2em; + line-height: 1.7em; + text-align: left; +} + #zotero-item-pane { width: 338px; diff --git a/test/tests/zoteroPaneTest.js b/test/tests/zoteroPaneTest.js index a86c23df97..135a645e03 100644 --- a/test/tests/zoteroPaneTest.js +++ b/test/tests/zoteroPaneTest.js @@ -76,7 +76,7 @@ describe("ZoteroPane", function() { // Unselected, with no items in view assert.equal( - doc.getElementById('zotero-item-pane-message').value, + doc.getElementById('zotero-item-pane-message-box').textContent, Zotero.getString('pane.item.unselected.zero', 0) ); @@ -87,7 +87,7 @@ describe("ZoteroPane", function() { skipSelect: true }); assert.equal( - doc.getElementById('zotero-item-pane-message').value, + doc.getElementById('zotero-item-pane-message-box').textContent, Zotero.getString('pane.item.unselected.singular', 1) ); @@ -98,7 +98,7 @@ describe("ZoteroPane", function() { skipSelect: true }); assert.equal( - doc.getElementById('zotero-item-pane-message').value, + doc.getElementById('zotero-item-pane-message-box').textContent, Zotero.getString('pane.item.unselected.plural', 2) ); @@ -107,7 +107,7 @@ describe("ZoteroPane", function() { zp.itemsView.rememberSelection([itemID1, itemID2]); yield promise; assert.equal( - doc.getElementById('zotero-item-pane-message').value, + doc.getElementById('zotero-item-pane-message-box').textContent, Zotero.getString('pane.item.selected.multiple', 2) ); })