rjy7 2010-07-22 18:50:49 +00:00
parent aa7a7ab6c9
commit 302575251f
4 changed files with 27 additions and 11 deletions

View file

@ -253,6 +253,7 @@ SPARQL queries for existing values. --%>
List<String> customJs = new ArrayList<String>(Arrays.asList(JavaScript.JQUERY_UI.path(),
JavaScript.CUSTOM_FORM_UTILS.path(),
"/js/browserUtils.js",
"/edit/forms/js/addAuthorsToInformationResource.js"
));
request.setAttribute("customJs", customJs);
@ -287,6 +288,9 @@ SPARQL queries for existing values. --%>
<%-- DO NOT CHANGE IDS, CLASSES, OR HTML STRUCTURE ON THIS PAGE WITHOUT UNDERSTANDING THE IMPACT ON THE JAVASCRIPT! --%>
<h2>${title}</h2>
<%@ include file="unsupportedBrowserMessage.jsp" %>
<div class="noIE67">
<h3>Manage Authors</h3>
<ul id="authorships" <%= ulClass %>>
@ -403,6 +407,7 @@ SPARQL queries for existing values. --%>
<p id="requiredLegend" class="requiredHint">* required fields</p>
</form>
</div>
<c:url var="acUrl" value="/autocomplete?type=${foaf}Person&tokenize=false&stem=false" />
<c:url var="reorderUrl" value="/edit/primitiveRdfEdit" />

View file

@ -108,3 +108,10 @@ option {
.or, .cancel{
vertical-align:top;
}
/* Message displayed for an unsupported browser. Hide on page load; JavaScript
* shows if needed.
*/
#ie67DisableWrapper {
display: none;
}

View file

@ -9,10 +9,6 @@
display: none;
}
#ie67DisableWrapper {
display: none;
}
#content form p.inline label {
display: inline;
clear: none;

View file

@ -5,11 +5,15 @@ var addAuthorForm = {
/* *** Initial page setup *** */
onLoad: function() {
if (this.disableFormInUnsupportedBrowsers()) {
return;
}
this.mixIn();
this.initObjects();
this.initPage();
},
mixIn: function() {
// Mix in the custom form utility methods
$.extend(this, vitro.customFormUtils);
@ -192,6 +196,8 @@ var addAuthorForm = {
});
},
// Select event not triggered in IE6/7 when selecting with enter key rather
// than mouse.
select: function(event, ui) {
addAuthorForm.showSelectedAuthor(ui);
}
@ -439,13 +445,15 @@ var addAuthorForm = {
addAuthorForm.onLastNameChange();
});
// When hitting enter in last name field, if not an autocomplete
// selection, show first and middle name fields.
// When hitting enter in last name field, show first and middle name fields.
// NB This event fires when selecting an autocomplete suggestion with the enter
// key, and there's no way to prevent it. Since it fires first, we undo its
// effects in the ac select event listener.
this.lastNameField.keydown(function(event) {
if (event.keyCode === 13) {
addAuthorForm.onLastNameChange();
return false; // don't submit form
}
if (event.which === 13) {
addAuthorForm.onLastNameChange();
return false; // don't submit form
}
});
this.removeAuthorshipLinks.click(function() {