1/** 2 * config.js: ver 1.0.7 3 * å ¨ãã¼ã¸å ±éï¼YOUï¼ 4 * 5 * 䏿忢, å¤ã®æ¯è¼ 6 * ãªãã¤ã¬ã¯ã, 404ãã¼ã¸ 7 * æ¥ä»ãã©ã¼ããã, æéãã©ã¼ããã, æé 8 * URLãã©ã¡ã¼ã¿ããªãã¸ã§ã¯ãåãã¦è¿å´, URLãã©ã¡ã¼ã¿ã夿´ï¼å¼æ°ã§ç½®æï¼, ãã©ã¡ã¼ã¿ãåå¾, URLãã©ã¡ã¼ã¿ã追å & setQryã«ãã¹ãã§å¤æ´ 9 * å ç¥è¦ç´ ã®åå¾ 10 * ãµã¤ãã¡ãã¥ã¼ã®è¿½å , ãã³ããã®è¿½å , ããã¿ã¼ãã¿ã³ã®è¿½å , ã¬ã³ã¡ã³ãååã®è¿½å , Appããã¼ã®è¡¨ç¤º 11 * 12 * Last Modified - 2026.03.26 13 * shelpassããã¼ãé表示 14 */ 15(function (global) { 16 'use strict'; 17 18 var href = location.href, 19 pathname = location.pathname, 20 search = location.search, 21 hash = location.hash, 22 device = Flgs.device; 23 24 var d = document, 25 main = d.querySelector('main.region-main'), 26 root = d.querySelector('#contents'), 27 bread = d.querySelector('.site-main'), 28 footer = d.querySelector('.contents.footer'), 29 recommend = d.querySelector('.contents.recommend'), 30 app = d.querySelector('.contents.app'); 31 32 var brandObject = '/campaign/asset/json/brand.json', 33 sideMenuFile = '/operation/common/html/pc/leftnavi.html', 34 swsRoot = '/sws/r/rSWS', 35 errorPage = '/CustomError/Error404_sws.html'; 36 37 var CONFIG = { 38 // 䏿忢 39 sleep: function (e) { return new Promise(function (resolve) { setTimeout(resolve, e) }); }, 40 // å¤ã®æ¯è¼ 41 result: function (e) { return (e === null || e === undefined || e === '') ? false : true; }, 42 // ãªãã¤ã¬ã¯ã 43 redirect: function (e) { location.replace(e); }, 44 // 404 ãã¼ã¸ 45 error: function () { location.replace(errorPage); }, 46 // æ¥ä»ãã©ã¼ããã 47 formatDate: function () { 48 var date = new Date(), array = []; 49 array[0] = date.getFullYear(); 50 array[1] = (date.getMonth() + 1).toString().padStart(2, 0); 51 array[2] = date.getDate().toString().padStart(2, 0); 52 return array.join(''); 53 }, 54 // æéãã©ã¼ããã 55 formatTime: function () { 56 var date = new Date(), array = []; 57 array[0] = date.getHours().toString().padStart(2, 0); 58 array[1] = date.getMinutes().toString().padStart(2, 0); 59 array[2] = date.getSeconds().toString().padStart(2, 0); 60 return array.join(''); 61 }, 62 // æé 63 getTimed: function (start, end) { 64 var today = CONFIG.formatDate()+CONFIG.formatTime(); 65 return (start <= today && end >= today) ? true : false; 66 }, 67 // URLãã©ã¡ã¼ã¿ããªãã¸ã§ã¯ãåãã¦è¿å´ 68 getQry: function () { 69 var obj = {}; 70 if (CONFIG.result(search)) { 71 search.substring(1).split('&').forEach(function (e) { 72 obj[e.split('=')[0]] = e.split('=')[1]; 73 }); 74 } 75 return obj; 76 }, 77 // URLãã©ã¡ã¼ã¿ã夿´ï¼å¼æ°ã§ç½®æï¼ 78 setQry: function (arg) { 79 search = CONFIG.result(search) ? search.replace(search, arg) : arg; 80 search = CONFIG.result(search) ? '?'+search : ''; 81 hash = location.hash ? hash : ''; 82 history.replaceState(null, null, pathname+search+hash); 83 }, 84 // URLãã©ã¡ã¼ã¿ãåå¾ 85 getSRCH: function (key) { 86 var params = new URLSearchParams(search); 87 return params.get(key); 88 }, 89 // URLãã©ã¡ã¼ã¿ã追å & setQryã«ãã¹ãã§å¤æ´ 90 setSRCH: function (key, val) { 91 var params = new URLSearchParams(search); 92 params.set(key, val); 93 return params.toString(); 94 }, 95 // å ç¥è¦ç´ ã®åå¾ 96 closest: function (node, selector) { 97 return (node.closest || function (_selector) { 98 do { 99 if ((node.matches || node.msMatchesSelector).call(node, _selector)) { 100 return node; 101 } 102 node = node.parentElement || node.parentNode; 103 } while (node !== null && node.nodeType === 1); 104 return null; 105 }).call(node, selector); 106 }, 107 // ãµã¤ãã¡ãã¥ã¼ã®è¿½å 108 setSideMenu: function () { 109 if (!main) return; 110 if (!Flgs.sidemenu) return; 111 if (!(device === 'pc')) return; 112 fetch(sideMenuFile).then(function (r) { 113 return r.text(); 114 }).then(function (res) { 115 main.insertAdjacentHTML('beforebegin', '<div class="region-nav" id="leftnavi">'+res+'</div>'); 116 }).catch(function (err) { 117 console.error(err); 118 }); 119 }, 120 // ãã³ããã®è¿½å 121 // ããã¿ã¼ãã¿ã³ã®è¿½å 122 setCommonElements: function () { 123 var arr = { format: '', brand: '' }; 124 if (CONFIG.result(CONFIG.getSRCH('brand'))) { 125 arr.format = 'full'; 126 arr.brand = CONFIG.getSRCH('brand'); 127 } else { 128 arr.format = 'short'; 129 arr.brand = pathname.split('/').slice(-1)[0].split('_')[0]; 130 } 131 fetch(brandObject).then(function (r) { 132 return r.json(); 133 }).then(function (res) { 134 CONFIG.setBreadCrumbs(res, arr.format, arr.brand); 135 CONFIG.setFooterButtons(res, arr.format, arr.brand); 136 }); 137 }, 138 // ãã³ãã 139 setBreadCrumbs: function (arg, format, brand) { 140 if (!bread) return; 141 if (!Flgs.bread) return; 142 var arr = { 143 brandTop: '', 144 brandName: '', 145 breadCrumbs: [] 146 }; 147 for (var i=0; i<arg.length; i++) { 148 if (brand === arg[i][format]) { 149 arr.brandTop = arg[i].brandtop; 150 arr.brandName = arg[i].brand; 151 break; 152 } 153 } 154 var aspx = pathname.split('/').slice(-1)[0]; 155 switch (aspx) { 156 case 'news.aspx': 157 arr.breadCrumbs[0] = {link: swsRoot, text: 'TOP'}; 158 arr.breadCrumbs[1] = {link: pathname, text: 'ãã¥ã¼ã¹ä¸è¦§'}; 159 arr.breadCrumbs[2] = CONFIG.result(CONFIG.getSRCH('article')) ? {link: '', text: '詳細'} : ''; 160 break; 161 case 'topics.aspx':
162 case 'catalog.aspx': 163 var pageName = aspx.split('.')[0].toUpperCase(); 164 arr.breadCrumbs[0] = {link: swsRoot, text: 'TOP'}; 165 arr.breadCrumbs[1] = (CONFIG.result(arr.brandTop) && arr.brandTop !== swsRoot) ? {link: arr.brandTop, text: arr.brandName} : {link: '', text: pageName}; 166 arr.breadCrumbs[2] = (CONFIG.result(arr.brandTop) && arr.brandTop !== swsRoot) ? {link: '', text: pageName} : ''; 167 break; 168 default: 169 arr.breadCrumbs[0] = {link: swsRoot, text: 'TOP'}; 170 arr.breadCrumbs[1] = (CONFIG.result(arr.brandTop) && arr.brandTop !== swsRoot) ? {link: arr.brandTop, text: arr.brandName} : {link: '', text: Flgs.title}; 171 arr.breadCrumbs[2] = (CONFIG.result(arr.brandTop) && arr.brandTop !== swsRoot) ? {link: '', text: Flgs.title} : ''; 172 break; 173 } 174 arr.breadCrumbs = arr.breadCrumbs.filter(function (e) { 175 if (CONFIG.result(e)) return e; 176 }); 177 178 var element = d.createElement('ul'); 179 element.id = 'bread-clumbs'; 180 arr.breadCrumbs.forEach(function (e, i) { 181 if (i === 0) { 182 element.insertAdjacentHTML('beforeend', '<li><a href="'+e.link+'">'+e.text+'</a></li>'); 183 } else { 184 if (arr.breadCrumbs.length === (i+1)) { 185 element.insertAdjacentHTML('beforeend', '<li><em>'+e.text+'</em></li>'); 186 } else { 187 element.insertAdjacentHTML('beforeend', '<li><a href="'+e.link+'">'+e.text+'</a></li>'); 188 } 189 } 190 }); 191 if (device === 'pc') { 192 bread.insertAdjacentHTML('afterbegin', '<div class="str-outer of-full"><div class="str-inner">'+element.outerHTML+'</div></div>'); 193 } else { 194 bread.insertAdjacentHTML('beforebegin', '<nav class="nav-breadcrumb"><div class="str-outer"><div class="str-inner">'+element.outerHTML+'</div></div></nav>'); 195 } 196 }, 197 // ããã¿ã¼ 198 setFooterButtons: function (arg, format, brand) { 199 if (!footer) return; 200 if (!Flgs.footer) return footer.parentNode.removeChild(footer); 201 for (var i=0; i<arg.length; i++) { 202 var e = arg[i]; 203 if (brand === e[format]) { 204 footer.insertAdjacentHTML('beforeend', '<div class="brand">'+ 205 (CONFIG.result(e.brandtop) ? '<a href="'+e.brandtop+'" target="_blank">'+e.brand+' ããã</a>' : '')+ 206 (CONFIG.result(e.topics) ? '<a href="'+e.topics+'" target="_blank">'+e.brand+' ãããã¯ã¹ä¸è¦§</a>' : '')+ 207 '</div>'); 208 break; 209 } else { 210 if (!(arg.length === (i+1))) continue; 211 if (!(footer.children.length === 0)) break; 212 footer.insertAdjacentHTML('beforeend', '<div class="brand">'+ 213 (CONFIG.result(arg[0].brandtop) ? '<a href="'+arg[0].brandtop+'" target="_blank">'+arg[0].brand+' ããã</a>' : '')+ 214 (CONFIG.result(arg[0].topics) ? '<a href="'+arg[0].topics+'" target="_blank">'+arg[0].brand+' ãããã¯ã¹ä¸è¦§</a>' : '')+ 215 '</div>'); 216 } 217 } 218 }, 219 // ã¬ã³ã¡ã³ãååã®è¿½å 220 setRecommends: function () { 221 if (!recommend) return; 222 if (!Flgs.recommend) return recommend.parentNode.removeChild(recommend); 223 if (device === 'pc') { 224 recommend.insertAdjacentHTML('beforeend', '<div class="block-common-title"><span>RECOMMENDS</span></div><ul class="block-thumbnail-t " id="rt_pc_auto_lp_1"></ul>'); 225 } else { 226 recommend.insertAdjacentHTML('beforeend', '<div class="str-outer"><div class="str-inner"><div class="str-outer of-type-02"><section class="item-list" id="rt_sp_auto_lp_1"><h2 class="mod-hdgL2 align-center"><span>RECOMMENDS</span></h2></section></div></div></div>'); 227 } 228 }, 229 // Appããã¼ã®è¿½å 230 // 2026.3.26 ~ appãã©ã°ã®å¤ã«é¢ããããããã¼é表示ãappè¦ç´ ãåé¤ãã仿§ã¸å¤æ´ã(ããã¼ãã«ãã¡ã®æç¤ºã«ãã)ã表示åéã«åãã.appã®å¤§å ã®è¦ç´ çæã¯æ®ãç½®ãã 231 setAppBanners: function () { 232 if (!app) return; 233 // if (!Flgs.app) return app.parentNode.removeChild(app); 234 return app.parentNode.removeChild(app); 235 // app.insertAdjacentHTML('beforeend', '<div class="shelpass"><a href="https://mypage.baroque.shop/apl/all/?code=sws_lpfooter" target="_blank"><img src="/campaign/asset/img/shelpass.jpg"></a></div>'); 236 }, 237 }; 238 global.CONFIG = CONFIG; 239 return CONFIG; 240})((this || 0).self || global); 241 242/** //////////////////////////////////////// * 243 * å ±éé ç® - å®è¡ 244 * //////////////////////////////////////// */ 245CONFIG.setSideMenu(); 246CONFIG.setCommonElements(); 247CONFIG.setRecommends(); 248CONFIG.setAppBanners();
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.