1var ecblib = ecblib || {}; 2ecblib.customize = ecblib.customize || {}; 3ecblib.customize.goods = ecblib.customize.goods || {}; 4 5(function () { 6 'use strict'; 7 8 var _goods = ecblib.customize.goods; 9 10}()); 11 12 13// æè¿è¦ãååãªã©ãç§»å 14jQuery(function () { 15 const brandFooter = jQuery('.goods_brand_contents'); 16 const topicFooter = jQuery('.goods_topic_contents'); 17 const goodsAnnotations = jQuery('.block-goods-detail .postage'); 18 const goodsFooter = jQuery('.pane-main .pane-goods-footer'); 19 const itemHistory = jQuery('.pane-contents #goodsdetail_itemhistory'); 20 21 if (goodsAnnotations.length) { 22 // .pane-contents ã®å¾ãã«æ¿å ¥ 23 goodsAnnotations.appendTo('.pane-goods-right-side form'); 24 } 25 // ã©ã¡ããåå¨ããå ´åã®ã¿å¦ç 26 if (itemHistory.length) { 27 const goodsWrap = jQuery('<div class="goods-footer-contents"></div>'); 28 29 // åå¨ããè¦ç´ ãã©ããã«è¿½å 30 brandFooter.length && goodsWrap.append(brandFooter); 31 goodsFooter.length && goodsWrap.append(goodsFooter); 32 topicFooter.length && goodsWrap.append(topicFooter); 33 itemHistory.length && goodsWrap.append(itemHistory); 34 35 // .pane-contents ã®å¾ãã«æ¿å ¥ 36 goodsWrap.insertAfter('.pane-contents'); 37 } 38 39 jQuery(".goods_information_block .tab").on("click", function () { 40 jQuery(".active").removeClass("active"); 41 jQuery(this).addClass("active"); 42 const index = jQuery(".goods_information_block .tab").index(this); 43 jQuery(".goods_information_block .content").removeClass("show").eq(index).addClass("show"); 44 }); 45 46 jQuery(".goods_comment_faq .faq_ttl").on("click", function () { 47 jQuery(this).next().slideToggle(); 48 jQuery(this).toggleClass("open"); 49 }); 50}); 51 52jQuery(function () { 53 function addIcon(target) { 54 const $desc = jQuery(target); 55 if ($desc.find('.block-icon').length === 0) { 56 $desc.prepend('<div class="block-icon"><span class="block-icon--src1"></span></div>'); 57 } 58 } 59 60 // æ¢åè¦ç´ ã«é©ç¨ 61 jQuery('.block-thumbnail-t--goods-description').each(function () { 62 addIcon(this); 63 }); 64 65 // åç追å ãç£è¦ 66 const observer = new MutationObserver(function (mutations) { 67 mutations.forEach(function (mutation) { 68 jQuery(mutation.addedNodes).each(function () { 69 if (jQuery(this).hasClass('block-thumbnail-t--goods-description')) { 70 addIcon(this); 71 } 72 // åè¦ç´ ã®ä¸ã«å«ã¾ããå ´åãå¯¾å¿ 73 jQuery(this).find('.block-thumbnail-t--goods-description').each(function () { 74 addIcon(this); 75 }); 76 }); 77 }); 78 }); 79 observer.observe(document.body, { 80 childList: true, 81 subtree: true 82 }); 83}); 84 85jQuery(function () { 86 function setMatchHeight() { 87 jQuery('.block-thumbnail-t--goods-name').matchHeight('destroy'); 88 jQuery('.block-thumbnail-t--price-infos').matchHeight('destroy'); 89 90 jQuery('.block-thumbnail-t--goods-name').matchHeight(); 91 jQuery('.block-thumbnail-t--price-infos').matchHeight(); 92 } 93 94 setMatchHeight(); 95 96 const observer = new MutationObserver(function (mutations) { 97 mutations.forEach(function (mutation) { 98 if (mutation.addedNodes.length) { 99 setMatchHeight(); 100 } 101 }); 102 }); 103 observer.observe(document.body, { 104 childList: true, 105 subtree: true 106 }); 107}); 108 109jQuery(function () { 110 // è¦ç´ ã®æ°åãããvariation-nameã¨block-iconã®æ ã追å 111 jQuery('.block-accessory-list').each(function () { 112 // `.block-icon` ãåå¨ãããç¢ºèª 113 if (jQuery('.block-icon').length === 0) { 114 return; // 1ã¤ããªããã°ä½ãããªã 115 } 116 jQuery('.block-pickup-list-p--item-description').each(function () { 117 const $desc = jQuery(this); 118 // ãã®è¦ç´ å ã« .block-icon ããªãå ´åã®ã¿è¿½å 119 if ($desc.find('.block-icon').length === 0) { 120 $desc.prepend('<div class="block-icon"><span class="block-icon--src1"></span></div>'); 121 } 122 }); 123 }); 124 jQuery(function () { 125 jQuery('.block-pickup-list-p--goods-name').matchHeight(); 126 jQuery('.block-pickup-list-p--price-infos').matchHeight(); 127 jQuery('.block-pickup-list-p--comment').matchHeight(); 128 }); 129}); 130 131// ã¢ã¤ã³ã³ç¢ºèª 132jQuery(function () { 133 if (!jQuery('body').hasClass('page-search')) return; 134 135 const items = jQuery('.block-pickup-list-p--items > li'); 136 137 // 4ã¤ãã¤å¦ç 138 for (let i = 0; i < items.length; i += 4) { 139 const group = items.slice(i, i + 4); 140 141 // ã°ã«ã¼ãå ã«iconãããã 142 const hasIcon = group.find('.block-icon').length > 0; 143 144 // 1ã¤ã§ãããã°å ¨ã¦ã«è¿½å 145 if (hasIcon) { 146 group.each(function () { 147 const icon = jQuery(this).find('.block-icon'); 148 149 // ãã§ã«ããå ´åã¯ä½ãããªãï¼éè¤é²æ¢ï¼ 150 if (icon.length === 0) { 151 jQuery(this) 152 .find('.block-pickup-list-p--item-description') 153 .prepend('<div class="block-icon"></div>'); 154 } 155 }); 156 } 157 } 158 159 // é«ãã½ãã 160 jQuery('.block-pickup-list-p--goods-name').matchHeight(); 161 jQuery('.block-pickup-list-p--price-infos').matchHeight(); 162 jQuery('.block-icon').matchHeight(); 163});
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.