diff --git a/dist/disqus.js b/dist/disqus.js index ad6ea8a..dee93ae 100644 --- a/dist/disqus.js +++ b/dist/disqus.js @@ -6,4 +6,4 @@ * Link: https://github.com/SukkaW/DisqusJS * License: GPL-3.0 */ -function(){disqusjs.page=[],window.disqus_config=function(){this.page.url=disqusjs.config.url,this.page.identifier=disqusjs.config.identifier};var s=new XMLHttpRequest,n=function(e,s){try{localStorage.setItem(e,s)}catch(e){console.log(e),console.log("Failed to set localStorage item")}};Date.prototype.Format=function(e){var s={"M+":this.getMonth()+1,"d+":this.getDate(),"h+":this.getHours(),"m+":this.getMinutes(),"s+":this.getSeconds(),"q+":Math.floor((this.getMonth()+3)/3),S:this.getMilliseconds()};for(var t in/(y+)/.test(e)&&(e=e.replace(RegExp.$1,(this.getFullYear()+"").substr(4-RegExp.$1.length))),s)new RegExp("("+t+")").test(e)&&(e=e.replace(RegExp.$1,1==RegExp.$1.length?s[t]:("00"+s[t]).substr((""+s[t]).length)));return e};var t=function(){var s=new Image,t=setTimeout(function(){s.onerror=s.onload=null,n("disqusjs_mode","dsqjs")},2e3);s.onerror=function(){clearTimeout(t),n("disqusjs_mode","dsqjs"),u()},s.onload=function(){clearTimeout(t);var e=setTimeout(function(){s.onerror=s.onload=null,n("disqusjs_mode","dsqjs")},2e3);s.onerror=function(){clearTimeout(e),n("disqusjs_mode","dsqjs"),u()},s.onload=function(){clearTimeout(e),n("disqusjs_mode","disqus"),u()},s.src="https://"+disqusjs.config.shortname+".disqus.com/favicon.ico?"+ +new Date},s.src="https://disqus.com/favicon.ico?"+ +new Date},a=function(){n("disqusjs_mode","dsqjs"),u()},o=function(){n("disqusjs_mode","disqus"),u()},i=function(){document.getElementById("dsqjs-load-error").classList.remove("dsqjs-hide"),document.getElementById("dsqjs-loading-dsqjs").classList.add("dsqjs-hide"),document.getElementById("dsqjs-reload").addEventListener("click",r)},r=function(){document.getElementById("dsqjs-loading-dsqjs").classList.remove("dsqjs-hide"),document.getElementById("dsqjs-force-disqus").addEventListener("click",o),document.getElementById("dsqjs-reload-disqus").addEventListener("click",t);var e=disqusjs.config.api+"3.0/threads/list.json?forum="+disqusjs.config.shortname+"&thread=ident:"+disqusjs.config.identifier+"&api_key="+disqusjs.config.apikey;s.open("GET",e,!0),s.timeout=4e3,s.send(),s.onload=function(){if(200==this.status||304==this.status){var e=JSON.parse(this.responseText).response[0];disqusjs.page={id:e.id,title:e.title,isClosed:e.isClosed,length:e.posts},d()}},s.ontimeout=function(e){i()},s.onerror=function(e){i()}},d=function(){var e=disqusjs.config.api+"3.0/posts/list.json?forum="+disqusjs.config.shortname+"&thread="+disqusjs.page.id+"&api_key="+disqusjs.config.apikey;s.open("GET",e,!0),s.timeout=4e3,s.send(),s.onload=function(){if(200==this.status||304==this.status){var e=JSON.parse(this.responseText);0===e.code&&0'),s.authorEl='').concat(s.author.name,"")):(s.avatarEl=''),s.authorEl="".concat(s.author.name)),s.author.name===disqusjs.config.admin&&(s.authorEl+=''.concat(disqusjs.config.adminLabel,"")),e.children&&(e.nesting=1);var t='
  • ');t+=baidu.template(o,s),t+="".concat(function t(e){var n=e.nesting,s=e.children||[];if("null"!=typeof s){if(n<4)var a='