NIHVIVO-3066 Merged r8868 from maint-rel-vivo-1.3 branch.

This commit is contained in:
cappadona 2011-07-27 12:46:35 +00:00
parent aab156cf62
commit 1b260b2e67
2 changed files with 15 additions and 11 deletions

View file

@ -91,28 +91,32 @@ var menuManagementEdit = {
validateMenuItemForm: function() { validateMenuItemForm: function() {
var validationError = ""; var validationError = "";
//Check menu name // Check menu name
if ($("input[type=text][name=menuName]").val() == ""){ if ($('input[type=text][name=menuName]').val() == "") {
validationError += "You must supply a name<br />"; validationError += "You must supply a name<br />";
} }
//Check pretty url // Check pretty url
if ($("input[type=text][name=prettyUrl]").val() == ""){ if ($('input[type=text][name=prettyUrl]').val() == "") {
validationError += "You must supply a pretty URL<br />"; validationError += "You must supply a pretty URL<br />";
} }
if ($('input[type=text][name=prettyUrl]').val().charAt(0) != "/") {
if ($("input:radio[name=selectedTemplate]:checked").val() == "custom") { validationError += "The pretty URL must begin with a leading forward slash<br />";
if ($("input[name=customTemplate]").val() == "") { }
// Check custom template
if ($('input:radio[name=selectedTemplate]:checked').val() == "custom") {
if ($('input[name=customTemplate]').val() == "") {
validationError += "You must supply a template<br />"; validationError += "You must supply a template<br />";
} }
} }
//if no class group selected, this is an error // if no class group selected, this is an error
if ($("#selectClassGroup").val() =='-1'){ if ($('#selectClassGroup').val() =='-1') {
validationError += "You must supply a content type<br />"; validationError += "You must supply a content type<br />";
} else { } else {
//class group has been selected, make sure there is at least one class selected //class group has been selected, make sure there is at least one class selected
var allSelected = $('input[name="allSelected"]:checked').length; var allSelected = $('input[name="allSelected"]:checked').length;
var noClassesSelected = $("input[name='classInClassGroup']:checked").length; var noClassesSelected = $('input[name="classInClassGroup"]:checked').length;
if (allSelected == 0 && noClassesSelected == 0) { if (allSelected == 0 && noClassesSelected == 0) {
//at least one class should be selected //at least one class should be selected
validationError += "You must select the type of content to display<br />"; validationError += "You must select the type of content to display<br />";

View file

@ -28,7 +28,7 @@
<label for="pretty-url">Pretty URL<span class="requiredHint"> *</span></label> <label for="pretty-url">Pretty URL<span class="requiredHint"> *</span></label>
<input type="text" name="prettyUrl" value="${prettyUrl}" role="input" /> <input type="text" name="prettyUrl" value="${prettyUrl}" role="input" />
<p class="note">(Format: /<prettyURL> - e.g., /people)</p> <p class="note">Must begin with a leading forward slash: / (e.g., /people)</p>
<p>Template<span class="requiredHint"> *</span></p> <p>Template<span class="requiredHint"> *</span></p>