1 2// DEVELOPERS: PLEASE REMEMBER TO CHANGE THE VERSIONING PRIOR TO PUBLISH! IT IS VERY IMPORTANT WE KNOW THE VERSIONS OF JAVASCRIPT FILES ON LIVE! 3//Version nomenclature 4// Major (If a major revision is made that changes the functionality) 5// Minor (If a minor revision is made that requires backwards compatability) 6// Revision (Month of the year of the change) 7// System (Day of the Month of the change) 8// Iteration (Number of iterations in the same day of changes) 9// Year (Year of the change) 10// 11// Name is the name of the file 12// Requires is an array of names that represent files the current file needs, right now only used for JavaScripts. 13 14try { 15 versioning.reportVersion({ 16 major: 1, 17 minor: 0, 18 revision: 1, 19 system: 7, 20 iteration: 1, 21 year: 2019, 22 name: 'default.js', 23 requires: ['NOAH.Include.Config.js', 'NOAH.Include.js'] 24 }); 25} catch (ex) { console.log(ex.message); } 26 27/* Standard INCLUDE JavaScript Functions */ 28var resetDFBCount = $('[id*=upDFBUpdate][dfbhtml5-id]').length || 0; 29 30var resetSkinScripts = true; 31var resetSkinScriptsCustom = (resetDFBCount < 2) || false; 32 33var alreadyLoadedSkinScripts = false; 34var alreadyLoadedSkinScriptsCustom = false; 35 36function extendedEndAjaxRequest_Before() { 37 try { 38 if (resetSkinScripts) { 39 alreadyLoadedSkinScripts = false; 40 } 41 } catch (ex) { console.log(ex.message); } 42} 43 44function extendedEndAjaxRequest_After() { 45 try { 46 if (!alreadyLoadedSkinScripts) { 47 // loadSkinScripts(); 48 alreadyLoadedSkinScripts = true; 49 } 50 } catch (ex) { console.log(ex.message); } 51} 52 53 54function customShowPleaseWait_onBegin(options) { 55 try { 56 if (resetSkinScriptsCustom) { 57 alreadyLoadedSkinScriptsCustom = false; 58 } 59 } catch (ex) { console.log(ex.message); } 60} 61 62function customShowPleaseWait_onEnd(options) { 63 try { 64 if (!alreadyLoadedSkinScriptsCustom) { 65 // loadSkinScripts(); 66 alreadyLoadedSkinScriptsCustom = true; 67 } 68 69 try { $('.HIDDEN[id*=wcbFormWrapper]').removeClass('HIDDEN'); } catch (ex) { } 70 } catch (ex) { console.log(ex.message); } 71} 72 73/* X-Page data with cookies for the hfSessionData */ 74function setCookie(name, value, days) { 75 try { 76 var expires = ""; 77 78 if (days) { 79 var date = new Date(); 80 date.setTime(date.getTime() + (days * 24 * 60 * 60 * 1000)); 81 expires = "; expires=" + date.toUTCString(); 82 } 83 document.cookie = name + "=" + (value || "") + expires + "; path=/"; 84 } 85 catch (ex) { 86 console.log(ex.message); 87 } 88} 89 90function setCookieWithOptions(name, value, options) { 91 try { 92 var expireDate = new Date(); 93 var _defaults = { 94 path: window.location.pathname, 95 domain: window.location.host, 96 expires: expireDate.toUTCString(), 97 secure: '', 98 days: 7, 99 maxAge: 7 100 }; 101 102 var settings = $.extend({}, _defaults, options); 103 // console.log(settings); 104 if (!value || value == null || value == 'delete') { settings.days = -1; value = ''; } 105 106 settings.expires = new Date(settings.expires).setTime(new Date(settings.expires).getTime() + (Math.min((settings.days || 7), (settings.maxAge || 1)) * 24 * 60 * 60 * 1000)); 107 settings.expires = new Date(settings.expires).toUTCString(); 108 109 var cookieData = [name, '=', encodeURIComponent((value || '').toString()) + ';', 'expires=' + (settings.expires || '').toString() + ';', 'path=' + (settings.path || '').toString() + ';', 'domain=' + (settings.domain || '').toString() + ';'].join(''); 110 // console.log(cookieData); 111 document.cookie = cookieData; 112 } 113 catch (ex) { 114 console.log(ex.message); 115 } 116} 117 118function getCookie(name) { 119 try { 120 var nameEQ = name + "="; 121 var ca = document.cookie.split(';'); 122 for (var i = 0; i < ca.length; i++) { 123 var c = ca[i];
124 while (c.charAt(0) === ' ') c = c.substring(1, c.length); 125 if (c.indexOf(nameEQ) === 0) return c.substring(nameEQ.length, c.length); 126 } 127 } 128 catch (ex) { 129 console.log(ex.message); 130 } 131 return null; 132} 133 134function eraseCookie(name) { 135 try { 136 document.cookie = name + '=; Max-Age=-99999999;'; 137 } 138 catch (ex) { 139 console.log(ex.message); 140 } 141} 142 143$('[id*=hfSessionData').change(function () { 144 try { 145 var value = $(this).val(); 146 setCookie("SessionData", value, 1); 147 } 148 catch (ex) { 149 console.log(ex.message); 150 } 151}); 152 153function loadSessionData() { 154 try { 155 $('[id*=hfSessionData').val(getCookie("SessionData")); 156 } 157 catch (ex) { 158 console.log(ex.message); 159 } 160} 161 162 163function guid() { 164 var result = null; 165 try { 166 var d = new Date().getTime(); 167 if (Date.now) { 168 d = Date.now(); //high-precision timer 169 } 170 var uuid = 'xxxxxxxx-xxxx-4xxx-yxxx-xxxxxxxxxxxx'.replace(/[xy]/g, function (c) { 171 var r = (d + Math.random() * 16) % 16 | 0; 172 d = Math.floor(d / 16); 173 return (c == 'x' ? r : (r & 0x3 | 0x8)).toString(16); 174 }); 175 result = uuid; 176 } 177 catch(ex) 178 { 179 console.log(ex.message); 180 } 181 return result; 182}; 183 184function pageLoad_DefaultJS() { 185 try { 186 console.log('%c Running [default.js] pageLoad() ...', 'color: darkgreen; padding-left: 7em; font-size: 1.25em; font-weight: bold; text-transform: uppercase;'); 187 loadSessionData(); 188 } 189 catch (ex) { 190 console.log(ex.message); 191 } 192} 193 194$(document).ready(function () { 195 try { 196 console.log('%c Running [default.js] $(document).ready() ...', 'color: darkgreen; padding-left: 7em; font-size: 1.25em; font-weight: bold; text-transform: uppercase;'); 197 loadSessionData(); 198 } 199 catch (ex) { 200 console.log(ex.message); 201 } 202}); 203 204try { addLoadEvent(pageLoad_DefaultJS); } catch (ex) { console.log(ex.message); } 205
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.