1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39$(document).ready(function () { 40 if ($('.kxbb').length > 0) { 41 function loadKxbbNewsViaJsonp(page = 1) { 42 const container = document.getElementById('kxnews-list'); 43 container.classList.add('hidden'); 44 const script = document.createElement('script'); 45 const callbackName = 'jsCallback_' + Math.round(Math.random() * 1000000); 46 47 window[callbackName] = function (data) { 48 startNewsRotation(data.result.data.feed.list, page); 49 delete window[callbackName]; 50 document.body.removeChild(script); 51 }; 52 53 script.src = `//zhibo.sina.com.cn/api/zhibo/feed?callback=${callbackName}&page=${page}&num=10&tag_id=101&zhibo_id=152&_=${new Date().getTime()}`; 54 document.body.appendChild(script); 55 } 56 57 function startNewsRotation(newsList, currentPage) { 58 let index = 0; 59 const totalPages = 3; 60 const itemsPerBatch = 10; 61 62 function showNextBatch() { 63 const container = document.getElementById('kxnews-list'); 64 container.classList.remove('visible'); 65 66 setTimeout(() => { 67 container.innerHTML = ''; 68 69 for (let i = 0; i < itemsPerBatch; i++) { 70 if (index >= newsList.length) { 71 index = 0; 72 } 73 const item = newsList[index++]; 74 const newsItem = document.createElement('div'); 75 newsItem.className = 'kxnews-item'; 76 77 const richText = item.rich_text || 'ææ å 容'; 78 const titleMatch = richText.match(/ã([^ã]+)ã/); 79 const title = titleMatch ? titleMatch[1] : richText; 80 const content = titleMatch ? richText.replace(/ã[^ã]+ã/, '').trim() : richText; 81 const fullTime = item.create_time ? new Date(item.create_time).toLocaleTimeString([], { hour: '2-digit', minute: '2-digit' }) : 'æªç¥æ¶é´'; 82 83 newsItem.innerHTML = ` 84 <div class="kxnews-header" title="${content}"> 85 <time class="kxnews-time">${fullTime}</time> 86 <span class="kxnews-title">${title}</span> 87 <span class="kxnews-content">${content}</span> 88 </div> 89 `; 90 91 container.appendChild(newsItem); 92 } 93 94 container.classList.add('visible'); 95 }, 500); 96 97 setTimeout(() => { 98 if (index >= newsList.length) { 99 const nextPage = currentPage % totalPages + 1; 100 loadKxbbNewsViaJsonp(nextPage); 101 } else { 102 showNextBatch(); 103 } 104 }, 10000); 105 } 106 107 showNextBatch(); 108 } 109 loadKxbbNewsViaJsonp(); 110 }; 111}); 112 113$(document).ready(function () { 114 115 const stockConfig = [ 116 { id: "sh000001", name: "ä¸è¯ææ°", img: "//image.sinajs.cn/newchart/hollow/small/nsh000001.gif" }, 117 { id: "sz399001", name: "æ·±è¯ææ", img: "//image.sinajs.cn/newchart/hollow/small/nsz399001.gif" }, 118 { id: "sh000300", name: "沪深300", img: "//image.sinajs.cn/newchart/hollow/small/nsh000300.gif" }, 119 { id: "bj899050", name: "åè¯50", img: "//image.sinajs.cn/n/cn/min/310x154xnoxxfpp/bj899050.png" }, 120 { id: "sz399006", name: "å䏿¿æ", img: "//image.sinajs.cn/newchart/hollow/small/nsz399006.gif" }, 121 { id: "sh000011", name: "åºéææ°", img: "//image.sinajs.cn/newchart/hollow/small/nsh000011.gif" }, 122 { id: "sh000012", name: "å½åºææ°", img: "//image.sinajs.cn/newchart/hollow/small/nsh000012.gif" }, 123 { id: "nf_IC0", name: "ææIC0", img: "//image.sinajs.cn/newchart/futures/cffex/mins_hollow/IC0.gif" } 124 ]; 125 126 if ($('.quoted-price').length > 0) { 127 128 const stockList = document.getElementById('stockList'); 129 130 for (let i = 0; i < stockConfig.length; i++) { 131 132 const stock = stockConfig[i]; 133 134 const li = document.createElement('li'); 135 li.id = stock.id; 136 li.style.width = '12.5%'; 137 li.innerHTML = ` 138 <div class="item-chart"> 139 <div class="item-chart-wrap"> 140 <div class="item-chart-top">
141 <span>沪深京 宿¶ææ° èµ°å¿å¾</span> 142 </div> 143 <div class="item-chart-hd"> 144 <span class="item-chart__name">${stock.name}</span> 145 <span class="item-chart__cur"></span> 146 <span class="item-chart__price"></span> 147 <span class="item-chart__percent"></span> 148 </div> 149 <div class="item-chart__content"> 150 <div class="item-chart__img"> 151 <img src="${stock.img}"> 152 </div> 153 </div> 154 </div> 155 </div> 156 <span class="item-name">${stock.name}</span> 157 <span class="item-price"></span> 158 <span class="item-percent"></span> 159 `; 160 stockList.appendChild(li); 161 }; 162 }; 163 164 if ($('.swiperhq').length > 0) { 165 166 const stockSwiper = document.getElementById('stockSwiper'); 167 168 for (let i = 0; i < stockConfig.length; i++) { 169 170 const stock = stockConfig[i]; 171 172 const div = document.createElement('div'); 173 div.className = 'swiper-slide item-chart-m'; 174 div.id = stock.id; 175 div.innerHTML = ` 176 <div class="item-chart-wrap-m"> 177 <div class="item-chart-hd-m"> 178 <span class="item-chart__name">${stock.name}</span> 179 <span class="item-chart__cur"></span> 180 <span class="item-chart__price"></span> 181 <span class="item-chart__percent"></span> 182 </div> 183 <div class="item-chart__content"> 184 <div class="item-chart__img"> 185 <img src="${stock.img}"> 186 </div> 187 </div> 188 </div> 189 `; 190 stockSwiper.appendChild(div); 191 }; 192 193 var swiperhq = new Swiper('.swiperhq', { 194 loop: true, 195 autoplay: { 196 delay: 3000, 197 disableOnInteraction: false 198 }, 199 pagination: { 200 el: '.swiperhq .swiper-pagination', 201 }, 202 navigation: { 203 nextEl: '.swiperhq .swiper-button-next', 204 prevEl: '.swiperhq .swiper-button-prev', 205 } 206 }); 207 }; 208 209 210 function updateStockData() { 211 212 let apiUrl = "/plugins/apihq/data.php?rn=" + new Date().getTime() + "&list="; 213 214 for (let i = 0; i < stockConfig.length; i++) { 215 if (i < stockConfig.length - 1) { 216 apiUrl += "s_" + stockConfig[i].id + ","; 217 } else { 218 apiUrl += "nf_IC0"; 219 } 220 } 221 222 fetch(apiUrl) 223 224 .then((response) => { 225 if (response.ok) { 226 return response.text(); 227 } 228 throw new Error('æ°æ®è¯·æ±é误'); 229 }) 230 231 .then((text) => { 232 233 const hq_str = text.split(";"); 234 235 for (let i = 0; i < stockConfig.length - 1; i++) { 236 if (i < hq_str.length && hq_str[i]) { 237 238 const stockData = hq_str[i].split("=")[1]?.replace(/"/g, "").split(","); 239 240 if (stockData && stockData.length >= 4) { 241 242 const stockId = stockConfig[i].id; 243 244 $("#" + stockId + " .item-chart__cur, #" + stockId + " .item-chart__price, #" + stockId + " .item-chart__percent").removeClass("up-text down-text").addClass("flash-white"); 245 $("#" + stockId + " .item-price, #" + stockId + " .item-percent").removeClass("up-text down-text").addClass("flash-white"); 246 247 $("#" + stockId + " .item-chart__cur").text(parseFloat(stockData[1]).toFixed(2)); 248 $("#" + stockId + " .item-chart__price").text(parseFloat(stockData[2]).toFixed(2)); 249 $("#" + stockId + " .item-chart__percent").text(parseFloat(stockData[3]).toFixed(2) + "%"); 250 251 $("#" + stockId + " .item-price").text(parseFloat(stockData[1]).toFixed(2)); 252 $("#" + stockId + " .item-percent").text(parseFloat(stockData[3]).toFixed(2) + "%"); 253 254 if (stockData[2].indexOf("-") == -1) { 255 $("#" + stockId + " .item-chart__cur, #" + stockId + " .item-chart__price, #" + stockId + " .item-chart__percent").addClass("up-text"); 256 $("#" + stockId + " .item-price, #" + stockId + " .item-percent").addClass("up-text"); 257 } else { 258 $("#" + stockId + " .item-chart__cur, #" + stockId + " .item-chart__price, #" + stockId + " .item-chart__percent").addClass("down-text"); 259 $("#" + stockId + " .item-price, #" + stockId + " .item-percent").addClass("down-text"); 260 } 261 262 setTimeout(function () { 263 $("#" + stockId + " .item-chart__cur, #" + stockId + " .item-chart__price, #" + stockId + " .item-chart__percent").removeClass("flash-white"); 264 $("#" + stockId + " .item-price, #" + stockId + " .item-percent").removeClass("flash-white"); 265 }, 800); 266 }; 267 }; 268 }; 269 270 const nf_IC0 = hq_str[stockConfig.length - 1].split("=")[1]?.replace(/"/g, "").split(","); 271 272 if (nf_IC0 && nf_IC0.length >= 15) { 273 274 $("#nf_IC0 .item-chart__cur, #nf_IC0 .item-chart__price, #nf_IC0 .item-chart__percent").removeClass("up-text down-text").addClass("flash-white"); 275 $("#nf_IC0 .item-price, #nf_IC0 .item-percent").removeClass("up-text down-text").addClass("flash-white"); 276 277 const change_price = (nf_IC0[3] - nf_IC0[14]).toFixed(2); 278 const change_prenum = (change_price / nf_IC0[14] * 100).toFixed(2); 279 280 $("#nf_IC0 .item-chart__cur").text(parseFloat(nf_IC0[3]).toFixed(2)); 281 $("#nf_IC0 .item-chart__price").text(change_price); 282 $("#nf_IC0 .item-chart__percent").text(change_prenum + "%"); 283 284 $("#nf_IC0 .item-price").text(parseFloat(nf_IC0[3]).toFixed(2)); 285 $("#nf_IC0 .item-percent").text(change_prenum + "%"); 286 287 if (change_price.indexOf("-") == -1) { 288 $("#nf_IC0 .item-chart__cur, #nf_IC0 .item-chart__price, #nf_IC0 .item-chart__percent").addClass("up-text"); 289 $("#nf_IC0 .item-price, #nf_IC0 .item-percent").addClass("up-text"); 290 } else { 291 $("#nf_IC0 .item-chart__cur, #nf_IC0 .item-chart__price, #nf_IC0 .item-chart__percent").addClass("down-text"); 292 $("#nf_IC0 .item-price, #nf_IC0 .item-percent").addClass("down-text"); 293 } 294 295 setTimeout(function () { 296 $("#nf_IC0 .item-chart__cur, #nf_IC0 .item-chart__price, #nf_IC0 .item-chart__percent").removeClass("flash-white"); 297 $("#nf_IC0 .item-price, #nf_IC0 .item-percent").removeClass("flash-white"); 298 }, 800); 299 }; 300 301 $('.item-chart__img img').each(function () { 302 const originalSrc = $(this).attr('src').split('?')[0]; 303 $(this).attr('src', originalSrc + '?' + new Date().getTime()); 304 }); 305 }) 306 307 .catch(error => { 308 console.error('æ°æ®è·å失败:', error); 309 }); 310 }; 311 312 updateStockData(); 313 314 const refreshInterval = setInterval(updateStockData, 5000); 315 316 document.addEventListener('visibilitychange', function () { 317 if (document.hidden) { 318 clearInterval(refreshInterval); 319 } else { 320 updateStockData(); 321 setInterval(updateStockData, 5000); 322 } 323 }); 324 325 $('.quoted-price_list li').on('mouseenter', function () { 326 const $chart = $(this).find('.item-chart'); 327 $chart.css('display', 'block'); 328 setTimeout(function () { 329 $chart.css('opacity', '1'); 330 }, 10); 331 }); 332 333 $('.quoted-price_list li').on('mouseleave', function () { 334 const $chart = $(this).find('.item-chart'); 335 $chart.css('opacity', '0'); 336 setTimeout(function () { 337 if ($chart.css('opacity') === '0') { 338 $chart.css('display', 'none'); 339 } 340 }, 300); 341 }); 342 343}); 344 345$(document).ready(function () { 346 347 (function () { 348 349 function SubShowClass(e, t, n, r, i) { 350 var s = this; 351 this.parentObj = this.$(e); 352 if (this.parentObj == null && e != "none") throw new Error("SubShowClass(ID)åæ°é误:ID 对åä¸åå¨!(value:" + e + ")"); 353 this.lock = !1, 354 this.label = [], 355 this.defaultID = n == null ? 0 : n, 356 this.selectedIndex = this.defaultID, 357 this.openClassName = r == null ? "selected" : r, 358 this.closeClassName = i == null ? "" : i, 359 this.mouseIn = !1; 360 var o = function () { 361 s.mouseIn = !0 362 }, 363 u = function () { 364 s.mouseIn = !1 365 }; 366 e != "none" && e != "" && (this.parentObj.attachEvent ? this.parentObj.attachEvent("onmouseover", o) : this.parentObj.addEventListener("mouseover", o, !1)), 367 e != "none" && e != "" && (this.parentObj.attachEvent ? this.parentObj.attachEvent("onmouseout", u) : this.parentObj.addEventListener("mouseout", u, !1)), 368 typeof t != "string" && (t = "onmousedown"), 369 t = t.toLowerCase(); 370 switch (t) { 371 case "onmouseover": 372 this.eventType = "mouseover"; 373 break; 374 case "onclick": 375 this.eventType = "click"; 376 break; 377 case "onmouseup": 378 this.eventType = "mouseup"; 379 break; 380 default: 381 this.eventType = "mousedown" 382 } 383 this.autoPlay = !1, 384 this.autoPlayTimeObj = null, 385 this.spaceTime = 5e3 386 } 387 388 SubShowClass.prototype = { 389 version: "1.32", 390 author: "mengjia", 391 _delay: 200, 392 393 _setClassName: function (e, t) { 394 var n; 395 n = e.className, 396 n ? (n = n.replace(this.openClassName, ""), n = n.replace(this.closeClassName, ""), n += " " + (t == "open" ? this.openClassName : this.closeClassName)) : n = t == "open" ? this.openClassName : this.closeClassName, 397 e.className = n 398 }, 399 400 addLabel: function (labelID, contID, parentBg, springEvent, blurEvent) { 401 var t = this, 402 labelObj = this.$(labelID), 403 contObj = this.$(contID); 404 if (labelObj == null && labelID != "none") throw new Error("addLabel(labelID)åæ°é误:labelID 对åä¸åå¨!(value:" + labelID + ")"); 405 var TempID = this.label.length; 406 parentBg == "" && (parentBg = null),
407 this.label.push([labelID, contID, parentBg, springEvent, blurEvent]); 408 var tempFunc = function () { 409 t.eventType == "mouseover" ? (clearTimeout(labelObj._timeout), labelObj._timeout = setTimeout(function () { 410 t.select(TempID) 411 }, 412 t._delay)) : t.select(TempID) 413 }; 414 labelID != "none" && (labelObj.attachEvent ? labelObj.attachEvent("on" + this.eventType, tempFunc) : labelObj.addEventListener(this.eventType, tempFunc, !1), t.eventType == "mouseover" && (labelObj.attachEvent ? labelObj.attachEvent("onmouseout", 415 function () { 416 clearTimeout(labelObj._timeout) 417 }) : labelObj.addEventListener("mouseout", 418 function () { 419 clearTimeout(labelObj._timeout) 420 }, 421 !1))), 422 TempID == this.defaultID ? (labelID != "none" && this._setClassName(labelObj, "open"), this.$(contID) && (contObj.style.display = ""), this.ID != "none" && parentBg != null && (this.parentObj.style.background = parentBg), springEvent != null && eval(springEvent)) : (labelID != "none" && this._setClassName(labelObj, "close"), contObj && (contObj.style.display = "none")); 423 var mouseInFunc = function () { 424 t.mouseIn = !0 425 }, 426 mouseOutFunc = function () { 427 t.mouseIn = !1 428 }; 429 contObj && (contObj.attachEvent ? contObj.attachEvent("onmouseover", mouseInFunc) : contObj.addEventListener("mouseover", mouseInFunc, !1), contObj.attachEvent ? contObj.attachEvent("onmouseout", mouseOutFunc) : contObj.addEventListener("mouseout", mouseOutFunc, !1)) 430 }, 431 432 select: function (num, force) { 433 if (typeof num != "number") throw new Error("select(num)åæ°é误:num 䏿¯ number ç±»å!(value:" + num + ")"); 434 if (force != 1 && this.selectedIndex == num) return; 435 var i; 436 for (i = 0; i < this.label.length; i++) if (i == num) this.label[i][0] != "none" && this._setClassName(this.$(this.label[i][0]), "open"), 437 this.$(this.label[i][1]) && (this.$(this.label[i][1]).style.display = ""), 438 this.ID != "none" && this.label[i][2] != null && (this.parentObj.style.background = this.label[i][2]), 439 this.label[i][3] != null && eval(this.label[i][3]); 440 else if (this.selectedIndex == i || force == 1) this.label[i][0] != "none" && this._setClassName(this.$(this.label[i][0]), "close"), 441 this.$(this.label[i][1]) && (this.$(this.label[i][1]).style.display = "none"), 442 this.label[i][4] != null && eval(this.label[i][4]); 443 this.selectedIndex = num 444 }, 445 446 random: function () { 447 if (arguments.length != this.label.length) throw new Error("random()åæ°é误:åæ°æ°é䏿 ç¾æ°éä¸ç¬¦!(length:" + arguments.length + ")"); 448 var e = 0, 449 t; 450 for (t = 0; t < arguments.length; t++) e += arguments[t]; 451 var n = Math.random(), 452 r = 0; 453 for (t = 0; t < arguments.length; t++) { 454 r += arguments[t] / e; 455 if (n < r) { 456 this.select(t); 457 break 458 } 459 } 460 }, 461 462 order: function () { 463 if (arguments.length != this.label.length) throw new Error("order()åæ°é误:åæ°æ°é䏿 ç¾æ°éä¸ç¬¦!(length:" + arguments.length + ")"); 464 if (!/^\d+$/.test(SubShowClass.sum)) return; 465 var e = 0, 466 t; 467 for (t = 0; t < arguments.length; t++) e += arguments[t]; 468 var n = SubShowClass.sum % e; 469 n == 0 && (n = e); 470 var r = 0; 471 for (t = 0; t < arguments.length; t++) { 472 r += arguments[t]; 473 if (r >= n) { 474 this.select(t); 475 break 476 } 477 } 478 }, 479 480 play: function (e) { 481 var t = this; 482 typeof e == "number" && (this.spaceTime = e), 483 clearInterval(this.autoPlayTimeObj), 484 this.autoPlayTimeObj = setInterval(function () { 485 t.autoPlayFunc() 486 }, 487 this.spaceTime), 488 this.autoPlay = !0 489 }, 490 491 autoPlayFunc: function () { 492 if (this.autoPlay == 0 || this.mouseIn == 1) return; 493 this.nextLabel() 494 }, 495 496 nextLabel: function () { 497 var e = this, 498 t = this.selectedIndex; 499 t++, 500 t >= this.label.length && (t = 0), 501 this.select(t), 502 this.autoPlay == 1 && (clearInterval(this.autoPlayTimeObj), this.autoPlayTimeObj = setInterval(function () { 503 e.autoPlayFunc() 504 }, 505 this.spaceTime)) 506 }, 507 508 previousLabel: function () { 509 var e = this, 510 t = this.selectedIndex; 511 t--, 512 t < 0 && (t = this.label.length - 1), 513 this.select(t), 514 this.autoPlay == 1 && (clearInterval(this.autoPlayTimeObj), this.autoPlayTimeObj = setInterval(function () { 515 e.autoPlayFunc() 516 }, 517 this.spaceTime)) 518 }, 519 520 stop: function () { 521 clearInterval(this.autoPlayTimeObj), 522 this.autoPlay = !1 523 }, 524 525 $: function (objName) { 526 return document.getElementById ? eval('document.getElementById("' + objName + '")') : eval("document.all." + objName) 527 } 528 }, 529 530 SubShowClass.readCookie = function (e) { 531 var t = "", 532 n = e + "="; 533 if (document.cookie.length > 0) { 534 var r = document.cookie.indexOf(n); 535 if (r != -1) { 536 r += n.length; 537 var i = document.cookie.indexOf(";", r); 538 i == -1 && (i = document.cookie.length), 539 t = unescape(document.cookie.substring(r, i)) 540 } 541 } 542 return t 543 }, 544 545 SubShowClass.writeCookie = function (e, t, n, r) { 546 var i = "", 547 s = ""; 548 n != null && (i = new Date((new Date).getTime() + n * 36e5), i = "; expires=" + i.toGMTString()), 549 r != null && (s = ";domain=" + r), 550 document.cookie = e + "=" + escape(t) + i + s 551 }, 552 553 SubShowClass.sum = SubShowClass.readCookie("SSCSum"), 554 /^\d+$/.test(SubShowClass.sum) ? SubShowClass.sum++ : SubShowClass.sum = 1, 555 SubShowClass.writeCookie("SSCSum", SubShowClass.sum, 12); 556 557 window.SubShowClass = SubShowClass; 558 559 })(); 560 561 (function ($$) { 562 if (typeof $$.FN === 'undefined') { $$.FN = {} }; 563 var FN = $$.FN; 564 565 FN.hasClass = function (ele, cname) { 566 var reg = new RegExp('(^| )' + cname + '( |$)'), 567 ename = ele.className; 568 return reg.test(ename); 569 }; 570 571 FN.addEvent = function (ele, etype, fn) { 572 if (ele.addEventListener) { 573 ele.addEventListener(etype, fn, false); 574 } else if (ele.attachEvent) { 575 ele.attachEvent('on' + etype, fn); 576 } else { 577 ele['on' + etype] = fn; 578 } 579 }; 580 581 FN.preventDefault = function (e) { 582 e.preventDefault && e.preventDefault(); 583 e.returnValue = false;
584 }; 585 586 FN.delegate = function (ele, cname, etype, fn) { 587 FN.addEvent(ele, etype, function (e) { 588 var e = e || window.event, 589 t = e.target || e.srcElement; 590 if (!t.nodeName) { t = t.parentNode; } 591 do { 592 if (FN.hasClass(t, cname)) { 593 fn(e, t); 594 return; 595 } 596 t = t.parentNode; 597 } while (t != ele && t.parentNode) 598 }) 599 }; 600 601 FN.getScript = function (url, callback, charset) { 602 var njs = document.createElement('script'); 603 njs.onload = njs.onreadystatechange = function () { 604 if (!this.readyState || this.readyState === 'complete' || this.readyState === 'loaded') { 605 njs.onload = njs.onreadystatechange = null; 606 if (typeof callback === 'function') { callback(); } 607 njs.parentNode.removeChild(njs); 608 } 609 }; 610 njs.setAttribute('src', url); 611 njs.setAttribute('charset', charset || ''); 612 document.getElementsByTagName('head')[0].appendChild(njs); 613 }; 614 615 FN.kNum = function (num, f) { 616 var b, e, s = [], k = false; 617 num = num - 0; 618 if (num < 0) { k = true; } 619 num = (Math.abs(num) + '').split('.'); 620 b = num[0]; 621 e = num[1] || ''; 622 while (b.length > 0) { 623 s.unshift(b.slice(-3)); 624 b = b.slice(0, -3); 625 } 626 if (typeof f === 'number') { 627 e = e.slice(0, f); 628 } 629 if (e !== '') { e = '.' + e; } 630 return k ? ('-' + s.join(',') + e) : s.join(',') + e; 631 }; 632 633 $$.FN = FN; 634 635 })(window); 636 637 (function () { 638 var isPAD = false; 639 if ('ontouchstart' in window) { 640 isPAD = true; 641 FN.delegate(document.body, 'tablinkbtns', 'click', function (e) { 642 e = e || window.event; 643 FN.preventDefault(e); 644 }); 645 } 646 window.isPAD = isPAD; 647 })(); 648 649 (function () { 650 var etype = isPAD ? 'onclick' : 'onmouseover', 651 ssc = new SubShowClass('none', etype, '', 'selected'); 652 ssc.addLabel('gegu_lab01', 'gegu_c01'); 653 ssc.addLabel('gegu_lab02', 'gegu_c02'); 654 ssc.addLabel('gegu_lab03', 'gegu_c03'); 655 ssc.addLabel('gegu_lab04', 'gegu_c04'); 656 ssc.addLabel('gegu_lab05', 'gegu_c05'); 657 })(); 658 659 (function () { 660 661 var keys = [ 662 'new_all_changepercent_up', 663 'new_all_changepercent_down', 664 'si_api0', 665 'si_api1', 666 'new_all_turnoverrate', 667 ], 668 669 hqapijson = '/plugins/apihq/datagtu.php?ran=%ran%&format=json&list=', 670 hqapi = '/plugins/apihq/datagtu.php?ran=%ran%&list=', 671 ttables = '<table>', 672 ttablee = '</table>', 673 tbodys = '<tbody>', 674 tbodye = '</tbody>', 675 tth0 = '<thead><tr><th>æå</th><th>åç§°</th><th>ææ°ä»·</th><th>æ¶¨å¹ </th><th>æ¢æç</th><th> </th></tr></thead>', 676 tth1 = '<thead><tr><th>æå</th><th>åç§°</th><th>ææ°ä»·</th><th>æ¶¨å¹ </th><th>æµå ¥ç</th><th> </th></tr></thead>', 677 tth2 = '<thead><tr><th>æå</th><th>åç§°</th><th>ææ°ä»·</th><th>æ¶¨å¹ </th><th>æµåºç</th><th> </th></tr></thead>', 678 ttd0 = '<tr><th>%rank%</th><td><a href="javascript:;" title="%scname%(%symbol%)">%scname%</a></td><td class="%ccolor%">%price%</td><td class="%ccolor%">%chg%%</td><td>%ratio%%</td></tr>', 679 680 paint = function (wid, datas, tth, ttd, num) { 681 var h = [], 682 w = document.getElementById(wid), 683 dl = datas.length, 684 l = num ? Math.min(num, dl) : dl; 685 h.push(ttables); 686 h.push(tth); 687 h.push(tbodys); 688 for (var i = 0; i < l; i++) { 689 var d = datas[i]; 690 h.push(ttd.replace(/%rank%/g, d['rank']).replace(/%symbol%/g, d['symbol']).replace(/%scname%/g, d['scname']).replace(/%cname%/g, d['cname']).replace(/%price%/g, isFinite(d['price']) ? d['price'] || '--' : '--').replace(/%chg%/g, isFinite(d['chg']) ? d['chg'] || '--' : '--').replace(/%ratio%/g, isFinite(d['ratio']) ? d['ratio'] || '--' : '--').replace(/%ccolor%/g, d['ccolor']).replace(/%hcode%/g, d['hcode']).replace(/%shcname%/g, d['shcname']).replace(/%hcname%/g, d['hcname']).replace(/%hchg%/g, isFinite(d['hchg']) ? d['hchg'] || '--' : '--').replace(/%hnet%/g, d['hnet']).replace(/%minchg%/g, isFinite(d['minchg']) ? d['minchg'] || '--' : '--').replace(/%maxchg%/g, isFinite(d['maxchg']) ? d['maxchg'] || '--' : '--').replace(/%tdate%/g, d['tdate']).replace(/%ati%/g, d['ati']).replace(/%atprice%/g, isFinite(d['atprice']) ? d['atprice'] || '--' : '--').replace(/%atchg%/g, isFinite(d['atchg']) ? d['atchg'] || '--' : '--').replace(/%hccolor%/g, d['hccolor'])); 691 } 692 h.push(tbodye); 693 h.push(ttablee); 694 w.innerHTML = h.join(''); 695 }, 696 697 formatC0 = function () { 698 var ret = [], 699 s = window['hq_json_new_all_changepercent_up']; 700 if (typeof s === 'undefined' || s === '') { return ret; } 701 for (var i = 0, l = s.length; i < l; i++) { 702 var d = s[i], 703 c = d[3] - 0, 704 ccolor = c > 0 ? 'cred' : c < 0 ? 'cgreen' : '';
705 ret.push({ 706 rank: i + 1, 707 symbol: d[0], 708 cname: d[1], 709 scname: d[1].slice(0, 15), 710 price: FN.kNum(d[2] - 0, 2), 711 chg: c.toFixed(2), 712 ratio: (d[5] - 0).toFixed(2), 713 ccolor: ccolor 714 }); 715 } 716 paint('gegu_c01', ret, tth0, ttd0, 10); 717 }, 718 719 formatC1 = function () { 720 var ret = [], 721 s = window['hq_json_new_all_changepercent_down']; 722 if (typeof s === 'undefined' || s === '') { return ret; } 723 for (var i = 0, l = s.length; i < l; i++) { 724 var d = s[i], 725 c = d[3] - 0, 726 ccolor = c > 0 ? 'cred' : c < 0 ? 'cgreen' : ''; 727 ret.push({ 728 rank: i + 1, 729 symbol: d[0], 730 cname: d[1], 731 scname: d[1].slice(0, 15), 732 price: FN.kNum(d[2] - 0, 2), 733 chg: c.toFixed(2), 734 ratio: (d[5] - 0).toFixed(2), 735 ccolor: ccolor 736 }); 737 } 738 paint('gegu_c02', ret, tth0, ttd0, 10); 739 }, 740 741 formatC2 = function () { 742 var ret = [], 743 s = window['hq_json_si_api0']; 744 if (typeof s === 'undefined' || s === '') { return ret; } 745 for (var i = 0, l = s.length; i < l; i++) { 746 var d = s[i], 747 c = d['changeratio'] * 100, 748 ccolor = c > 0 ? 'cred' : c < 0 ? 'cgreen' : ''; 749 ret.push({ 750 rank: i + 1, 751 symbol: d['symbol'], 752 cname: d['name'], 753 scname: d['name'].slice(0, 15), 754 price: FN.kNum(d['trade'] - 0, 2), 755 chg: c.toFixed(2), 756 ratio: ((d['ratioamount'] - 0) * 100).toFixed(2), 757 ccolor: ccolor 758 }); 759 } 760 paint('gegu_c03', ret, tth1, ttd0, 10); 761 }, 762 763 formatC3 = function () { 764 var ret = [], 765 s = window['hq_json_si_api1']; 766 if (typeof s === 'undefined' || s === '') { return ret; } 767 for (var i = 0, l = s.length; i < l; i++) { 768 var d = s[i], 769 c = d['changeratio'] * 100, 770 ccolor = c > 0 ? 'cred' : c < 0 ? 'cgreen' : ''; 771 ret.push({ 772 rank: i + 1, 773 symbol: d['symbol'], 774 cname: d['name'], 775 scname: d['name'].slice(0, 15), 776 price: FN.kNum(d['trade'] - 0, 2), 777 chg: c.toFixed(2), 778 ratio: ((d['ratioamount'] - 0) * 100).toFixed(2), 779 ccolor: ccolor 780 }); 781 } 782 paint('gegu_c04', ret, tth2, ttd0, 10); 783 }, 784 785 formatC4 = function () { 786 var ret = [], 787 s = window['hq_json_new_all_turnoverrate']; 788 if (typeof s === 'undefined' || s === '') { return ret; } 789 for (var i = 0, l = s.length; i < l; i++) { 790 var d = s[i], 791 c = d[5] - 0, 792 ccolor = c > 0 ? 'cred' : c < 0 ? 'cgreen' : ''; 793 ret.push({ 794 rank: i + 1, 795 symbol: d[0], 796 cname: d[1], 797 scname: d[1].slice(0, 15), 798 price: FN.kNum(d[2] - 0, 2), 799 chg: c.toFixed(2), 800 ratio: (d[3] - 0).toFixed(2), 801 ccolor: ccolor 802 }); 803 } 804 paint('gegu_c05', ret, tth0, ttd0, 10); 805 }, 806 807 pStocks = function (key, delay, callback) { 808 var api = hqapijson, 809 lists = [];
810 for (var i = 0, l = key.length; i < l; i++) { 811 lists.push(keys[key[i]]); 812 } 813 api = api + lists.join(','); 814 if (typeof callback === 'string') { api = api.replace(/%callback%/, callback); } 815 getDatas(api, callback); 816 setInterval(function () { 817 getDatas(api, callback); 818 }, delay); 819 }, 820 821 getDatas = function (api, callback) { 822 FN.getScript(api.replace(/%ran%/, Math.random()), callback); 823 }; 824 825 setTimeout(function () { 826 pStocks([0, 1, 2, 3, 4], 20e3, function () { 827 formatC0(); 828 formatC1(); 829 formatC2(); 830 formatC3(); 831 formatC4(); 832 }); 833 }, 200); 834 835 })(); 836 837});
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.