From 4a79b818d2f3db37363b4f27f9491435aa3ee93a Mon Sep 17 00:00:00 2001 From: SukkaW <isukkaw@gmail.com> Date: Fri, 29 May 2020 15:34:11 +0800 Subject: [PATCH] release 1.3.0 --- .gitignore | 4 +++- .npmignore | 2 ++ README.md | 46 +++++++++++++++++++++++++++++----------------- dist/disqus.js | 7 +------ dist/disqusjs.css | 7 +------ docs/index.html | 4 ++-- package.json | 2 +- 7 files changed, 39 insertions(+), 33 deletions(-) diff --git a/.gitignore b/.gitignore index 4cd7534..3892d32 100644 --- a/.gitignore +++ b/.gitignore @@ -13,4 +13,6 @@ _build public -src/index.html \ No newline at end of file +src/index.html + +dist/index.html diff --git a/.npmignore b/.npmignore index 912a432..e8fc8d5 100644 --- a/.npmignore +++ b/.npmignore @@ -1,3 +1,5 @@ src/index.html +dist/index.html + docs/ diff --git a/README.md b/README.md index c9610c0..512a343 100644 --- a/README.md +++ b/README.md @@ -45,12 +45,27 @@ ```html <!-- Unpkg --> -<link rel="stylesheet" href="https://unpkg.com/disqusjs@1.2/dist/disqusjs.css"> -<script src="https://unpkg.com/disqusjs@1.2/dist/disqus.js"></script> +<link rel="stylesheet" href="https://unpkg.com/disqusjs@1.3/dist/disqusjs.css"> +<script src="https://unpkg.com/disqusjs@1.3/dist/disqus.js"></script> <!-- jsDelivr --> -<link rel="stylesheet" href="https://cdn.jsdelivr.net/npm/disqusjs@1.2/dist/disqusjs.css"> -<script src="https://cdn.jsdelivr.net/npm/disqusjs@1.2/dist/disqus.js"></script> +<link rel="stylesheet" href="https://cdn.jsdelivr.net/npm/disqusjs@1.3/dist/disqusjs.css"> +<script src="https://cdn.jsdelivr.net/npm/disqusjs@1.3dist/disqus.js"></script> +``` + +DisqusJS 从 v1.3.0 版本开始使用 Fetch API 代替 XMLHttpRequest,因此不再兼容低于 IE 11 的老旧浏览器。这些浏览器将会收到如下提示: + +``` +你的浏览器版本过低,不兼容评论基础模式。如需完整体验请针对 disq.us | disquscdn.com | disqus.com 启用代理并尝试完整 Disqus 模式 +``` + +如果需要为 IE8 及以上浏览器提供 DisqusJS 评论基础模式的兼容性支持,请在 DisqusJS 加载之前添加如下的 Polyfill: + +```html +<!-- Promise Polyfill --> +<script src="https://cdn.jsdelivr.net/npm/promise-polyfill@8/dist/polyfill.min.js"></script> +<!-- Fetch Polyfill --> +<script src="https://cdn.jsdelivr.net/npm/whatwg-fetch@3.0.0/dist/fetch.umd.min.js"></script> ``` #### 从 NPM 安装 @@ -153,6 +168,11 @@ var dsqjs = new DisqusJS({ - 最大评论嵌套数;超过嵌套层数的评论,会不论从属关系显示在同一层级下 - 非必须,默认值为 `4` +**nocomment** `{Number}` + +- 没有评论时的提示语(对应 Disqus Admin - Settings - Community - Comment Count Link - Zero comments) +- 非必须,默认值为 `这里冷冷清清的,一条评论都没有` + --- 以下配置和 Disqus Moderator Badge 相关,缺少一个都不会显示 Badge @@ -167,15 +187,6 @@ var dsqjs = new DisqusJS({ - 你想显示在 Disqus Moderator Badge 中的文字。该配置应和 [Disqus Admin - Settings - Community - Moderator Badge Text](https://disqus.com/admin/settings/community/) 相同 - 非必须,无默认值 ---- - -未来可能扩展的配置: - -- nocomment 没有评论时的提示语(对应 Disqus Admin - Settings - Community - Comment Count Link - Zero comments) -- ~~commentPolicyURL 站点评论政策 URL(对应 对应 Disqus Admin - Settings - General - Comment Policy URL)~~ -- ~~commentPolicyText 站点评论政策简介(对应 对应 Disqus Admin - Settings - General - Comment Policy Summary)~~ -- ~~newcomment 是否允许添加新评论(目前增加评论功能尚未实现)~~ - ### PJAX 站点注意事项 如果你在使用 DisqusJS v0.2.5 版本,需要在 PJAX 的页面跳转事件下销毁 Disqus 实例(Disqus 不支持 PJAX)、并通过 `window.disqusjs.load();` 重新加载 DisqusJS。DisqusJS v0.2.5 版本支持自动判断当前页面是否存在 `#disqus_thread` 容器,如果容器不存在就不加载。 @@ -192,9 +203,9 @@ DisqusJS v1.2.6 开始支持检测是否存在 Disqus 实例,并在加载 Disq > 当然,你也可以直接使用我搭建的反代 `https://disqus.skk.moe/disqus/`。 -### ZEIT Now +### Vercel (ZEIT Now) -[ZEIT Now](https://zeit.co) 是一个 Serverless 平台。免费 Plan 提供每月 20 GiB 流量。 +[ZEIT Now](https://zeit.co) 是一个 Serverless 平台。免费 Plan 提供每月 100 GiB 流量和无限的请求次数。 [sukkaw/disqusjs-proxy-example](https://github.com/SukkaW/disqusjs-proxy-example) 提供了一个使用 Now Router 进行反代的样例配置文件。 ### Cloudflare Workers @@ -235,11 +246,12 @@ DisqusJS v1.2.6 开始支持检测是否存在 Disqus 实例,并在加载 Disq ## 调试、进阶使用 & 开发相关 -- `a.disquscdn.com` 和 `c.disquscdn.com` 解析到 Cloudflare 而不是 Fastly,可用性大大增强;`disqus.com` 和 `shortname.disqus.com` 仍然被墙;`disq.us` 解析到 Fastly 连通性较差,DisqusJS 通过解析获得了原链接。 +- ~~`a.disquscdn.com` 和 ~~`c.disquscdn.com` 解析到 Cloudflare 而不是 Fastly,可用性大大增强;`disqus.com` 和 `shortname.disqus.com` 仍然被墙;`disq.us` 解析到 Fastly 连通性较差,DisqusJS 通过解析获得了原链接。 +- `a.disquscdn.com` 重新解析到 Fastly,可用性不如 `c.disquscdn.com`,DisqusJS 内部已增加替换 `a.disquscdn.com` 为 `c.disquscdn.com` 以改善速度。 - DisqusJS 检测访客的 Disqus 可用性是通过检测 `disqus.com/favicon.ico` 和 `${disqusjs.config.shortname}.disqus.com/favicon.ico` 是否能正常加载,如果有一个加载出错或超时(2s)就判定 Disqus 不可用。 - DisqusJS 在 localStorage 中持久化了 Disqus 连通性检查结果,key 为 `dsqjs_mode`,value 为 `disqus` 或者 `dsqjs`。需要调整 DisqusJS 的模式时可以直接操作 localStorage。 - Disqus 自己的 config 保存在全局变量 `window.disqus_config` 中,你可能好奇为什么没有引入。实际上由于 `disqus_config` 和 DisqusJS 中有很多重复的配置,所以 DisqusJS 直接将相关配置项赋给了 `disqus_config`,所以用户只需要配置 DisqusJS 即可。 -- DisqusJS 并没有使用 Webpack 将 `disqusjs.css` 和 `disqus.js` 打包在一起,大家可以开发自己的 DisqusJS 主题。所有 DisqusJS 创建的 HTML 元素都在 `<div id="dsqjs"></div>` 之中、几乎所有的元素都有自己的类名并都以 `dsqjs-` 为前缀,防止污染。 +- DisqusJS 并没有使用 Webpack 将 `disqusjs.css` 和 `disqus.js` 打包在一起,大家可以开发自己的 DisqusJS 主题。所有 DisqusJS 创建的 HTML 元素都包裹在 `<div id="dsqjs"></div>` 之中、几乎所有的元素都有自己的类名并都以 `dsqjs-` 为前缀,防止污染。 - DisqusJS 从 v1.2.0 版本开始实现了评论排序。Disqus 将评论排序方式持久化在 localStorage 中、key 为 `disqus.sort`,DisqusJS 沿用了这一位置。 ## Todo List diff --git a/dist/disqus.js b/dist/disqus.js index 6893883..db5d498 100644 --- a/dist/disqus.js +++ b/dist/disqus.js @@ -1,6 +1 @@ -/*! - * DisqusJS | v1.2.6 - * 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,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(){if(window.DISQUS)window.DISQUS.reset({reload:!0,config:function(){this.page.identifier=D.config.identifier,this.page.url=D.config.url,this.page.title=D.config.title}});else{var s=l.createElement("script");y("disqus_thread").innerHTML='<div id="dsqjs"><section><div id="dsqjs-msg">评论完整模式加载中...如果长时间无法加载,请针对 disq.us | disquscdn.com | disqus.com 启用代理,或使用 <a id="dsqjs-force-dsqjs" class="dsqjs-msg-btn">评论基础模式</a></div></section><footer><p class="dsqjs-footer">Powered by <a class="dsqjs-disqus-logo" href="https://disqus.com" rel="nofollow noopener noreferrer" target="_blank"></a> & <a href="https://github.com/SukkaW/DisqusJS" target="_blank">DisqusJS</a></p></footer>',y("dsqjs-force-dsqjs").addEventListener("click",r),s.src="https://".concat(D.config.shortname,".disqus.com/embed.js"),s.setAttribute("data-timestamp",+new Date),(l.head||l.body).appendChild(s)}}function L(){y("disqus_thread").innerHTML='<div id="dsqjs"><section><div id="dsqjs-msg">正在检查 Disqus 能否访问...</div></section><footer><p class="dsqjs-footer">Powered by <a class="dsqjs-disqus-logo" href="https://disqus.com" rel="nofollow noopener noreferrer" target="_blank"></a> & <a href="https://github.com/SukkaW/DisqusJS" target="_blank">DisqusJS</a></p></footer></div>';for(var s=["disqus.com","".concat(D.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<s.length;t++)e(s[t])}function t(){!function(){y("disqus_thread").innerHTML='<div id="dsqjs"><section><div id="dsqjs-msg"></div></section><header class="dsqjs-header dsqjs-hide" id="dsqjs-header"><nav class="dsqjs-nav dsqjs-clearfix"><ul><li class="dsqjs-nav-tab dsqjs-tab-active"><span><span id="dsqjs-comment-num"></span> Comments</span></li><li class="dsqjs-nav-tab"><span id="dsqjs-site-name"></span></li></ul><div class="dsqjs-order"><input class="dsqjs-order-radio" id="dsqjs-order-desc" type="radio" name="comment-order" value="desc"> <label class="dsqjs-order-label" for="dsqjs-order-desc" title="按从新到旧">最新</label> <input class="dsqjs-order-radio" id="dsqjs-order-asc" type="radio" name="comment-order" value="asc"> <label class="dsqjs-order-label" for="dsqjs-order-asc" title="按从旧到新">最早</label> <input class="dsqjs-order-radio" id="dsqjs-order-popular" type="radio" name="comment-order" value="popular"> <label class="dsqjs-order-label" for="dsqjs-order-popular" title="按评分从高到低">最佳</label></div></nav></header><section class="dsqjs-post-container"><ul class="dsqjs-post-list" id="dsqjs-post-container"></ul><a id="dsqjs-load-more" class="dsqjs-load-more dsqjs-hide">加载更多评论</a></section><footer><p class="dsqjs-footer">Powered by <a class="dsqjs-disqus-logo" href="https://disqus.com" rel="nofollow noopener noreferrer" target="_blank"></a> & <a href="https://github.com/SukkaW/DisqusJS" target="_blank">DisqusJS</a></p></footer></div>',y("dsqjs-msg").innerHTML='评论基础模式加载中。如需完整体验请针对 disq.us | disquscdn.com | disqus.com 启用代理并 <a id="dsqjs-reload-disqus" class="dsqjs-msg-btn">尝试完整 Disqus 模式</a> | <a id="dsqjs-force-disqus" class="dsqjs-msg-btn">强制完整 Disqus 模式</a>。',y("dsqjs-reload-disqus").addEventListener("click",L),y("dsqjs-force-disqus").addEventListener("click",k),y("dsqjs-order-".concat(D.sortType)).setAttribute("checked","true");var s="".concat(D.config.api,"3.0/threads/list.json?forum=").concat(D.config.shortname,"&thread=ident:").concat(D.config.identifier,"&api_key=").concat(a());n(s,function(s){if(0===s.code&&1===s.response.length){var e=s.response[0];D.page={id:e.id,title:e.title,isClosed:e.isClosed,length:e.posts,comment:[]},y("dsqjs-comment-num").innerHTML=D.page.length,D.config.siteName&&(y("dsqjs-site-name").innerHTML=D.config.siteName),t()}else 0===s.code&&1!==s.response.length?(y("dsqjs-msg").innerHTML='该 Thread 并没有初始化,是否 <a id="dsqjs-force-disqus" class="dsqjs-msg-btn">切换到完整 Disqus 模式</a> 进行初始化?',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(D.page.next)},u=function(){s?(f.classList.remove("dsqjs-disabled"),f.innerHTML="加载更多评论失败,点击重试",f.addEventListener("click",g)):o()},h=function s(e){D.sortType=e.target.getAttribute("value"),b("disqus.sort",D.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}}D.page.comment=[],D.page.next="",y("dsqjs-post-container").innerHTML='<p style="text-align: center">正在切换排序方式...</p>',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(D.config.api,"3.0/threads/listPostsThreaded?forum=").concat(D.config.shortname,"&thread=").concat(D.page.id).concat(s,"&api_key=").concat(a(),"&order=").concat(D.sortType);n(e,function(s){if(0===s.code&&0<s.response.length){f.classList.remove("dsqjs-disabled"),D.page.comment=D.page.comment.concat(s.response),D.page.comment.sort(v.parentAsc),j(D.page.comment);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.addEventListener("change",h)}catch(s){t=!0,n=s}finally{try{e||null==a.return||a.return()}finally{if(t)throw n}}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.addEventListener("click",L)}catch(s){i=!0,c=s}finally{try{r||null==l.return||l.return()}finally{if(i)throw c}}s.cursor.hasNext?(D.page.next=s.cursor.next,f.innerHTML="加载更多评论",f.classList.remove("dsqjs-hide"),f.addEventListener("click",g)):f.classList.add("dsqjs-hide")}else 0===s.code&&0===s.response.length?(y("dsqjs-msg").innerHTML='你可能无法访问 Disqus,已启用评论基础模式。如需完整体验请针对 disq.us | disquscdn.com | disqus.com 启用代理并 <a id="dsqjs-reload-disqus" class="dsqjs-msg-btn">尝试完整 Disqus 模式</a> | <a id="dsqjs-force-disqus" class="dsqjs-msg-btn">强制完整 Disqus 模式</a>。',y("dsqjs-header").classList.remove("dsqjs-hide"),y("dsqjs-post-container").innerHTML='<div class="dsqjs-no-comment">这里冷冷清清的,一条评论都没有</div>',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='<a href="'.concat(s.comment.author.profileUrl,'"><img src="').concat(s.comment.author.avatar.cache,'"></a>'),s.comment.authorEl='<span class="dsqjs-post-author"><a href="'.concat(s.comment.author.profileUrl,'" target="_blank" rel="nofollow noopener noreferrer">').concat(s.comment.author.name,"</a></span>")):(s.comment.avatarEl='<img src="'.concat(s.comment.author.avatar.cache,'">'),s.comment.authorEl='<span class="dsqjs-post-author">'.concat(s.comment.author.name,"</span>")),D.config.adminLabel&&s.isPrimary&&(s.comment.authorEl+='<span class="dsqjs-admin-badge">'.concat(D.config.adminLabel,"</span>")),s},i=function(s){var e="",t="";return t=s.isDeleted?"<small>此评论已被删除</small>":(e="".concat(s.authorEl,'<span class="dsqjs-bullet"></span>'),s.message),'<div class="dsqjs-post-item dsqjs-clearfix"><div class="dsqjs-post-avatar">'.concat(s.avatarEl,'</div><div class="dsqjs-post-body"><div class="dsqjs-post-header">').concat(e,'<span class="dsqjs-meta"><time>').concat(c(s.createdAt),'</time></span></div><div class="dsqjs-post-content">').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),"</div></div></div>")},n="";e=[],o=[],a=function(s){return{comment:s,author:s.author.name,isPrimary:!!D.config.admin&&s.author.username===D.config.admin,children:t(+s.id),hasMore:s.hasMore}},t=function(s){if(0===o.length)return null;for(var e=[],t=0;t<o.length;t++){var n=o[t];n.parent===s&&e.unshift(a(n))}return e.length?e:null},s.forEach(function(s){(s.parent?o:e).push(s)}),(s=e.map(function(s){return a(s)})).map(function(s){s.children&&(s.nesting=1);var e="";(s=r(s)).hasMore&&(e='<p class="dsqjs-has-more">切换到 <a id="load-more-'.concat(s.comment.id,'">完整 Disqus 模式</a> 显示更多回复</p>')),n+='<li data-id="comment-'.concat(s.comment.id,'" id="comment-').concat(s.comment.id,'">').concat(i(s.comment)).concat(function t(s){var n=s.nesting,e=s.children||[];if(e){var o=n<D.config.nesting?'<ul class="dsqjs-post-list dsqjs-children">':'<ul class="dsqjs-post-list">';return e.map(function(s){(s=r(s)).nesting=n+1;var e="";s.hasMore&&(e='<p class="dsqjs-has-more">切换到 <a class="dsqjs-has-more-btn" id="load-more-'.concat(s.comment.id,'">完整 Disqus 模式</a> 显示更多回复</p>')),o+='<li data-id="comment-'.concat(s.comment.id,'" id="comment-').concat(s.comment.id,'">').concat(i(s.comment)).concat(t(s)).concat(e,"</li>")}),0!==(o+="</ul>").length?o:void 0}}(s)).concat(e,"</li>")}),y("dsqjs-header").classList.remove("dsqjs-hide"),y("dsqjs-msg").innerHTML='你可能无法访问 Disqus,已启用评论基础模式。如需完整体验请针对 disq.us | disquscdn.com | disqus.com 启用代理并 <a id="dsqjs-reload-disqus" class="dsqjs-msg-btn">尝试完整 Disqus 模式</a> | <a id="dsqjs-force-disqus" class="dsqjs-msg-btn">强制完整 Disqus 模式</a>。',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='评论基础模式加载失败,是否 <a id="dsqjs-reload-dsqjs" class="dsqjs-msg-btn">重载</a> 或 <a id="dsqjs-reload-disqus" class="dsqjs-msg-btn">尝试完整 Disqus 模式</a> ?',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 D={};D.config=s,D.config.api=D.config.api||"https://disqus.skk.moe/disqus/",D.config.identifier=D.config.identifier||l.location.origin+l.location.pathname+l.location.search,D.config.url=D.config.url||l.location.origin+l.location.pathname+l.location.search,D.config.title=D.config.title||l.title,D.config.nesting=D.config.nesting?parseInt(D.config.nesting):4,D.page=[];var a=function(){return Array.isArray(D.config.apikey)?D.config.apikey[Math.floor(Math.random()*D.config.apikey.length)]:D.config.apikey};window.disqus_config=function(){this.page.url=D.config.url,this.page.identifier=D.config.identifier,this.page.title=D.config.title},D.mode=localStorage.getItem("dsqjs_mode"),D.sortType=localStorage.getItem("disqus.sort"),D.sortType||(b("disqus.sort","desc"),D.sortType="desc"),"disqus"===D.mode?e():"dsqjs"===D.mode?t():L()}}); \ No newline at end of file +/*! DisqusJS v1.3.0 | Sukka (https://skk.moe) | https://disqusjs.skk.moe | MIT License */"use strict";function _createForOfIteratorHelperLoose(e,s){var t;if("undefined"!=typeof Symbol&&null!=e[Symbol.iterator])return(t=e[Symbol.iterator]()).next.bind(t);if(Array.isArray(e)||(t=_unsupportedIterableToArray(e))||s&&e&&"number"==typeof e.length){t&&(e=t);var r=0;return function(){return r>=e.length?{done:!0}:{done:!1,value:e[r++]}}}throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}function _unsupportedIterableToArray(e,s){if(e){if("string"==typeof e)return _arrayLikeToArray(e,s);var t=Object.prototype.toString.call(e).slice(8,-1);return"Object"===t&&e.constructor&&(t=e.constructor.name),"Map"===t||"Set"===t?Array.from(e):"Arguments"===t||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(t)?_arrayLikeToArray(e,s):void 0}}function _arrayLikeToArray(e,s){(null==s||s>e.length)&&(s=e.length);for(var t=0,r=new Array(s);t<s;t++)r[t]=e[t];return r}function DisqusJS(M){!function(s,p,t,r,n){function a(){for(var e=arguments.length,s=new Array(e),t=0;t<e;t++)s[t]=arguments[t];return(a=Object.assign||function(e){for(var s,t=_createForOfIteratorHelperLoose(arguments);!(s=t()).done;){var r=s.value;for(var n in r)Object.prototype.hasOwnProperty.call(r,n)&&(e[n]=r[n])}return e}).apply(this,s)}var q=function(e){return p.getElementById(e)},h=function(e){var s=q("dsqjs-msg");s&&(s.innerHTML=e)},v="click",d="disqus_thread",o="dsqjs_sort",c='target="_blank" rel="external nofollow noopener noreferrer"',l='<footer><p class="dsqjs-footer">Powered by <a class="dsqjs-disqus-logo" href="https://disqus.com" '+c+'></a> & <a href="https://disqusjs.skk.moe" target="_blank">DisqusJS</a></p></footer>',u=function(e,s){return'<header class="dsqjs-header" id="dsqjs-header"><nav class="dsqjs-nav dsqjs-clearfix"><ul><li class="dsqjs-nav-tab dsqjs-tab-active"><span>'+e+' Comments</span></li><li class="dsqjs-nav-tab">'+s+'</li></ul><div class="dsqjs-order"><input class="dsqjs-order-radio" id="dsqjs-order-desc" type="radio" name="comment-order" value="desc" checked="true"><label class="dsqjs-order-label" for="dsqjs-order-desc" title="按从新到旧">最新</label><input class="dsqjs-order-radio" id="dsqjs-order-asc" type="radio" name="comment-order" value="asc"><label class="dsqjs-order-label" for="dsqjs-order-asc" title="按从旧到新">最早</label><input class="dsqjs-order-radio" id="dsqjs-order-popular" type="radio" name="comment-order" value="popular"><label class="dsqjs-order-label" for="dsqjs-order-popular" title="按评分从高到低">最佳</label></div></nav></header>'},m=function(e,s,t){var r=e.avatarEl,n=e.createdAt;return'<div class="dsqjs-post-item dsqjs-clearfix"><div class="dsqjs-post-avatar">'+r+'</div><div class="dsqjs-post-body"><div class="dsqjs-post-header">'+s+'<span class="dsqjs-meta"><time>'+i(n)+'</time></span></div><div class="dsqjs-post-content">'+t+"</div></div></div>"},g='如需完整体验请针对 disq.us | disquscdn.com | disqus.com 启用代理并 <a id="dsqjs-reload-disqus" class="dsqjs-msg-btn">尝试完整 Disqus 模式</a> | <a id="dsqjs-force-disqus" class="dsqjs-msg-btn">强制完整 Disqus 模式</a>',j=function(e){return r(e,{method:"GET"}).then(function(e){return n.all([e.ok,e.status,e.json(),e.headers])}).then(function(e){var s=e[0],t=e[1],r=e[2],n=e[3];if(s)return{ok:s,status:t,data:r,headers:n};throw new Error}).catch(function(e){throw e})},b=function(e,s){try{t.setItem(e,s)}catch(e){}},i=function(e){function s(e){return e<10?"0"+e:e}return e=Date.parse(new Date(e)),(e=new Date(e+288e5)).getFullYear()+"-"+s(e.getMonth()+1)+"-"+s(e.getDate())+" "+s(e.getHours())+":"+s(e.getMinutes())};function e(){var e;s.DISQUS?s.DISQUS.reset({reload:!0,config:function(){this.page.identifier=D.config.identifier,this.page.url=D.config.url,this.page.title=D.config.title}}):(e=p.createElement("script"),q(d).innerHTML='<div id="dsqjs"><section><div id="dsqjs-msg">评论完整模式加载中... 如果长时间无法加载,请针对 disq.us | disquscdn.com | disqus.com 启用代理,或切换至 <a id="dsqjs-force-dsqjs" class="dsqjs-msg-btn">评论基础模式</a></div></section>'+l+"</div>",q("dsqjs-force-dsqjs").addEventListener(v,T),e.src="https://"+D.config.shortname+".disqus.com/embed.js",e.setAttribute("data-timestamp",+new Date),(p.head||p.body).appendChild(e))}function y(){q(d).innerHTML='<div id="dsqjs"><section><div id="dsqjs-msg">正在检查 Disqus 能否访问...</div></section>'+l+"</div>";for(var e=["disqus.com",D.config.shortname+".disqus.com"],r=0,n=0,a=function(){e.length===r&&r===n?w():e.length===r&&T()},s=0,t=e;s<t.length;s++){!function(e){var s=new Image,t=setTimeout(function(){s.onerror=s.onload=null,r++,a()},3e3);s.onerror=function(){clearTimeout(t),r++,a()},s.onload=function(){clearTimeout(t),r++,n++,a()},s.src="https://"+e+"/favicon.ico?"+ +new Date+"="+ +new Date}(t[s])}}function L(){q("dsqjs-reload-disqus").addEventListener(v,y),q("dsqjs-force-disqus").addEventListener(v,w)}function f(){h("评论基础模式加载中... "+g),L();var e=D.config.api+"3.0/threads/list.json?forum="+D.config.shortname+"&thread=ident:"+D.config.identifier+"&api_key="+H();j(e).then(function(e){var s=e.data;if(0===s.code&&1===s.response.length){var t=s.response[0],r=t.id,n=t.title,a=t.isClosed,o=t.posts;D.page={id:r,title:n,isClosed:a,length:o,comment:[]},q(d).innerHTML='<div id="dsqjs"><div id="dsqjs-msg">评论基础模式加载中... '+g+"</div>"+u(o,D.config.siteName)+'<section class="dsqjs-post-container"><ul class="dsqjs-post-list" id="dsqjs-post-container"><p class="dsqjs-no-comment">评论列表加载中...</p></ul><a id="dsqjs-load-more" class="dsqjs-load-more dsqjs-hide">加载更多评论</a></section>'+l+"</div>",L(),q("dsqjs-order-"+D.sortType).setAttribute("checked","true"),i()}else{if(0!==s.code||1===s.response.length)throw new Error;h('当前 Thread 尚未创建。是否切换至 <a id="dsqjs-force-disqus" class="dsqjs-msg-btn">完整 Disqus 模式</a>?'),q("dsqjs-force-disqus").addEventListener(v,w)}}).catch(E);function s(e){function a(e){return{comment:e,author:e.author.name,isPrimary:!!D.config.admin&&e.author.username===D.config.admin,children:t(+e.id),hasMore:e.hasMore}}var s=[],o=[],t=function(e){if(0===o.length)return null;for(var s,t=[],r=_createForOfIteratorHelperLoose(o);!(s=r()).done;){var n=s.value;n.parent===e&&t.unshift(a(n))}return t.length?t:null};return e.forEach(function(e){(e.parent?o:s).push(e)}),s.map(a)}var i=function t(e){void 0===e&&(e="");function r(){for(var e,s=_createForOfIteratorHelperLoose(d);!(e=s()).done;){e.value.removeEventListener("change",u)}i.removeEventListener(v,l);for(var t,r=_createForOfIteratorHelperLoose(c);!(t=r()).done;){t.value.removeEventListener(v,y)}}var i=q("dsqjs-load-more"),d=p.getElementsByClassName("dsqjs-order-radio"),c=p.getElementsByClassName("dsqjs-has-more-btn"),l=function(){r(),t(D.page.next)},u=function(e){var s=e.target;D.sortType=s.getAttribute("value"),b(o,D.sortType),r(),D.page.comment=[],D.page.next="",q("dsqjs-post-container").innerHTML='<p class="dsqjs-no-comment">正在切换排序方式...</p>',i.classList.add("dsqjs-hide"),t()},s=""===e?"":"&cursor="+e;i.classList.add("dsqjs-disabled");function n(e){var s=e.createdAt;return Date.parse(new Date(s))}function m(e,s){return e.parent&&s.parent?n(e)-n(s):0}var a=D.config.api+"3.0/threads/listPostsThreaded?forum="+D.config.shortname+"&thread="+D.page.id+s+"&api_key="+H()+"&order="+D.sortType;j(a).then(function(e){var s,t=e.data;if(0===t.code&&0<t.response.length){i.classList.remove("dsqjs-disabled"),(s=D.page.comment).push.apply(s,t.response),D.page.comment.sort(m),f(D.page.comment);for(var r,n=_createForOfIteratorHelperLoose(d);!(r=n()).done;){r.value.addEventListener("change",u)}for(var a,o=_createForOfIteratorHelperLoose(c);!(a=o()).done;){a.value.addEventListener(v,y)}t.cursor.hasNext?(D.page.next=t.cursor.next,i.innerHTML="加载更多评论",i.classList.remove("dsqjs-hide"),i.addEventListener(v,l)):i.classList.add("dsqjs-hide")}else{if(0!==t.code||0!==t.response.length)throw new Error;h("你可能无法访问 Disqus,已启用评论基础模式。"+g),q("dsqjs-post-container").innerHTML='<p class="dsqjs-no-comment" >'+D.config.nocomment+"</p>",L(),q("dsqjs-force-disqus").addEventListener(v,T)}}).catch(function(){""===e?E():(i.classList.remove("dsqjs-disabled"),i.innerHTML="加载更多评论失败,点击重试",i.addEventListener(v,l))})},f=function(e){function a(e){return e.comment.author.profileUrl?(e.comment.avatarEl='<a href="'+e.comment.author.profileUrl+'"><img src="'+r(e.comment.author.avatar.cache)+'" '+c+"></a>",e.comment.authorEl='<span class="dsqjs-post-author"><a href="'+e.comment.author.profileUrl+'" '+c+">"+e.comment.author.name+"</a></span>"):(e.comment.avatarEl='<img src="'+r(e.comment.author.avatar.cache)+'">',e.comment.authorEl='<span class="dsqjs-post-author">'+e.comment.author.name+"</span>"),D.config.adminLabel&&e.isPrimary&&(e.comment.authorEl+='<span class="dsqjs-admin-badge">'+D.config.adminLabel+"</span>"),e}function o(e){var s="",t="",t=e.isDeleted?"<small>此评论已被删除</small>":(s=e.authorEl+'<span class="dsqjs-bullet"></span>',function(e){var s=p.createElement("div");s.innerHTML=e;for(var t,r=_createForOfIteratorHelperLoose(s.getElementsByTagName("a"));!(t=r()).done;){var n=t.value,a=decodeURIComponent(n.href.replace(/https:\/\/disq.us\/url\?url=/g,"")).replace(/(.*):.+cuid=.*/,"$1");n.href=a,n.innerHTML=a,n.rel="external noopener nofollow noreferrer",n.target="_blank"}return s.innerHTML}(r(e.message)));return m(e,s,t)}var r=function(e){return e.replace("/a.disquscdn.com/ig","c.disquscdn.com")},t="";s(e).map(function(e){e.children&&(e.nesting=1);var s="";(e=a(e)).hasMore&&(s='<p class="dsqjs-has-more">切换至 <a id="load-more-'+e.comment.id+'">完整 Disqus 模式</a> 显示更多回复</p>'),t+='<li data-id="comment-'+e.comment.id+'" id="comment-'+e.comment.id+'">'+o(e.comment)+function t(e){var r=e.nesting,s=e.children||[];if(s){var n="",n=r<D.config.nesting?'<ul class="dsqjs-post-list dsqjs-children">':'<ul class="dsqjs-post-list">';return s.map(function(e){(e=a(e)).nesting=r+1;var s="";e.hasMore&&(s='<p class="dsqjs-has-more">切换至 <a class="dsqjs-has-more-btn" id="load-more-'+e.comment.id+'" data-more-id="comment-'+e.comment.id+'">完整 Disqus 模式</a> 显示更多回复</p>'),n+='<li data-id="comment-'+e.comment.id+'" id="comment-'+e.comment.id+'">'+o(e.comment)+t(e)+s+"</li>"}),0!==(n+="</ul>").length?n:void 0}}(e)+s+"</li>"}),h("你可能无法访问 Disqus,已启用评论基础模式。"+g),q("dsqjs-post-container").innerHTML=t,L()}}function E(e){console.log(e),h('评论基础模式加载失败,是否 <a id="dsqjs-reload-dsqjs" class="dsqjs-msg-btn">重载</a> 或 <a id="dsqjs-reload-disqus" class="dsqjs-msg-btn">尝试完整 Disqus 模式</a> ?'),q("dsqjs-reload-dsqjs").addEventListener(v,f),q("dsqjs-reload-disqus").addEventListener(v,y)}function T(){b("dsqjs_mode","dsqjs"),f()}function w(){b("dsqjs_mode","disqus"),e()}var D={},_=p.location.origin+p.location.pathname+p.location.search;D.config=a({api:"https://disqus.skk.moe/disqus/",identifier:_,url:_,title:p.title,siteName:"",nesting:parseInt(M.nesting)||4,nocomment:"这里冷冷清清的,一条评论都没有"},M),D.page={};var I=D.config.apikey,H=function(){return Array.isArray(I)?I[Math.floor(Math.random()*I.length)]:I};s.disqus_config=function(){this.page.url=D.config.url,this.page.identifier=D.config.identifier,this.page.title=D.config.title},q(d).innerHTML='<div id="dsqjs"><div id="dsqjs-msg"></div>'+l+"</div>",r&&t&&n?(D.mode=t.getItem("dsqjs_mode"),D.sortType=t.getItem(o)||t.getItem("disqus.sort"),D.sortType||(b(o,"desc"),D.sortType="desc"),("disqus"===D.mode?e:"dsqjs"===D.mode?f:y)()):(h("你的浏览器版本过低,不兼容评论基础模式。"+g),L())}(window,document,localStorage,fetch,Promise)}try{module.exports=DisqusJS}catch(e){} \ No newline at end of file diff --git a/dist/disqusjs.css b/dist/disqusjs.css index 6a00529..22c0842 100644 --- a/dist/disqusjs.css +++ b/dist/disqusjs.css @@ -1,6 +1 @@ -/*! - * DisqusJS - Default Theme | v1.2.6 - * Author: SukkaW - * Link: https://github.com/SukkaW/DisqusJS - * License: MIT - */#dsqjs *{margin:0;padding:0}#dsqjs a{text-decoration:none;color:#076dd0}#dsqjs .dsqjs-hide{display:none!important}#dsqjs .dsqjs-disabled{cursor:not-allowed;opacity:.5}#dsqjs #dsqjs-msg{text-align:center;margin-top:4px;margin-bottom:4px;font-size:14px}#dsqjs #dsqjs-msg .dsqjs-msg-btn{cursor:pointer}#dsqjs .dsqjs-bullet{line-height:1.4;margin:0 2px}#dsqjs .dsqjs-bullet::after{color:#c2c6cc;content:"·";font-weight:700}#dsqjs .dsqjs-clearfix:after,#dsqjs .dsqjs-clearfix:before{display:table;content:"";line-height:0;clear:both}#dsqjs .dsqjs-nav{position:relative;margin:0 0 20px;border-bottom:2px solid #e7e9ee}#dsqjs ol,#dsqjs ul{list-style:none;list-style-type:none}#dsqjs .dsqjs-no-comment{text-align:center;font-size:16px;line-height:1.5;word-wrap:break-word;overflow:hidden;color:#2a2e2e;margin-bottom:6px}#dsqjs .dsqjs-nav-tab{float:left;text-transform:capitalize;font-size:15px;padding:12px 0;color:#656c7a;display:block;margin:0 15px 0 0;font-weight:700;line-height:1;position:relative;-webkit-transition:all .2s ease-in-out;transition:all .2s ease-in-out}#dsqjs .dsqjs-nav-tab:last-child{margin:0}#dsqjs .dsqjs-tab-active{color:#2a2e2e}#dsqjs .dsqjs-tab-active>span:after{content:" ";display:block;height:2px;background-color:#076dd0!important;position:absolute;bottom:-2px;left:0;right:0}#dsqjs .dsqjs-post-list .dsqjs-post-item{position:relative;margin-bottom:16px}#dsqjs .dsqjs-post-list .dsqjs-post-avatar{float:left;margin-right:10px;position:relative;background:#dbdfe4;padding:0;display:block;border-radius:4px}#dsqjs .dsqjs-post-list .dsqjs-post-avatar img{width:44px;height:44px;display:block;border-radius:4px}#dsqjs .dsqjs-post-list .dsqjs-post-header{line-height:1;font-size:14px;margin-bottom:3px}#dsqjs .dsqjs-post-list .dsqjs-post-header .dsqjs-post-author{color:#656c7a;font-weight:700}#dsqjs .dsqjs-post-list .dsqjs-post-header .dsqjs-admin-badge{color:#fff;background:#687a86;padding:1px 3px;margin-left:4px;font-size:12px;line-height:1;font-weight:700;border-radius:3px;display:inline-block;position:relative;top:-1px;left:1px}#dsqjs .dsqjs-post-list .dsqjs-post-header .dsqjs-meta{display:inline-block;font-size:12px;color:#656c7a}#dsqjs .dsqjs-post-body{font-size:15px;line-height:1.5;word-wrap:break-word;overflow:hidden;color:#2a2e2e}#dsqjs .dsqjs-post-body code{padding:.2em .4em;margin:0;font-size:85%;background:#f5f5f5;color:inherit;border-radius:3px}#dsqjs .dsqjs-post-body pre{padding:.5em;overflow:auto;font-size:85%;line-height:1.45;border-radius:3px;background:#f5f5f5;margin:.5em 0}#dsqjs .dsqjs-post-body blockquote{padding:0 .8em;margin:.5em 0;color:#6a737d;border-left:.25em solid #dfe2e5}#dsqjs .dsqjs-post-body p:last-child{margin:0}#dsqjs .dsqjs-post-list.dsqjs-children>li{margin-left:30px}@media (min-width:768px){#dsqjs .dsqjs-post-list.dsqjs-children>li{margin-left:48px}#dsqjs .dsqjs-post-list .dsqjs-post-avatar{margin-right:12px}#dsqjs .dsqjs-post-list .dsqjs-post-item{margin-bottom:20px}}@media (min-width:1024px){#dsqjs .dsqjs-post-list.dsqjs-children>li{margin-left:60px}}#dsqjs .dsqjs-post-list.dsqjs-children .dsqjs-post-avatar img{width:38px;height:38px}#dsqjs .dsqjs-load-more{font-size:14px;font-weight:400;display:block;text-align:center;padding:11px 14px;margin:0 0 24px;background:#687a86;color:#fff;cursor:pointer}#dsqjs .dsqjs-load-more:hover{opacity:.8}#dsqjs footer{text-align:right;line-height:1.5;padding-top:12px;font-weight:700;font-size:16px;color:#555}#dsqjs .dsqjs-disqus-logo{background-image:url("data:image/svg+xml,%3csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 438 80'%3e%3cpath fill='%23575B5D' d='M30.2 1.6H1v76h28.9C57 77.6 73 61.3 73 39.4v-.2c0-22-15.7-37.6-42.9-37.6zm21.3 38.1c0 12.3-8.4 19.3-21 19.3H22V20.3h8.5c12.6 0 21 7 21 19.2v.2zm35.6 38h21.2V1.5H87.1v76zm70-47.4c-10.4-2.4-13-4-13-7.4v-.2c0-2.7 2.4-5 7.6-5 6.7 0 14.3 2.7 21.2 7.6l10.6-14.9A47.9 47.9 0 0 0 152.2.3c-18.3 0-29.4 10.2-29.4 24.3v.2c0 15.7 12.4 20.3 28.6 24 10.4 2.3 12.9 4 12.9 7.2v.2c0 3.3-3 5.2-8.7 5.2-8.8 0-17.2-3.1-24.7-9l-11.7 14a53.1 53.1 0 0 0 35.6 12.5c18.5 0 30.7-9.2 30.7-24.7V54c0-14.3-10.8-20-28.3-23.7zm120.7 9.3v-.2A39.5 39.5 0 0 0 236.9.1c-23.4 0-41 17.7-41 39.5v.2a39.5 39.5 0 0 0 40.8 39.4c8.7 0 16.6-2.5 23.1-6.8l8.4 7.5L279 68.1l-7.9-6.6a38 38 0 0 0 6.8-21.9zm-21.4.5c0 2.6-.5 5-1.3 7.3l-10.4-9.3-10.6 12 10.5 9a21.7 21.7 0 0 1-7.7 1.4c-11.6 0-19.4-9.7-19.4-20.7v-.2c0-11 7.7-20.5 19.2-20.5 11.7 0 19.7 9.7 19.7 20.7v.3zm83.5 4.3c0 10.6-5.5 15.6-14 15.6s-14-5.2-14-16.1V1.6h-21.4v42.7C290.5 68 304 79 325.7 79s35.6-10.8 35.6-35.3V1.5h-21.4v42.8zm68.9-14.1c-10.6-2.4-13.2-4-13.2-7.4v-.2c0-2.7 2.5-5 7.6-5 6.8 0 14.4 2.7 21.3 7.6l10.6-14.9A47.9 47.9 0 0 0 403.8.3c-18.3 0-29.5 10.2-29.5 24.3v.2c0 15.7 12.5 20.3 28.7 24 10.3 2.3 12.8 4 12.8 7.2v.2c0 3.3-3 5.3-8.7 5.3-8.8 0-17.1-3.2-24.6-9.2l-11.7 14A53.1 53.1 0 0 0 406.4 79c18.5 0 30.7-9.2 30.7-24.7V54c0-14.3-10.8-20-28.3-23.7z'/%3e%3c/svg%3e");background-position:50% 50%;background-repeat:no-repeat;display:inline-block;height:12px;width:65.7px}#dsqjs .dsqjs-order{display:-webkit-box;display:-ms-flexbox;display:flex;float:right;-webkit-box-align:center;-ms-flex-align:center;align-items:center;margin-top:10px;margin-bottom:12px}#dsqjs .dsqjs-order-radio{display:none}#dsqjs .dsqjs-order-radio:checked+.dsqjs-order-label{color:#fff;background-color:#888}#dsqjs .dsqjs-order-label{display:block;height:20px;line-height:20px;margin-right:10px;font-size:12px;border-radius:2px;padding:0 5px;background-color:#dcdcdc;cursor:pointer}#dsqjs p.dsqjs-has-more{margin-bottom:24px;margin-left:48px;font-size:13px;line-height:15px}#dsqjs p.dsqjs-has-more a.dsqjs-has-more-btn{color:#656c7a;text-decoration:underline;cursor:pointer} \ No newline at end of file +/*! DisqusJS - Default Theme | v1.3.0 | Sukka (https://skk.moe) | https://disqusjs.skk.moe | MIT License */#dsqjs *{margin:0;padding:0}#dsqjs a{text-decoration:none;color:#076dd0}#dsqjs .dsqjs-hide{display:none!important}#dsqjs .dsqjs-disabled{cursor:not-allowed;opacity:.5}#dsqjs #dsqjs-msg{text-align:center;margin-top:4px;margin-bottom:4px;font-size:14px}#dsqjs #dsqjs-msg .dsqjs-msg-btn{cursor:pointer}#dsqjs .dsqjs-bullet{line-height:1.4;margin:0 2px}#dsqjs .dsqjs-bullet::after{color:#c2c6cc;content:"·";font-weight:700}#dsqjs .dsqjs-clearfix:after,#dsqjs .dsqjs-clearfix:before{display:table;content:"";line-height:0;clear:both}#dsqjs .dsqjs-nav{position:relative;margin:0 0 20px;border-bottom:2px solid #e7e9ee}#dsqjs ol,#dsqjs ul{list-style:none;list-style-type:none}#dsqjs .dsqjs-no-comment{text-align:center;font-size:16px;line-height:1.5;word-wrap:break-word;overflow:hidden;color:#2a2e2e;margin-bottom:6px}#dsqjs .dsqjs-nav-tab{float:left;text-transform:capitalize;font-size:15px;padding:12px 8px;color:#656c7a;display:block;margin:0 15px 0 0;font-weight:700;line-height:1;position:relative;-webkit-transition:all .2s ease-in-out;-o-transition:all .2s ease-in-out;transition:all .2s ease-in-out}#dsqjs .dsqjs-nav-tab:last-child{margin:0}#dsqjs .dsqjs-tab-active{color:#2a2e2e}#dsqjs .dsqjs-tab-active>span:after{content:" ";display:block;height:2px;background-color:#076dd0!important;position:absolute;bottom:-5px;left:0;right:0}#dsqjs .dsqjs-post-list .dsqjs-post-item{position:relative;margin-bottom:16px}#dsqjs .dsqjs-post-list .dsqjs-post-avatar{float:left;margin-right:10px;position:relative;background:#dbdfe4;padding:0;display:block;border-radius:4px}#dsqjs .dsqjs-post-list .dsqjs-post-avatar img{width:44px;height:44px;display:block;border-radius:4px}#dsqjs .dsqjs-post-list .dsqjs-post-header{line-height:1;font-size:14px;margin-bottom:3px}#dsqjs .dsqjs-post-list .dsqjs-post-header .dsqjs-post-author{color:#656c7a;font-weight:700}#dsqjs .dsqjs-post-list .dsqjs-post-header .dsqjs-admin-badge{color:#fff;background:#687a86;padding:1px 3px;margin-left:4px;font-size:12px;line-height:1;font-weight:700;border-radius:3px;display:inline-block;position:relative;top:-1px;left:1px}#dsqjs .dsqjs-post-list .dsqjs-post-header .dsqjs-meta{display:inline-block;font-size:12px;color:#656c7a}#dsqjs .dsqjs-post-body{font-size:15px;line-height:1.5;word-wrap:break-word;overflow:hidden;color:#2a2e2e}#dsqjs .dsqjs-post-body code{padding:.2em .4em;margin:0;font-size:85%;background:#f5f5f5;color:inherit;border-radius:3px}#dsqjs .dsqjs-post-body pre{padding:.5em;overflow:auto;font-size:85%;line-height:1.45;border-radius:3px;background:#f5f5f5;margin:.5em 0}#dsqjs .dsqjs-post-body blockquote{padding:0 .8em;margin:.5em 0;color:#6a737d;border-left:.25em solid #dfe2e5}#dsqjs .dsqjs-post-body p:last-child{margin:0}#dsqjs .dsqjs-post-list.dsqjs-children>li{margin-left:30px}@media (min-width:768px){#dsqjs .dsqjs-post-list.dsqjs-children>li{margin-left:48px}#dsqjs .dsqjs-post-list .dsqjs-post-avatar{margin-right:12px}#dsqjs .dsqjs-post-list .dsqjs-post-item{margin-bottom:20px}}@media (min-width:1024px){#dsqjs .dsqjs-post-list.dsqjs-children>li{margin-left:60px}}#dsqjs .dsqjs-post-list.dsqjs-children .dsqjs-post-avatar img{width:38px;height:38px}#dsqjs .dsqjs-load-more{font-size:14px;font-weight:400;display:block;text-align:center;padding:11px 14px;margin:0 0 24px;background:#687a86;color:#fff;cursor:pointer}#dsqjs .dsqjs-load-more:hover{opacity:.8}#dsqjs footer{text-align:right;line-height:1.5;padding-top:10px;padding-right:10px;border-top:2px solid #e7e9ee;margin-top:12px;font-weight:700;font-size:16px;color:#555}#dsqjs .dsqjs-disqus-logo{background-image:url("data:image/svg+xml,%3csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 438 80'%3e%3cpath fill='%23575B5D' d='M30.2 1.6H1v76h28.9C57 77.6 73 61.3 73 39.4v-.2c0-22-15.7-37.6-42.9-37.6zm21.3 38.1c0 12.3-8.4 19.3-21 19.3H22V20.3h8.5c12.6 0 21 7 21 19.2v.2zm35.6 38h21.2V1.5H87.1v76zm70-47.4c-10.4-2.4-13-4-13-7.4v-.2c0-2.7 2.4-5 7.6-5 6.7 0 14.3 2.7 21.2 7.6l10.6-14.9A47.9 47.9 0 0 0 152.2.3c-18.3 0-29.4 10.2-29.4 24.3v.2c0 15.7 12.4 20.3 28.6 24 10.4 2.3 12.9 4 12.9 7.2v.2c0 3.3-3 5.2-8.7 5.2-8.8 0-17.2-3.1-24.7-9l-11.7 14a53.1 53.1 0 0 0 35.6 12.5c18.5 0 30.7-9.2 30.7-24.7V54c0-14.3-10.8-20-28.3-23.7zm120.7 9.3v-.2A39.5 39.5 0 0 0 236.9.1c-23.4 0-41 17.7-41 39.5v.2a39.5 39.5 0 0 0 40.8 39.4c8.7 0 16.6-2.5 23.1-6.8l8.4 7.5L279 68.1l-7.9-6.6a38 38 0 0 0 6.8-21.9zm-21.4.5c0 2.6-.5 5-1.3 7.3l-10.4-9.3-10.6 12 10.5 9a21.7 21.7 0 0 1-7.7 1.4c-11.6 0-19.4-9.7-19.4-20.7v-.2c0-11 7.7-20.5 19.2-20.5 11.7 0 19.7 9.7 19.7 20.7v.3zm83.5 4.3c0 10.6-5.5 15.6-14 15.6s-14-5.2-14-16.1V1.6h-21.4v42.7C290.5 68 304 79 325.7 79s35.6-10.8 35.6-35.3V1.5h-21.4v42.8zm68.9-14.1c-10.6-2.4-13.2-4-13.2-7.4v-.2c0-2.7 2.5-5 7.6-5 6.8 0 14.4 2.7 21.3 7.6l10.6-14.9A47.9 47.9 0 0 0 403.8.3c-18.3 0-29.5 10.2-29.5 24.3v.2c0 15.7 12.5 20.3 28.7 24 10.3 2.3 12.8 4 12.8 7.2v.2c0 3.3-3 5.3-8.7 5.3-8.8 0-17.1-3.2-24.6-9.2l-11.7 14A53.1 53.1 0 0 0 406.4 79c18.5 0 30.7-9.2 30.7-24.7V54c0-14.3-10.8-20-28.3-23.7z'/%3e%3c/svg%3e");background-position:50% 50%;background-repeat:no-repeat;display:inline-block;height:12px;width:65.7px}#dsqjs .dsqjs-order{display:-webkit-box;display:-ms-flexbox;display:flex;float:right;-webkit-box-align:center;-ms-flex-align:center;align-items:center;margin-top:10px;margin-bottom:12px}#dsqjs .dsqjs-order-radio{display:none}#dsqjs .dsqjs-order-radio:checked+.dsqjs-order-label{color:#fff;background-color:#888}#dsqjs .dsqjs-order-label{display:block;height:20px;line-height:20px;margin-right:10px;font-size:12px;border-radius:2px;padding:0 5px;background-color:#dcdcdc;cursor:pointer}#dsqjs p.dsqjs-has-more{margin-bottom:24px;margin-left:48px;font-size:13px;line-height:15px}#dsqjs p.dsqjs-has-more a.dsqjs-has-more-btn{color:#656c7a;text-decoration:underline;cursor:pointer} \ No newline at end of file diff --git a/docs/index.html b/docs/index.html index c102870..23a1265 100644 --- a/docs/index.html +++ b/docs/index.html @@ -11,7 +11,7 @@ <link href="https://cdn.jsdelivr.net/npm/skx@0.0.1/favicon/favicon-32x32.png" rel="icon" type="image/png" sizes="32x32"> <link href="https://cdn.jsdelivr.net/npm/skx@0.0.1/favicon/favicon-16x16.png" rel="icon" type="image/png" sizes="16x16"> <link href="https://cdn.jsdelivr.net/npm/skx@0.0.1" rel="shortcut icon" type="image/ico"> - <link rel="stylesheet" href="https://cdn.jsdelivr.net/npm/disqusjs@1.2.6/dist/disqusjs.css"> + <link rel="stylesheet" href="https://cdn.jsdelivr.net/npm/disqusjs@1.3.0/dist/disqusjs.css"> <script src="https://cdn.jsdelivr.net/npm/vconsole"></script> <script>var vConsole = new VConsole();</script> <style> @@ -137,7 +137,7 @@ </div> <div id="disqus_thread"></div> </div> - <script id="dsqjs-script" async src="https://cdn.jsdelivr.net/npm/disqusjs@1.2.6/dist/disqus.js"></script> + <script id="dsqjs-script" async src="https://cdn.jsdelivr.net/npm/disqusjs@1.3.0/dist/disqus.js"></script> <script> document.getElementById('dsqjs-script').addEventListener('load', function() { var dsqjs = new DisqusJS({ diff --git a/package.json b/package.json index 7bf1837..55af152 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "disqusjs", - "version": "1.2.6", + "version": "1.3.0", "description": "Alternative DISQUS - Render comments components from Disqus API", "main": "dist/disqus.js", "scripts": {