NIHVIVO-753 Undo toggling of last name field label, and javascript name-fixing. See discussion under NIHVIVO-444 for the rationale behind these changes.

NIHVIVO-725 More work on publication form.
This commit is contained in:
rjy7 2010-07-07 14:57:20 +00:00
parent 98543e75e0
commit 7685f5e329
5 changed files with 25 additions and 28 deletions

View file

@ -130,20 +130,20 @@ var addAuthorForm = {
showFieldsForNewPerson: function() {
this.firstNameWrapper.show();
this.middleNameWrapper.show();
this.toggleLastNameLabel('Name', 'Last name');
// this.toggleLastNameLabel('Name', 'Last name');
},
hideFieldsForNewPerson: function() {
this.hideFields(this.firstNameWrapper);
this.hideFields(this.middleNameWrapper);
this.toggleLastNameLabel('Last name', 'Name');
// this.toggleLastNameLabel('Last name', 'Name');
},
toggleLastNameLabel: function(currentText, newText) {
var lastNameLabelText = this.lastNameLabel.html(),
newLastNameLabelText = lastNameLabelText.replace(currentText, newText);
this.lastNameLabel.html(newLastNameLabelText);
},
// toggleLastNameLabel: function(currentText, newText) {
// var lastNameLabelText = this.lastNameLabel.html(),
// newLastNameLabelText = lastNameLabelText.replace(currentText, newText);
// this.lastNameLabel.html(newLastNameLabelText);
// },
/* *** Ajax initializations *** */
@ -451,24 +451,26 @@ var addAuthorForm = {
onLastNameChange: function() {
this.showFieldsForNewPerson();
this.firstNameField.focus();
this.fixNames();
// this.fixNames();
},
// User may have typed first name as well as last name into last name field.
// If so, when showing first and middle name fields, move anything after a comma
// or space into the first name field.
fixNames: function() {
var lastNameInput = this.lastNameField.val(),
names = lastNameInput.split(/[, ]+/),
lastName = names[0];
this.lastNameField.val(lastName);
if (names.length > 1) {
//firstName = names[1].replace(/^[, ]+/, '');
this.firstNameField.val(names[1]);
}
},
// RY Space is problematic because they may be entering "<firstname> <lastname>", but
// comma is a clear case.
// fixNames: function() {
// var lastNameInput = this.lastNameField.val(),
// names = lastNameInput.split(/[, ]+/),
// lastName = names[0];
//
// this.lastNameField.val(lastName);
//
// if (names.length > 1) {
// //firstName = names[1].replace(/^[, ]+/, '');
// this.firstNameField.val(names[1]);
// }
// },
removeAuthorship: function(link) {
// RY Upgrade this to a modal window

View file

@ -1,3 +1,2 @@
/* $This file is distributed under the terms of the license in /doc/license.txt$ */
$('#pubUri').attr('disabled', 'disabled');