1/*ç®æ¬¡ãªã¹ã*/ 2 3jQuery(function ($) { 4 var idcount = 1; 5 var toc = ''; 6 7 // ãtoc-noneãh2ã«ã¯ã©ã¹ãtoc-noneããå ¥ãããã®ã¯ãç®æ¬¡ã«å«ã¾ããªããªãã 8 9 jQuery("article h2", this).not('.toc-none').each(function () { 10 // article å ã® h2 ã¿ã°ãã«ã¼ãã§é çªã«å¦çãã 11 if(this.id == ""){ 12 this.id = "toc-" + idcount; 13 } 14 idcount++; 15 toc += '<li><a href="#' + this.id + '">' + jQuery(this).text() + "</a></li>\n"; 16 }); 17 if (idcount > 2) { 18 // è¦åºãé ç®ã3件以ä¸ã®å ´åã¯è¦ªè¦ç´ ã«ãis-closeãã¯ã©ã¹ãã¤ãã¦ããï¼ã¯ãã¼ãºç¶æ ã®è¡¨ç¤ºã¯cssã«ã¦æç¤ºï¼ 19 jQuery("#toc").addClass("is-close"); 20 } 21 if (jQuery("article h2")[0]) { 22 // å®éã«ã½ã¼ã¹ã³ã¼ãä¸ã«ç®æ¬¡ã®ã½ã¼ã¹ãæµãè¾¼ãï¼ãã£ã¨è¦ããã¿ã³ãããã§æµãè¾¼ãã§ããï¼ 23 jQuery("#toc").html('<div>ç®æ¬¡</div><ul>' + toc + '</ul><div class="toc-more"><a href="#"></a></div>'); 24 } 25 26 jQuery(document).on('click','.toc-more > a',function(){ 27 // ãã£ã¨è¦ããã¿ã³ãæ¼ãããéã®å¦ç 28 jQuery("#toc").removeClass("is-close"); // 親è¦ç´ ã®ãis-closeãã¯ã©ã¹ãå¤ã 29 jQuery("#toc").html('<div>ç®æ¬¡</div><ul>' + toc + '</ul><div class="toc-open"><a href="#"></a></div>'); 30 return false; 31 }); 32 33 // éãããã¿ã³ãæ¼ãããéã®å¦ç 34 jQuery(document).on('click','.toc-open > a',function(){ 35 jQuery(".toc-open").remove(); 36 jQuery("#toc").addClass("is-close"); 37 jQuery("#toc").html('<div>ç®æ¬¡</div><ul>' + toc + '</ul><div class="toc-more"><a href="#"></a></div>'); 38 return false; 39 }); 40 41});
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.