1/* global NexT, CONFIG, DISQUS */ 2 3document.addEventListener('page:loaded', () => { 4 5 if (CONFIG.disqus.count) { 6 const loadCount = () => { 7 NexT.utils.getScript(`https://${CONFIG.disqus.shortname}.disqus.com/count.js`, { 8 attributes: { id: 'dsq-count-scr' } 9 }); 10 }; 11 12 // defer loading until the whole page loading is completed 13 window.addEventListener('load', loadCount, false); 14 } 15 16 if (CONFIG.page.comments) { 17 // `disqus_config` should be a global variable 18 // See https://help.disqus.com/en/articles/1717084-javascript-configuration-variables 19 window.disqus_config = function() { 20 this.page.url = CONFIG.page.permalink; 21 this.page.identifier = CONFIG.page.path; 22 this.page.title = CONFIG.page.title; 23 if (CONFIG.disqus.i18n.disqus !== 'disqus') { 24 this.language = CONFIG.disqus.i18n.disqus; 25 } 26 }; 27 NexT.utils.loadComments('#disqus_thread').then(() => { 28 if (window.DISQUS) { 29 DISQUS.reset({ 30 reload: true, 31 config: window.disqus_config 32 }); 33 } else { 34 NexT.utils.getScript(`https://${CONFIG.disqus.shortname}.disqus.com/embed.js`, { 35 attributes: { dataset: { timestamp: '' + +new Date() } } 36 }); 37 } 38 }); 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.