1// JavaScript Document 2(function (_w) { 3 4 var w = _w; 5 6 //main namespace 7 G = {}; 8 G.page_code = 'index'; 9 G.Message = { 10 error:'ç³»ç»é误ï¼è¯·è系管çåå¤ç' 11 }; 12 13 14 G.Fun = { 15 //è·åurlä¸çåæ° 16 getUrlParam: function(name) { 17 var reg = new RegExp("(^|&)" + name + "=([^&]*)(&|$)"); //æé ä¸ä¸ªå«æç®æ åæ°çæ£å表达å¼å¯¹è±¡ 18 var r = window.location.search.substr(1).match(reg); //å¹é ç®æ åæ° 19 if (r != null) return unescape(r[2]); return null; //è¿ååæ°å¼ 20 }, 21 Today: function(){ 22 return G.Fun.formatter_date(); 23 }, 24 addDay: function(date, num) { 25 // å建ä¸ä¸ªæ°ç Date 对象ï¼é¿å ç´æ¥ä¿®æ¹åæ¥æå¯¹è±¡ 26 var newDate = new Date(date.getTime()); 27 // è·åå½åæ¥æç天æ°å¹¶å ä¸ 28 var day = newDate.getDate(); 29 newDate.setDate(day + num); 30 return G.Fun.formatter_date(newDate); 31 }, 32 formatter_date: function(time){ 33 const date = typeof time == 'undefined' ? new Date() : new Date(time); 34 const formattedDate = date.toLocaleString('zh-CN', { year: 'numeric', month: 'numeric', day: 'numeric' }); 35 36 return formattedDate; 37 }, 38 formatter_date_to_items: function(time) { 39 var d = G.Fun.formatter_date(time); 40 var dSplit = d.split('/'); 41 var year = dSplit[0]; 42 var month = dSplit[1].length == 1 ? '0' + dSplit[1] : dSplit[1]; 43 var day = dSplit[2].length == 1 ? '0' + dSplit[2] : dSplit[2]; 44 45 var re = { 46 year: year, 47 month: month, 48 day: day 49 }; 50 return re 51 }, 52 check_invite_url: function(url, type){ 53 if (typeof G_Invite_config != 'undefined') 54 { 55 var flag = true; 56 var index = G_Invite_config['url_urls']['key'].indexOf(url); 57 if (index > -1) 58 { 59 url = G_Invite_config['url_urls']['value'][index]; 60 flag = false; 61 } 62 63 if (flag) 64 { 65 if (typeof G_Invite_config['code_urls'][type] != 'undefined') 66 { 67 url = G_Invite_config['code_urls'][type]; 68 flag = false; 69 } 70 } 71 } 72 return url; 73 }, 74 check_invite_code: function(code, type){ 75 if (typeof G_Invite_config != 'undefined') 76 { 77 if (typeof G_Invite_config['codes'][type] != 'undefined') 78 { 79 var new_code = G_Invite_config['codes'][type]; 80 code = new_code.length == '' ? code : new_code; 81 } 82 } 83 return code; 84 }, 85 CreateItem: function(time){ 86 var tempDate = G.Fun.formatter_date(time) 87 tempDateSplit = tempDate.split('/'); 88 var title = tempDateSplit[1] + 'æ'+ tempDateSplit[2] +'æ¥æ´æ°ï¼'+tempDateSplit[0]+'å¹´ææ°é«éShadowrocket/SSR/V2ray/Clash订é 龿¥å è´¹èç¹è®¢é '; 89 var url = '/newly-discovered-nodes/index.html?date=' + tempDate.replace(/\//g, '-'); 90 var time = tempDateSplit[1] + 'æ'+ tempDateSplit[2] +'æ¥'; 91 92 return {title: title, url: url, time: time}; 93 }, 94 BindData: function(datas, template) { 95 $.each(datas, function(i){ 96 var item = datas[i]; 97 98 var template_temp = template.clone(); 99 template_temp.find('.xcblog-blog-title').text(item['title']); 100 template_temp.find('.xcblog-blog-url').attr('href', item['url']); 101 template_temp.find('.xcblog-blog-time').text(item['time']); 102 103 $('.xcblog-blog-list').prepend(template_temp); 104 }) 105 }, 106 BindTo: function(){ 107 $('.js_to').attr('href', 'javascript:;'); 108 $('.js_to').click(function(e){ 109 e.preventDefault(); 110 111 var url = $(this).data('url'); 112 var code = $(this).data('code'); 113 var type = $(this).data('type'); 114 var new_url = G.Fun.check_invite_url(url, type); 115 var new_code = G.Fun.check_invite_code(code, type); 116 new_url += new_code; 117 118 if (typeof $.post === 'function') { 119 var domain = 'https://www.freeclashnode.com'; 120 $.post( 121 domain + '/index.php/api/xcblog/c', 122 { 123 url: location.href, 124 to_url: new_url, 125 code: type, 126 ad_code: type 127 } 128 ); 129 } 130 131 window.open(new_url); 132 }) 133 }, 134 BindDetailWebsite: function(){ 135 if ($('#share-website-info').length > 0) 136 { 137 var name = $('#share-website-info').data('name'); 138 var url = $('#share-website-info').data('url'); 139 140 if (name != '' && url != '') 141 { 142 $.each($('h2:contains("订é 龿¥"), h2:contains("è®¢é æä»¶é¾æ¥")'), function(i){ 143 var item = $('h2:contains("订é 龿¥"), h2:contains("è®¢é æä»¶é¾æ¥")').eq(i); 144 if (item.text() == '订é 龿¥' || item.text() == 'è®¢é æä»¶é¾æ¥') 145 {
146 var div = $('<div style="background:#fcf8e3;border:1px solid #faf3cd;border-left: 0.5rem solid #faf3cd;padding: 0.5rem;line-height:2rem;margin-top: 1rem;color:#c09853;">以ä¸è®¢é 龿¥åæ¥èª <b>'+name+'</b> åäº«ï¼æ´å¤å è´¹æºåºè®¢é å¯ <a href="'+url+'">ã跳转æ¥çã</a></div>'); 147 item.after(div); 148 } 149 }) 150 } 151 } 152 }, 153 //åå§åæä½ 154 init: function (page_code) { 155 G.Fun.BindTo(); 156 switch(page_code) 157 { 158 case 'index': 159 case 'category': 160 var first_item = $('.xcblog-blog-list .xcblog-blog-item:eq(0)'); 161 var first_item_date = new Date(first_item.data('date')); 162 163 if (G.Fun.formatter_date() != G.Fun.formatter_date(first_item_date)) 164 { 165 var datas = []; 166 for(var i=1;i<99;i++) 167 { 168 var the_date = G.Fun.addDay(first_item_date, i); 169 // console.log(the_date); 170 171 datas.push(G.Fun.CreateItem(the_date)); 172 173 if (the_date == G.Fun.Today()) 174 { 175 break; 176 } 177 } 178 // console.log(datas); 179 G.Fun.BindData(datas, first_item); 180 } 181 break; 182 183 case 'newly_discovered_nodes': 184 G.Fun.BindDetailWebsite(); 185 186 var date = G.Fun.getUrlParam('date'); 187 dateItems = G.Fun.formatter_date_to_items(date); 188 189 var clash_rows = []; 190 var v2ray_rows = []; 191 for(var i=0;i<5;i++) 192 { 193 var clash_url = 'https://node.freeclashnode.com/uploads/'+dateItems['year']+'/'+dateItems['month']+'/'+i+'-'+dateItems['year']+dateItems['month']+dateItems['day']+'.yaml'; 194 clash_rows.push(clash_url); 195 196 var v2ray_url = 'https://node.freeclashnode.com/uploads/'+dateItems['year']+'/'+dateItems['month']+'/'+i+'-'+dateItems['year']+dateItems['month']+dateItems['day']+'.txt'; 197 v2ray_rows.push(v2ray_url); 198 } 199 var singbox_rows = ['https://node.freeclashnode.com/uploads/'+dateItems['year']+'/'+dateItems['month']+'/'+dateItems['year']+dateItems['month']+dateItems['day']+'.json']; 200 201 $.each(clash_rows, function(i){ 202 var clash_p = $('<p>'+clash_rows[i]+'</p>') 203 $('.xcblog-clash-box').append(clash_p); 204 var v2ray_p = $('<p>'+v2ray_rows[i]+'</p>') 205 $('.xcblog-v2ray-box').append(v2ray_p); 206 }) 207 208 $('.xcblog-singbox-box').html('<p>'+singbox_rows[0]+'</p>'); 209 break; 210 211 case 'detail': 212 G.Fun.BindDetailWebsite(); 213 break; 214 } 215 }, 216 }; 217 218 $(function () { 219 var page_code = $('body').attr('data-page'); 220 G.Fun.init(page_code); 221 }); 222 223})(); 224 225 226 227 228
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.