PageSourceSearch

https://static-web.runkeeper.com/build/5864/static/oceanus/js/global.js

js runkeeper.com collected 2026-10-01 08:35:08 UTC 4,392 bytes, 170 lines download raw bytes

1/* 
2
3THIS FILE IS RESERVED FOR GLOBAL REQUIRED JS
4
5Please do not include javascript that has external dependencies.
6
7*/
8
9function setCookie(c_name,value,path,expDate,sameSite)
10{
11   var c_value = escape(value);
12   if ((typeof path !== 'undefined') && (path != null))
13   {
14      c_value += ";path=" + path;
15   }
16   if ((typeof expDate !== 'undefined') && (expDate != null))
17   {
18      c_value += ";expires=" + expDate.toUTCString();
19   }
20   if ((typeof sameSite !== 'undefined') && (sameSite != null))
21   {
22      c_value += ";SameSite=" + sameSite
23   }
24   document.cookie=c_name + "=" + c_value + ";secure";
25
26}
27
28function getCookie(c_name)
29{
30   var i,x,y,ARRcookies=document.cookie.split(";");
31   for (i=0;i<ARRcookies.length;i++)
32   {
33      x=ARRcookies[i].substr(0,ARRcookies[i].indexOf("="));
34      y=ARRcookies[i].substr(ARRcookies[i].indexOf("=")+1);
35      x=x.replace(/^\s+|\s+$/g,"");
36      if (x==c_name)
37      {
38         return unescape(y);
39      }
40   }
41   return null;
42}
43
44function deleteCookie(c_name, path) {
45   setCookie(c_name, null, path, new Date(0));
46}
47
48function openOAuthPopup(url,callback)
49{  
50   
51var userAgent = navigator.userAgent,
52 mobile = function() {
53    return /\b(iPhone|iP[ao]d)/.test(userAgent) ||
54         /\b(iP[ao]d)/.test(userAgent) ||
55         /Android/i.test(userAgent) ||
56         /Mobile/i.test(userAgent);
57   },
58   popupWidth = 780,
59   popupHeight = 650,
60   screenX = typeof window.screenX != 'undefined' ? window.screenX : window.screenLeft,
61   screenY = typeof window.screenY != 'undefined' ? window.screenY : window.screenTop,
62   outerWidth = typeof window.outerWidth != 'undefined' ? window.outerWidth : document.documentElement.clientWidth,
63   outerHeight = typeof window.outerHeight != 'undefined' ? window.outerHeight : document.documentElement.clientHeight - 22,
64   targetWidth = mobile() ? null : popupWidth,
65   targetHeight = mobile() ? null : popupHeight,
66   V = screenX < 0 ? window.screen.width + screenX : screenX,
67   left = parseInt(V + (outerWidth - targetWidth) / 2, 10),
68   right = parseInt(screenY + (outerHeight - targetHeight) / 2.5, 10)
69
70   var popupWindow = window.open(url, "oauthPopup", "width=" + popupWidth + ", height=" + popupHeight + ", left=" + left + ", top=" + right + ", directories=no, titlebar=no, toolbar=no,location=no, status=no, menubar=no,scrollbars=no,resizable=no");
71
72   if (typeof callback !== "undefined")
73   {
74      var timer = setInterval(function() {
75         if(popupWindow.closed)
76         {
77            clearTimeout(timer);
78            callback();
79         }
80      }, 1000);
81   }
82}
83
84
85function oAuthDisconnect(disconnectUrl,callback) {             
86   $.get(disconnectUrl,callback);
87}
88
89function emailCheck(emailStr)
90{
91   var checkTLD=1;
92   var knownDomsPat=/^(com|net|org|edu|int|mil|gov|arpa|biz|aero|name|coop|info|pro|museum|cat|asia|mobi|xxx|scot)$/i;
93   var emailPat=/^(.+)@(.+)$/;
94   var specialChars="\\(\\)><@,;:\\\\\\\"\\.\\[\\]";
95   var validChars="\[^\\s" + specialChars + "\]";
96   var quotedUser="(\"[^\"]*\")";
97   var ipDomainPat=/^\[(\d{1,3})\.(\d{1,3})\.(\d{1,3})\.(\d{1,3})\]$/;
98   var atom=validChars + '+';
99   var word="(" + atom + "|" + quotedUser + ")";
100   var userPat=new RegExp("^" + word + "(\\." + word + ")*$");
101   var domainPat=new RegExp("^" + atom + "(\\." + atom +")*$");
102   var matchArray=emailStr.match(emailPat);
103
104   if (matchArray==null)
105   {
106      return false;
107   }
108   
109   var user=matchArray[1];
110   var domain=matchArray[2];
111
112   for (i=0; i<user.length; i++)
113   {
114      if (user.charCodeAt(i)>127)
115      {
116         return false;
117      }
118   }
119   
120   for (i=0; i<domain.length; i++)
121   {
122      if (domain.charCodeAt(i)>127)
123      {
124         return false;
125      }
126   }
127
128   if (user.match(userPat) == null)
129   {
130      return false;
131   }
132
133   var IPArray=domain.match(ipDomainPat);
134
135   if (IPArray!=null)
136   {
137      for (var i=1;i<=4;i++)
138      {
139         if (IPArray[i]>255)
140         {
141            return false;
142         }
143      }
144      return true;
145   }
146
147   var atomPat=new RegExp("^" + atom + "$");
148   var domArr=domain.split(".");
149   var len=domArr.length;
150
151   for (i=0;i<len;i++)
152   {
153      if (domArr[i].search(atomPat) == -1)
154      {
155         return false;
156      }
157   }
158
159   if (checkTLD && domArr[domArr.length-1].length!=2 && domArr[domArr.length-1].search(knownDomsPat)==-1)
160   {
161      return false;
162   }
163
164   if (len<2)
165   {
166      return false;
167   }
168
169   return true;
170}

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.