NIHVIVO-646 JS and CSS tweaks
This commit is contained in:
parent
5c9de606d0
commit
addabdc245
3 changed files with 34 additions and 19 deletions
|
@ -362,6 +362,13 @@ SPARQL queries for existing values. --%>
|
||||||
<v:input type="submit" value="Add Author" id="showAddFormButton" cancel="true" cancelLabel="Return to Publication" cancelUrl="/individual" />
|
<v:input type="submit" value="Add Author" id="showAddFormButton" cancel="true" cancelLabel="Return to Publication" cancelUrl="/individual" />
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
|
<div id="infoForJs">
|
||||||
|
<span class="rankPred" id="${rankPred}"></span>
|
||||||
|
<span class="rankXsdType" id="${intDatatypeUri}"></span>
|
||||||
|
<span class="acUrl" id="<c:url value="/autocomplete?type=${foaf}Person&stem=false" />"></span>
|
||||||
|
<span class="reorderUrl" id="<c:url value="/edit/primitiveRdfEdit" />"></span>
|
||||||
|
</div>
|
||||||
|
|
||||||
<form id="addAuthorForm" action="<c:url value="/edit/processRdfForm2.jsp"/>" >
|
<form id="addAuthorForm" action="<c:url value="/edit/processRdfForm2.jsp"/>" >
|
||||||
|
|
||||||
<h3>Add an Author</h3>
|
<h3>Add an Author</h3>
|
||||||
|
@ -377,11 +384,7 @@ SPARQL queries for existing values. --%>
|
||||||
<input type="hidden" id="personUri" name="personUri" value="" /> <!-- Field value populated by JavaScript -->
|
<input type="hidden" id="personUri" name="personUri" value="" /> <!-- Field value populated by JavaScript -->
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
<input type="hidden" name="rankPred" id="rankPred" value="${rankPred}" />
|
|
||||||
<input type="hidden" name="rankXsdType" id="rankXsdType" value="${intDatatypeUri}" />
|
|
||||||
<input type="hidden" name="rank" id="rank" value="${newRank}" />
|
<input type="hidden" name="rank" id="rank" value="${newRank}" />
|
||||||
<input type="hidden" name="acUrl" id="acUrl" value="<c:url value="/autocomplete?type=${foaf}Person&stem=false" />" />
|
|
||||||
<input type="hidden" name="reorderUrl" id="reorderUrl" value="<c:url value="/edit/primitiveRdfEdit" />" />
|
|
||||||
|
|
||||||
<p class="submit"><v:input type="submit" id="submit" value="Add Author" cancel="true" /></p>
|
<p class="submit"><v:input type="submit" id="submit" value="Add Author" cancel="true" /></p>
|
||||||
|
|
||||||
|
|
|
@ -24,6 +24,10 @@
|
||||||
margin-left: 2em;
|
margin-left: 2em;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
#infoForJs {
|
||||||
|
display: none;
|
||||||
|
}
|
||||||
|
|
||||||
form h3 {
|
form h3 {
|
||||||
margin-bottom: .5em;
|
margin-bottom: .5em;
|
||||||
}
|
}
|
||||||
|
@ -78,6 +82,15 @@ form a:hover.cancel,
|
||||||
clear: left;
|
clear: left;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
#content form #selectedAuthor p.inline label {
|
||||||
|
width: 10em;
|
||||||
|
}
|
||||||
|
|
||||||
|
#selectedAuthorName {
|
||||||
|
background-color: #d9d9d9;
|
||||||
|
padding: .5em 1em;
|
||||||
|
}
|
||||||
|
|
||||||
#content form p.submit {
|
#content form p.submit {
|
||||||
margin-top: 3em;
|
margin-top: 3em;
|
||||||
}
|
}
|
||||||
|
|
|
@ -70,10 +70,9 @@ var addAuthorForm = {
|
||||||
|
|
||||||
this.submit.click(function() {
|
this.submit.click(function() {
|
||||||
// NB Important JavaScript scope issue: if we call it this way, this = addAuthorForm
|
// NB Important JavaScript scope issue: if we call it this way, this = addAuthorForm
|
||||||
// in prepareFieldValuesForSubmit. If we do
|
// in prepareSubmit. If we do this.submit.click(prepareSubmit); then
|
||||||
// this.submit.click(this.prepareFieldValuesForSubmit); then
|
// this != addAuthorForm in prepareSubmit.
|
||||||
// this != addAuthorForm in prepareFieldValuesForSubmit.
|
addAuthorForm.prepareSubmit();
|
||||||
addAuthorForm.prepareFieldValuesForSubmit();
|
|
||||||
});
|
});
|
||||||
|
|
||||||
this.lastNameField.blur(function() {
|
this.lastNameField.blur(function() {
|
||||||
|
@ -282,8 +281,8 @@ var addAuthorForm = {
|
||||||
initAuthorReordering: function() {
|
initAuthorReordering: function() {
|
||||||
$('#authorships').sortable({
|
$('#authorships').sortable({
|
||||||
stop: function(event, ui) {
|
stop: function(event, ui) {
|
||||||
var predicateUri = '<' + $('#rankPred').val() + '>',
|
var predicateUri = '<' + $('.rankPred').attr('id') + '>',
|
||||||
rankXsdType = $('#rankXsdType').val(),
|
rankXsdType = $('.rankXsdType').attr('id'),
|
||||||
additions = '',
|
additions = '',
|
||||||
retractions = '',
|
retractions = '',
|
||||||
authorships = [];
|
authorships = [];
|
||||||
|
@ -324,7 +323,7 @@ var addAuthorForm = {
|
||||||
// console.log("retractions: " + retractions);
|
// console.log("retractions: " + retractions);
|
||||||
|
|
||||||
$.ajax({
|
$.ajax({
|
||||||
url: $('#reorderUrl').val(),
|
url: $('.reorderUrl').attr('id'),
|
||||||
data: {
|
data: {
|
||||||
additions: additions,
|
additions: additions,
|
||||||
retractions: retractions
|
retractions: retractions
|
||||||
|
@ -333,7 +332,6 @@ var addAuthorForm = {
|
||||||
processData: 'false',
|
processData: 'false',
|
||||||
dataType: 'json',
|
dataType: 'json',
|
||||||
type: 'POST',
|
type: 'POST',
|
||||||
movedItem: ui.item,
|
|
||||||
success: function(data, status, request) {
|
success: function(data, status, request) {
|
||||||
$.each(authorships, function(index, obj) {
|
$.each(authorships, function(index, obj) {
|
||||||
// find the element with this uri as id
|
// find the element with this uri as id
|
||||||
|
@ -377,7 +375,7 @@ var addAuthorForm = {
|
||||||
initAutocomplete: function() {
|
initAutocomplete: function() {
|
||||||
|
|
||||||
var cache = {};
|
var cache = {};
|
||||||
var url = $('#acUrl').val();
|
var url = $('.acUrl').attr('id');
|
||||||
var existingAuthorUris = addAuthorForm.getExistingAuthorUris();
|
var existingAuthorUris = addAuthorForm.getExistingAuthorUris();
|
||||||
|
|
||||||
jQuery.each(existingAuthorUris, function(index, element) {
|
jQuery.each(existingAuthorUris, function(index, element) {
|
||||||
|
@ -420,15 +418,16 @@ var addAuthorForm = {
|
||||||
},
|
},
|
||||||
|
|
||||||
getExistingAuthorUris: function() {
|
getExistingAuthorUris: function() {
|
||||||
|
// NB This only gets the id of the first one
|
||||||
var existingAuthors = $('#authorships li');
|
// return $('#authorships .authorLink').attr('id');
|
||||||
|
var existingAuthors = $('#authorships .authorLink');
|
||||||
return existingAuthors.map(function() {
|
return existingAuthors.map(function() {
|
||||||
return $(this).attr('id');
|
return $(this).attr('id');
|
||||||
});
|
});
|
||||||
|
|
||||||
},
|
},
|
||||||
|
|
||||||
prepareFieldValuesForSubmit: function() {
|
prepareSubmit: function() {
|
||||||
var firstName,
|
var firstName,
|
||||||
middleName,
|
middleName,
|
||||||
lastName,
|
lastName,
|
||||||
|
|
Loading…
Add table
Reference in a new issue