1(function ($) { 2 'use strict'; 3 4 $(function () { 5 cookie_check(); 6 }); 7 8 function cookie_check(){ 9 let cookie = getCookie('oly_enc_id'); 10 if(cookie !== null && cookie !== 'null'){ 11 cookie = cookie.replace(new RegExp('"', 'g'), ''); 12 if(pass_id_object.debug === '1'){ 13 console.log('cookie', cookie); 14 } 15 pass_authenticated_id(cookie); 16 } 17 } 18 19 function getCookie(name) { 20 // Split cookie string and get all individual name=value pairs in an array 21 var cookieArr = document.cookie.split(";"); 22 23 // Loop through the array elements 24 for(var i = 0; i < cookieArr.length; i++) { 25 var cookiePair = cookieArr[i].split("="); 26 27 /* Removing whitespace at the beginning of the cookie name 28 and compare it with the given string */ 29 if(name == cookiePair[0].trim()) { 30 // Decode the cookie value and return 31 return decodeURIComponent(cookiePair[1]); 32 } 33 } 34 35 // Return null if not found 36 return null; 37 } 38 39 function pass_authenticated_id(id){ 40 let $link = $(pass_id_object.pass_id_class); 41 42 $link.each(function(index){ 43 if(typeof $(this).attr('href') !== 'undefined'){ 44 let $l = $(this); 45 let oldUrl = $l.attr('href'); 46 let newUrl = oldUrl + '?oly_enc_id='+id; 47 $l.attr('href', newUrl); 48 } else { 49 let $l = $(this).find('a'); 50 let oldUrl = $l.attr('href'); 51 let newUrl = oldUrl + '?oly_enc_id='+id; 52 $l.attr('href', newUrl); 53 } 54 55 }) 56 57 } 58 59})(jQuery);
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.