1(function($) { 2 /** 3 * ãããã¯ã¹ãªã¹ããåã£ã¦ãã¦æ´å½¢ããã¯ã©ã¹ 4 */ 5 var TopicsFetcher = function(setting) { 6 7 this.topicsGroupId = setting.topicsGroupId || ''; 8 this.cnt = setting.cnt ?? 10; // åå¾ããè¨äºæ° 9 this.dataType = setting.dataType || 'json'; // ããã©ã«ãã 'json' ã« 10 this.from_page = setting.from_page || "";; 11 this.target_contents = setting.target_contents || "";; 12 this.puts = setting.puts || function() {}; 13 // search_ext_col_XX (01ã99) ã«å¯¾å¿ 14 Object.keys(setting).forEach(key => { 15 if (/^search_ext_col_\d{2}$/.test(key)) { 16 this[key] = Array.isArray(setting[key]) ? setting[key] : []; 17 } 18 }); 19 this.url = setting.url || '/topics_list' + this.topicsGroupId + '/'; 20 this.contents_type = setting.contents_type || ''; 21 }; 22 23 // è¨äºè©³ç´°ã®URLçæ 24 // TopicsFetcher.getTopicsDetailUrl = function(topic) { 25 // if (topic.link_flg == '1') { 26 // if (topic.ext_col_99) { 27 // return topic.ext_col_99; 28 // } else { 29 // return '/topics_detail' + topic.topics_group_id + '/id=' + topic.topics_id; 30 // } 31 // } else if (topic.link_flg == '2') { 32 // return topic.link_url; 33 // } else { 34 // return ""; 35 // } 36 // }; 37 38 TopicsFetcher.formatYmd = function(ymd) { 39 if (!ymd || ymd.indexOf('-') === -1) return ''; // 䏿£ãªå¤ãã§ã㯠40 var splitted = ymd.split('-'); 41 return splitted[0] + 'å¹´' + splitted[1] + 'æ' + splitted[2] + 'æ¥'; 42 }; 43 44 TopicsFetcher.prototype = { 45 constructor: TopicsFetcher, 46 47 _makeOptions: function() { 48 49 var self = this; 50 var data = { 51 data_format: "json", 52 cnt: self.cnt, 53 dataType: self.dataType, 54 from_page: self.from_page, 55 target_contents: self.target_contents, 56 contents_type: self.contents_type 57 }; 58 59 // search_ext_col_xx (01ã99) ã追å 60 Object.keys(self).forEach(function(key) { 61 if (/^search_ext_col_\d{2}$/.test(key)) { 62 data[key] = self[key]; 63 } 64 }); 65 console.log(data); 66 var self = this; 67 return { 68 type: 'GET', 69 url: self.url, 70 dataType: self.dataType, // dataTypeããªã¯ã¨ã¹ãã«åæ 71 data: data, 72 success: function(data) { 73 74 if (!data) { 75 console.error("åå¾ãã¼ã¿ã null ã¾ã㯠undefined:", data); 76 return; 77 } 78 79 // dataType ã 'html' ã®å ´å㯠data ããã®ã¾ã¾æ¸¡ã 80 if (self.dataType === 'html') { 81 self.puts(data); 82 } else { 83 // JSONãã¼ã¿ã¨ãã¦å¦ç 84 if (!data.html_source && (!data.topicsList || data.topicsList.length === 0)) { 85 console.error("åå¾ãã¼ã¿ã䏿£: html_source ã topicsList ã空", data); 86 return; 87 } 88 self.puts(data.pageInfo, data.topicsList, data.html_source); 89 } 90 }, 91 error: function(xhr, status, error) { 92 console.error("AJAXã¨ã©ã¼:", status, error); 93 } 94 }; 95 }, 96 97 run: function() { 98 $.ajax(this._makeOptions()); 99 } 100 }; 101 102 window.TopicsFetcher = TopicsFetcher; 103 })(jQuery); 104
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.