From 42a381b2a7c1b46b13e4c0a52e51763fad679216 Mon Sep 17 00:00:00 2001 From: SukkaW Date: Sun, 21 Oct 2018 00:39:53 +0800 Subject: [PATCH] release 1.0.0-rc-5 --- README.md | 108 +++++++++++++++++++++++++--------------------- dist/disqus.js | 4 +- dist/disqusjs.css | 4 +- package.json | 2 +- 4 files changed, 65 insertions(+), 53 deletions(-) diff --git a/README.md b/README.md index 0148791..29da8b2 100644 --- a/README.md +++ b/README.md @@ -1,7 +1,6 @@ # DisqusJS -> Alternative Disqus - Render comment component using Disqus API
-> Disqus 替代方案:使用 Disqus API 渲染评论列表 +> 超轻量级的「评论基础模式」实现:使用 Disqus API 渲染评论列表 [![npm version](https://img.shields.io/npm/v/disqusjs.svg?style=flat-square)](https://www.npmjs.com/package/disqusjs) [![Author](https://img.shields.io/badge/Author-Sukka-b68469.svg?style=flat-square)](https://skk.moe) @@ -19,8 +18,7 @@ ## 功能 - 展示评论列表 -- 自动判断访客的 DISQUS 可用性选择不同模式 - +- 自动判断访客的 DISQUS 可用性选择「评论基础模式」或「」 ## Demo @@ -31,7 +29,9 @@ ### 安装 -首先下载 [经过编译和压缩的 DisqusJS 相关文件](https://github.com/SukkaW/DisqusJS/tree/master/dist),在你需要安装 DisqusJS 的页面的 `` 之前引入 DisqusJS 的 css、在 `` 之前引入 Disqus 的 JS: +#### 直接引入 + +首先下载 [经过编译和压缩的 DisqusJS 相关文件](https://github.com/SukkaW/DisqusJS/tree/master/dist),在你需要安装 DisqusJS 的页面的 `` 之前引入 DisqusJS 的 css,在需要在需要显示评论的位置引入 DisqusJS 的 js: ```html @@ -45,33 +45,53 @@ ```html - - + + - - + + +``` + +#### 从 NPM 安装 + +你可以轻松将 DisqusJS 引入你现有的项目: + +```bash +npm i --save gitalk ``` -在需要显示评论的地方插入下述代码: +``` +import 'disqusjs/dist/disqusjs.css' +import DisqusJS from 'disqusjs' +``` + +### 使用 + +创建一个 DisqusJS 的容器: ```html
+``` + +使用下述代码初始化一个 DisqusJS 实例,注意初始化需在 DisqusJS 加载完成后执行: + +```html ``` -完成上述步骤后,DisqusJS 就已经安装好了,但是你现在还不能使用它。要使用 DisqusJS,你还需要进行一些配置。 +完成上述步骤后,DisqusJS 就已经在您的站点安装好了,但是你现在还不能使用它。要使用 DisqusJS,你还需要进行一些配置。 ### 配置 Disqus Application @@ -89,53 +109,47 @@ disqusjs.config = { ### 配置 DisqusJS 参数 -``` -disqusjs.config {} -``` - -**shortname** +**shortname** `{string}` - 你的 Disqus Forum 的 shortname,你可以在 [Disqus Admin - Settings - General - Shortname](https://disqus.com/admin/settings/general/) 获取你的 shortname -- {String} -- **必填**,无默认值 +- **必须**,无默认值 -**identifier** +**siteName** `{string}` -- 你的页面的 identifier,用来区分不同页面 -- {String} -- **必填**,无默认值 +- 你站点的名称,将会显示在「评论基础模式」的 header 中;该配置应该和 [Disqus Admin - Settings - General - Website Name](https://disqus.com/admin/settings/general/) 一致 +- 非必须,无默认值 -**url** +**identifier** `{string}` -- 你的页面的 URL,Disqus 的爬虫会爬取该 URL 获取页面相关信息 -- {String} -- **必填**,无默认值 +- 当前页面的 identifier,用来区分不同页面 +- **建议**,默认值为 `document.location.origin + document.location.pathname + document.location.search` -**api** +**url** `{string}` -- DisqusJS 请求的 API Endpoint,通常情况下你应该配置一个 Disqus API 的反代并填入反代的地址。你也可以直接使用 DISQUS 官方 API 的 Endpoint `https://disqus.com/api/` 或者使用我搭建的公共 Disqus API 反代:`https://disqus.skk.moe/disqus/` -- {String} -- **必填**,无默认值 +- 当前页面的 URL,Disqus 的爬虫会爬取该 URL 获取页面相关信息 +- **建议**,默认值为 `document.location.origin + document.location.pathname + document.location.search` + +**api** `{string}` + +- DisqusJS 请求的 API Endpoint,通常情况下你应该配置一个 Disqus API 的反代并填入反代的地址。你也可以直接使用 DISQUS 官方 API 的 Endpoint `https://disqus.com/api/`,或我搭建的 Disqus API 反代 Endpoint `https://disqus.skk.moe/disqus/` +- 非必须,默认值为 `https://disqus.skk.moe/disqus/` -**apikey** +**apikey** `{string}` - DisqusJS 向 API 发起请求时使用的 API Key,你应该在配置 Disqus Application 时获取了 API Key -- {String} - **必填**,无默认值 -以下配置和 Disqus Moderator Badge 相关 +以下配置和 Disqus Moderator Badge 相关,缺少一个都不会显示 Badge -**admin** +**admin** `{string}` -- 你的站点的 Disqus Moderator 的用户名(也就是你的用户名) -- {String} -- **必填**,不使用 Badge 时配置为 `''` +- 你的站点的 Disqus Moderator 的用户名(也就是你的用户名)。你可以在 [Disqus - Settings - Account - Username](https://disqus.com/home/settings/account/) 获取你的 Username +- 非必须,无默认值 -**adminLabel** +**adminLabel** `{string}` - 你想显示在 Disqus Moderator Badge 中的文字。该配置应和 [Disqus Admin - Settings - Community - Moderator Badge Text](https://disqus.com/admin/settings/community/) 相同 -- {String} -- **必填**,不使用 Badge 时配置为 `''` +- 非必须,无默认值 --- @@ -145,12 +159,11 @@ disqusjs.config {} - nocomment 没有评论时的提示语(对应 Disqus Admin - Settings - Community - Comment Count Link - Zero comments) - commentPolicyURL 站点评论政策 URL(对应 对应 Disqus Admin - Settings - General - Comment Policy URL) - commentPolicyText 站点评论政策 URL(对应 对应 Disqus Admin - Settings - General - Comment Policy Summary) -- noavatar 默认头像的图片 URL(对应 对应 Disqus Admin - Settings - General - Default Commenter Avatar) - newcomment 是否允许添加新评论(目前增加评论功能尚未实现) ## 注意 -- ~~DisqusJS 尚不支持初始化一个新页面,在新创建了页面以后需要先使用原版 Disqus 访问一次该页面完成初始化。~~ DisqusJS 如果检测到当前页面没有初始化、会提示是否切换到 Disqus 完整模式进行初始化。 +- DisqusJS 如果检测到当前页面没有初始化、会提示是否切换到 Disqus 完整模式进行初始化。 - DisqusJS 仅在当前域名首次访问时检测 Disqus 可用性并选择模式,并把结果持久化在 localStorage 中,之后访问都会沿用之前的模式。 - 一个 Disqus Application 的 Rate Limit 是每小时 1000 次;DisqusJS 一次正常加载会产生 2 次请求。未来可能会开放填入多个 API Key,支持调用多个 Application,绕过 Rate Limit。 - 我搭建了一个 Disqus API 反代的服务 `https://disqus.skk.moe/disqus/` 可供没有能力搭建反代的用户使用,不保证 SLA。 @@ -158,12 +171,11 @@ disqusjs.config {} ## 调试、进阶使用 & 开发相关 -- `a.disquscdn.com` 和 `c.disquscdn.com` 解析到 Cloudflare 而不是 Fastly,可用性大大增强;部分地区 `disqus.com` 已经解封,但是 `shortname.disqus.com` 仍然被墙。 +- `a.disquscdn.com` 和 `c.disquscdn.com` 解析到 Cloudflare 而不是 Fastly,可用性大大增强;部分地区 `disqus.com` 已经解封,但是 `shortname.disqus.com` 仍然被墙;`disq.us` 解析到 Fastly 连通性较差,建议直接解析获得原链接。 - DisqusJS 检测访客的 Disqus 可用性是通过检测 `disqus.com/favicon.ico` 和 `${disqusjs.config.shortname}.disqus.com/favicon.ico` 是否能正常加载,如果有一个加载出错或超时(2s)就判定 Disqus 不可用。 -- 你应该已经注意到 DisqusJS 在页面注册了全局变量 `window.disqusjs`,你可以直接在控制台输入 `console.log(disqusjs)` 查看。关于里面每个子串的含义全部标注在 [DisqusJS 源文件](https://github.com/SukkaW/DisqusJS/blob/master/src/disqus.js) 的注释之中。 +- ~~你应该已经注意到 DisqusJS 在页面注册了全局变量 `window.disqusjs`,你可以直接在控制台输入 `console.log(disqusjs)` 查看。关于里面每个子串的含义全部标注在 [DisqusJS 源文件](https://github.com/SukkaW/DisqusJS/blob/master/src/disqus.js) 的注释之中。~~ - Disqus 自己的 config 保存在全局变量 `window.disqus_config` 中,你可能好奇为什么没有引入。实际上由于 `disqus_config` 和 `disqusjs.config` 中有很多重复的配置,所以 DisqusJS 直接将 `disqusjs.config` 中相关配置项赋给了 `disqus_config`,所以用户只需要配置 `disqusjs.config` 即可。 - ~~ES6 模板字符串不支持复用,所以引入了 [baiduTemplate](https://baidufe.github.io/BaiduTemplate/) 用来渲染评论条目。baiduTemplate 是一个超轻量级的浏览器端 EJS 模板实现。以后 DisqusJS 可能会通过复用函数的方法实现 ES6 模板字符串复用,届时就可以剥离掉 baiduTemplate 了。~~ 已经剥离 baiduTemplate。 -- Disqus API 中有一个 createComment 的 API 用于创建新的评论,但是调用时会有一些坑。 - DisqusJS 并没有使用 Webpack 将 `disqusjs.css` 和 `disqus.js` 打包在一起,这样大家就可以开发自己的 DisqusJS 主题并引入。所有 DisqusJS 创建的 HTML 元素都在 `
` 之中、几乎所有的元素都有自己的类名并都以 `dsqjs-` 为前缀,防止污染。 ## Todo List diff --git a/dist/disqus.js b/dist/disqus.js index de7ff68..eec1009 100644 --- a/dist/disqus.js +++ b/dist/disqus.js @@ -1,6 +1,6 @@ /*! - * DisqusJS | v1.0.0-alpha-1 + * DisqusJS | v1.0.0-rc-5 * Author: SukkaW * Link: https://github.com/SukkaW/DisqusJS * License: MIT - */"use strict";function DisqusJS(s){var n=function(s,e,n){var t=new XMLHttpRequest;t.open("GET",encodeURI(s),!0),t.onreadystatechange=function(){if(4==t.readyState&&200==t.status){var s=JSON.parse(t.responseText);e(s)}},t.timeout=4e3,t.ontimeout=function(s){n(s)},t.onerror=function(s){n(s)},t.send()},d=function(s,e){try{localStorage.setItem(s,e)}catch(s){}},c=function(s){var e=s.getFullYear(),n=s.getMonth()+1;n=n<10?"0".concat(n):n;var t=s.getDate();t=t<10?"0".concat(t):t;var a=s.getHours()+8;a=a<10?"0".concat(a):a;var o=s.getMinutes();return o=o<10?"0".concat(o):o,"".concat(e,"-").concat(n,"-").concat(t," ").concat(a,":").concat(o)};function i(){var s=document,e=s.createElement("script");s.getElementById("disqus_thread").innerHTML='
评论完整模式加载中...如果长时间无法加载,请针对 disq.us | disquscdn.com | disqus.com 启用代理,或使用 评论基础模式
',s.getElementById("dsqjs-force-dsqjs").addEventListener("click",t),e.src="https://"+q.config.shortname+".disqus.com/embed.js",e.setAttribute("data-timestamp",+new Date),(s.head||s.body).appendChild(e)}function r(){for(var s=["disqus.com","".concat(q.config.shortname,".disqus.com")],t=0,a=0,o=function(){s.length===t&&t===a?(d("dsqjs_mode","disqus"),i()):s.length===t&&(d("dsqjs_mode","dsqjs"),l())},e=0;e
    加载更多评论
    ',s.getElementById("dsqjs-msg").innerHTML='评论基础模式加载中。如需完整体验请针对 disq.us | disquscdn.com | disqus.com 启用代理并 尝试完整 Disqus 模式 | 强制完整 Disqus 模式。',s.getElementById("dsqjs-reload-disqus").addEventListener("click",r),s.getElementById("dsqjs-force-disqus").addEventListener("click",u);var e="".concat(q.config.api,"3.0/threads/list.json?forum=").concat(q.config.shortname,"&thread=ident:").concat(q.config.identifier,"&api_key=").concat(q.config.apikey);n(e,function(s){var e=document;if(0===s.code&&1===s.response.length){var n=s.response[0];q.page={id:n.id,title:n.title,isClosed:n.isClosed,length:n.posts},e.getElementById("dsqjs-comment-num").innerHTML=q.page.length,e.getElementById("dsqjs-site-name").innerHTML=q.config.siteName,t()}else 0===s.code&&1!==s.response.length?(e.getElementById("dsqjs-msg").innerHTML='该 Thread 并没有初始化,是否 切换到完整 Disqus 模式 进行初始化?',e.getElementById("dsqjs-force-disqus").addEventListener("click",u)):m()},function(s){m()})}();var t=function t(s){s=s?"&cursor=".concat(s):"";var e="".concat(q.config.api,"3.0/posts/list.json?forum=").concat(q.config.shortname,"&thread=").concat(q.page.id).concat(s,"&api_key=").concat(q.config.apikey);n(e,function(s){if(0===s.code&&0尝试完整 Disqus 模式 | 强制完整 Disqus 模式。',n.getElementById("dsqjs-header").classList.remove("dsqjs-hide"),n.getElementById("dsqjs-post-container").innerHTML='
    这里冷冷清清的,一条评论都没有
    '}else m()},function(s){m()})},a=function(s){var e=[],o=[];return s.forEach(function(s){(s.parent?o:e).push(s)}),e.map(function(s){return{comment:s,author:s.author.name,isPrimary:s.author.username===q.config.admin.toLowerCase(),children:function s(e){if(0===o.length)return null;for(var n=[],t=0;t'),s.comment.authorEl='")):(s.comment.avatarEl=''),s.comment.authorEl='")),s.isPrimary&&(s.comment.authorEl+=''.concat(q.config.adminLabel,"")),s.children&&(s.nesting=1),s},d=function(s){return'
    '.concat(s.avatarEl,'
    ').concat(s.authorEl,'
    ').concat(s.message,"
    ")},e="";(s=a(s)).map(function(s){s=o(s),e+='
  • ').concat(d(s.comment)).concat(function e(s){var n=s.nesting,t=s.children||[];if(t){var a=n<4?'
      ':'
        ';return a+=t.map(function(s){return(s=o(s)).nesting=n+1,'
      • ').concat(d(s.comment)).concat(e(s),"
      • ")}),0!==(a+="
      ").length?a:void 0}}(s),"")});var n=document;n.getElementById("dsqjs-header").classList.remove("dsqjs-hide"),n.getElementById("dsqjs-msg").innerHTML='你可能无法访问 Disqus,已启用评论基础模式。如需完整体验请针对 disq.us | disquscdn.com | disqus.com 启用代理并 尝试完整 Disqus 模式 | 强制完整 Disqus 模式。',n.getElementById("dsqjs-post-container").insertAdjacentHTML("beforeend",e),n.getElementById("dsqjs-reload-disqus").addEventListener("click",r),n.getElementById("dsqjs-force-disqus").addEventListener("click",u)}}function m(){var s=document;s.getElementById("dsqjs-msg").innerHTML='评论基础模式加载失败,是否 重载尝试完整 Disqus 模式 ?',s.getElementById("dsqjs-reload-dsqjs").addEventListener("click",l),s.getElementById("dsqjs-reload-disqus").addEventListener("click",r)}function t(){d("dsqjs_mode","dsqjs"),l()}function u(){d("dsqjs_mode","disqus"),i()}var e,q=[];q.config=s,q.page=[],window.disqus_config=function(){this.page.url=q.config.url,this.page.identifier=q.config.identifier},q.mode=(e="dsqjs_mode",localStorage.getItem(e)),"disqus"===q.mode?i():"dsqjs"===q.mode&&l()} \ No newline at end of file + */"use strict";function DisqusJS(s){var n=function(s,e,n){var t=new XMLHttpRequest;t.open("GET",encodeURI(s),!0),t.onload=function(){if(200<=t.status&&t.status<300||304===t.status){var s=JSON.parse(t.responseText);e(s)}else i()},t.timeout=4500,t.ontimeout=function(s){n(s)},t.onerror=function(s){n(s)},t.send()},e=function(s,e){try{localStorage.setItem(s,e)}catch(s){}},c=function(s){s=Date.parse(new Date(s));var e=(s=new Date(s+288e5)).getFullYear(),n=s.getMonth()+1;n=n<10?"0".concat(n):n;var t=s.getDate();t=t<10?"0".concat(t):t;var a=s.getHours();a=a<10?"0".concat(a):a;var o=s.getMinutes();return o=o<10?"0".concat(o):o,"".concat(e,"-").concat(n,"-").concat(t," ").concat(a,":").concat(o)};function t(){var s=document,e=s.createElement("script");s.getElementById("disqus_thread").innerHTML='
      评论完整模式加载中...如果长时间无法加载,请针对 disq.us | disquscdn.com | disqus.com 启用代理,或使用 评论基础模式
      ',s.getElementById("dsqjs-force-dsqjs").addEventListener("click",r),e.src="https://"+m.config.shortname+".disqus.com/embed.js",e.setAttribute("data-timestamp",+new Date),(s.head||s.body).appendChild(e)}function d(){for(var s=["disqus.com","".concat(m.config.shortname,".disqus.com")],t=0,a=0,o=function(){s.length===t&&t===a?l():s.length===t&&r()},e=0;e
        加载更多评论
        ',s.getElementById("dsqjs-msg").innerHTML='评论基础模式加载中。如需完整体验请针对 disq.us | disquscdn.com | disqus.com 启用代理并 尝试完整 Disqus 模式 | 强制完整 Disqus 模式。',s.getElementById("dsqjs-reload-disqus").addEventListener("click",d),s.getElementById("dsqjs-force-disqus").addEventListener("click",l);var e="".concat(m.config.api,"3.0/threads/list.json?forum=").concat(m.config.shortname,"&thread=ident:").concat(m.config.identifier,"&api_key=").concat(m.config.apikey);n(e,function(s){var e=document;if(0===s.code&&1===s.response.length){var n=s.response[0];m.page={id:n.id,title:n.title,isClosed:n.isClosed,length:n.posts},e.getElementById("dsqjs-comment-num").innerHTML=m.page.length,m.config.siteName&&(e.getElementById("dsqjs-site-name").innerHTML=m.config.siteName),t()}else 0===s.code&&1!==s.response.length?(e.getElementById("dsqjs-msg").innerHTML='该 Thread 并没有初始化,是否 切换到完整 Disqus 模式 进行初始化?',e.getElementById("dsqjs-force-disqus").addEventListener("click",l)):i()},function(s){i()})}();var t=function t(s){s=s?"&cursor=".concat(s):"";var e="".concat(m.config.api,"3.0/posts/list.json?forum=").concat(m.config.shortname,"&thread=").concat(m.page.id).concat(s,"&api_key=").concat(m.config.apikey);n(e,function(s){if(0===s.code&&0尝试完整 Disqus 模式 | 强制完整 Disqus 模式。',n.getElementById("dsqjs-header").classList.remove("dsqjs-hide"),n.getElementById("dsqjs-post-container").innerHTML='
        这里冷冷清清的,一条评论都没有
        '}else i()},function(s){i()})},a=function(s){var e=[],o=[];return s.forEach(function(s){(s.parent?o:e).push(s)}),e.map(function(s){return{comment:s,author:s.author.name,isPrimary:!!m.config.admin&&s.author.username===m.config.admin,children:function s(e){if(0===o.length)return null;for(var n=[],t=0;t'),s.comment.authorEl='")):(s.comment.avatarEl=''),s.comment.authorEl='")),m.config.adminLabel&&s.isPrimary&&(s.comment.authorEl+=''.concat(m.config.adminLabel,"")),s},i=function(s){var e,n,t;return'
        '.concat(s.avatarEl,'
        ').concat(s.authorEl,'
        ').concat((e=s.message,n=new RegExp(//gi),t=new RegExp(/href=\"(.+?)\"/gi),(e.match(n)||[]).map(function(s){s=s.match(t)[0].replace(/href=\"https:\/\/disq.us\/url\?url=/g,"").replace(/(.*)"/,"$1"),s=decodeURIComponent(s).replace(/(.*):(.*)/,"$1"),e=e.replace(n,'').concat(s,""))}),e.replace(/href=/g,'target="_blank" href=')),"
        ")},e="";(s=a(s)).map(function(s){s.children&&(s.nesting=1),s=o(s),e+='
      • ').concat(i(s.comment)).concat(function e(s){var n=s.nesting,t=s.children||[];if(t){var a=n<4?'
          ':'
            ';return a+=t.map(function(s){return(s=o(s)).nesting=n+1,'
          • ').concat(i(s.comment)).concat(e(s),"
          • ")}),0!==(a+="
          ").length?a:void 0}}(s),"")});var n=document;n.getElementById("dsqjs-header").classList.remove("dsqjs-hide"),n.getElementById("dsqjs-msg").innerHTML='你可能无法访问 Disqus,已启用评论基础模式。如需完整体验请针对 disq.us | disquscdn.com | disqus.com 启用代理并 尝试完整 Disqus 模式 | 强制完整 Disqus 模式。',n.getElementById("dsqjs-post-container").insertAdjacentHTML("beforeend",e),n.getElementById("dsqjs-reload-disqus").addEventListener("click",d),n.getElementById("dsqjs-force-disqus").addEventListener("click",l)}}function i(){var s=document;s.getElementById("dsqjs-msg").innerHTML='评论基础模式加载失败,是否 重载尝试完整 Disqus 模式 ?',s.getElementById("dsqjs-reload-dsqjs").addEventListener("click",a),s.getElementById("dsqjs-reload-disqus").addEventListener("click",d)}function r(){e("dsqjs_mode","dsqjs"),a()}function l(){e("dsqjs_mode","disqus"),t()}var o,m=[];m.config=s,m.config.api=m.config.api||"https://disqus.skk.moe/disqus/",m.config.identifier=m.config.identifier||document.location.origin+document.location.pathname+document.location.search,m.config.url=m.config.url||document.location.origin+document.location.pathname+document.location.search,m.page=[],window.disqus_config=function(){this.page.url=m.config.url,this.page.identifier=m.config.identifier},m.mode=(o="dsqjs_mode",localStorage.getItem(o)),"disqus"===m.mode?t():"dsqjs"===m.mode?a():d()} \ No newline at end of file diff --git a/dist/disqusjs.css b/dist/disqusjs.css index 00a988e..9014b5b 100644 --- a/dist/disqusjs.css +++ b/dist/disqusjs.css @@ -1,6 +1,6 @@ /*! - * DisqusJS - Default Theme | v1.0.0-alpha-1 + * DisqusJS - Default Theme | v1.0.0-rc-5 * Author: SukkaW * Link: https://github.com/SukkaW/DisqusJS * License: MIT - */#dsqjs *{margin:0;padding:0;font-family:-apple-system,system-ui,BlinkMacSystemFont,"Segoe UI",Roboto,"PingFang SC","Hiragino Sans GB","Microsoft YaHei","Helvetica Neue",sans-serif;-webkit-font-smoothing:antialiased;-moz-osx-font-smoothing:grayscale}#dsqjs a{text-decoration:none;color:#076dd0}#dsqjs .dsqjs-hide{display:none!important}#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,#dsqjs .dsqjs-post-body pre{font-family:"SF Mono","Segoe UI Mono",Consolas,"Roboto Mono","Liberation Mono",Menlo,Courier,'Courier New',monospace!important}#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-right:4px;padding-top:12px;font-weight:700;font-size:16px;color:#555}#dsqjs .dsqjs-disqus-logo{background-image:url('data:image/svg+xml;utf8,');background-position:50% 50%;background-repeat:no-repeat;display:inline-block;height:12px;width:65.7px} \ No newline at end of file + */#dsqjs *{margin:0;padding:0;font-family:-apple-system,system-ui,BlinkMacSystemFont,"Segoe UI",Roboto,"PingFang SC","Hiragino Sans GB","Microsoft YaHei","Helvetica Neue",sans-serif;-webkit-font-smoothing:antialiased;-moz-osx-font-smoothing:grayscale}#dsqjs a{text-decoration:none;color:#076dd0}#dsqjs .dsqjs-hide{display:none!important}#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,#dsqjs .dsqjs-post-body pre{font-family:"SF Mono","Segoe UI Mono",Consolas,"Roboto Mono","Liberation Mono",Menlo,Courier,'Courier New',monospace!important}#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;utf8,');background-position:50% 50%;background-repeat:no-repeat;display:inline-block;height:12px;width:65.7px} \ No newline at end of file diff --git a/package.json b/package.json index 9388908..0d9368c 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "disqusjs", - "version": "1.0.0-rc-1", + "version": "1.0.0-rc-5", "description": "Alternative DISQUS - Render comments components from Disqus API", "main": "dist/disqus.js", "scripts": {