Renaming 'abstract' field to 'abstractNote' so it's not a reserved word in JS and we don't have to add in special logic for it
(Doesn't have to be 'abstractNote', especially now that abstracts aren't actually notes--other suggestions welcome.)
This commit is contained in:
parent
7a9cc0f935
commit
22dacc2dbc
|
@ -308,7 +308,7 @@ var ZoteroItemPane = new function()
|
||||||
|
|
||||||
var prefix = '';
|
var prefix = '';
|
||||||
// Add '(...)' before 'Abstract:' for collapsed abstracts
|
// Add '(...)' before 'Abstract:' for collapsed abstracts
|
||||||
if (fieldNames[i] == 'abstract') {
|
if (fieldNames[i] == 'abstractNote') {
|
||||||
if (val && !Zotero.Prefs.get('lastAbstractExpand')) {
|
if (val && !Zotero.Prefs.get('lastAbstractExpand')) {
|
||||||
prefix = '(...) ';
|
prefix = '(...) ';
|
||||||
}
|
}
|
||||||
|
@ -321,7 +321,7 @@ var ZoteroItemPane = new function()
|
||||||
label.setAttribute("onclick", "ZoteroPane.loadURI(this.nextSibling.value, event)");
|
label.setAttribute("onclick", "ZoteroPane.loadURI(this.nextSibling.value, event)");
|
||||||
label.setAttribute("tooltiptext", Zotero.getString('pane.item.goToURL.online.tooltip'));
|
label.setAttribute("tooltiptext", Zotero.getString('pane.item.goToURL.online.tooltip'));
|
||||||
}
|
}
|
||||||
else if (fieldNames[i] == 'abstract') {
|
else if (fieldNames[i] == 'abstractNote') {
|
||||||
label.setAttribute("onclick", "if (this.nextSibling.inputField) { this.nextSibling.inputField.blur(); } else { ZoteroItemPane.toggleAbstractExpand(this); }");
|
label.setAttribute("onclick", "if (this.nextSibling.inputField) { this.nextSibling.inputField.blur(); } else { ZoteroItemPane.toggleAbstractExpand(this); }");
|
||||||
}
|
}
|
||||||
else {
|
else {
|
||||||
|
@ -842,12 +842,12 @@ var ZoteroItemPane = new function()
|
||||||
Zotero.Prefs.set('lastAbstractExpand', !cur);
|
Zotero.Prefs.set('lastAbstractExpand', !cur);
|
||||||
|
|
||||||
var ab = label.nextSibling;
|
var ab = label.nextSibling;
|
||||||
var valueText = _itemBeingEdited.getField('abstract');
|
var valueText = _itemBeingEdited.getField('abstractNote');
|
||||||
var tabindex = ab.getAttribute('ztabindex');
|
var tabindex = ab.getAttribute('ztabindex');
|
||||||
var elem = createValueElement(valueText, 'abstract', tabindex);
|
var elem = createValueElement(valueText, 'abstractNote', tabindex);
|
||||||
ab.parentNode.replaceChild(elem, ab);
|
ab.parentNode.replaceChild(elem, ab);
|
||||||
|
|
||||||
var text = Zotero.ItemFields.getLocalizedString(_itemBeingEdited.getType(), 'abstract') + ':';
|
var text = Zotero.ItemFields.getLocalizedString(_itemBeingEdited.getType(), 'abstractNote') + ':';
|
||||||
// Add '(...)' before "Abstract:" for collapsed abstracts
|
// Add '(...)' before "Abstract:" for collapsed abstracts
|
||||||
if (valueText && cur) {
|
if (valueText && cur) {
|
||||||
text = '(...) ' + text;
|
text = '(...) ' + text;
|
||||||
|
@ -871,7 +871,7 @@ var ZoteroItemPane = new function()
|
||||||
|
|
||||||
function createValueElement(valueText, fieldName, tabindex, noedit)
|
function createValueElement(valueText, fieldName, tabindex, noedit)
|
||||||
{
|
{
|
||||||
var abstractAsVbox = (fieldName == 'abstract') &&
|
var abstractAsVbox = (fieldName == 'abstractNote') &&
|
||||||
Zotero.Prefs.get('lastAbstractExpand');
|
Zotero.Prefs.get('lastAbstractExpand');
|
||||||
|
|
||||||
if (fieldName == 'extra' || abstractAsVbox) {
|
if (fieldName == 'extra' || abstractAsVbox) {
|
||||||
|
@ -940,8 +940,8 @@ var ZoteroItemPane = new function()
|
||||||
// 29 == arbitrary length at which to chop uninterrupted text
|
// 29 == arbitrary length at which to chop uninterrupted text
|
||||||
else if ((firstSpace == -1 && valueText.length > 29 ) || firstSpace > 29
|
else if ((firstSpace == -1 && valueText.length > 29 ) || firstSpace > 29
|
||||||
|| (fieldName &&
|
|| (fieldName &&
|
||||||
(fieldName.substr(0, 7) == 'creator') || fieldName == 'abstract')) {
|
(fieldName.substr(0, 7) == 'creator') || fieldName == 'abstractNote')) {
|
||||||
if (fieldName == 'abstract') {
|
if (fieldName == 'abstractNote') {
|
||||||
valueText = valueText.replace(/[\t\n]/g, ' ');
|
valueText = valueText.replace(/[\t\n]/g, ' ');
|
||||||
}
|
}
|
||||||
valueElement.setAttribute('crop', 'end');
|
valueElement.setAttribute('crop', 'end');
|
||||||
|
@ -1025,7 +1025,7 @@ var ZoteroItemPane = new function()
|
||||||
t.setAttribute('singleField', elem.getAttribute('singleField'));
|
t.setAttribute('singleField', elem.getAttribute('singleField'));
|
||||||
}
|
}
|
||||||
|
|
||||||
if (fieldName == 'abstract' || fieldName == 'extra')
|
if (fieldName == 'abstractNote' || fieldName == 'extra')
|
||||||
{
|
{
|
||||||
t.setAttribute('multiline', true);
|
t.setAttribute('multiline', true);
|
||||||
t.setAttribute('rows', 8);
|
t.setAttribute('rows', 8);
|
||||||
|
@ -1144,7 +1144,7 @@ var ZoteroItemPane = new function()
|
||||||
{
|
{
|
||||||
case event.DOM_VK_RETURN:
|
case event.DOM_VK_RETURN:
|
||||||
// Use shift-enter as the save action for the larger fields
|
// Use shift-enter as the save action for the larger fields
|
||||||
if ((target.getAttribute('fieldname') == 'abstract'
|
if ((target.getAttribute('fieldname') == 'abstractNote'
|
||||||
|| target.getAttribute('fieldname') == 'extra')
|
|| target.getAttribute('fieldname') == 'extra')
|
||||||
&& !event.shiftKey)
|
&& !event.shiftKey)
|
||||||
{
|
{
|
||||||
|
|
|
@ -1897,11 +1897,6 @@ Zotero.Item.prototype.clone = function() {
|
||||||
}
|
}
|
||||||
continue;
|
continue;
|
||||||
|
|
||||||
// toArray()'s 'abstractNote' is 'abstract' field
|
|
||||||
case 'abstractNote':
|
|
||||||
newItem.setField('abstract', obj[i]);
|
|
||||||
continue;
|
|
||||||
|
|
||||||
case 'creators':
|
case 'creators':
|
||||||
var i = 0;
|
var i = 0;
|
||||||
for each(var c in obj.creators) {
|
for each(var c in obj.creators) {
|
||||||
|
@ -2131,12 +2126,6 @@ Zotero.Item.prototype.toArray = function(){
|
||||||
arr['itemType'] = Zotero.ItemTypes.getName(this._data[i]);
|
arr['itemType'] = Zotero.ItemTypes.getName(this._data[i]);
|
||||||
break;
|
break;
|
||||||
|
|
||||||
// Since 'abstract' is a reserved word in JS, we use abstractNote
|
|
||||||
// instead so clients can use dot notation
|
|
||||||
case 'abstract':
|
|
||||||
arr['abstractNote'] = this._data[i];
|
|
||||||
continue;
|
|
||||||
|
|
||||||
// Skip certain fields
|
// Skip certain fields
|
||||||
//case 'firstCreator':
|
//case 'firstCreator':
|
||||||
case 'numNotes':
|
case 'numNotes':
|
||||||
|
|
|
@ -1144,8 +1144,6 @@ Zotero.Translate.prototype._itemDone = function(item, attachedTo) {
|
||||||
newItem.setField(field, data);
|
newItem.setField(field, data);
|
||||||
} else if(field == "seeAlso") {
|
} else if(field == "seeAlso") {
|
||||||
newItem.translateSeeAlso = data;
|
newItem.translateSeeAlso = data;
|
||||||
} else if(field == "abstractNote") { // abstractNote is 'abstract' field
|
|
||||||
newItem.setField('abstract', data);
|
|
||||||
} else if(field != "note" && field != "notes" && field != "itemID" &&
|
} else if(field != "note" && field != "notes" && field != "itemID" &&
|
||||||
field != "attachments" && field != "tags" &&
|
field != "attachments" && field != "tags" &&
|
||||||
(fieldID = Zotero.ItemFields.getID(field))) {
|
(fieldID = Zotero.ItemFields.getID(field))) {
|
||||||
|
|
|
@ -211,7 +211,7 @@ itemFields.dictionaryTitle = Dictionary Title
|
||||||
itemFields.language = Language
|
itemFields.language = Language
|
||||||
itemFields.programmingLanguage = Language
|
itemFields.programmingLanguage = Language
|
||||||
itemFields.university = University
|
itemFields.university = University
|
||||||
itemFields.abstract = Abstract
|
itemFields.abstractNote = Abstract
|
||||||
itemFields.websiteTitle = Website Title
|
itemFields.websiteTitle = Website Title
|
||||||
itemFields.reportNumber = Report Number
|
itemFields.reportNumber = Report Number
|
||||||
itemFields.billNumber = Bill Number
|
itemFields.billNumber = Bill Number
|
||||||
|
|
|
@ -71,7 +71,7 @@
|
||||||
margin-left: 0;
|
margin-left: 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
#zotero-editpane-dynamic-fields row vbox[fieldname=abstract],
|
#zotero-editpane-dynamic-fields row vbox[fieldname=abstractNote],
|
||||||
#zotero-editpane-dynamic-fields row vbox[fieldname=extra]
|
#zotero-editpane-dynamic-fields row vbox[fieldname=extra]
|
||||||
{
|
{
|
||||||
margin-top: 1px;
|
margin-top: 1px;
|
||||||
|
|
|
@ -1,4 +1,4 @@
|
||||||
-- 13
|
-- 14
|
||||||
|
|
||||||
-- This file creates system tables that can be safely wiped and reinitialized
|
-- This file creates system tables that can be safely wiped and reinitialized
|
||||||
-- at any time, as long as existing ids are preserved.
|
-- at any time, as long as existing ids are preserved.
|
||||||
|
@ -241,7 +241,7 @@ INSERT INTO fields VALUES (86,'dictionaryTitle',NULL);
|
||||||
INSERT INTO fields VALUES (87,'language',NULL);
|
INSERT INTO fields VALUES (87,'language',NULL);
|
||||||
INSERT INTO fields VALUES (88,'programmingLanguage',NULL);
|
INSERT INTO fields VALUES (88,'programmingLanguage',NULL);
|
||||||
INSERT INTO fields VALUES (89,'university',NULL);
|
INSERT INTO fields VALUES (89,'university',NULL);
|
||||||
INSERT INTO fields VALUES (90,'abstract',NULL);
|
INSERT INTO fields VALUES (90,'abstractNote',NULL);
|
||||||
INSERT INTO fields VALUES (91,'websiteTitle',NULL);
|
INSERT INTO fields VALUES (91,'websiteTitle',NULL);
|
||||||
INSERT INTO fields VALUES (92,'reportNumber',NULL);
|
INSERT INTO fields VALUES (92,'reportNumber',NULL);
|
||||||
INSERT INTO fields VALUES (93,'billNumber',NULL);
|
INSERT INTO fields VALUES (93,'billNumber',NULL);
|
||||||
|
|
Loading…
Reference in New Issue
Block a user