From f0fba592cbed5473421f6dd973b2db223cacd707 Mon Sep 17 00:00:00 2001 From: SukkaW Date: Sun, 19 May 2019 20:13:51 +0800 Subject: [PATCH] version 1.2.5 --- dist/disqus.js | 4 ++-- dist/disqusjs.css | 2 +- docs/index.html | 4 ++-- package.json | 2 +- 4 files changed, 6 insertions(+), 6 deletions(-) diff --git a/dist/disqus.js b/dist/disqus.js index 631238a..ca1ab79 100644 --- a/dist/disqus.js +++ b/dist/disqus.js @@ -1,6 +1,6 @@ /*! - * DisqusJS | v1.2.4 + * DisqusJS | v1.2.5 * Author: SukkaW * Link: https://github.com/SukkaW/DisqusJS * License: MIT - */"use strict";function _typeof(s){return(_typeof="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(s){return typeof s}:function(s){return s&&"function"==typeof Symbol&&s.constructor===Symbol&&s!==Symbol.prototype?"symbol":typeof s})(s)}!function(s,e){"function"==typeof define&&define.amd?define("DisqusJS",[],e):"object"===("undefined"==typeof module?"undefined":_typeof(module))&&module.exports?module.exports=e():s.DisqusJS=e()}("undefined"!=typeof self?self:void 0,function(){return function(s){var l=document,j=function(s){return l.getElementById(s)},n=function(s,e,t){var n=new XMLHttpRequest;n.open("GET",encodeURI(s),!0),n.onload=function(){if(200<=n.status&&n.status<300||304===n.status){var s=JSON.parse(n.responseText);e(s)}else o()},n.timeout=4500,n.ontimeout=function(s){t(s)},n.onerror=function(s){t(s)},n.send()},y=function(s,e){try{localStorage.setItem(s,e)}catch(s){}},d=function(s){var e=function(s){return s<10?"0".concat(s):s};s=Date.parse(new Date(s));var t=(s=new Date(s+288e5)).getFullYear(),n=e(s.getMonth()+1),o=e(s.getDate()),a=e(s.getHours()),r=e(s.getMinutes());return"".concat(t,"-").concat(n,"-").concat(o," ").concat(a,":").concat(r)};function e(){var s=l.createElement("script");j("disqus_thread").innerHTML='
评论完整模式加载中...如果长时间无法加载,请针对 disq.us | disquscdn.com | disqus.com 启用代理,或使用 评论基础模式
',j("dsqjs-force-dsqjs").addEventListener("click",r),s.src="https://".concat(k.config.shortname,".disqus.com/embed.js"),s.setAttribute("data-timestamp",+new Date),(l.head||l.body).appendChild(s)}function b(){j("disqus_thread").innerHTML='
正在检查 Disqus 能否访问...
';for(var s=["disqus.com","".concat(k.config.shortname,".disqus.com")],n=0,o=0,a=function(){s.length===n&&n===o?L():s.length===n&&r()},e=function(s){var e=new Image,t=setTimeout(function(){e.onerror=e.onload=null,n++,a()},3e3);e.onerror=function(){clearTimeout(t),n++,a()},e.onload=function(){clearTimeout(t),n++,o++,a()},e.src="https://".concat(s,"/favicon.ico?").concat(+new Date)},t=0;t切换到完整 Disqus 模式 进行初始化?',j("dsqjs-force-disqus").addEventListener("click",L)):o()},function(s){o()})}();var t=function m(s){var f=j("dsqjs-load-more"),q=l.getElementsByClassName("dsqjs-order-radio");$loadHideCommentInDisqus=l.getElementsByClassName("dsqjs-has-more-btn");var p=function s(){var e=!0,t=!1,n=void 0;try{for(var o,a=q[Symbol.iterator]();!(e=(o=a.next()).done);e=!0)o.value.removeEventListener("change",g)}catch(s){t=!0,n=s}finally{try{e||null==a.return||a.return()}finally{if(t)throw n}}f.removeEventListener("click",s);var r=!0,i=!1,d=void 0;try{for(var c,l=$loadHideCommentInDisqus[Symbol.iterator]();!(r=(c=l.next()).done);r=!0)c.value.removeEventListener("click",b)}catch(s){i=!0,d=s}finally{try{r||null==l.return||l.return()}finally{if(i)throw d}}m(k.page.next)},u=function(){s?(f.classList.remove("dsqjs-disabled"),f.innerHTML="加载更多评论失败,点击重试",f.addEventListener("click",p)):o()},g=function s(e){k.sortType=e.target.getAttribute("value"),y("disqus.sort",k.sortType);var t=!0,n=!1,o=void 0;try{for(var a,r=q[Symbol.iterator]();!(t=(a=r.next()).done);t=!0)a.value.removeEventListener("change",s)}catch(s){n=!0,o=s}finally{try{t||null==r.return||r.return()}finally{if(n)throw o}}f.removeEventListener("click",p);var i=!0,d=!1,c=void 0;try{for(var l,u=$loadHideCommentInDisqus[Symbol.iterator]();!(i=(l=u.next()).done);i=!0)l.value.removeEventListener("click",b)}catch(s){d=!0,c=s}finally{try{i||null==u.return||u.return()}finally{if(d)throw c}}k.page.comment=[],k.page.next="",j("dsqjs-post-container").innerHTML='

正在切换排序方式...

',f.classList.add("dsqjs-hide"),m()};s=s?"&cursor=".concat(s):"",f.classList.add("dsqjs-disabled");var v={parseDate:function(s){return Date.parse(new Date(s.createdAt))},parentAsc:function(s,e){return s.parent&&e.parent?v.parseDate(s)-v.parseDate(e):0}},e="".concat(k.config.api,"3.0/threads/listPostsThreaded?forum=").concat(k.config.shortname,"&thread=").concat(k.page.id).concat(s,"&api_key=").concat(a(),"&order=").concat(k.sortType);n(e,function(s){if(0===s.code&&0尝试完整 Disqus 模式 | 强制完整 Disqus 模式。',j("dsqjs-header").classList.remove("dsqjs-hide"),j("dsqjs-post-container").innerHTML='
这里冷冷清清的,一条评论都没有
',j("dsqjs-reload-disqus").addEventListener("click",b),j("dsqjs-force-disqus").addEventListener("click",L)):u()},function(s){u()})},h=function(s){var e,o,a,t,r=function(s){return s.comment.author.profileUrl?(s.comment.avatarEl=''),s.comment.authorEl='")):(s.comment.avatarEl=''),s.comment.authorEl='")),k.config.adminLabel&&s.isPrimary&&(s.comment.authorEl+=''.concat(k.config.adminLabel,"")),s},i=function(s){var e="",t="";return t=s.isDeleted?"此评论已被删除":(e="".concat(s.authorEl,''),s.message),'
'.concat(s.avatarEl,'
').concat(e,'
').concat(function(s){var e=l.createElement("div");e.innerHTML=s;var t=e.getElementsByTagName("a"),n=!0,o=!1,a=void 0;try{for(var r,i=t[Symbol.iterator]();!(n=(r=i.next()).done);n=!0){var d=r.value,c=d.href;c=decodeURIComponent(c.replace(/https:\/\/disq.us\/url\?url=/g,"").replace(/(.*)"/,"$1")).replace(/(.*):(.*)cuid=(.*)/,"$1"),d.href=c,d.innerHTML=c,d.rel="nofollow noopener noreferrer",d.target="_blank"}}catch(s){o=!0,a=s}finally{try{n||null==i.return||i.return()}finally{if(o)throw a}}return e.innerHTML}(t),"
")},n="";e=[],o=[],a=function(s){return{comment:s,author:s.author.name,isPrimary:!!k.config.admin&&s.author.username===k.config.admin,children:t(+s.id),hasMore:s.hasMore}},t=function(s){if(0===o.length)return null;for(var e=[],t=0;t切换到 完整 Disqus 模式 显示更多回复

')),n+='
  • ').concat(i(s.comment)).concat(function t(s){var n=s.nesting,e=s.children||[];if(e){var o=n':'
      ';return e.map(function(s){(s=r(s)).nesting=n+1;var e="";s.hasMore&&(e='

      切换到 完整 Disqus 模式 显示更多回复

      ')),o+='
    • ').concat(i(s.comment)).concat(t(s)).concat(e,"
    • ")}),0!==(o+="
    ").length?o:void 0}}(s)).concat(e,"
  • ")}),j("dsqjs-header").classList.remove("dsqjs-hide"),j("dsqjs-msg").innerHTML='你可能无法访问 Disqus,已启用评论基础模式。如需完整体验请针对 disq.us | disquscdn.com | disqus.com 启用代理并 尝试完整 Disqus 模式 | 强制完整 Disqus 模式。',j("dsqjs-post-container").innerHTML=n,j("dsqjs-reload-disqus").addEventListener("click",b),j("dsqjs-force-disqus").addEventListener("click",L)}}function o(){j("dsqjs-msg").innerHTML='评论基础模式加载失败,是否 重载尝试完整 Disqus 模式 ?',j("dsqjs-reload-dsqjs").addEventListener("click",t),j("dsqjs-reload-disqus").addEventListener("click",b)}function r(){y("dsqjs_mode","dsqjs"),t()}function L(){y("dsqjs_mode","disqus"),e()}Array.isArray||(Array.isArray=function(s){return"[object Array]"===Object.prototype.toString.call(s)});var k={};k.config=s,k.config.api=k.config.api||"https://disqus.skk.moe/disqus/",k.config.identifier=k.config.identifier||l.location.origin+l.location.pathname+l.location.search,k.config.url=k.config.url||l.location.origin+l.location.pathname+l.location.search,k.config.title=k.config.title||l.title,k.config.nesting=k.config.nesting?parseInt(k.config.nesting):4,k.page=[];var a=function(){return Array.isArray(k.config.apikey)?k.config.apikey[Math.floor(Math.random()*k.config.apikey.length)]:k.config.apikey};window.disqus_config=function(){this.page.url=k.config.url,this.page.identifier=k.config.identifier,this.page.title=k.config.title},k.mode=localStorage.getItem("dsqjs_mode"),k.sortType=localStorage.getItem("disqus.sort"),k.sortType||(y("disqus.sort","desc"),k.sortType="desc"),"disqus"===k.mode?e():"dsqjs"===k.mode?t():b()}}); \ No newline at end of file + */"use strict";function _typeof(s){return(_typeof="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(s){return typeof s}:function(s){return s&&"function"==typeof Symbol&&s.constructor===Symbol&&s!==Symbol.prototype?"symbol":typeof s})(s)}!function(s,e){"function"==typeof define&&define.amd?define("DisqusJS",[],e):"object"===("undefined"==typeof module?"undefined":_typeof(module))&&module.exports?module.exports=e():s.DisqusJS=e()}("undefined"!=typeof self?self:void 0,function(){return function(s){var l=document,y=function(s){return l.getElementById(s)},n=function(s,e,t){var n=new XMLHttpRequest;n.open("GET",encodeURI(s),!0),n.onload=function(){if(200<=n.status&&n.status<300||304===n.status){var s=JSON.parse(n.responseText);e(s)}else o()},n.timeout=4500,n.ontimeout=function(s){t(s)},n.onerror=function(s){t(s)},n.send()},b=function(s,e){try{localStorage.setItem(s,e)}catch(s){}},c=function(s){var e=function(s){return s<10?"0".concat(s):s};s=Date.parse(new Date(s));var t=(s=new Date(s+288e5)).getFullYear(),n=e(s.getMonth()+1),o=e(s.getDate()),a=e(s.getHours()),r=e(s.getMinutes());return"".concat(t,"-").concat(n,"-").concat(o," ").concat(a,":").concat(r)};function e(){var s=l.createElement("script");y("disqus_thread").innerHTML='
    评论完整模式加载中...如果长时间无法加载,请针对 disq.us | disquscdn.com | disqus.com 启用代理,或使用 评论基础模式
    ',y("dsqjs-force-dsqjs").addEventListener("click",r),s.src="https://".concat(E.config.shortname,".disqus.com/embed.js"),s.setAttribute("data-timestamp",+new Date),(l.head||l.body).appendChild(s)}function L(){y("disqus_thread").innerHTML='
    正在检查 Disqus 能否访问...
    ';for(var s=["disqus.com","".concat(E.config.shortname,".disqus.com")],n=0,o=0,a=function(){s.length===n&&n===o?k():s.length===n&&r()},e=function(s){var e=new Image,t=setTimeout(function(){e.onerror=e.onload=null,n++,a()},3e3);e.onerror=function(){clearTimeout(t),n++,a()},e.onload=function(){clearTimeout(t),n++,o++,a()},e.src="https://".concat(s,"/favicon.ico?").concat(+new Date)},t=0;t切换到完整 Disqus 模式 进行初始化?',y("dsqjs-force-disqus").addEventListener("click",k)):o()},function(s){o()})}();var t=function m(s){var f=y("dsqjs-load-more"),q=l.getElementsByClassName("dsqjs-order-radio"),p=l.getElementsByClassName("dsqjs-has-more-btn"),g=function s(){var e=!0,t=!1,n=void 0;try{for(var o,a=q[Symbol.iterator]();!(e=(o=a.next()).done);e=!0)o.value.removeEventListener("change",h)}catch(s){t=!0,n=s}finally{try{e||null==a.return||a.return()}finally{if(t)throw n}}f.removeEventListener("click",s);var r=!0,i=!1,c=void 0;try{for(var d,l=p[Symbol.iterator]();!(r=(d=l.next()).done);r=!0)d.value.removeEventListener("click",L)}catch(s){i=!0,c=s}finally{try{r||null==l.return||l.return()}finally{if(i)throw c}}m(E.page.next)},u=function(){s?(f.classList.remove("dsqjs-disabled"),f.innerHTML="加载更多评论失败,点击重试",f.addEventListener("click",g)):o()},h=function s(e){E.sortType=e.target.getAttribute("value"),b("disqus.sort",E.sortType);var t=!0,n=!1,o=void 0;try{for(var a,r=q[Symbol.iterator]();!(t=(a=r.next()).done);t=!0)a.value.removeEventListener("change",s)}catch(s){n=!0,o=s}finally{try{t||null==r.return||r.return()}finally{if(n)throw o}}f.removeEventListener("click",g);var i=!0,c=!1,d=void 0;try{for(var l,u=p[Symbol.iterator]();!(i=(l=u.next()).done);i=!0)l.value.removeEventListener("click",L)}catch(s){c=!0,d=s}finally{try{i||null==u.return||u.return()}finally{if(c)throw d}}E.page.comment=[],E.page.next="",y("dsqjs-post-container").innerHTML='

    正在切换排序方式...

    ',f.classList.add("dsqjs-hide"),m()};s=s?"&cursor=".concat(s):"",f.classList.add("dsqjs-disabled");var v={parseDate:function(s){return Date.parse(new Date(s.createdAt))},parentAsc:function(s,e){return s.parent&&e.parent?v.parseDate(s)-v.parseDate(e):0}},e="".concat(E.config.api,"3.0/threads/listPostsThreaded?forum=").concat(E.config.shortname,"&thread=").concat(E.page.id).concat(s,"&api_key=").concat(a(),"&order=").concat(E.sortType);n(e,function(s){if(0===s.code&&0尝试完整 Disqus 模式 | 强制完整 Disqus 模式。',y("dsqjs-header").classList.remove("dsqjs-hide"),y("dsqjs-post-container").innerHTML='
    这里冷冷清清的,一条评论都没有
    ',y("dsqjs-reload-disqus").addEventListener("click",L),y("dsqjs-force-disqus").addEventListener("click",k)):u()},function(s){u()})},j=function(s){var e,o,a,t,r=function(s){return s.comment.author.profileUrl?(s.comment.avatarEl=''),s.comment.authorEl='")):(s.comment.avatarEl=''),s.comment.authorEl='")),E.config.adminLabel&&s.isPrimary&&(s.comment.authorEl+=''.concat(E.config.adminLabel,"")),s},i=function(s){var e="",t="";return t=s.isDeleted?"此评论已被删除":(e="".concat(s.authorEl,''),s.message),'
    '.concat(s.avatarEl,'
    ').concat(e,'
    ').concat(function(s){var e=l.createElement("div");e.innerHTML=s;var t=e.getElementsByTagName("a"),n=!0,o=!1,a=void 0;try{for(var r,i=t[Symbol.iterator]();!(n=(r=i.next()).done);n=!0){var c=r.value,d=c.href;d=decodeURIComponent(d.replace(/https:\/\/disq.us\/url\?url=/g,"").replace(/(.*)"/,"$1")).replace(/(.*):(.*)cuid=(.*)/,"$1"),c.href=d,c.innerHTML=d,c.rel="nofollow noopener noreferrer",c.target="_blank"}}catch(s){o=!0,a=s}finally{try{n||null==i.return||i.return()}finally{if(o)throw a}}return e.innerHTML}(t),"
    ")},n="";e=[],o=[],a=function(s){return{comment:s,author:s.author.name,isPrimary:!!E.config.admin&&s.author.username===E.config.admin,children:t(+s.id),hasMore:s.hasMore}},t=function(s){if(0===o.length)return null;for(var e=[],t=0;t切换到 完整 Disqus 模式 显示更多回复

    ')),n+='
  • ').concat(i(s.comment)).concat(function t(s){var n=s.nesting,e=s.children||[];if(e){var o=n':'
      ';return e.map(function(s){(s=r(s)).nesting=n+1;var e="";s.hasMore&&(e='

      切换到 完整 Disqus 模式 显示更多回复

      ')),o+='
    • ').concat(i(s.comment)).concat(t(s)).concat(e,"
    • ")}),0!==(o+="
    ").length?o:void 0}}(s)).concat(e,"
  • ")}),y("dsqjs-header").classList.remove("dsqjs-hide"),y("dsqjs-msg").innerHTML='你可能无法访问 Disqus,已启用评论基础模式。如需完整体验请针对 disq.us | disquscdn.com | disqus.com 启用代理并 尝试完整 Disqus 模式 | 强制完整 Disqus 模式。',y("dsqjs-post-container").innerHTML=n,y("dsqjs-reload-disqus").addEventListener("click",L),y("dsqjs-force-disqus").addEventListener("click",k)}}function o(){y("dsqjs-msg").innerHTML='评论基础模式加载失败,是否 重载尝试完整 Disqus 模式 ?',y("dsqjs-reload-dsqjs").addEventListener("click",t),y("dsqjs-reload-disqus").addEventListener("click",L)}function r(){b("dsqjs_mode","dsqjs"),t()}function k(){b("dsqjs_mode","disqus"),e()}Array.isArray||(Array.isArray=function(s){return"[object Array]"===Object.prototype.toString.call(s)});var E={};E.config=s,E.config.api=E.config.api||"https://disqus.skk.moe/disqus/",E.config.identifier=E.config.identifier||l.location.origin+l.location.pathname+l.location.search,E.config.url=E.config.url||l.location.origin+l.location.pathname+l.location.search,E.config.title=E.config.title||l.title,E.config.nesting=E.config.nesting?parseInt(E.config.nesting):4,E.page=[];var a=function(){return Array.isArray(E.config.apikey)?E.config.apikey[Math.floor(Math.random()*E.config.apikey.length)]:E.config.apikey};window.disqus_config=function(){this.page.url=E.config.url,this.page.identifier=E.config.identifier,this.page.title=E.config.title},E.mode=localStorage.getItem("dsqjs_mode"),E.sortType=localStorage.getItem("disqus.sort"),E.sortType||(b("disqus.sort","desc"),E.sortType="desc"),"disqus"===E.mode?e():"dsqjs"===E.mode?t():L()}}); \ No newline at end of file diff --git a/dist/disqusjs.css b/dist/disqusjs.css index 8cb814b..19eada2 100644 --- a/dist/disqusjs.css +++ b/dist/disqusjs.css @@ -1,5 +1,5 @@ /*! - * DisqusJS - Default Theme | v1.2.4 + * DisqusJS - Default Theme | v1.2.5 * Author: SukkaW * Link: https://github.com/SukkaW/DisqusJS * License: MIT diff --git a/docs/index.html b/docs/index.html index ea9d5d4..4343a73 100644 --- a/docs/index.html +++ b/docs/index.html @@ -11,7 +11,7 @@ - +