From 58235c6bf6b719eb3759d43248a4147601bc35f4 Mon Sep 17 00:00:00 2001 From: Dan Stillman Date: Thu, 15 Feb 2007 22:16:52 +0000 Subject: [PATCH] Display "(...) " before "Abstract:" when abstract field is cropped I can't find any way to detect if the value is actually cropped with an ellipsis, so the best we can do is not display the ellipsis if the value is blank--if the value is shorter than the crop width but not empty, the ellipsis will still display. --- chrome/content/zotero/itemPane.js | 18 +++++++++++++++++- 1 file changed, 17 insertions(+), 1 deletion(-) diff --git a/chrome/content/zotero/itemPane.js b/chrome/content/zotero/itemPane.js index 7e70f8d8d0..f7d73e8edc 100644 --- a/chrome/content/zotero/itemPane.js +++ b/chrome/content/zotero/itemPane.js @@ -303,7 +303,16 @@ var ZoteroItemPane = new function() var label = document.createElement("label"); label.setAttribute('fieldname', fieldNames[i]); - label.setAttribute("value", Zotero.ItemFields.getLocalizedString(_itemBeingEdited.getType(), fieldNames[i]) + ":"); + + var prefix = ''; + // Add '(...)' before 'Abstract:' for collapsed abstracts + if (fieldNames[i] == 'abstract') { + if (val && !Zotero.Prefs.get('lastAbstractExpand')) { + prefix = '(...) '; + } + } + label.setAttribute("value", prefix + + Zotero.ItemFields.getLocalizedString(_itemBeingEdited.getType(), fieldNames[i]) + ":"); if (fieldNames[i] == 'url' && val) { label.setAttribute("isButton", true); @@ -835,6 +844,13 @@ var ZoteroItemPane = new function() var tabindex = ab.getAttribute('ztabindex'); var elem = createValueElement(valueText, 'abstract', tabindex); ab.parentNode.replaceChild(elem, ab); + + var text = Zotero.ItemFields.getLocalizedString(_itemBeingEdited.getType(), 'abstract') + ':'; + // Add '(...)' before "Abstract:" for collapsed abstracts + if (valueText && cur) { + text = '(...) ' + text; + } + label.setAttribute('value', text); }