1 2function isDesktop() { 3 var result = window.innerWidth > 1375; 4 return result; 5} 6 7$(document).ready(function () { 8 // Un-comment for local testing 9 // baseRedirectUrl = 'http://localhost:3000'; 10 baseRedirectUrl = 'https://app.geniusu.com'; 11 12 baseUrl = () => { 13 if (typeof baseRedirectUrl !== 'undefined') { 14 return baseRedirectUrl; 15 } else { 16 return 'https://app.geniusu.com'; 17 } 18 }; 19 20 // Link replacement 21 if (typeof baseRedirectUrl !== 'undefined') { 22 $(document).on('click', '.link_replace', function (e) { 23 e.preventDefault(); 24 var href = $(this).attr('href'); 25 var redirectUrl = href.replace('https://app.geniusu.com', baseRedirectUrl); 26 window.location.href = redirectUrl; 27 }); 28 } 29 30 // Authentication 31 function setAuthenticatedView(isAuthenticated) { 32 localStorage.setItem('isAuthenticated', isAuthenticated); 33 34 if (isAuthenticated) { 35 $('#join_for_free, #log_in, .get_started_button').addClass('d-none'); 36 $('#back_to_app, .continue_journey_button').removeClass('d-none'); 37 } else { 38 $('#back_to_app, .continue_journey_button').addClass('d-none'); 39 $('#join_for_free, #log_in, .get_started_button').removeClass('d-none'); 40 } 41 } 42 43 function checkAuthenticated() { 44 url = `${baseUrl()}/api/v1/users/authenticated`; 45 46 $.ajax({ 47 url: url, 48 timeout: 5000, 49 xhrFields: { 50 withCredentials: true, 51 crossDomain: true 52 }, 53 error: function () { 54 setAuthenticatedView(false); 55 }, 56 success: function (result) { 57 setAuthenticatedView(result.authenticated); 58 } 59 }); 60 } 61 62 checkAuthenticated(); 63 64 // Quiz 65 quizLoadedFromHomepage = true; 66 67 $('#main-menu .dropdown').hover(function(event) { 68 if (isDesktop()) { 69 if (event.type === 'mouseenter') { 70 $(this).addClass('open'); 71 $(this).find('.fa-caret-down').addClass('gu-dropdown-icon-rotate'); 72 } 73 74 if (event.type === "mouseleave") { 75 $(this).removeClass('open'); 76 return $(this).find('.fa-caret-down').removeClass('gu-dropdown-icon-rotate'); 77 } 78 } 79 }); 80});
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.