1var hide = 'slideUp'; 2var show = 'slideDown'; 3var actual_mode = 'nothing'; 4 5window.MDCTextField = mdc.MDCTextField; 6window.MDCSnackbar = mdc.MDCSnackbar; 7window.MDCCheckbox = mdc.MDCCheckbox; 8window.MDCMenu = mdc.MDCMenu; 9window.MDCSelect = mdc.MDCSelect; 10window.MDCFormField = mdc.MDCFormField; 11window.MDCRadio = mdc.MDCRadio; 12 13Messenger.options = { 14 extraClasses: 'messenger-fixed messenger-on-top', 15 theme: 'flat', 16}; 17 18function LoginMode() { 19 actual_mode = 'login'; 20 RegisterFunct(0); 21 22 $('#foo1').show(); 23 24 $('#welcome')[hide](); 25 26 $('#login-register')[show](); 27 28 return false; 29} 30 31function SignMode() { 32 var passwordmode = actual_mode == 'password'; 33 actual_mode = 'signup'; 34 RegisterFunct(1); 35 36 $('#foo1').show(); 37 $('#welcome')[hide](); 38 $('#login-register')[show](); 39 40 if (passwordmode) { 41 $('#resetA')[hide](); 42 $('#entireLogic')[show](); 43 } 44 45 return false; 46} 47 48function PasswordLoss() { 49 actual_mode = 'password'; 50 $('#foo1').hide(); 51 52 $('#foo2').show(); 53 54 $('#entireLogic')[hide](); 55 56 $('#resetA')[show](); 57 58 return false; 59} 60 61function LoginBack() { 62 $('#foo2').hide(); 63 64 $('#foo1').show(); 65 66 $('#resetA')[hide](); 67 68 $('#entireLogic')[show](); 69 70 return false; 71} 72 73function RegisterFunct(i) { 74 var l = $('.login-mode'); 75 var s = $('.sign-mode'); 76 if (i) { 77 l.hide(); 78 //l.parents('.control-group:first').hide(); 79 80 //s.parents('.control-group:first').show(); 81 s.show(); 82 83 $('#logincmd').val('register'); 84 } else { 85 //l.parents('.control-group:first').show(); 86 l.show(); 87 88 s.hide(); 89 //s.parents('.control-group:first').hide(); 90 91 $('#logincmd').val('login'); 92 } 93} 94 95function detectIE() { 96 var ua = window.navigator.userAgent; 97 var msie = ua.indexOf('MSIE '); 98 var trident = ua.indexOf('Trident/'); 99 100 if (msie > 0) { 101 // IE 10 or older => return version number 102 return parseInt(ua.substring(msie + 5, ua.indexOf('.', msie)), 10); 103 } 104 105 if (trident > 0) { 106 // IE 11 (or newer) => return version number 107 var rv = ua.indexOf('rv:'); 108 return parseInt(ua.substring(rv + 3, ua.indexOf('.', rv)), 10); 109 } 110 111 // other browser 112 return false; 113} 114 115function LoginFormPayload(fr) { 116 if ($('.magic-link-mode.login-mode:visible').length > 0) { 117 return false; 118 } 119 return true; 120 121 var f = $(fr); 122 var btns = f.find('[type="submit"], [type="button"]'); 123 $.ajax({ 124 beforeSend: function () { 125 btns.attr('disabled', 'disabled'); 126 }, 127 dataType: 'json', 128 type: 'post', 129 data: f.serialize() + '&ajax_mode=1', 130 url: f.attr('action'), 131 complete: function () { 132 btns.removeAttr('disabled'); 133 }, 134 success: function (data) { 135 if (data && data.data) { 136 data = data.data; 137 } 138 139 if (data['login_success'] || data['registered']) { 140 window.location.href = data.login_success_link; 141 return; 142 } 143 144 if (data && data.requires_2fa && data.verify_url) { 145 window.location.href = data.verify_url; 146 return; 147 } 148 149 $('#whole').html(data.content || ''); 150 151 RegisterFunct($('#logincmd').val() == 'register'); 152 }, 153 }); 154 155 return false; 156} 157 158$(function () { 159 var rr = function () { 160 $('.access-front').css('min-height', $(window).height() - 220); 161 }; 162 $(window).bind('resize orientationchange', rr); 163 164 rr(); 165 166 if (window.MobileApp) { 167 window.MobileApp.postMessage(JSON.stringify({ logout: true })); 168 } 169 170 var poolLogin = function (form, tok, attempt) { 171 if (attempt > 60 * 20) { 172 return; 173 } 174 var url = form.find('[name="cordova_login_link"]').val(); 175 console.log(form, 'url ', url); 176 var focused = false; 177 $.ajax({ 178 type: 'post', 179 dataType: 'json', 180 data: form.serialize(), 181 url: url + '?id=' + tok, 182 success: function (data) { 183 if (!data.login) { 184 setTimeout(function () { 185 poolLogin(form, tok, attempt + 1); 186 }, 1000); 187 if (!focused) { 188 focused = true; 189 window.focus(); 190 } 191 if (cordovaState.closeWindows) { 192 cordovaState.closeWindows(); 193 } 194 } else if (data.redirect) { 195 window.location.href = data.redirect; 196 } 197 }, 198 error: function () { 199 setTimeout(function () { 200 poolLogin(form, tok, attempt + 1); 201 }, 1000); 202 }, 203 }); 204 }; 205 206 $('.social-login-monitor').on('click', function (e) { 207 var token = $(this).attr('data-social-token'); 208 if (!token) { 209 return; 210 } 211 poolLogin($('.submission-form'), token, 1); 212 }); 213 214 var aa = $('.story-box'); 215 216 aa.hover( 217 function () { 218 var ba = $(this); 219 220 ba.find('.inner').addClass('active', 400); 221 }, 222 function () { 223 $(this).find('.inner').removeClass('active', 400); 224 } 225 ); 226 227 var fn = function () { 228 var that = $(this); 229 $('.large-pointer span') 230 .stop() 231 .fadeOut(200, function () { 232 aa.removeClass('active'); 233 that.addClass('active'); 234 $('.large-pointer span') 235 .stop() 236 .fadeIn(300) 237 .html(that.find('.hidden').html()); 238 }); 239 240 var where = that.data('arrow_position'); 241 if (where == 'left') { 242 where = { 243 marginRight: 'auto', 244 }; 245 } else if (where == 'right') { 246 where = { 247 marginLeft: 'auto', 248 }; 249 } else if (where == 'center') { 250 where = { 251 margin: 'auto', 252 }; 253 } 254 255 $('.svg-wrapper').css(where); 256 }; 257 258 $('.godown').click(function (e) { 259 $('html, body').animate( 260 { 261 scrollTop: $('#starter').offset().top, 262 }, 263 1000 264 ); 265 266 e.preventDefault(); 267 return false;
268 }); 269 270 $('.parallax-window').parallax(); 271 272 $('.control-group').addClass('form-group'); 273 274 $('.nextslide').click(function (e) { 275 var href = $(this).attr('href'); 276 if (href.indexOf('#') === 0) { 277 $('.tab-menu a[href="' + href + '"]').click(); 278 return e.preventDefault(); 279 } 280 }); 281 282 var pppc = function () { 283 var introtext = $('.intro-text'); 284 introtext.css('padding-top', '0px'); 285 286 var offd = $(window).height() - introtext.height(); 287 288 if ($('.navbar-toggle').css('display') == 'none') { 289 var offdr = offd / 2; 290 291 if (offdr < 200) { 292 offdr = 200; 293 } 294 295 introtext.css({ 296 'padding-top': offdr, 297 'padding-bottom': offdr, 298 }); 299 } else { 300 offd = offd - 120; 301 if (offd < 190) { 302 offd = 190; 303 } 304 305 introtext.css({ 306 'padding-top': offd * 0.6, 307 'padding-bottom': offd * 0.4, 308 }); 309 } 310 311 var checkAutoComplete = function () { 312 $( 313 'input:-webkit-autofill, textarea:-webkit-autofill, select:-webkit-autofill' 314 ).each(function () { 315 var that = $(this); 316 var next = that.next(); 317 if ( 318 next.hasClass('mdc-notched-outline') && 319 !next.hasClass('mdc-notched-outline--notched') && 320 window.innerWidth > 1024 321 ) { 322 var ref = that.data('mdcTextField'); 323 if (ref) { 324 ref.foundation_.activateFocus(); 325 /* 326 327 var adp = ref.foundation_.adapter_; 328 adp.floatLabel(true); 329 adp.notchOutline(adp.getLabelWidth()); 330 */ 331 } 332 next 333 .addClass('mdc-notched-outline--notched') 334 .find('.mdc-floating-label') 335 .addClass('mdc-floating-label--float-above'); 336 } 337 }); 338 }; 339 340 checkAutoComplete(); 341 342 setInterval(checkAutoComplete, 1000); 343 }; 344 345 $(window).load(pppc); 346 347 $('.nav-tabs-awl').tabs({ 348 show: true, 349 }); 350 351 $('.focus-login-form').on('focus', function () { 352 var elmnt = $(this).parents('form:first').find('[type="submit"]'); 353 if (elmnt.get(0)) { 354 elmnt.get(0).scrollIntoView(); 355 } 356 }); 357 358 $('ul.tab-menu-mobile li').on('click', function () { 359 $('html,body').animate( 360 { scrollTop: $('#overview').offset().top - 80 }, 361 400 362 ); 363 }); 364 365 window.isTextualInput = function (that) { 366 for (let k of [ 367 'text', 368 'color', 369 'number', 370 'email', 371 'tel', 372 'date', 373 'time', 374 'password', 375 'date', 376 'time', 377 'datetime', 378 ]) { 379 if ($(that).find('input[type="' + k + '"]').length) { 380 return true; 381 } 382 } 383 }; 384 385 $('.mdc-checkbox').each(function () { 386 if ($(this).data('mdcTextField')) { 387 return; 388 } 389 let checkbox = new MDCCheckbox(this); 390 $(this).data('mdcTextField', checkbox); 391 let formField = new MDCFormField( 392 $(this).parents('.mdc-form-field:first')[0] 393 ); 394 formField.input = checkbox; 395 }); 396 397 $('.mdc-menu').each(function () { 398 if ($(this).data('mdcTextField')) { 399 return; 400 } 401 var menu = new MDCMenu(this); 402 $(this).data('mdcTextField', menu); 403 var anch = $('[data-trigger-menu="' + $(this).attr('id') + '"]').get(0); 404 menu.setAnchorElement(anch); 405 }); 406 407 $('.mdc-select').each(function () { 408 if ($(this).data('mdcTextField')) { 409 return; 410 } 411 var select = new MDCSelect($(this).get(0)); 412 $(this).data('mdcTextField', select); 413 var ow = $(this).width(); 414 if (ow) { 415 $(this).find('.mdc-menu').width(ow); 416 } 417 var that = $(this).find('[type="hidden"]'); 418 select.listen('MDCSelect:change', function () { 419 that.change(); 420 }); 421 }); 422 423 $('.mdc-snackbar').each(function () { 424 var snck = new MDCSnackbar($(this).get(0)); 425 snck.timeoutMs = 10000; 426 snck.open(); 427 }); 428 429 $('.material-radio').each(function () { 430 if ($(this).data('mdcTextField')) { 431 return; 432 } 433 var radio = new MDCRadio($(this).find('.mdc-radio').get(0)); 434 $(this).data('mdcTextField', radio); 435 var formField = new MDCFormField($(this).get(0)); 436 formField.input = radio; 437 }); 438 439 $('.mdc-text-field').each(function () { 440 if ($(this).data('mdcTextField')) { 441 return; 442 } 443 var ref; 444 var textarea = $(this).find('textarea').length; 445 if (textarea) {
446 try { 447 ref = new MDCTextField($(this).get(0)); 448 } catch (e) { 449 console.error('failed attaching to ', this, e); 450 } 451 } else if (isTextualInput(this)) { 452 try { 453 ref = new MDCTextField($(this).get(0)); 454 } catch (e) { 455 console.error('failed attaching to ', this, e); 456 } 457 } 458 $(this).data('mdcTextField', ref); 459 var that = $(this); 460 $(this) 461 .find('input, textarea') 462 .on('change', function () { 463 if (this.value && !that.hasClass('mdc-text-field--label-floating')) { 464 that.addClass('mdc-text-field--label-floating'); 465 that 466 .find('.mdc-notched-outline--upgraded') 467 .addClass('mdc-notched-outline--notched'); 468 that 469 .find('.mdc-floating-label') 470 .addClass('mdc-floating-label--float-above'); 471 } 472 }) 473 .change(); 474 }); 475 476 //aa.click(fn); 477 478 // $.proxy(fn, $('.story-box.init-active'))(); 479});
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.