Merge r1114 from http://svn.mannlib.cornell.edu/svn/vivo/branches/rel-1.1-maint
This commit is contained in:
parent
c5031fc9a7
commit
0b023f6f42
2 changed files with 16 additions and 17 deletions
|
@ -147,8 +147,9 @@ public static Log log = LogFactory.getLog("edu.cornell.mannlib.vitro.webapp.jsp.
|
||||||
<c:set var="label" value="${rdfs}label" />
|
<c:set var="label" value="${rdfs}label" />
|
||||||
<c:set var="defaultNamespace" value=""/> <%--blank triggers default URI generation behavior --%>
|
<c:set var="defaultNamespace" value=""/> <%--blank triggers default URI generation behavior --%>
|
||||||
|
|
||||||
<%-- label is required if we are doing an update --%>
|
<%-- label and type required if we are doing an add or a repair, but not an edit --%>
|
||||||
<c:set var="labelRequired" ><%= mode == 2 ?"\"nonempty\"," : "" %></c:set>
|
<c:set var="labelRequired" ><%= (mode == 1 || mode == 3) ?"\"nonempty\"," : "" %></c:set>
|
||||||
|
<c:set var="typeRequired" ><%= (mode == 1 || mode == 3) ?"\"nonempty\"," : "" %></c:set>
|
||||||
|
|
||||||
<%--
|
<%--
|
||||||
<c:choose>
|
<c:choose>
|
||||||
|
@ -277,7 +278,7 @@ public static Log log = LogFactory.getLog("edu.cornell.mannlib.vitro.webapp.jsp.
|
||||||
},
|
},
|
||||||
"roleActivityType" : {
|
"roleActivityType" : {
|
||||||
"newResource" : "true",
|
"newResource" : "true",
|
||||||
"validators" : [ ],
|
"validators" : [ ${typeRequired} ],
|
||||||
"optionsType" : "${roleActivityType_optionsType}",
|
"optionsType" : "${roleActivityType_optionsType}",
|
||||||
"literalOptions" : [ ${roleActivityType_literalOptions } ],
|
"literalOptions" : [ ${roleActivityType_literalOptions } ],
|
||||||
"predicateUri" : "",
|
"predicateUri" : "",
|
||||||
|
|
|
@ -186,13 +186,6 @@ var customForm = {
|
||||||
// These are not editable: only properties of the role are editable.
|
// These are not editable: only properties of the role are editable.
|
||||||
this.typeSelector.attr('disabled', 'disabled');
|
this.typeSelector.attr('disabled', 'disabled');
|
||||||
this.relatedIndLabel.attr('disabled', 'disabled');
|
this.relatedIndLabel.attr('disabled', 'disabled');
|
||||||
|
|
||||||
this.form.submit(function() {
|
|
||||||
// Re-enable these fields so they get submitted, since they are required
|
|
||||||
// in the edit config.
|
|
||||||
customForm.typeSelector.attr('disabled', '');
|
|
||||||
customForm.relatedIndLabel.attr('disabled', '');
|
|
||||||
});
|
|
||||||
},
|
},
|
||||||
|
|
||||||
// Bind event listeners that persist over the life of the page. Event listeners
|
// Bind event listeners that persist over the life of the page. Event listeners
|
||||||
|
@ -216,6 +209,7 @@ var customForm = {
|
||||||
window.open($(this).attr('href'), 'verifyMatchWindow', 'width=640,height=640,scrollbars=yes,resizable=yes,status=yes,toolbar=no,menubar=no,location=no');
|
window.open($(this).attr('href'), 'verifyMatchWindow', 'width=640,height=640,scrollbars=yes,resizable=yes,status=yes,toolbar=no,menubar=no,location=no');
|
||||||
return false;
|
return false;
|
||||||
});
|
});
|
||||||
|
|
||||||
},
|
},
|
||||||
|
|
||||||
initAutocomplete: function() {
|
initAutocomplete: function() {
|
||||||
|
@ -246,7 +240,6 @@ var customForm = {
|
||||||
},
|
},
|
||||||
complete: function(xhr, status) {
|
complete: function(xhr, status) {
|
||||||
// Not sure why, but we need an explicit json parse here. jQuery
|
// Not sure why, but we need an explicit json parse here. jQuery
|
||||||
// should parse the response text and return a json object.
|
|
||||||
var results = $.parseJSON(xhr.responseText),
|
var results = $.parseJSON(xhr.responseText),
|
||||||
filteredResults = customForm.filterAcResults(results);
|
filteredResults = customForm.filterAcResults(results);
|
||||||
customForm.acCache[request.term] = filteredResults;
|
customForm.acCache[request.term] = filteredResults;
|
||||||
|
@ -341,7 +334,8 @@ var customForm = {
|
||||||
this.acSelection.show();
|
this.acSelection.show();
|
||||||
|
|
||||||
this.acUriReceiver.val(uri);
|
this.acUriReceiver.val(uri);
|
||||||
this.acLabelReceiver.val(label);
|
this.acLabelReceiver.val(label); // RY PROBABLY DON"T NEED THIS AT ALL????
|
||||||
|
this.acSelector.val(label);
|
||||||
this.acSelectionInfo.html(label);
|
this.acSelectionInfo.html(label);
|
||||||
this.verifyMatch.attr('href', this.verifyMatchBaseHref + uri);
|
this.verifyMatch.attr('href', this.verifyMatchBaseHref + uri);
|
||||||
|
|
||||||
|
@ -364,6 +358,7 @@ var customForm = {
|
||||||
this.acSelector.val('');
|
this.acSelector.val('');
|
||||||
this.hideFields(this.acSelection);
|
this.hideFields(this.acSelection);
|
||||||
this.acUriReceiver.val('');
|
this.acUriReceiver.val('');
|
||||||
|
this.acLabelReceiver.val('');
|
||||||
this.acSelectionInfo.html('');
|
this.acSelectionInfo.html('');
|
||||||
this.verifyMatch.attr('href', this.verifyMatchBaseHref);
|
this.verifyMatch.attr('href', this.verifyMatchBaseHref);
|
||||||
|
|
||||||
|
@ -423,7 +418,7 @@ var customForm = {
|
||||||
// or a new related individual. Called when setting up full view of form, and after
|
// or a new related individual. Called when setting up full view of form, and after
|
||||||
// an autocomplete selection.
|
// an autocomplete selection.
|
||||||
setButtonText: function(newOrExisting) {
|
setButtonText: function(newOrExisting) {
|
||||||
var typeText;
|
var typeText, buttonText;
|
||||||
|
|
||||||
// Edit mode button doesn't change, so it's specified in the jsp
|
// Edit mode button doesn't change, so it's specified in the jsp
|
||||||
if (this.editMode === 'edit') {
|
if (this.editMode === 'edit') {
|
||||||
|
@ -438,16 +433,19 @@ var customForm = {
|
||||||
if (newOrExisting === 'new') {
|
if (newOrExisting === 'new') {
|
||||||
if (this.submitButtonTextType == 'compound') { // use == to tolerate nulls
|
if (this.submitButtonTextType == 'compound') { // use == to tolerate nulls
|
||||||
// e.g., 'Create Grant & Principal Investigator'
|
// e.g., 'Create Grant & Principal Investigator'
|
||||||
this.button.val('Create ' + typeText + ' & ' + this.baseButtonText);
|
buttonText = 'Create ' + typeText + ' & ' + this.baseButtonText;
|
||||||
} else {
|
} else {
|
||||||
// e.g., 'Create Publication'
|
// e.g., 'Create Publication'
|
||||||
this.button.val('Create ' + this.baseButtonText);
|
buttonText = 'Create ' + this.baseButtonText;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
// Using existing related individual
|
// Using existing related individual
|
||||||
else {
|
else {
|
||||||
this.button.val('Add ' + this.baseButtonText);
|
// In repair mode, baseButtonText is "Edit X". Keep that for this case.
|
||||||
|
buttonText = this.editMode == 'repair' ? this.baseButtonText : 'Add ' + this.baseButtonText;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
this.button.val(buttonText);
|
||||||
}
|
}
|
||||||
|
|
||||||
};
|
};
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue