1// 代ç åä¸é®å¤å¶ 2 3$(function () { 4 var $copyIcon = $('<i class="fas fa-copy code_copy" title="å¤å¶ä»£ç " aria-hidden="true"></i>') 5 var $notice = $('<div class="codecopy_notice"></div>') 6 $('.code-area').prepend($copyIcon) 7 $('.code-area').prepend($notice) 8 // âå¤å¶æåâååºç° 9 function copy(text, ctx) { 10 if (document.queryCommandSupported && document.queryCommandSupported('copy')) { 11 try { 12 document.execCommand('copy') // Security exception may be thrown by some browsers. 13 $(ctx).prev('.codecopy_notice') 14 .text("å¤å¶æå") 15 .animate({ 16 opacity: 1, 17 top: 30 18 }, 450, function () { 19 setTimeout(function () { 20 $(ctx).prev('.codecopy_notice').animate({ 21 opacity: 0, 22 top: 0 23 }, 650) 24 }, 400) 25 }) 26 } catch (ex) { 27 $(ctx).prev('.codecopy_notice') 28 .text("å¤å¶å¤±è´¥") 29 .animate({ 30 opacity: 1, 31 top: 30 32 }, 650, function () { 33 setTimeout(function () { 34 $(ctx).prev('.codecopy_notice').animate({ 35 opacity: 0, 36 top: 0 37 }, 650) 38 }, 400) 39 }) 40 return false 41 } 42 } else { 43 $(ctx).prev('.codecopy_notice').text("æµè§å¨ä¸æ¯æå¤å¶") 44 } 45 } 46 // å¤å¶ 47 $('.code-area .fa-copy').on('click', function () { 48 var selection = window.getSelection() 49 var range = document.createRange() 50 range.selectNodeContents($(this).siblings('pre').find('code')[0]) 51 selection.removeAllRanges() 52 selection.addRange(range) 53 var text = selection.toString() 54 copy(text, this) 55 selection.removeAllRanges() 56 }) 57});
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.