Closes #247, Add interface option for institutional creators in item edit pane
Here's a shot at a single/double creator field toggle switch -- let me know what you think A few issues: - There's currently no comma between the last name and first name when in two-field mode -- I removed it to greatly simplify the code, hoping to be able to use the CSS :after pseudo-element, but that seems to not work with XUL -- I'll figure out a clean solution and add it back ( refs #288 ) - It's not very smart about switching between single-field mode and two-field mode, as it currently just keeps the last word (even if it's "Jr." or "III") as the last name and puts the rest in the first name field -- not a big deal, but it should at least be a bit smarter about this ( refs #289 ) - There are probably some other bugs
This commit is contained in:
parent
60422e032e
commit
e2aa1a06db
|
@ -26,12 +26,20 @@ var ScholarItemPane = new function()
|
||||||
var _tabIndexMinFields = 1000;
|
var _tabIndexMinFields = 1000;
|
||||||
var _tabIndexMaxFields = 0;
|
var _tabIndexMaxFields = 0;
|
||||||
|
|
||||||
|
const _defaultFirstName =
|
||||||
|
'(' + Scholar.getString('pane.item.defaultFirstName') + ')';
|
||||||
|
const _defaultLastName =
|
||||||
|
'(' + Scholar.getString('pane.item.defaultLastName') + ')';
|
||||||
|
const _defaultFullName =
|
||||||
|
'(' + Scholar.getString('pane.item.defaultFullName') + ')';
|
||||||
|
|
||||||
this.onLoad = onLoad;
|
this.onLoad = onLoad;
|
||||||
this.viewItem = viewItem;
|
this.viewItem = viewItem;
|
||||||
this.loadPane = loadPane;
|
this.loadPane = loadPane;
|
||||||
this.changeTypeTo = changeTypeTo;
|
this.changeTypeTo = changeTypeTo;
|
||||||
this.onOpenURLClick = onOpenURLClick;
|
this.onOpenURLClick = onOpenURLClick;
|
||||||
this.addCreatorRow = addCreatorRow;
|
this.addCreatorRow = addCreatorRow;
|
||||||
|
this.switchCreatorMode = switchCreatorMode;
|
||||||
this.disableButton = disableButton;
|
this.disableButton = disableButton;
|
||||||
this.createValueElement = createValueElement;
|
this.createValueElement = createValueElement;
|
||||||
this.removeCreator = removeCreator;
|
this.removeCreator = removeCreator;
|
||||||
|
@ -183,13 +191,13 @@ var ScholarItemPane = new function()
|
||||||
for(var i = 0, len=_itemBeingEdited.numCreators(); i<len; i++)
|
for(var i = 0, len=_itemBeingEdited.numCreators(); i<len; i++)
|
||||||
{
|
{
|
||||||
var creator = _itemBeingEdited.getCreator(i);
|
var creator = _itemBeingEdited.getCreator(i);
|
||||||
addCreatorRow(creator['firstName'], creator['lastName'], creator['creatorTypeID']);
|
addCreatorRow(creator['firstName'], creator['lastName'], creator['creatorTypeID'], creator['isInstitution']);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
// Add default row
|
// Add default row
|
||||||
addCreatorRow('', '', 1, true, true);
|
addCreatorRow('', '', 1, false, true, true);
|
||||||
}
|
}
|
||||||
|
|
||||||
// Move to next or previous field if (shift-)tab was pressed
|
// Move to next or previous field if (shift-)tab was pressed
|
||||||
|
@ -338,7 +346,7 @@ var ScholarItemPane = new function()
|
||||||
_dynamicFields.appendChild(row);
|
_dynamicFields.appendChild(row);
|
||||||
}
|
}
|
||||||
|
|
||||||
function addCreatorRow(firstName, lastName, typeID, unsaved, defaultRow)
|
function addCreatorRow(firstName, lastName, typeID, singleField, unsaved, defaultRow)
|
||||||
{
|
{
|
||||||
// Disable the "+" button on previous rows
|
// Disable the "+" button on previous rows
|
||||||
var elems = _dynamicFields.getElementsByAttribute('value', '+');
|
var elems = _dynamicFields.getElementsByAttribute('value', '+');
|
||||||
|
@ -346,27 +354,43 @@ var ScholarItemPane = new function()
|
||||||
ScholarItemPane.disableButton(elems[elems.length-1]);
|
ScholarItemPane.disableButton(elems[elems.length-1]);
|
||||||
}
|
}
|
||||||
|
|
||||||
if(!firstName)
|
if (singleField)
|
||||||
firstName = "(" + Scholar.getString('pane.item.defaultFirstName') + ")";
|
{
|
||||||
if (!lastName)
|
if (!lastName)
|
||||||
lastName = "(" + Scholar.getString('pane.item.defaultLastName') + ")";
|
{
|
||||||
|
lastName = _defaultFullName;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
if (!firstName)
|
||||||
|
{
|
||||||
|
firstName = _defaultFirstName;
|
||||||
|
}
|
||||||
|
if (!lastName)
|
||||||
|
{
|
||||||
|
lastName = _defaultLastName;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
var label = document.createElement("label");
|
var label = document.createElement("label");
|
||||||
label.setAttribute("value",Scholar.getString('creatorTypes.'+Scholar.CreatorTypes.getName(typeID))+":");
|
label.setAttribute("value",Scholar.getString('creatorTypes.'+Scholar.CreatorTypes.getName(typeID))+":");
|
||||||
label.setAttribute("popup","creatorTypeMenu");
|
label.setAttribute("popup","creatorTypeMenu");
|
||||||
label.setAttribute("fieldname",'creator-'+_creatorCount+'-typeID');
|
label.setAttribute("fieldname",'creator-'+_creatorCount+'-typeID');
|
||||||
|
|
||||||
label.className = 'clicky';
|
label.className = 'clicky';
|
||||||
|
|
||||||
// getCreatorFields() needs to be adjusted if this DOM structure changes
|
// getCreatorFields() and switchCreatorMode() may need need to be
|
||||||
var row = document.createElement("hbox");
|
// adjusted if this DOM structure changes
|
||||||
|
var hbox = document.createElement("hbox");
|
||||||
|
|
||||||
|
// Name
|
||||||
var firstlast = document.createElement("hbox");
|
var firstlast = document.createElement("hbox");
|
||||||
firstlast.setAttribute("flex","1");
|
firstlast.setAttribute("flex","1");
|
||||||
|
|
||||||
var tabindex = _tabIndexMinCreators + (_creatorCount * 2);
|
var tabindex = _tabIndexMinCreators + (_creatorCount * 2);
|
||||||
firstlast.appendChild(
|
firstlast.appendChild(
|
||||||
createValueElement(
|
createValueElement(
|
||||||
lastName + ",",
|
lastName,
|
||||||
'creator-' + _creatorCount + '-lastName',
|
'creator-' + _creatorCount + '-lastName',
|
||||||
tabindex
|
tabindex
|
||||||
)
|
)
|
||||||
|
@ -378,10 +402,21 @@ var ScholarItemPane = new function()
|
||||||
tabindex + 1
|
tabindex + 1
|
||||||
)
|
)
|
||||||
);
|
);
|
||||||
_tabIndexMaxCreators = Math.max(_tabIndexMaxCreators, tabindex + 1);
|
if (singleField)
|
||||||
|
{
|
||||||
|
firstlast.lastChild.setAttribute('hidden', true);
|
||||||
|
}
|
||||||
|
_tabIndexMaxCreators = Math.max(_tabIndexMaxCreators, tabindex);
|
||||||
|
|
||||||
row.appendChild(firstlast);
|
hbox.appendChild(firstlast);
|
||||||
|
|
||||||
|
// Single/double field toggle
|
||||||
|
var toggleButton = document.createElement('toolbarbutton');
|
||||||
|
toggleButton.setAttribute('fieldname', 'creator-' + _creatorCount + '-singleField');
|
||||||
|
toggleButton.className = 'clicky';
|
||||||
|
hbox.appendChild(toggleButton);
|
||||||
|
|
||||||
|
// Minus (-) button
|
||||||
var removeButton = document.createElement('label');
|
var removeButton = document.createElement('label');
|
||||||
removeButton.setAttribute("value","-");
|
removeButton.setAttribute("value","-");
|
||||||
// If default first row, don't let user remove it
|
// If default first row, don't let user remove it
|
||||||
|
@ -392,8 +427,9 @@ var ScholarItemPane = new function()
|
||||||
removeButton.setAttribute("class","clicky");
|
removeButton.setAttribute("class","clicky");
|
||||||
removeButton.setAttribute("onclick","ScholarItemPane.removeCreator("+_creatorCount+", this.parentNode.parentNode)");
|
removeButton.setAttribute("onclick","ScholarItemPane.removeCreator("+_creatorCount+", this.parentNode.parentNode)");
|
||||||
}
|
}
|
||||||
row.appendChild(removeButton);
|
hbox.appendChild(removeButton);
|
||||||
|
|
||||||
|
// Plus (+) button
|
||||||
var addButton = document.createElement('label');
|
var addButton = document.createElement('label');
|
||||||
addButton.setAttribute("value","+");
|
addButton.setAttribute("value","+");
|
||||||
// If row isn't saved, don't let user add more
|
// If row isn't saved, don't let user add more
|
||||||
|
@ -405,11 +441,111 @@ var ScholarItemPane = new function()
|
||||||
{
|
{
|
||||||
_enablePlusButton(addButton);
|
_enablePlusButton(addButton);
|
||||||
}
|
}
|
||||||
row.appendChild(addButton);
|
hbox.appendChild(addButton);
|
||||||
|
|
||||||
_creatorCount++;
|
_creatorCount++;
|
||||||
|
|
||||||
addDynamicRow(label, row, true);
|
addDynamicRow(label, hbox, true);
|
||||||
|
|
||||||
|
// Set single/double field toggle mode
|
||||||
|
if (singleField)
|
||||||
|
{
|
||||||
|
switchCreatorMode(hbox.parentNode, true, true);
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
switchCreatorMode(hbox.parentNode, false, true);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
function switchCreatorMode(row, singleField, initial)
|
||||||
|
{
|
||||||
|
// Change if button position changes
|
||||||
|
// row->hbox->label->label->toolbarbutton
|
||||||
|
var button = row.lastChild.lastChild.previousSibling.previousSibling;
|
||||||
|
var hbox = button.previousSibling;
|
||||||
|
var lastName = hbox.firstChild;
|
||||||
|
var firstName = hbox.lastChild;
|
||||||
|
|
||||||
|
// Switch to single-field mode
|
||||||
|
if (singleField)
|
||||||
|
{
|
||||||
|
button.setAttribute('image', 'chrome://scholar/skin/textfield-dual.png');
|
||||||
|
button.setAttribute('tooltiptext', 'Switch to two fields');
|
||||||
|
lastName.setAttribute('singleField', 'true');
|
||||||
|
button.setAttribute('onclick', "ScholarItemPane.switchCreatorMode(this.parentNode.parentNode, false)");
|
||||||
|
|
||||||
|
// Remove firstname field from tabindex
|
||||||
|
var tab = parseInt(firstName.getAttribute('tabindex'));
|
||||||
|
firstName.setAttribute('tabindex', -1);
|
||||||
|
if (_tabIndexMaxCreators==tab)
|
||||||
|
{
|
||||||
|
_tabIndexMaxCreators--;
|
||||||
|
}
|
||||||
|
|
||||||
|
// Hide first name field and prepend to last name field
|
||||||
|
firstName.setAttribute('hidden', true);
|
||||||
|
var first = _getFieldValue(firstName);
|
||||||
|
if (first && first != _defaultFirstName)
|
||||||
|
{
|
||||||
|
var last = _getFieldValue(lastName);
|
||||||
|
_setFieldValue(lastName, first + ' ' + last);
|
||||||
|
}
|
||||||
|
|
||||||
|
if (_getFieldValue(lastName) == _defaultLastName)
|
||||||
|
{
|
||||||
|
_setFieldValue(lastName, _defaultFullName);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
// Switch to two-field mode
|
||||||
|
else
|
||||||
|
{
|
||||||
|
button.setAttribute('image', 'chrome://scholar/skin/textfield-single.png');
|
||||||
|
button.setAttribute('tooltiptext', 'Switch to single field');
|
||||||
|
lastName.setAttribute('singleField', 'false');
|
||||||
|
button.setAttribute('onclick', "ScholarItemPane.switchCreatorMode(this.parentNode.parentNode, true)");
|
||||||
|
|
||||||
|
// Add firstname field to tabindex
|
||||||
|
var tab = parseInt(lastName.getAttribute('tabindex'));
|
||||||
|
firstName.setAttribute('tabindex', tab + 1);
|
||||||
|
if (_tabIndexMaxCreators==tab)
|
||||||
|
{
|
||||||
|
_tabIndexMaxCreators++;
|
||||||
|
}
|
||||||
|
|
||||||
|
// Move all but last word to first name field and show it
|
||||||
|
var last = _getFieldValue(lastName);
|
||||||
|
if (last && last != _defaultFullName)
|
||||||
|
{
|
||||||
|
var lastNameRE = /(.*?)[ ]*([^ ]+[ ]*)$/;
|
||||||
|
var parts = lastNameRE.exec(last);
|
||||||
|
if (parts[2] && parts[2] != last)
|
||||||
|
{
|
||||||
|
_setFieldValue(lastName, parts[2]);
|
||||||
|
_setFieldValue(firstName, parts[1]);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
if (!_getFieldValue(firstName))
|
||||||
|
{
|
||||||
|
_setFieldValue(firstName, _defaultFirstName);
|
||||||
|
}
|
||||||
|
|
||||||
|
if (_getFieldValue(lastName) == _defaultFullName)
|
||||||
|
{
|
||||||
|
_setFieldValue(lastName, _defaultLastName);
|
||||||
|
}
|
||||||
|
|
||||||
|
firstName.setAttribute('hidden', false);
|
||||||
|
}
|
||||||
|
|
||||||
|
if (!initial)
|
||||||
|
{
|
||||||
|
var [, index, field] = button.getAttribute('fieldname').split('-');
|
||||||
|
|
||||||
|
var otherFields = getCreatorFields(row); // row
|
||||||
|
modifyCreator(index, field, !!singleField, otherFields);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
function disableButton(button)
|
function disableButton(button)
|
||||||
|
@ -423,7 +559,7 @@ var ScholarItemPane = new function()
|
||||||
{
|
{
|
||||||
button.setAttribute('disabled', false);
|
button.setAttribute('disabled', false);
|
||||||
button.setAttribute("class","clicky");
|
button.setAttribute("class","clicky");
|
||||||
button.setAttribute("onclick","ScholarItemPane.disableButton(this); ScholarItemPane.addCreatorRow('','',1,true);");
|
button.setAttribute("onclick","ScholarItemPane.disableButton(this); ScholarItemPane.addCreatorRow('','',1,false,true);");
|
||||||
}
|
}
|
||||||
|
|
||||||
function createValueElement(valueText, fieldName, tabindex)
|
function createValueElement(valueText, fieldName, tabindex)
|
||||||
|
@ -478,11 +614,11 @@ var ScholarItemPane = new function()
|
||||||
|
|
||||||
var fieldName = elem.getAttribute('fieldname');
|
var fieldName = elem.getAttribute('fieldname');
|
||||||
var tabindex = elem.getAttribute('tabindex');
|
var tabindex = elem.getAttribute('tabindex');
|
||||||
var creatorFields = fieldName.split('-');
|
var [field, creatorIndex, creatorField] = fieldName.split('-');
|
||||||
if(creatorFields[0] == 'creator')
|
if (field == 'creator')
|
||||||
{
|
{
|
||||||
var c = _itemBeingEdited.getCreator(creatorFields[1]);
|
var c = _itemBeingEdited.getCreator(creatorIndex);
|
||||||
var value = c ? c[creatorFields[2]] : '';
|
var value = c ? c[creatorField] : '';
|
||||||
var itemID = _itemBeingEdited.getID();
|
var itemID = _itemBeingEdited.getID();
|
||||||
}
|
}
|
||||||
else if (fieldName=='tag')
|
else if (fieldName=='tag')
|
||||||
|
@ -505,6 +641,10 @@ var ScholarItemPane = new function()
|
||||||
t.setAttribute('fieldname', fieldName);
|
t.setAttribute('fieldname', fieldName);
|
||||||
t.setAttribute('tabindex', tabindex);
|
t.setAttribute('tabindex', tabindex);
|
||||||
t.setAttribute('flex','1');
|
t.setAttribute('flex','1');
|
||||||
|
if (creatorField=='lastName')
|
||||||
|
{
|
||||||
|
t.setAttribute('singleField', elem.getAttribute('singleField'));
|
||||||
|
}
|
||||||
|
|
||||||
var box = elem.parentNode;
|
var box = elem.parentNode;
|
||||||
box.replaceChild(t,elem);
|
box.replaceChild(t,elem);
|
||||||
|
@ -551,35 +691,45 @@ var ScholarItemPane = new function()
|
||||||
var value = t.value;
|
var value = t.value;
|
||||||
|
|
||||||
var elem;
|
var elem;
|
||||||
var creatorFields = fieldName.split('-');
|
var [field, creatorIndex, creatorField] = fieldName.split('-');
|
||||||
|
|
||||||
// Creator fields
|
// Creator fields
|
||||||
if(creatorFields[0] == 'creator')
|
if (field == 'creator')
|
||||||
{
|
{
|
||||||
|
var row = textbox.parentNode.parentNode.parentNode;
|
||||||
|
|
||||||
|
var otherFields = getCreatorFields(row);
|
||||||
|
|
||||||
if (saveChanges){
|
if (saveChanges){
|
||||||
var otherFields =
|
modifyCreator(creatorIndex, creatorField, value, otherFields);
|
||||||
getCreatorFields(textbox.parentNode.parentNode.parentNode);
|
|
||||||
modifyCreator(creatorFields[1], creatorFields[2], value, otherFields);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
var val = _itemBeingEdited.getCreator(creatorFields[1])[creatorFields[2]];
|
var val = _itemBeingEdited.getCreator(creatorIndex)[creatorField];
|
||||||
|
|
||||||
if (!val){
|
if (!val){
|
||||||
// Reset to '(first)' or '(last)'
|
// Reset to '(first)'/'(last)'/'(name)'
|
||||||
if (creatorFields[2]=='lastName'){
|
if (creatorField=='lastName')
|
||||||
val = "(" + Scholar.getString('pane.item.defaultLastName') + ")";
|
{
|
||||||
|
val = otherFields['singleField']
|
||||||
|
? _defaultFullName : _defaultLastName;
|
||||||
}
|
}
|
||||||
else if (creatorFields[2]=='firstName'){
|
else if (creatorField=='firstName')
|
||||||
val = "(" + Scholar.getString('pane.item.defaultFirstName') + ")";
|
{
|
||||||
|
val = _defaultFirstName;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
// Add trailing comma
|
|
||||||
if (creatorFields[2]=='lastName'){
|
|
||||||
val += ',';
|
|
||||||
}
|
|
||||||
|
|
||||||
elem = createValueElement(val, fieldName, tabindex);
|
elem = createValueElement(val, fieldName, tabindex);
|
||||||
|
|
||||||
|
// Reset creator mode settings
|
||||||
|
if (otherFields['singleField'])
|
||||||
|
{
|
||||||
|
switchCreatorMode(row, true, true);
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
switchCreatorMode(row, false, true);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
// Tags
|
// Tags
|
||||||
|
@ -656,6 +806,24 @@ var ScholarItemPane = new function()
|
||||||
_itemBeingEdited.save();
|
_itemBeingEdited.save();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
function _getFieldValue(field)
|
||||||
|
{
|
||||||
|
return field.firstChild
|
||||||
|
? field.firstChild.nodeValue : field.value;
|
||||||
|
}
|
||||||
|
|
||||||
|
function _setFieldValue(field, value)
|
||||||
|
{
|
||||||
|
if (field.firstChild)
|
||||||
|
{
|
||||||
|
field.firstChild.nodeValue = value;
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
field.value = value;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
function getCreatorFields(row){
|
function getCreatorFields(row){
|
||||||
var type = row.getElementsByTagName('label')[0].getAttribute('value');
|
var type = row.getElementsByTagName('label')[0].getAttribute('value');
|
||||||
var label1 = row.getElementsByTagName('hbox')[0].firstChild.firstChild;
|
var label1 = row.getElementsByTagName('hbox')[0].firstChild.firstChild;
|
||||||
|
@ -663,12 +831,11 @@ var ScholarItemPane = new function()
|
||||||
|
|
||||||
return {
|
return {
|
||||||
lastName: label1.firstChild ? label1.firstChild.nodeValue
|
lastName: label1.firstChild ? label1.firstChild.nodeValue
|
||||||
// Strip trailing comma
|
: label1.value,
|
||||||
.substr(0, label1.firstChild.nodeValue.length-1): label1.value,
|
|
||||||
firstName: label2.firstChild ? label2.firstChild.nodeValue
|
firstName: label2.firstChild ? label2.firstChild.nodeValue
|
||||||
: label2.value,
|
: label2.value,
|
||||||
typeID: Scholar.CreatorTypes.getID(type.substr(0, type.length-1).toLowerCase()),
|
typeID: Scholar.CreatorTypes.getID(type.substr(0, type.length-1).toLowerCase()),
|
||||||
isInstitution: null // placeholder
|
singleField: label1.getAttribute('singleField') == 'true'
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -678,13 +845,14 @@ var ScholarItemPane = new function()
|
||||||
var firstName = otherFields.firstName;
|
var firstName = otherFields.firstName;
|
||||||
var lastName = otherFields.lastName;
|
var lastName = otherFields.lastName;
|
||||||
var typeID = otherFields.typeID;
|
var typeID = otherFields.typeID;
|
||||||
// var isInstitution = otherFields.isInstitution;
|
var singleField = otherFields.singleField;
|
||||||
|
|
||||||
// Ignore '(first)' and '(last)'
|
// Ignore '(first)'/'(last)' or '(name)'
|
||||||
if (firstName == "(" + Scholar.getString('pane.item.defaultFirstName') + ")"){
|
if (singleField || firstName == _defaultFirstName){
|
||||||
firstName = '';
|
firstName = '';
|
||||||
}
|
}
|
||||||
if (lastName == "(" + Scholar.getString('pane.item.defaultLastName') + ")"){
|
|
||||||
|
if (lastName==_defaultFullName || lastName == _defaultLastName){
|
||||||
lastName = '';
|
lastName = '';
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -693,9 +861,10 @@ var ScholarItemPane = new function()
|
||||||
var firstName = creator['firstName'];
|
var firstName = creator['firstName'];
|
||||||
var lastName = creator['lastName'];
|
var lastName = creator['lastName'];
|
||||||
var typeID = creator['creatorTypeID'];
|
var typeID = creator['creatorTypeID'];
|
||||||
// var isInstitution = creator['isInstitution'];
|
var singleField = creator['isInstitution'];
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// Don't save empty creators
|
||||||
if (!_itemBeingEdited.hasCreatorAt(index) && !firstName && !lastName){
|
if (!_itemBeingEdited.hasCreatorAt(index) && !firstName && !lastName){
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
@ -710,9 +879,12 @@ var ScholarItemPane = new function()
|
||||||
case 'typeID':
|
case 'typeID':
|
||||||
typeID = value;
|
typeID = value;
|
||||||
break;
|
break;
|
||||||
|
case 'singleField':
|
||||||
|
singleField = value;
|
||||||
|
break;
|
||||||
}
|
}
|
||||||
|
|
||||||
_itemBeingEdited.setCreator(index, firstName, lastName, typeID);
|
_itemBeingEdited.setCreator(index, firstName, lastName, typeID, singleField);
|
||||||
_itemBeingEdited.save();
|
_itemBeingEdited.save();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -22,6 +22,7 @@ pane.item.selected.multiple = %1 items selected
|
||||||
pane.item.changeType = Are you sure you want to change the item type? Certain fields may be lost.
|
pane.item.changeType = Are you sure you want to change the item type? Certain fields may be lost.
|
||||||
pane.item.defaultFirstName = first
|
pane.item.defaultFirstName = first
|
||||||
pane.item.defaultLastName = last
|
pane.item.defaultLastName = last
|
||||||
|
pane.item.defaultFullName = full name
|
||||||
pane.item.notes.untitled = Untitled Note
|
pane.item.notes.untitled = Untitled Note
|
||||||
pane.item.notes.delete.confirm = Are you sure you want to delete this note?
|
pane.item.notes.delete.confirm = Are you sure you want to delete this note?
|
||||||
pane.item.notes.count.singular = %1 note
|
pane.item.notes.count.singular = %1 note
|
||||||
|
|
|
@ -83,7 +83,7 @@
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
/* These three fix a rendering bug in Fx2.0b2 */
|
/* These fix a rendering bug in Fx2.0b2 */
|
||||||
#scholar-pane .toolbarbutton-text
|
#scholar-pane .toolbarbutton-text
|
||||||
{
|
{
|
||||||
margin:0 2px;
|
margin:0 2px;
|
||||||
|
@ -92,7 +92,7 @@
|
||||||
{
|
{
|
||||||
margin-right:4px;
|
margin-right:4px;
|
||||||
}
|
}
|
||||||
#tb-fullscreen .toolbarbutton-text
|
#tb-fullscreen .toolbarbutton-text, #editpane-dynamic-fields .toolbarbutton-text
|
||||||
{
|
{
|
||||||
margin:0;
|
margin:0;
|
||||||
}
|
}
|
||||||
|
@ -183,6 +183,12 @@
|
||||||
list-style-image: url('chrome://scholar/skin/toolbar-openurl.png');
|
list-style-image: url('chrome://scholar/skin/toolbar-openurl.png');
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/* creator switch button */
|
||||||
|
#editpane-dynamic-fields row hbox toolbarbutton
|
||||||
|
{
|
||||||
|
margin-right:5px;
|
||||||
|
}
|
||||||
|
|
||||||
#scholar-view-item vbox
|
#scholar-view-item vbox
|
||||||
{
|
{
|
||||||
overflow: auto;
|
overflow: auto;
|
||||||
|
|
|
@ -95,6 +95,12 @@ searchcondition menulist[id="operatorsmenu"]
|
||||||
margin-bottom:-1px;
|
margin-bottom:-1px;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/* DEBUG: this doesn't seem to work, unfortunately */
|
||||||
|
#editpane-dynamic-fields label[singleField=false]:after
|
||||||
|
{
|
||||||
|
content:",";
|
||||||
|
}
|
||||||
|
|
||||||
.clicky, .unclicky
|
.clicky, .unclicky
|
||||||
{
|
{
|
||||||
-moz-border-radius: 6px;
|
-moz-border-radius: 6px;
|
||||||
|
|
BIN
chrome/chromeFiles/skin/default/scholar/textfield-dual.png
Normal file
BIN
chrome/chromeFiles/skin/default/scholar/textfield-dual.png
Normal file
Binary file not shown.
After Width: | Height: | Size: 216 B |
BIN
chrome/chromeFiles/skin/default/scholar/textfield-single.png
Normal file
BIN
chrome/chromeFiles/skin/default/scholar/textfield-single.png
Normal file
Binary file not shown.
After Width: | Height: | Size: 185 B |
Loading…
Reference in New Issue
Block a user