1/** 2 * @fileOverview LiercoPopup 3 */ 4 5(function ($) { 6 'use strict'; 7 8 /** 9 * LiercoPopup NX 10 * @constructor 11 */ 12 var LiercoPopup = function () { 13 this.initialize.apply(this, arguments); 14 }; 15 16 /** 17 * ú» 18 */ 19 LiercoPopup.prototype.initialize = function (options) { 20 this.config = $.extend({}, options); 21 }; 22 23 /** 24 * Às 25 */ 26 LiercoPopup.prototype.run = function () { 27 this.fetch(); 28 }; 29 30 /** 31 * f[^ðûW·é 32 * @returns {Promise} 33 */ 34 LiercoPopup.prototype.fetch = function () { 35 var self = this; 36 37 $ 38 .ajax({ 39 url: 'https://s9.r-ad.ne.jp/json', 40 dataType: 'JSON', 41 data: { 42 f: this.config.f, 43 m: this.config.m, 44 kid: this.config.kid 45 }, 46 timeout: 5000 47 }) 48 .done(function (json) { 49 if (json.length) { 50 self.setup(); 51 self.render(json); 52 } 53 }); 54 }; 55 56 /** 57 * GRgÇÁ 58 */ 59 LiercoPopup.prototype.setup = function () { 60 var modalFrame = (function () {/* 61 <div class="liercoPopup js-liercoPopup js-liercoPopupClose"> 62 <div class="liercoPopup__content js-liercoPopupContent"> 63 <span class="ji ji-close-round liercoPopup__close js-liercoPopupClose"></span> 64 <div class="liercoPopup__banner js-liercoPopupBanner"></div> 65 </div> 66 </div> 67 */}).toString().match(/[^]*\/\*([^]*)\*\/\}$/)[1]; 68 69 $('body').append(modalFrame); 70 }; 71 72 /** 73 * GR`æ 74 */ 75 LiercoPopup.prototype.render = function (data) { 76 var self = this; 77 var liercoItem = data[0]; 78 var $a = $('<a>').attr('href', liercoItem.link_url).addClass('js-liercoPopupLink'); 79 var $img = $('<img>').attr('src', liercoItem.image_url); 80 var $liercoPopupBanner = $('.js-liercoPopupBanner'); 81 82 $a.append($img); 83 $liercoPopupBanner.append($a); 84 85 $img.on('load', function () { 86 $('html,body').addClass('showLiercoPopup'); 87 self.setEvents(); 88 }); 89 }; 90 91 /** 92 * CxgÝè 93 */ 94 LiercoPopup.prototype.setEvents = function () { 95 var self = this; 96 97 $('.js-liercoPopupClose').on('click.liercoPopupClose', function () { 98 self.close(); 99 self.hide(); 100 }); 101 102 $('.js-liercoPopupContent').on('click.liercoPopupContent', function (e) { 103 e.stopPropagation(); 104 }); 105 106 $('.js-liercoPopupLink').on('click.liercoPopupLink', function () { 107 self.hide(); 108 }); 109 }; 110 111 /** 112 * ¶é 113 */ 114 LiercoPopup.prototype.close = function () { 115 $('.js-liercoPopup').remove(); 116 $('html,body').removeClass('showLiercoPopup'); 117 }; 118 119 /** 120 * Ä\¦µÈ¢æ¤É·éBlocalStorageÌÛLúÀÉ˶·é 121 * localStorageo^AZingÉàlª¯ú³êé 122 * @see https://developer.mozilla.org/ja/docs/Web/API/Storage/setItem 123 */ 124 LiercoPopup.prototype.hide = function () { 125 try { 126 localStorage.setItem(this.config.storageKey, this.config.f); 127 128 } catch (e) { 129 return; 130 } 131 }; 132 133 window.LiercoPopup = LiercoPopup; 134 135})(window.jQuery); 136 137$(function () { 138 var getCookie = function (name) { 139 var cookies = '; ' + document.cookie; 140 var values = cookies.split('; ' + name + '='); 141 return 1 < values.length ? values[1].split(';')[0] : ''; 142 }; 143 144 // OCÏ©ð»f·é 145 var capId = getCookie('jln_m').split('#')[2]; 146 if (!capId) return; 147 148 // Ýèt@Cðæ¾ 149 $.ajax({ 150 url: '/jalan/doc/jalanLiercoPopup_pc_f.json', 151 dataType: 'json', 152 timeout: 5000 153 }) 154 .done(function (json) { 155 // \oÝèªÈ¢êÍI¹ 156 if (!json || !json.f) return; 157 var frameId = json.f; 158 159 var storageKey = 'viewLiercoPopup'; 160 var storageValue = localStorage.getItem(storageKey); 161 162 // localStorageÉ\oÏÌLIDª¶ÝµA»Ý\oÝèÌLIDÆêvµÄ¢éêA\oÏÆÝÈ· 163 if (storageValue && storageValue === frameId) return; 164 165 // ZingÎÌuEUÌÝAZingðmF 166 if (window.zingTarget) { 167 var zingKey = localStorage.getItem('__zing__'); 168 169 // __zing__o^LÌêAù\of[^ÍÈ¢×A|bvAbv\oÉÚs 170 if (zingKey) { 171 popUpCall(); 172 return; 173 }; 174 175 // __zing__o^³ÌêAZingÉÛ¶³êÄ¢éÂ\«ª é×ApulledCxgmFðs¤ 176 function zingPulled() { 177 var zingData = null; 178 return new Promise(function(resolve, reject){ 179 window.addEventListener('ZingStorage__pulled', function(e) { 180 zingData = e.detail; 181 }); 182 183 var timeOutId = setTimeout(function () { 184 clearInterval(timerId); 185 reject(); 186 }, 5000); 187 188 var timerId = setInterval(function () { 189 if (zingData !== null) { 190 clearInterval(timerId); 191 clearTimeout(timeOutId); 192 resolve(zingData); 193 } 194 }, 1000); 195 }); 196 } 197 198 zingPulled().then(function (zingData) { 199 // ZingÉo^ÏÌf[^ª¶ÝµAZingo^lÆ\oÝèlªêv·éêAI¹ 200 if (zingData.viewLiercoPopup && zingData.viewLiercoPopup === frameId) return; 201 // ¢\oÌêÍ|bvAbv\oÉÚs·é 202 popUpCall(); 203 204 }).catch(function (error) { 205 // G[ÌêÍI¹ 206 return; 207 }); 208 209 } else { 210 // ñÎuEUÌêAZingÍmFµÈ¢ 211 popUpCall(); 212 } 213 214 function popUpCall () { 215 var 216 kid = getCookie('r_ad_token2'), 217 opt = { 218 f: frameId, 219 m: '1', 220 kid: kid, 221 storageKey: storageKey 222 }; 223 224 if (kid) { 225 new window.LiercoPopup(opt).run(); 226 return; 227 } 228 229 var timerId = setInterval(function () { 230 var kid = getCookie('r_ad_token2'); 231 if (kid) { 232 clearInterval(timerId); 233 opt.kid = kid; 234 new window.LiercoPopup(opt).run(); 235 return; 236 } 237 }, 1000); 238 setTimeout(function () { 239 clearInterval(timerId); 240 }, 10000); 241 }; 242 243 }); 244});
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.