1$(function(){ 2 var $flbnr = $('.floatingbnr'); 3 var $btn = $('.floatingbnr-btn', $flbnr); 4 var newURL = $btn.data('flbnr_new_url'); // æ°è¦åããªã³ã¯ 5 var exisURL = $btn.data('flbnr_exis_url'); // æ¢ååããªã³ã¯ 6 var bnrID = $btn.data('flbnr_id'); // ããã¼åºæID 7 var bnrExpir = $btn.data('flbnr_expir'); // é表示æéï¼æ¥æ°ï¼ 8 var $closeBtn = $('.floatingbnr-close a', $flbnr); 9 var isNew = localStorage.tabNumber==2 ? false : true; // æ°è¦ï¼æ¢åã®localStrageãèªãã§å¤å® 10 var isClosed = document.cookie.indexOf('flbnr=' + bnrID) !== -1 ? true : false; // éãããã©ãã 11 //var isClosed = localStorage.flbnrStatus.getItem(''); 12 var observer_tabNew = new MutationObserver(function(rec,obs){ // ã¿ãåãæ¿ãç£è¦ 13 $(rec[0].target).hasClass('act') ? isNew = true : isNew = false; 14 bannerReplace(); 15 }); 16 var $pagetop = $('.totop'); //ãã¼ã¸ãããã«ãã©ããã¿ã³ 17 var observer_totop = new MutationObserver(function(rec,obs){ 18 pagetopBtnPos($(rec[0].target)); 19 }); 20 21 function bannerReplace(){ 22 if(isNew){ 23 $btn.attr('href', newURL); 24 $btn.addClass('floatingbnr-btn-new'); 25 $btn.removeClass('floatingbnr-btn-exis'); 26 } else { 27 $btn.attr('href', exisURL); 28 $btn.removeClass('floatingbnr-btn-new'); 29 $btn.addClass('floatingbnr-btn-exis'); 30 } 31 } 32 33 function displayBanner(){ 34 if(isClosed){ 35 $flbnr.fadeOut(400); 36 } else { 37 $flbnr.fadeIn(400); 38 } 39 } 40 41 function bannerClose(){ 42 var now = new Date(); 43 var maxAge = bnrExpir * 60 * 60 * 24; 44 now.setDate(now.getDate() + bnrExpir); 45 document.cookie = 'flbnr=' + bnrID + '; max-age=' + maxAge + '; expires=' + now.toUTCString(); 46 isClosed = true; 47 displayBanner(); 48 } 49 50 function pagetopBtnPos($tgt){ 51 if( $tgt.hasClass('fixed') ){ 52 $pagetop.css({ bottom: $btn.innerHeight() + 35 }); 53 } else { 54 $pagetop.css({ bottom: 'auto' }); 55 } 56 } 57 58 bannerReplace(); 59 displayBanner(); 60 pagetopBtnPos($pagetop); 61 62 observer_tabNew.observe( $('.tab-underreview')[0], { 63 attributes: true, 64 }); 65 66 observer_totop.observe( $pagetop[0], { 67 attributes: true, 68 attributeFilter: ["class"], 69 }); 70 71 $closeBtn.on('click', function(ev){ 72 ev.preventDefault(); 73 bannerClose(); 74 }) 75 76 77});
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.