PageSourceSearch

https://www.regal.co.jp/cms/js/items_v2.js?20240321v1

js regal.co.jp collected 2026-10-02 02:28:11 UTC 6,218 bytes, 151 lines download raw bytes

1let item1count = 0;
2let item2count = 0;
3
4jQuery(function () {
5
6  let goods_code_api_num_input = jQuery("input[id*='goods_code_api_']").length;
7  let goods_code_api_num_tag = jQuery(".template-style-goods-list-api").length;
8	
9  //商品コードセット	
10  if(jQuery("input[id*='goods_code_api_']").length){
11    let goods_code_api_count = 1;
12    
13    jQuery(".template-style-goods-list-api").each(function(){
14	  jQuery(this).attr('id', 'item1-' + goods_code_api_count);	
15		
16      let goods_code_api_data = jQuery('#goods_code_api_' + goods_code_api_count).val();
17      jQuery('#item1-' + goods_code_api_count).attr('data-ajax', goods_code_api_data);
18      
19      goods_code_api_count++;
20    });
21  }
22  
23  //URLセット
24  var ajax_list = "/" + "api/goodslistapi.aspx?type=xml&charset=UTF-8&goods="; /*API基本URL*/
25    
26  //商品コード取得
27  if(goods_code_api_num_input == goods_code_api_num_tag){	
28	  if(jQuery('.template-style-goods-list-api').length){
29		jQuery('div[id*="item1-"]:not(#item1-all)').each(function(i){
30		  let getId = jQuery(this).attr('id');
31		  let idAll = '#item1-all';
32		  let data_ajax_list = jQuery(this).attr("data-ajax");	
33			getAjaxHtml(ajax_list+jQuery(this).attr("data-ajax"),'#'+getId,idAll, data_ajax_list).done(function(data){
34			  jQuery('.'+getId).addClass('loaded');
35			  if(item1count === jQuery('div[id*="item1-"]:not(#item1-all)').length){
36				setFirstAjaxhtml(idAll);
37			  }
38			});
39		  });
40		}
41	}
42	
43  });
44    
45  
46  function setFirstAjaxhtml(all_tagrget) {
47    jQuery(all_tagrget).parent().find('div[id*="item"] ul').each(function(){
48      let addAllhtml = '';
49      addAllhtml += jQuery(this).html();
50      jQuery(all_tagrget+' ul').append(addAllhtml);
51    });
52  }	
53  
54  function getAjaxHtml(ajax_url,display_target,idAll,data_ajax_list){
55    
56    var deferred = new jQuery.Deferred;
57    let date = new Date();
58    let timestamp = String(date.getFullYear())+String(date.getMonth()+1)+String(date.getDate())+String(date.getHours())+String(date.getMinutes());
59    jQuery.ajax({
60      url: ajax_url+"&"+timestamp,
61      type:'get',
62      dataType:'xml',
63      timeout : 10000
64    })
65    .then(
66      function (data) {
67      
68        appendItem(data,display_target,data_ajax_list);
69        jQuery(display_target).find("img").each(function() {
70          jQuery(this).attr("src",jQuery(this).attr("src"));
71          jQuery(this).attr("data-src",jQuery(this).attr("data-src"));
72        });
73      if(idAll === '#item1-all'){
74      item1count += 1;
75      }
76      if(idAll === '#item2-all'){
77      item2count += 1;
78      }
79        deferred.resolve(data);
80      },
81      function () {
82      //function (XMLHttpRequest, textStatus, errorThrown) {		  
83		  //console.log("XMLHttpRequest : " + XMLHttpRequest.status);
84		//console.log("textStatus     : " + textStatus);
85		//console.log("errorThrown    : " + errorThrown.message);		  
86		  
87		  
88		  if(idAll === '#item1-all'){
89			item1count += 1;
90		  }
91		  if(idAll === '#item2-all'){
92			item2count += 1;
93		  }
94        jQuery(display_target).html('<p style="text-align:center;">取得できませんでした。<br>しばらく時間をおいてから再度アクセスしてください。</p>');
95        //deferred.reject(data);
96      }
97    );
98    return deferred.promise();
99  }
100  
101  
102  function appendItem(data,target,data_ajax_list){
103	  
104	var goodsCodeOrderSplit = data_ajax_list.split(',');
105	for (var i = 0; i < goodsCodeOrderSplit.length; i++) {
106	  var goodsCodeValue = goodsCodeOrderSplit[i];
107	  var goodsCodeXmlItem = jQuery(data).find('item:has(goods:contains("' + goodsCodeValue + '"))');
108	  var $goods = goodsCodeXmlItem.find('goods').text(); //商品URL
109    var $name = goodsCodeXmlItem.find('name').text(); //商品名
110	  var $format_price = goodsCodeXmlItem.find('format_price').text(); //価格(税込)
111    var $src_s = goodsCodeXmlItem.find('src_s').text(); //S画像
112    var $src_c = goodsCodeXmlItem.find('src_c').text();
113    let $variation1 = goodsCodeXmlItem.find('variation_group').text(); //商品コード
114    //let $variation2 = goodsCodeXmlItem.find('variation_name1').text(); //サイズ
115    let $variation3 = goodsCodeXmlItem.find('variation_name2').text(); //カラー
116    let $variation_range = goodsCodeXmlItem.find('all_size_comment').text(); //サイズレンジ
117    let $brandName = goodsCodeXmlItem.find('brand_name').text(); //商品コード
118    //let $brandUp = brandName.toUpperCase();
119    var $src_cSet = '';
120    if ($src_c != '') {
121      $src_cSet = '<div class="block-icon"><span class="block-icon--srcC"><img alt="'+$name+'" src="/cms/img/usr/lazyloading.png" data-src="'+$src_c+'"  class="lazyload"></span></div>';
122    }
123    var $sale_comment = goodsCodeXmlItem.find('sales_comment').text(); //セール名
124    if($sale_comment == ''){
125      //通常
126      var $goods_price = '<div class="price">' + $format_price + '<span class="price-tax">(税込)</span></div>';
127    }else{
128      //sale
129      var $format_normal_price = goodsCodeXmlItem.find('format_normal_price').text();
130      var $goods_price = '<div class="goods-default-price">' + $format_normal_price + '<span class="price-tax">(税込)</span></div><div class="goods-price sale-price"><div class="goods-sale-scomment">' + $sale_comment + '</div><span class="format-price">' + $format_price + '</span><span class="price-tax">(税込)</span></div>';
131    }
132		
133	  if($goods != ''){
134		  var itemHTML =
135			'<li class="item" data-code-val="' +$goods+ '">'+
136      '<a href="/shop/g/g'+$goods+'/" title="'+$name+'">'+
137			'<figure>'+
138			'<img alt="'+$name+'" src="/cms/img/usr/lazyloading.png" data-src="'+$src_s+'"  class="lazyload">'+
139			'</figure>'+
140      '<p class="brand">'+$brandName+'</p>'+
141			'<p class="variation">'+
142      '<span class="variation_group">' + $variation1 + '</span>'+
143      '<span class="variation_name2">' + $variation3 + '</span>'+
144      '<span class="variation_name3">' + $variation_range + '</span>'+
145      '</p>'+
146			'<div class="goods-price-inner">' + $goods_price + '</div>'		
147			'</a></li>';
148		  jQuery(itemHTML).appendTo(target+' ul');
149	  }
150	}
151  }	

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.