re-worked cancel button and some hide/show issues; corrected typo in java class, was GEneral...

This commit is contained in:
tworrall 2011-12-02 18:03:36 +00:00
parent a6af90662e
commit 57e880a9c2
3 changed files with 20 additions and 11 deletions

View file

@ -95,11 +95,6 @@ var addConceptForm = {
//Also clear the search input //Also clear the search input
this.searchTerm.val(""); this.searchTerm.val("");
this.cancel.unbind('click'); this.cancel.unbind('click');
this.cancel.bind('click', function() {
//show only list of existing terms and hide adding term form
addConceptForm.showConceptListOnlyView();
return false;
});
// Show the form // Show the form
this.form.show(); this.form.show();
@ -124,6 +119,10 @@ var addConceptForm = {
this.createOwn.show(); this.createOwn.show();
this.submit.show(); this.submit.show();
}, },
showSpanAndCreateOption:function() {
this.orSpan.show();
this.createOwn.show();
},
showConceptListOnlyView: function() { showConceptListOnlyView: function() {
this.hideForm(); this.hideForm();
this.showFormButtonWrapper.show(); this.showFormButtonWrapper.show();
@ -132,6 +131,7 @@ var addConceptForm = {
//Get value of search term //Get value of search term
var searchValue = this.searchTerm.val(); var searchValue = this.searchTerm.val();
var checkedVocabSource = $('input:radio[name="source"]:checked'); var checkedVocabSource = $('input:radio[name="source"]:checked');
var createLink = this.createOwn;
if(!checkedVocabSource.length) { if(!checkedVocabSource.length) {
addConceptForm.showUncheckedSourceError(); addConceptForm.showUncheckedSourceError();
return; return;
@ -172,7 +172,12 @@ var addConceptForm = {
} }
if(htmlAdd.length) { if(htmlAdd.length) {
$('#selectedConcept').html(htmlAdd); $('#selectedConcept').html(htmlAdd);
addConceptForm.showHiddenElements(); if (htmlAdd.indexOf("No search results") >= 0) {
addConceptForm.showSpanAndCreateOption();
}
else {
addConceptForm.showHiddenElements();
}
} }
}); });
return true; return true;
@ -249,7 +254,7 @@ var addConceptForm = {
validateConceptSelection:function(checkedElements) { validateConceptSelection:function(checkedElements) {
var numberElements = checkedElements.length; var numberElements = checkedElements.length;
if(numberElements < 1) { if(numberElements < 1) {
addConceptForm.errors.html("<p class='validationError'>Please select at least one term from search results to add or click cancel.</p>"); addConceptForm.errors.html("<p class='validationError'>Please select at least one term from the search search results.</p>");
return false; return false;
} }
return true; return true;

View file

@ -105,11 +105,15 @@
<input type="hidden" name="editKey" id="editKey" value="${editKey}"/> <input type="hidden" name="editKey" id="editKey" value="${editKey}"/>
<p class="submit"> <p class="submit">
<input type="submit" id="submit" name="submit" value="Add Selected Concept" /> <input type="submit" id="submit" name="submit" value="Add Selected Concept" />
<span class="or"> or </span><a class="cancel" href="${cancelUrl}">Cancel</a>
</p> </p>
<div id="createOwn"><br /><a href="${userDefinedConceptUrl}" > Can't find the concept you want? Create your own.</a> <div id="createOwn"><br />
<a href="${userDefinedConceptUrl}" > Can't find the concept you want? Create your own.</a>
</div> </div>
<p>
<span class="or"> or </span><a class="cancel" href="${cancelUrl}&url=/individual">Return to Profile Page</a>
</p>
</form> </form>
</div> </div>

View file

@ -40,7 +40,7 @@ public class ConceptSearchServiceUtils {
map.put(UMLSVocabSource, new VocabSourceDescription("UMLS", UMLSVocabSource, "http://www.nlm.nih.gov/research/umls/", "Unified Medical Language System")); map.put(UMLSVocabSource, new VocabSourceDescription("UMLS", UMLSVocabSource, "http://www.nlm.nih.gov/research/umls/", "Unified Medical Language System"));
//Commenting out agrovoc for now until implementation is updated //Commenting out agrovoc for now until implementation is updated
// map.put(AgrovocVocabSource, new VocabSourceDescription("AGROVOC", AgrovocVocabSource, "www.fao.org/agrovoc/", "Agricultural Vocabulary")); // map.put(AgrovocVocabSource, new VocabSourceDescription("AGROVOC", AgrovocVocabSource, "www.fao.org/agrovoc/", "Agricultural Vocabulary"));
map.put(GemetVocabSource, new VocabSourceDescription("GEMET", GemetVocabSource, "http://www.eionet.europa.eu/gemet", "GEneral Multilingual Environmental Thesaurus")); map.put(GemetVocabSource, new VocabSourceDescription("GEMET", GemetVocabSource, "http://www.eionet.europa.eu/gemet", "General Multilingual Environmental Thesaurus"));
return map; return map;
} }