1// ã«ãã´ãªã¼å¤å¥ç¨å¤æ° 2let is_cate_brand = false; 3const category_ly1 = $('#category-ly1'); 4if (category_ly1.length > 0) { 5 is_cate_brand = category_ly1.val() == '/view/category/brand'; 6} 7 8// å ¨ãã¼ã¸å ±éã®å¦ç群 9const init_common = () => { 10 // è¦ç´ ã®ã³ãã¼ 11 (() => { 12 // ï¼ï¼ï¼ã¢ã¤ã³ã³ã¡ãã¥ã¼ï¼è¿½å¾ã¡ãã¥ã¼ â SPã°ãã¼ãã«ã¡ãã¥ã¼ 13 const $copy_1 = $('.hd-sticky-menu .hd-icon-menu').clone(); 14 const $target_1 = $('.sp-glb-menu .__inner'); 15 $copy_1.addClass('sp-only'); 16 $copy_1.prependTo($target_1); 17 18 // ï¼ï¼ï¼ä¼å¡æ å ±ï¼PCãããã¼ â SPã°ãã¼ãã«ã¡ãã¥ã¼ 19 const $copy_2 = $('.hd-member-info.pc-only').clone(); 20 const $target_2 = $('.sp-glb-menu .__inner'); 21 $copy_2.toggleClass('pc-only sp-only'); 22 $copy_2.prependTo($target_2); 23 24 // ï¼ï¼ï¼ç¬èªãã©ã³ãã¡ãã¥ã¼ï¼PCãããã¼ â SPã«ãã´ãªã¼ã¡ãã¥ã¼ 25 const $copy_3 = $('.pc-hd-cate .__ly1-item.--orig-brand').clone(); 26 const $target_3A = $('.sp-glb-menu .cate-menu .__ly1-item.--bulk'); 27 const $target_3B = $('.sp-glb-menu .cate-menu .__ly1'); 28 if ($target_3A.length > 0) { 29 $copy_3.insertBefore($target_3A); 30 } else { 31 $copy_3.appendTo($target_3B); 32 } 33 $('.sp-glb-menu .__ly1-item.--orig-brand .__ly1-name').addClass('cate-acc-trig'); 34 35 // ï¼ï¼ï¼SPã«ãã´ãªã¼ã¡ãã¥ã¼ï¼SPã°ãã¼ãã«ã¡ãã¥ã¼ â SPæ¤ç´¢ã¡ãã¥ã¼ 36 const $copy_4 = $('.sp-glb-menu .cate-menu').clone(); 37 const $target_4 = $('.sp-search-menu .__inner'); 38 $copy_4.appendTo($target_4); 39 40 // ï¼ï¼ï¼SPã°ãã¼ãã«ã¡ãã¥ã¼ï¼SPãããã¼ â PCãµã¤ããã 41 const $copy_5 = $('.sp-glb-menu .__inner').clone(); 42 const $target_5 = $('.pc-multi-column'); 43 if ($target_5.length > 0) { 44 $copy_5.find('.cate-menu').toggleClass('--sp --pc'); 45 $copy_5.find('.sp-only').remove(); 46 $copy_5.wrap('<nav class="pc-side-nav pc-only"></nav>'); 47 $copy_5.parent().prependTo($target_5); 48 } 49 })(); 50 51 // ã¡ãã¥ã¼éé 52 const $menu_sw = $('.menu-sw'); 53 $menu_sw.on('click', function () { 54 const tgt_id = $(this).attr('data-menu-id'); 55 $('[data-menu-id]').each(function () { 56 if ($(this).attr('data-menu-id') == tgt_id) { 57 $(this).toggleClass('--open'); 58 } else { 59 $(this).removeClass('--open'); 60 } 61 }); 62 63 // 仿¹ãéãã¦ããæã®é å»¶è¨å® 64 const delay_time = 300; 65 const $menu = $('[data-menu-id]:not(.menu-sw)'); 66 if ($menu.filter('.--open').length > 0) { 67 $menu.filter(':not(.--open)').delay(delay_time).queue(function () { 68 $(this).addClass('--delay').dequeue(); 69 }); 70 $menu.filter('.--open').delay(delay_time).queue(function () { 71 $(this).removeClass('--delay').dequeue(); 72 }); 73 } else { 74 $menu.removeClass('--delay'); 75 } 76 }); 77 78 // ã«ãã´ãªã¼ã¡ãã¥ã¼ã®ã¢ã³ã¼ãã£ãªã³éé 79 const $pc_cate = $('.cate-menu.--pc'); 80 const $sp_cate = $('.cate-menu.--sp'); 81 // -- PCåæç¶æ ï¼ 82 // ããã©ã³ãããæ¢ããé ä¸ã®ã«ãã´ãªã¼ãéãã¦ããã°ããã©ã³ãããæ¢ãããéãã 83 //ããããããã§ãªããã°ãã«ãã´ãªã¼ããæ¢ãããéãããã以å¤ã¯éãã¦ãã 84 if (is_cate_brand) { 85 $pc_cate.find('.__ly1-item.--code-brand .__ly1-name').addClass('--open'); 86 } else { 87 $pc_cate.find('.__ly1-item.--code-category .__ly1-name').addClass('--open'); 88 } 89 $pc_cate.find('.__ly1-name:not(.--open) + .__list-wrap').hide(); 90 // -- SPåæç¶æ ï¼ãã¹ã¦éãã¦ãã 91 $sp_cate.find('.__ly1-item .__list-wrap').hide(); 92 // -- ã¯ãªãã¯/ã¿ããæã®å¦ç 93 $pc_cate.add($sp_cate).find('.cate-acc-trig').on('click', function () { 94 $(this).toggleClass('--open'); 95 $(this).next('.__list-wrap').slideToggle(200); 96 });
97 98 // Enterãã¼ã§æ¤ç´¢å®è¡ 99 $('.search-form').find('input').on('keypress', function (e) { 100 if (e.keyCode == 13) { 101 $(this).parents('.search-form').find('.__submit').get(0).click(); 102 } 103 }); 104 105 // ååãªã¹ãç¨ã®Swiperè¨å® 106 $('.item-list.--swiper').each(function (i) { 107 new Swiper($(this).find('.swiper').get(0), { 108 lazyPreloadPrevNext: 2, 109 slidesPerView: $(this).find('.__item').length > 2 ? 2.1 : 2, 110 spaceBetween: 11, 111 watchSlidesProgress: true, 112 freeMode: { 113 enabled: true, 114 momentumRatio: 0.5, 115 momentumVelocityRatio: 0.5, 116 }, 117 navigation: { 118 enabled: false, 119 prevEl: $(this).find('.__btn.--prev').get(0), 120 nextEl: $(this).find('.__btn.--next').get(0), 121 }, 122 scrollbar: { 123 enabled: true, 124 hide: false, 125 draggable: true, 126 el: $(this).find(' .__sb').get(0), 127 }, 128 breakpoints: { 129 400: { 130 slidesPerView: 4.1, 131 } 132 }, 133 breakpoints: { 134 769: { 135 slidesPerView: 5, 136 spaceBetween: 20, 137 freeMode: false, 138 navigation: { enabled: true }, 139 scrollbar: { enabled: false }, 140 } 141 }, 142 }); 143 }); 144 145 // ã«ã¬ã³ãã¼æ¥å¥å 容é è² 146 const $date_data = $(".calendar .__date-data"); 147 $date_data.each(function () {
148 const month = $(this).attr("data-month"); 149 const date = $(this).attr("data-date"); 150 const color = $(this).attr("data-color"); 151 $(".calendar .makeshop-calendar" + month + " .day" + date) 152 .css("--calendar-bg-color", color); 153 }); 154 const $date_color = $(".calendar .__date-color:not(.--toady)"); 155 $date_color.each(function () { 156 const color = $(this).attr("data-color"); 157 $(this).css("background-color", color); 158 }); 159 160 // æ°éæ¬ã®å¦ç 161 const $qty = $('.quantity .__qty'); 162 if ($qty.length > 0) { 163 const min = $qty.eq(0).is('[data-min]') ? parseInt($qty.eq(0).attr('data-min')) : 1; 164 const max = $qty.eq(0).is('[data-max]') ? parseInt($qty.eq(0).attr('data-max')) : 999999; 165 // æ°éæ¬å¤æ´æ 166 $qty.on('change', function () { 167 const qty_val = parseInt($(this).val().replace(/[ï¼-ï¼]/g, (val) => { 168 return String.fromCharCode(val.charCodeAt(0) - 0xFEE0); // å ã®å¤ã®å ¨è§æ°åãåè§ã«ç½®æ 169 })); 170 const val = (() => { 171 if (isNaN(qty_val)) { 172 return $(this).attr('value'); 173 } else if (qty_val > max) { 174 return max; 175 } else if (qty_val < min) { 176 return min; 177 } else { 178 return qty_val; 179 } 180 })(); 181 $(this).val(val); 182 }); 183 184 // æ°éã¹ãã³ãã¿ã³æ¼ä¸æ 185 const $qty_btn = $('.quantity .__btn'); 186 if ($qty_btn.length > 0) { 187 $qty_btn.on('click', function () { 188 const $tgt = $(this).parents('.quantity').find('.__qty'); 189 let val = $tgt.val(); 190 if ($(this).hasClass('--up') && val < max) { 191 val++; 192 } else if ($(this).hasClass('--down') && val > min ) { 193 val--; 194 } 195 $tgt.val(val); 196 }); 197 } 198 } 199 200 // ä¸ã«æ»ã 201 const $btt = $('.back-to-top'); 202 $(window).on('scroll', function () { 203 if ( $(this).scrollTop() < 200 ) { 204 $btt.removeClass('--show'); 205 } else { 206 $btt.addClass('--show'); 207 } 208 }); 209 210 // ãã¼ã¸èªã¿è¾¼ã¿æ URLã«ã¢ã³ã«ã¼ãããã°ã¢ã³ã«ã¼ä½ç½®ã¸ç§»å 211 if (window.location.hash) { 212 setTimeout(function(){ 213 const hash = window.location.hash; 214 window.location.replace(hash); 215 }, 300); 216 } 217} 218 219$(function () { 220 init_common(); 221}); 222// ãªãã·ã§ã³åæ¿æã®å¦ç 223function MakeShop_afterItemOptionChange(data) { 224 // å¨åº«ã«å¿ãã¦ã«ã¼ãã«å ¥ãããã¿ã³ã®åãæ¿ã 225 if (data.isSoldout) { 226 // ååãã®å ´å 227 $('.item-cart-btn-wrap .--cv').addClass('--hide'); 228 $('.item-cart-btn-wrap .--disable').removeClass('--hide'); 229 } else { 230 // å¨åº«ããã or ãªãã·ã§ã³ã°ã«ã¼ãã®å ´å 231 $('.item-cart-btn-wrap .--cv').removeClass('--hide'); 232 $('.item-cart-btn-wrap .--disable').addClass('--hide'); 233 } 234} 235 236// ãæ°ã«å ¥ã追å ã»å餿ã®å¦ç 237function MakeShop_afterFavoriteEntry(data) { 238 if (data.result) { 239 const $fav_wrap = $(`[href="${data.source}"]`).parent(); 240 $fav_wrap.children('.--add').addClass('--hide'); 241 $fav_wrap.children('.--remove').removeClass('--hide'); 242 } 243} 244function MakeShop_afterFavoriteRemove(data) { 245 if (data.result) { 246 const $fav_wrap = $(`[href="${data.source}"]`).parent(); 247 $fav_wrap.children('.--remove').addClass('--hide'); 248 $fav_wrap.children('.--add').removeClass('--hide'); 249 } 250} 251 252// ã«ã¼ãã«å ¥ããæã®å¦ç 253function MakeShop_afterCartEntry(data) { 254 if (data.result) { 255 // ãããã¼ã®ååæ°ããã¸ã®æ´æ° 256 const $hd_cart_num = $('.hd-icon-menu .__cart-num'); 257 $hd_cart_num.html(data.totalQuantity); 258 if (data.totalQuantity > 0) { 259 $hd_cart_num.addClass('--show'); 260 } else { 261 $hd_cart_num.removeClass('--show'); 262 } 263 264 // ã¢ã¼ãã«ã表示 265 const $item_add_cart_modal = $('.item-add-cart-modal'); 266 $item_add_cart_modal.addClass('--show'); 267 268 // ã«ã¼ãç»é¢ã¸é·ç§»ãããªã 269 return false; 270 } else { 271 data.method.modal(data.error.message); 272 } 273} 274 275const item_init = () => { 276 // ååç»åç¨ã®Swiperè¨å® 277 const $photo_multi = $('.item-photo.--multi'); 278 if ($photo_multi.length > 0) { 279 const $thumb = $('.item-photo.--thumb .__photo'); 280 new Swiper($photo_multi.find('.swiper').get(0), { 281 slidesPerView: 1, 282 on: { 283 afterInit: (swiper) => { 284 $thumb.each(function (i) { 285 $(this).on('click', () => swiper.slideTo(i)); 286 }); 287 }, 288 }, 289 }); 290 } 291 292 // SKUå¥ãã¿ã³ ãªãã·ã§ã³ç»ååãæ¿ã 293 $('.item-sku-hd .__photo-img').on('click', function () { 294 const src = $(this).attr('src'); 295 $('.item-photo.--thumb').find(`img[src="${src}"]`) 296 .parent('.__photo').trigger('click'); 297 });
298 299 // ã¢ã¼ãã«ãéãã 300 const $item_add_cart_modal_close = $('.item-add-cart-modal .close-modal'); 301 $item_add_cart_modal_close.on('click', function() { 302 $(this).parents('.item-add-cart-modal').removeClass('--show'); 303 }); 304 305 // ã¤ã¼ã¬ã³ã©ã³ãã³ã°ç¨ã®Swiperè¨å® 306 $('.item-ereco .item-list.--swiper').each(function (i) { 307 new Swiper($(this).find('.swiper').get(0), { 308 lazyPreloadPrevNext: 2, 309 slidesPerView: $(this).find('.__item').length > 2 ? 2.1 : 2, 310 spaceBetween: 11, 311 watchSlidesProgress: true, 312 freeMode: { 313 enabled: true, 314 momentumRatio: 0.5, 315 momentumVelocityRatio: 0.5, 316 }, 317 navigation: { 318 enabled: false, 319 prevEl: $(this).find('.__btn.--prev').get(0), 320 nextEl: $(this).find('.__btn.--next').get(0), 321 }, 322 scrollbar: { 323 enabled: true, 324 hide: false, 325 draggable: true, 326 el: $(this).find(' .__sb').get(0), 327 }, 328 breakpoints: { 329 400: { 330 slidesPerView: 4.1, 331 } 332 }, 333 breakpoints: { 334 769: { 335 slidesPerView: 5, 336 spaceBetween: 20, 337 freeMode: false, 338 navigation: { enabled: true }, 339 scrollbar: { enabled: false }, 340 } 341 }, 342 }); 343 }); 344} 345 346setTimeout(function() { 347 item_init(); 348}, 2000); 349
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.