1<!doctype html> 2 3 4 5 6 7 8<html class="theme-next mist use-motion"> 9<head> 10 <meta charset="UTF-8"/> 11<meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1" /> 12<meta name="viewport" content="width=device-width, initial-scale=1, maximum-scale=1"/> 13 14 15 16<meta http-equiv="Cache-Control" content="no-transform" /> 17<meta http-equiv="Cache-Control" content="no-siteapp" /> 18 19 20 21 22 23 24 25 26 27 28 29 30 <link href="/vendors/fancybox/source/jquery.fancybox.css?v=2.1.5" rel="stylesheet" type="text/css"/> 31 32 33 34 35 <link href="//fonts.googleapis.com/css?family=Lato:300,400,700,400italic&subset=latin,latin-ext" rel="stylesheet" type="text/css"> 36 37 38 39<link href="/vendors/font-awesome/css/font-awesome.min.css?v=4.4.0" rel="stylesheet" type="text/css" /> 40 41<link href="/css/main.css?v=0.5.0" rel="stylesheet" type="text/css" /> 42 43 44 <meta name="keywords" content="Webå端, 西é£å客, Hexoå客" /> 45 46 47 48 49 50 <link rel="alternate" href="/atom.xml" title="西é£å端" type="application/atom+xml" /> 51 52 53 54 55 <link rel="shortcut icon" type="image/x-icon" href="/favicon.ico?v=0.5.0" /> 56 57 58 59 60 61 62<meta name="description" content="卿¢¦æ³é¢åï¼ä¸å齿¯åå£ã"> 63<meta property="og:type" content="website"> 64<meta property="og:title" content="西é£å端"> 65<meta property="og:url" content="http://xifengxx.github.io/archives/index.html"> 66<meta property="og:site_name" content="西é£å端"> 67<meta property="og:description" content="卿¢¦æ³é¢åï¼ä¸å齿¯åå£ã"> 68<meta name="twitter:card" content="summary"> 69<meta name="twitter:title" content="西é£å端"> 70<meta name="twitter:description" content="卿¢¦æ³é¢åï¼ä¸å齿¯åå£ã"> 71 72 73
74<script type="text/javascript" id="hexo.configuration"> 75 var NexT = window.NexT || {}; 76 var CONFIG = { 77 scheme: 'Mist', 78 sidebar: {"position":"left","display":"post"}, 79 fancybox: true, 80 motion: true, 81 duoshuo: { 82 userId: 0, 83 author: 'å主' 84 } 85 }; 86</script>
86 87 88 <title> 彿¡£ | 西é£å端 </title> 89</head> 90 91<body itemscope itemtype="http://schema.org/WebPage" lang="zh-Hans"> 92 93 94 95 96 97
97<script type="text/javascript"> 98 var _hmt = _hmt || []; 99 (function() { 100 var hm = document.createElement("script"); 101 hm.src = "//hm.baidu.com/hm.js?1e199d27279271fc384c64d64d900b77"; 102 var s = document.getElementsByTagName("script")[0]; 103 s.parentNode.insertBefore(hm, s); 104 })(); 105 </script>
105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 <div class="container one-collumn sidebar-position-left page-archive "> 120 <div class="headband"></div> 121 122 <header id="header" class="header" itemscope itemtype="http://schema.org/WPHeader"> 123 <div class="header-inner"><div class="site-meta "> 124 125 126 <div class="custom-logo-site-title"> 127 <a href="/" class="brand" rel="start"> 128 <span class="logo-line-before"><i></i></span> 129 <span class="site-title">西é£å端</span> 130 <span class="logo-line-after"><i></i></span> 131 </a> 132 </div> 133 <p class="site-subtitle">Webå端å¦ä¹ å客ã</p> 134</div> 135 136<div class="site-nav-toggle"> 137 <button> 138 <span class="btn-bar"></span> 139 <span class="btn-bar"></span> 140 <span class="btn-bar"></span> 141 </button> 142</div> 143 144<nav class="site-nav"> 145 146 147 148 <ul id="menu" class="menu"> 149 150 151 <li class="menu-item menu-item-home"> 152 <a href="/" rel="section"> 153 154 é¦é¡µ 155 </a> 156 </li> 157 158 159 <li class="menu-item menu-item-categories"> 160 <a href="/categories" rel="section"> 161 162 åç±» 163 </a> 164 </li> 165 166 167 <li class="menu-item menu-item-archives"> 168 <a href="/archives" rel="section"> 169 170 彿¡£ 171 </a> 172 </li> 173 174 175 <li class="menu-item menu-item-tags"> 176 <a href="/tags" rel="section"> 177 178 æ ç¾ 179 </a> 180 </li> 181 182 183 <li class="menu-item menu-item-webdemo"> 184 <a href="https://xifengxx.github.io/web-demo/" rel="section"> 185 186 å端ä½åDemo 187 </a> 188 </li> 189 190 191 <li class="menu-item menu-item-nec"> 192 <a href="/course-notes" rel="section"> 193 194 å端微ä¸ä¸ 195 </a> 196 </li> 197 198 199 <li class="menu-item menu-item-about"> 200 <a href="/about" rel="section"> 201 202 å ³äº 203 </a> 204 </li> 205 206 207 208 <li class="menu-item menu-item-search"> 209 210 <a href="#" class="popup-trigger"> 211 212 213 æç´¢ 214 </a> 215 </li> 216 217 </ul> 218 219 220 221 <div class="site-search"> 222 223 <div class="popup"> 224 <span class="search-icon fa fa-search"></span> 225 <input type="text" id="local-search-input"> 226 <div id="local-search-result"></div> 227 <span class="popup-btn-close">close</span> 228</div> 229 230 231 </div> 232 233</nav> 234 235 </div> 236 </header> 237 238 <main id="main" class="main"> 239 <div class="main-inner"> 240 <div class="content-wrap"> 241 <div id="content" class="content"> 242 243 244 <section id="posts" class="posts-collapse"> 245 <span class="archive-move-on"></span> 246 247 <span class="archive-page-counter"> 248 249 250 251 252 好! ç®åå ±è®¡ 75 ç¯æ¥å¿ã ç»§ç»åªåã 253 </span> 254 255 256 257 258 259 260 261 262 263 <div class="collection-title"> 264 <h2 class="archive-year motion-element" id="archive-year-2016">2016</h2> 265 </div> 266 267 268 269 270 271 <article class="post post-type-normal" itemscope itemtype="http://schema.org/Article"> 272 <header class="post-header"> 273 274 <h1 class="post-title"> 275 276 <a class="post-title-link" href="/2016/11/11/Webåç«¯å®æç»éª(JSç¸å ³)/" itemprop="url"> 277 278 <span itemprop="name">Webåç«¯å®æç»éª(JSç¸å ³)</span> 279 280 </a> 281 282 </h1> 283 284 <div class="post-meta"> 285 <time class="post-time" itemprop="dateCreated" 286 datetime="2016-11-11T11:11:11+08:00" 287 content="2016-11-11" > 288 11-11 289 </time> 290 </div> 291 292 </header> 293 </article> 294 295 296 297 298 299 300 301 302 303 304 305 306 307 308 <article class="post post-type-normal" itemscope itemtype="http://schema.org/Article"> 309 <header class="post-header"> 310 311 <h1 class="post-title"> 312 313 <a class="post-title-link" href="/2016/11/11/Webåç«¯å®æç»éª(CSSå页é¢å¸å±)/" itemprop="url"> 314
315 <span itemprop="name">Webåç«¯å®æç»éª(CSSå页é¢å¸å±)</span> 316 317 </a> 318 319 </h1> 320 321 <div class="post-meta"> 322 <time class="post-time" itemprop="dateCreated" 323 datetime="2016-11-11T11:11:11+08:00" 324 content="2016-11-11" > 325 11-11 326 </time> 327 </div> 328 329 </header> 330 </article> 331 332 333 334 335 336 337 338 339 340 341 342 343 344 345 <article class="post post-type-normal" itemscope itemtype="http://schema.org/Article"> 346 <header class="post-header"> 347 348 <h1 class="post-title"> 349 350 <a class="post-title-link" href="/2016/11/11/Webåç«¯å®æç»éª(æµè§å¨å ¼å®¹)/" itemprop="url"> 351 352 <span itemprop="name">Webåç«¯å®æç»éª(æµè§å¨å ¼å®¹)</span> 353 354 </a> 355 356 </h1> 357 358 <div class="post-meta"> 359 <time class="post-time" itemprop="dateCreated" 360 datetime="2016-11-11T11:11:11+08:00" 361 content="2016-11-11" > 362 11-11 363 </time> 364 </div> 365 366 </header> 367 </article> 368 369 370 371 372 373 374 375 376 377 378 379 380 381 382 <article class="post post-type-normal" itemscope itemtype="http://schema.org/Article"> 383 <header class="post-header"> 384 385 <h1 class="post-title"> 386 387 <a class="post-title-link" href="/2016/08/06/Webå端å¼å-æ°ç¥è¯ç¹åçé®/" itemprop="url"> 388 389 <span itemprop="name">Webå端å¼å-æ°ç¥è¯ç¹åçé®</span> 390 391 </a> 392 393 </h1> 394 395 <div class="post-meta"> 396 <time class="post-time" itemprop="dateCreated" 397 datetime="2016-08-06T09:23:24+08:00" 398 content="2016-08-06" > 399 08-06 400 </time> 401 </div> 402 403 </header> 404 </article> 405 406 407 408 409 410 411 412 413 414 415 416 417 418 419 <article class="post post-type-normal" itemscope itemtype="http://schema.org/Article"> 420 <header class="post-header"> 421 422 <h1 class="post-title"> 423 424 <a class="post-title-link" href="/2016/07/30/JavaScriptæ·±å ¥æµ åº(3)/" itemprop="url"> 425 426 <span itemprop="name">JavaScriptæ·±å ¥æµ åº(3)</span> 427 428 </a> 429 430 </h1> 431 432 <div class="post-meta"> 433 <time class="post-time" itemprop="dateCreated" 434 datetime="2016-07-30T21:23:24+08:00" 435 content="2016-07-30" > 436 07-30 437 </time> 438 </div> 439 440 </header> 441 </article> 442 443 444 445 446 447 448 449 450 451 452 453 454 455 456 <article class="post post-type-normal" itemscope itemtype="http://schema.org/Article"> 457 <header class="post-header"> 458 459 <h1 class="post-title"> 460 461 <a class="post-title-link" href="/2016/07/29/JavaScriptæ·±å ¥æµ åº(2)/" itemprop="url"> 462 463 <span itemprop="name">JavaScriptæ·±å ¥æµ åº(2)</span> 464 465 </a> 466 467 </h1> 468 469 <div class="post-meta"> 470 <time class="post-time" itemprop="dateCreated" 471 datetime="2016-07-29T21:23:24+08:00" 472 content="2016-07-29" > 473 07-29 474 </time> 475 </div> 476 477 </header> 478 </article> 479 480 481 482 483 484 485 486 487 488 489 490 491 492 493 <article class="post post-type-normal" itemscope itemtype="http://schema.org/Article"> 494 <header class="post-header"> 495 496 <h1 class="post-title"> 497 498 <a class="post-title-link" href="/2016/07/28/JavaScriptæ·±å ¥æµ åº(1)/" itemprop="url"> 499 500 <span itemprop="name">JavaScriptæ·±å ¥æµ åº(1)</span> 501 502 </a> 503 504 </h1> 505 506 <div class="post-meta"> 507 <time class="post-time" itemprop="dateCreated" 508 datetime="2016-07-28T21:23:24+08:00" 509 content="2016-07-28" > 510 07-28 511 </time> 512 </div> 513 514 </header> 515 </article> 516 517 518 519 520 521 522 523 524 525 526 527 528 529 530 <article class="post post-type-normal" itemscope itemtype="http://schema.org/Article"> 531 <header class="post-header"> 532 533 <h1 class="post-title"> 534 535 <a class="post-title-link" href="/2016/07/14/requestAnimationFrameå¨ç»/" itemprop="url"> 536
537 <span itemprop="name">requestAnimationFrameå¨ç»</span> 538 539 </a> 540 541 </h1> 542 543 <div class="post-meta"> 544 <time class="post-time" itemprop="dateCreated" 545 datetime="2016-07-14T09:23:24+08:00" 546 content="2016-07-14" > 547 07-14 548 </time> 549 </div> 550 551 </header> 552 </article> 553 554 555 556 557 558 559 560 561 562 563 564 565 566 567 <article class="post post-type-normal" itemscope itemtype="http://schema.org/Article"> 568 <header class="post-header"> 569 570 <h1 class="post-title"> 571 572 <a class="post-title-link" href="/2016/07/13/å端工ç¨å¸å¿ å¤çPSæè½-åå¾ç¯/" itemprop="url"> 573 574 <span itemprop="name">å端工ç¨å¸å¿ å¤çPSæè½-åå¾ç¯</span> 575 576 </a> 577 578 </h1> 579 580 <div class="post-meta"> 581 <time class="post-time" itemprop="dateCreated" 582 datetime="2016-07-13T09:23:24+08:00" 583 content="2016-07-13" > 584 07-13 585 </time> 586 </div> 587 588 </header> 589 </article> 590 591 592 593 594 595 596 597 598 599 600 601 602 603 604 <article class="post post-type-normal" itemscope itemtype="http://schema.org/Article"> 605 <header class="post-header"> 606 607 <h1 class="post-title"> 608 609 <a class="post-title-link" href="/2016/07/12/HTML5 Canvasæ¡ä¾-åè®¡æ¶æ¶é/" itemprop="url"> 610 611 <span itemprop="name">HTML5 Canvas宿</span> 612 613 </a> 614 615 </h1> 616 617 <div class="post-meta"> 618 <time class="post-time" itemprop="dateCreated" 619 datetime="2016-07-12T15:23:24+08:00" 620 content="2016-07-12" > 621 07-12 622 </time> 623 </div> 624 625 </header> 626 </article> 627 628 629 630 631 632 </section> 633 634 635 <nav class="pagination"> 636 <span class="page-number current">1</span><a class="page-number" href="/archives/page/2/">2</a><span class="space">…</span><a class="page-number" href="/archives/page/8/">8</a><a class="extend next" rel="next" href="/archives/page/2/"><i class="fa fa-angle-right"></i></a> 637 </nav> 638 639 640 641 642 </div> 643 644 645 646 647 648 </div> 649 650 651 652 <div class="sidebar-toggle"> 653 <div class="sidebar-toggle-line-wrap"> 654 <span class="sidebar-toggle-line sidebar-toggle-line-first"></span> 655 <span class="sidebar-toggle-line sidebar-toggle-line-middle"></span> 656 <span class="sidebar-toggle-line sidebar-toggle-line-last"></span> 657 </div> 658 </div> 659 660 <aside id="sidebar" class="sidebar"> 661 <div class="sidebar-inner"> 662 663 664 665 666 667 <section class="site-overview sidebar-panel sidebar-panel-active "> 668 <div class="site-author motion-element" itemprop="author" itemscope itemtype="http://schema.org/Person"> 669 <img class="site-author-image" itemprop="image" 670 src="/uploads/avatar.png" 671 alt="xifengxx" /> 672 <p class="site-author-name" itemprop="name">xifengxx</p> 673 <p class="site-description motion-element" itemprop="description">卿¢¦æ³é¢åï¼ä¸å齿¯åå£ã</p> 674 </div> 675 <nav class="site-state motion-element"> 676 <div class="site-state-item site-state-posts"> 677 <a href="/archives"> 678 <span class="site-state-item-count">75</span> 679 <span class="site-state-item-name">æ¥å¿</span> 680 </a> 681 </div> 682 683 684 <div class="site-state-item site-state-categories"> 685 <a href="/categories"> 686 <span class="site-state-item-count">31</span> 687 <span class="site-state-item-name">åç±»</span> 688 </a> 689 </div> 690 691 692 693 <div class="site-state-item site-state-tags"> 694 <a href="/tags"> 695 <span class="site-state-item-count">60</span> 696 <span class="site-state-item-name">æ ç¾</span> 697 </a> 698 </div> 699 700 701 </nav> 702 703 704 <div class="feed-link motion-element"> 705 <a href="/atom.xml" rel="alternate"> 706 <i class="fa fa-rss"></i> 707 RSS 708 </a> 709 </div> 710 711 712 <div class="links-of-author motion-element"> 713 714
715 <span class="links-of-author-item"> 716 <a href="https://github.com/xifengxx" target="_blank"> 717 718 <i class="fa fa-github"></i> 719 720 GitHub 721 </a> 722 </span> 723 724 <span class="links-of-author-item"> 725 <a href="http://weibo.com/xifengxx" target="_blank"> 726 727 <i class="fa fa-weibo"></i> 728 729 Weibo 730 </a> 731 </span> 732 733 <span class="links-of-author-item"> 734 <a href="/uploads/wechat.jpg" target="_blank"> 735 736 <i class="fa fa-wechat"></i> 737 738 Weixin 739 </a> 740 </span> 741 742 743 </div> 744 745 746 747 <div class="cc-license motion-element" itemprop="license"> 748 <a href="http://creativecommons.org/licenses/by-nc-sa/4.0" class="cc-opacity" target="_blank"> 749 <img src="/images/cc-by-nc-sa.svg" alt="Creative Commons" /> 750 </a> 751 </div> 752 753 754 755 <div class="links-of-blogroll motion-element"> 756 757 <div class="links-of-blogroll-title">åæ é¾æ¥</div> 758 <ul class="links-of-blogroll-list"> 759 760 <li class="links-of-blogroll-item"> 761 <a href="http://www.xifengxx.com/" target="_blank">西é£å客</a> 762 </li> 763 764 </ul> 765 766 </div> 767 768 </section> 769 770 771 772 </div> 773 </aside> 774 775 776 777 </div> 778 </main> 779 780 <footer id="footer" class="footer"> 781 <div class="footer-inner"> 782 <div class="copyright" > 783 784 © 2015 - 785 <span itemprop="copyrightYear">2016</span> 786 <span class="with-love"> 787 <i class="fa fa-heart"></i> 788 </span> 789 <span class="author" itemprop="copyrightHolder">xifengxx</span> 790</div> 791 792<div class="powered-by"> 793 ç± <a class="theme-link" href="http://hexo.io">Hexo</a> 强åé©±å¨ 794</div> 795 796<div class="theme-info"> 797 ä¸»é¢ - 798 <a class="theme-link" href="https://github.com/iissnan/hexo-theme-next"> 799 NexT.Mist 800 </a> 801</div> 802 803 804 805 </div> 806 </footer> 807 808 <div class="back-to-top"> 809 <i class="fa fa-arrow-up"></i> 810 </div> 811 </div> 812 813 814 815 816 817 818 819 820
821<script type="text/javascript"> 822 if (Object.prototype.toString.call(window.Promise) !== '[object Function]') { 823 window.Promise = null; 824 } 825</script>
825 826 827 828
828<script type="text/javascript" src="/vendors/jquery/index.js?v=2.1.3"></script>
828 829 830
830<script type="text/javascript" src="/vendors/fastclick/lib/fastclick.min.js?v=1.0.6"></script>
830 831 832
832<script type="text/javascript" src="/vendors/jquery_lazyload/jquery.lazyload.js?v=1.9.7"></script>
832 833 834
834<script type="text/javascript" src="/vendors/velocity/velocity.min.js"></script>
834 835 836
836<script type="text/javascript" src="/vendors/velocity/velocity.ui.min.js"></script>
836 837 838
838<script type="text/javascript" src="/vendors/fancybox/source/jquery.fancybox.pack.js"></script>
838 839 840 841 842 843 844
844<script type="text/javascript" src="/js/src/utils.js?v=0.5.0"></script>
844 845 846
846<script type="text/javascript" src="/js/src/motion.js?v=0.5.0"></script>
846 847 848 849 850 851 852 853 854 855
855<script type="text/javascript" id="motion.page.archive"> 856 $('.archive-year').velocity('transition.slideLeftIn'); 857 </script>
857 858 859 860 861 862 863 864
864<script type="text/javascript" src="/js/src/bootstrap.js?v=0.5.0"></script>
864 865 866 867 868 869 870 871 872 873 874
874<script type="text/javascript"> 875 var duoshuoQuery = {short_name:"417131853"}; 876 (function() { 877 var ds = document.createElement('script'); 878 ds.type = 'text/javascript';ds.async = true; 879 ds.id = 'duoshuo-script'; 880 ds.src = (document.location.protocol == 'https:' ? 'https:' : 'http:') + '//static.duoshuo.com/embed.js'; 881 ds.charset = 'UTF-8'; 882 (document.getElementsByTagName('head')[0] 883 || document.getElementsByTagName('body')[0]).appendChild(ds); 884 })(); 885 </script>
885 886 887 888 889 890 891 892 893 894 895 896 897
897<script type="text/javascript"> 898 // Popup Window; 899 var isfetched = false; 900 // Search DB path; 901 var search_path = "search.xml"; 902 if (search_path.length == 0) { 903 search_path = "search.xml"; 904 } 905 var path = "/" + search_path; 906 // monitor main search box; 907 908 function proceedsearch() { 909 $("body").append('<div class="popoverlay">').css('overflow', 'hidden'); 910 $('.popup').toggle(); 911 912 } 913 // search function; 914 var searchFunc = function(path, search_id, content_id) { 915 'use strict'; 916 $.ajax({ 917 url: path, 918 dataType: "xml", 919 async: true, 920 success: function( xmlResponse ) { 921 // get the contents from search data 922 isfetched = true; 923 $('.popup').detach().appendTo('.header-inner'); 924 var datas = $( "entry", xmlResponse ).map(function() { 925 return { 926 title: $( "title", this ).text(), 927 content: $("content",this).text(), 928 url: $( "url" , this).text() 929 }; 930 }).get(); 931 var $input = document.getElementById(search_id); 932 var $resultContent = document.getElementById(content_id); 933 $input.addEventListener('input', function(){ 934 var matchcounts = 0; 935 var str='<ul class=\"search-result-list\">'; 936 var keywords = this.value.trim().toLowerCase().split(/[\s\-]+/); 937 $resultContent.innerHTML = ""; 938 if (this.value.trim().length > 1) { 939 // perform local searching 940 datas.forEach(function(data) { 941 var isMatch = true; 942 var content_index = []; 943 var data_title = data.title.trim().toLowerCase(); 944 var data_content = data.content.trim().replace(/<[^>]+>/g,"").toLowerCase(); 945 var data_url = data.url; 946 var index_title = -1; 947 var index_content = -1; 948 var first_occur = -1; 949 // only match artiles with not empty titles and contents 950 if(data_title != '' && data_content != '') { 951 keywords.forEach(function(keyword, i) { 952 index_title = data_title.indexOf(keyword); 953 index_content = data_content.indexOf(keyword); 954 if( index_title < 0 && index_content < 0 ){ 955 isMatch = false; 956 } else { 957 if (index_content < 0) { 958 index_content = 0; 959 } 960 if (i == 0) { 961 first_occur = index_content; 962 } 963 } 964 }); 965 } 966 // show search results 967 if (isMatch) { 968 matchcounts += 1; 969 str += "<li><a href='"+ data_url +"' class='search-result-title'>"+ data_title +"</a>"; 970 var content = data.content.trim().replace(/<[^>]+>/g,""); 971 if (first_occur >= 0) { 972 // cut out 100 characters 973 var start = first_occur - 20; 974 var end = first_occur + 80; 975 if(start < 0){ 976 start = 0; 977 } 978 if(start == 0){ 979 end = 50; 980 } 981 if(end > content.length){ 982 end = content.length; 983 } 984 var match_content = content.substring(start, end); 985 // highlight all keywords 986 keywords.forEach(function(keyword){ 987 var regS = new RegExp(keyword, "gi"); 988 match_content = match_content.replace(regS, "<b class=\"search-keyword\">"+keyword+"</b>"); 989 }); 990 991 str += "<p class=\"search-result\">" + match_content +"...</p>" 992 } 993 str += "</li>"; 994 } 995 })}; 996 str += "</ul>"; 997 if (matchcounts == 0) { str = '<div id="no-result"><i class="fa fa-frown-o fa-5x" /></div>' } 998 if (keywords == "") { str = '<div id="no-result"><i class="fa fa-search fa-5x" /></div>' } 999 $resultContent.innerHTML = str; 1000 }); 1001 proceedsearch(); 1002 } 1003 });} 1004 1005 // handle and trigger popup window; 1006 $('.popup-trigger').mousedown(function(e) { 1007 e.stopPropagation(); 1008 if (isfetched == false) { 1009 searchFunc(path, 'local-search-input', 'local-search-result'); 1010 } else { 1011 proceedsearch(); 1012 }; 1013 1014 }); 1015 1016 $('.popup-btn-close').click(function(e){ 1017 $('.popup').hide(); 1018 $(".popoverlay").remove(); 1019 $('body').css('overflow', ''); 1020 }); 1021 $('.popup').click(function(e){ 1022 e.stopPropagation(); 1023 }); 1024 </script>
1024 1025 1026 1027 1028 1029 1030 1031
1031<script src="https://cdn1.lncld.net/static/js/av-core-mini-0.6.1.js"></script>
1031 1032
1032<script>AV.initialize("Kkljw3izeaB5Fa8P2HwSjqWq-gzGzoHsz", "JSwiiCRKO0LaKbGHyelnr6jY");</script>
1032 1033
1033<script> 1034 function showTime(Counter) { 1035 var query = new AV.Query(Counter); 1036 var entries = []; 1037 var $visitors = $(".leancloud_visitors"); 1038 1039 $visitors.each(function () { 1040 entries.push( $(this).attr("id").trim() ); 1041 }); 1042 1043 query.containedIn('url', entries); 1044 query.find() 1045 .done(function (results) { 1046 var COUNT_CONTAINER_REF = '.leancloud-visitors-count'; 1047 1048 if (results.length === 0) { 1049 $visitors.find(COUNT_CONTAINER_REF).text(0); 1050 return; 1051 } 1052 1053 for (var i = 0; i < results.length; i++) { 1054 var item = results[i]; 1055 var url = item.get('url'); 1056 var time = item.get('time'); 1057 var element = document.getElementById(url); 1058 1059 $(element).find(COUNT_CONTAINER_REF).text(time); 1060 } 1061 }) 1062 .fail(function (object, error) { 1063 console.log("Error: " + error.code + " " + error.message); 1064 }); 1065 } 1066 1067 function addCount(Counter) { 1068 var $visitors = $(".leancloud_visitors"); 1069 var url = $visitors.attr('id').trim(); 1070 var title = $visitors.attr('data-flag-title').trim(); 1071 var query = new AV.Query(Counter); 1072 1073 query.equalTo("url", url); 1074 query.find({ 1075 success: function(results) { 1076 if (results.length > 0) { 1077 var counter = results[0]; 1078 counter.fetchWhenSave(true); 1079 counter.increment("time"); 1080 counter.save(null, { 1081 success: function(counter) { 1082 var $element = $(document.getElementById(url)); 1083 $element.find('.leancloud-visitors-count').text(counter.get('time')); 1084 }, 1085 error: function(counter, error) { 1086 console.log('Failed to save Visitor num, with error message: ' + error.message); 1087 } 1088 }); 1089 } else { 1090 var newcounter = new Counter(); 1091 newcounter.set("title", title); 1092 newcounter.set("url", url); 1093 newcounter.set("time", 1); 1094 newcounter.save(null, { 1095 success: function(newcounter) { 1096 var $element = $(document.getElementById(url)); 1097 $element.find('.leancloud-visitors-count').text(newcounter.get('time')); 1098 }, 1099 error: function(newcounter, error) { 1100 console.log('Failed to create'); 1101 } 1102 }); 1103 } 1104 }, 1105 error: function(error) { 1106 console.log('Error:' + error.code + " " + error.message); 1107 } 1108 }); 1109 } 1110 1111 $(function() { 1112 var Counter = AV.Object.extend("Counter"); 1113 if ($('.leancloud_visitors').length == 1) { 1114 addCount(Counter); 1115 } else if ($('.post-title-link').length > 1) { 1116 showTime(Counter); 1117 } 1118 }); 1119 </script>
1119 1120 1121 1122 1123 1124 1125</body> 1126</html>
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.