1// js methods for form display validation 2 3function singleDot(value) { 4 var dot = 0; 5 for (var i = 0; i < value.length; i++) { 6 if (value[i] == '.') { 7 dot++; 8 } 9 } 10 if (dot == 0) { 11 return true; 12 } else { 13 return false; 14 } 15} 16 17function minusSign(value) { 18 if (value.length == 0) { 19 return true; 20 } else { 21 return false; 22 } 23} 24 25/** 26 * @author Anus Wahaj Ali 27 * @since 08 May, 2015 28 */ 29function confirmQuestionOption() { 30 var boolcheck = confirm('Are you sure, you want to delete this option?'); 31 if (!boolcheck) { 32 return false; 33 } else { 34 return true; 35 } 36} 37function confirmQuestion() { 38 var boolcheck = confirm('Are you sure, you want to delete this question?'); 39 40 if (!boolcheck) { 41 return false; 42 } else { 43 return true; 44 } 45} 46 47jQuery_f_d(".ui-icon-closethick").on('click', function() { 48 jQuery_f_d('html').css("overflow", "scroll"); 49}); 50 51function hideOverLayDiv() { 52 jQuery_f_d('.ui-widget-overlay').hide(); 53 showScroller(); 54} 55 56function changeBackgroundColor(id) { 57 jQuery_f_d('[id$=' + id + ']').css('background', ' #b5e8e8'); 58} 59 60function handleDropColumn(event, ui) { 61 var droppedColumn = ui.draggable; 62 droppedColumn.fadeOut('fast'); 63} 64 65function handleDropRow(event, ui) { 66 var droppedRow = ui.draggable; 67 droppedRow.fadeOut('fast'); 68} 69 70function handleDropFirstRow(event, ui) { 71 var droppedFirstRow = ui.draggable; 72 droppedFirstRow.fadeOut('fast'); 73} 74 75function handleDropColumnSec(event, ui) { 76 var droppedColumnSec = ui.draggable; 77 droppedColumnSec.fadeOut('fast'); 78} 79 80function handleDropRowSec(event, ui) { 81 var droppedRowSec = ui.draggable; 82 droppedRowSec.fadeOut('fast'); 83} 84function handleDropFirstRowSec(event, ui) { 85 var droppedFirstRowSec = ui.draggable; 86 droppedFirstRowSec.fadeOut('fast'); 87} 88 89function focusQuestionThatFailedValidation() { 90 91 setTimeout(function(){ 92 var msgLabel = jQuery_f_d("label[id$='msg']"); 93 94 if (msgLabel.length > 0 && msgLabel.hasClass("portlet-msg-error")) { 95 var msgText = msgLabel.text(); 96 msgText = msgText.substring(msgText.indexOf("\"") + 1, msgText.lastIndexOf("\"")); 97 var questionLabel = null; 98 99 jQuery_f_d(".fd-question label").each(function(){ 100 var questionText = jQuery_f_d(this).clone().children().remove().end().text(); 101 102 if (questionText == msgText) { 103 questionLabel = jQuery_f_d(this); 104 return false; 105 } 106 }); 107 108 if (questionLabel != null && questionLabel.length > 0) { 109 var questionFields = questionLabel.parents(".fd-question").find(":input"); 110 111 if (questionFields.length > 0) { 112 jQuery_f_d(questionFields.get(0)).trigger("focus"); 113 jQuery_f_d(".fd-question").removeAttr("aria-describedby"); 114 questionFields.attr("aria-describedby", msgLabel.attr("id")); 115 } 116 } 117 } 118 }, 300); 119} 120 121 122function setCaptchaText(element, id) { 123 getElement(id).value = element.value; 124}
Line numbers count LF bytes from the start of the resource, as the search results do. Vendor segments are library code the classifier recognised; they are stored but not indexed. Bytes are shown as Latin1 characters, one per byte.