1function textInActive() 2{ 3 var txt=document.getElementById('email_textbox'); 4 txt.style.color="#999"; 5 if (txt.value=="") 6 txt.value="Email Address"; 7} 8 9function textActive() 10{ 11 var txt=document.getElementById('email_textbox'); 12 txt.style.color="#3B3B3B"; 13 if (txt.value=="Email Address") 14 txt.value=""; 15} 16 17/* Function to get Query String */ 18function getParameterByName(name) 19{ 20 name = name.replace(/[\[]/, "\\\[").replace(/[\]]/, "\\\]"); 21 var regexS = "[\\?&]" + name + "=([^&#]*)"; 22 var regex = new RegExp(regexS); 23 var results = regex.exec(window.location.search); 24 if(results == null) 25 return ""; 26 else 27 return decodeURIComponent(results[1].replace(/\+/g, " ")); 28} 29 30/* Function to get all query string params */ 31function parseQueryString() 32{ 33 var match, 34 pl = /\+/g, // Regex for replacing addition symbol with a space 35 search = /([^&=]+)=?([^&]*)/g, 36 decode = function (s) { return decodeURIComponent(s.replace(pl, " ")); }, 37 query = window.location.search.substring(1); 38 39 urlParams = {}; 40 while (match = search.exec(query)) { 41 urlParams[decode(match[1])] = decode(match[2]); 42 } 43 44 return urlParams; 45} 46 47function getCookie(c_name) 48{ 49 var i,x,y,ARRcookies=document.cookie.split(";"); 50 for (i=0;i<ARRcookies.length;i++) { 51 x=ARRcookies[i].substr(0,ARRcookies[i].indexOf("=")); 52 y=ARRcookies[i].substr(ARRcookies[i].indexOf("=")+1); 53 x=x.replace(/^\s+|\s+$/g,""); 54 if (x==c_name) { 55 return unescape(y); 56 } 57 } 58} 59 60function setCookie(cookieName, cookieValue, nDays) { 61 var today = new Date(); 62 var expire = new Date(); 63 if (nDays == null || nDays == 0) { 64 nDays = 1; 65 } 66 expire.setTime(today.getTime() + 3600000*24*nDays); 67 document.cookie = cookieName+"=" + escape(cookieValue) + 68 "; expires=" + expire.toGMTString() + 69 "; path=/" + 70 "; domain=.connectify.me"; 71} 72 73function areCookiesEnabled() 74{ 75 var cookieEnabled = (navigator.cookieEnabled) ? true : false; 76 if (typeof navigator.cookieEnabled == "undefined" && !cookieEnabled) { 77 document.cookie="testcookie"; 78 cookieEnabled = (document.cookie.indexOf("testcookie") != -1) ? true : false; 79 } 80 return (cookieEnabled); 81} 82 83function downloadConnectify(version, source) { 84 85 /* Optimizely Tracking 86 window['optimizely'] = window['optimizely'] || []; 87 window.optimizely.push(["trackEvent", "DownloadCustom"]);*/ 88 89 /* Get the File */ 90 window.location = "https://downloads.connectify.me/?v=" + version + "&src=" + source; 91 console.log('dC', "https://downloads.connectify.me/?v=" + version + "&src=" + source); 92} 93 94function getCurrentOfferEvent(actionName, offerName) { 95 $.getJSON("/wp-aux/data/offers.json", function(json) { 96 dataLayer.push({ 97 'gaEventCategory': 'Offer Modal Overlay', 98 'gaEventAction': actionName, 99 'gaEventLabel': offerName, 100 'gaEventValue': 1, 101 'gaEventNonInteraction': true, 102 'bannerName': offerName, 103 'event': 'gaEvent' 104 }); 105 }); 106} 107 108//Get one or zero randomly 109function getOneOrZero() { 110 return Math.random() < 0.5 ? 0 : 1; 111} 112 113//Use params l, ls, disL and dislLs 114function getAppParams() 115{ 116 var l = getParameterByName('l'); 117 var ls = getParameterByName('ls'); 118 var disL = getParameterByName('disL'); 119 var disLs = getParameterByName('disLs'); 120 var lite = getParameterByName('lite'); 121 122 return { 123 l: l, 124 ls: ls, 125 disL: disL, 126 disLs: disLs, 127 lite: lite 128 }; 129 130} 131 132//Use params l, ls, disL and dislLs 133function isLiteFromApp() 134{ 135 //TODO look at the json values in the cookie cuinfo 136 //Probably also need to make sure they don't have a login even if the cookie values are set 137 138 params = getAppParams(); 139 return (params.l == 1 && params.ls == 2 && params.disL == 1 && params.disLs == 2); 140} 141 142//Use params l, ls, disL and dislLs 143function isProFromApp(l, ls, disL, disLs) 144{ 145 isPaidHotspot = (l == 2 || l == 6) && (ls == 7 || ls == 9);
146 isPaidDispatch = (disL == 2 || disL == 6) && (disLs == 7 || disLs == 9); 147 148 return isPaidHotspot || isPaidDispatch; 149} 150 151function isProFromProfile(userArray) { 152 var isHotspotPro = userArray.numberOfLicenses.Hotspot > 0; 153 var isDispatchPro = userArray.numberOfLicenses.Dispatch > 0; 154 return isHotspotPro || isDispatchPro; 155} 156 157function isPro() 158{ 159 //TODO use datalayer directly 160 var cuinfo = getCookie('_cuinfo'); 161 if (cuinfo) { 162 var json = JSON.parse(cuinfo); 163 var appArray = json['app_array']; 164 var userArray = json['user_array']; 165 return (appArray && isProFromApp( 166 appArray.hotspotLicenseType, 167 appArray.hotspotLicenseState, 168 appArray.dispatchLicenseType, 169 appArray.dispatchLicenseState 170 )) || (userArray && isProFromProfile(userArray)); 171 172 } else { 173 params = getAppParams(); 174 return isProFromApp(params.l, params.ls, params.disL, params.disLs); 175 } 176} 177 178//Get bucketed LITE URLs 179function getBucketedLiteURL() { 180 if (getOneOrZero()) { 181 //Go to download page with ?refid=testgrpA 182 return "/download/?refid=nonir"; 183 } else { 184 //Go to iron source download page 185 return "/download-lite/"; 186 } 187} 188 189//Get the URL for download buttons 190function getDownloadURL() { 191 if (isPro()) { 192 //Go to download-pro page 193 return "/download-pro/"; 194 } else { 195 /* Modify and return getBucketedLiteURL() to randomly choose 196 * two different LITE URLs or else return /download/ 197 */ 198 return "/download/"; 199 } 200} 201 202/* Refid is used to set the source to the installer. 203 * The app also sends users to the website with refid set. 204 * This is of the format 'src:SomeSoure,ref:someRef' 205 * If this user now goes and downloads off of the website 206 * the refid that gets put in the installer name gets all of 207 * the above.So we need to parse it out and use only the actual 208 * src when going to downloads2. 209 * Example refids: 210 * 1. src:dispatch_nonir,ref:videoRepeater 211 * 2. src:dispatch_nonir 212 * 3. ref:videoRepeater 213 * 4. nonir 214 */ 215function getSrcForDownload(refid) { 216 if (refid.indexOf(',') === -1 && refid.indexOf(':') === -1) { 217 if (refid.indexOf('dispatch_') === -1) { 218 return refid; 219 } else { 220 return refid.substring(9) 221 } 222 } 223 var arrays = refid.split(','); 224 var length = arrays.length; 225 for (var i = 0; i < length; i++) { 226 var subArrays = arrays[i].split(':'); 227 var subLength = subArrays.length; 228 229 for (var j = 0; j < subLength; j++) { 230 if (subArrays[j] == 'src') { 231 srcSplit = subArrays[j+1].split('_'); 232 return srcSplit[1]; 233 } 234 } 235 } 236 return ''; 237}
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.