1/*Version: 1.1*/ 2 3$(document).ready(function () { 4 5 6 7 var heading = MsgsMap['joule.loginpanel.helptext.heading']; 8 9 var contents = '<div class="helpText-font-size"><div class="dl-vertical fw-bold"><span>' + heading + '</span></div><div class="dl-vertical">' + 10 '<br/><div class="fw-bold">' + MsgsMap['joule.loginpanel.helptext.Rule1'] + '</div><div class="fw-light">' + MsgsMap['joule.loginpanel.helptext.Rule1_ex'] + '</div><br/>' + 11 '<br/><div class="fw-bold">' + MsgsMap['joule.loginpanel.helptext.Rule2'] + '</div><div class="fw-light">' + MsgsMap['joule.loginpanel.helptext.Rule2_ex'] + '</div><br/>' + 12 '<br/><div class="fw-bold">' + MsgsMap['joule.loginpanel.helptext.Rule3'] + '</div><div class="fw-light">' + MsgsMap['joule.loginpanel.helptext.Rule3_ex'] + '</div></div></div>'; 13 14 15 $('#usernameHelpText').popover({ 16 html: true, 17 content: function () { 18 var content = $(this).attr("data-bs-popover-content"); 19 return contents; 20 }, 21 animation: true 22 }); 23 24 //Password eye-icon 25 if (document.images) { 26 img = new Image(); 27 img.src = "/assets/hw-images/Hide_PW_icon.png"; 28 } 29 $(".toggle-password").attr("title", MsgsMap['joule.loginpanel.helptext.show-pw']); 30 $(".toggle-password").on("click", function () { 31 $(this).toggleClass("show-pw-icon hide-pw-icon"); 32 var input = $($(this).attr("toggle")); 33 if (input.attr("type") == "password") { 34 input.attr("type", "text"); 35 $(this).attr("title", MsgsMap['joule.loginpanel.helptext.hide-pw']); 36 } else { 37 input.attr("type", "password"); 38 $(this).attr("title", MsgsMap['joule.loginpanel.helptext.show-pw']); 39 } 40 }); 41 42 43}); 44 45 46function setErrorMsg(id, msg) { 47 $(id).siblings('.errorMsg').html(msg); 48 $(id).siblings('.errorMsg').css("display", "block"); 49 $(id).parent().addClass('has-error'); 50} 51 52function removeErrorMsg(id) { 53 $(id).siblings('.errorMsg').html(''); 54 $(id).siblings('.errorMsg').css("display", "none"); 55 $(id).parent().removeClass('has-error'); 56} 57 58function validateCwaUser(username) { 59 60 if (username.length > userName_maxLength) { 61 setErrorMsg('#username', MsgsMap['msg.username.notvalid']); 62 return false; 63 } 64 username = username.toLowerCase(); 65 if ((username.indexOf("honeywell") != -1) || (username.indexOf("honey") != -1) || (username.indexOf("allied") != -1)) { 66 setErrorMsg('#username', MsgsMap['msg.username.notvalid']); 67 return false; 68 } 69 70 if ((username.indexOf(".com") != -1) || (username.indexOf("-com") != -1) || (username.indexOf("_com") != -1)) { 71 setErrorMsg('#username', MsgsMap['msg.username.notvalid']); 72 return false; 73 } 74 if ((username.indexOf(".net") != -1) || (username.indexOf("-net") != -1) || (username.indexOf("_net") != -1)) { 75 setErrorMsg('#username', MsgsMap['msg.username.notvalid']); 76 return false; 77 } 78 if ((username.indexOf(".org") != -1) || (username.indexOf("-org") != -1) || (username.indexOf("_org") != -1)) { 79 setErrorMsg('#username', MsgsMap['msg.username.notvalid']); 80 return false; 81 } 82 if (((username).indexOf(".edu") != -1) || ((username).indexOf("-edu") != -1) || ((username).indexOf("_edu") != -1)) { 83 setErrorMsg('#username', MsgsMap['msg.username.notvalid']); 84 return false; 85 } 86 if (username.indexOf(" ") != -1) { 87 setErrorMsg('#username', MsgsMap['msg.username.notvalid']); 88 return false; 89 } 90 var ch; 91 var bleftFlag = false; 92 var brightFlag = false; 93 for (var i = 0; i < username.length; i++) { 94 ch = username.charAt(i); 95 96 if (ch == '&' || ch == '\'' || ch == '<' || ch == '>' || ch == '!' || ch == '!' || ch == '#' || ch == '$' || ch == '%' || ch == '*') { 97 setErrorMsg('#username', MsgsMap['msg.username.notvalid']); 98 return false; 99 } 100 if (ch == '(') 101 bleftFlag = true; 102 if (ch == ')') 103 brightFlag = true; 104 if (ch == '_') { 105 ch = username.charAt(i + 1); 106 if (ch == '_') { 107 setErrorMsg('#username', MsgsMap['msg.username.notvalid']); 108 return false; 109 } 110 } 111 if (ch == '-') { 112 ch = username.charAt(i + 1); 113 if (ch == '-') { 114 setErrorMsg('#username', MsgsMap['msg.username.notvalid']); 115 return false; 116 } 117 } 118 if (ch == '.') { 119 ch = username.charAt(i + 1); 120 if (ch == '.') { 121 setErrorMsg('#username', MsgsMap['msg.username.notvalid']); 122 return false; 123 } 124 } 125 if (ch == ' ') { 126 setErrorMsg('#username', MsgsMap['msg.username.notvalid']); 127 return false; 128 } 129 if (ch == '\t') { 130 setErrorMsg('#username', MsgsMap['msg.username.notvalid']); 131 return false; 132 } 133 if ((bleftFlag == true) || (brightFlag == true)) { 134 setErrorMsg('#username', MsgsMap['msg.username.notvalid']); 135 return false; 136 } 137 } 138 139 if ((username.charAt(0) == '_') || (username.charAt(0) == '-') || (username.charAt(0) == '.')) { 140 setErrorMsg('#username', MsgsMap['msg.username.notvalid']); 141 return false; 142 } 143 return true; 144} 145 146function removeSpace(id) { 147 let val = $('#' + id).val(); 148 if (val) { 149 $('#' + id).val(val.trim()); 150 } 151}
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.