Welcome to mirror list, hosted at ThFree Co, Russian Federation.

github.com/zhaohuabing/hugo-theme-cleanwhite.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorzhaohuabing <zhaohuabing@gmail.com>2022-03-14 09:18:56 +0300
committerzhaohuabing <zhaohuabing@gmail.com>2022-03-14 09:18:56 +0300
commitd995f7e47b037d4cac5dcbf357ca80046e5bcc1b (patch)
tree18ef10d2ce2702eb113f415a72d6894f88989b39
parent888bafd5e39c1fc7c3a9cc0f2941cfb7e4d56818 (diff)
updae iSisqus
Signed-off-by: zhaohuabing <zhaohuabing@gmail.com>
-rw-r--r--layouts/partials/comments.html5
-rw-r--r--static/css/iDisqus.min.css5
-rw-r--r--static/css/iDisqus.min.css.map1
-rw-r--r--static/js/iDisqus.js1769
-rw-r--r--static/js/iDisqus.min.js92
-rw-r--r--static/js/iDisqus.min.js.map1
6 files changed, 198 insertions, 1675 deletions
diff --git a/layouts/partials/comments.html b/layouts/partials/comments.html
index a39058d..6d6708a 100644
--- a/layouts/partials/comments.html
+++ b/layouts/partials/comments.html
@@ -21,9 +21,10 @@ var disq = new iDisqus('disqus-comment', {
forum: '{{ .Site.DisqusShortname}}',
api: '{{ .Site.Params.disqus_proxy }}',
site: '{{ .Site.Params.disqus_site }}',
- mode: 1,
+ mode: 2,
timeout: 5000,
- init: true
+ init: true,
+ emojiPreview: true
});
</script>
{{ else if .Site.DisqusShortname }}
diff --git a/static/css/iDisqus.min.css b/static/css/iDisqus.min.css
index cec99d4..fc0e2a0 100644
--- a/static/css/iDisqus.min.css
+++ b/static/css/iDisqus.min.css
@@ -1,3 +1,4 @@
-.comment{position:relative;font:14px/1.6 Helvetica Neue,Helvetica,Arial,\\5FAE\8F6F\96C5\9ED1,Microsoft YaHei,sans-serif;color:#2a2e2e;margin:5px auto;word-wrap:break-word;padding:0;box-sizing:border-box}.comment#disqus_thread{display:none}.comment a{text-decoration:none}.comment .icon{max-width:20px}.comment *{margin:0;padding:0;box-sizing:border-box}.comment b,.comment strong{font-weight:700;color:#000}.comment :focus{outline:none}.comment abbr[title]{text-decoration:none}.comment .hide,.comment .loading-bg{display:none}.comment.loading{display:block}.comment.loading>*{display:none}.comment.loading .loading-container{margin:20px auto 40px;color:#9d9ea1;text-align:center;display:block;position:relative;height:100px;line-height:40px;width:250px}.comment.loading .loading-container .loading-bg{display:block;-webkit-transform:rotate(-135deg);transform:rotate(-135deg);margin:0 auto}.comment.loading .loading-container:after,.comment.loading .loading-container:before{display:block;position:absolute}.comment.loading .loading-container:before{content:attr(data-tip);top:64px;left:0;width:100%;height:30px;line-height:30px}.comment.loading .loading-container:after{content:"";box-sizing:border-box;width:26px;height:26px;top:20px;left:115px;border-width:3px;border-style:solid;border-color:#9d9ea1 transparent;border-radius:13px;-webkit-transform-origin:50% 50% 0;transform-origin:50% 50% 0;-webkit-animation:disqus-loader-spinner-animation .7s infinite linear;animation:disqus-loader-spinner-animation .7s infinite linear}.comment-box{display:flex;margin:20px 0}.comment-header{height:36px;line-height:36px;font-weight:700;font-size:15px;display:flex;justify-content:space-between;border-bottom:2px solid #e7e9ee}.comment-header .comment-header-item{color:#656c7a;display:inline-block;border-bottom:2px solid #656c7a;margin-bottom:-2px;padding:0 7px}.comment-header .comment-header-item#comment-link{border-bottom-color:transparent!important}.comment-header .comment-show{position:relative;color:#2a2e2e;cursor:pointer;display:none}.comment-header .comment-header-count,.comment-header .comment-show{width:120px;text-align:center;transition:all .2s ease-in-out;text-transform:capitalize}.comment-header .comment-header-count{display:inline-block}.comment-header .comment-header-count:after{content:" ";display:block;height:2px;position:absolute;bottom:-2px;left:0;right:0;background:#2e9fff}.comment-form{display:flex;flex-direction:column;flex:1}.placeholder{color:#7f919e;line-height:30px;font-size:12px;position:absolute;top:7px;left:10px;right:9px;white-space:nowrap;text-overflow:ellipsis;cursor:text;overflow:hidden}.comment-form-wrapper{display:flex;flex-direction:column;border:2px solid #dbdfe4;border-radius:4px;width:100%}.comment-actions{background:#f6f8f9;border-radius:0 0 2px 2px;display:flex;justify-content:space-between;height:0;transition:opacity .2s linear;opacity:0;filter:alpha(opacity=0);visibility:hidden}.comment-actions .comment-actions-group{display:flex;position:relative}.comment-actions .comment-actions-input{display:none}.comment-actions .comment-actions-input[type=checkbox]:checked+.comment-actions-label .icon{fill:#1d2f3a}.comment-actions .comment-actions-label{display:inline-block;width:34px;height:34px;cursor:pointer}.comment-actions .comment-actions-label .icon{height:18px;margin:8px;display:inline-block;color:#737474;cursor:pointer;fill:#c2c6cc;transition:all .2s}.comment-actions .comment-actions-label:hover .icon{fill:#1d2f3a!important}.comment-actions .exit{display:none}.comment-actions .emojione-list{cursor:default;position:absolute;opacity:0;filter:alpha(opacity=0);visibility:hidden;list-style:none;width:125px;background-color:#fff;padding:5px 0 0 5px;border-radius:2px;border:2px solid #c2c6cc;bottom:100%;left:-2px;margin-left:0;display:flex;flex-wrap:wrap}.comment-actions .emojione-item{position:relative;height:24px;width:24px;margin:0 5px 5px 0}.comment-actions .emojione-item:before{content:"";display:inline-block;position:absolute;left:0;top:0;bottom:0;right:0;z-index:4}.comment-actions .emojione-item-image{height:24px;width:24px;margin:0}.comment-actions .comment-actions-input[type=checkbox]:checked+.emojione:before{position:fixed;top:0;left:0;width:100%;height:100%;content:"";display:block;cursor:default}.comment-actions .comment-actions-input[type=checkbox]:checked+.emojione .emojione-list{opacity:1;filter:alpha(opacity=100);visibility:visible!important}.expanded .comment-image{display:flex}.expanded .comment-image .comment-image-progress{position:relative;height:80px;width:0;background:url("https://a.disquscdn.com/next/embed/assets/img/loader.5cc23909da9c4a9874500d7a85c4125f.gif") 50% no-repeat;margin:0 5px;overflow:hidden}.expanded .comment-image .comment-image-progress:before{position:absolute;content:"";display:block;top:55px;bottom:20px;left:0;right:0;height:5px;width:100%;background-color:#dbdfe4}.expanded .comment-image .comment-image-progress .comment-image-loaded{position:absolute;background-color:#7f919e;top:55px;left:0;right:0;bottom:20px;height:5px;width:0}.expanded .comment-image .comment-image-list{list-style:none;display:flex}.expanded .comment-image .comment-image-item{height:80px;margin-left:5px;position:relative;border-radius:3px;overflow:hidden}.expanded .comment-image .comment-image-item:before{overflow:hidden;line-height:0;height:0;transition:all .3s;content:"\70B9\51FB\79FB\9664";display:block;text-align:center;position:absolute;bottom:0;left:0;right:0;width:100%;font-size:12px;background-color:rgba(0,0,0,.5);line-height:25px;color:#fff}.expanded .comment-image .comment-image-item:hover:before{height:25px}.expanded .comment-image .comment-image-item .comment-image-object{height:100%;border-radius:3px;overflow:hidden}.expanded .comment-image .comment-image-item.loading .comment-image-object{width:20px;margin:0 30px}.expanded .comment-image .comment-image-item.loading:before{display:none}.comment-form-wrapper.editing+.comment-form-user{opacity:1;height:auto;margin-top:10px}.comment-form-wrapper.editing .comment-form-textarea{font:14px/16px Helvetica Neue,Helvetica,Arial,\\5FAE\8F6F\96C5\9ED1,Microsoft YaHei;height:74px}.comment-form-wrapper.editing .comment-image{transition:padding-bottom .15s ease-in-out;background-color:rgba(16,48,68,.03)}.comment-form-wrapper.editing .comment-actions{transition:all .2s ease-in-out;border-top:2px solid #dbdfe4;opacity:1;height:36px;filter:alpha(opacity=100);visibility:visible!important}.comment-form-wrapper.editing .comment-actions-form{transition:all .3s .5s;margin:87px -2px -2px}.comment-form-wrapper.editing .comment-form-submit{opacity:1}.comment-form-wrapper.focus{border:2px solid #c2c6cc}.comment-form-wrapper.focus .comment-actions{border-top:2px solid #c2c6cc}.comment-form-wrapper.focus .comment-actions .comment-actions-label .icon{fill:#656c7a}.comment-form-wrapper.focus.expanded .comment-image{border-top:2px solid #c2c6cc}.comment-form-wrapper.expanded .comment-image{border-top:2px solid #dbdfe4;padding:10px 0 8px}.comment-form-wrapper.logged-in .comment-form-submit{border-radius:0 0 4px;transition:none;opacity:1}.comment-form-wrapper.logged-in .comment-actions-form{margin:0;transition:all .5s}.comment-form-wrapper.logged-in+.comment-form-user{height:0;opacity:0;margin-top:-40px}.comment-form-wrapper.logged-in .exit{display:block}.comment-form-wrapper .comment-form-textarea{width:100%;display:block;border:none;overflow:auto;color:#2a2e2e;cursor:text;resize:none;height:44px;font:18px/30px Helvetica Neue,Helvetica,Arial,\\5FAE\8F6F\96C5\9ED1,Microsoft YaHei;padding:7px;transition:all .2s ease-in-out}.comment-form-wrapper .comment-form-textarea::-webkit-input-placeholder{color:#7f919e}.comment-form-wrapper .comment-form-textarea::-moz-placeholder{color:#7f919e}.comment-form-wrapper .comment-form-alert:not(:empty){background-color:#f05f70;padding:10px;line-height:20px;font-size:13px;font-weight:700;color:#fff;margin:0 -2px;border-top:2px solid #dbdfe4}.comment-actions-form{display:flex}.comment-actions-form .comment-form-cancel{line-height:36px;padding:0 15px;font-size:12px}.comment-actions-form .comment-form-submit{z-index:1;border:none;opacity:0;margin:-2px;white-space:nowrap;border-radius:4px;height:38px;width:80px;display:inline-block;background-color:rgba(29,47,58,.6);cursor:pointer;line-height:38px}.comment-actions-form .comment-form-submit .icon{margin:9px;fill:#fff;cursor:pointer;width:20px;height:20px}.comment-actions-form .comment-form-submit:hover{background-color:rgba(29,47,58,.75)}.comment-form-user{display:flex;opacity:0;transition:all .5s .2s;height:0;margin:-40px -5px 40px;overflow:hidden;line-height:32px}.comment-form-user .comment-form-guest{display:flex;flex-wrap:wrap;flex:1}.comment-form-user .comment-form-auth{height:32px}.comment-form-user .comment-form-login{background-color:transparent;border:none;height:32px;width:32px;margin:0 0 0 5px;cursor:pointer}.comment-thread-form{text-align:center;color:#656c7a;line-height:32px}.comment-thread-form .comment-form-submit{background-color:rgba(29,47,58,.6);border:none;white-space:nowrap;border-radius:4px;height:38px;width:120px;display:inline-block;cursor:pointer;line-height:38px;margin:10px 0;color:#fff;font-size:15px}.comment-thread-form .comment-form-submit:hover{background-color:rgba(29,47,58,.75)}.comment-form-item{display:flex;margin:10px 0}.comment-form-item .comment-form-label{display:block;height:32px;line-height:32px;font-size:14px;color:#656c7a;width:100px;text-align:right;font-weight:700}.comment-form-item .comment-form-textarea{background-color:#fff;border:2px solid #dbdfe4;transition:all .2s linear;padding:2px 10px;border-radius:4px;font-size:14px;height:64px;margin:0 5px;width:30px;line-height:20px;flex:auto}.comment-form-item .comment-form-textarea:focus{border:2px solid #c2c6cc}.comment-form-input{background-color:#fff;border:2px solid #dbdfe4;transition:all .2s linear;padding:0 7px;border-radius:4px;font-size:14px;height:32px;margin:0 5px;width:30px;line-height:32px;flex:auto}.comment-form-input::-webkit-input-placeholder{color:#7f919e}.comment-form-input::-moz-placeholder{color:#7f919e}.comment-form-input:focus{border:2px solid #c2c6cc}.comment-form-input[disabled]{color:#656c7a}.comment-list{font-size:14px}.comment-list:empty:after{content:"\6765\505A\7B2C\4E00\4E2A\7559\8A00\7684\4EBA\5427\FF01";display:block;opacity:.6;line-height:80px;text-align:center}.comment-list p{margin:0}.comment-list a{text-decoration:none;color:#288ce4}.comment-list a[href="javascript:void(0);"]{color:#000;cursor:default}.comment-list pre{overflow:hidden;margin:0 0 15px;border-left:4px solid #7f919e;padding:0 0 0 12px}.comment-list code,.comment-list pre{font-size:12px;font-family:monaco,menlo,monospace;line-height:20px}.comment-list code{padding:0 .3em;display:inline-block;vertical-align:top;margin:2px}.comment-list #comment-preview{opacity:.6}.comment-list .comment-item{padding-top:6px}.comment-list .comment-item-body{display:flex}.comment-list .comment-item-footer,.comment-list .comment-item-header{font-size:13px;line-height:1.2;color:#c2c6cc}.comment-list .comment-item-footer .comment-item-bullet,.comment-list .comment-item-header .comment-item-bullet{padding:0 2px}.comment-list .comment-item-header .comment-item-pname{color:#656c7a}.comment-list .comment-item-header .comment-item-pname .icon{width:12px;height:12px;margin:1px 2px;vertical-align:top;fill:#656c7a}.comment-list .comment-item-header .comment-item-pname:hover{color:#2a2e2e}.comment-list .comment-item-header .comment-item-pname:hover .icon{fill:#656c7a}.comment-list .comment-item-header .comment-item-badge{color:#fff;background:#7f919e;padding:1px 3px;margin:0 2px;font-size:10px;line-height:1.1;font-weight:700;border-radius:3px;display:inline-block}.comment-list .comment-item-header .comment-item-time{font-size:12px;color:#7f919e;word-spacing:-2px;font-weight:400}.comment-list .comment-item-header .comment-item-name{color:#0095dd;font-weight:700}.comment-list .comment-item-header .comment-item-name[href^=javascript]{cursor:text;color:#000}.comment-list .comment-item-footer{padding:5px 0}.comment-list .comment-item-footer .comment-item-delete,.comment-list .comment-item-footer .comment-item-edit,.comment-list .comment-item-footer .comment-item-reply{color:#656c7a;font-weight:500}.comment-list .comment-item-footer .comment-item-delete:hover,.comment-list .comment-item-footer .comment-item-edit:hover,.comment-list .comment-item-footer .comment-item-reply:hover{color:#2a2e2e}.comment-list .comment-item-footer .comment-item-cancel{color:#0095dd;font-weight:700}.comment-list .comment-item-images{display:flex;flex-wrap:wrap}.comment-list .comment-item-images .comment-item-image{height:100px;width:100px;background-size:cover;background-position:50%;background-repeat:no-repeat;margin:0 5px 5px 0}.comment-list .comment-item.transparent{opacity:.4}.comment-list .comment-item-content{padding-top:5px;line-height:24px;font-size:14px}.comment-list .comment-item-content a[data-dsq-mention]:before{content:"@"}.comment-list .comment-item-content .comment-item-content{min-height:20px}.comment-list .comment-item-content img.emojione{vertical-align:top;width:24px;height:24px;margin:0 3px}.comment-list .comment-item-body+.comment-box .comment-avatar,.comment-list .comment-item-body+.comment-box .comment-avatar-image,.comment-list .comment-item-children .comment-box .comment-avatar,.comment-list .comment-item-children .comment-box .comment-avatar-image,.comment-list .comment-item-children .comment-item-avatar,.comment-list .comment-item-children .comment-item-avatar img{width:36px;height:36px;margin-right:6px}.comment-list .comment-form-textarea{height:32px;padding:5px;line-height:22px;font-size:15px}.comment-list .comment-item-main{flex:1}.comment-list .comment-item-main:empty{padding-bottom:5px}.comment-list .comment-item-main:empty:after{content:attr(data-message);line-height:36px;color:#7f919e}.comment-list .comment-box{margin:0}.comment-list .comment-item-body+.comment-box{padding-left:60px;margin-top:6px;margin-bottom:20px}.comment-list .comment-item-children{padding-left:60px}.comment-list .comment-item-children .comment-item-body+.comment-box,.comment-list .comment-item-children .comment-item-children{padding-left:42px}.comment-list .comment-item-children .comment-item-body+.comment-box .comment-item-children .comment-box,.comment-list .comment-item-children .comment-item-body+.comment-box .comment-item-children .comment-item-children,.comment-list .comment-item-children .comment-item-children .comment-item-children .comment-box,.comment-list .comment-item-children .comment-item-children .comment-item-children .comment-item-children{padding-left:0}.comment-loadmore{font-weight:500;display:block;text-align:center;padding:11px 14px;background-color:rgba(29,47,58,.6);color:#fff!important;line-height:1.1;border-radius:3px;transition:background .2s;text-shadow:none}.comment-loadmore:hover{background-color:rgba(29,47,58,.7)}.comment-loadmore.loading{background-color:#edeff2;color:#444!important;cursor:wait}.comment-form-error{position:absolute;background-color:#fff;font-size:14px;padding:10px;line-height:20px;border-radius:3px;box-shadow:0 0 5px 1px rgba(0,0,0,.3);margin-top:40px;margin-left:2px;z-index:10}.comment-form-error:before{width:10px;height:10px;-webkit-transform:rotate(45deg);transform:rotate(45deg);box-shadow:0 0 5px 1px rgba(0,0,0,.3);top:-4px;left:15px}.comment-form-error:after,.comment-form-error:before{content:"";display:block;position:absolute;background-color:#fff}.comment-form-error:after{width:20px;height:12px;top:0;left:10px}.comment-item-children,.comment-list{text-align:left;list-style:none;margin-left:0;line-height:20px}.comment-avatar,.comment-item-avatar{display:block;width:48px;height:48px;margin-right:12px}.comment-avatar img,.comment-item-avatar img{border-radius:3px;width:48px;height:48px}.mention-user{background-color:#fff;border-radius:2px;box-shadow:1px 1px 2px 1px rgba(29,47,58,.2);position:absolute;overflow:hidden}.mention-user .mention-user-list{list-style:none}.mention-user .mention-user-item{height:30px;padding:3px;line-height:24px;font-size:12px;display:flex;cursor:default}.mention-user .mention-user-item.active{background-color:#2e9fff;color:#fff}.mention-user .mention-user-item.active .mention-user-name{color:#fff}.mention-user .mention-user-avatar{width:24px;height:24px;border-radius:3px;display:block}.mention-user .mention-user-username{font-weight:600;padding-left:4px}.mention-user .mention-user-name{color:#656c7a;padding-left:4px}@-webkit-keyframes disqus-loader-spinner-animation{0%{-webkit-transform:rotate(0);transform:rotate(0)}to{-webkit-transform:rotate(1turn);transform:rotate(1turn)}}@keyframes disqus-loader-spinner-animation{0%{-webkit-transform:rotate(0);transform:rotate(0)}to{-webkit-transform:rotate(1turn);transform:rotate(1turn)}}@media screen and (max-width:450px){.comment-item .comment-item-children .comment-box,.comment-item .comment-item-children .comment-item-children{padding-left:0!important}.comment-item .at,.comment-item .comment-avatar,.comment-item .comment-item-children .comment-item-avatar{display:none}.comment-form-user{line-height:42px}.comment-form-user .comment-form-auth{margin:5px}.comment-form-user .comment-form-input{margin:5px;width:100%}.comment-form-wrapper.editing .comment-actions-form{margin:180px 0 0}.comment-form-wrapper.logged-in .comment-actions-form{margin:0}}
+.comment{position:relative;font:13.5px/1.6 "Helvetica Neue", Helvetica, Arial, "微软雅黑", "Microsoft YaHei", sans-serif;color:#2a2e2e;margin:5px auto;word-wrap:break-word;padding:0;box-sizing:border-box}.comment#disqus_thread{display:none}.comment input,.comment textarea,.comment select,.comment button{font:13.5px/1.6 "Helvetica Neue", Helvetica, Arial, "微软雅黑", "Microsoft YaHei", sans-serif}.comment a{text-decoration:none}.comment .icon{max-width:20px}.comment *{margin:0;padding:0;box-sizing:border-box}.comment strong,.comment b{font-weight:bold;color:#000}.comment :focus{outline:none}.comment abbr[title]{text-decoration:none}.comment .hide{display:none}.comment .init-bg{display:none}.comment.init{display:block}.comment.init>*{display:none}.comment.init .init-container{margin:20px auto 20px;color:#9d9ea1;text-align:center;display:block;position:relative;height:100px;line-height:40px;width:250px}.comment.init .init-container .init-bg{display:block;transform:rotate(-135deg);margin:0 auto}.comment.init .init-container:before,.comment.init .init-container:after{display:block;position:absolute}.comment.init .init-container:before{content:attr(data-tips);top:64px;left:0;width:100%;height:30px;line-height:30px}.comment.init .init-container:after{content:"";box-sizing:border-box;width:26px;height:26px;top:20px;left:115px;border-width:3px;border-style:solid;border-color:#9d9ea1 transparent;border-radius:13px;transform-origin:50% 50% 0;-webkit-animation:disqus-loader-spinner-animation .7s infinite linear;animation:disqus-loader-spinner-animation .7s infinite linear}.comment.loading .comment-order{pointer-events:none}.comment-box{display:flex;margin:0 0 20px}.comment-navbar{display:flex;justify-content:space-between;align-items:center;height:48px}.comment-navbar .comment-navbar-item{display:flex}.comment-navbar .comment-recommend{display:flex;align-items:center;line-height:27px;height:27px;border:1px solid #656c7a;padding:0 5px;border-radius:3px;color:#656c7a;font-size:12px}.comment-navbar .comment-recommend .icon{fill:#656c7a;width:16px;height:16px}.comment-navbar .comment-recommend.voted .icon{fill:#f05f70}.comment-navbar .comment-recommend-text{margin:0 5px}.comment-navbar .comment-order-label{display:block;height:20px;line-height:20px;margin-right:10px;font-size:12px;border-radius:2px;padding:0 5px;background-color:#e7e9ee;cursor:pointer}.comment-navbar .comment-order-label:last-child{margin-right:0}.comment-navbar .comment-order-radio{display:none}.comment-navbar .comment-order-radio:checked+.comment-order-label{color:#fff;background-color:#c2c6cc}.comment-header{display:flex;justify-content:space-between;border-bottom:2px solid #e7e9ee}.comment-header .comment-header-item{height:36px;line-height:36px;font-weight:bold;font-size:15px;color:#656c7a;display:inline-block;border-bottom:2px solid #656c7a;margin-bottom:-2px;margin-right:10px;padding:0 5px}.comment-header .comment-header-item:last-child{margin-right:0;border-bottom-color:transparent}.comment-header .comment-header-item:last-child:hover{color:#2a2a2a}.comment-header #comment-user{display:none}.comment-header #comment-user:checked+.comment-user{color:#2a2a2a}.comment-header #comment-user:checked+.comment-user:after{border-top-color:#2a2a2a}.comment-header #comment-user:checked+.comment-user .comment-logout{display:block}.comment-header .comment-login{cursor:pointer}.comment-header .comment-user{cursor:pointer;position:relative;padding-right:15px}.comment-header .comment-user:after{content:"";display:block;position:absolute;height:0;width:0;border:5px solid transparent;border-top-color:#656c7a;top:50%;right:0;margin-top:0}.comment-header .comment-user:hover:after{border-top-color:#2a2a2a}.comment-header .comment-logout{cursor:pointer;z-index:1;display:none;position:absolute;border-radius:3px;border:2px solid #c2c6cc;width:80px;background-color:#fff;height:32px;line-height:28px;text-align:center;right:0;top:80%;color:#656c7a;font-size:13px}.comment-header .comment-logout:hover{color:#0095dd}.comment-header .comment-show{width:120px;text-align:center;position:relative;transition:all 0.2s ease-in-out;color:#2a2e2e;text-transform:capitalize;cursor:pointer;display:none}.comment-header .comment-header-count{width:120px;text-align:center;transition:all 0.2s ease-in-out;text-transform:capitalize;display:inline-block}.comment-header .comment-header-count:after{content:" ";display:block;height:2px;position:absolute;bottom:-2px;left:0px;right:0px;background:#2e9fff}.comment-form{display:flex;flex-direction:column;width:calc(100% - 60px)}.comment-item-child .comment-form{width:calc(100% - 42px)}.placeholder{color:#7f919e;line-height:30px;font-size:12px;position:absolute;top:7px;left:10px;right:9px;white-space:nowrap;text-overflow:ellipsis;cursor:text;overflow:hidden}.comment-form-wrapper{display:flex;flex-direction:column;border:2px solid #dbdfe4;border-radius:4px;width:100%}.comment-actions{background:#f6f8f9;border-radius:0 0 2px 2px;display:flex;justify-content:space-between;height:0;transition:opacity linear .2s;opacity:0;filter:alpha(opacity=0);visibility:hidden}.comment-actions .comment-actions-group{display:flex;position:relative}.comment-actions .comment-actions-input{display:none}.comment-actions .comment-actions-input[type="checkbox"]:checked+.comment-actions-label .icon{fill:#1d2f3a}.comment-actions .comment-actions-label{display:inline-block;width:34px;height:34px;cursor:pointer}.comment-actions .comment-actions-label .icon{height:18px;margin:8px;display:inline-block;color:#737474;cursor:pointer;fill:#c2c6cc;transition:all .2s}.comment-actions .comment-actions-label:hover .icon{fill:#1d2f3a !important}.comment-actions .emojione-list{cursor:default;position:absolute;opacity:0;filter:alpha(opacity=0);visibility:hidden;list-style:none;width:125px;background-color:#fff;padding:5px 0 0 5px;border-radius:2px;border:2px solid #c2c6cc;bottom:100%;left:-2px;margin-left:0;display:flex;flex-wrap:wrap}.comment-actions .emojione-item{position:relative;height:24px;width:24px;margin:0 5px 5px 0}.comment-actions .emojione-item:before{content:"";display:inline-block;position:absolute;left:0;top:0;bottom:0;right:0;z-index:4}.comment-actions .emojione-item-image{height:24px;width:24px}.comment-actions .comment-actions-input[type="checkbox"]:checked+.emojione:before{position:fixed;top:0;left:0;width:100%;height:100%;content:"";display:block;cursor:default}.comment-actions .comment-actions-input[type="checkbox"]:checked+.emojione .emojione-list{opacity:1;filter:alpha(opacity=100);visibility:visible !important}.expanded .comment-image{display:flex;overflow-x:auto}.expanded .comment-image .comment-image-progress{position:relative;height:80px;width:0;background:url("https://a.disquscdn.com/next/embed/assets/img/loader.5cc23909da9c4a9874500d7a85c4125f.gif") center no-repeat;margin:0 5px;overflow:hidden}.expanded .comment-image .comment-image-progress:before{position:absolute;content:"";display:block;top:55px;bottom:20px;left:0;right:0;height:5px;width:100%;background-color:#dbdfe4}.expanded .comment-image .comment-image-progress .comment-image-loaded{position:absolute;background-color:#7f919e;top:55px;left:0;right:0;bottom:20px;height:5px;width:0}.expanded .comment-image .comment-image-list{list-style:none;display:flex}.expanded .comment-image .comment-image-item{height:80px;margin-left:5px;position:relative;border-radius:3px;overflow:hidden;flex:none}.expanded .comment-image .comment-image-item .comment-image-object{display:block;height:100%;border-radius:3px;overflow:hidden}.expanded .comment-image .comment-image-item.loading .comment-image-object{width:20px;margin:0 30px}.comment-form-wrapper.editing+.comment-form-user{opacity:1;height:auto;margin-top:10px}.comment-form-wrapper.editing .comment-form-textarea{height:74px;font-size:13.5px;line-height:16px}.comment-form-wrapper.editing .comment-image{transition:padding-bottom .15s ease-in-out;background-color:rgba(16,48,68,0.03)}.comment-form-wrapper.editing .comment-actions{transition:all 0.2s ease-in-out;border-top:solid 2px #dbdfe4;opacity:1;height:36px;filter:alpha(opacity=100);visibility:visible !important}.comment-form-wrapper.editing .comment-actions-form{transition:all .3s .5s;margin:87px -2px -2px}.comment-form-wrapper.editing .comment-form-submit{opacity:1}.comment-form-wrapper.focus{border:2px solid #c2c6cc}.comment-form-wrapper.focus .comment-actions{border-top:2px solid #c2c6cc}.comment-form-wrapper.focus .comment-actions-label .icon{fill:#656c7a}.comment-form-wrapper.focus.expanded .comment-image{border-top:2px solid #c2c6cc}.comment-form-wrapper.preview{border:2px solid #c2c6cc}.comment-form-wrapper.preview .comment-actions{border-top:2px solid #c2c6cc}.comment-form-wrapper.preview .comment-actions-label{pointer-events:none}.comment-form-wrapper.preview .comment-actions-label[for^="preview-input"]{pointer-events:auto}.comment-form-wrapper.preview .comment-actions-label[for^="preview-input"] .icon{fill:#656c7a}.comment-form-wrapper.expanded .comment-image{border-top:2px solid #dbdfe4;padding:10px 0 8px}.comment-form-wrapper.logged-in .comment-form-submit{border-radius:0 0 4px;transition:none;opacity:1}.comment-form-wrapper.logged-in .comment-actions-form{margin:0;transition:all .5s}.comment-form-wrapper.logged-in+.comment-form-user{height:0;opacity:0;margin-top:-40px}.comment-form-wrapper.logged-in .exit{display:block}.comment-form-wrapper .comment-form-preview{border-radius:4px;display:none;min-height:74px;padding:7px;white-space:pre-wrap}.comment-form-wrapper .comment-form-textarea{width:100%;display:block;border:none;font-size:18px;line-height:30px;border-radius:4px;color:#2a2e2e;cursor:text;resize:none;height:44px;padding:7px;transition:all .2s ease-in-out;background-color:#fefefe}.comment-form-wrapper .comment-form-textarea::-webkit-input-placeholder{color:#7f919e}.comment-form-wrapper .comment-form-textarea::-moz-placeholder{color:#7f919e}.comment-form-wrapper .comment-form-alert:not(:empty){background-color:#f05f70;padding:10px;line-height:20px;font-size:13px;font-weight:700;color:#fff;margin:0 -2px;border-top:2px solid #dbdfe4}.comment-actions-form{display:flex}.comment-actions-form .comment-form-cancel{line-height:36px;padding:0 15px;font-size:12px}.comment-actions-form .comment-form-submit{z-index:1;border:none;opacity:0;margin:-2px;white-space:nowrap;border-radius:4px;height:38px;width:80px;display:inline-block;background-color:rgba(29,47,58,0.6);cursor:pointer;line-height:38px}.comment-actions-form .comment-form-submit .icon{margin:9px;fill:#fff;cursor:pointer;width:20px;height:20px}.comment-actions-form .comment-form-submit:hover{background-color:rgba(29,47,58,0.75)}.comment-form-user{display:flex;opacity:0;transition:all .5s .2s;height:0;margin:-40px -5px 40px;overflow:hidden;line-height:32px}.comment-form-user .comment-form-guest{display:flex;flex-wrap:wrap;flex:1}.comment-form-user .comment-form-auth{height:32px}.comment-form-user .comment-form-login{background-color:transparent;border:none;height:32px;width:32px;margin:0 0 0 5px;cursor:pointer}.comment-thread-form{text-align:center;color:#656c7a;line-height:32px}.comment-thread-form .comment-form-submit{background-color:rgba(29,47,58,0.6);border:none;white-space:nowrap;border-radius:4px;height:38px;width:120px;display:inline-block;cursor:pointer;line-height:38px;margin:10px 0;color:#fff;font-size:15px}.comment-thread-form .comment-form-submit:hover{background-color:rgba(29,47,58,0.75)}.comment-form-item{display:flex;margin:10px 0}.comment-form-item .comment-form-label{display:block;height:32px;line-height:32px;color:#656c7a;width:100px;text-align:right;font-weight:bold}.comment-form-item .comment-form-textarea{background-color:#fff;border:2px solid #dbdfe4;transition:all .2s linear;padding:2px 10px;border-radius:4px;height:64px;margin:0 5px;width:30px;line-height:20px;flex:auto}.comment-form-item .comment-form-textarea:focus{border:2px solid #c2c6cc}.comment-form-input{background-color:#fff;border:2px solid #dbdfe4;transition:all .2s linear;padding:0 7px;border-radius:4px;height:32px;margin:0 5px;width:30px;line-height:32px;flex:auto}.comment-form-input::-webkit-input-placeholder{color:#7f919e}.comment-form-input::-moz-placeholder{color:#7f919e}.comment-form-input:focus{border:2px solid #c2c6cc}.comment-form-input[disabled]{color:#656c7a}.comment-list:empty:after{content:attr(data-tips);display:block;opacity:.6;line-height:80px;text-align:center}.comment-list p{margin:0}.comment-list a{text-decoration:none;color:#288ce4}.comment-list a[href="javascript:void(0);"]{color:#000;cursor:default}.comment-list code{line-height:20px;font-size:12px;font-family:monaco,menlo,monospace;padding:0 .3em;display:inline-block;vertical-align:top;margin:2px}.comment-list pre{overflow-x:auto;margin:0 0 15px;border-left:4px solid #7f919e;padding:0 0 0 12px}.comment-list pre code{display:block;overflow-y:hidden;white-space:pre;line-height:1.1}.comment-list #comment-preview{opacity:.6}.comment-list .comment-item{padding-top:6px}.comment-list .comment-item-body{display:flex;margin-bottom:5px}.comment-list .comment-item-header,.comment-list .comment-item-footer{line-height:1.2;color:#c2c6cc}.comment-list .comment-item-header .comment-item-bullet,.comment-list .comment-item-footer .comment-item-bullet{padding:0 2px}.comment-list .comment-item-header{font-size:13px}.comment-list .comment-item-header .comment-item-pname{color:#656c7a;position:relative}.comment-list .comment-item-header .comment-item-pname .icon{width:12px;height:12px;margin:1px 2px;vertical-align:top;fill:#656c7a}.comment-list .comment-item-header .comment-item-pname:hover{color:#2a2e2e}.comment-list .comment-item-header .comment-item-pname:hover .icon{fill:#656c7a}.comment-list .comment-item-header .comment-item-pname:hover .comment-item-parent{display:flex}.comment-list .comment-item-header .comment-item-parent{display:none;position:absolute;border-radius:3px;border:2px solid #dbdfe4;padding:5px;width:250px;background-color:#fff;align-items:center;height:48px;top:50%;margin-top:-24px;left:15px;line-height:18px;box-shadow:0 1px 1px 0 rgba(0,0,0,0.1)}.comment-list .comment-item-header .comment-item-parent .comment-item-pmain{width:calc(100% - 42px)}.comment-list .comment-item-header .comment-item-parent .comment-item-pheader{color:#656c7a}.comment-list .comment-item-header .comment-item-parent .comment-item-pcontent{font-size:12px;padding:0;overflow:hidden;white-space:nowrap;text-overflow:ellipsis}.comment-list .comment-item-header .comment-item-badge{color:#fff;background:#7f919e;padding:1px 3px;margin:0 2px;font-size:10px;line-height:1.1;font-weight:700;border-radius:3px;display:inline-block}.comment-list .comment-item-header .comment-item-time{font-size:12px;color:#7f919e;word-spacing:-2px;font-weight:400}.comment-list .comment-item-header .comment-item-name{color:#0095dd;font-weight:700}.comment-list .comment-item-header .comment-item-name[href^="javascript"]{cursor:text;color:#000}.comment-list .comment-item-footer{font-size:12px;padding:5px 0}.comment-list .comment-item-footer .comment-item-reply,.comment-list .comment-item-footer .comment-item-edit,.comment-list .comment-item-footer .comment-item-delete{color:#656c7a;font-weight:500}.comment-list .comment-item-footer .comment-item-reply:hover,.comment-list .comment-item-footer .comment-item-edit:hover,.comment-list .comment-item-footer .comment-item-delete:hover{color:#2a2e2e}.comment-list .comment-item-footer .comment-item-cancel{color:#0095dd;font-weight:700}.comment-list .comment-item-image a{display:inline-block}.comment-list .comment-item-image img{display:block;border-radius:3px;max-width:100%;max-height:480px}.comment-list iframe{width:100%}.comment-list .comment-item.transparent{opacity:.4}.comment-list .comment-item-content{padding-top:5px;letter-spacing:.5px}.comment-list .comment-item-content spoiler{display:inline;background-color:#687a86;color:transparent;white-space:pre-wrap}.comment-list .comment-item-content spoiler:hover{color:#2e2e2e;background-color:transparent}.comment-list .comment-item-content p{margin-bottom:5px}.comment-list .comment-item-content p:last-child{margin-bottom:0}.comment-list .comment-item-content a[data-dsq-mention]:before{content:"@"}.comment-list .comment-item-content .comment-item-content{min-height:20px}.comment-list .comment-item-content img.emojione{vertical-align:top;width:24px;height:24px;margin:0 3px}.comment-list .comment-item-children .comment-item-avatar,.comment-list .comment-item-children .comment-item-avatar img,.comment-list .comment-item-children .comment-box .comment-avatar,.comment-list .comment-item-children .comment-box .comment-avatar-image,.comment-list .comment-item-body+.comment-box .comment-avatar,.comment-list .comment-item-body+.comment-box .comment-avatar-image{width:36px;height:36px;margin-right:6px;box-shadow:0 0.5px 0.5px 0 rgba(0,0,0,0.05)}.comment-list .comment-form-textarea{height:32px;padding:5px;line-height:22px;font-size:15px}.comment-list .comment-item-main{width:calc(100% - 60px)}.comment-list .comment-item-main:empty{line-height:48px}.comment-list .comment-item-main:empty:after{content:attr(data-message);line-height:36px;color:#7f919e}.comment-list .comment-box{margin:0}.comment-list .comment-box+.comment-item-body{display:none}.comment-list .comment-item-body+.comment-box{padding-left:60px;padding-top:6px;margin-bottom:20px}.comment-list .comment-item-children{padding-left:60px}.comment-list .comment-item-children .comment-item-main{width:calc(100% - 42px)}.comment-list .comment-item-children .comment-item-main:empty{line-height:36px}.comment-list .comment-item-children .comment-item-children,.comment-list .comment-item-children .comment-item-body+.comment-box{padding-left:42px}.comment-list .comment-item-children .comment-item-children .comment-item-children .comment-item-children,.comment-list .comment-item-children .comment-item-children .comment-item-children .comment-box,.comment-list .comment-item-children .comment-item-body+.comment-box .comment-item-children .comment-item-children,.comment-list .comment-item-children .comment-item-body+.comment-box .comment-item-children .comment-box{padding-left:0}.comment-list .comment-item-loadmore{font-size:13px;text-decoration:underline;display:block;margin:10px 0}.comment-loadmore{font-weight:500;display:block;text-align:center;padding:11px 14px;background-color:rgba(29,47,58,0.6);color:#fff !important;line-height:1.1;border-radius:3px;transition:background .2s;text-shadow:none}.comment-loadmore:hover{background-color:rgba(29,47,58,0.7)}.comment-loadmore.loading{background-color:#edeff2;color:#444 !important;cursor:wait}.comment-form-error{position:absolute;background-color:#fff;padding:10px;line-height:20px;border-radius:3px;box-shadow:0 0 5px 1px rgba(0,0,0,0.3);margin-top:40px;margin-left:2px;z-index:10}.comment-form-error:before{content:"";display:block;position:absolute;width:10px;height:10px;transform:rotate(45deg);background-color:#fff;box-shadow:0 0 5px 1px rgba(0,0,0,0.3);top:-4px;left:15px}.comment-form-error:after{content:"";display:block;position:absolute;width:20px;height:12px;top:0;left:10px;background-color:#fff}.comment-list,.comment-item-children{text-align:left;list-style:none;margin-left:0;line-height:20px}.comment-avatar,.comment-item-avatar{display:block;width:48px;height:48px;margin-right:12px}.comment-avatar img,.comment-item-avatar img{border-radius:3px;width:48px;height:48px}.mention-user{background-color:#fff;border-radius:2px;box-shadow:1px 1px 2px 1px rgba(29,47,58,0.2);position:absolute;overflow:hidden}.mention-user .mention-user-list{list-style:none}.mention-user .mention-user-item{height:30px;padding:3px;line-height:24px;font-size:12px;display:flex;cursor:default}.mention-user .mention-user-item.active{background-color:#2e9fff;color:#fff}.mention-user .mention-user-item.active .mention-user-name{color:#fff}.mention-user .mention-user-avatar{width:24px;height:24px;border-radius:3px;display:block}.mention-user .mention-user-username{font-weight:600;padding-left:4px}.mention-user .mention-user-name{color:#656c7a;padding-left:4px}.comment-related{color:#444;margin-top:20px;width:100%}.comment-related .comment-related-title{font-weight:700;text-transform:uppercase;color:rgba(34,59,74,0.5);margin-bottom:5px;white-space:nowrap;text-overflow:ellipsis}.comment-related .comment-related-forumname{color:#413a3a}.comment-related .related-list{display:flex;flex-wrap:wrap;list-style:none}.comment-related .related-list .related-item{width:48%;margin-bottom:10px}.comment-related .related-list .related-item:nth-child(odd){margin-right:4%}.comment-related .related-list .related-item-link{color:#000}.comment-related .related-list .related-item-link:hover .related-item-avatar{opacity:.8}.comment-related .related-list .related-item-link:hover .related-item-name{color:#aaa}.comment-related .related-list .related-item-title{display:block;overflow:hidden;font-weight:700}.comment-related .related-list .related-item-desc{color:rgba(30,55,70,0.4);font-weight:500;font-size:12px}.comment-related .related-list .related-item-post{padding:5px 0;display:flex}.comment-related .related-list .related-item-avatar{width:30px;height:30px;margin-right:5px;flex:none}.comment-related .related-list .related-item-avatar img{display:block;width:100%;border-radius:3px}.comment-related .related-list .related-item-main{flex:1;height:30px;line-height:15px;overflow:hidden;font-size:13px}.comment-related .related-list .related-item-name{color:rgba(30,55,70,0.4);font-weight:600}.comment-related .related-list .related-item-message{white-space:nowrap;overflow:hidden;text-overflow:ellipsis}.comment-reaction{display:flex;flex-direction:column}.comment-reaction .comment-reaction-header{text-align:center;line-height:25px}.comment-reaction .comment-reaction-list{display:flex;justify-content:center;list-style-type:none;flex-wrap:wrap;align-items:center}.comment-reaction .comment-reaction-list:not(:empty){padding:10px 0}.comment-reaction .comment-reaction-list .comment-reaction-item{display:flex;flex-direction:column;justify-content:center;align-items:center;font-size:12px;color:#656c7a;margin-right:10px}.comment-reaction .comment-reaction-list .comment-reaction-item:last-child{margin-right:0}.comment-reaction .comment-reaction-list .comment-reaction-btn{display:flex;align-items:center;padding:0 5px;border:1px solid #c2c6cc;border-radius:3px;height:30px;line-height:30px;max-width:100px;color:#656c7a}.comment-reaction .comment-reaction-list .comment-reaction-btn.selected{border-color:#656c7a}.comment-reaction .comment-reaction-list .comment-reaction-count{padding:5px 0}.comment-reaction .comment-reaction-list .comment-reaction-text{margin-left:5px}.comment-reaction .comment-reaction-list img{width:20px;height:20px}@-webkit-keyframes disqus-loader-spinner-animation{0%{transform:rotate(0)}100%{transform:rotate(360deg)}}@keyframes disqus-loader-spinner-animation{0%{transform:rotate(0)}100%{transform:rotate(360deg)}}@media screen and (max-width: 450px){.comment-reaction-text{display:none}.comment-form-wrapper.editing .comment-actions-form{margin:180px 0 0}.comment-form-wrapper.logged-in .comment-actions-form{margin:0}.comment-item .at{display:none}.comment-item .comment-avatar{display:none}.comment-item .comment-form{width:100%}.comment-item .comment-item-children .comment-item-children,.comment-item .comment-item-children .comment-box{padding-left:0 !important}.comment-item .comment-item-children .comment-item-avatar{display:none}.comment-item .comment-item-children .comment-item-main,.comment-item .comment-item-children .comment-form{width:100%}.comment-form-user{line-height:42px}.comment-form-user .comment-form-auth{margin:5px}.comment-form-user .comment-form-input{margin:5px;width:100%}.comment-related .related-list .related-item{width:100%;padding-left:10px}}
-/*# sourceMappingURL=iDisqus.min.css.map*/
+
+/*# sourceMappingURL=iDisqus.min.css.map*/ \ No newline at end of file
diff --git a/static/css/iDisqus.min.css.map b/static/css/iDisqus.min.css.map
new file mode 100644
index 0000000..aa6e5b9
--- /dev/null
+++ b/static/css/iDisqus.min.css.map
@@ -0,0 +1 @@
+{"version":3,"sources":["webpack://[name]/./src/iDisqus.scss"],"names":[],"mappings":"AAAA,SAAS,kBAAkB,0FAA0F,cAAc,gBAAgB,qBAAqB,UAAU,sBAAsB,uBAAuB,aAAa,iEAAiE,0FAA0F,WAAW,qBAAqB,eAAe,eAAe,WAAW,SAAS,UAAU,sBAAsB,2BAA2B,iBAAiB,WAAW,gBAAgB,aAAa,qBAAqB,qBAAqB,eAAe,aAAa,kBAAkB,aAAa,cAAc,cAAc,gBAAgB,aAAa,8BAA8B,sBAAsB,cAAc,kBAAkB,cAAc,kBAAkB,aAAa,iBAAiB,YAAY,uCAAuC,cAAc,0BAA0B,cAAc,yEAAyE,cAAc,kBAAkB,qCAAqC,wBAAwB,SAAS,OAAO,WAAW,YAAY,iBAAiB,oCAAoC,WAAW,sBAAsB,WAAW,YAAY,SAAS,WA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,WAAW,kBAAkB,kDAAkD,OAAO,YAAY,iBAAiB,gBAAgB,eAAe,kDAAkD,yBAAyB,gBAAgB,qDAAqD,mBAAmB,gBAAgB,uBAAuB,kBAAkB,aAAa,sBAAsB,2CAA2C,kBAAkB,iBAAiB,yCAAyC,aAAa,uBAAuB,qBAAqB,eAAe,mBAAmB,qDAAqD,eAAe,gEAAgE,aAAa,sBAAsB,uBAAuB,mBAAmB,eAAe,cAAc,kBAAkB,2EAA2E,eAAe,+DAA+D,aAAa,mBAAmB,cAAc,yBAAyB,kBAAkB,YAAY,iBAAiB,gBAAgB,cAAc,wEAAwE,qBAAqB,iEAAiE,cAAc,gEAAgE,gBAAgB,6CAA6C,WAAW,YAAY,mDAAmD,GAAG,oBAAoB,KAAK,0BAA0B,2CAA2C,GAAG,oBAAoB,KAAK,0BAA0B,qCAAqC,uBAAuB,aAAa,oDAAoD,iBAAiB,sDAAsD,SAAS,kBAAkB,aAAa,8BAA8B,aAAa,4BAA4B,WAAW,8GAA8G,0BAA0B,0DAA0D,aAAa,2GAA2G,WAAW,mBAAmB,iBAAiB,sCAAsC,WAAW,uCAAuC,WAAW,WAAW,6CAA6C,WAAW","file":"iDisqus.min.css","sourcesContent":[".comment{position:relative;font:13.5px/1.6 \"Helvetica Neue\", Helvetica, Arial, \"微软雅黑\", \"Microsoft YaHei\", sans-serif;color:#2a2e2e;margin:5px auto;word-wrap:break-word;padding:0;box-sizing:border-box}.comment#disqus_thread{display:none}.comment input,.comment textarea,.comment select,.comment button{font:13.5px/1.6 \"Helvetica Neue\", Helvetica, Arial, \"微软雅黑\", \"Microsoft YaHei\", sans-serif}.comment a{text-decoration:none}.comment .icon{max-width:20px}.comment *{margin:0;padding:0;box-sizing:border-box}.comment strong,.comment b{font-weight:bold;color:#000}.comment :focus{outline:none}.comment abbr[title]{text-decoration:none}.comment .hide{display:none}.comment .init-bg{display:none}.comment.init{display:block}.comment.init>*{display:none}.comment.init .init-container{margin:20px auto 20px;color:#9d9ea1;text-align:center;display:block;position:relative;height:100px;line-height:40px;width:250px}.comment.init .init-container .init-bg{display:block;transform:rotate(-135deg);margin:0 auto}.comment.init .init-container:before,.comment.init .init-container:after{display:block;position:absolute}.comment.init .init-container:before{content:attr(data-tips);top:64px;left:0;width:100%;height:30px;line-height:30px}.comment.init .init-container:after{content:\"\";box-sizing:border-box;width:26px;height:26px;top:20px;left:115px;border-width:3px;border-style:solid;border-color:#9d9ea1 transparent;border-radius:13px;transform-origin:50% 50% 0;-webkit-animation:disqus-loader-spinner-animation .7s infinite linear;animation:disqus-loader-spinner-animation .7s infinite linear}.comment.loading .comment-order{pointer-events:none}.comment-box{display:flex;margin:0 0 20px}.comment-navbar{display:flex;justify-content:space-between;align-items:center;height:48px}.comment-navbar .comment-navbar-item{display:flex}.comment-navbar .comment-recommend{display:flex;align-items:center;line-height:27px;height:27px;border:1px solid #656c7a;padding:0 5px;border-radius:3px;color:#656c7a;font-size:12px}.comment-navbar .comment-recommend .icon{fill:#656c7a;width:16px;height:16px}.comment-navbar .comment-recommend.voted .icon{fill:#f05f70}.comment-navbar .comment-recommend-text{margin:0 5px}.comment-navbar .comment-order-label{display:block;height:20px;line-height:20px;margin-right:10px;font-size:12px;border-radius:2px;padding:0 5px;background-color:#e7e9ee;cursor:pointer}.comment-navbar .comment-order-label:last-child{margin-right:0}.comment-navbar .comment-order-radio{display:none}.comment-navbar .comment-order-radio:checked+.comment-order-label{color:#fff;background-color:#c2c6cc}.comment-header{display:flex;justify-content:space-between;border-bottom:2px solid #e7e9ee}.comment-header .comment-header-item{height:36px;line-height:36px;font-weight:bold;font-size:15px;color:#656c7a;display:inline-block;border-bottom:2px solid #656c7a;margin-bottom:-2px;margin-right:10px;padding:0 5px}.comment-header .comment-header-item:last-child{margin-right:0;border-bottom-color:transparent}.comment-header .comment-header-item:last-child:hover{color:#2a2a2a}.comment-header #comment-user{display:none}.comment-header #comment-user:checked+.comment-user{color:#2a2a2a}.comment-header #comment-user:checked+.comment-user:after{border-top-color:#2a2a2a}.comment-header #comment-user:checked+.comment-user .comment-logout{display:block}.comment-header .comment-login{cursor:pointer}.comment-header .comment-user{cursor:pointer;position:relative;padding-right:15px}.comment-header .comment-user:after{content:\"\";display:block;position:absolute;height:0;width:0;border:5px solid transparent;border-top-color:#656c7a;top:50%;right:0;margin-top:0}.comment-header .comment-user:hover:after{border-top-color:#2a2a2a}.comment-header .comment-logout{cursor:pointer;z-index:1;display:none;position:absolute;border-radius:3px;border:2px solid #c2c6cc;width:80px;background-color:#fff;height:32px;line-height:28px;text-align:center;right:0;top:80%;color:#656c7a;font-size:13px}.comment-header .comment-logout:hover{color:#0095dd}.comment-header .comment-show{width:120px;text-align:center;position:relative;transition:all 0.2s ease-in-out;color:#2a2e2e;text-transform:capitalize;cursor:pointer;display:none}.comment-header .comment-header-count{width:120px;text-align:center;transition:all 0.2s ease-in-out;text-transform:capitalize;display:inline-block}.comment-header .comment-header-count:after{content:\" \";display:block;height:2px;position:absolute;bottom:-2px;left:0px;right:0px;background:#2e9fff}.comment-form{display:flex;flex-direction:column;width:calc(100% - 60px)}.comment-item-child .comment-form{width:calc(100% - 42px)}.placeholder{color:#7f919e;line-height:30px;font-size:12px;position:absolute;top:7px;left:10px;right:9px;white-space:nowrap;text-overflow:ellipsis;cursor:text;overflow:hidden}.comment-form-wrapper{display:flex;flex-direction:column;border:2px solid #dbdfe4;border-radius:4px;width:100%}.comment-actions{background:#f6f8f9;border-radius:0 0 2px 2px;display:flex;justify-content:space-between;height:0;transition:opacity linear .2s;opacity:0;filter:alpha(opacity=0);visibility:hidden}.comment-actions .comment-actions-group{display:flex;position:relative}.comment-actions .comment-actions-input{display:none}.comment-actions .comment-actions-input[type=\"checkbox\"]:checked+.comment-actions-label .icon{fill:#1d2f3a}.comment-actions .comment-actions-label{display:inline-block;width:34px;height:34px;cursor:pointer}.comment-actions .comment-actions-label .icon{height:18px;margin:8px;display:inline-block;color:#737474;cursor:pointer;fill:#c2c6cc;transition:all .2s}.comment-actions .comment-actions-label:hover .icon{fill:#1d2f3a !important}.comment-actions .emojione-list{cursor:default;position:absolute;opacity:0;filter:alpha(opacity=0);visibility:hidden;list-style:none;width:125px;background-color:#fff;padding:5px 0 0 5px;border-radius:2px;border:2px solid #c2c6cc;bottom:100%;left:-2px;margin-left:0;display:flex;flex-wrap:wrap}.comment-actions .emojione-item{position:relative;height:24px;width:24px;margin:0 5px 5px 0}.comment-actions .emojione-item:before{content:\"\";display:inline-block;position:absolute;left:0;top:0;bottom:0;right:0;z-index:4}.comment-actions .emojione-item-image{height:24px;width:24px}.comment-actions .comment-actions-input[type=\"checkbox\"]:checked+.emojione:before{position:fixed;top:0;left:0;width:100%;height:100%;content:\"\";display:block;cursor:default}.comment-actions .comment-actions-input[type=\"checkbox\"]:checked+.emojione .emojione-list{opacity:1;filter:alpha(opacity=100);visibility:visible !important}.expanded .comment-image{display:flex;overflow-x:auto}.expanded .comment-image .comment-image-progress{position:relative;height:80px;width:0;background:url(\"https://a.disquscdn.com/next/embed/assets/img/loader.5cc23909da9c4a9874500d7a85c4125f.gif\") center no-repeat;margin:0 5px;overflow:hidden}.expanded .comment-image .comment-image-progress:before{position:absolute;content:\"\";display:block;top:55px;bottom:20px;left:0;right:0;height:5px;width:100%;background-color:#dbdfe4}.expanded .comment-image .comment-image-progress .comment-image-loaded{position:absolute;background-color:#7f919e;top:55px;left:0;right:0;bottom:20px;height:5px;width:0}.expanded .comment-image .comment-image-list{list-style:none;display:flex}.expanded .comment-image .comment-image-item{height:80px;margin-left:5px;position:relative;border-radius:3px;overflow:hidden;flex:none}.expanded .comment-image .comment-image-item .comment-image-object{display:block;height:100%;border-radius:3px;overflow:hidden}.expanded .comment-image .comment-image-item.loading .comment-image-object{width:20px;margin:0 30px}.comment-form-wrapper.editing+.comment-form-user{opacity:1;height:auto;margin-top:10px}.comment-form-wrapper.editing .comment-form-textarea{height:74px;font-size:13.5px;line-height:16px}.comment-form-wrapper.editing .comment-image{transition:padding-bottom .15s ease-in-out;background-color:rgba(16,48,68,0.03)}.comment-form-wrapper.editing .comment-actions{transition:all 0.2s ease-in-out;border-top:solid 2px #dbdfe4;opacity:1;height:36px;filter:alpha(opacity=100);visibility:visible !important}.comment-form-wrapper.editing .comment-actions-form{transition:all .3s .5s;margin:87px -2px -2px}.comment-form-wrapper.editing .comment-form-submit{opacity:1}.comment-form-wrapper.focus{border:2px solid #c2c6cc}.comment-form-wrapper.focus .comment-actions{border-top:2px solid #c2c6cc}.comment-form-wrapper.focus .comment-actions-label .icon{fill:#656c7a}.comment-form-wrapper.focus.expanded .comment-image{border-top:2px solid #c2c6cc}.comment-form-wrapper.preview{border:2px solid #c2c6cc}.comment-form-wrapper.preview .comment-actions{border-top:2px solid #c2c6cc}.comment-form-wrapper.preview .comment-actions-label{pointer-events:none}.comment-form-wrapper.preview .comment-actions-label[for^=\"preview-input\"]{pointer-events:auto}.comment-form-wrapper.preview .comment-actions-label[for^=\"preview-input\"] .icon{fill:#656c7a}.comment-form-wrapper.expanded .comment-image{border-top:2px solid #dbdfe4;padding:10px 0 8px}.comment-form-wrapper.logged-in .comment-form-submit{border-radius:0 0 4px;transition:none;opacity:1}.comment-form-wrapper.logged-in .comment-actions-form{margin:0;transition:all .5s}.comment-form-wrapper.logged-in+.comment-form-user{height:0;opacity:0;margin-top:-40px}.comment-form-wrapper.logged-in .exit{display:block}.comment-form-wrapper .comment-form-preview{border-radius:4px;display:none;min-height:74px;padding:7px;white-space:pre-wrap}.comment-form-wrapper .comment-form-textarea{width:100%;display:block;border:none;font-size:18px;line-height:30px;border-radius:4px;color:#2a2e2e;cursor:text;resize:none;height:44px;padding:7px;transition:all .2s ease-in-out;background-color:#fefefe}.comment-form-wrapper .comment-form-textarea::-webkit-input-placeholder{color:#7f919e}.comment-form-wrapper .comment-form-textarea::-moz-placeholder{color:#7f919e}.comment-form-wrapper .comment-form-alert:not(:empty){background-color:#f05f70;padding:10px;line-height:20px;font-size:13px;font-weight:700;color:#fff;margin:0 -2px;border-top:2px solid #dbdfe4}.comment-actions-form{display:flex}.comment-actions-form .comment-form-cancel{line-height:36px;padding:0 15px;font-size:12px}.comment-actions-form .comment-form-submit{z-index:1;border:none;opacity:0;margin:-2px;white-space:nowrap;border-radius:4px;height:38px;width:80px;display:inline-block;background-color:rgba(29,47,58,0.6);cursor:pointer;line-height:38px}.comment-actions-form .comment-form-submit .icon{margin:9px;fill:#fff;cursor:pointer;width:20px;height:20px}.comment-actions-form .comment-form-submit:hover{background-color:rgba(29,47,58,0.75)}.comment-form-user{display:flex;opacity:0;transition:all .5s .2s;height:0;margin:-40px -5px 40px;overflow:hidden;line-height:32px}.comment-form-user .comment-form-guest{display:flex;flex-wrap:wrap;flex:1}.comment-form-user .comment-form-auth{height:32px}.comment-form-user .comment-form-login{background-color:transparent;border:none;height:32px;width:32px;margin:0 0 0 5px;cursor:pointer}.comment-thread-form{text-align:center;color:#656c7a;line-height:32px}.comment-thread-form .comment-form-submit{background-color:rgba(29,47,58,0.6);border:none;white-space:nowrap;border-radius:4px;height:38px;width:120px;display:inline-block;cursor:pointer;line-height:38px;margin:10px 0;color:#fff;font-size:15px}.comment-thread-form .comment-form-submit:hover{background-color:rgba(29,47,58,0.75)}.comment-form-item{display:flex;margin:10px 0}.comment-form-item .comment-form-label{display:block;height:32px;line-height:32px;color:#656c7a;width:100px;text-align:right;font-weight:bold}.comment-form-item .comment-form-textarea{background-color:#fff;border:2px solid #dbdfe4;transition:all .2s linear;padding:2px 10px;border-radius:4px;height:64px;margin:0 5px;width:30px;line-height:20px;flex:auto}.comment-form-item .comment-form-textarea:focus{border:2px solid #c2c6cc}.comment-form-input{background-color:#fff;border:2px solid #dbdfe4;transition:all .2s linear;padding:0 7px;border-radius:4px;height:32px;margin:0 5px;width:30px;line-height:32px;flex:auto}.comment-form-input::-webkit-input-placeholder{color:#7f919e}.comment-form-input::-moz-placeholder{color:#7f919e}.comment-form-input:focus{border:2px solid #c2c6cc}.comment-form-input[disabled]{color:#656c7a}.comment-list:empty:after{content:attr(data-tips);display:block;opacity:.6;line-height:80px;text-align:center}.comment-list p{margin:0}.comment-list a{text-decoration:none;color:#288ce4}.comment-list a[href=\"javascript:void(0);\"]{color:#000;cursor:default}.comment-list code{line-height:20px;font-size:12px;font-family:monaco,menlo,monospace;padding:0 .3em;display:inline-block;vertical-align:top;margin:2px}.comment-list pre{overflow-x:auto;margin:0 0 15px;border-left:4px solid #7f919e;padding:0 0 0 12px}.comment-list pre code{display:block;overflow-y:hidden;white-space:pre;line-height:1.1}.comment-list #comment-preview{opacity:.6}.comment-list .comment-item{padding-top:6px}.comment-list .comment-item-body{display:flex;margin-bottom:5px}.comment-list .comment-item-header,.comment-list .comment-item-footer{line-height:1.2;color:#c2c6cc}.comment-list .comment-item-header .comment-item-bullet,.comment-list .comment-item-footer .comment-item-bullet{padding:0 2px}.comment-list .comment-item-header{font-size:13px}.comment-list .comment-item-header .comment-item-pname{color:#656c7a;position:relative}.comment-list .comment-item-header .comment-item-pname .icon{width:12px;height:12px;margin:1px 2px;vertical-align:top;fill:#656c7a}.comment-list .comment-item-header .comment-item-pname:hover{color:#2a2e2e}.comment-list .comment-item-header .comment-item-pname:hover .icon{fill:#656c7a}.comment-list .comment-item-header .comment-item-pname:hover .comment-item-parent{display:flex}.comment-list .comment-item-header .comment-item-parent{display:none;position:absolute;border-radius:3px;border:2px solid #dbdfe4;padding:5px;width:250px;background-color:#fff;align-items:center;height:48px;top:50%;margin-top:-24px;left:15px;line-height:18px;box-shadow:0 1px 1px 0 rgba(0,0,0,0.1)}.comment-list .comment-item-header .comment-item-parent .comment-item-pmain{width:calc(100% - 42px)}.comment-list .comment-item-header .comment-item-parent .comment-item-pheader{color:#656c7a}.comment-list .comment-item-header .comment-item-parent .comment-item-pcontent{font-size:12px;padding:0;overflow:hidden;white-space:nowrap;text-overflow:ellipsis}.comment-list .comment-item-header .comment-item-badge{color:#fff;background:#7f919e;padding:1px 3px;margin:0 2px;font-size:10px;line-height:1.1;font-weight:700;border-radius:3px;display:inline-block}.comment-list .comment-item-header .comment-item-time{font-size:12px;color:#7f919e;word-spacing:-2px;font-weight:400}.comment-list .comment-item-header .comment-item-name{color:#0095dd;font-weight:700}.comment-list .comment-item-header .comment-item-name[href^=\"javascript\"]{cursor:text;color:#000}.comment-list .comment-item-footer{font-size:12px;padding:5px 0}.comment-list .comment-item-footer .comment-item-reply,.comment-list .comment-item-footer .comment-item-edit,.comment-list .comment-item-footer .comment-item-delete{color:#656c7a;font-weight:500}.comment-list .comment-item-footer .comment-item-reply:hover,.comment-list .comment-item-footer .comment-item-edit:hover,.comment-list .comment-item-footer .comment-item-delete:hover{color:#2a2e2e}.comment-list .comment-item-footer .comment-item-cancel{color:#0095dd;font-weight:700}.comment-list .comment-item-image a{display:inline-block}.comment-list .comment-item-image img{display:block;border-radius:3px;max-width:100%;max-height:480px}.comment-list iframe{width:100%}.comment-list .comment-item.transparent{opacity:.4}.comment-list .comment-item-content{padding-top:5px;letter-spacing:.5px}.comment-list .comment-item-content spoiler{display:inline;background-color:#687a86;color:transparent;white-space:pre-wrap}.comment-list .comment-item-content spoiler:hover{color:#2e2e2e;background-color:transparent}.comment-list .comment-item-content p{margin-bottom:5px}.comment-list .comment-item-content p:last-child{margin-bottom:0}.comment-list .comment-item-content a[data-dsq-mention]:before{content:\"@\"}.comment-list .comment-item-content .comment-item-content{min-height:20px}.comment-list .comment-item-content img.emojione{vertical-align:top;width:24px;height:24px;margin:0 3px}.comment-list .comment-item-children .comment-item-avatar,.comment-list .comment-item-children .comment-item-avatar img,.comment-list .comment-item-children .comment-box .comment-avatar,.comment-list .comment-item-children .comment-box .comment-avatar-image,.comment-list .comment-item-body+.comment-box .comment-avatar,.comment-list .comment-item-body+.comment-box .comment-avatar-image{width:36px;height:36px;margin-right:6px;box-shadow:0 0.5px 0.5px 0 rgba(0,0,0,0.05)}.comment-list .comment-form-textarea{height:32px;padding:5px;line-height:22px;font-size:15px}.comment-list .comment-item-main{width:calc(100% - 60px)}.comment-list .comment-item-main:empty{line-height:48px}.comment-list .comment-item-main:empty:after{content:attr(data-message);line-height:36px;color:#7f919e}.comment-list .comment-box{margin:0}.comment-list .comment-box+.comment-item-body{display:none}.comment-list .comment-item-body+.comment-box{padding-left:60px;padding-top:6px;margin-bottom:20px}.comment-list .comment-item-children{padding-left:60px}.comment-list .comment-item-children .comment-item-main{width:calc(100% - 42px)}.comment-list .comment-item-children .comment-item-main:empty{line-height:36px}.comment-list .comment-item-children .comment-item-children,.comment-list .comment-item-children .comment-item-body+.comment-box{padding-left:42px}.comment-list .comment-item-children .comment-item-children .comment-item-children .comment-item-children,.comment-list .comment-item-children .comment-item-children .comment-item-children .comment-box,.comment-list .comment-item-children .comment-item-body+.comment-box .comment-item-children .comment-item-children,.comment-list .comment-item-children .comment-item-body+.comment-box .comment-item-children .comment-box{padding-left:0}.comment-list .comment-item-loadmore{font-size:13px;text-decoration:underline;display:block;margin:10px 0}.comment-loadmore{font-weight:500;display:block;text-align:center;padding:11px 14px;background-color:rgba(29,47,58,0.6);color:#fff !important;line-height:1.1;border-radius:3px;transition:background .2s;text-shadow:none}.comment-loadmore:hover{background-color:rgba(29,47,58,0.7)}.comment-loadmore.loading{background-color:#edeff2;color:#444 !important;cursor:wait}.comment-form-error{position:absolute;background-color:#fff;padding:10px;line-height:20px;border-radius:3px;box-shadow:0 0 5px 1px rgba(0,0,0,0.3);margin-top:40px;margin-left:2px;z-index:10}.comment-form-error:before{content:\"\";display:block;position:absolute;width:10px;height:10px;transform:rotate(45deg);background-color:#fff;box-shadow:0 0 5px 1px rgba(0,0,0,0.3);top:-4px;left:15px}.comment-form-error:after{content:\"\";display:block;position:absolute;width:20px;height:12px;top:0;left:10px;background-color:#fff}.comment-list,.comment-item-children{text-align:left;list-style:none;margin-left:0;line-height:20px}.comment-avatar,.comment-item-avatar{display:block;width:48px;height:48px;margin-right:12px}.comment-avatar img,.comment-item-avatar img{border-radius:3px;width:48px;height:48px}.mention-user{background-color:#fff;border-radius:2px;box-shadow:1px 1px 2px 1px rgba(29,47,58,0.2);position:absolute;overflow:hidden}.mention-user .mention-user-list{list-style:none}.mention-user .mention-user-item{height:30px;padding:3px;line-height:24px;font-size:12px;display:flex;cursor:default}.mention-user .mention-user-item.active{background-color:#2e9fff;color:#fff}.mention-user .mention-user-item.active .mention-user-name{color:#fff}.mention-user .mention-user-avatar{width:24px;height:24px;border-radius:3px;display:block}.mention-user .mention-user-username{font-weight:600;padding-left:4px}.mention-user .mention-user-name{color:#656c7a;padding-left:4px}.comment-related{color:#444;margin-top:20px;width:100%}.comment-related .comment-related-title{font-weight:700;text-transform:uppercase;color:rgba(34,59,74,0.5);margin-bottom:5px;white-space:nowrap;text-overflow:ellipsis}.comment-related .comment-related-forumname{color:#413a3a}.comment-related .related-list{display:flex;flex-wrap:wrap;list-style:none}.comment-related .related-list .related-item{width:48%;margin-bottom:10px}.comment-related .related-list .related-item:nth-child(odd){margin-right:4%}.comment-related .related-list .related-item-link{color:#000}.comment-related .related-list .related-item-link:hover .related-item-avatar{opacity:.8}.comment-related .related-list .related-item-link:hover .related-item-name{color:#aaa}.comment-related .related-list .related-item-title{display:block;overflow:hidden;font-weight:700}.comment-related .related-list .related-item-desc{color:rgba(30,55,70,0.4);font-weight:500;font-size:12px}.comment-related .related-list .related-item-post{padding:5px 0;display:flex}.comment-related .related-list .related-item-avatar{width:30px;height:30px;margin-right:5px;flex:none}.comment-related .related-list .related-item-avatar img{display:block;width:100%;border-radius:3px}.comment-related .related-list .related-item-main{flex:1;height:30px;line-height:15px;overflow:hidden;font-size:13px}.comment-related .related-list .related-item-name{color:rgba(30,55,70,0.4);font-weight:600}.comment-related .related-list .related-item-message{white-space:nowrap;overflow:hidden;text-overflow:ellipsis}.comment-reaction{display:flex;flex-direction:column}.comment-reaction .comment-reaction-header{text-align:center;line-height:25px}.comment-reaction .comment-reaction-list{display:flex;justify-content:center;list-style-type:none;flex-wrap:wrap;align-items:center}.comment-reaction .comment-reaction-list:not(:empty){padding:10px 0}.comment-reaction .comment-reaction-list .comment-reaction-item{display:flex;flex-direction:column;justify-content:center;align-items:center;font-size:12px;color:#656c7a;margin-right:10px}.comment-reaction .comment-reaction-list .comment-reaction-item:last-child{margin-right:0}.comment-reaction .comment-reaction-list .comment-reaction-btn{display:flex;align-items:center;padding:0 5px;border:1px solid #c2c6cc;border-radius:3px;height:30px;line-height:30px;max-width:100px;color:#656c7a}.comment-reaction .comment-reaction-list .comment-reaction-btn.selected{border-color:#656c7a}.comment-reaction .comment-reaction-list .comment-reaction-count{padding:5px 0}.comment-reaction .comment-reaction-list .comment-reaction-text{margin-left:5px}.comment-reaction .comment-reaction-list img{width:20px;height:20px}@-webkit-keyframes disqus-loader-spinner-animation{0%{transform:rotate(0)}100%{transform:rotate(360deg)}}@keyframes disqus-loader-spinner-animation{0%{transform:rotate(0)}100%{transform:rotate(360deg)}}@media screen and (max-width: 450px){.comment-reaction-text{display:none}.comment-form-wrapper.editing .comment-actions-form{margin:180px 0 0}.comment-form-wrapper.logged-in .comment-actions-form{margin:0}.comment-item .at{display:none}.comment-item .comment-avatar{display:none}.comment-item .comment-form{width:100%}.comment-item .comment-item-children .comment-item-children,.comment-item .comment-item-children .comment-box{padding-left:0 !important}.comment-item .comment-item-children .comment-item-avatar{display:none}.comment-item .comment-item-children .comment-item-main,.comment-item .comment-item-children .comment-form{width:100%}.comment-form-user{line-height:42px}.comment-form-user .comment-form-auth{margin:5px}.comment-form-user .comment-form-input{margin:5px;width:100%}.comment-related .related-list .related-item{width:100%;padding-left:10px}}\n"],"sourceRoot":""} \ No newline at end of file
diff --git a/static/js/iDisqus.js b/static/js/iDisqus.js
index ee325e2..19f658c 100644
--- a/static/js/iDisqus.js
+++ b/static/js/iDisqus.js
@@ -1,1591 +1,178 @@
-/*!
- * v 0.2.11
- *
- * https://github.com/fooleap/disqus-php-api
- *
- * Copyright 2017-2018 fooleap
- * Released under the MIT license
- */
-(function (global) {
- 'use strict';
-
- var d = document,
- l = localStorage,
- scripts = d.scripts,
- lasturl = scripts[scripts.length - 1].src,
- filepath = lasturl.substring(0, lasturl.lastIndexOf('/')),
- isEdge = navigator.userAgent.indexOf("Edge") > -1,
- isIE = !!window.ActiveXObject || "ActiveXObject" in window;
-
- function getLocation(href) {
- var link = d.createElement('a');
- link.href = href;
- return link;
- }
-
- function getAjax(url, success, error) {
- var xhr = new XMLHttpRequest();
- xhr.open ('GET', encodeURI(url));
- xhr.onreadystatechange = function() {
- if (xhr.readyState == 4 && xhr.status == 200) {
- success(xhr.responseText);
- }
- }
- xhr.onerror = error;
- xhr.withCredentials = true;
- xhr.send();
- return xhr;
- }
-
- function postAjax(url, data, success, error) {
- var params = typeof data == 'string' ? data : Object.keys(data).map(
- function(k){ return encodeURIComponent(k) + '=' + encodeURIComponent(data[k]) }
- ).join('&');
-
- var xhr = new XMLHttpRequest();
- xhr.open('POST', url);
- xhr.onreadystatechange = function() {
- if (xhr.readyState == 4 && xhr.status == 200) {
- success(xhr.responseText);
- }
- };
- xhr.onerror = error;
- xhr.withCredentials = true;
- xhr.setRequestHeader('Content-Type', 'application/x-www-form-urlencoded');
- xhr.send(params);
- return xhr;
- }
-
- // matches & closest polyfill https://github.com/jonathantneal/closest
- (function (ElementProto) {
- if (typeof ElementProto.matches !== 'function') {
- ElementProto.matches = ElementProto.msMatchesSelector || ElementProto.mozMatchesSelector || ElementProto.webkitMatchesSelector || function matches(selector) {
- var element = this;
- var elements = (element.document || element.ownerDocument).querySelectorAll(selector);
- var index = 0;
-
- while (elements[index] && elements[index] !== element) {
- ++index;
- }
-
- return Boolean(elements[index]);
- };
- }
-
- if (typeof ElementProto.closest !== 'function') {
- ElementProto.closest = function closest(selector) {
- var element = this;
-
- while (element && element.nodeType === 1) {
- if (element.matches(selector)) {
- return element;
- }
-
- element = element.parentNode;
- }
-
- return null;
- };
- }
- })(window.Element.prototype);
-
- // 访客信息
- var User = function () {
- this.dom = arguments[0];
- this.opts = arguments[1];
- this.init();
- this.autologin();
- }
-
- User.prototype = {
- // 初始化访客信息
- init: function(){
- var _ = this;
- // 读取访客信息
- _.name = l.getItem('name');
- _.email = l.getItem('email');
- _.url = l.getItem('url');
- _.avatar = l.getItem('avatar');
- _.type = l.getItem('type');
- _.logged_in = l.getItem('logged_in');
-
- var boxarr = _.dom.getElementsByClassName('comment-box');
- if( _.logged_in == 'true' ) {
- [].forEach.call(boxarr,function(item){
- if(_.type == '1'){
- item.querySelector('.comment-form-wrapper').classList.add('logged-in');
- }
- item.querySelector('.comment-form-name').value = _.name;
- item.querySelector('.comment-form-email').value = _.email;
- item.querySelector('.comment-form-url').value = _.url;
- item.querySelector('.comment-avatar-image').src = _.avatar;
- });
- } else {
- [].forEach.call(boxarr,function(item){
- item.querySelector('.comment-form-wrapper').classList.remove('logged-in');
- item.querySelector('.comment-form-name').value = '';
- item.querySelector('.comment-form-email').value = '';
- item.querySelector('.comment-form-url').value = '';
- item.querySelector('.comment-avatar-image').src = _.dom.querySelector('.comment-avatar-image').dataset.avatar;
- });
- l.setItem('logged_in', 'false');
- }
- },
-
- // 自动登录
- autologin: function(){
- var _ = this;
- getAjax( _.opts.api +'/user.php', function(resp){
- var data = JSON.parse(resp);
- if( data.code == 0 ){
- _.submit(data.response);
- } else {
- if( _.type == '1' ){
- l.setItem('logged_in', 'false');
- _.init();
- }
- }
- }, function(){
- })
- },
-
- // 登录
- login: function(){
-
- var _ = this;
- var popup = window.open(_.opts.api+'/login.php', 'Disqus Oauth', 'width=470,height=508');
- var timer;
- function isLogged(){
- if (!popup || !popup.closed) return;
- clearInterval(timer);
- _.user.autologin();
- }
- timer = setInterval(isLogged, 100);
-
- },
-
- // 退出登录
- logout: function(){
- var _ = this;
- postAjax( _.opts.api + '/logout.php', {}, function(resp){
- l.setItem('logged_in', 'false');
- l.removeItem('type');
- l.removeItem('email');
- l.removeItem('avatar');
- l.removeItem('name');
- l.removeItem('url');
- _.user.init();
- })
- },
-
- // 提交访客信息
- submit: function(user){
- l.setItem('email', user.email);
- l.setItem('type', user.type);
- l.setItem('name', user.name);
- l.setItem('url', user.url);
- l.setItem('avatar', user.avatar);
- l.setItem('logged_in', 'true');
- this.init();
- }
- }
-
- var iDisqus = function () {
- var _ = this;
-
- // 配置
- _.opts = typeof(arguments[1]) == 'object' ? arguments[1] : arguments[0];
- _.dom = d.getElementById(typeof(arguments[0]) == 'string' ? arguments[0] : 'comment');
- _.opts.api = _.opts.api.slice(-1) == '/' ? _.opts.api.slice(0,-1) : _.opts.api;
- _.opts.site = _.opts.site || location.origin;
- if(!!_.opts.url){
- var optsUrl = _.opts.url.replace(_.opts.site, '');
- _.opts.url = optsUrl.slice(0, 1) != '/' ? '/' + optsUrl : optsUrl;
- } else if(isEdge || isIE) {
- _.opts.url = encodeURI(location.pathname) + encodeURI(location.search);
- } else {
- _.opts.url = location.pathname + location.search;
- }
- _.opts.identifier = _.opts.identifier || _.opts.url;
- _.opts.link = _.opts.site + _.opts.url;
- _.opts.title = _.opts.title || d.title;
- _.opts.slug = !!_.opts.slug ? _.opts.slug.replace(/[^A-Za-z0-9_-]+/g,'') : '';
- _.opts.desc = _.opts.desc || (!!d.querySelector('[name="description"]') ? d.querySelector('[name="description"]').content : '');
- _.opts.mode = _.opts.mode || 1;
- _.opts.timeout = _.opts.timeout || 3000;
- _.opts.toggle = !!_.opts.toggle ? d.getElementById(_.opts.toggle) : null;
- _.opts.autoCreate = !!_.opts.autoCreate || !!_.opts.auto;
-
- // emoji 表情
- _.opts.emojiPath = _.opts.emojiPath || _.opts.emoji_path || 'https://cdn.jsdelivr.net/emojione/assets/png/';
- _.emojiList = _.opts.emojiList || _.opts.emoji_list || [{
- code:'smile',
- title:'笑脸',
- unicode:'1f604'
- },{
- code:'mask',
- title:'生病',
- unicode:'1f637'
- },{
- code:'joy',
- title:'破涕为笑',
- unicode:'1f602'
- },{
- code:'stuck_out_tongue_closed_eyes',
- title:'吐舌',
- unicode:'1f61d'
- },{
- code:'flushed',
- title:'脸红',
- unicode:'1f633'
- },{
- code:'scream',
- title:'恐惧',
- unicode:'1f631'
- },{
- code:'pensive',
- title:'失望',
- unicode:'1f614'
- },{
- code:'unamused',
- title:'无语',
- unicode:'1f612'
- },{
- code:'grin',
- title:'露齿笑',
- unicode:'1f601'
- },{
- code:'heart_eyes',
- title:'色',
- unicode:'1f60d'
- },{
- code:'sweat',
- title:'汗',
- unicode:'1f613'
- },{
- code:'smirk',
- title:'得意',
- unicode:'1f60f'
- },{
- code:'relieved',
- title:'满意',
- unicode:'1f60c'
- },{
- code:'rolling_eyes',
- title:'翻白眼',
- unicode:'1f644'
- },{
- code:'ok_hand',
- title:'OK',
- unicode:'1f44c'
- },{
- code:'v',
- title:'胜利',
- unicode:'270c'
- }];
-
- if(!!_.opts.emoji_preview || !!_.opts.emojiPreview ){
- getAjax(_.opts.api +'/eac.min.php', function(resp){
- _.eac = JSON.parse(resp);
- }, function(){
- })
- }
-
- // 默认状态
- _.stat = {
- current: 'idisqus', // 当前显示评论框
- loaded: false, // 评论框已加载
- loading: false, // 评论加载中
- editing: false, // 评论编辑中
- offsetTop: 0, // 高度位置
- thread: null, // 本页 thread id
- next: null, // 下条评论
- message: null, // 新评论
- mediaHtml: null, // 新上传图片
- root: [], // 根评论
- count: 0, // 评论数
- users: [], // Disqus 会员
- imageSize: [], // 已上传图片大小
- disqusLoaded: false // Disqus 已加载
- };
-
- // Disqus 评论框设置
- window.disqus_config = function () {
- this.page.identifier = _.opts.identifier;
- this.page.title = _.opts.title;
- this.page.url = _.opts.link;
- this.callbacks.onReady.push(function() {
- _.stat.current = 'disqus';
- _.stat.disqusLoaded = true;
- _.dom.querySelector('#idisqus').style.display = 'none';
- _.dom.querySelector('#disqus_thread').style.display = 'block';
- if( _.opts.mode == 3 && !!_.opts.toggle) {
- _.opts.toggle.disabled = '';
- _.opts.toggle.checked = true;
- _.opts.toggle.addEventListener('change', _.handle.toggle, false);
- }
- });
- }
-
- // 自动初始化
- if( !!_.opts.init ){
- _.init();
- //console.log(_);
- }
- }
-
- // TimeAgo https://coderwall.com/p/uub3pw/javascript-timeago-func-e-g-8-hours-ago
- iDisqus.prototype.timeAgo = function() {
-
- var _ = this;
- var templates = {
- prefix: "",
- suffix: "前",
- seconds: "几秒",
- minute: "1分钟",
- minutes: "%d分钟",
- hour: "1小时",
- hours: "%d小时",
- day: "1天",
- days: "%d天",
- month: "1个月",
- months: "%d个月",
- year: "1年",
- years: "%d年"
- };
- var template = function (t, n) {
- return templates[t] && templates[t].replace(/%d/i, Math.abs(Math.round(n)));
- };
-
- var timer = function (time) {
- if (!time) return;
- time = time.replace(/\.\d+/, ""); // remove milliseconds
- time = time.replace(/-/, "/").replace(/-/, "/");
- time = time.replace(/T/, " ").replace(/Z/, " UTC");
- time = time.replace(/([\+\-]\d\d)\:?(\d\d)/, " $1$2"); // -04:00 -> -0400
- time = new Date(time * 1000 || time);
-
- var now = new Date();
- var seconds = ((now.getTime() - time) * .001) >> 0;
- var minutes = seconds / 60;
- var hours = minutes / 60;
- var days = hours / 24;
- var years = days / 365;
-
- return templates.prefix + ( seconds < 45 && template('seconds', seconds) || seconds < 90 && template('minute', 1) || minutes < 45 && template('minutes', minutes) || minutes < 90 && template('hour', 1) || hours < 24 && template('hours', hours) || hours < 42 && template('day', 1) || days < 30 && template('days', days) || days < 45 && template('month', 1) || days < 365 && template('months', days / 30) || years < 1.5 && template('year', 1) || template('years', years)) + templates.suffix;
- };
-
- var elements = _.dom.querySelectorAll('.comment-item-time');
- for (var i in elements) {
- var $this = elements[i];
- if (typeof $this === 'object') {
- $this.title = new Date($this.getAttribute('datetime'));
- $this.innerHTML = timer($this.getAttribute('datetime'));
- }
- }
-
- // update time every minute
- setTimeout(_.timeAgo.bind(_), 60000);
-
- }
-
- // 初始化评论框
- iDisqus.prototype.init = function(){
- var _ = this;
- if(!_.dom){
- //console.log('该页面没有评论框!');
- return
- }
- // 表情
- var emojiList = '';
- _.emojiList.forEach(function(item){
- emojiList += '<li class="emojione-item" title="'+ item.title+'" data-code=":'+item.code+':"><img class="emojione-item-image" src="'+_.opts.emojiPath + item.unicode+'.png" /></li>';
- })
- _.dom.innerHTML = '<div class="comment loading" id="idisqus">\n'+
- ' <div class="loading-container" data-tip="正在加载评论……"><svg class="loading-bg" width="72" height="72" viewBox="0 0 720 720" version="1.1" xmlns="http://www.w3.org/2000/svg"><path class="ring" fill="none" stroke="#9d9ea1" d="M 0 -260 A 260 260 0 1 1 -80 -260" transform="translate(400,400)" stroke-width="50" /><polygon transform="translate(305,20)" points="50,0 0,100 18,145 50,82 92,145 100,100" style="fill:#9d9ea1"/></svg></div>\n'+
- ' <div class="comment-header"><span class="comment-header-item" id="comment-count">评论</span><a target="_blank" class="comment-header-item" id="comment-link">Disqus 讨论区</a></div>\n'+
- ' <div class="comment-box">\n'+
- ' <div class="comment-avatar avatar"><img class="comment-avatar-image" src="//a.disquscdn.com/images/noavatar92.png" data-avatar="//a.disquscdn.com/images/noavatar92.png"></div>\n'+
- ' <div class="comment-form">\n'+
- ' <div class="comment-form-wrapper">\n'+
- ' <textarea class="comment-form-textarea" placeholder="加入讨论……"></textarea>\n'+
- ' <div class="comment-form-alert"></div>\n'+
- ' <div class="comment-image">\n'+
- ' <ul class="comment-image-list"></ul>\n'+
- ' <div class="comment-image-progress">\n'+
- ' <div class="comment-image-loaded"></div>\n'+
- ' </div>\n'+
- ' </div>\n'+
- ' <div class="comment-actions">\n'+
- ' <div class="comment-actions-group">\n'+
- ' <input id="emoji-input" class="comment-actions-input" type="checkbox"> \n'+
- ' <label class="comment-actions-label emojione" for="emoji-input">\n'+
- ' <svg class="icon" fill="#c2c6cc" viewBox="0 0 1024 1024" version="1.1" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" width="200" height="200">\n'+
- ' <g>\n'+
- ' <title>选择表情</title>\n'+
- ' <path d="M512 1024c-282.713043 0-512-229.286957-512-512s229.286957-512 512-512c282.713043 0 512 229.286957 512 512S792.486957 1024 512 1024zM512 44.521739c-258.226087 0-467.478261 209.252174-467.478261 467.478261 0 258.226087 209.252174 467.478261 467.478261 467.478261s467.478261-209.252174 467.478261-467.478261C979.478261 253.773913 768 44.521739 512 44.521739z"></path>\n'+
- ' <path d="M801.391304 554.295652c0 160.278261-129.113043 289.391304-289.391304 289.391304s-289.391304-129.113043-289.391304-289.391304L801.391304 554.295652z"></path>\n'+
- ' <path d="M674.504348 349.495652m-57.878261 0a2.6 2.6 0 1 0 115.756522 0 2.6 2.6 0 1 0-115.756522 0Z"></path>\n'+
- ' <path d="M347.269565 349.495652m-57.878261 0a2.6 2.6 0 1 0 115.756522 0 2.6 2.6 0 1 0-115.756522 0Z"></path>\n'+
- ' </g>\n'+
- ' </svg>\n'+
- ' <ul class="emojione-list">'+emojiList+'</ul>\n'+
- ' </label>\n'+
- ' <input id="upload-input" class="comment-actions-input comment-image-input" type="file" accept="image/*" name="file"> \n'+
- ' <label class="comment-actions-label" for="upload-input">\n'+
- ' <svg class="icon" fill="#c2c6cc" viewBox="0 0 1024 1024" version="1.1" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" width="200" height="200">\n'+
- ' <g>\n'+
- ' <title>上传图片</title>\n'+
- ' <path d="M15.515152 15.515152 15.515152 15.515152 15.515152 15.515152Z"></path>\n'+
- ' <path d="M15.515152 139.636364l0 806.787879 992.969697 0 0-806.787879-992.969697 0zM946.424242 884.363636l-868.848485 0 0-682.666667 868.848485 0 0 682.666667zM698.181818 356.848485c0-51.417212 41.673697-93.090909 93.090909-93.090909s93.090909 41.673697 93.090909 93.090909c0 51.417212-41.673697 93.090909-93.090909 93.090909s-93.090909-41.673697-93.090909-93.090909zM884.363636 822.30303l-744.727273 0 186.181818-496.484848 248.242424 310.30303 124.121212-93.090909z"></path>\n'+
- ' </g>\n'+
- ' </svg>\n'+
- ' </label>\n'+
- ' </div>\n'+
- ' <div class="comment-actions-form">\n'+
- ' <label class="comment-actions-label exit" title="退出登录">\n'+
- ' <svg class="icon" fill="#c2c6cc" viewBox="0 0 1024 1024" version="1.1" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" width="48" height="48">\n'+
- ' <path d="M348.870666 210.685443l378.570081 0c32.8205 0 58.683541 26.561959 58.683541 58.683541 0 162.043606 0 324.804551 0 486.848157 0 32.81129-26.561959 58.674331-58.683541 58.674331L348.870666 814.891472c-10.477632 0-18.850323-8.363482-18.850323-18.841114l0-37.728276c0-10.477632 8.372691-18.841114 18.850323-18.841114l343.645664 0c10.477632 0 18.850323-8.372691 18.850323-18.850323L711.366653 304.983109c0-10.477632-8.372691-18.841114-18.850323-18.841114L348.870666 286.141996c-10.477632 0-18.850323-8.363482-18.850323-18.841114l0-37.728276C329.98248 219.095997 338.393034 210.685443 348.870666 210.685443z"></path>\n'+
- ' <path d="M128.152728 526.436804l112.450095 112.450095c6.985088 6.985088 19.567661 6.985088 26.552749 0l26.561959-26.561959c6.985088-6.985088 6.985088-19.567661 0-26.552749l-34.925441-34.925441L494.168889 550.84675c10.477632 0 18.850323-8.372691 18.850323-18.850323l0-37.719066c0-10.477632-8.372691-18.850323-18.850323-18.850323L258.754229 475.427036l34.925441-34.925441c6.985088-6.985088 6.985088-19.567661 0-26.552749l-26.561959-26.524097c-6.985088-6.985088-19.567661-6.985088-26.552749 0L128.152728 499.875868C120.431883 506.859933 120.431883 519.451716 128.152728 526.436804z"></path>\n'+
- ' </svg>\n'+
- ' </label>\n'+
- ' <button class="comment-form-submit">\n'+
- ' <svg class="icon" viewBox="0 0 1024 1024" version="1.1" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" width="200" height="200">\n'+
- ' <path d="M565.747623 792.837176l260.819261 112.921839 126.910435-845.424882L66.087673 581.973678l232.843092 109.933785 562.612725-511.653099-451.697589 563.616588-5.996574 239.832274L565.747623 792.837176z" fill="#ffffff"></path>\n'+
- ' </svg>\n'+
- ' </button>\n'+
- ' </div>\n'+
- ' </div>\n'+
- ' </div>\n'+
- ' <div class="comment-form-user">'+ ( _.opts.mode != 1 ? '<div class="comment-form-auth"><button class="comment-form-login" title="使用 Disqus 帐号登录"><svg xmlns="http://www.w3.org/2000/svg" width="32" height="32" viewBox="0 0 200 200"><path fill="#2E9FFF" d="M102.535 167.5c-16.518 0-31.621-6.036-43.298-16.021L30.5 155.405l11.102-27.401A67.658 67.658 0 0 1 35.564 100c0-37.277 29.984-67.5 66.971-67.5 36.984 0 66.965 30.223 66.965 67.5 0 37.284-29.98 67.5-66.965 67.5zm36.567-67.693v-.188c0-19.478-13.736-33.367-37.42-33.367h-25.58v67.5h25.201c23.868.001 37.799-14.468 37.799-33.945zm-37.138 17.361h-7.482V82.841h7.482c10.989 0 18.283 6.265 18.283 17.07v.188c0 10.896-7.294 17.069-18.283 17.069z"/></svg></button></div><span> 或 </span>' : '' ) + '<div class="comment-form-guest"><input class="comment-form-input comment-form-name" type="text" name="name" placeholder="名字(必填)" autocomplete="name"><input class="comment-form-input comment-form-email" type="email" name="email" placeholder="邮箱(必填)" autocomplete="email"><input class="comment-form-input comment-form-url" type="url" name="url" placeholder="网址(可选)" autocomplete="url"></div></div>\n'+
- ' </div>\n'+
- ' </div>\n'+
- ' <ul id="comments" class="comment-list"></ul>\n'+
- ' <a href="javascript:;" class="comment-loadmore">加载更多</a>\n'+
- '</div>\n'+
- '<div class="comment" id="disqus_thread"></div>';
-
- _.user = new User(_.dom,_.opts);
- _.box = _.dom.querySelector('.comment-box').outerHTML.replace(/<label class="comment-actions-label exit"(.|\n)*<\/label>\n/,'').replace('comment-form-wrapper','comment-form-wrapper editing').replace(/加入讨论……/,'');
- _.handle = {
- logout: _.user.logout.bind(_),
- login: _.user.login.bind(_),
- loadMore: _.loadMore.bind(_),
- post: _.post.bind(_),
- postThread: _.postThread.bind(_),
- remove: _.remove.bind(_),
- show: _.show.bind(_),
- toggle: _.toggle.bind(_),
- upload: _.upload.bind(_),
- verify: _.verify.bind(_),
- jump: _.jump.bind(_),
- mention: _.mention.bind(_),
- keySelect: _.keySelect.bind(_),
- field: _.field,
- focus: _.focus,
- input: _.input
- };
-
- switch(_.opts.mode){
- case 1:
- _.disqus();
- break;
- case 2:
- _.getlist();
- break;
- case 3:
- _.getlist();
- _.disqus();
- break;
- default:
- _.disqus();
- break;
- }
- }
-
- // 切换评论框
- iDisqus.prototype.toggle = function(){
- var _ = this;
- if( _.stat.current == 'disqus' ){
- _.stat.current = 'idisqus';
- _.dom.querySelector('#idisqus').style.display = 'block';
- _.dom.querySelector('#disqus_thread').style.display = 'none';
- } else {
- _.disqus();
- }
- }
-
- // 加载 Disqus 评论
- iDisqus.prototype.disqus = function(){
- var _ = this;
- var _tip = _.dom.querySelector('.loading-container').dataset.tip;
- //if(_.opts.site != location.origin){
- // //console.log('本地环境不加载 Disqus 评论框!');
- // if( _.opts.mode == 1 ){
- // _.getlist();
- // }
- // return;
- //}
- if(!_.stat.disqusLoaded ){
- _tip = '尝试连接 Disqus……';
-
- var s = d.createElement('script');
- s.src = '//'+_.opts.forum+'.disqus.com/embed.js';
- s.dataset.timestamp = Date.now();
- s.onload = function(){
- _.stat.disqusLoaded = true;
- _tip = '连接成功,加载 Disqus 评论框……'
- }
- s.onerror = function(){
- if( _.opts.mode == 1){
- _tip = '连接失败,加载简易评论框……';
- _.getlist();
- }
- }
-
- var xhr = new XMLHttpRequest();
- xhr.open('GET', '//disqus.com/next/config.json?' + Date.now(), true);
- xhr.timeout = _.opts.timeout;
- xhr.onreadystatechange = function () {
- if (xhr.readyState == 4 && xhr.status == 200) {
- (d.head || d.body).appendChild(s);
- }
- }
- xhr.ontimeout = function () {
- xhr.abort();
- if( _.opts.mode == 1){
- _tip = '连接超时,加载简易评论框……';
- _.getlist();
- }
- }
- xhr.onerror = function() {
- if( _.opts.mode == 1){
- _tip = '连接失败,加载简易评论框……';
- _.getlist();
- }
- }
- xhr.send();
- } else {
- _.stat.current = 'disqus';
- _.dom.querySelector('#idisqus').style.display = 'none';
- _.dom.querySelector('#disqus_thread').style.display = 'block';
- }
- }
-
- // 添加事件监听
- iDisqus.prototype.addListener = function (els, evt, func){
- var _ = this;
- var el = _.dom.getElementsByClassName(els);
- [].forEach.call(el, function(item){
- item.addEventListener(evt, func, false);
- });
- }
-
- // 移除事件监听
- iDisqus.prototype.removeListener = function (els, evt, func){
- var _ = this;
- var el = _.dom.getElementsByClassName(els);
- [].forEach.call(el, function(item){
- item.removeEventListener(evt, func, false);
- });
- }
-
- // 添加所有事件监听
- iDisqus.prototype.addAllListeners = function (){
- var _ = this;
- _.addListener('exit', 'click', _.handle.logout);
- _.addListener('comment-form-textarea', 'blur', _.handle.focus);
- _.addListener('comment-form-textarea', 'focus', _.handle.focus);
- _.addListener('comment-form-textarea', 'input', _.handle.input);
- _.addListener('comment-form-textarea', 'keyup', _.handle.mention);
- _.addListener('comment-form-email', 'blur', _.handle.verify);
- _.addListener('comment-form-submit', 'click', _.handle.post);
- _.addListener('comment-form-login', 'click', _.handle.login);
- _.addListener('comment-image-input', 'change', _.handle.upload);
- _.addListener('emojione-item', 'click', _.handle.field);
- }
-
- // 评论计数
- iDisqus.prototype.count = function (){
- var _ = this;
- var counts = d.querySelectorAll('[data-disqus-url]');
- var qty = counts.length;
- if(qty > 0){
- var commentArr = [];
- for( var i = 0; i < qty; i++){
- commentArr[i] = counts[i].dataset.disqusUrl.replace(_.opts.site, '');
- }
- getAjax(
- _.opts.api + '/count.php?links=' + commentArr.join(','),
- function(resp) {
- var data = JSON.parse(resp);
- var posts = data.response;
- posts.forEach(function(item){
- var link = document.createElement('a');
- link.href = item.link;
- var itemLink = link.href.replace(link.origin, '');
- var el = d.querySelector('[data-disqus-url$="'+itemLink+'"]')
- if(!!el ){
- el.innerHTML = item.posts;
- el.dataset.disqusCount = item.posts;
- }
- });
- }, function(){
- console.log('获取数据失败!')
- }
- );
- }
- };
-
- // 热门评论
- iDisqus.prototype.popular = function(){
- var _ = this;
- if(!!_.opts.popular){
- getAjax(
- _.opts.api + '/popular.php',
- function(resp) {
- var data = JSON.parse(resp);
- if(data.code == 0){
- var posts = data.response;
- var postsHtml = '';
- posts.forEach(function(item){
- postsHtml += '<li><a href="' + item.link.replace(_.opts.site, '') + '" title="' + item.title + '">' + item.title + '</a></li>';
- });
- _.opts.popular.innerHTML = postsHtml;
- }
- },function(){
- console.log('获取数据失败!')
- }
- );
- }
- }
-
- // 获取评论列表
- iDisqus.prototype.getlist = function(){
- var _ = this;
- _.stat.loading = true;
- _.dom.querySelector('#idisqus').style.display = 'block';
- _.dom.querySelector('#disqus_thread').style.display = 'none';
- getAjax(
- _.opts.api + '/getcomments.php?ident=' + _.opts.identifier + (!!_.stat.next ? '&cursor=' + _.stat.next : ''),
- function(resp){
- var data = JSON.parse(resp);
- if (data.code === 0) {
- _.stat.offsetTop = d.documentElement.scrollTop || d.body.scrollTop;
- _.stat.thread = data.thread;
- _.stat.count = data.posts;
- _.opts.avatar = data.forum.avatar;
- _.dom.querySelector('.comment-avatar-image').dataset.avatar = data.forum.avatar;
- if( _.user.logged_in == 'false' ){
- _.dom.querySelector('.comment-avatar-image').src = data.forum.avatar;
- }
- _.opts.badge = data.forum.moderatorBadgeText;
- _.dom.querySelector('#idisqus').classList.remove('loading');
- _.dom.querySelector('#comment-link').href = data.link;
- _.dom.querySelector('#comment-count').innerHTML = _.stat.count + ' 条评论';
- var loadmore = _.dom.querySelector('.comment-loadmore');
- var posts = !!data.response ? data.response : [];
- _.stat.root = [];
- posts.forEach(function(item){
- _.load(item);
- if(!item.parent){
- _.stat.root.unshift(item.id);
- }
- });
-
- if ( data.cursor.hasPrev ){
- _.stat.root.forEach(function(item){
- _.dom.querySelector('.comment-list').appendChild(_.dom.querySelector('#comment-' + item));
- })
- } else {
- loadmore.addEventListener('click', _.handle.loadMore, false);
- _.addAllListeners();
- }
- if ( data.cursor.hasNext ){
- _.stat.next = data.cursor.next;
- loadmore.classList.remove('loading');
- } else {
- _.stat.next = null;
- loadmore.classList.add('hide');
- }
- if (posts.length == 0) {
- return;
- }
-
- window.scrollTo(0, _.stat.offsetTop);
-
- _.timeAgo();
-
- if (/^#disqus|^#comment-/.test(location.hash) && !data.cursor.hasPrev && !_.stat.disqusLoaded && !_.stat.loaded) {
- var el = _.dom.querySelector('#idisqus ' + location.hash)
- if( !!el ){
- window.scrollBy(0, el.getBoundingClientRect().top);
- }
- }
- _.stat.loading = false;
- _.stat.loaded = true;
- } else if ( data.code === 2 ){
- _.create();
- }
- },function(){
- alert('获取数据失败,请检查服务器设置。')
- }
- );
- }
-
- // 读取评论
- iDisqus.prototype.load = function(post){
-
- var _ = this;
-
- var parentPostDom = _.dom.querySelector('.comment-item[data-id="'+post.parent+'"]');
-
- var user = {
- username: post.username,
- name: post.name,
- avatar: post.avatar
- }
- if(!!post.username && _.stat.users.map(function(user) { return user.username; }).indexOf(post.username) == -1){
- _.stat.users.push(user);
- }
-
- var parentPost = !!post.parent ? {
- name: '<a class="comment-item-pname" href="#'+parentPostDom.id+'"><svg class="icon" viewBox="0 0 1024 1024" version="1.1" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" width="200" height="200"><path d="M1.664 902.144s97.92-557.888 596.352-557.888V129.728L1024 515.84l-425.984 360.448V628.8c-270.464 0-455.232 23.872-596.352 273.28"></path></svg>' + parentPostDom.dataset.name + '</a>',
- dom: parentPostDom.querySelector('.comment-item-children'),
- insert: 'afterbegin'
- } : {
- name: '',
- dom: _.dom.querySelector('.comment-list'),
- insert: post.id == 'preview' || !!post.isPost ? 'afterbegin' : 'beforeend'
- };
-
- var mediaHTML = '';
- if( post.media.length == 1 ){
- mediaHTML = '<div class="comment-item-images"><a class="comment-item-image" target="_blank" href="' + post.media[0] + '" style="background-image: url('+post.media[0]+');width: 167px;height: 167px"></a></div>';
- } else if( post.media.length > 1 ){
- post.media.forEach(function(item){
- mediaHTML += '<a class="comment-item-image" target="_blank" href="' + item + '" style="background-image: url('+item+')"></a>';
- })
- mediaHTML = '<div class="comment-item-images">' + mediaHTML + '</div>';
- }
-
- var html = '<li class="comment-item" data-id="' + post.id + '" data-name="'+ post.name + '" id="comment-' + post.id + '">' +
- '<div class="comment-item-body">'+
- '<a class="comment-item-avatar" href="#comment-'+post.id+'"><img src="' + post.avatar + '"></a>'+
- '<div class="comment-item-main">'+
- '<div class="comment-item-header"><a class="comment-item-name" title="' + post.name + '" rel="nofollow" target="_blank" href="' + ( post.url ? post.url : 'javascript:;' ) + '">' + post.name + '</a>'+ (post.isMod ?'<span class="comment-item-badge">'+_.opts.badge+'</span>' :'')+parentPost.name+'<span class="comment-item-bullet"> • </span><time class="comment-item-time" datetime="' + post.createdAt + '"></time></div>'+
- '<div class="comment-item-content">' + post.message + mediaHTML + '</div>'+
- '<div class="comment-item-footer">' + (!!post.isPost ? '<span class="comment-item-manage"><a class="comment-item-edit" href="javascript:;">编辑</a><span class="comment-item-bullet"> • </span><a class="comment-item-delete" href="javascript:;">删除</a><span class="comment-item-bullet"> • </span></span>' : '') + '<a class="comment-item-reply" href="javascript:;">回复</a> </div>'+
- '</div></div>'+
- '<ul class="comment-item-children"></ul>'+
- '</li>';
-
- // 已删除评论
- if(!!post.isDeleted){
- html = '<li class="comment-item" data-id="' + post.id + '" id="comment-' + post.id + '" data-name="已删除">' +
- '<div class="comment-item-body">'+
- '<a class="comment-item-avatar" href="#comment-'+post.id+'"><img src="' + post.avatar + '"></a>'+
- '<div class="comment-item-main" data-message="此评论已被删除。"></div></div>'+
- '<ul class="comment-item-children"></ul>'+
- '</li>';
- }
-
-
- // 更新 or 创建
- if(!!_.dom.querySelector('.comment-item[data-id="' + post.id + '"]')){
- _.dom.querySelector('.comment-item[data-id="' + post.id + '"]').outerHTML = html;
- } else {
- parentPost.dom.insertAdjacentHTML(parentPost.insert, html);
- }
-
- if(!post.isDeleted){
- _.dom.querySelector('.comment-item[data-id="' + post.id + '"] .comment-item-reply').addEventListener('click', _.handle.show, false);
- _.dom.querySelector('.comment-item[data-id="' + post.id + '"] .comment-item-avatar').addEventListener('click', _.handle.jump, false);
- if( !!post.parent ) {
- _.dom.querySelector('.comment-item[data-id="' + post.id + '"] .comment-item-pname').addEventListener('click', _.handle.jump, false);
- }
- }
-
- // 发布留言,可编辑删除
- if(!!post.isPost && !_.stat.editing){
- var $this = _.dom.querySelector('.comment-item[data-id="' + post.id + '"]');
-
- var postEdit = setTimeout(function(){
- // 十分钟后
- if(!!$this.querySelector('.comment-item-manage')){
- $this.querySelector('.comment-item-manage').outerHTML = '';
- }
- }, 600000);
-
- // 删除
- $this.querySelector('.comment-item-delete').addEventListener('click',function(e){
- var postData = {
- id: post.id
- }
- var delDom = e.currentTarget;
- delDom.innerHTML = '删除中';
- postAjax( _.opts.api + '/removecomment.php', postData, function(resp){
- var data = JSON.parse(resp);
- if (data.code === 0) {
- if(data.response.isDeleted == true){
- $this.outerHTML = '';
- } else {
- alert(data.response.message);
- $this.querySelector('.comment-item-manage').outerHTML = '';
- }
- } else if (data.code === 2) {
- alert(data.response);
- $this.querySelector('.comment-item-manage').outerHTML = '';
- }
- }, function(){
- alert('删除出错,请稍后重试');
- })
- clearTimeout(postEdit);
- }, false)
-
- // 编辑
- $this.querySelector('.comment-item-edit').addEventListener('click',function(){
- _.stat.editing = post;
- _.edit(post);
- }, false)
- }
- }
-
- // 读取更多
- iDisqus.prototype.loadMore = function(e){
- var _ = this;
- _.stat.offsetTop = d.documentElement.scrollTop || d.body.scrollTop;
- if( !_.stat.loading ){
- e.currentTarget.classList.add('loading');
- _.getlist();
- }
- }
-
- // 评论框焦点
- iDisqus.prototype.focus = function(e){
- var wrapper = e.currentTarget.closest('.comment-form-wrapper');
- wrapper.classList.add('editing');
- if (wrapper.classList.contains('focus')){
- wrapper.classList.remove('focus');
- } else{
- wrapper.classList.add('focus');
- }
- }
-
- // 输入事件
- iDisqus.prototype.input = function(e){
- var form = e.currentTarget.closest('.comment-form');
- var alertmsg = form.querySelector('.comment-form-alert');
- alertmsg.innerHTML = '';
- }
-
- // 提醒用户 @ mention
- iDisqus.prototype.mention = function(e){
- var _ = this;
- var textarea = e.currentTarget;
- var selStart = textarea.selectionStart;
- var mentionIndex = textarea.value.slice(0, selStart).lastIndexOf('@');
- var mentionText = textarea.value.slice(mentionIndex, selStart);
- var mentionDom = _.dom.querySelector('.mention-user');
- if(mentionText.search(/^@\w+$|^@$/) == 0){
- if( e.keyCode == 38 || e.keyCode == 40){
- return;
- }
- var showUsers = _.stat.users.filter(function(user){
- var re = new RegExp(mentionText.slice(1), 'i');
- return user.username.search(re) > -1;
- });
- var coord = _.getCaretCoord(textarea);
- var list='', html = '';
-
- if( showUsers.length > 0){
- showUsers.forEach(function(item, i){
- list += '<li class="mention-user-item'+(i == 0 ? ' active' : '')+'" data-username="'+item.username+'"><img class="mention-user-avatar" src="'+item.avatar+'"><div class="mention-user-username">'+item.username+'</div><div class="mention-user-name">'+item.name+'</div></li>';
- })
- if(!!mentionDom){
- mentionDom.innerHTML = '<ul class="mention-user-list">'+list+'</ul>';
- mentionDom.style.left = coord.left + 'px';
- mentionDom.style.top = coord.top + 'px';
- } else {
- html = '<div class="mention-user" style="left:'+coord.left+'px;top:'+coord.top+'px"><ul class="mention-user-list">'+list+'</ul></div>';
- _.dom.querySelector('#idisqus').insertAdjacentHTML('beforeend', html);
- }
-
- // 鼠标悬浮
- _.addListener('mention-user-item', 'mouseover', function(){
- _.dom.querySelector('.mention-user-item.active').classList.remove('active');
- this.classList.add('active');
- })
-
- // 鼠标点击
- _.addListener('mention-user-item', 'click', function(){
- var username = '@' + this.dataset.username + ' ';
- textarea.value = textarea.value.slice(0, mentionIndex) + username + textarea.value.slice(selStart);
- _.dom.querySelector('.mention-user').outerHTML = '';
- textarea.focus();
- textarea.setSelectionRange(mentionIndex + username.length, mentionIndex + username.length)
- textarea.removeEventListener('keydown', _.handle.keySelect, false);
- })
-
- // 键盘事件
- textarea.addEventListener('keydown', _.handle.keySelect, false);
- } else{
- if(!!mentionDom){
- mentionDom.outerHTML = '';
- textarea.removeEventListener('keydown', _.handle.keySelect, false);
- }
- }
- } else {
- if(!!mentionDom){
- mentionDom.outerHTML = '';
- textarea.removeEventListener('keydown', _.handle.keySelect, false);
- }
- }
- }
-
- // 获取光标坐标 https://medium.com/@_jh3y/how-to-where-s-the-caret-getting-the-xy-position-of-the-caret-a24ba372990a
- iDisqus.prototype.getCaretCoord = function(textarea){
- var _ = this;
- var carPos = textarea.selectionEnd,
- div = d.createElement('div'),
- span = d.createElement('span'),
- copyStyle = getComputedStyle(textarea);
- [].forEach.call(copyStyle, function(prop){
- div.style[prop] = copyStyle[prop];
- });
- div.style.position = 'absolute';
- _.dom.appendChild(div);
- div.textContent = textarea.value.substr(0, carPos);
- span.textContent = textarea.value.substr(carPos) || '.';
- div.appendChild(span);
- var coords = {
- 'top': textarea.offsetTop - textarea.scrollTop + span.offsetTop + parseFloat(copyStyle.lineHeight),
- 'left': textarea.offsetLeft - textarea.scrollLeft + span.offsetLeft
- };
- _.dom.removeChild(div);
- return coords;
- }
-
- // 键盘选择用户
- iDisqus.prototype.keySelect = function(e){
- var _ = this;
- var textarea = e.currentTarget;
- var selStart = textarea.selectionStart;
- var mentionIndex = textarea.value.slice(0, selStart).lastIndexOf('@');
- var mentionText = textarea.value.slice(mentionIndex, selStart);
- var mentionDom = _.dom.querySelector('.mention-user');
- var current = _.dom.querySelector('.mention-user-item.active')
- switch(e.keyCode){
- case 13:
- //回车
- var username = '@' + current.dataset.username + ' ';
- textarea.value = textarea.value.slice(0, mentionIndex) + username + textarea.value.slice(selStart);
- textarea.setSelectionRange(mentionIndex + username.length, mentionIndex + username.length)
- _.dom.querySelector('.mention-user').outerHTML = '';
- textarea.removeEventListener('keydown', _.handle.keySelect, false);
- e.preventDefault();
- break;
- case 38:
- //上
- if(!!current.previousSibling){
- current.previousSibling.classList.add('active');
- current.classList.remove('active');
- }
- e.preventDefault();
- break;
- case 40:
- //下
- if(!!current.nextSibling){
- current.nextSibling.classList.add('active');
- current.classList.remove('active');
- }
- e.preventDefault();
- break;
- default:
- break;
- }
- }
-
- // 跳到评论
- iDisqus.prototype.jump = function(e){
- var _ = this;
- var $this = e.currentTarget;
- var hash = getLocation($this.href).hash;
- var el = _.dom.querySelector('#idisqus ' + hash);
- history.replaceState(undefined, undefined, hash);
- window.scrollBy(0, el.getBoundingClientRect().top);
- e.preventDefault();
- }
-
- // 点选表情
- iDisqus.prototype.field = function(e){
- var item = e.currentTarget;
- var form = item.closest('.comment-form');
- var textarea = form.querySelector('.comment-form-textarea');
- var selStart = textarea.selectionStart;
- var shortCode = selStart == 0 ? item.dataset.code + ' ' : ' ' + item.dataset.code + ' '
- textarea.value = textarea.value.slice(0, selStart) + shortCode + textarea.value.slice(selStart)
- textarea.focus();
- textarea.setSelectionRange(selStart + shortCode.length, selStart + shortCode.length);
- }
-
- // 显示回复框 or 取消回复框
- iDisqus.prototype.show = function(e){
- var _ = this;
-
- var $this = e.currentTarget;
- var item = $this.closest('.comment-item');
-
- // 无论取消还是回复,移除已显示回复框
- var box = _.dom.querySelector('.comment-item .comment-box:not([data-current-id])');
- if( box ){
- var $show = box.closest('.comment-item');
- var cancel = $show.querySelector('.comment-item-cancel')
- cancel.outerHTML = cancel.outerHTML.replace('cancel','reply');
- box.outerHTML = '';
- }
-
- // 回复时,显示评论框
- if( $this.className == 'comment-item-reply' ){
- $this.outerHTML = $this.outerHTML.replace('reply','cancel');
- var commentBox = _.box.replace(/emoji-input/g,'emoji-input-'+item.dataset.id).replace(/upload-input/g,'upload-input-'+item.dataset.id);
- item.querySelector('.comment-item-children').insertAdjacentHTML('beforebegin', commentBox);
- _.user.init();
-
- _.addAllListeners();
- item.querySelector('.comment-form-textarea').focus();
- }
-
- // 监听事件
- _.addListener('comment-item-reply', 'click', _.handle.show);
- _.addListener('comment-item-cancel', 'click', _.handle.show);
-
- }
-
- // 验证表单
- iDisqus.prototype.verify = function(e){
- var _ = this;
- var box = e.currentTarget.closest('.comment-box');
- var avatar = box.querySelector('.comment-avatar-image');
- var email = box.querySelector('.comment-form-email');
- var alertmsg = box.querySelector('.comment-form-alert');
- if(/^[A-Z0-9._%+-]+@[A-Z0-9.-]+\.[A-Z]{2,}$/i.test(email.value)){
- getAjax(
- _.opts.api + '/getgravatar.php?email=' + email.value,
- function(resp) {
- if (resp == 'false') {
- _.errorTips('您所填写的邮箱地址有误。', email);
- } else {
- avatar.src = resp;
- }
- }, function(){
- }
- );
- }
- }
-
- // 上传图片
- iDisqus.prototype.upload = function(e){
- var _ = this;
- var file = e.currentTarget;
- var form = file.closest('.comment-form');
- var progress = form.querySelector('.comment-image-progress');
- var loaded = form.querySelector('.comment-image-loaded');
- var wrapper = form.querySelector('.comment-form-wrapper');
- var alertmsg = form.querySelector('.comment-form-alert');
- alertmsg.innerHTML = '';
- if(file.files.length === 0){
- return;
- }
-
- // 以文件大小识别是否为同张图片
- var size = file.files[0].size;
-
- if( size > 5000000 ){
- alertmsg.innerHTML = '请选择 5M 以下图片。';
- setTimeout(function(){
- alertmsg.innerHTML = '';
- }, 3000);
- return;
- }
-
- if( _.stat.imageSize.indexOf(size) == -1 ){
- progress.style.width = '80px';
- } else {
- alertmsg.innerHTML = '请勿选择已存在的图片。';
- setTimeout(function(){
- alertmsg.innerHTML = '';
- }, 3000);
- return;
- }
-
- // 展开图片上传界面
- wrapper.classList.add('expanded');
-
- // 图片上传请求
- var data = new FormData();
- data.append('file', file.files[0] );
- var filename = file.files[0].name;
-
- var $item;
-
- var xhrUpload = new XMLHttpRequest();
- xhrUpload.withCredentials = true;
- xhrUpload.onreadystatechange = function(){
- if(xhrUpload.readyState == 4 && xhrUpload.status == 200){
- var data = JSON.parse(xhrUpload.responseText);
- if( data.code == 0 ){
- _.stat.imageSize.push(size);
- var imageUrl = data.response[filename].url;
- var image = new Image();
- image.src = imageUrl;
- image.onload = function(){
- $item.innerHTML = '<img class="comment-image-object" src="'+imageUrl+'">';
- $item.dataset.imageUrl = imageUrl;
- $item.classList.remove('loading');
- $item.addEventListener('click', _.handle.remove, false);
- }
- } else {
- alertmsg.innerHTML = '图片上传出错。';
- $item.innerHTML = '';
- if( !!form.getElementsByClassName('comment-image-item').length){
- wrapper.classList.remove('expanded');
- }
- setTimeout(function(){
- alertmsg.innerHTML = '';
- }, 3000);
- }
- }
- };
- xhrUpload.upload.addEventListener('progress', function(e){
- loaded.style.width = Math.ceil((e.loaded/e.total) * 100)+ '%';
- }, false);
- xhrUpload.upload.addEventListener('load', function(e){
- loaded.style.width = 0;
- progress.style.width = 0;
- var imageItem = '<li class="comment-image-item loading" data-image-size="' + size + '">\n'+
- ' <svg version="1.1" class="comment-image-object" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" x="0px" y="0px"\n'+
- ' width="24px" height="30px" viewBox="0 0 24 30" style="enable-background: new 0 0 50 50;" xml:space="preserve">\n'+
- ' <rect x="0" y="10" width="4" height="10" fill="rgba(127,145,158,1)" opacity="0.2">\n'+
- ' <animate attributeName="opacity" attributeType="XML" values="0.2; 1; .2" begin="0s" dur="0.6s" repeatCount="indefinite" />\n'+
- ' <animate attributeName="height" attributeType="XML" values="10; 20; 10" begin="0s" dur="0.6s" repeatCount="indefinite" />\n'+
- ' <animate attributeName="y" attributeType="XML" values="10; 5; 10" begin="0s" dur="0.6s" repeatCount="indefinite" />\n'+
- ' </rect>\n'+
- ' <rect x="8" y="10" width="4" height="10" fill="rgba(127,145,158,1)" opacity="0.2">\n'+
- ' <animate attributeName="opacity" attributeType="XML" values="0.2; 1; .2" begin="0.15s" dur="0.6s" repeatCount="indefinite" />\n'+
- ' <animate attributeName="height" attributeType="XML" values="10; 20; 10" begin="0.15s" dur="0.6s" repeatCount="indefinite" />\n'+
- ' <animate attributeName="y" attributeType="XML" values="10; 5; 10" begin="0.15s" dur="0.6s" repeatCount="indefinite" />\n'+
- ' </rect>\n'+
- ' <rect x="16" y="10" width="4" height="10" fill="rgba(127,145,158,1)" opacity="0.2">\n'+
- ' <animate attributeName="opacity" attributeType="XML" values="0.2; 1; .2" begin="0.3s" dur="0.6s" repeatCount="indefinite" />\n'+
- ' <animate attributeName="height" attributeType="XML" values="10; 20; 10" begin="0.3s" dur="0.6s" repeatCount="indefinite" />\n'+
- ' <animate attributeName="y" attributeType="XML" values="10; 5; 10" begin="0.3s" dur="0.6s" repeatCount="indefinite" />\n'+
- ' </rect>\n'+
- ' </svg>\n'+
- '</li>\n';
- form.querySelector('.comment-image-list').insertAdjacentHTML('beforeend', imageItem);
- $item = form.querySelector('[data-image-size="'+size+'"]');
- }, false);
- xhrUpload.open('POST', _.opts.api + '/upload.php', true);
- xhrUpload.send(data);
- }
-
- // 移除图片
- iDisqus.prototype.remove = function(e){
- var _ = this;
- var $item = e.currentTarget.closest('.comment-image-item');
- var wrapper = e.currentTarget.closest('.comment-form-wrapper');
- $item.outerHTML = '';
- _.stat.imageSize = [];
- var imageArr = wrapper.getElementsByClassName('comment-image-item');
- [].forEach.call(imageArr, function(item, i){
- _.stat.imageSize[i] = item.dataset.imageSize;
- });
- if(_.stat.imageSize.length == 0){
- wrapper.classList.remove('expanded');
- }
- wrapper.querySelector('.comment-image-input').value = '';
- }
-
- // 错误提示
- iDisqus.prototype.errorTips = function(Text, Dom){
- var _ = this;
- if( _.user.logged_in == 'true' ){
- _.handle.logout();
- }
- var idisqus = _.dom.querySelector('#idisqus');
- var errorDom = _.dom.querySelector('.comment-form-error');
- if(!!errorDom){
- errorDom.outerHTML = '';
- }
- var Top = Dom.offsetTop;
- var Left = Dom.offsetLeft;
- var errorHtml = '<div class="comment-form-error" style="top:'+Top+'px;left:'+Left+'px;">'+Text+'</div>';
- idisqus.insertAdjacentHTML('beforeend', errorHtml);
- setTimeout(function(){
- var errorDom = _.dom.querySelector('.comment-form-error');
- if(!!errorDom){
- errorDom.outerHTML = '';
- }
- }, 3000);
- }
-
- // 发表/回复评论
- iDisqus.prototype.post = function(e){
- var _ = this;
- var item = e.currentTarget.closest('.comment-box[data-current-id]') || e.currentTarget.closest('.comment-item') || e.currentTarget.closest('.comment-box');
- var message = item.querySelector('.comment-form-textarea').value;
- var parentId = !!item.dataset.id ? item.dataset.id : '';
- var imgArr = item.getElementsByClassName('comment-image-item');
- var media = [];
- var mediaStr = '';
- [].forEach.call(imgArr, function(image,i){
- media[i] = image.dataset.imageUrl;
- mediaStr += ' ' + image.dataset.imageUrl;
- });
-
- // 不是编辑框需预览
- if( !item.dataset.currentId ){
- var elName = item.querySelector('.comment-form-name');
- var elEmail = item.querySelector('.comment-form-email');
- var elUrl = item.querySelector('.comment-form-url');
- var user = {
- name: elName.value,
- email: elEmail.value,
- url: elUrl.value.replace(/\s/g,''),
- avatar: item.querySelector('.comment-avatar-image').src,
- type: 0
- }
- var alertmsg = item.querySelector('.comment-form-alert');
- var alertClear = function() {
- setTimeout(function(){
- alertmsg.innerHTML = '';
- }, 3000);
- }
-
- if(_.user.type != '1'){
- if(/^\s*$/i.test(user.name)){
- _.errorTips('名字不能为空。', elName);
- return;
- }
- if(/^\s*$/i.test(user.email)){
- _.errorTips('邮箱不能为空。', elEmail);
- return;
- }
- if(!/^[A-Z0-9._%+-]+@[A-Z0-9.-]+\.[A-Z]{2,}$/i.test(user.email)){
- _.errorTips('请正确填写邮箱。', elEmail);
- return;
- }
- if(!/^([hH][tT]{2}[pP]:\/\/|[hH][tT]{2}[pP][sS]:\/\/)(([A-Za-z0-9-~]+)\.)+([A-Za-z0-9-~\/])+$|^\s*$/i.test(user.url)){
- _.errorTips('请正确填写网址。', elUrl);
- return;
- }
- _.user.submit(user);
-
- if( !_.user.name && !_.user.email ){
- return;
- }
- }
-
- if(!_.stat.message && !_.stat.mediaHtml){
- _.box = _.dom.querySelector('.comment-box').outerHTML.replace(/<label class="comment-actions-label exit"(.|\n)*<\/label>\n/,'').replace('comment-form-wrapper','comment-form-wrapper editing').replace(/加入讨论……/,'');
- }
-
- if( media.length == 0 && /^\s*$/i.test(message)){
- alertmsg.innerHTML = '评论不能为空或空格。';
- item.querySelector('.comment-form-textarea').focus();
- return;
- };
-
- var preMessage = message;
-
- if( !!_.opts.emoji_preview ){
- preMessage = preMessage.replace(/:([-+\w]+):/g, function (match){
- var emojiShort = match.replace(/:/g,'');
- var emojiImage = !!_.eac[emojiShort] ? '<img class="emojione" width="24" height="24" alt="'+emojiShort+'" title=":'+emojiShort+':" src="'+_.opts.emojiPath +_.eac[emojiShort]+'.png">' : match;
- return emojiImage;
- });
- } else {
- _.emojiList.forEach(function(item){
- preMessage = preMessage.replace(':'+item.code+':', '<img class="emojione" width="24" height="24" src="' + _.opts.emojiPath + item.unicode + '.png" />');
- });
- }
-
- var post = {
- 'url': !!_.user.url ? _.user.url : '',
- 'isMod': false,
- 'username': null,
- 'name': _.user.name,
- 'avatar': _.user.avatar,
- 'id': 'preview',
- 'parent': parentId,
- 'createdAt': (new Date()).toJSON(),
- 'message': '<p>' + preMessage + '</p>',
- 'media': media
- };
-
- _.load(post);
-
- _.timeAgo();
-
- // 清空或移除评论框
- _.stat.message = message;
- _.stat.mediaHtml = item.querySelector('.comment-image-list').innerHTML;
-
- if( parentId ){
- item.querySelector('.comment-item-cancel').click();
- } else {
- item.querySelector('.comment-form-textarea').value = '';
- item.querySelector('.comment-image-list').innerHTML = '';
- item.querySelector('.comment-form-wrapper').classList.remove('expanded','editing');
- }
- }
-
- // @
- var mentions = message.match(/@\w+/g);
- if( !!mentions ){
- mentions = mentions.filter(function(mention) {
- return _.stat.users.map(function(user) { return user.username; }).indexOf(mention.slice(1)) > -1;
- });
- if( mentions.length > 0 ){
- var re = new RegExp('('+mentions.join('|')+')','g');
- message = message.replace(re,'$1:disqus');
- }
- }
-
- // 文本 + 图片
- message += mediaStr;
-
- // POST 操作
- // 编辑框则更新评论
- if( !!item.dataset.currentId ){
- var postData = {
- id: item.dataset.currentId,
- message: message,
- }
- postAjax( _.opts.api + '/updatecomment.php', postData, function(resp){
- var data = JSON.parse(resp);
- if (data.code === 0) {
- _.stat.message = null;
- _.stat.mediaHtml = null;
- var post = data.response;
- _.load(post);
- _.timeAgo();
- _.stat.editing = false;
- } else {
- // 取消编辑
- _.load(_.stat.editing)
- _.timeAgo();
- _.stat.editing = false;
- }
- }, function(){
- // 取消编辑
- _.load(_.stat.editing)
- _.timeAgo();
- _.stat.editing = false;
- })
- } else {
- var postData = {
- thread: _.stat.thread,
- parent: parentId,
- message: message,
- name: _.user.name,
- email: _.user.email,
- url: _.user.url,
- }
- postAjax( _.opts.api + '/postcomment.php', postData, function(resp){
- var data = JSON.parse(resp);
- if (data.code === 0) {
- _.dom.querySelector('.comment-item[data-id="preview"]').outerHTML = '';
- _.stat.count += 1;
- _.dom.querySelector('#comment-count').innerHTML = _.stat.count + ' 条评论';
- var post = data.response;
- post.isPost = true;
- _.load(post);
- _.timeAgo();
- } else if (data.code === 2) {
- alertmsg.innerHTML = data.response;
- _.dom.querySelector('.comment-item[data-id="preview"]').outerHTML = '';
- _.reEdit(item);
-
- if( data.response.indexOf('author') > -1){
- _.handle.logout();
- }
- } else {
- alertmsg.innerHTML = '提交失败,请稍后重试,错误代码:' + data.code;
- alertClear();
-
- _.dom.querySelector('.comment-item[data-id="preview"]').outerHTML = '';
- _.reEdit(item);
- }
-
- }, function(){
- alertmsg.innerHTML = '提交出错,请稍后重试。';
- alertClear();
-
- _.dom.querySelector('.comment-item[data-id="preview"]').outerHTML = '';
- _.reEdit(item);
- })
- }
- }
-
- // 重新编辑
- iDisqus.prototype.reEdit = function(item){
- var _ = this;
-
- if( !!item.dataset.id ){
- item.querySelector('.comment-item-reply').click();
- } else {
- item.querySelector('.comment-form-wrapper').classList.add('editing');
- }
-
- // 重新填充文本图片
- if(!!_.stat.message){
- item.querySelector('.comment-form-textarea').value = _.stat.message;
- }
- if(!!_.stat.mediaHtml){
- item.querySelector('.comment-form-wrapper').classList.add('expanded');
- item.querySelector('.comment-image-list').innerHTML = _.stat.mediaHtml;
- _.addListener('comment-image-item', 'click', _.handle.remove);
- }
- }
-
- // 编辑
- iDisqus.prototype.edit = function(post){
- var _ = this;
- var commentBox = _.box.replace('comment-box','comment-box comment-box-'+post.id).replace(/emoji-input/g,'emoji-input-'+post.id).replace(/upload-input/g,'upload-input-'+ post.id);
- var $this = _.dom.querySelector('.comment-item[data-id="' + post.id + '"] .comment-item-body');
- $this.outerHTML = commentBox;
- _.user.init();
- var item = _.dom.querySelector('.comment-box-' + post.id);
- item.dataset.currentId = post.id;
- _.addAllListeners();
- item.querySelector('.comment-form-textarea').focus();
-
- // 取消编辑
- item.querySelector('.comment-actions-form').insertAdjacentHTML('afterbegin', '<a class="comment-form-cancel" href="javascript:;">取消</a>')
- item.querySelector('.comment-form-cancel').addEventListener('click', function(){
- _.stat.editing = false;
- _.load(post);
- _.timeAgo();
- }, false);
-
- // 重新填充文本图片,连续回复、连续编辑会有 bug
- if(!!_.stat.message){
- item.querySelector('.comment-form-textarea').value = _.stat.message;
- }
- if(!!_.stat.mediaHtml){
- item.querySelector('.comment-form-wrapper').classList.add('expanded');
- item.querySelector('.comment-image-list').innerHTML = _.stat.mediaHtml;
- _.addListener('comment-image-item', 'click', _.handle.remove);
- }
-
- }
-
- // 创建 Thread 表单
- iDisqus.prototype.create = function(){
- var _ = this;
- if(_.opts.autoCreate){
- _.dom.querySelector('.loading-container').dataset.tip = '正在创建 Thread……';
- var postData = {
- url: _.opts.link,
- identifier: _.opts.identifier,
- title: _.opts.title,
- slug: _.opts.slug,
- message: _.opts.desc
- }
- _.postThread(postData);
- return;
- }
- _.dom.querySelector('#idisqus').classList.remove('loading');
- _.dom.querySelector('#idisqus').innerHTML = '<div class="comment-header"><span class="comment-header-item">创建 Thread<\/span><\/div>'+
- '<div class="comment-thread-form">'+
- '<p>由于 Disqus 没有本页面的相关 Thread,故需先创建 Thread<\/p>'+
- '<div class="comment-form-item"><label class="comment-form-label">url:<\/label><input class="comment-form-input" id="thread-url" name="url" value="' + _.opts.link + '" disabled \/><\/div>'+
- '<div class="comment-form-item"><label class="comment-form-label">identifier:<\/label><input class="comment-form-input" id="thread-identifier" name="identifier" value="'+_.opts.identifier+'" disabled \/><\/div>'+
- '<div class="comment-form-item"><label class="comment-form-label">title:<\/label><input class="comment-form-input" id="thread-title" name="title" value="'+_.opts.title+'" disabled \/><\/div>'+
- '<div class="comment-form-item"><label class="comment-form-label">slug:<\/label><input class="comment-form-input" id="thread-slug" name="slug" value="' + _.opts.slug + '" \/><\/div>'+
- '<div class="comment-form-item"><label class="comment-form-label">message:<\/label><textarea class="comment-form-textarea" id="thread-message" name="message">'+_.opts.desc+'<\/textarea><\/div>'+
- '<button id="thread-submit" class="comment-form-submit">提交<\/button><\/div>';
- _.dom.querySelector('#thread-submit').addEventListener('click', _.handle.postThread, false);
- }
-
- // 创建 Thread 事件
- iDisqus.prototype.postThread = function(){
- var _ = this;
- if( !!arguments[0].target ){
- var postData = {
- url: _.dom.querySelector('#thread-url').value,
- identifier: _.dom.querySelector('#thread-identifier').value,
- title: _.dom.querySelector('#thread-title').value,
- slug: _.dom.querySelector('#thread-slug').value.replace(/[^A-Za-z0-9_-]+/g,''),
- message: _.dom.querySelector('#thread-message').value
- }
- } else {
- var postData = arguments[0];
- }
- postAjax( _.opts.api + '/createthread.php', postData, function(resp){
- var data = JSON.parse(resp);
- if( data.code === 0 ) {
- alert('创建 Thread 成功,刷新后便可愉快地评论了!');
- setTimeout(function(){location.reload();},2000);
- } else if( data.code === 2 ) {
- if (data.response.indexOf('A thread already exists with link') > -1) {
- alert(data.response.replace('A thread already exists with link,', '已存在此链接的相关 Thread,'));
- return;
- }
- if (data.response.indexOf('Invalid URL') > -1) {
- alert('参数错误,无效的\'URL\'');
- return;
- }
- if (data.response.indexOf('Invalid slug') > -1) {
- alert('参数错误,无效的\'slug\'');
- return;
- }
- alert(data.response);
- return;
- } else {
- alert(data.response);
- return;
- }
- }, function(){
- alert('创建 Thread 出错,请稍后重试!');
- })
- }
-
- // 销毁评论框
- iDisqus.prototype.destroy = function(){
- var _ = this;
- _.removeListener('exit', 'click', _.handle.logout);
- _.removeListener('comment-form-textarea', 'blur', _.handle.focus);
- _.removeListener('comment-form-textarea', 'focus', _.handle.focus);
- _.removeListener('comment-form-textarea', 'keyup', _.handle.mention);
- _.removeListener('comment-form-email', 'blur', _.handle.verify);
- _.removeListener('comment-form-submit', 'click', _.handle.post);
- _.removeListener('comment-image-input', 'change', _.handle.upload);
- _.removeListener('comment-item-reply', 'click', _.handle.show);
- _.removeListener('comment-loadmore', 'click', _.handle.loadMore);
- _.removeListener('emojione-item', 'click', _.handle.field);
- _.dom.innerHTML = '';
- delete _.box;
- delete _.dom;
- delete _.emojiList;
- delete _.user;
- delete _.handle;
- delete _.opts;
- delete _.stat;
- }
-
- /* CommonJS */
- if (typeof require === 'function' && typeof module === 'object' && module && typeof exports === 'object' && exports)
- module.exports = iDisqus;
- /* AMD */
- else if (typeof define === 'function' && define['amd'])
- define(function () {
- return iDisqus;
- });
- /* Global */
- else
- global['iDisqus'] = global['iDisqus'] || iDisqus;
-
-})(window || this);
+(function webpackUniversalModuleDefinition(root, factory) {
+ if(typeof exports === 'object' && typeof module === 'object')
+ module.exports = factory();
+ else if(typeof define === 'function' && define.amd)
+ define([], factory);
+ else if(typeof exports === 'object')
+ exports["iDisqus"] = factory();
+ else
+ root["iDisqus"] = factory();
+})(window, function() {
+return /******/ (function(modules) { // webpackBootstrap
+/******/ // The module cache
+/******/ var installedModules = {};
+/******/
+/******/ // The require function
+/******/ function __webpack_require__(moduleId) {
+/******/
+/******/ // Check if module is in cache
+/******/ if(installedModules[moduleId]) {
+/******/ return installedModules[moduleId].exports;
+/******/ }
+/******/ // Create a new module (and put it into the cache)
+/******/ var module = installedModules[moduleId] = {
+/******/ i: moduleId,
+/******/ l: false,
+/******/ exports: {}
+/******/ };
+/******/
+/******/ // Execute the module function
+/******/ modules[moduleId].call(module.exports, module, module.exports, __webpack_require__);
+/******/
+/******/ // Flag the module as loaded
+/******/ module.l = true;
+/******/
+/******/ // Return the exports of the module
+/******/ return module.exports;
+/******/ }
+/******/
+/******/
+/******/ // expose the modules object (__webpack_modules__)
+/******/ __webpack_require__.m = modules;
+/******/
+/******/ // expose the module cache
+/******/ __webpack_require__.c = installedModules;
+/******/
+/******/ // define getter function for harmony exports
+/******/ __webpack_require__.d = function(exports, name, getter) {
+/******/ if(!__webpack_require__.o(exports, name)) {
+/******/ Object.defineProperty(exports, name, { enumerable: true, get: getter });
+/******/ }
+/******/ };
+/******/
+/******/ // define __esModule on exports
+/******/ __webpack_require__.r = function(exports) {
+/******/ if(typeof Symbol !== 'undefined' && Symbol.toStringTag) {
+/******/ Object.defineProperty(exports, Symbol.toStringTag, { value: 'Module' });
+/******/ }
+/******/ Object.defineProperty(exports, '__esModule', { value: true });
+/******/ };
+/******/
+/******/ // create a fake namespace object
+/******/ // mode & 1: value is a module id, require it
+/******/ // mode & 2: merge all properties of value into the ns
+/******/ // mode & 4: return value when already ns object
+/******/ // mode & 8|1: behave like require
+/******/ __webpack_require__.t = function(value, mode) {
+/******/ if(mode & 1) value = __webpack_require__(value);
+/******/ if(mode & 8) return value;
+/******/ if((mode & 4) && typeof value === 'object' && value && value.__esModule) return value;
+/******/ var ns = Object.create(null);
+/******/ __webpack_require__.r(ns);
+/******/ Object.defineProperty(ns, 'default', { enumerable: true, value: value });
+/******/ if(mode & 2 && typeof value != 'string') for(var key in value) __webpack_require__.d(ns, key, function(key) { return value[key]; }.bind(null, key));
+/******/ return ns;
+/******/ };
+/******/
+/******/ // getDefaultExport function for compatibility with non-harmony modules
+/******/ __webpack_require__.n = function(module) {
+/******/ var getter = module && module.__esModule ?
+/******/ function getDefault() { return module['default']; } :
+/******/ function getModuleExports() { return module; };
+/******/ __webpack_require__.d(getter, 'a', getter);
+/******/ return getter;
+/******/ };
+/******/
+/******/ // Object.prototype.hasOwnProperty.call
+/******/ __webpack_require__.o = function(object, property) { return Object.prototype.hasOwnProperty.call(object, property); };
+/******/
+/******/ // __webpack_public_path__
+/******/ __webpack_require__.p = "";
+/******/
+/******/
+/******/ // Load entry module and return exports
+/******/ return __webpack_require__(__webpack_require__.s = "./src/iDisqus.js");
+/******/ })
+/************************************************************************/
+/******/ ({
+
+/***/ "./node_modules/css-loader/dist/cjs.js!./node_modules/postcss-loader/src/index.js?!./node_modules/sass-loader/dist/cjs.js!./src/iDisqus.scss":
+/*!***************************************************************************************************************************************************!*\
+ !*** ./node_modules/css-loader/dist/cjs.js!./node_modules/postcss-loader/src??ref--4-2!./node_modules/sass-loader/dist/cjs.js!./src/iDisqus.scss ***!
+ \***************************************************************************************************************************************************/
+/*! no static exports found */
+/***/ (function(module, exports, __webpack_require__) {
+
+eval("exports = module.exports = __webpack_require__(/*! ../node_modules/css-loader/dist/runtime/api.js */ \"./node_modules/css-loader/dist/runtime/api.js\")(false);\n// Module\nexports.push([module.i, \".comment{position:relative;font:13.5px/1.6 \\\"Helvetica Neue\\\", Helvetica, Arial, \\\"微软雅黑\\\", \\\"Microsoft YaHei\\\", sans-serif;color:#2a2e2e;margin:5px auto;word-wrap:break-word;padding:0;box-sizing:border-box}.comment#disqus_thread{display:none}.comment input,.comment textarea,.comment select,.comment button{font:13.5px/1.6 \\\"Helvetica Neue\\\", Helvetica, Arial, \\\"微软雅黑\\\", \\\"Microsoft YaHei\\\", sans-serif}.comment a{text-decoration:none}.comment .icon{max-width:20px}.comment *{margin:0;padding:0;box-sizing:border-box}.comment strong,.comment b{font-weight:bold;color:#000}.comment :focus{outline:none}.comment abbr[title]{text-decoration:none}.comment .hide{display:none}.comment .init-bg{display:none}.comment.init{display:block}.comment.init>*{display:none}.comment.init .init-container{margin:20px auto 20px;color:#9d9ea1;text-align:center;display:block;position:relative;height:100px;line-height:40px;width:250px}.comment.init .init-container .init-bg{display:block;transform:rotate(-135deg);margin:0 auto}.comment.init .init-container:before,.comment.init .init-container:after{display:block;position:absolute}.comment.init .init-container:before{content:attr(data-tips);top:64px;left:0;width:100%;height:30px;line-height:30px}.comment.init .init-container:after{content:\\\"\\\";box-sizing:border-box;width:26px;height:26px;top:20px;left:115px;border-width:3px;border-style:solid;border-color:#9d9ea1 transparent;border-radius:13px;transform-origin:50% 50% 0;-webkit-animation:disqus-loader-spinner-animation .7s infinite linear;animation:disqus-loader-spinner-animation .7s infinite linear}.comment.loading .comment-order{pointer-events:none}.comment-box{display:flex;margin:0 0 20px}.comment-navbar{display:flex;justify-content:space-between;align-items:center;height:48px}.comment-navbar .comment-navbar-item{display:flex}.comment-navbar .comment-recommend{display:flex;align-items:center;line-height:27px;height:27px;border:1px solid #656c7a;padding:0 5px;border-radius:3px;color:#656c7a;font-size:12px}.comment-navbar .comment-recommend .icon{fill:#656c7a;width:16px;height:16px}.comment-navbar .comment-recommend.voted .icon{fill:#f05f70}.comment-navbar .comment-recommend-text{margin:0 5px}.comment-navbar .comment-order-label{display:block;height:20px;line-height:20px;margin-right:10px;font-size:12px;border-radius:2px;padding:0 5px;background-color:#e7e9ee;cursor:pointer}.comment-navbar .comment-order-label:last-child{margin-right:0}.comment-navbar .comment-order-radio{display:none}.comment-navbar .comment-order-radio:checked+.comment-order-label{color:#fff;background-color:#c2c6cc}.comment-header{display:flex;justify-content:space-between;border-bottom:2px solid #e7e9ee}.comment-header .comment-header-item{height:36px;line-height:36px;font-weight:bold;font-size:15px;color:#656c7a;display:inline-block;border-bottom:2px solid #656c7a;margin-bottom:-2px;margin-right:10px;padding:0 5px}.comment-header .comment-header-item:last-child{margin-right:0;border-bottom-color:transparent}.comment-header .comment-header-item:last-child:hover{color:#2a2a2a}.comment-header #comment-user{display:none}.comment-header #comment-user:checked+.comment-user{color:#2a2a2a}.comment-header #comment-user:checked+.comment-user:after{border-top-color:#2a2a2a}.comment-header #comment-user:checked+.comment-user .comment-logout{display:block}.comment-header .comment-login{cursor:pointer}.comment-header .comment-user{cursor:pointer;position:relative;padding-right:15px}.comment-header .comment-user:after{content:\\\"\\\";display:block;position:absolute;height:0;width:0;border:5px solid transparent;border-top-color:#656c7a;top:50%;right:0;margin-top:0}.comment-header .comment-user:hover:after{border-top-color:#2a2a2a}.comment-header .comment-logout{cursor:pointer;z-index:1;display:none;position:absolute;border-radius:3px;border:2px solid #c2c6cc;width:80px;background-color:#fff;height:32px;line-height:28px;text-align:center;right:0;top:80%;color:#656c7a;font-size:13px}.comment-header .comment-logout:hover{color:#0095dd}.comment-header .comment-show{width:120px;text-align:center;position:relative;transition:all 0.2s ease-in-out;color:#2a2e2e;text-transform:capitalize;cursor:pointer;display:none}.comment-header .comment-header-count{width:120px;text-align:center;transition:all 0.2s ease-in-out;text-transform:capitalize;display:inline-block}.comment-header .comment-header-count:after{content:\\\" \\\";display:block;height:2px;position:absolute;bottom:-2px;left:0px;right:0px;background:#2e9fff}.comment-form{display:flex;flex-direction:column;width:calc(100% - 60px)}.comment-item-child .comment-form{width:calc(100% - 42px)}.placeholder{color:#7f919e;line-height:30px;font-size:12px;position:absolute;top:7px;left:10px;right:9px;white-space:nowrap;text-overflow:ellipsis;cursor:text;overflow:hidden}.comment-form-wrapper{display:flex;flex-direction:column;border:2px solid #dbdfe4;border-radius:4px;width:100%}.comment-actions{background:#f6f8f9;border-radius:0 0 2px 2px;display:flex;justify-content:space-between;height:0;transition:opacity linear .2s;opacity:0;filter:alpha(opacity=0);visibility:hidden}.comment-actions .comment-actions-group{display:flex;position:relative}.comment-actions .comment-actions-input{display:none}.comment-actions .comment-actions-input[type=\\\"checkbox\\\"]:checked+.comment-actions-label .icon{fill:#1d2f3a}.comment-actions .comment-actions-label{display:inline-block;width:34px;height:34px;cursor:pointer}.comment-actions .comment-actions-label .icon{height:18px;margin:8px;display:inline-block;color:#737474;cursor:pointer;fill:#c2c6cc;transition:all .2s}.comment-actions .comment-actions-label:hover .icon{fill:#1d2f3a !important}.comment-actions .emojione-list{cursor:default;position:absolute;opacity:0;filter:alpha(opacity=0);visibility:hidden;list-style:none;width:125px;background-color:#fff;padding:5px 0 0 5px;border-radius:2px;border:2px solid #c2c6cc;bottom:100%;left:-2px;margin-left:0;display:flex;flex-wrap:wrap}.comment-actions .emojione-item{position:relative;height:24px;width:24px;margin:0 5px 5px 0}.comment-actions .emojione-item:before{content:\\\"\\\";display:inline-block;position:absolute;left:0;top:0;bottom:0;right:0;z-index:4}.comment-actions .emojione-item-image{height:24px;width:24px}.comment-actions .comment-actions-input[type=\\\"checkbox\\\"]:checked+.emojione:before{position:fixed;top:0;left:0;width:100%;height:100%;content:\\\"\\\";display:block;cursor:default}.comment-actions .comment-actions-input[type=\\\"checkbox\\\"]:checked+.emojione .emojione-list{opacity:1;filter:alpha(opacity=100);visibility:visible !important}.expanded .comment-image{display:flex;overflow-x:auto}.expanded .comment-image .comment-image-progress{position:relative;height:80px;width:0;background:url(\\\"https://a.disquscdn.com/next/embed/assets/img/loader.5cc23909da9c4a9874500d7a85c4125f.gif\\\") center no-repeat;margin:0 5px;overflow:hidden}.expanded .comment-image .comment-image-progress:before{position:absolute;content:\\\"\\\";display:block;top:55px;bottom:20px;left:0;right:0;height:5px;width:100%;background-color:#dbdfe4}.expanded .comment-image .comment-image-progress .comment-image-loaded{position:absolute;background-color:#7f919e;top:55px;left:0;right:0;bottom:20px;height:5px;width:0}.expanded .comment-image .comment-image-list{list-style:none;display:flex}.expanded .comment-image .comment-image-item{height:80px;margin-left:5px;position:relative;border-radius:3px;overflow:hidden;flex:none}.expanded .comment-image .comment-image-item .comment-image-object{display:block;height:100%;border-radius:3px;overflow:hidden}.expanded .comment-image .comment-image-item.loading .comment-image-object{width:20px;margin:0 30px}.comment-form-wrapper.editing+.comment-form-user{opacity:1;height:auto;margin-top:10px}.comment-form-wrapper.editing .comment-form-textarea{height:74px;font-size:13.5px;line-height:16px}.comment-form-wrapper.editing .comment-image{transition:padding-bottom .15s ease-in-out;background-color:rgba(16,48,68,0.03)}.comment-form-wrapper.editing .comment-actions{transition:all 0.2s ease-in-out;border-top:solid 2px #dbdfe4;opacity:1;height:36px;filter:alpha(opacity=100);visibility:visible !important}.comment-form-wrapper.editing .comment-actions-form{transition:all .3s .5s;margin:87px -2px -2px}.comment-form-wrapper.editing .comment-form-submit{opacity:1}.comment-form-wrapper.focus{border:2px solid #c2c6cc}.comment-form-wrapper.focus .comment-actions{border-top:2px solid #c2c6cc}.comment-form-wrapper.focus .comment-actions-label .icon{fill:#656c7a}.comment-form-wrapper.focus.expanded .comment-image{border-top:2px solid #c2c6cc}.comment-form-wrapper.preview{border:2px solid #c2c6cc}.comment-form-wrapper.preview .comment-actions{border-top:2px solid #c2c6cc}.comment-form-wrapper.preview .comment-actions-label{pointer-events:none}.comment-form-wrapper.preview .comment-actions-label[for^=\\\"preview-input\\\"]{pointer-events:auto}.comment-form-wrapper.preview .comment-actions-label[for^=\\\"preview-input\\\"] .icon{fill:#656c7a}.comment-form-wrapper.expanded .comment-image{border-top:2px solid #dbdfe4;padding:10px 0 8px}.comment-form-wrapper.logged-in .comment-form-submit{border-radius:0 0 4px;transition:none;opacity:1}.comment-form-wrapper.logged-in .comment-actions-form{margin:0;transition:all .5s}.comment-form-wrapper.logged-in+.comment-form-user{height:0;opacity:0;margin-top:-40px}.comment-form-wrapper.logged-in .exit{display:block}.comment-form-wrapper .comment-form-preview{border-radius:4px;display:none;min-height:74px;padding:7px;white-space:pre-wrap}.comment-form-wrapper .comment-form-textarea{width:100%;display:block;border:none;font-size:18px;line-height:30px;border-radius:4px;color:#2a2e2e;cursor:text;resize:none;height:44px;padding:7px;transition:all .2s ease-in-out;background-color:#fefefe}.comment-form-wrapper .comment-form-textarea::-webkit-input-placeholder{color:#7f919e}.comment-form-wrapper .comment-form-textarea::-moz-placeholder{color:#7f919e}.comment-form-wrapper .comment-form-alert:not(:empty){background-color:#f05f70;padding:10px;line-height:20px;font-size:13px;font-weight:700;color:#fff;margin:0 -2px;border-top:2px solid #dbdfe4}.comment-actions-form{display:flex}.comment-actions-form .comment-form-cancel{line-height:36px;padding:0 15px;font-size:12px}.comment-actions-form .comment-form-submit{z-index:1;border:none;opacity:0;margin:-2px;white-space:nowrap;border-radius:4px;height:38px;width:80px;display:inline-block;background-color:rgba(29,47,58,0.6);cursor:pointer;line-height:38px}.comment-actions-form .comment-form-submit .icon{margin:9px;fill:#fff;cursor:pointer;width:20px;height:20px}.comment-actions-form .comment-form-submit:hover{background-color:rgba(29,47,58,0.75)}.comment-form-user{display:flex;opacity:0;transition:all .5s .2s;height:0;margin:-40px -5px 40px;overflow:hidden;line-height:32px}.comment-form-user .comment-form-guest{display:flex;flex-wrap:wrap;flex:1}.comment-form-user .comment-form-auth{height:32px}.comment-form-user .comment-form-login{background-color:transparent;border:none;height:32px;width:32px;margin:0 0 0 5px;cursor:pointer}.comment-thread-form{text-align:center;color:#656c7a;line-height:32px}.comment-thread-form .comment-form-submit{background-color:rgba(29,47,58,0.6);border:none;white-space:nowrap;border-radius:4px;height:38px;width:120px;display:inline-block;cursor:pointer;line-height:38px;margin:10px 0;color:#fff;font-size:15px}.comment-thread-form .comment-form-submit:hover{background-color:rgba(29,47,58,0.75)}.comment-form-item{display:flex;margin:10px 0}.comment-form-item .comment-form-label{display:block;height:32px;line-height:32px;color:#656c7a;width:100px;text-align:right;font-weight:bold}.comment-form-item .comment-form-textarea{background-color:#fff;border:2px solid #dbdfe4;transition:all .2s linear;padding:2px 10px;border-radius:4px;height:64px;margin:0 5px;width:30px;line-height:20px;flex:auto}.comment-form-item .comment-form-textarea:focus{border:2px solid #c2c6cc}.comment-form-input{background-color:#fff;border:2px solid #dbdfe4;transition:all .2s linear;padding:0 7px;border-radius:4px;height:32px;margin:0 5px;width:30px;line-height:32px;flex:auto}.comment-form-input::-webkit-input-placeholder{color:#7f919e}.comment-form-input::-moz-placeholder{color:#7f919e}.comment-form-input:focus{border:2px solid #c2c6cc}.comment-form-input[disabled]{color:#656c7a}.comment-list:empty:after{content:attr(data-tips);display:block;opacity:.6;line-height:80px;text-align:center}.comment-list p{margin:0}.comment-list a{text-decoration:none;color:#288ce4}.comment-list a[href=\\\"javascript:void(0);\\\"]{color:#000;cursor:default}.comment-list code{line-height:20px;font-size:12px;font-family:monaco,menlo,monospace;padding:0 .3em;display:inline-block;vertical-align:top;margin:2px}.comment-list pre{overflow-x:auto;margin:0 0 15px;border-left:4px solid #7f919e;padding:0 0 0 12px}.comment-list pre code{display:block;overflow-y:hidden;white-space:pre;line-height:1.1}.comment-list #comment-preview{opacity:.6}.comment-list .comment-item{padding-top:6px}.comment-list .comment-item-body{display:flex;margin-bottom:5px}.comment-list .comment-item-header,.comment-list .comment-item-footer{line-height:1.2;color:#c2c6cc}.comment-list .comment-item-header .comment-item-bullet,.comment-list .comment-item-footer .comment-item-bullet{padding:0 2px}.comment-list .comment-item-header{font-size:13px}.comment-list .comment-item-header .comment-item-pname{color:#656c7a;position:relative}.comment-list .comment-item-header .comment-item-pname .icon{width:12px;height:12px;margin:1px 2px;vertical-align:top;fill:#656c7a}.comment-list .comment-item-header .comment-item-pname:hover{color:#2a2e2e}.comment-list .comment-item-header .comment-item-pname:hover .icon{fill:#656c7a}.comment-list .comment-item-header .comment-item-pname:hover .comment-item-parent{display:flex}.comment-list .comment-item-header .comment-item-parent{display:none;position:absolute;border-radius:3px;border:2px solid #dbdfe4;padding:5px;width:250px;background-color:#fff;align-items:center;height:48px;top:50%;margin-top:-24px;left:15px;line-height:18px;box-shadow:0 1px 1px 0 rgba(0,0,0,0.1)}.comment-list .comment-item-header .comment-item-parent .comment-item-pmain{width:calc(100% - 42px)}.comment-list .comment-item-header .comment-item-parent .comment-item-pheader{color:#656c7a}.comment-list .comment-item-header .comment-item-parent .comment-item-pcontent{font-size:12px;padding:0;overflow:hidden;white-space:nowrap;text-overflow:ellipsis}.comment-list .comment-item-header .comment-item-badge{color:#fff;background:#7f919e;padding:1px 3px;margin:0 2px;font-size:10px;line-height:1.1;font-weight:700;border-radius:3px;display:inline-block}.comment-list .comment-item-header .comment-item-time{font-size:12px;color:#7f919e;word-spacing:-2px;font-weight:400}.comment-list .comment-item-header .comment-item-name{color:#0095dd;font-weight:700}.comment-list .comment-item-header .comment-item-name[href^=\\\"javascript\\\"]{cursor:text;color:#000}.comment-list .comment-item-footer{font-size:12px;padding:5px 0}.comment-list .comment-item-footer .comment-item-reply,.comment-list .comment-item-footer .comment-item-edit,.comment-list .comment-item-footer .comment-item-delete{color:#656c7a;font-weight:500}.comment-list .comment-item-footer .comment-item-reply:hover,.comment-list .comment-item-footer .comment-item-edit:hover,.comment-list .comment-item-footer .comment-item-delete:hover{color:#2a2e2e}.comment-list .comment-item-footer .comment-item-cancel{color:#0095dd;font-weight:700}.comment-list .comment-item-image a{display:inline-block}.comment-list .comment-item-image img{display:block;border-radius:3px;max-width:100%;max-height:480px}.comment-list iframe{width:100%}.comment-list .comment-item.transparent{opacity:.4}.comment-list .comment-item-content{padding-top:5px;letter-spacing:.5px}.comment-list .comment-item-content spoiler{display:inline;background-color:#687a86;color:transparent;white-space:pre-wrap}.comment-list .comment-item-content spoiler:hover{color:#2e2e2e;background-color:transparent}.comment-list .comment-item-content p{margin-bottom:5px}.comment-list .comment-item-content p:last-child{margin-bottom:0}.comment-list .comment-item-content a[data-dsq-mention]:before{content:\\\"@\\\"}.comment-list .comment-item-content .comment-item-content{min-height:20px}.comment-list .comment-item-content img.emojione{vertical-align:top;width:24px;height:24px;margin:0 3px}.comment-list .comment-item-children .comment-item-avatar,.comment-list .comment-item-children .comment-item-avatar img,.comment-list .comment-item-children .comment-box .comment-avatar,.comment-list .comment-item-children .comment-box .comment-avatar-image,.comment-list .comment-item-body+.comment-box .comment-avatar,.comment-list .comment-item-body+.comment-box .comment-avatar-image{width:36px;height:36px;margin-right:6px;box-shadow:0 0.5px 0.5px 0 rgba(0,0,0,0.05)}.comment-list .comment-form-textarea{height:32px;padding:5px;line-height:22px;font-size:15px}.comment-list .comment-item-main{width:calc(100% - 60px)}.comment-list .comment-item-main:empty{line-height:48px}.comment-list .comment-item-main:empty:after{content:attr(data-message);line-height:36px;color:#7f919e}.comment-list .comment-box{margin:0}.comment-list .comment-box+.comment-item-body{display:none}.comment-list .comment-item-body+.comment-box{padding-left:60px;padding-top:6px;margin-bottom:20px}.comment-list .comment-item-children{padding-left:60px}.comment-list .comment-item-children .comment-item-main{width:calc(100% - 42px)}.comment-list .comment-item-children .comment-item-main:empty{line-height:36px}.comment-list .comment-item-children .comment-item-children,.comment-list .comment-item-children .comment-item-body+.comment-box{padding-left:42px}.comment-list .comment-item-children .comment-item-children .comment-item-children .comment-item-children,.comment-list .comment-item-children .comment-item-children .comment-item-children .comment-box,.comment-list .comment-item-children .comment-item-body+.comment-box .comment-item-children .comment-item-children,.comment-list .comment-item-children .comment-item-body+.comment-box .comment-item-children .comment-box{padding-left:0}.comment-list .comment-item-loadmore{font-size:13px;text-decoration:underline;display:block;margin:10px 0}.comment-loadmore{font-weight:500;display:block;text-align:center;padding:11px 14px;background-color:rgba(29,47,58,0.6);color:#fff !important;line-height:1.1;border-radius:3px;transition:background .2s;text-shadow:none}.comment-loadmore:hover{background-color:rgba(29,47,58,0.7)}.comment-loadmore.loading{background-color:#edeff2;color:#444 !important;cursor:wait}.comment-form-error{position:absolute;background-color:#fff;padding:10px;line-height:20px;border-radius:3px;box-shadow:0 0 5px 1px rgba(0,0,0,0.3);margin-top:40px;margin-left:2px;z-index:10}.comment-form-error:before{content:\\\"\\\";display:block;position:absolute;width:10px;height:10px;transform:rotate(45deg);background-color:#fff;box-shadow:0 0 5px 1px rgba(0,0,0,0.3);top:-4px;left:15px}.comment-form-error:after{content:\\\"\\\";display:block;position:absolute;width:20px;height:12px;top:0;left:10px;background-color:#fff}.comment-list,.comment-item-children{text-align:left;list-style:none;margin-left:0;line-height:20px}.comment-avatar,.comment-item-avatar{display:block;width:48px;height:48px;margin-right:12px}.comment-avatar img,.comment-item-avatar img{border-radius:3px;width:48px;height:48px}.mention-user{background-color:#fff;border-radius:2px;box-shadow:1px 1px 2px 1px rgba(29,47,58,0.2);position:absolute;overflow:hidden}.mention-user .mention-user-list{list-style:none}.mention-user .mention-user-item{height:30px;padding:3px;line-height:24px;font-size:12px;display:flex;cursor:default}.mention-user .mention-user-item.active{background-color:#2e9fff;color:#fff}.mention-user .mention-user-item.active .mention-user-name{color:#fff}.mention-user .mention-user-avatar{width:24px;height:24px;border-radius:3px;display:block}.mention-user .mention-user-username{font-weight:600;padding-left:4px}.mention-user .mention-user-name{color:#656c7a;padding-left:4px}.comment-related{color:#444;margin-top:20px;width:100%}.comment-related .comment-related-title{font-weight:700;text-transform:uppercase;color:rgba(34,59,74,0.5);margin-bottom:5px;white-space:nowrap;text-overflow:ellipsis}.comment-related .comment-related-forumname{color:#413a3a}.comment-related .related-list{display:flex;flex-wrap:wrap;list-style:none}.comment-related .related-list .related-item{width:48%;margin-bottom:10px}.comment-related .related-list .related-item:nth-child(odd){margin-right:4%}.comment-related .related-list .related-item-link{color:#000}.comment-related .related-list .related-item-link:hover .related-item-avatar{opacity:.8}.comment-related .related-list .related-item-link:hover .related-item-name{color:#aaa}.comment-related .related-list .related-item-title{display:block;overflow:hidden;font-weight:700}.comment-related .related-list .related-item-desc{color:rgba(30,55,70,0.4);font-weight:500;font-size:12px}.comment-related .related-list .related-item-post{padding:5px 0;display:flex}.comment-related .related-list .related-item-avatar{width:30px;height:30px;margin-right:5px;flex:none}.comment-related .related-list .related-item-avatar img{display:block;width:100%;border-radius:3px}.comment-related .related-list .related-item-main{flex:1;height:30px;line-height:15px;overflow:hidden;font-size:13px}.comment-related .related-list .related-item-name{color:rgba(30,55,70,0.4);font-weight:600}.comment-related .related-list .related-item-message{white-space:nowrap;overflow:hidden;text-overflow:ellipsis}.comment-reaction{display:flex;flex-direction:column}.comment-reaction .comment-reaction-header{text-align:center;line-height:25px}.comment-reaction .comment-reaction-list{display:flex;justify-content:center;list-style-type:none;flex-wrap:wrap;align-items:center}.comment-reaction .comment-reaction-list:not(:empty){padding:10px 0}.comment-reaction .comment-reaction-list .comment-reaction-item{display:flex;flex-direction:column;justify-content:center;align-items:center;font-size:12px;color:#656c7a;margin-right:10px}.comment-reaction .comment-reaction-list .comment-reaction-item:last-child{margin-right:0}.comment-reaction .comment-reaction-list .comment-reaction-btn{display:flex;align-items:center;padding:0 5px;border:1px solid #c2c6cc;border-radius:3px;height:30px;line-height:30px;max-width:100px;color:#656c7a}.comment-reaction .comment-reaction-list .comment-reaction-btn.selected{border-color:#656c7a}.comment-reaction .comment-reaction-list .comment-reaction-count{padding:5px 0}.comment-reaction .comment-reaction-list .comment-reaction-text{margin-left:5px}.comment-reaction .comment-reaction-list img{width:20px;height:20px}@-webkit-keyframes disqus-loader-spinner-animation{0%{transform:rotate(0)}100%{transform:rotate(360deg)}}@keyframes disqus-loader-spinner-animation{0%{transform:rotate(0)}100%{transform:rotate(360deg)}}@media screen and (max-width: 450px){.comment-reaction-text{display:none}.comment-form-wrapper.editing .comment-actions-form{margin:180px 0 0}.comment-form-wrapper.logged-in .comment-actions-form{margin:0}.comment-item .at{display:none}.comment-item .comment-avatar{display:none}.comment-item .comment-form{width:100%}.comment-item .comment-item-children .comment-item-children,.comment-item .comment-item-children .comment-box{padding-left:0 !important}.comment-item .comment-item-children .comment-item-avatar{display:none}.comment-item .comment-item-children .comment-item-main,.comment-item .comment-item-children .comment-form{width:100%}.comment-form-user{line-height:42px}.comment-form-user .comment-form-auth{margin:5px}.comment-form-user .comment-form-input{margin:5px;width:100%}.comment-related .related-list .related-item{width:100%;padding-left:10px}}\\n\", \"\"]);\n\n\n\n//# sourceURL=webpack://%5Bname%5D/./src/iDisqus.scss?./node_modules/css-loader/dist/cjs.js!./node_modules/postcss-loader/src??ref--4-2!./node_modules/sass-loader/dist/cjs.js");
+
+/***/ }),
+
+/***/ "./node_modules/css-loader/dist/runtime/api.js":
+/*!*****************************************************!*\
+ !*** ./node_modules/css-loader/dist/runtime/api.js ***!
+ \*****************************************************/
+/*! no static exports found */
+/***/ (function(module, exports, __webpack_require__) {
+
+"use strict";
+eval("\n\n/*\n MIT License http://www.opensource.org/licenses/mit-license.php\n Author Tobias Koppers @sokra\n*/\n// css base code, injected by the css-loader\nmodule.exports = function (useSourceMap) {\n var list = []; // return the list of modules as css string\n\n list.toString = function toString() {\n return this.map(function (item) {\n var content = cssWithMappingToString(item, useSourceMap);\n\n if (item[2]) {\n return '@media ' + item[2] + '{' + content + '}';\n } else {\n return content;\n }\n }).join('');\n }; // import a list of modules into the list\n\n\n list.i = function (modules, mediaQuery) {\n if (typeof modules === 'string') {\n modules = [[null, modules, '']];\n }\n\n var alreadyImportedModules = {};\n\n for (var i = 0; i < this.length; i++) {\n var id = this[i][0];\n\n if (id != null) {\n alreadyImportedModules[id] = true;\n }\n }\n\n for (i = 0; i < modules.length; i++) {\n var item = modules[i]; // skip already imported module\n // this implementation is not 100% perfect for weird media query combinations\n // when a module is imported multiple times with different media queries.\n // I hope this will never occur (Hey this way we have smaller bundles)\n\n if (item[0] == null || !alreadyImportedModules[item[0]]) {\n if (mediaQuery && !item[2]) {\n item[2] = mediaQuery;\n } else if (mediaQuery) {\n item[2] = '(' + item[2] + ') and (' + mediaQuery + ')';\n }\n\n list.push(item);\n }\n }\n };\n\n return list;\n};\n\nfunction cssWithMappingToString(item, useSourceMap) {\n var content = item[1] || '';\n var cssMapping = item[3];\n\n if (!cssMapping) {\n return content;\n }\n\n if (useSourceMap && typeof btoa === 'function') {\n var sourceMapping = toComment(cssMapping);\n var sourceURLs = cssMapping.sources.map(function (source) {\n return '/*# sourceURL=' + cssMapping.sourceRoot + source + ' */';\n });\n return [content].concat(sourceURLs).concat([sourceMapping]).join('\\n');\n }\n\n return [content].join('\\n');\n} // Adapted from convert-source-map (MIT)\n\n\nfunction toComment(sourceMap) {\n // eslint-disable-next-line no-undef\n var base64 = btoa(unescape(encodeURIComponent(JSON.stringify(sourceMap))));\n var data = 'sourceMappingURL=data:application/json;charset=utf-8;base64,' + base64;\n return '/*# ' + data + ' */';\n}\n\n//# sourceURL=webpack://%5Bname%5D/./node_modules/css-loader/dist/runtime/api.js?");
+
+/***/ }),
+
+/***/ "./node_modules/style-loader/lib/addStyles.js":
+/*!****************************************************!*\
+ !*** ./node_modules/style-loader/lib/addStyles.js ***!
+ \****************************************************/
+/*! no static exports found */
+/***/ (function(module, exports, __webpack_require__) {
+
+eval("/*\n\tMIT License http://www.opensource.org/licenses/mit-license.php\n\tAuthor Tobias Koppers @sokra\n*/\n\nvar stylesInDom = {};\n\nvar\tmemoize = function (fn) {\n\tvar memo;\n\n\treturn function () {\n\t\tif (typeof memo === \"undefined\") memo = fn.apply(this, arguments);\n\t\treturn memo;\n\t};\n};\n\nvar isOldIE = memoize(function () {\n\t// Test for IE <= 9 as proposed by Browserhacks\n\t// @see http://browserhacks.com/#hack-e71d8692f65334173fee715c222cb805\n\t// Tests for existence of standard globals is to allow style-loader\n\t// to operate correctly into non-standard environments\n\t// @see https://github.com/webpack-contrib/style-loader/issues/177\n\treturn window && document && document.all && !window.atob;\n});\n\nvar getTarget = function (target, parent) {\n if (parent){\n return parent.querySelector(target);\n }\n return document.querySelector(target);\n};\n\nvar getElement = (function (fn) {\n\tvar memo = {};\n\n\treturn function(target, parent) {\n // If passing function in options, then use it for resolve \"head\" element.\n // Useful for Shadow Root style i.e\n // {\n // insertInto: function () { return document.querySelector(\"#foo\").shadowRoot }\n // }\n if (typeof target === 'function') {\n return target();\n }\n if (typeof memo[target] === \"undefined\") {\n\t\t\tvar styleTarget = getTarget.call(this, target, parent);\n\t\t\t// Special case to return head of iframe instead of iframe itself\n\t\t\tif (window.HTMLIFrameElement && styleTarget instanceof window.HTMLIFrameElement) {\n\t\t\t\ttry {\n\t\t\t\t\t// This will throw an exception if access to iframe is blocked\n\t\t\t\t\t// due to cross-origin restrictions\n\t\t\t\t\tstyleTarget = styleTarget.contentDocument.head;\n\t\t\t\t} catch(e) {\n\t\t\t\t\tstyleTarget = null;\n\t\t\t\t}\n\t\t\t}\n\t\t\tmemo[target] = styleTarget;\n\t\t}\n\t\treturn memo[target]\n\t};\n})();\n\nvar singleton = null;\nvar\tsingletonCounter = 0;\nvar\tstylesInsertedAtTop = [];\n\nvar\tfixUrls = __webpack_require__(/*! ./urls */ \"./node_modules/style-loader/lib/urls.js\");\n\nmodule.exports = function(list, options) {\n\tif (typeof DEBUG !== \"undefined\" && DEBUG) {\n\t\tif (typeof document !== \"object\") throw new Error(\"The style-loader cannot be used in a non-browser environment\");\n\t}\n\n\toptions = options || {};\n\n\toptions.attrs = typeof options.attrs === \"object\" ? options.attrs : {};\n\n\t// Force single-tag solution on IE6-9, which has a hard limit on the # of <style>\n\t// tags it will allow on a page\n\tif (!options.singleton && typeof options.singleton !== \"boolean\") options.singleton = isOldIE();\n\n\t// By default, add <style> tags to the <head> element\n if (!options.insertInto) options.insertInto = \"head\";\n\n\t// By default, add <style> tags to the bottom of the target\n\tif (!options.insertAt) options.insertAt = \"bottom\";\n\n\tvar styles = listToStyles(list, options);\n\n\taddStylesToDom(styles, options);\n\n\treturn function update (newList) {\n\t\tvar mayRemove = [];\n\n\t\tfor (var i = 0; i < styles.length; i++) {\n\t\t\tvar item = styles[i];\n\t\t\tvar domStyle = stylesInDom[item.id];\n\n\t\t\tdomStyle.refs--;\n\t\t\tmayRemove.push(domStyle);\n\t\t}\n\n\t\tif(newList) {\n\t\t\tvar newStyles = listToStyles(newList, options);\n\t\t\taddStylesToDom(newStyles, options);\n\t\t}\n\n\t\tfor (var i = 0; i < mayRemove.length; i++) {\n\t\t\tvar domStyle = mayRemove[i];\n\n\t\t\tif(domStyle.refs === 0) {\n\t\t\t\tfor (var j = 0; j < domStyle.parts.length; j++) domStyle.parts[j]();\n\n\t\t\t\tdelete stylesInDom[domStyle.id];\n\t\t\t}\n\t\t}\n\t};\n};\n\nfunction addStylesToDom (styles, options) {\n\tfor (var i = 0; i < styles.length; i++) {\n\t\tvar item = styles[i];\n\t\tvar domStyle = stylesInDom[item.id];\n\n\t\tif(domStyle) {\n\t\t\tdomStyle.refs++;\n\n\t\t\tfor(var j = 0; j < domStyle.parts.length; j++) {\n\t\t\t\tdomStyle.parts[j](item.parts[j]);\n\t\t\t}\n\n\t\t\tfor(; j < item.parts.length; j++) {\n\t\t\t\tdomStyle.parts.push(addStyle(item.parts[j], options));\n\t\t\t}\n\t\t} else {\n\t\t\tvar parts = [];\n\n\t\t\tfor(var j = 0; j < item.parts.length; j++) {\n\t\t\t\tparts.push(addStyle(item.parts[j], options));\n\t\t\t}\n\n\t\t\tstylesInDom[item.id] = {id: item.id, refs: 1, parts: parts};\n\t\t}\n\t}\n}\n\nfunction listToStyles (list, options) {\n\tvar styles = [];\n\tvar newStyles = {};\n\n\tfor (var i = 0; i < list.length; i++) {\n\t\tvar item = list[i];\n\t\tvar id = options.base ? item[0] + options.base : item[0];\n\t\tvar css = item[1];\n\t\tvar media = item[2];\n\t\tvar sourceMap = item[3];\n\t\tvar part = {css: css, media: media, sourceMap: sourceMap};\n\n\t\tif(!newStyles[id]) styles.push(newStyles[id] = {id: id, parts: [part]});\n\t\telse newStyles[id].parts.push(part);\n\t}\n\n\treturn styles;\n}\n\nfunction insertStyleElement (options, style) {\n\tvar target = getElement(options.insertInto)\n\n\tif (!target) {\n\t\tthrow new Error(\"Couldn't find a style target. This probably means that the value for the 'insertInto' parameter is invalid.\");\n\t}\n\n\tvar lastStyleElementInsertedAtTop = stylesInsertedAtTop[stylesInsertedAtTop.length - 1];\n\n\tif (options.insertAt === \"top\") {\n\t\tif (!lastStyleElementInsertedAtTop) {\n\t\t\ttarget.insertBefore(style, target.firstChild);\n\t\t} else if (lastStyleElementInsertedAtTop.nextSibling) {\n\t\t\ttarget.insertBefore(style, lastStyleElementInsertedAtTop.nextSibling);\n\t\t} else {\n\t\t\ttarget.appendChild(style);\n\t\t}\n\t\tstylesInsertedAtTop.push(style);\n\t} else if (options.insertAt === \"bottom\") {\n\t\ttarget.appendChild(style);\n\t} else if (typeof options.insertAt === \"object\" && options.insertAt.before) {\n\t\tvar nextSibling = getElement(options.insertAt.before, target);\n\t\ttarget.insertBefore(style, nextSibling);\n\t} else {\n\t\tthrow new Error(\"[Style Loader]\\n\\n Invalid value for parameter 'insertAt' ('options.insertAt') found.\\n Must be 'top', 'bottom', or Object.\\n (https://github.com/webpack-contrib/style-loader#insertat)\\n\");\n\t}\n}\n\nfunction removeStyleElement (style) {\n\tif (style.parentNode === null) return false;\n\tstyle.parentNode.removeChild(style);\n\n\tvar idx = stylesInsertedAtTop.indexOf(style);\n\tif(idx >= 0) {\n\t\tstylesInsertedAtTop.splice(idx, 1);\n\t}\n}\n\nfunction createStyleElement (options) {\n\tvar style = document.createElement(\"style\");\n\n\tif(options.attrs.type === undefined) {\n\t\toptions.attrs.type = \"text/css\";\n\t}\n\n\tif(options.attrs.nonce === undefined) {\n\t\tvar nonce = getNonce();\n\t\tif (nonce) {\n\t\t\toptions.attrs.nonce = nonce;\n\t\t}\n\t}\n\n\taddAttrs(style, options.attrs);\n\tinsertStyleElement(options, style);\n\n\treturn style;\n}\n\nfunction createLinkElement (options) {\n\tvar link = document.createElement(\"link\");\n\n\tif(options.attrs.type === undefined) {\n\t\toptions.attrs.type = \"text/css\";\n\t}\n\toptions.attrs.rel = \"stylesheet\";\n\n\taddAttrs(link, options.attrs);\n\tinsertStyleElement(options, link);\n\n\treturn link;\n}\n\nfunction addAttrs (el, attrs) {\n\tObject.keys(attrs).forEach(function (key) {\n\t\tel.setAttribute(key, attrs[key]);\n\t});\n}\n\nfunction getNonce() {\n\tif (false) {}\n\n\treturn __webpack_require__.nc;\n}\n\nfunction addStyle (obj, options) {\n\tvar style, update, remove, result;\n\n\t// If a transform function was defined, run it on the css\n\tif (options.transform && obj.css) {\n\t result = typeof options.transform === 'function'\n\t\t ? options.transform(obj.css) \n\t\t : options.transform.default(obj.css);\n\n\t if (result) {\n\t \t// If transform returns a value, use that instead of the original css.\n\t \t// This allows running runtime transformations on the css.\n\t \tobj.css = result;\n\t } else {\n\t \t// If the transform function returns a falsy value, don't add this css.\n\t \t// This allows conditional loading of css\n\t \treturn function() {\n\t \t\t// noop\n\t \t};\n\t }\n\t}\n\n\tif (options.singleton) {\n\t\tvar styleIndex = singletonCounter++;\n\n\t\tstyle = singleton || (singleton = createStyleElement(options));\n\n\t\tupdate = applyToSingletonTag.bind(null, style, styleIndex, false);\n\t\tremove = applyToSingletonTag.bind(null, style, styleIndex, true);\n\n\t} else if (\n\t\tobj.sourceMap &&\n\t\ttypeof URL === \"function\" &&\n\t\ttypeof URL.createObjectURL === \"function\" &&\n\t\ttypeof URL.revokeObjectURL === \"function\" &&\n\t\ttypeof Blob === \"function\" &&\n\t\ttypeof btoa === \"function\"\n\t) {\n\t\tstyle = createLinkElement(options);\n\t\tupdate = updateLink.bind(null, style, options);\n\t\tremove = function () {\n\t\t\tremoveStyleElement(style);\n\n\t\t\tif(style.href) URL.revokeObjectURL(style.href);\n\t\t};\n\t} else {\n\t\tstyle = createStyleElement(options);\n\t\tupdate = applyToTag.bind(null, style);\n\t\tremove = function () {\n\t\t\tremoveStyleElement(style);\n\t\t};\n\t}\n\n\tupdate(obj);\n\n\treturn function updateStyle (newObj) {\n\t\tif (newObj) {\n\t\t\tif (\n\t\t\t\tnewObj.css === obj.css &&\n\t\t\t\tnewObj.media === obj.media &&\n\t\t\t\tnewObj.sourceMap === obj.sourceMap\n\t\t\t) {\n\t\t\t\treturn;\n\t\t\t}\n\n\t\t\tupdate(obj = newObj);\n\t\t} else {\n\t\t\tremove();\n\t\t}\n\t};\n}\n\nvar replaceText = (function () {\n\tvar textStore = [];\n\n\treturn function (index, replacement) {\n\t\ttextStore[index] = replacement;\n\n\t\treturn textStore.filter(Boolean).join('\\n');\n\t};\n})();\n\nfunction applyToSingletonTag (style, index, remove, obj) {\n\tvar css = remove ? \"\" : obj.css;\n\n\tif (style.styleSheet) {\n\t\tstyle.styleSheet.cssText = replaceText(index, css);\n\t} else {\n\t\tvar cssNode = document.createTextNode(css);\n\t\tvar childNodes = style.childNodes;\n\n\t\tif (childNodes[index]) style.removeChild(childNodes[index]);\n\n\t\tif (childNodes.length) {\n\t\t\tstyle.insertBefore(cssNode, childNodes[index]);\n\t\t} else {\n\t\t\tstyle.appendChild(cssNode);\n\t\t}\n\t}\n}\n\nfunction applyToTag (style, obj) {\n\tvar css = obj.css;\n\tvar media = obj.media;\n\n\tif(media) {\n\t\tstyle.setAttribute(\"media\", media)\n\t}\n\n\tif(style.styleSheet) {\n\t\tstyle.styleSheet.cssText = css;\n\t} else {\n\t\twhile(style.firstChild) {\n\t\t\tstyle.removeChild(style.firstChild);\n\t\t}\n\n\t\tstyle.appendChild(document.createTextNode(css));\n\t}\n}\n\nfunction updateLink (link, options, obj) {\n\tvar css = obj.css;\n\tvar sourceMap = obj.sourceMap;\n\n\t/*\n\t\tIf convertToAbsoluteUrls isn't defined, but sourcemaps are enabled\n\t\tand there is no publicPath defined then lets turn convertToAbsoluteUrls\n\t\ton by default. Otherwise default to the convertToAbsoluteUrls option\n\t\tdirectly\n\t*/\n\tvar autoFixUrls = options.convertToAbsoluteUrls === undefined && sourceMap;\n\n\tif (options.convertToAbsoluteUrls || autoFixUrls) {\n\t\tcss = fixUrls(css);\n\t}\n\n\tif (sourceMap) {\n\t\t// http://stackoverflow.com/a/26603875\n\t\tcss += \"\\n/*# sourceMappingURL=data:application/json;base64,\" + btoa(unescape(encodeURIComponent(JSON.stringify(sourceMap)))) + \" */\";\n\t}\n\n\tvar blob = new Blob([css], { type: \"text/css\" });\n\n\tvar oldSrc = link.href;\n\n\tlink.href = URL.createObjectURL(blob);\n\n\tif(oldSrc) URL.revokeObjectURL(oldSrc);\n}\n\n\n//# sourceURL=webpack://%5Bname%5D/./node_modules/style-loader/lib/addStyles.js?");
+
+/***/ }),
+
+/***/ "./node_modules/style-loader/lib/urls.js":
+/*!***********************************************!*\
+ !*** ./node_modules/style-loader/lib/urls.js ***!
+ \***********************************************/
+/*! no static exports found */
+/***/ (function(module, exports) {
+
+eval("\n/**\n * When source maps are enabled, `style-loader` uses a link element with a data-uri to\n * embed the css on the page. This breaks all relative urls because now they are relative to a\n * bundle instead of the current page.\n *\n * One solution is to only use full urls, but that may be impossible.\n *\n * Instead, this function \"fixes\" the relative urls to be absolute according to the current page location.\n *\n * A rudimentary test suite is located at `test/fixUrls.js` and can be run via the `npm test` command.\n *\n */\n\nmodule.exports = function (css) {\n // get current location\n var location = typeof window !== \"undefined\" && window.location;\n\n if (!location) {\n throw new Error(\"fixUrls requires window.location\");\n }\n\n\t// blank or null?\n\tif (!css || typeof css !== \"string\") {\n\t return css;\n }\n\n var baseUrl = location.protocol + \"//\" + location.host;\n var currentDir = baseUrl + location.pathname.replace(/\\/[^\\/]*$/, \"/\");\n\n\t// convert each url(...)\n\t/*\n\tThis regular expression is just a way to recursively match brackets within\n\ta string.\n\n\t /url\\s*\\( = Match on the word \"url\" with any whitespace after it and then a parens\n\t ( = Start a capturing group\n\t (?: = Start a non-capturing group\n\t [^)(] = Match anything that isn't a parentheses\n\t | = OR\n\t \\( = Match a start parentheses\n\t (?: = Start another non-capturing groups\n\t [^)(]+ = Match anything that isn't a parentheses\n\t | = OR\n\t \\( = Match a start parentheses\n\t [^)(]* = Match anything that isn't a parentheses\n\t \\) = Match a end parentheses\n\t ) = End Group\n *\\) = Match anything and then a close parens\n ) = Close non-capturing group\n * = Match anything\n ) = Close capturing group\n\t \\) = Match a close parens\n\n\t /gi = Get all matches, not the first. Be case insensitive.\n\t */\n\tvar fixedCss = css.replace(/url\\s*\\(((?:[^)(]|\\((?:[^)(]+|\\([^)(]*\\))*\\))*)\\)/gi, function(fullMatch, origUrl) {\n\t\t// strip quotes (if they exist)\n\t\tvar unquotedOrigUrl = origUrl\n\t\t\t.trim()\n\t\t\t.replace(/^\"(.*)\"$/, function(o, $1){ return $1; })\n\t\t\t.replace(/^'(.*)'$/, function(o, $1){ return $1; });\n\n\t\t// already a full url? no change\n\t\tif (/^(#|data:|http:\\/\\/|https:\\/\\/|file:\\/\\/\\/|\\s*$)/i.test(unquotedOrigUrl)) {\n\t\t return fullMatch;\n\t\t}\n\n\t\t// convert the url to a full url\n\t\tvar newUrl;\n\n\t\tif (unquotedOrigUrl.indexOf(\"//\") === 0) {\n\t\t \t//TODO: should we add protocol?\n\t\t\tnewUrl = unquotedOrigUrl;\n\t\t} else if (unquotedOrigUrl.indexOf(\"/\") === 0) {\n\t\t\t// path should be relative to the base url\n\t\t\tnewUrl = baseUrl + unquotedOrigUrl; // already starts with '/'\n\t\t} else {\n\t\t\t// path should be relative to current directory\n\t\t\tnewUrl = currentDir + unquotedOrigUrl.replace(/^\\.\\//, \"\"); // Strip leading './'\n\t\t}\n\n\t\t// send back the fixed url(...)\n\t\treturn \"url(\" + JSON.stringify(newUrl) + \")\";\n\t});\n\n\t// send back the fixed css\n\treturn fixedCss;\n};\n\n\n//# sourceURL=webpack://%5Bname%5D/./node_modules/style-loader/lib/urls.js?");
+
+/***/ }),
+
+/***/ "./node_modules/webpack/buildin/module.js":
+/*!***********************************!*\
+ !*** (webpack)/buildin/module.js ***!
+ \***********************************/
+/*! no static exports found */
+/***/ (function(module, exports) {
+
+eval("module.exports = function(module) {\n\tif (!module.webpackPolyfill) {\n\t\tmodule.deprecate = function() {};\n\t\tmodule.paths = [];\n\t\t// module.parent = undefined by default\n\t\tif (!module.children) module.children = [];\n\t\tObject.defineProperty(module, \"loaded\", {\n\t\t\tenumerable: true,\n\t\t\tget: function() {\n\t\t\t\treturn module.l;\n\t\t\t}\n\t\t});\n\t\tObject.defineProperty(module, \"id\", {\n\t\t\tenumerable: true,\n\t\t\tget: function() {\n\t\t\t\treturn module.i;\n\t\t\t}\n\t\t});\n\t\tmodule.webpackPolyfill = 1;\n\t}\n\treturn module;\n};\n\n\n//# sourceURL=webpack://%5Bname%5D/(webpack)/buildin/module.js?");
+
+/***/ }),
+
+/***/ "./src/iDisqus.js":
+/*!************************!*\
+ !*** ./src/iDisqus.js ***!
+ \************************/
+/*! no static exports found */
+/***/ (function(module, exports, __webpack_require__) {
+
+eval("/* WEBPACK VAR INJECTION */(function(module) {var __WEBPACK_AMD_DEFINE_RESULT__;/*!\r\n * \r\n * @author fooleap\r\n * @email fooleap@gmail.com\r\n * @create 2017-06-17 20:48:25\r\n * @update 2021-05-11 11:58:38\r\n * @version 0.2.31\r\n * Copyright 2017-2021 fooleap\r\n * Released under the MIT license\r\n */\r\n__webpack_require__(/*! ./iDisqus.scss */ \"./src/iDisqus.scss\");\r\n(function (global) {\r\n 'use strict';\r\n\r\n var d = document,\r\n l = localStorage,\r\n scripts = d.scripts,\r\n lasturl = scripts[scripts.length - 1].src,\r\n filepath = lasturl.substring(0, lasturl.lastIndexOf('/')),\r\n isEdge = navigator.userAgent.indexOf(\"Edge\") > -1,\r\n isIE = !!window.ActiveXObject || \"ActiveXObject\" in window;\r\n\r\n function getLocation(href) {\r\n var link = d.createElement('a');\r\n link.href = href;\r\n return link;\r\n }\r\n\r\n function getAjax(url, success, error) {\r\n var xhr = new XMLHttpRequest();\r\n xhr.open('GET', encodeURI(url));\r\n xhr.onreadystatechange = function () {\r\n if (xhr.readyState == 4 && xhr.status == 200) {\r\n success(xhr.responseText);\r\n }\r\n }\r\n xhr.onerror = error;\r\n xhr.withCredentials = true;\r\n xhr.send();\r\n return xhr;\r\n }\r\n\r\n function postAjax(url, data, success, error) {\r\n var params = typeof data == 'string' ? data : Object.keys(data).filter(function (k) {\r\n return data[k] != null;\r\n }).map(function (k) {\r\n return encodeURIComponent(k) + '=' + encodeURIComponent(data[k])\r\n }).join('&');\r\n\r\n var xhr = new XMLHttpRequest();\r\n xhr.open('POST', url);\r\n xhr.onreadystatechange = function () {\r\n if (xhr.readyState == 4 && xhr.status == 200) {\r\n success(xhr.responseText);\r\n }\r\n };\r\n xhr.onerror = error;\r\n xhr.withCredentials = true;\r\n xhr.setRequestHeader('Content-Type', 'application/x-www-form-urlencoded');\r\n xhr.send(params);\r\n return xhr;\r\n }\r\n\r\n function generateGUID() {\r\n var time = Number(new Date().getTime().toString().substring(3));\r\n var guid = Math.abs(time + Math.floor(Math.random() * 1e5) - 48 * 1e6 + Math.floor(Math.random() * 1e6)).toString(32);\r\n guid += Math.floor(Math.random() * 1e9).toString(32);\r\n return guid;\r\n }\r\n\r\n (function (ElementProto) {\r\n // matches & closest polyfill https://github.com/jonathantneal/closest\r\n if (typeof ElementProto.matches !== 'function') {\r\n ElementProto.matches = ElementProto.msMatchesSelector || ElementProto.mozMatchesSelector || ElementProto.webkitMatchesSelector || function matches(selector) {\r\n var element = this;\r\n var elements = (element.document || element.ownerDocument).querySelectorAll(selector);\r\n var index = 0;\r\n\r\n while (elements[index] && elements[index] !== element) {\r\n ++index;\r\n }\r\n\r\n return Boolean(elements[index]);\r\n };\r\n }\r\n\r\n if (typeof ElementProto.closest !== 'function') {\r\n ElementProto.closest = function closest(selector) {\r\n var element = this;\r\n\r\n while (element && element.nodeType === 1) {\r\n if (element.matches(selector)) {\r\n return element;\r\n }\r\n\r\n element = element.parentNode;\r\n }\r\n\r\n return null;\r\n };\r\n }\r\n\r\n // 事件委托\r\n ElementProto.on = function on(eventName, selector, handler) {\r\n this.addEventListener(eventName, function (e) {\r\n for (var target = e.target; target && target != this; target = target.parentNode) {\r\n if (target.matches(selector)) {\r\n handler.call(null, e, target);\r\n break;\r\n }\r\n }\r\n }, true);\r\n };\r\n\r\n })(window.Element.prototype);\r\n\r\n // 访客信息\r\n var User = function () {\r\n this.dom = arguments[0];\r\n this.opts = arguments[1];\r\n this.init();\r\n this.autologin();\r\n }\r\n\r\n User.prototype = {\r\n // 初始化访客信息\r\n init: function () {\r\n var _ = this;\r\n // 读取访客信息\r\n _.name = l.getItem('name');\r\n _.email = l.getItem('email');\r\n _.url = l.getItem('url');\r\n _.avatar = l.getItem('avatar');\r\n _.type = l.getItem('type');\r\n _.logged_in = l.getItem('logged_in');\r\n _.unique = l.getItem('disqus_unique')\r\n if (!l.getItem('vote')) {\r\n l.setItem('vote', JSON.stringify({}));\r\n }\r\n if (!l.getItem('reaction_vote')) {\r\n l.setItem('reaction_vote', JSON.stringify({}));\r\n }\r\n _.vote = JSON.parse(l.getItem('vote'));\r\n _.reactionVote = JSON.parse(l.getItem('reaction_vote'));\r\n\r\n var boxarr = _.dom.getElementsByClassName('comment-box');\r\n if (_.logged_in == 'true') {\r\n [].forEach.call(boxarr, function (item) {\r\n if (_.type == '1') {\r\n item.querySelector('.comment-form-wrapper').classList.add('logged-in');\r\n }\r\n item.querySelector('.comment-form-name').value = _.name;\r\n item.querySelector('.comment-form-email').value = _.email;\r\n item.querySelector('.comment-form-url').value = _.url;\r\n item.querySelector('.comment-avatar-image').src = _.avatar;\r\n });\r\n } else {\r\n [].forEach.call(boxarr, function (item) {\r\n item.querySelector('.comment-form-wrapper').classList.remove('logged-in');\r\n item.querySelector('.comment-form-name').value = '';\r\n item.querySelector('.comment-form-email').value = '';\r\n item.querySelector('.comment-form-url').value = '';\r\n item.querySelector('.comment-avatar-image').src = _.dom.querySelector('.comment-avatar-image').dataset.avatar;\r\n });\r\n l.setItem('logged_in', 'false');\r\n }\r\n\r\n if (_.type == '1' && _.logged_in == 'true') {\r\n var $login = _.dom.querySelector('.comment-login');\r\n if (!!$login) {\r\n $login.innerHTML = _.name + '<label class=\"comment-logout\" title=\"退出\" for=\"comment-user\">退出登录</label>';\r\n $login.title = _.name;\r\n $login.classList.add('comment-user');\r\n $login.classList.remove('comment-login');\r\n _.dom.querySelector('#comment-user').checked = false;\r\n }\r\n } else {\r\n var $user = _.dom.querySelector('.comment-user');\r\n if (!!$user) {\r\n $user.innerHTML = '登录';\r\n $user.title = '使用 Disqus 帐号授权登录';\r\n $user.classList.add('comment-login');\r\n $user.classList.remove('comment-user');\r\n }\r\n }\r\n\r\n },\r\n\r\n // 自动登录\r\n autologin: function () {\r\n var _ = this;\r\n getAjax(_.opts.api + '/user.php', function (resp) {\r\n var data = JSON.parse(resp);\r\n if (data.code == 0) {\r\n var user = data.response;\r\n _.avatar = user.avatar;\r\n _.name = user.name;\r\n _.username = user.username;\r\n _.url = user.url;\r\n _.type = user.type\r\n _.submit();\r\n } else {\r\n if (_.type == '1') {\r\n l.setItem('logged_in', 'false');\r\n _.init();\r\n } else {\r\n l.setItem('type', '0');\r\n if (!_.unique) {\r\n l.setItem('disqus_unique', generateGUID());\r\n }\r\n _.init();\r\n }\r\n }\r\n }, function () {\r\n })\r\n },\r\n\r\n // 登录\r\n login: function () {\r\n\r\n var _ = this;\r\n var popup = window.open(_.opts.api + '/login.php', 'Disqus Oauth', 'width=470,height=508');\r\n var timer;\r\n function isLogged() {\r\n if (!popup || !popup.closed) return;\r\n clearInterval(timer);\r\n _.user.autologin();\r\n }\r\n timer = setInterval(isLogged, 100);\r\n\r\n },\r\n\r\n // 退出登录\r\n logout: function () {\r\n var _ = this;\r\n postAjax(_.opts.api + '/logout.php', {}, function (resp) {\r\n l.setItem('logged_in', 'false');\r\n l.removeItem('type');\r\n l.removeItem('email');\r\n l.removeItem('avatar');\r\n l.removeItem('name');\r\n l.removeItem('url');\r\n l.removeItem('disqus_unique');\r\n l.removeItem('vote');\r\n l.removeItem('reaction_vote');\r\n _.user.init();\r\n })\r\n },\r\n\r\n // 提交访客信息\r\n submit: function () {\r\n var _ = this;\r\n l.setItem('email', _.email);\r\n l.setItem('type', _.type);\r\n l.setItem('name', _.name);\r\n l.setItem('url', _.url);\r\n l.setItem('avatar', _.avatar);\r\n l.setItem('disqus_unique', _.unique);\r\n l.setItem('logged_in', 'true');\r\n this.init();\r\n }\r\n }\r\n\r\n var iDisqus = function () {\r\n var _ = this;\r\n\r\n // 配置\r\n _.opts = typeof (arguments[1]) == 'object' ? arguments[1] : arguments[0];\r\n _.dom = d.getElementById(typeof (arguments[0]) == 'string' ? arguments[0] : 'comment');\r\n _.opts.api = _.opts.api.slice(-1) == '/' ? _.opts.api.slice(0, -1) : _.opts.api;\r\n _.opts.site = _.opts.site || location.origin;\r\n if (!!_.opts.url) {\r\n var optsUrl = _.opts.url.replace(_.opts.site, '');\r\n _.opts.url = optsUrl.slice(0, 1) != '/' ? '/' + optsUrl : optsUrl;\r\n } else if (isEdge || isIE) {\r\n _.opts.url = encodeURI(location.pathname) + encodeURI(location.search);\r\n } else {\r\n _.opts.url = location.pathname + location.search;\r\n }\r\n _.opts.identifier = _.opts.identifier || _.opts.url;\r\n _.opts.link = _.opts.site + _.opts.url;\r\n _.opts.title = _.opts.title || d.title;\r\n _.opts.slug = !!_.opts.slug ? _.opts.slug.replace(/[^A-Za-z0-9_-]+/g, '') : '';\r\n _.opts.desc = _.opts.desc || (!!d.querySelector('[name=\"description\"]') ? d.querySelector('[name=\"description\"]').content : '');\r\n _.opts.mode = _.opts.mode || 1;\r\n _.opts.timeout = _.opts.timeout || 3000;\r\n _.opts.toggle = !!_.opts.toggle ? d.getElementById(_.opts.toggle) : null;\r\n _.opts.autoCreate = !!_.opts.autoCreate || !!_.opts.auto;\r\n _.opts.relatedType = _.opts.relatedType || 'related'\r\n\r\n // emoji 表情\r\n _.opts.emojiPath = _.opts.emojiPath || _.opts.emoji_path || 'https://github.githubassets.com/images/icons/emoji/unicode/';\r\n _.emojiList = _.opts.emojiList || _.opts.emoji_list || [{\r\n code: 'smile',\r\n title: '笑脸',\r\n unicode: '1f604'\r\n }, {\r\n code: 'mask',\r\n title: '生病',\r\n unicode: '1f637'\r\n }, {\r\n code: 'joy',\r\n title: '破涕为笑',\r\n unicode: '1f602'\r\n }, {\r\n code: 'stuck_out_tongue_closed_eyes',\r\n title: '吐舌',\r\n unicode: '1f61d'\r\n }, {\r\n code: 'flushed',\r\n title: '脸红',\r\n unicode: '1f633'\r\n }, {\r\n code: 'scream',\r\n title: '恐惧',\r\n unicode: '1f631'\r\n }, {\r\n code: 'pensive',\r\n title: '失望',\r\n unicode: '1f614'\r\n }, {\r\n code: 'unamused',\r\n title: '无语',\r\n unicode: '1f612'\r\n }, {\r\n code: 'grin',\r\n title: '露齿笑',\r\n unicode: '1f601'\r\n }, {\r\n code: 'heart_eyes',\r\n title: '色',\r\n unicode: '1f60d'\r\n }, {\r\n code: 'sweat',\r\n title: '汗',\r\n unicode: '1f613'\r\n }, {\r\n code: 'smirk',\r\n title: '得意',\r\n unicode: '1f60f'\r\n }, {\r\n code: 'relieved',\r\n title: '满意',\r\n unicode: '1f60c'\r\n }, {\r\n code: 'rolling_eyes',\r\n title: '翻白眼',\r\n unicode: '1f644'\r\n }, {\r\n code: 'ok_hand',\r\n title: 'OK',\r\n unicode: '1f44c'\r\n }, {\r\n code: 'v',\r\n title: '胜利',\r\n unicode: '270c'\r\n }];\r\n\r\n if (!!_.opts.emoji_preview || !!_.opts.emojiPreview) {\r\n getAjax(_.opts.api + '/eac.php', function (resp) {\r\n _.eac = JSON.parse(resp);\r\n }, function () {\r\n })\r\n }\r\n\r\n // 默认状态\r\n _.stat = {\r\n current: 'idisqus', // 当前显示评论框\r\n loaded: false, // 评论框已加载\r\n loading: false, // 评论加载中\r\n editing: false, // 评论编辑中\r\n offsetTop: 0, // 高度位置\r\n next: null, // 下条评论\r\n message: null, // 新评论\r\n mediaHtml: null, // 新上传图片\r\n forum: {}, // 站点信息\r\n thread: {}, // 文章信息\r\n post: {}, // 评论数据\r\n media: {}, // 媒体信息\r\n root: [], // 根评论\r\n order: 'desc', // 排序\r\n users: [], // Disqus 会员\r\n imageSize: [], // 已上传图片大小\r\n disqusLoaded: false // Disqus 已加载\r\n };\r\n\r\n // Disqus 评论框设置\r\n window.disqus_config = function () {\r\n this.page.identifier = _.opts.identifier;\r\n this.page.title = _.opts.title;\r\n this.page.url = _.opts.link;\r\n this.callbacks.onReady.push(function () {\r\n _.stat.current = 'disqus';\r\n _.stat.disqusLoaded = true;\r\n _.dom.querySelector('#idisqus').style.display = 'none';\r\n _.dom.querySelector('#disqus_thread').style.display = 'block';\r\n if (_.opts.mode == 3 && !!_.opts.toggle) {\r\n _.opts.toggle.disabled = '';\r\n _.opts.toggle.checked = true;\r\n _.opts.toggle.addEventListener('change', _.handle.toggle, false);\r\n }\r\n });\r\n // 原生评论框发邮件\r\n this.callbacks.onNewComment = [function (comment, a) {\r\n var postData = {\r\n id: comment.id\r\n }\r\n // 异步发送邮件\r\n setTimeout(function () {\r\n postAjax(_.opts.api + '/sendemail.php', postData, function (resp) {\r\n console.info('邮件发送成功!');\r\n })\r\n }, 2000);\r\n }];\r\n }\r\n\r\n // 自动初始化\r\n if (!!_.opts.init) {\r\n _.init();\r\n //console.log(_);\r\n }\r\n }\r\n\r\n // TimeAgo https://coderwall.com/p/uub3pw/javascript-timeago-func-e-g-8-hours-ago\r\n iDisqus.prototype.timeAgo = function () {\r\n\r\n var _ = this;\r\n var templates = {\r\n prefix: \"\",\r\n suffix: \"前\",\r\n seconds: \"几秒\",\r\n minute: \"1分钟\",\r\n minutes: \"%d分钟\",\r\n hour: \"1小时\",\r\n hours: \"%d小时\",\r\n day: \"1天\",\r\n days: \"%d天\",\r\n week: \"1周\",\r\n weeks: \"%d周\",\r\n month: \"1个月\",\r\n months: \"%d个月\",\r\n year: \"1年\",\r\n years: \"%d年\"\r\n };\r\n var template = function (t, n) {\r\n return templates[t] && templates[t].replace(/%d/i, Math.abs(Math.round(n)));\r\n };\r\n\r\n var timer = function (time) {\r\n if (!time) return;\r\n time = time.replace(/\\.\\d+/, \"\"); // remove milliseconds\r\n time = time.replace(/-/, \"/\").replace(/-/, \"/\");\r\n time = time.replace(/T/, \" \").replace(/Z/, \" UTC\");\r\n time = time.replace(/([\\+\\-]\\d\\d)\\:?(\\d\\d)/, \" $1$2\"); // -04:00 -> -0400\r\n time = new Date(time * 1000 || time);\r\n\r\n var now = new Date();\r\n var seconds = ((now.getTime() - time) * .001) >> 0;\r\n var minutes = seconds / 60;\r\n var hours = minutes / 60;\r\n var days = hours / 24;\r\n var weeks = days / 7;\r\n var months = days / 30;\r\n var years = days / 365;\r\n\r\n return templates.prefix + (seconds < 45 && template('seconds', seconds) || seconds < 90 && template('minute', 1) || minutes < 45 && template('minutes', minutes) || minutes < 90 && template('hour', 1) || hours < 24 && template('hours', hours) || hours < 42 && template('day', 1) || days < 30 && template('days', days) || days < 45 && template('month', 1) || days < 365 && template('months', months) || years < 1.5 && template('year', 1) || template('years', years)) + templates.suffix;\r\n };\r\n\r\n var elements = _.dom.querySelectorAll('time[datetime]');\r\n for (var i in elements) {\r\n var $this = elements[i];\r\n if (typeof $this === 'object') {\r\n $this.title = new Date($this.getAttribute('datetime'));\r\n $this.innerHTML = timer($this.getAttribute('datetime'));\r\n }\r\n }\r\n\r\n // update time every minute\r\n setTimeout(_.timeAgo.bind(_), 60000);\r\n\r\n }\r\n\r\n // 初始化评论框\r\n iDisqus.prototype.init = function () {\r\n var _ = this;\r\n if (!_.dom) {\r\n //console.log('该页面没有评论框!');\r\n return\r\n }\r\n // 表情\r\n var emojiList = '';\r\n _.emojiList.forEach(function (item) {\r\n emojiList += '<li class=\"emojione-item\" title=\"' + item.title + '\" data-code=\":' + item.code + ':\"><img class=\"emojione-item-image\" src=\"' + _.opts.emojiPath + item.unicode + '.png\" /></li>';\r\n })\r\n _.dom.innerHTML = `<div class=\"comment init\" id=\"idisqus\">\r\n <div class=\"comment-reaction\">\r\n <div class=\"comment-reaction-header\">\r\n <div class=\"comment-reaction-prompt\"></div>\r\n <div class=\"comment-reaction-total\"></div>\r\n </div>\r\n <div class=\"comment-reaction-list\"></div>\r\n </div>\r\n <div class=\"init-container\" data-tips=\"正在初始化……\"><svg class=\"init-bg\" width=\"72\" height=\"72\" viewBox=\"0 0 720 720\" version=\"1.1\" xmlns=\"http://www.w3.org/2000/svg\"><path class=\"ring\" fill=\"none\" stroke=\"#9d9ea1\" d=\"M 0 -260 A 260 260 0 1 1 -80 -260\" transform=\"translate(400,400)\" stroke-width=\"50\" /><polygon transform=\"translate(305,20)\" points=\"50,0 0,100 18,145 50,82 92,145 100,100\" style=\"fill:#9d9ea1\"/></svg></div>\r\n <div class=\"comment-header\">\r\n <div class=\"comment-header-primary\">\r\n <span class=\"comment-header-item\" id=\"comment-count\">评论</span>\r\n <a class=\"comment-header-item\" id=\"comment-link\" target=\"_blank\">在线讨论</a>\r\n </div>\r\n <div class=\"comment-header-menu\">\r\n <input class=\"comment-header-checkbox\" type=\"checkbox\" id=\"comment-user\">\r\n <label class=\"comment-header-item comment-login\" title=\"使用 Disqus 帐号授权登录\" for=\"comment-user\">登录</label>\r\n </div>\r\n </div>\r\n <div class=\"comment-navbar\">\r\n <div class=\"comment-navbar-item\">\r\n <a class=\"comment-recommend\" href=\"javascript:;\"><svg t=\"1537508059126\" class=\"icon\" style=\"\" viewBox=\"0 0 1024 1024\" version=\"1.1\" xmlns=\"http://www.w3.org/2000/svg\" p-id=\"3234\" xmlns:xlink=\"http://www.w3.org/1999/xlink\" width=\"24\" height=\"24\"><path d=\"M489.993 887.107 177.906 586.021c-4.002-3.501-114.033-104.031-114.033-224.063 0-146.54 89.526-234.065 239.069-234.065 87.523 0 169.546 69.019 209.058 108.03 39.512-39.011 121.535-108.03 209.059-108.03 149.542 0 239.068 87.525 239.068 234.065 0 120.033-110.031 220.563-114.533 225.065L534.007 887.107c-6 6-14.003 9-22.007 9C503.997 896.107 495.993 893.107 489.993 887.107z\" p-id=\"3235\"></path></svg><span class=\"comment-recommend-text\">推荐</span><span class=\"comment-recommend-count\"></span></a>\r\n </div>\r\n <div class=\"comment-navbar-item comment-order\">\r\n <input class=\"comment-order-radio\" id=\"order-popular\" type=\"radio\" name=\"comment-order\" value=\"popular\" />\r\n <label class=\"comment-order-label\" for=\"order-popular\" title=\"按评分高低排序\">最佳</label>\r\n <input class=\"comment-order-radio\" id=\"order-desc\" type=\"radio\" name=\"comment-order\" value=\"desc\" />\r\n <label class=\"comment-order-label\" for=\"order-desc\" title=\"按从新到旧排序\">最新</label>\r\n <input class=\"comment-order-radio\" id=\"order-asc\" type=\"radio\" name=\"comment-order\" value=\"asc\" />\r\n <label class=\"comment-order-label\" for=\"order-asc\" title=\"按从旧到新排序\">最早</label>\r\n </div>\r\n </div>\r\n <div class=\"comment-box\">\r\n <div class=\"comment-avatar avatar\"><img class=\"comment-avatar-image\" src=\"//a.disquscdn.com/images/noavatar92.png\" data-avatar=\"//a.disquscdn.com/images/noavatar92.png\"></div>\r\n <div class=\"comment-form\">\r\n <div class=\"comment-form-wrapper\">\r\n <textarea class=\"comment-form-textarea\" placeholder=\"加入讨论……\"></textarea>\r\n <div class=\"comment-form-alert\"></div>\r\n <div class=\"comment-image\">\r\n <ul class=\"comment-image-list\"></ul>\r\n <div class=\"comment-image-progress\"><div class=\"comment-image-loaded\"></div></div>\r\n </div>\r\n \r\n <div class=\"comment-actions\">\r\n \r\n <div class=\"comment-actions-group\">\r\n <input id=\"emoji-input\" class=\"comment-actions-input\" type=\"checkbox\">\r\n <label class=\"comment-actions-label emojione\" for=\"emoji-input\">\r\n <svg class=\"icon\" fill=\"#c2c6cc\" viewBox=\"0 0 1024 1024\" version=\"1.1\" xmlns=\"http://www.w3.org/2000/svg\" xmlns:xlink=\"http://www.w3.org/1999/xlink\" width=\"200\" height=\"200\">\r\n <g>\r\n <title>选择表情</title>\r\n <path d=\"M512 1024c-282.713043 0-512-229.286957-512-512s229.286957-512 512-512c282.713043 0 512 229.286957 512 512S792.486957 1024 512 1024zM512 44.521739c-258.226087 0-467.478261 209.252174-467.478261 467.478261 0 258.226087 209.252174 467.478261 467.478261 467.478261s467.478261-209.252174 467.478261-467.478261C979.478261 253.773913 768 44.521739 512 44.521739z\"></path>\r\n <path d=\"M801.391304 554.295652c0 160.278261-129.113043 289.391304-289.391304 289.391304s-289.391304-129.113043-289.391304-289.391304L801.391304 554.295652z\"></path>\r\n <path d=\"M674.504348 349.495652m-57.878261 0a2.6 2.6 0 1 0 115.756522 0 2.6 2.6 0 1 0-115.756522 0Z\"></path>\r\n <path d=\"M347.269565 349.495652m-57.878261 0a2.6 2.6 0 1 0 115.756522 0 2.6 2.6 0 1 0-115.756522 0Z\"></path>\r\n </g>\r\n </svg>\r\n <ul class=\"emojione-list\">${ emojiList}</ul>\r\n </label>\r\n <input id=\"upload-input\" class=\"comment-actions-input comment-image-input\" type=\"file\" accept=\"image/*\" name=\"file\">\r\n <label class=\"comment-actions-label\" for=\"upload-input\">\r\n <svg class=\"icon\" fill=\"#c2c6cc\" viewBox=\"0 0 1024 1024\" version=\"1.1\" xmlns=\"http://www.w3.org/2000/svg\" xmlns:xlink=\"http://www.w3.org/1999/xlink\" width=\"200\" height=\"200\">\r\n <g>\r\n <title>上传图片</title>\r\n <path d=\"M15.515152 15.515152 15.515152 15.515152 15.515152 15.515152Z\"></path>\r\n <path d=\"M15.515152 139.636364l0 806.787879 992.969697 0 0-806.787879-992.969697 0zM946.424242 884.363636l-868.848485 0 0-682.666667 868.848485 0 0 682.666667zM698.181818 356.848485c0-51.417212 41.673697-93.090909 93.090909-93.090909s93.090909 41.673697 93.090909 93.090909c0 51.417212-41.673697 93.090909-93.090909 93.090909s-93.090909-41.673697-93.090909-93.090909zM884.363636 822.30303l-744.727273 0 186.181818-496.484848 248.242424 310.30303 124.121212-93.090909z\"></path>\r\n </g>\r\n </svg>\r\n </label>\r\n </div>\r\n \r\n <div class=\"comment-actions-form\">\r\n <button class=\"comment-form-submit\">\r\n <svg class=\"icon\" viewBox=\"0 0 1024 1024\" version=\"1.1\" xmlns=\"http://www.w3.org/2000/svg\" xmlns:xlink=\"http://www.w3.org/1999/xlink\" width=\"200\" height=\"200\">\r\n <path d=\"M565.747623 792.837176l260.819261 112.921839 126.910435-845.424882L66.087673 581.973678l232.843092 109.933785 562.612725-511.653099-451.697589 563.616588-5.996574 239.832274L565.747623 792.837176z\" fill=\"#ffffff\"></path>\r\n </svg>\r\n </button>\r\n </div>\r\n </div>\r\n\r\n </div>\r\n <div class=\"comment-form-user\">\r\n <form class=\"comment-form-guest\"><input class=\"comment-form-input comment-form-name\" type=\"text\" name=\"name\" placeholder=\"名字(必填)\" autocomplete=\"name\" /><input class=\"comment-form-input comment-form-email\" type=\"email\" name=\"email\" placeholder=\"邮箱(必填)\" autocomplete=\"email\" /><input class=\"comment-form-input comment-form-url\" type=\"url\" name=\"url\" placeholder=\"网址(可选)\" autocomplete=\"url\" /></form>\r\n </div>\r\n </div>\r\n </div>\r\n <ul id=\"comments\" class=\"comment-list\" data-tips=\"评论加载中……\"></ul>\r\n <a href=\"javascript:;\" class=\"comment-loadmore hide\">加载更多</a>\r\n <div class=\"comment-related\"></div>\r\n </div>\r\n <div class=\"comment\" id=\"disqus_thread\"></div>`;\r\n\r\n _.user = new User(_.dom, _.opts);\r\n _.handle = {\r\n logout: _.user.logout.bind(_),\r\n login: _.user.login.bind(_),\r\n loadMore: _.loadMore.bind(_),\r\n loadMoreReply: _.loadMoreReply.bind(_),\r\n post: _.post.bind(_),\r\n threadCreate: _.threadCreate.bind(_),\r\n threadVote: _.threadVote.bind(_),\r\n reactionVote: _.reactionVote.bind(_),\r\n remove: _.remove.bind(_),\r\n show: _.show.bind(_),\r\n toggle: _.toggle.bind(_),\r\n upload: _.upload.bind(_),\r\n verify: _.verify.bind(_),\r\n jump: _.jump.bind(_),\r\n mention: _.mention.bind(_),\r\n keySelect: _.keySelect.bind(_),\r\n field: _.field.bind(_),\r\n focus: _.focus,\r\n input: _.input.bind(_),\r\n parentShow: _.parentShow.bind(_),\r\n selectOrder: _.selectOrder.bind(_)\r\n };\r\n\r\n var $iDisqus = _.dom.querySelector('#idisqus');\r\n $iDisqus.on('blur', '.comment-form-textarea', _.handle.focus);\r\n $iDisqus.on('focus', '.comment-form-textarea', _.handle.focus);\r\n $iDisqus.on('input', '.comment-form-textarea', _.handle.input);\r\n $iDisqus.on('propertychange', '.comment-form-textarea', _.handle.input);\r\n $iDisqus.on('keyup', '.comment-form-textarea', _.handle.mention);\r\n $iDisqus.on('keydown', '.comment-form-textarea', _.handle.keySelect);\r\n $iDisqus.on('blur', '.comment-form-name', _.handle.verify);\r\n $iDisqus.on('blur', '.comment-form-email', _.handle.verify);\r\n $iDisqus.on('click', '.comment-form-submit', _.handle.post);\r\n $iDisqus.on('click', '.comment-login', _.handle.login);\r\n $iDisqus.on('change', '.comment-image-input', _.handle.upload);\r\n $iDisqus.on('click', '.emojione-item', _.handle.field);\r\n $iDisqus.on('click', '.comment-logout', _.handle.logout);\r\n $iDisqus.on('click', '.comment-item-reply', _.handle.show);\r\n $iDisqus.on('click', '.comment-item-cancel', _.handle.show);\r\n $iDisqus.on('click', '.comment-item-avatar', _.handle.jump);\r\n $iDisqus.on('click', '.comment-item-pname', _.handle.jump);\r\n $iDisqus.on('mouseover', '.comment-item-pname', _.handle.parentShow);\r\n $iDisqus.on('click', '.comment-loadmore', _.handle.loadMore);\r\n $iDisqus.on('click', '.comment-item-loadmore', _.handle.loadMoreReply);\r\n $iDisqus.on('click', '#thread-submit', _.handle.threadCreate);\r\n $iDisqus.on('click', '.comment-recommend', _.handle.threadVote);\r\n $iDisqus.on('click', '.comment-reaction-btn:not(.selected)', _.handle.reactionVote);\r\n $iDisqus.on('change', '.comment-order-radio', _.handle.selectOrder);\r\n\r\n switch (_.opts.mode) {\r\n case 1:\r\n _.disqus();\r\n break;\r\n case 2:\r\n _.threadInit();\r\n break;\r\n case 3:\r\n _.threadInit();\r\n _.disqus();\r\n break;\r\n default:\r\n _.disqus();\r\n break;\r\n }\r\n }\r\n\r\n // 切换评论框\r\n iDisqus.prototype.toggle = function () {\r\n var _ = this;\r\n if (_.stat.current == 'disqus') {\r\n _.stat.current = 'idisqus';\r\n _.dom.querySelector('#idisqus').style.display = 'block';\r\n _.dom.querySelector('#disqus_thread').style.display = 'none';\r\n } else {\r\n _.disqus();\r\n }\r\n }\r\n\r\n // 加载 Disqus 评论\r\n iDisqus.prototype.disqus = function () {\r\n var _ = this;\r\n var _tips = _.dom.querySelector('.init-container').dataset.tips;\r\n if (_.opts.site != location.origin) {\r\n console.log('本地环境不加载 Disqus 评论框!');\r\n if (_.opts.mode == 1) {\r\n _.threadInit();\r\n }\r\n return;\r\n }\r\n if (!_.stat.disqusLoaded) {\r\n _tips = '尝试连接 Disqus……';\r\n\r\n var s = d.createElement('script');\r\n s.src = '//' + _.opts.forum + '.disqus.com/embed.js';\r\n s.dataset.timestamp = Date.now();\r\n s.onload = function () {\r\n _.stat.disqusLoaded = true;\r\n _tips = '连接成功,加载 Disqus 评论框……'\r\n }\r\n s.onerror = function () {\r\n if (_.opts.mode == 1) {\r\n _tips = '连接失败,加载简易评论框……';\r\n _.threadInit();\r\n }\r\n }\r\n\r\n\r\n var img = new Image();\r\n img.onerror = function () {\r\n if (_.opts.mode == 1) {\r\n _tips = '连接超时,加载简易评论框……';\r\n _.threadInit();\r\n }\r\n }\r\n img.onload = function () {\r\n (d.head || d.body).appendChild(s);\r\n clearTimeout(timer)\r\n };\r\n img.src = 'https://disqus.com/favicon.ico?' + Date.now();\r\n var timer = setTimeout(function () {\r\n if ( !img.complete || !img.naturalWidth ) {\r\n if (_.opts.mode == 1) {\r\n _tips = '连接失败,加载简易评论框……';\r\n _.threadInit();\r\n }\r\n }\r\n }, _.opts.timeout);\r\n } else {\r\n _.stat.current = 'disqus';\r\n _.dom.querySelector('#idisqus').style.display = 'none';\r\n _.dom.querySelector('#disqus_thread').style.display = 'block';\r\n }\r\n }\r\n\r\n // 添加事件监听\r\n iDisqus.prototype.addListener = function (els, evt, func) {\r\n var _ = this;\r\n var el = _.dom.getElementsByClassName(els);\r\n [].forEach.call(el, function (item) {\r\n item.addEventListener(evt, func, false);\r\n });\r\n }\r\n\r\n // 评论计数\r\n iDisqus.prototype.count = function () {\r\n var _ = this;\r\n var counts = d.querySelectorAll('[data-disqus-url]');\r\n var qty = counts.length;\r\n if (qty > 0) {\r\n var commentArr = [];\r\n for (var i = 0; i < qty; i++) {\r\n commentArr[i] = counts[i].dataset.disqusUrl.replace(_.opts.site, '');\r\n }\r\n getAjax(\r\n _.opts.api + '/threadsList.php?links=' + commentArr.join(','),\r\n function (resp) {\r\n var data = JSON.parse(resp);\r\n var posts = data.response;\r\n posts.forEach(function (item) {\r\n var link = document.createElement('a');\r\n link.href = item.link;\r\n var itemLink = link.href.replace(link.origin, '');\r\n var el = d.querySelector('[data-disqus-url$=\"' + itemLink + '\"]')\r\n if (!!el) {\r\n el.innerHTML = item.posts;\r\n el.dataset.disqusCount = item.posts;\r\n }\r\n });\r\n }, function () {\r\n console.log('获取数据失败!')\r\n }\r\n );\r\n }\r\n };\r\n\r\n // 加载最近评论\r\n iDisqus.prototype.postsList = function (listLimit, containerId) {\r\n var _ = this;\r\n listLimit = listLimit || 5;\r\n var listContainer = d.getElementById(typeof (containerId) == 'string' ? containerId : 'disqusPostsList');\r\n if (listContainer) {\r\n getAjax(\r\n _.opts.api + '/postsList.php?limit=' + listLimit,\r\n function (resp) {\r\n var data = JSON.parse(resp);\r\n var posts = data.response;\r\n var popHtml = '';\r\n posts.forEach(function (item) {\r\n popHtml += `<li style=\"list-style-type: none;\">${item.name}: ${item.raw_message}</br>评: <a href=\"${item.thread.link}\">${item.thread.title}</a></li>`;\r\n });\r\n popHtml = `<ul>${popHtml}</ul`;\r\n listContainer.innerHTML = popHtml;\r\n }, function () {\r\n console.log('获取数据失败!')\r\n }\r\n );\r\n }\r\n };\r\n\r\n // 加载相关话题\r\n iDisqus.prototype.loadRelated = function () {\r\n var _ = this;\r\n if (_.stat.forum.settings.organicDiscoveryEnabled == false || _.stat.relatedLoaded) {\r\n return;\r\n }\r\n getAjax(\r\n _.opts.api + '/threadsList.php?type=' + _.opts.relatedType.toLowerCase() + '&thread=' + _.stat.thread.id,\r\n function (resp) {\r\n var data = JSON.parse(resp);\r\n if (data.code == 0) {\r\n _.stat.relatedLoaded = true;\r\n var threads = data.response;\r\n var popHtml = '';\r\n threads.forEach(function (item) {\r\n var message = item.topPost.message.replace(/<[^>]*>/g, '');\r\n popHtml += `<li class=\"related-item\">\r\n <a class=\"related-item-link\" href=\"${item.link}\" title=\"${item.title}\">\r\n <div class=\"related-item-title\">${item.title}</div>\r\n <div class=\"related-item-desc\">${item.posts}条评论<span class=\"related-item-bullet\"> • </span><time class=\"related-item-time\" datetime=\"${item.createdAt}\"></time></div></a>\r\n <a class=\"related-item-link\" href=\"${item.link}?#comment-${item.topPost.id}\" title=\"${message}\">\r\n <div class=\"related-item-post\">\r\n <div class=\"related-item-avatar\"><img src=\"${item.topPost.avatar}\" /></div>\r\n <div class=\"related-item-main\">\r\n <div class=\"related-item-name\">${ item.topPost.name}</div>\r\n <div class=\"related-item-message\">${ message}</div>\r\n </div>\r\n </div></a>\r\n </li>`;\r\n });\r\n popHtml = `<div class=\"comment-related-title\">在<span class=\"comment-related-forumname\">${_.stat.forum.name}</span>上还有</div><div class=\"comment-related-content\"><ul class=\"related-list\">${popHtml}</ul></div>`;\r\n _.dom.querySelector('.comment-related').innerHTML = popHtml;\r\n _.timeAgo();\r\n }\r\n }, function () {\r\n console.log('获取数据失败!')\r\n }\r\n );\r\n };\r\n\r\n // 加载反应\r\n iDisqus.prototype.loadReactions = function () {\r\n var _ = this;\r\n if (_.stat.forum.settings.threadReactionsEnabled == false) {\r\n return;\r\n }\r\n getAjax(_.opts.api + '/threadReactionsLoadReations.php' + '?thread=' + _.stat.thread.id, function (resp) {\r\n var data = JSON.parse(resp);\r\n if (data.response.eligible) {\r\n _.dom.querySelector('.comment-reaction-prompt').innerHTML = data.response.prompt;\r\n var reactions = data.response.reactions;\r\n var total = 0;\r\n var reaListHtml = '';\r\n var selectedId = _.user.reactionVote[_.stat.thread.id];\r\n selectedId = selectedId || (!!data.selected ? data.selected.id : 0);\r\n reactions.forEach(function (item) {\r\n total += item.votes;\r\n reaListHtml += `<li class=\"comment-reaction-item\"><a class=\"comment-reaction-btn${(selectedId == item.id ? ' selected' : '')}\" data-id=\"${item.id}\" href=\"javascript:;\"><img class=\"comment-reaction-image\" src=\"${item.imageUrl}\"> ${item.text}</a><div class=\"comment-reaction-count\">${item.votes}</div></li>`;\r\n })\r\n _.dom.querySelector('.comment-reaction-list').innerHTML = reaListHtml;\r\n _.dom.querySelector('.comment-reaction-total').innerHTML = total + ' 人次参与';\r\n }\r\n }, function () { })\r\n\r\n };\r\n\r\n // 反应打分事件\r\n iDisqus.prototype.reactionVote = function (e, target) {\r\n var _ = this;\r\n var $reaction = target.closest('.comment-reaction-item');\r\n var $count = $reaction.querySelector('.comment-reaction-count');\r\n var reactionId = target.dataset.id;\r\n var postData = {\r\n thread: _.stat.thread.id,\r\n unique: _.user.unique,\r\n reaction: reactionId\r\n }\r\n postAjax(_.opts.api + '/threadReactionsVote.php', postData, function (resp) {\r\n _.user.reactionVote[_.stat.thread.id] = reactionId;\r\n l.setItem('reaction_vote', JSON.stringify(_.user.reactionVote));\r\n target.classList.add('selected');\r\n $count.innerHTML++\r\n })\r\n }\r\n\r\n // 排序\r\n iDisqus.prototype.selectOrder = function (e, target) {\r\n var _ = this;\r\n var order = target.value;\r\n sessionStorage.setItem('order', order);\r\n _.stat.order = order;\r\n _.dom.querySelector('.comment-list').innerHTML = '';\r\n _.dom.querySelector('.comment-loadmore').classList.add('hide');\r\n _.stat.next = null;\r\n _.getlist();\r\n }\r\n\r\n // 获取评论列表\r\n iDisqus.prototype.getlist = function () {\r\n var _ = this;\r\n _.stat.loading = true;\r\n _.dom.querySelector('#idisqus').classList.add('loading');\r\n _.dom.querySelector('.comment-list').dataset.tips = '评论加载中……';\r\n getAjax(\r\n _.opts.api + '/getcomments.php?thread=' + _.stat.thread.id + (!!_.stat.next ? '&cursor=' + _.stat.next : '') + '&order=' + _.stat.order,\r\n function (resp) {\r\n var data = JSON.parse(resp);\r\n if (data.code === 0) {\r\n _.stat.offsetTop = d.documentElement.scrollTop || d.body.scrollTop;\r\n\r\n _.dom.querySelector('#idisqus').classList.remove('loading')\r\n var loadmore = _.dom.querySelector('.comment-loadmore');\r\n var posts = !!data.response ? data.response : [];\r\n _.stat.root = [];\r\n posts.forEach(function (item) {\r\n _.load(item);\r\n if (!item.parent) {\r\n _.stat.root.unshift(item.id);\r\n }\r\n });\r\n\r\n if (data.cursor.hasPrev) {\r\n _.stat.root.forEach(function (item) {\r\n _.dom.querySelector('.comment-list').appendChild(_.dom.querySelector('#comment-' + item));\r\n })\r\n }\r\n if (data.cursor.hasNext) {\r\n _.stat.next = data.cursor.next;\r\n loadmore.classList.remove('loading');\r\n loadmore.classList.remove('hide');\r\n } else {\r\n _.stat.next = null;\r\n loadmore.classList.add('hide');\r\n }\r\n\r\n if (_.stat.thread.posts == 0) {\r\n _.dom.querySelector('.comment-list').dataset.tips = '来做第一个留言的人吧!';\r\n return;\r\n }\r\n\r\n if (posts.length == 0) {\r\n return;\r\n }\r\n _.timeAgo();\r\n\r\n var iframe = _.dom.querySelectorAll('.comment-item-body iframe');\r\n [].forEach.call(iframe, function (item) {\r\n item.style.width = item.clientWidth + 'px';\r\n item.style.height = item.clientWidth * 9 / 16 + 'px';\r\n setTimeout(function () {\r\n item.src = item.src;\r\n }, 1000)\r\n })\r\n var tweet = _.dom.querySelectorAll('.comment-item-body .twitter-tweet');\r\n if (tweet.length > 0) {\r\n var head = document.getElementsByTagName('head')[0];\r\n var script = document.createElement('script');\r\n script.type = 'text/javascript';\r\n script.src = '//platform.twitter.com/widgets.js';\r\n head.appendChild(script);\r\n }\r\n\r\n window.scrollTo(0, _.stat.offsetTop);\r\n\r\n if (/^#disqus|^#comment-/.test(location.hash) && !data.cursor.hasPrev && !_.stat.disqusLoaded && !_.stat.loaded) {\r\n var el = _.dom.querySelector('#idisqus ' + location.hash)\r\n if (!!el) {\r\n window.scrollBy(0, el.getBoundingClientRect().top);\r\n }\r\n }\r\n _.stat.loading = false;\r\n _.stat.loaded = true;\r\n }\r\n }, function () {\r\n alert('获取数据失败,请检查服务器设置。')\r\n }\r\n );\r\n }\r\n\r\n // 读取评论\r\n iDisqus.prototype.load = function (post) {\r\n\r\n var _ = this;\r\n\r\n _.stat.post[post.id] = post;\r\n\r\n var parentPostDom = _.dom.querySelector('.comment-item[data-id=\"' + post.parent + '\"]');\r\n\r\n var user = {\r\n username: post.username,\r\n name: post.name,\r\n avatar: post.avatar\r\n }\r\n if (!!post.username && _.stat.users.map(function (user) { return user.username; }).indexOf(post.username) == -1) {\r\n _.stat.users.push(user);\r\n }\r\n\r\n var parentPost = !!post.parent ? {\r\n name: `<a class=\"comment-item-pname\" data-parent=\"${post.parent}\" href=\"#${parentPostDom.id}\"><svg class=\"icon\" viewBox=\"0 0 1024 1024\" version=\"1.1\" xmlns=\"http://www.w3.org/2000/svg\" xmlns:xlink=\"http://www.w3.org/1999/xlink\" width=\"200\" height=\"200\"><path d=\"M1.664 902.144s97.92-557.888 596.352-557.888V129.728L1024 515.84l-425.984 360.448V628.8c-270.464 0-455.232 23.872-596.352 273.28\"></path></svg>${parentPostDom.dataset.name}</a>`,\r\n dom: parentPostDom.querySelector('.comment-item-children'),\r\n insert: 'afterbegin'\r\n } : {\r\n name: '',\r\n dom: _.dom.querySelector('.comment-list'),\r\n insert: post.id == 'preview' || !!post.isPost ? 'afterbegin' : 'beforeend'\r\n };\r\n\r\n\r\n var html = `<li class=\"comment-item\" data-id=\"${post.id}\" data-name=\"${post.name}\" id=\"comment-${post.id}\">\r\n <div class=\"comment-item-body\">\r\n <a class=\"comment-item-avatar\" href=\"#comment-${ post.id}\"><img src=\"${post.avatar}\"></a>\r\n <div class=\"comment-item-main\">\r\n <div class=\"comment-item-header\"><a class=\"comment-item-name\" title=\"${ post.name}\" rel=\"nofollow\" target=\"_blank\" href=\"${(post.url || 'javascript:;')}\">${post.name}</a>${(post.isMod ? `<span class=\"comment-item-badge\">${_.opts.badge}</span>` : ``)}${parentPost.name}<span class=\"comment-item-bullet\"> • </span><time class=\"comment-item-time\" datetime=\"${post.createdAt}\"></time></div>\r\n <div class=\"comment-item-content\">${ post.message}</div>\r\n <div class=\"comment-item-footer\">${!!post.isPost ? `<span class=\"comment-item-manage\"><a class=\"comment-item-edit\" href=\"javascript:;\">编辑</a><span class=\"comment-item-bullet\"> • </span><a class=\"comment-item-delete\" href=\"javascript:;\">删除</a><span class=\"comment-item-bullet\"> • </span></span>` : ``}<a class=\"comment-item-reply\" href=\"javascript:;\">回复</a></div>\r\n </div></div>\r\n <ul class=\"comment-item-children\">\r\n ${ post.hasMore ? `<li><a class=\"comment-item-loadmore\" href=\"javascript:;\">显示更多回复</a></li>` : `` }\r\n </ul>\r\n </li>`;\r\n\r\n // 已删除评论\r\n if (!!post.isDeleted) {\r\n html = `<li class=\"comment-item\" data-id=\"${post.id}\" id=\"comment-${post.id}\" data-name=\"${post.name}\">\r\n <div class=\"comment-item-body\">\r\n <a class=\"comment-item-avatar\" href=\"#comment-${ post.id}\"><img src=\"${post.avatar}\"></a>\r\n <div class=\"comment-item-main\" data-message=\"此评论已被删除。\"></div></div>\r\n <ul class=\"comment-item-children\">\r\n ${ post.hasMore ? `<li><a class=\"comment-item-loadmore\" href=\"javascript:;\">显示更多回复</a></li>` : `` }\r\n </ul>\r\n </li>`;\r\n }\r\n\r\n\r\n // 更新 or 创建\r\n if (!!_.dom.querySelector('.comment-item[data-id=\"' + post.id + '\"]')) {\r\n _.dom.querySelector('.comment-item[data-id=\"' + post.id + '\"]').outerHTML = html;\r\n } else {\r\n parentPost.dom.insertAdjacentHTML(parentPost.insert, html);\r\n }\r\n\r\n // 发布留言,可编辑删除\r\n if (!!post.isPost && !_.stat.editing) {\r\n var $this = _.dom.querySelector('.comment-item[data-id=\"' + post.id + '\"]');\r\n\r\n var postEdit = setTimeout(function () {\r\n // 十分钟后\r\n if (!!$this.querySelector('.comment-item-manage')) {\r\n $this.querySelector('.comment-item-manage').outerHTML = '';\r\n }\r\n }, 6 * 1e5);\r\n\r\n // 删除\r\n $this.querySelector('.comment-item-delete').addEventListener('click', function (e) {\r\n var postData = {\r\n id: post.id\r\n }\r\n var delDom = e.currentTarget;\r\n delDom.innerHTML = '删除中';\r\n postAjax(_.opts.api + '/removecomment.php', postData, function (resp) {\r\n var data = JSON.parse(resp);\r\n if (data.code === 0) {\r\n if (data.response.isDeleted == true) {\r\n $this.outerHTML = '';\r\n _.stat.thread.posts = parseInt(_.dom.querySelector('#comment-count').innerHTML) - 1;\r\n _.dom.querySelector('#comment-count').innerHTML = _.stat.thread.posts + ' 条评论';\r\n } else {\r\n alert(data.response.message);\r\n $this.querySelector('.comment-item-manage').outerHTML = '';\r\n }\r\n } else if (data.code === 2) {\r\n alert(data.response);\r\n $this.querySelector('.comment-item-manage').outerHTML = '';\r\n }\r\n }, function () {\r\n alert('删除出错,请稍后重试');\r\n })\r\n clearTimeout(postEdit);\r\n }, false)\r\n\r\n // 编辑\r\n $this.querySelector('.comment-item-edit').addEventListener('click', function () {\r\n _.stat.editing = post;\r\n _.edit(post);\r\n }, false)\r\n }\r\n }\r\n\r\n // 读取更多\r\n iDisqus.prototype.loadMore = function (e, target) {\r\n var _ = this;\r\n _.stat.offsetTop = d.documentElement.scrollTop || d.body.scrollTop;\r\n if (!_.stat.loading) {\r\n target.classList.add('loading');\r\n _.getlist();\r\n }\r\n }\r\n\r\n // 读取更多回复\r\n iDisqus.prototype.loadMoreReply = function (e, target) {\r\n var _ = this;\r\n target.innerHTML = '加载中……';\r\n var $children = target.closest('.comment-item-children');\r\n var $post = target.closest('.comment-item');\r\n getAjax(\r\n _.opts.api + '/descendants.php?post=' + $post.dataset.id,\r\n function (resp) {\r\n var data = JSON.parse(resp);\r\n if( data.code == 0 ){\r\n $children.removeChild(target.parentNode);\r\n var posts = data.response;\r\n posts.forEach(function (item) {\r\n _.load(item);\r\n });\r\n _.timeAgo();\r\n } else {\r\n target.innerHTML = '读取失败';\r\n }\r\n }, function () {\r\n target.innerHTML = '读取出错';\r\n }\r\n );\r\n }\r\n\r\n // 评论框焦点\r\n iDisqus.prototype.focus = function (e, target) {\r\n var wrapper = target.closest('.comment-form-wrapper');\r\n wrapper.classList.add('editing');\r\n if (wrapper.classList.contains('focus')) {\r\n wrapper.classList.remove('focus');\r\n } else {\r\n wrapper.classList.add('focus');\r\n }\r\n }\r\n\r\n // 输入事件\r\n iDisqus.prototype.input = function (e, target) {\r\n var _ = this;\r\n var form = target.closest('.comment-form');\r\n var alertmsg = form.querySelector('.comment-form-alert');\r\n alertmsg.innerHTML = '';\r\n var wrapper = form.querySelector('.comment-form-wrapper');\r\n var filterText = target.value.replace(/<code>.*?<\\/code>/g, '');\r\n var urls = filterText.match(/(^|\\s|\\r|\\n)*(http:\\/\\/|https:\\/\\/)(\\w|-|\\.)*(disqus|sinaimg|giphy|imgur|instagram|twimg|twitter|youtube|youtu\\.be)((\\w|=|\\?|\\.|\\/|&|\\%|-)*)(jpg|png|gif|gallery\\/\\w+|p\\/[a-zA-Z0-9]{11}.*|status\\/\\d{19}|v=[a-zA-Z0-9]{11}|\\/[a-zA-Z0-9]{11})(\\s|$|\\n)/g);\r\n form.querySelector('.comment-image-list').innerHTML = '';\r\n if (!!urls) {\r\n urls.forEach(function (item, i) {\r\n item = item.replace('/\\n|\\r\\n|^\\s|\\s$/g', '');\r\n var image = _.stat.media[item];\r\n if (!!image) {\r\n var imageHtml = `<li class=\"comment-image-item\" data-image-url=\"${image.thumbnailUrl}\"><img class=\"comment-image-object\" src=\"https:${image.thumbnailUrl}\"></li>`;\r\n form.querySelector('.comment-image-list').insertAdjacentHTML('beforeend', imageHtml);\r\n wrapper.classList.add('expanded');\r\n return;\r\n }\r\n postAjax(_.opts.api + '/media.php', { url: item }, function (resp) {\r\n var data = JSON.parse(resp);\r\n if (data.code == 0) {\r\n image = data.response;\r\n var imageHtml = `<li class=\"comment-image-item\" data-image-url=\"${image.thumbnailUrl}\"><img class=\"comment-image-object\" src=\"https:${image.thumbnailUrl}\"></li>`;\r\n form.querySelector('.comment-image-list').insertAdjacentHTML('beforeend', imageHtml);\r\n _.stat.media[item] = image;\r\n wrapper.classList.add('expanded');\r\n }\r\n }, function () {\r\n })\r\n })\r\n } else {\r\n wrapper.classList.remove('expanded');\r\n }\r\n\r\n }\r\n\r\n // 提醒用户 @ mention \r\n iDisqus.prototype.mention = function (e, target) {\r\n var _ = this;\r\n var textarea = target;\r\n var selStart = textarea.selectionStart;\r\n var mentionIndex = textarea.value.slice(0, selStart).lastIndexOf('@');\r\n var mentionText = textarea.value.slice(mentionIndex, selStart);\r\n var mentionDom = _.dom.querySelector('.mention-user');\r\n var showUsers = _.stat.users.filter(function (user) {\r\n var re = new RegExp(mentionText.slice(1), 'i');\r\n return user.username.search(re) > -1;\r\n });\r\n if (mentionText.search(/^@\\w+$|^@$/) == 0 && showUsers.length > 0) {\r\n if (e.keyCode == 38 || e.keyCode == 40) {\r\n return;\r\n }\r\n var coord = _.getCaretCoord(textarea);\r\n var list = '', html = '';\r\n\r\n showUsers.forEach(function (item, i) {\r\n list += `<li class=\"mention-user-item${(i == 0 ? ' active' : '')}\" data-username=\"${item.username}\"><img class=\"mention-user-avatar\" src=\"${item.avatar}\"><div class=\"mention-user-username\">${item.username}</div><div class=\"mention-user-name\">${item.name}</div></li>`;\r\n })\r\n if (!!mentionDom) {\r\n mentionDom.innerHTML = '<ul class=\"mention-user-list\">' + list + '</ul>';\r\n mentionDom.style.left = coord.left + 'px';\r\n mentionDom.style.top = coord.top + 'px';\r\n } else {\r\n html = `<div class=\"mention-user\" style=\"left:${coord.left}px;top:${coord.top}px\"><ul class=\"mention-user-list\">${list}</ul></div>`;\r\n _.dom.querySelector('#idisqus').insertAdjacentHTML('beforeend', html);\r\n }\r\n\r\n // 鼠标悬浮\r\n _.addListener('mention-user-item', 'mouseover', function () {\r\n _.dom.querySelector('.mention-user-item.active').classList.remove('active');\r\n this.classList.add('active');\r\n })\r\n\r\n // 鼠标点击\r\n _.addListener('mention-user-item', 'click', function () {\r\n var username = '@' + this.dataset.username + ' ';\r\n textarea.value = textarea.value.slice(0, mentionIndex) + username + textarea.value.slice(selStart);\r\n mentionDom.outerHTML = '';\r\n textarea.focus();\r\n textarea.setSelectionRange(mentionIndex + username.length, mentionIndex + username.length)\r\n })\r\n } else if (!!mentionDom) {\r\n mentionDom.outerHTML = '';\r\n }\r\n }\r\n\r\n // 获取光标坐标 https://medium.com/@_jh3y/how-to-where-s-the-caret-getting-the-xy-position-of-the-caret-a24ba372990a\r\n iDisqus.prototype.getCaretCoord = function (textarea) {\r\n var _ = this;\r\n var carPos = textarea.selectionEnd,\r\n div = d.createElement('div'),\r\n span = d.createElement('span'),\r\n copyStyle = getComputedStyle(textarea);\r\n [].forEach.call(copyStyle, function (prop) {\r\n div.style[prop] = copyStyle[prop];\r\n });\r\n div.style.position = 'absolute';\r\n _.dom.appendChild(div);\r\n div.textContent = textarea.value.substr(0, carPos);\r\n span.textContent = textarea.value.substr(carPos) || '.';\r\n div.appendChild(span);\r\n var coords = {\r\n 'top': textarea.offsetTop - textarea.scrollTop + span.offsetTop + parseFloat(copyStyle.lineHeight),\r\n 'left': textarea.offsetLeft - textarea.scrollLeft + span.offsetLeft\r\n };\r\n _.dom.removeChild(div);\r\n return coords;\r\n }\r\n\r\n // 键盘选择用户\r\n iDisqus.prototype.keySelect = function (e, target) {\r\n var _ = this;\r\n var textarea = target;\r\n var selStart = textarea.selectionStart;\r\n var mentionIndex = textarea.value.slice(0, selStart).lastIndexOf('@');\r\n var mentionText = textarea.value.slice(mentionIndex, selStart);\r\n var mentionDom = _.dom.querySelector('.mention-user');\r\n if (!mentionDom) {\r\n return;\r\n }\r\n var current = _.dom.querySelector('.mention-user-item.active')\r\n switch (e.keyCode) {\r\n case 13:\r\n //回车\r\n var username = '@' + current.dataset.username + ' ';\r\n textarea.value = textarea.value.slice(0, mentionIndex) + username + textarea.value.slice(selStart);\r\n textarea.setSelectionRange(mentionIndex + username.length, mentionIndex + username.length)\r\n _.dom.querySelector('.mention-user').outerHTML = '';\r\n e.preventDefault();\r\n break;\r\n case 38:\r\n //上\r\n if (!!current.previousSibling) {\r\n current.previousSibling.classList.add('active');\r\n current.classList.remove('active');\r\n }\r\n e.preventDefault();\r\n break;\r\n case 40:\r\n //下\r\n if (!!current.nextSibling) {\r\n current.nextSibling.classList.add('active');\r\n current.classList.remove('active');\r\n }\r\n e.preventDefault();\r\n break;\r\n default:\r\n break;\r\n }\r\n }\r\n\r\n // 跳到评论\r\n iDisqus.prototype.jump = function (e, target) {\r\n var _ = this;\r\n var hash = getLocation(target.href).hash;\r\n var el = _.dom.querySelector('#idisqus ' + hash);\r\n history.replaceState(undefined, undefined, hash);\r\n window.scrollBy(0, el.getBoundingClientRect().top);\r\n e.preventDefault();\r\n }\r\n\r\n // 显示父评论\r\n iDisqus.prototype.parentShow = function (e, target) {\r\n var _ = this;\r\n if (!!target.querySelector('.comment-item-parent')) {\r\n return;\r\n }\r\n var comment = _.stat.post[target.dataset.parent];\r\n if (comment.isDeleted) {\r\n return;\r\n }\r\n var message = comment.message.replace(/<[^>]*>/g, '');\r\n var parentHtml = `<div class=\"comment-item-parent\"><a class=\"comment-item-avatar\" href=\"javascript:;\"><img src=\"${comment.avatar}\"></a><div class=\"comment-item-pmain\"><div class=\"comment-item-pheader\">${comment.name}</div><div class=\"comment-item-pcontent\" title=\"${message}\">${message}</div></div></div>`;\r\n target.insertAdjacentHTML('beforeend', parentHtml);\r\n }\r\n\r\n // 点选表情\r\n iDisqus.prototype.field = function (e, target) {\r\n var _ = this;\r\n var item = target;\r\n var form = item.closest('.comment-form');\r\n var textarea = form.querySelector('.comment-form-textarea');\r\n _.appendText(textarea, item.dataset.code);\r\n }\r\n\r\n // 显示回复框 or 取消回复框\r\n iDisqus.prototype.show = function (e, target) {\r\n var _ = this;\r\n\r\n var $this = target;\r\n var item = $this.closest('.comment-item');\r\n\r\n // 无论取消还是回复,移除已显示回复框\r\n var box = _.dom.querySelector('.comment-item .comment-box:not([data-current-id])');\r\n if (box) {\r\n var $show = box.closest('.comment-item');\r\n var cancel = $show.querySelector('.comment-item-cancel')\r\n cancel.outerHTML = cancel.outerHTML.replace('cancel', 'reply');\r\n box.outerHTML = '';\r\n }\r\n\r\n // 回复时,显示评论框\r\n if ($this.className == 'comment-item-reply') {\r\n $this.outerHTML = $this.outerHTML.replace('reply', 'cancel');\r\n var commentBox = _.box.replace(/emoji-input/g, 'emoji-input-' + item.dataset.id).replace(/upload-input/g, 'upload-input-' + item.dataset.id);\r\n item.querySelector('.comment-item-children').insertAdjacentHTML('beforebegin', commentBox);\r\n _.user.init();\r\n\r\n item.querySelector('.comment-form-textarea').focus();\r\n }\r\n\r\n }\r\n\r\n // 验证表单\r\n iDisqus.prototype.verify = function (e, target) {\r\n var _ = this;\r\n var $this = target;\r\n var box = $this.closest('.comment-box');\r\n var $avatar = box.querySelector('.comment-avatar-image');\r\n var $name = box.querySelector('.comment-form-name');\r\n var $email = box.querySelector('.comment-form-email');\r\n var alertmsg = box.querySelector('.comment-form-alert');\r\n if ($email.value == '') {\r\n return;\r\n }\r\n getAjax(\r\n _.opts.api + '/getgravatar.php?email=' + $email.value + '&name=' + $name.value,\r\n function (resp) {\r\n var data = JSON.parse(resp);\r\n if (!data.isEmail && $this == $email) {\r\n _.errorTips('您所填写的邮箱地址有误。', $email);\r\n }\r\n if ($name.value != '') {\r\n $avatar.src = data.gravatar;\r\n }\r\n }, function () {\r\n }\r\n );\r\n }\r\n\r\n // 添加文本\r\n iDisqus.prototype.appendText = function (textarea, text) {\r\n var _ = this;\r\n var selStart = textarea.selectionStart;\r\n var text = selStart == 0 ? text + ' ' : ' ' + text + ' ';\r\n textarea.value = textarea.value.slice(0, selStart) + text + textarea.value.slice(selStart);\r\n textarea.focus();\r\n textarea.setSelectionRange(selStart + text.length, selStart + text.length);\r\n }\r\n\r\n // 上传图片\r\n iDisqus.prototype.upload = function (e, target) {\r\n var _ = this;\r\n var file = target;\r\n var form = file.closest('.comment-form');\r\n var progress = form.querySelector('.comment-image-progress');\r\n var loaded = form.querySelector('.comment-image-loaded');\r\n var wrapper = form.querySelector('.comment-form-wrapper');\r\n var alertmsg = form.querySelector('.comment-form-alert');\r\n alertmsg.innerHTML = '';\r\n if (file.files.length === 0) {\r\n return;\r\n }\r\n\r\n // 以文件大小识别是否为同张图片\r\n var size = file.files[0].size;\r\n\r\n if (size > 5 * 1e6) {\r\n alertmsg.innerHTML = '请选择 5M 以下图片。';\r\n setTimeout(function () {\r\n alertmsg.innerHTML = '';\r\n }, 3000);\r\n return;\r\n }\r\n\r\n if (_.stat.imageSize.indexOf(size) == -1) {\r\n progress.style.width = '80px';\r\n } else {\r\n alertmsg.innerHTML = '请勿选择已存在的图片。';\r\n setTimeout(function () {\r\n alertmsg.innerHTML = '';\r\n }, 3000);\r\n return;\r\n }\r\n\r\n // 展开图片上传界面\r\n wrapper.classList.add('expanded');\r\n\r\n // 图片上传请求\r\n var data = new FormData();\r\n data.append('file', file.files[0]);\r\n var filename = file.files[0].name;\r\n\r\n var $item;\r\n\r\n var xhrUpload = new XMLHttpRequest();\r\n xhrUpload.withCredentials = true;\r\n xhrUpload.onreadystatechange = function () {\r\n if (xhrUpload.readyState == 4 && xhrUpload.status == 200) {\r\n var data = JSON.parse(xhrUpload.responseText);\r\n if (data.code == 0) {\r\n _.stat.imageSize.push(size);\r\n var imageUrl = data.response.thumbnailUrl;\r\n var textarea = form.querySelector('.comment-form-textarea');\r\n _.appendText(textarea, 'https:'+imageUrl);\r\n\r\n var image = new Image();\r\n image.src = imageUrl;\r\n image.onload = function () {\r\n $item.innerHTML = '<img class=\"comment-image-object\" src=\"https:' + imageUrl + '\">';\r\n $item.dataset.imageUrl = imageUrl;\r\n $item.classList.remove('loading');\r\n }\r\n } else {\r\n alertmsg.innerHTML = '图片上传出错。';\r\n $item.innerHTML = '';\r\n if (!!form.getElementsByClassName('comment-image-item').length) {\r\n wrapper.classList.remove('expanded');\r\n }\r\n setTimeout(function () {\r\n alertmsg.innerHTML = '';\r\n }, 3000);\r\n }\r\n }\r\n };\r\n xhrUpload.upload.addEventListener('progress', function (e) {\r\n loaded.style.width = Math.ceil((e.loaded / e.total) * 100) + '%';\r\n }, false);\r\n xhrUpload.upload.addEventListener('load', function (e) {\r\n loaded.style.width = 0;\r\n progress.style.width = 0;\r\n var imageItem = `<li class=\"comment-image-item loading\" data-image-size=\"${size}\">\r\n <svg version=\"1.1\" class=\"comment-image-object\" xmlns=\"http://www.w3.org/2000/svg\" xmlns:xlink=\"http://www.w3.org/1999/xlink\" x=\"0px\" y=\"0px\" width=\"24px\" height=\"30px\" viewBox=\"0 0 24 30\" style=\"enable-background: new 0 0 50 50;\" xml:space=\"preserve\">\r\n <rect x=\"0\" y=\"10\" width=\"4\" height=\"10\" fill=\"rgba(127,145,158,1)\" opacity=\"0.2\">\r\n <animate attributeName=\"opacity\" attributeType=\"XML\" values=\"0.2; 1; .2\" begin=\"0s\" dur=\"0.6s\" repeatCount=\"indefinite\" />\r\n <animate attributeName=\"height\" attributeType=\"XML\" values=\"10; 20; 10\" begin=\"0s\" dur=\"0.6s\" repeatCount=\"indefinite\" />\r\n <animate attributeName=\"y\" attributeType=\"XML\" values=\"10; 5; 10\" begin=\"0s\" dur=\"0.6s\" repeatCount=\"indefinite\" />\r\n </rect>\r\n <rect x=\"8\" y=\"10\" width=\"4\" height=\"10\" fill=\"rgba(127,145,158,1)\" opacity=\"0.2\">\r\n <animate attributeName=\"opacity\" attributeType=\"XML\" values=\"0.2; 1; .2\" begin=\"0.15s\" dur=\"0.6s\" repeatCount=\"indefinite\" />\r\n <animate attributeName=\"height\" attributeType=\"XML\" values=\"10; 20; 10\" begin=\"0.15s\" dur=\"0.6s\" repeatCount=\"indefinite\" />\r\n <animate attributeName=\"y\" attributeType=\"XML\" values=\"10; 5; 10\" begin=\"0.15s\" dur=\"0.6s\" repeatCount=\"indefinite\" />\r\n </rect>\r\n <rect x=\"16\" y=\"10\" width=\"4\" height=\"10\" fill=\"rgba(127,145,158,1)\" opacity=\"0.2\">\r\n <animate attributeName=\"opacity\" attributeType=\"XML\" values=\"0.2; 1; .2\" begin=\"0.3s\" dur=\"0.6s\" repeatCount=\"indefinite\" />\r\n <animate attributeName=\"height\" attributeType=\"XML\" values=\"10; 20; 10\" begin=\"0.3s\" dur=\"0.6s\" repeatCount=\"indefinite\" />\r\n <animate attributeName=\"y\" attributeType=\"XML\" values=\"10; 5; 10\" begin=\"0.3s\" dur=\"0.6s\" repeatCount=\"indefinite\" />\r\n </rect>\r\n </svg>\r\n </li>`;\r\n form.querySelector('.comment-image-list').insertAdjacentHTML('beforeend', imageItem);\r\n $item = form.querySelector('[data-image-size=\"' + size + '\"]');\r\n }, false);\r\n xhrUpload.open('POST', _.opts.api + '/media.php', true);\r\n xhrUpload.send(data);\r\n }\r\n\r\n // 移除图片\r\n iDisqus.prototype.remove = function (e) {\r\n var _ = this;\r\n var $item = e.currentTarget.closest('.comment-image-item');\r\n var wrapper = e.currentTarget.closest('.comment-form-wrapper');\r\n $item.outerHTML = '';\r\n _.stat.imageSize = [];\r\n var imageArr = wrapper.getElementsByClassName('comment-image-item');\r\n [].forEach.call(imageArr, function (item, i) {\r\n _.stat.imageSize[i] = item.dataset.imageSize;\r\n });\r\n if (_.stat.imageSize.length == 0) {\r\n wrapper.classList.remove('expanded');\r\n }\r\n wrapper.querySelector('.comment-image-input').value = '';\r\n }\r\n\r\n // 错误提示\r\n iDisqus.prototype.errorTips = function (Text, Dom) {\r\n var _ = this;\r\n if (_.user.logged_in == 'true') {\r\n _.handle.logout();\r\n }\r\n var idisqus = _.dom.querySelector('#idisqus');\r\n var errorDom = _.dom.querySelector('.comment-form-error');\r\n if (!!errorDom) {\r\n errorDom.outerHTML = '';\r\n }\r\n var Top = Dom.offsetTop;\r\n var Left = Dom.offsetLeft;\r\n var errorHtml = '<div class=\"comment-form-error\" style=\"top:' + Top + 'px;left:' + Left + 'px;\">' + Text + '</div>';\r\n idisqus.insertAdjacentHTML('beforeend', errorHtml);\r\n setTimeout(function () {\r\n var errorDom = _.dom.querySelector('.comment-form-error');\r\n if (!!errorDom) {\r\n errorDom.outerHTML = '';\r\n }\r\n }, 3000);\r\n }\r\n\r\n // 发表/回复评论\r\n iDisqus.prototype.post = function (e, target) {\r\n var _ = this;\r\n var item = target.closest('.comment-box[data-current-id]') || target.closest('.comment-item') || target.closest('.comment-box');\r\n var message = item.querySelector('.comment-form-textarea').value;\r\n var parentId = !!item.dataset.id ? item.dataset.id : '';\r\n var imgArr = item.getElementsByClassName('comment-image-item');\r\n\r\n // 不是编辑框需预览\r\n if (!item.dataset.currentId) {\r\n var elName = item.querySelector('.comment-form-name');\r\n var elEmail = item.querySelector('.comment-form-email');\r\n var elUrl = item.querySelector('.comment-form-url');\r\n var alertmsg = item.querySelector('.comment-form-alert');\r\n var alertClear = function () {\r\n setTimeout(function () {\r\n alertmsg.innerHTML = '';\r\n }, 3000);\r\n }\r\n\r\n if (_.user.type != '1') {\r\n var anonName = elName.value;\r\n var anonEmail = elEmail.value;\r\n var anonUrl = elUrl.value.replace(/\\s/g, '');\r\n if (/^\\s*$/i.test(anonName)) {\r\n _.errorTips('名字不能为空或空格。', elName);\r\n return;\r\n }\r\n if (/^\\s*$/i.test(anonEmail)) {\r\n _.errorTips('邮箱不能为空或空格。', elEmail);\r\n return;\r\n }\r\n if (!/^[A-Z0-9._%+-]+@[A-Z0-9.-]+\\.[A-Z]{2,}$/i.test(anonEmail)) {\r\n _.errorTips('请正确填写邮箱。', elEmail);\r\n return;\r\n }\r\n if (!/^([hH][tT]{2}[pP]:\\/\\/|[hH][tT]{2}[pP][sS]:\\/\\/)(([A-Za-z0-9-~]+)\\.)+([A-Za-z0-9-~\\/])+$|^\\s*$/i.test(anonUrl)) {\r\n _.errorTips('请正确填写网址。', elUrl);\r\n return;\r\n }\r\n _.user.unique = _.user.email == anonEmail ? _.user.unique : generateGUID();\r\n _.user.name = anonName;\r\n _.user.email = anonEmail;\r\n _.user.url = anonUrl;\r\n _.user.avatar = item.querySelector('.comment-avatar-image').src;\r\n _.user.submit();\r\n\r\n if (!_.user.name && !_.user.email) {\r\n return;\r\n }\r\n }\r\n\r\n if (!_.stat.message && !_.stat.mediaHtml) {\r\n _.box = _.dom.querySelector('.comment-box').outerHTML.replace('comment-form-wrapper', 'comment-form-wrapper editing').replace(/加入讨论……/, '');\r\n }\r\n\r\n if (/^\\s*$/i.test(message)) {\r\n alertmsg.innerHTML = '评论不能为空或空格。';\r\n item.querySelector('.comment-form-textarea').focus();\r\n return;\r\n };\r\n\r\n var preMessage = message;\r\n\r\n if (!!_.opts.emoji_preview) {\r\n preMessage = preMessage.replace(/:([-+\\w]+):/g, function (match) {\r\n var emojiShort = match.replace(/:/g, '');\r\n var emojiImage = !!_.eac[emojiShort] ? `<img class=\"emojione\" width=\"24\" height=\"24\" alt=\"'+emojiShort+'\" title=\":${emojiShort}:\" src=\"${_.opts.emojiPath + _.eac[emojiShort]}.png\">` : match;\r\n return emojiImage;\r\n });\r\n } else {\r\n _.emojiList.forEach(function (item) {\r\n preMessage = preMessage.replace(`:${item.code}:`, `<img class=\"emojione\" width=\"24\" height=\"24\" src=\"${_.opts.emojiPath + item.unicode}.png\" />`);\r\n });\r\n }\r\n\r\n var post = {\r\n 'url': !!_.user.url ? _.user.url : '',\r\n 'isMod': false,\r\n 'username': null,\r\n 'name': _.user.name,\r\n 'avatar': _.user.avatar,\r\n 'id': 'preview',\r\n 'parent': parentId,\r\n 'createdAt': (new Date()).toJSON(),\r\n 'message': '<p>' + preMessage + '</p>',\r\n };\r\n\r\n _.load(post);\r\n\r\n _.timeAgo();\r\n\r\n // 清空或移除评论框\r\n _.stat.message = message;\r\n _.stat.mediaHtml = item.querySelector('.comment-image-list').innerHTML;\r\n\r\n if (parentId) {\r\n item.querySelector('.comment-item-cancel').click();\r\n } else {\r\n item.querySelector('.comment-form-textarea').value = '';\r\n item.querySelector('.comment-image-list').innerHTML = '';\r\n item.querySelector('.comment-form-wrapper').classList.remove('expanded', 'editing');\r\n }\r\n }\r\n\r\n // @\r\n var mentions = message.match(/@\\w+/g);\r\n if (!!mentions) {\r\n mentions = mentions.filter(function (mention) {\r\n return _.stat.users.map(function (user) { return user.username; }).indexOf(mention.slice(1)) > -1;\r\n });\r\n if (mentions.length > 0) {\r\n var re = new RegExp('(' + mentions.join('|') + ')', 'g');\r\n message = message.replace(re, '$1:disqus');\r\n }\r\n }\r\n\r\n // POST 操作\r\n // 编辑框则更新评论\r\n if (!!item.dataset.currentId) {\r\n var postData = {\r\n id: item.dataset.currentId,\r\n message: message,\r\n unique: _.user.unique\r\n }\r\n postAjax(_.opts.api + '/updatecomment.php', postData, function (resp) {\r\n var data = JSON.parse(resp);\r\n if (data.code === 0) {\r\n _.stat.message = null;\r\n _.stat.mediaHtml = null;\r\n var post = data.response;\r\n _.load(post);\r\n _.timeAgo();\r\n _.stat.editing = false;\r\n } else {\r\n // 取消编辑\r\n _.load(_.stat.editing)\r\n _.timeAgo();\r\n _.stat.editing = false;\r\n }\r\n }, function () {\r\n // 取消编辑\r\n _.load(_.stat.editing)\r\n _.timeAgo();\r\n _.stat.editing = false;\r\n })\r\n } else {\r\n var postData = {\r\n thread: _.stat.thread.id,\r\n parent: parentId,\r\n message: message,\r\n name: _.user.name,\r\n email: _.user.email,\r\n url: _.user.url,\r\n unique: _.user.unique\r\n }\r\n postAjax(_.opts.api + '/postcomment.php', postData, function (resp) {\r\n var data = JSON.parse(resp);\r\n if (data.code === 0) {\r\n _.dom.querySelector('.comment-item[data-id=\"preview\"]').outerHTML = '';\r\n _.stat.thread = data.thread;\r\n _.stat.thread.posts = parseInt(_.dom.querySelector('#comment-count').innerHTML) + 1;\r\n _.dom.querySelector('#comment-count').innerHTML = _.stat.thread.posts + ' 条评论';\r\n var post = data.response;\r\n post.isPost = true;\r\n _.load(post);\r\n _.timeAgo();\r\n var postData = {\r\n post: JSON.stringify(post),\r\n thread: JSON.stringify(_.stat.thread),\r\n parent: JSON.stringify(_.stat.post[parentId]),\r\n code: data.verifyCode\r\n }\r\n if (!!data.verifyCode) {\r\n // 异步发送邮件\r\n postAjax(_.opts.api + '/sendemail.php', postData, function (resp) {\r\n console.info('邮件发送成功!');\r\n })\r\n }\r\n } else if (data.code === 2) {\r\n alertmsg.innerHTML = data.response;\r\n _.dom.querySelector('.comment-item[data-id=\"preview\"]').outerHTML = '';\r\n _.reEdit(item);\r\n\r\n if (data.response.indexOf('author') > -1) {\r\n _.handle.logout();\r\n }\r\n } else {\r\n alertmsg.innerHTML = '提交失败,请稍后重试,错误代码:' + data.code;\r\n alertClear();\r\n\r\n _.dom.querySelector('.comment-item[data-id=\"preview\"]').outerHTML = '';\r\n _.reEdit(item);\r\n }\r\n\r\n }, function () {\r\n alertmsg.innerHTML = '提交出错,请稍后重试。';\r\n alertClear();\r\n\r\n _.dom.querySelector('.comment-item[data-id=\"preview\"]').outerHTML = '';\r\n _.reEdit(item);\r\n })\r\n }\r\n }\r\n\r\n // 重新编辑\r\n iDisqus.prototype.reEdit = function (item) {\r\n var _ = this;\r\n\r\n if (!!item.dataset.id) {\r\n item.querySelector('.comment-item-reply').click();\r\n } else {\r\n item.querySelector('.comment-form-wrapper').classList.add('editing');\r\n }\r\n\r\n // 重新填充文本图片\r\n if (!!_.stat.message) {\r\n item.querySelector('.comment-form-textarea').value = _.stat.message;\r\n }\r\n if (!!_.stat.mediaHtml) {\r\n item.querySelector('.comment-form-wrapper').classList.add('expanded');\r\n item.querySelector('.comment-image-list').innerHTML = _.stat.mediaHtml;\r\n }\r\n }\r\n\r\n // 编辑\r\n iDisqus.prototype.edit = function (post) {\r\n var _ = this;\r\n var commentBox = _.box.replace('comment-box', 'comment-box comment-box-' + post.id).replace(/emoji-input/g, 'emoji-input-' + post.id).replace(/upload-input/g, 'upload-input-' + post.id);\r\n var $this = _.dom.querySelector('.comment-item[data-id=\"' + post.id + '\"] .comment-item-body');\r\n $this.outerHTML = commentBox;\r\n _.user.init();\r\n var item = _.dom.querySelector('.comment-box-' + post.id);\r\n item.dataset.currentId = post.id;\r\n item.querySelector('.comment-form-textarea').focus();\r\n\r\n // 取消编辑\r\n item.querySelector('.comment-actions-form').insertAdjacentHTML('afterbegin', '<a class=\"comment-form-cancel\" href=\"javascript:;\">取消</a>')\r\n item.querySelector('.comment-form-cancel').addEventListener('click', function () {\r\n _.stat.editing = false;\r\n _.load(post);\r\n _.timeAgo();\r\n }, false);\r\n\r\n // 重新填充文本图片,连续回复、连续编辑会有 bug\r\n if (!!_.stat.message) {\r\n item.querySelector('.comment-form-textarea').value = _.stat.message;\r\n }\r\n if (!!_.stat.mediaHtml) {\r\n item.querySelector('.comment-form-wrapper').classList.add('expanded');\r\n item.querySelector('.comment-image-list').innerHTML = _.stat.mediaHtml;\r\n }\r\n\r\n }\r\n\r\n // Thread 初始化\r\n iDisqus.prototype.threadInit = function (e, target) {\r\n var _ = this;\r\n _.dom.querySelector('#idisqus').style.display = 'block';\r\n _.dom.querySelector('#disqus_thread').style.display = 'none';\r\n getAjax(_.opts.api + '/threadsDetails.php?ident=' + _.opts.identifier + '&link=' + _.opts.url, function (resp) {\r\n var data = JSON.parse(resp);\r\n if (data.code == 0) {\r\n _.stat.thread = data.response;\r\n _.stat.forum = data.forum;\r\n _.dom.querySelector('#comment-link').href = `https://disqus.com/home/discussion/${_.stat.forum.id}/${_.stat.thread.slug}/?l=zh`;\r\n _.dom.querySelector('.comment-avatar-image').dataset.avatar = _.stat.forum.avatar;\r\n _.dom.querySelector('.comment-recommend-count').innerHTML = _.stat.thread.likes || '';\r\n if (_.stat.forum.settings.mediaembedEnabled == false) {\r\n _.dom.querySelector('.comment-image-input').outerHTML = ''\r\n _.dom.querySelector('[for=\"upload-input\"]').outerHTML = ''\r\n }\r\n if (_.user.logged_in == 'false') {\r\n _.dom.querySelector('.comment-avatar-image').src = _.stat.forum.avatar;\r\n }\r\n _.box = _.dom.querySelector('.comment-box').outerHTML.replace(/<label class=\"comment-actions-label exit\"(.|\\n)*<\\/label>\\n/, '').replace('comment-form-wrapper', 'comment-form-wrapper editing').replace(/加入讨论……/, '');\r\n _.opts.badge = _.stat.forum.moderatorBadgeText;\r\n if (!_.stat.order) {\r\n switch (_.stat.forum.order) {\r\n case 1:\r\n _.stat.order = 'asc';\r\n break;\r\n case 2:\r\n _.stat.order = 'desc';\r\n break;\r\n case 4:\r\n _.stat.order = 'popular';\r\n break;\r\n }\r\n }\r\n _.dom.querySelector('.comment-order-radio[value=\"' + _.stat.order + '\"]').checked = true;\r\n\r\n var users = data.votedusers;\r\n var vote = 0;\r\n if (_.user.type == 1) {\r\n // 已登录\r\n vote = users.filter(function (user) {\r\n return user.username == _.user.username;\r\n }).length > 0 ? 1 : 0;\r\n } else {\r\n // 未登录\r\n vote = !!_.user.vote[_.stat.thread.id] ? 1 : 0;;\r\n }\r\n _.user.vote[_.stat.thread.id] = vote;\r\n l.setItem('vote', JSON.stringify(_.user.vote));\r\n if (!!vote) {\r\n _.dom.querySelector('.comment-recommend').classList.add('voted');\r\n _.dom.querySelector('.comment-recommend-text').innerHTML = '已推荐';\r\n }\r\n _.dom.querySelector('#idisqus').classList.remove('init')\r\n _.loadRelated();\r\n _.loadReactions();\r\n _.dom.querySelector('#comment-count').innerHTML = _.stat.thread.posts + ' 条评论';\r\n _.getlist();\r\n } else if (data.code === 2) {\r\n // 自动创建\r\n if (_.opts.autoCreate) {\r\n _.dom.querySelector('.init-container').dataset.tips = '正在创建 Thread……';\r\n var postData = {\r\n url: _.opts.link,\r\n identifier: _.opts.identifier,\r\n title: _.opts.title,\r\n slug: _.opts.slug,\r\n message: _.opts.desc\r\n }\r\n _.threadCreate(postData);\r\n return;\r\n }\r\n _.dom.querySelector('#idisqus').classList.remove('init');\r\n var threadForm = `<div class=\"comment-header\"><span class=\"comment-header-item\">创建 Thread</span></div>\r\n <div class=\"comment-thread-form\">\r\n <p>由于 Disqus 没有本页面的相关 Thread,故需先创建 Thread</p>\r\n <div class=\"comment-form-item\"><label class=\"comment-form-label\">url:</label><input class=\"comment-form-input\" id=\"thread-url\" name=\"url\" value=\"${ _.opts.link}\" disabled /></div>\r\n <div class=\"comment-form-item\"><label class=\"comment-form-label\">identifier:</label><input class=\"comment-form-input\" id=\"thread-identifier\" name=\"identifier\" value=\"${ _.opts.identifier}\" disabled /></div>\r\n <div class=\"comment-form-item\"><label class=\"comment-form-label\">title:</label><input class=\"comment-form-input\" id=\"thread-title\" name=\"title\" value=\"${ _.opts.title}\" disabled /></div>\r\n <div class=\"comment-form-item\"><label class=\"comment-form-label\">slug:</label><input class=\"comment-form-input\" id=\"thread-slug\" name=\"slug\" value=\"${ _.opts.slug}\" /></div>\r\n <div class=\"comment-form-item\"><label class=\"comment-form-label\">message:</label><textarea class=\"comment-form-textarea\" id=\"thread-message\" name=\"message\">${ _.opts.desc}</textarea></div>\r\n <button id=\"thread-submit\" class=\"comment-form-submit\">提交</button></div>`;\r\n _.dom.querySelector('#idisqus').innerHTML = threadForm;\r\n }\r\n }, function () { })\r\n }\r\n\r\n // Thread 打分事件\r\n iDisqus.prototype.threadVote = function (e, target) {\r\n var _ = this;\r\n var vote = !!_.user.vote[_.stat.thread.id] ? 0 : 1;\r\n var postData = {\r\n thread: _.stat.thread.id,\r\n unique: _.user.unique,\r\n vote: vote\r\n }\r\n postAjax(_.opts.api + '/threadsVote.php', postData, function (resp) {\r\n _.user.vote[_.stat.thread.id] = vote;\r\n l.setItem('vote', JSON.stringify(_.user.vote));\r\n if (!!vote) {\r\n _.dom.querySelector('.comment-recommend').classList.add('voted');\r\n _.stat.thread.likes++;\r\n } else {\r\n _.dom.querySelector('.comment-recommend').classList.remove('voted');\r\n _.stat.thread.likes = _.stat.thread.likes == 0 ? 0 : _.stat.thread.likes - 1;\r\n }\r\n _.dom.querySelector('.comment-recommend-count').innerHTML = _.stat.thread.likes || '';\r\n })\r\n }\r\n\r\n // Thread Create 事件\r\n iDisqus.prototype.threadCreate = function (e, target) {\r\n var _ = this;\r\n if (!!target) {\r\n var postData = {\r\n url: _.dom.querySelector('#thread-url').value,\r\n identifier: _.dom.querySelector('#thread-identifier').value,\r\n title: _.dom.querySelector('#thread-title').value,\r\n slug: _.dom.querySelector('#thread-slug').value.replace(/[^A-Za-z0-9_-]+/g, ''),\r\n message: _.dom.querySelector('#thread-message').value\r\n }\r\n } else {\r\n var postData = arguments[0];\r\n }\r\n postAjax(_.opts.api + '/createthread.php', postData, function (resp) {\r\n var data = JSON.parse(resp);\r\n if (data.code === 0) {\r\n alert('创建 Thread 成功,刷新后便可愉快地评论了!');\r\n setTimeout(function () { location.reload(); }, 2000);\r\n } else if (data.code === 2) {\r\n if (data.response.indexOf('A thread already exists with link') > -1) {\r\n alert(data.response.replace('A thread already exists with link,', '已存在此链接的相关 Thread,'));\r\n return;\r\n }\r\n if (data.response.indexOf('Invalid URL') > -1) {\r\n alert('参数错误,无效的\\'URL\\'');\r\n return;\r\n }\r\n if (data.response.indexOf('Invalid slug') > -1) {\r\n alert('参数错误,无效的\\'slug\\'');\r\n return;\r\n }\r\n alert(data.response);\r\n return;\r\n } else {\r\n alert(data.response);\r\n return;\r\n }\r\n }, function () {\r\n alert('创建 Thread 出错,请稍后重试!');\r\n })\r\n }\r\n\r\n // 销毁评论框\r\n iDisqus.prototype.destroy = function () {\r\n var _ = this;\r\n _.dom.innerHTML = '';\r\n delete _.dom;\r\n delete _.box;\r\n delete _.emojiList;\r\n delete _.user;\r\n delete _.handle;\r\n delete _.stat;\r\n delete _.opts;\r\n }\r\n\r\n /* CommonJS */\r\n if ( true && module && typeof exports === 'object' && exports)\r\n module.exports = iDisqus;\r\n /* AMD */\r\n else if (true)\r\n !(__WEBPACK_AMD_DEFINE_RESULT__ = (function () {\r\n return iDisqus;\r\n }).call(exports, __webpack_require__, exports, module),\n\t\t\t\t__WEBPACK_AMD_DEFINE_RESULT__ !== undefined && (module.exports = __WEBPACK_AMD_DEFINE_RESULT__));\r\n /* Global */\r\n else\r\n {}\r\n\r\n})(window || this);\r\n\n/* WEBPACK VAR INJECTION */}.call(this, __webpack_require__(/*! ./../node_modules/webpack/buildin/module.js */ \"./node_modules/webpack/buildin/module.js\")(module)))\n\n//# sourceURL=webpack://%5Bname%5D/./src/iDisqus.js?");
+
+/***/ }),
+
+/***/ "./src/iDisqus.scss":
+/*!**************************!*\
+ !*** ./src/iDisqus.scss ***!
+ \**************************/
+/*! no static exports found */
+/***/ (function(module, exports, __webpack_require__) {
+
+eval("\nvar content = __webpack_require__(/*! !../node_modules/css-loader/dist/cjs.js!../node_modules/postcss-loader/src??ref--4-2!../node_modules/sass-loader/dist/cjs.js!./iDisqus.scss */ \"./node_modules/css-loader/dist/cjs.js!./node_modules/postcss-loader/src/index.js?!./node_modules/sass-loader/dist/cjs.js!./src/iDisqus.scss\");\n\nif(typeof content === 'string') content = [[module.i, content, '']];\n\nvar transform;\nvar insertInto;\n\n\n\nvar options = {\"hmr\":true}\n\noptions.transform = transform\noptions.insertInto = undefined;\n\nvar update = __webpack_require__(/*! ../node_modules/style-loader/lib/addStyles.js */ \"./node_modules/style-loader/lib/addStyles.js\")(content, options);\n\nif(content.locals) module.exports = content.locals;\n\nif(false) {}\n\n//# sourceURL=webpack://%5Bname%5D/./src/iDisqus.scss?");
+
+/***/ })
+
+/******/ });
+}); \ No newline at end of file
diff --git a/static/js/iDisqus.min.js b/static/js/iDisqus.min.js
index f464b66..6275223 100644
--- a/static/js/iDisqus.min.js
+++ b/static/js/iDisqus.min.js
@@ -1,80 +1,12 @@
-/*
- v 0.1.23
- https://github.com/fooleap/disqus-php-api
-
- Copyright 2017 fooleap
- Released under the MIT license
-*/
-var $jscomp=$jscomp||{};$jscomp.scope={};$jscomp.ASSUME_ES5=!1;$jscomp.ASSUME_NO_NATIVE_MAP=!1;$jscomp.ASSUME_NO_NATIVE_SET=!1;$jscomp.defineProperty=$jscomp.ASSUME_ES5||"function"==typeof Object.defineProperties?Object.defineProperty:function(d,g,m){d!=Array.prototype&&d!=Object.prototype&&(d[g]=m.value)};$jscomp.getGlobal=function(d){return"undefined"!=typeof window&&window===d?d:"undefined"!=typeof global&&null!=global?global:d};$jscomp.global=$jscomp.getGlobal(this);$jscomp.SYMBOL_PREFIX="jscomp_symbol_";
-$jscomp.initSymbol=function(){$jscomp.initSymbol=function(){};$jscomp.global.Symbol||($jscomp.global.Symbol=$jscomp.Symbol)};$jscomp.Symbol=function(){var d=0;return function(g){return $jscomp.SYMBOL_PREFIX+(g||"")+d++}}();
-$jscomp.initSymbolIterator=function(){$jscomp.initSymbol();var d=$jscomp.global.Symbol.iterator;d||(d=$jscomp.global.Symbol.iterator=$jscomp.global.Symbol("iterator"));"function"!=typeof Array.prototype[d]&&$jscomp.defineProperty(Array.prototype,d,{configurable:!0,writable:!0,value:function(){return $jscomp.arrayIterator(this)}});$jscomp.initSymbolIterator=function(){}};$jscomp.arrayIterator=function(d){var g=0;return $jscomp.iteratorPrototype(function(){return g<d.length?{done:!1,value:d[g++]}:{done:!0}})};
-$jscomp.iteratorPrototype=function(d){$jscomp.initSymbolIterator();d={next:d};d[$jscomp.global.Symbol.iterator]=function(){return this};return d};$jscomp.iteratorFromArray=function(d,g){$jscomp.initSymbolIterator();d instanceof String&&(d+="");var m=0,h={next:function(){if(m<d.length){var l=m++;return{value:g(l,d[l]),done:!1}}h.next=function(){return{done:!0,value:void 0}};return h.next()}};h[Symbol.iterator]=function(){return h};return h};
-$jscomp.polyfill=function(d,g,m,h){if(g){m=$jscomp.global;d=d.split(".");for(h=0;h<d.length-1;h++){var l=d[h];l in m||(m[l]={});m=m[l]}d=d[d.length-1];h=m[d];g=g(h);g!=h&&null!=g&&$jscomp.defineProperty(m,d,{configurable:!0,writable:!0,value:g})}};$jscomp.polyfill("Array.prototype.keys",function(d){return d?d:function(){return $jscomp.iteratorFromArray(this,function(d){return d})}},"es6","es3");
-(function(d){function g(a,c,b){var n=new XMLHttpRequest;n.open("GET",encodeURI(a));n.onreadystatechange=function(){4==n.readyState&&200==n.status&&c(n.responseText)};n.onerror=b;n.send();return n}function m(a,c,b,n){var e="string"==typeof c?c:Object.keys(c).map(function(a){return encodeURIComponent(a)+"="+encodeURIComponent(c[a])}).join("&"),d=new XMLHttpRequest;d.open("POST",a);d.onreadystatechange=function(){4==d.readyState&&200==d.status&&b(d.responseText)};d.onerror=n;d.setRequestHeader("Content-Type",
-"application/x-www-form-urlencoded");d.send(e);return d}function h(a,c,b){[].forEach.call(a,function(a){a.addEventListener(c,b,!1)})}function l(a,c,b){[].forEach.call(a,function(a){a.removeEventListener(c,b,!1)})}var k=document,p=localStorage,r=k.scripts;r=r[r.length-1].src;var u=r.substring(0,r.lastIndexOf("/")),v=-1<navigator.userAgent.indexOf("Edge"),w=!!window.ActiveXObject||"ActiveXObject"in window;(function(a){"function"!==typeof a.matches&&(a.matches=a.msMatchesSelector||a.mozMatchesSelector||
-a.webkitMatchesSelector||function(a){a=(this.document||this.ownerDocument).querySelectorAll(a);for(var b=0;a[b]&&a[b]!==this;)++b;return!!a[b]});"function"!==typeof a.closest&&(a.closest=function(a){for(var b=this;b&&1===b.nodeType;){if(b.matches(a))return b;b=b.parentNode}return null})})(window.Element.prototype);var t=function(a){this.dom=a;this.init()};t.prototype={init:function(){var a=this;a.name=p.getItem("name");a.email=p.getItem("email");a.url=p.getItem("url");a.avatar=p.getItem("avatar");
-a.logged_in=p.getItem("logged_in");var c=a.dom.getElementsByClassName("comment-box");"true"==a.logged_in?[].forEach.call(c,function(b){b.querySelector(".comment-form-wrapper").classList.add("logged-in");b.querySelector(".comment-form-name").value=a.name;b.querySelector(".comment-form-email").value=a.email;b.querySelector(".comment-form-url").value=a.url;b.querySelector(".comment-avatar-image").src=a.avatar}):([].forEach.call(c,function(b){b.querySelector(".comment-form-wrapper").classList.remove("logged-in");
-b.querySelector(".comment-form-name").value=a.name;b.querySelector(".comment-form-email").value=a.email;b.querySelector(".comment-form-url").value=a.url;b.querySelector(".comment-avatar-image").src=a.avatar?a.avatar:b.querySelector(".comment-avatar-image").src}),p.setItem("logged_in","false"))},reset:function(){p.setItem("logged_in","false");this.init()},submit:function(a){"false"==this.logged_in&&(p.setItem("name",a.name),p.setItem("email",a.email),p.setItem("url",a.url),p.setItem("avatar",a.avatar),
-p.setItem("logged_in","true"),this.init())}};var f=function(a,c){var b=this;b.opts="object"==typeof c?c:a;b.dom=k.getElementById("string"==typeof a?a:"comment");b.opts.api="/"==b.opts.api.slice(-1)?b.opts.api.slice(0,-1):b.opts.api;b.opts.site=b.opts.site?b.opts.site:location.origin;b.opts.url?(a=b.opts.url.replace(b.opts.site,""),b.opts.url="/"!=a.slice(0,1)?"/"+a:a):b.opts.url=v||w?encodeURI(location.pathname)+encodeURI(location.search):location.pathname+location.search;b.opts.identifier=b.opts.identifier?
-b.opts.identifier:b.opts.url;b.opts.link=b.opts.site+b.opts.url;b.opts.title=b.opts.title?b.opts.title:k.title;b.opts.slug=b.opts.slug?b.opts.slug.replace(/[^A-Za-z0-9_-]+/g,""):"";b.opts.desc=b.opts.desc?b.opts.desc:k.querySelector('[name="description"]')?k.querySelector('[name="description"]').content:"";b.opts.mode=b.opts.mode?b.opts.mode:1;b.opts.timeout=b.opts.timeout?b.opts.timeout:3E3;b.opts.toggle=b.opts.toggle?k.getElementById(b.opts.toggle):null;b.opts.badge=b.opts.badge?b.opts.badge:"\u7ba1\u7406\u5458";
-b.opts.emoji_path=b.opts.emoji_path?b.opts.emoji_path:"https://cdn.jsdelivr.net/emojione/assets/png/";b.emoji_list=b.opts.emoji_list?b.opts.emoji_list:[{code:"smile",title:"\u7b11\u8138",unicode:"1f604"},{code:"mask",title:"\u751f\u75c5",unicode:"1f637"},{code:"joy",title:"\u7834\u6d95\u4e3a\u7b11",unicode:"1f602"},{code:"stuck_out_tongue_closed_eyes",title:"\u5410\u820c",unicode:"1f61d"},{code:"flushed",title:"\u8138\u7ea2",unicode:"1f633"},{code:"scream",title:"\u6050\u60e7",unicode:"1f631"},
-{code:"pensive",title:"\u5931\u671b",unicode:"1f614"},{code:"unamused",title:"\u65e0\u8bed",unicode:"1f612"},{code:"grin",title:"\u9732\u9f7f\u7b11",unicode:"1f601"},{code:"heart_eyes",title:"\u8272",unicode:"1f60d"},{code:"sweat",title:"\u6c57",unicode:"1f613"},{code:"smirk",title:"\u5f97\u610f",unicode:"1f60f"},{code:"relieved",title:"\u6ee1\u610f",unicode:"1f60c"},{code:"rolling_eyes",title:"\u7ffb\u767d\u773c",unicode:"1f644"},{code:"ok_hand",title:"OK",unicode:"1f44c"},{code:"v",title:"\u80dc\u5229",
-unicode:"270c"}];b.opts.emoji_preview&&g(u+"/eac.min.json",function(a){b.eac=JSON.parse(a)},function(){});b.stat={current:"idisqus",loaded:!1,loading:!1,editing:!1,offsetTop:0,thread:null,next:null,message:null,mediaHtml:null,root:[],count:0,users:[],imageSize:[],disqusLoaded:!1};window.disqus_config=function(){this.page.identifier=b.opts.identifier;this.page.title=b.opts.title;this.page.url=b.opts.link;this.callbacks.onReady.push(function(){b.stat.current="disqus";b.stat.disqusLoaded=!0;b.dom.querySelector("#idisqus").style.display=
-"none";b.dom.querySelector("#disqus_thread").style.display="block";3==b.opts.mode&&b.opts.toggle&&(b.opts.toggle.disabled="",b.opts.toggle.checked=!0,b.opts.toggle.addEventListener("change",b.handle.toggle,!1))})};b.opts.init&&b.init()};f.prototype.timeAgo=function(){var a={prefix:"",suffix:"\u524d",seconds:"\u51e0\u79d2",minute:"1\u5206\u949f",minutes:"%d\u5206\u949f",hour:"1\u5c0f\u65f6",hours:"%d\u5c0f\u65f6",day:"1\u5929",days:"%d\u5929",month:"1\u4e2a\u6708",months:"%d\u4e2a\u6708",year:"1\u5e74",
-years:"%d\u5e74"},c=function(b,c){return a[b]&&a[b].replace(/%d/i,Math.abs(Math.round(c)))},b=function(b){if(b){b=b.replace(/\.\d+/,"");b=b.replace(/-/,"/").replace(/-/,"/");b=b.replace(/T/," ").replace(/Z/," UTC");b=b.replace(/([\+\-]\d\d):?(\d\d)/," $1$2");b=new Date(1E3*b||b);b=.001*((new Date).getTime()-b)>>0;var e=b/60,d=e/60,n=d/24,f=n/365;return a.prefix+(45>b&&c("seconds",b)||90>b&&c("minute",1)||45>e&&c("minutes",e)||90>e&&c("hour",1)||24>d&&c("hours",d)||42>d&&c("day",1)||30>n&&c("days",
-n)||45>n&&c("month",1)||365>n&&c("months",n/30)||1.5>f&&c("year",1)||c("years",f))+a.suffix}},n=this.dom.querySelectorAll(".comment-item-time"),e;for(e in n){var d=n[e];"object"===typeof d&&(d.title=new Date(d.getAttribute("datetime")),d.innerHTML=b(d.getAttribute("datetime")))}setTimeout(this.timeAgo.bind(this),6E4)};f.prototype.init=function(){var a=this;if(a.dom){var c="";a.emoji_list.forEach(function(b){c+='<li class="emojione-item" title="'+b.title+'" data-code=":'+b.code+':"><img class="emojione-item-image" src="'+
-a.opts.emoji_path+b.unicode+'.png" /></li>'});a.dom.innerHTML='<div class="comment loading" id="idisqus">\n <div class="loading-container" data-tip="\u6b63\u5728\u52a0\u8f7d\u8bc4\u8bba\u2026\u2026"><svg class="loading-bg" width="72" height="72" viewBox="0 0 720 720" version="1.1" xmlns="http://www.w3.org/2000/svg"><path class="ring" fill="none" stroke="#9d9ea1" d="M 0 -260 A 260 260 0 1 1 -80 -260" transform="translate(400,400)" stroke-width="50" /><polygon transform="translate(305,20)" points="50,0 0,100 18,145 50,82 92,145 100,100" style="fill:#9d9ea1"/></svg></div>\n <div class="comment-header"><span class="comment-header-item" id="comment-count">\u8bc4\u8bba</span><a target="_blank" class="comment-header-item" id="comment-link">Disqus \u8ba8\u8bba\u533a</a></div>\n <div class="comment-box">\n <div class="comment-avatar avatar"><img class="comment-avatar-image" src="https://a.disquscdn.com/images/noavatar92.png"></div>\n <div class="comment-form">\n <div class="comment-form-wrapper">\n <textarea class="comment-form-textarea" placeholder="\u52a0\u5165\u8ba8\u8bba\u2026\u2026"></textarea>\n <div class="comment-form-alert"></div>\n <div class="comment-image">\n <ul class="comment-image-list"></ul>\n <div class="comment-image-progress">\n <div class="comment-image-loaded"></div>\n </div>\n </div>\n <div class="comment-actions">\n <div class="comment-actions-group">\n <input id="emoji-input" class="comment-actions-input" type="checkbox"> \n <label class="comment-actions-label emojione" for="emoji-input" title="\u9009\u62e9\u8868\u60c5">\n <svg class="icon" fill="#c2c6cc" viewBox="0 0 1024 1024" version="1.1" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" width="200" height="200">\n <path d="M512 1024c-282.713043 0-512-229.286957-512-512s229.286957-512 512-512c282.713043 0 512 229.286957 512 512S792.486957 1024 512 1024zM512 44.521739c-258.226087 0-467.478261 209.252174-467.478261 467.478261 0 258.226087 209.252174 467.478261 467.478261 467.478261s467.478261-209.252174 467.478261-467.478261C979.478261 253.773913 768 44.521739 512 44.521739z"></path>\n <path d="M801.391304 554.295652c0 160.278261-129.113043 289.391304-289.391304 289.391304s-289.391304-129.113043-289.391304-289.391304L801.391304 554.295652z"></path>\n <path d="M674.504348 349.495652m-57.878261 0a2.6 2.6 0 1 0 115.756522 0 2.6 2.6 0 1 0-115.756522 0Z"></path>\n <path d="M347.269565 349.495652m-57.878261 0a2.6 2.6 0 1 0 115.756522 0 2.6 2.6 0 1 0-115.756522 0Z"></path>\n </svg>\n <ul class="emojione-list">'+
-c+'</ul>\n </label>\n <input id="upload-input" class="comment-actions-input comment-image-input" type="file" accept="image/*" name="file"> \n <label class="comment-actions-label" for="upload-input" title="\u4e0a\u4f20\u56fe\u7247">\n <svg class="icon" fill="#c2c6cc" viewBox="0 0 1024 1024" version="1.1" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" width="200" height="200">\n <path d="M15.515152 15.515152 15.515152 15.515152 15.515152 15.515152Z"></path>\n <path d="M15.515152 139.636364l0 806.787879 992.969697 0 0-806.787879-992.969697 0zM946.424242 884.363636l-868.848485 0 0-682.666667 868.848485 0 0 682.666667zM698.181818 356.848485c0-51.417212 41.673697-93.090909 93.090909-93.090909s93.090909 41.673697 93.090909 93.090909c0 51.417212-41.673697 93.090909-93.090909 93.090909s-93.090909-41.673697-93.090909-93.090909zM884.363636 822.30303l-744.727273 0 186.181818-496.484848 248.242424 310.30303 124.121212-93.090909z"></path>\n </svg>\n </label>\n </div>\n <div class="comment-actions-form">\n <label class="comment-actions-label exit" title="\u91cd\u7f6e\u8bbf\u5ba2\u4fe1\u606f">\n <svg class="icon" fill="#c2c6cc" viewBox="0 0 1024 1024" version="1.1" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" width="48" height="48">\n <path d="M348.870666 210.685443l378.570081 0c32.8205 0 58.683541 26.561959 58.683541 58.683541 0 162.043606 0 324.804551 0 486.848157 0 32.81129-26.561959 58.674331-58.683541 58.674331L348.870666 814.891472c-10.477632 0-18.850323-8.363482-18.850323-18.841114l0-37.728276c0-10.477632 8.372691-18.841114 18.850323-18.841114l343.645664 0c10.477632 0 18.850323-8.372691 18.850323-18.850323L711.366653 304.983109c0-10.477632-8.372691-18.841114-18.850323-18.841114L348.870666 286.141996c-10.477632 0-18.850323-8.363482-18.850323-18.841114l0-37.728276C329.98248 219.095997 338.393034 210.685443 348.870666 210.685443z"></path>\n <path d="M128.152728 526.436804l112.450095 112.450095c6.985088 6.985088 19.567661 6.985088 26.552749 0l26.561959-26.561959c6.985088-6.985088 6.985088-19.567661 0-26.552749l-34.925441-34.925441L494.168889 550.84675c10.477632 0 18.850323-8.372691 18.850323-18.850323l0-37.719066c0-10.477632-8.372691-18.850323-18.850323-18.850323L258.754229 475.427036l34.925441-34.925441c6.985088-6.985088 6.985088-19.567661 0-26.552749l-26.561959-26.524097c-6.985088-6.985088-19.567661-6.985088-26.552749 0L128.152728 499.875868C120.431883 506.859933 120.431883 519.451716 128.152728 526.436804z"></path>\n </svg>\n </label>\n <button class="comment-form-submit">\n <svg class="icon" viewBox="0 0 1024 1024" version="1.1" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" width="200" height="200">\n <path d="M565.747623 792.837176l260.819261 112.921839 126.910435-845.424882L66.087673 581.973678l232.843092 109.933785 562.612725-511.653099-451.697589 563.616588-5.996574 239.832274L565.747623 792.837176z" fill="#ffffff"></path>\n </svg>\n </button>\n </div>\n </div>\n </div>\n <div class="comment-login"><input class="comment-form-input comment-form-name" type="text" placeholder="\u540d\u5b57\uff08\u5fc5\u586b\uff09" autocomplete="name"><input class="comment-form-input comment-form-email" type="email" placeholder="\u90ae\u7bb1\uff08\u5fc5\u586b\uff09" autocomplete="email"><input class="comment-form-input comment-form-url" type="url" placeholder="\u7f51\u5740\uff08\u53ef\u9009\uff09" autocomplete="url"></div>\n </div>\n </div>\n <ul id="comments" class="comment-list"></ul>\n <a href="javascript:;" class="comment-loadmore">\u52a0\u8f7d\u66f4\u591a</a>\n</div>\n<div class="comment" id="disqus_thread"></div>';
-a.guest=new t(a.dom);a.box=a.dom.querySelector(".comment-box").outerHTML.replace(/<label class="comment-actions-label exit"(.|\n)*<\/label>\n/,"").replace("comment-form-wrapper","comment-form-wrapper editing").replace(/\u52a0\u5165\u8ba8\u8bba\u2026\u2026/,"");a.handle={guestReset:a.guest.reset.bind(a.guest),loadMore:a.loadMore.bind(a),post:a.post.bind(a),postThread:a.postThread.bind(a),remove:a.remove.bind(a),show:a.show.bind(a),toggle:a.toggle.bind(a),upload:a.upload.bind(a),verify:a.verify.bind(a),
-jump:a.jump.bind(a),mention:a.mention.bind(a),keySelect:a.keySelect.bind(a),field:a.field,focus:a.focus,input:a.input};switch(a.opts.mode){case 1:a.disqus();break;case 2:a.getlist();break;case 3:a.getlist();a.disqus();break;default:a.disqus()}}};f.prototype.toggle=function(){"disqus"==this.stat.current?(this.stat.current="idisqus",this.dom.querySelector("#idisqus").style.display="block",this.dom.querySelector("#disqus_thread").style.display="none"):this.disqus()};f.prototype.disqus=function(){var a=
-this;a.dom.querySelector(".loading-container");if(a.stat.disqusLoaded)a.stat.current="disqus",a.dom.querySelector("#idisqus").style.display="none",a.dom.querySelector("#disqus_thread").style.display="block";else{var c=k.createElement("script");c.src="//"+a.opts.forum+".disqus.com/embed.js";c.dataset.timestamp=Date.now();c.onload=function(){a.stat.disqusLoaded=!0};c.onerror=function(){1==a.opts.mode&&a.getlist()};var b=new XMLHttpRequest;b.open("GET","//disqus.com/next/config.json?"+Date.now(),!0);
-b.timeout=a.opts.timeout;b.onreadystatechange=function(){4==b.readyState&&200==b.status&&(k.head||k.body).appendChild(c)};b.ontimeout=function(){b.abort();1==a.opts.mode&&a.getlist()};b.onerror=function(){1==a.opts.mode&&a.getlist()};b.send()}};f.prototype.count=function(){var a=this,c=k.querySelectorAll("[data-disqus-url]"),b=c.length;if(0<b){for(var n=[],e=0;e<b;e++)n[e]=c[e].dataset.disqusUrl.replace(a.opts.site,"");g(a.opts.api+"/count.php?links="+n.join(","),function(b){JSON.parse(b).response.forEach(function(b){var c=
-b.link.replace(a.opts.site,"");c="/"!=c.slice(0,1)?"/"+c:c;if(c=k.querySelector('[data-disqus-url$="'+c+'"]'))c.innerHTML=b.posts,c.dataset.disqusCount=b.posts})},function(){console.log("\u83b7\u53d6\u6570\u636e\u5931\u8d25\uff01")})}};f.prototype.popular=function(){var a=this;a.opts.popular&&g(a.opts.api+"/popular.php",function(c){c=JSON.parse(c);if(0==c.code){var b="";c.response.forEach(function(c){b+='<li><a href="'+c.link.replace(a.opts.site,"")+'" title="'+c.title+'">'+c.title+"</a></li>"});
-a.opts.popular.innerHTML=b}},function(){console.log("\u83b7\u53d6\u6570\u636e\u5931\u8d25\uff01")})};f.prototype.getlist=function(){var a=this;a.stat.loading=!0;a.dom.querySelector("#idisqus").style.display="block";a.dom.querySelector("#disqus_thread").style.display="none";g(a.opts.api+"/getcomments.php?link="+a.opts.url+(a.stat.next?"&cursor="+a.stat.next:""),function(c){c=JSON.parse(c);c.auth||alert("\u8ba4\u8bc1\u51fa\u9519\uff0c\u8bf7\u67e5\u770b\u540e\u7aef\u914d\u7f6e\u4e2d\uff0cDisqus \u5e10\u53f7\u5bc6\u7801\u662f\u5426\u586b\u5199\u6709\u8bef\u3002");
-if(0===c.code){a.stat.offsetTop=k.documentElement.scrollTop||k.body.scrollTop;a.stat.thread=c.thread;a.stat.count=c.posts;a.dom.querySelector("#idisqus").classList.remove("loading");a.dom.querySelector("#comment-link").href=c.link;a.dom.querySelector("#comment-count").innerHTML=a.stat.count+" \u6761\u8bc4\u8bba";var b=a.dom.querySelector(".comment-loadmore"),d=c.response?c.response:[];a.stat.root=[];d.forEach(function(b){a.load(b);b.parent||a.stat.root.unshift(b.id)});c.cursor.hasPrev?a.stat.root.forEach(function(b){a.dom.querySelector(".comment-list").appendChild(a.dom.querySelector("#comment-"+
-b))}):(b.addEventListener("click",a.handle.loadMore,!1),a.dom.querySelector(".exit").addEventListener("click",a.handle.guestReset,!1),a.dom.querySelector(".comment-form-textarea").addEventListener("blur",a.handle.focus,!1),a.dom.querySelector(".comment-form-textarea").addEventListener("focus",a.handle.focus,!1),a.dom.querySelector(".comment-form-textarea").addEventListener("input",a.handle.input,!1),a.dom.querySelector(".comment-form-textarea").addEventListener("keyup",a.handle.mention,!1),a.dom.querySelector(".comment-form-email").addEventListener("blur",
-a.handle.verify,!1),a.dom.querySelector(".comment-form-submit").addEventListener("click",a.handle.post,!1),a.dom.querySelector(".comment-image-input").addEventListener("change",a.handle.upload,!1),h(a.dom.getElementsByClassName("emojione-item"),"click",a.handle.field));c.cursor.hasNext?(a.stat.next=c.cursor.next,b.classList.remove("loading")):(a.stat.next=null,b.classList.add("hide"));0!=d.length&&(window.scrollTo(0,a.stat.offsetTop),a.timeAgo(),!/^#disqus|^#comment/.test(location.hash)||c.cursor.hasPrev||
-a.stat.disqusLoaded||(c=a.dom.querySelector("#idisqus "+location.hash),window.scrollBy(0,c.getBoundingClientRect().top)),a.stat.loading=!1,a.stat.loaded=!0)}else 2===c.code&&a.create()},function(){alert("\u83b7\u53d6\u6570\u636e\u5931\u8d25\uff0c\u8bf7\u68c0\u67e5\u670d\u52a1\u5668\u8bbe\u7f6e\u3002")})};f.prototype.load=function(a){var c=this,b=c.dom.querySelector('.comment-item[data-id="'+a.parent+'"]'),d={username:a.username,name:a.name,avatar:a.avatar};a.username&&-1==c.stat.users.map(function(a){return a.username}).indexOf(a.username)&&
-c.stat.users.push(d);b=a.parent?{name:'<a class="comment-item-pname" href="#'+b.id+'"><svg class="icon" viewBox="0 0 1024 1024" version="1.1" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" width="200" height="200"><path d="M1.664 902.144s97.92-557.888 596.352-557.888V129.728L1024 515.84l-425.984 360.448V628.8c-270.464 0-455.232 23.872-596.352 273.28"></path></svg>'+b.dataset.name+"</a>",dom:b.querySelector(".comment-item-children"),insert:"afterbegin"}:{name:"",dom:c.dom.querySelector(".comment-list"),
-insert:"preview"==a.id||a.isPost?"afterbegin":"beforeend"};var e="";0<a.media.length&&(a.media.forEach(function(a){e+='<a class="comment-item-imagelink" target="_blank" href="'+a+'" ><img class="comment-item-image" src="'+a+'"></a>'}),e='<div class="comment-item-images">'+e+"</div>");d='<li class="comment-item" data-id="'+a.id+'" data-name="'+a.name+'" id="comment-'+a.id+'"><div class="comment-item-body"><a class="comment-item-avatar" href="#comment-'+a.id+'"><img src="'+a.avatar+'"></a><div class="comment-item-main"><div class="comment-item-header"><a class="comment-item-name" title="'+
-a.name+'" rel="nofollow" target="_blank" href="'+(a.url?a.url:"javascript:;")+'">'+a.name+"</a>"+(a.isMod?'<span class="comment-item-badge">'+c.opts.badge+"</span>":"")+b.name+'<span class="comment-item-bullet"> \u2022 </span><time class="comment-item-time" datetime="'+a.createdAt+'"></time></div><div class="comment-item-content">'+a.message+e+'</div><div class="comment-item-footer">'+(a.isPost?'<span class="comment-item-manage"><a class="comment-item-edit" href="javascript:;">\u7f16\u8f91</a><span class="comment-item-bullet"> \u2022 </span><a class="comment-item-delete" href="javascript:;">\u5220\u9664</a><span class="comment-item-bullet"> \u2022 </span></span>':
-"")+'<a class="comment-item-reply" href="javascript:;">\u56de\u590d</a> </div></div></div><ul class="comment-item-children"></ul></li>';a.isDeleted&&(d='<li class="comment-item" data-id="'+a.id+'" id="comment-'+a.id+'" data-name="\u5df2\u5220\u9664"><div class="comment-item-body"><a class="comment-item-avatar" href="#comment-'+a.id+'"><img src="'+a.avatar+'"></a><div class="comment-item-main" data-message="\u6b64\u8bc4\u8bba\u5df2\u88ab\u5220\u9664\u3002"></div></div><ul class="comment-item-children"></ul></li>');
-c.dom.querySelector('.comment-item[data-id="'+a.id+'"]')?c.dom.querySelector('.comment-item[data-id="'+a.id+'"]').outerHTML=d:b.dom.insertAdjacentHTML(b.insert,d);a.isDeleted||(c.dom.querySelector('.comment-item[data-id="'+a.id+'"] .comment-item-reply').addEventListener("click",c.handle.show,!1),c.dom.querySelector('.comment-item[data-id="'+a.id+'"] .comment-item-avatar').addEventListener("click",c.handle.jump,!1),a.parent&&c.dom.querySelector('.comment-item[data-id="'+a.id+'"] .comment-item-pname').addEventListener("click",
-c.handle.jump,!1));if(a.isPost&&!c.stat.editing){var f=c.dom.querySelector('.comment-item[data-id="'+a.id+'"]');f.querySelector(".comment-item-footer").insertAdjacentHTML("beforeend",'<span class="comment-item-tips">\u9875\u9762\u5237\u65b0\u524d\uff0c\u5341\u5206\u949f\u5185\u53ef\u7f16\u8f91\u6216\u5220\u9664</span>');setTimeout(function(){f.querySelector(".comment-item-tips")&&(f.querySelector(".comment-item-tips").outerHTML="")},5E3);var h=setTimeout(function(){f.querySelector(".comment-item-manage")&&
-(f.querySelector(".comment-item-manage").outerHTML="")},6E5);f.querySelector(".comment-item-delete").addEventListener("click",function(b){var d={id:a.id};b.currentTarget.innerHTML="\u5220\u9664\u4e2d";m(c.opts.api+"/removecomment.php",d,function(a){a=JSON.parse(a);0===a.code?1==a.response.isDeleted?f.outerHTML="":(alert(a.response.message),f.querySelector(".comment-item-manage").outerHTML=""):2===a.code&&(alert(a.response),f.querySelector(".comment-item-manage").outerHTML="")},function(){alert("\u5220\u9664\u51fa\u9519\uff0c\u8bf7\u7a0d\u540e\u91cd\u8bd5")});
-clearTimeout(h)},!1);f.querySelector(".comment-item-edit").addEventListener("click",function(){c.stat.editing=a;c.edit(a)},!1)}};f.prototype.loadMore=function(a){this.stat.loading||(a.currentTarget.classList.add("loading"),this.getlist())};f.prototype.focus=function(a){a=a.currentTarget.closest(".comment-form-wrapper");a.classList.add("editing");a.classList.contains("focus")?a.classList.remove("focus"):a.classList.add("focus")};f.prototype.input=function(a){a.currentTarget.closest(".comment-form").querySelector(".comment-form-alert").innerHTML=
-""};f.prototype.mention=function(a){var c=this,b=a.currentTarget,d=b.selectionStart,e=b.value.slice(0,d).lastIndexOf("@"),f=b.value.slice(e,d),g=c.dom.querySelector(".mention-user");if(0==f.search(/^@\w+$|^@$/)){if(38!=a.keyCode&&40!=a.keyCode){a=c.stat.users.filter(function(a){var b=new RegExp(f.slice(1),"i");return-1<a.username.search(b)});var m=c.getCaretCoord(b),l="",k="";0<a.length?(a.forEach(function(a,b){l+='<li class="mention-user-item'+(0==b?" active":"")+'" data-username="'+a.username+'"><img class="mention-user-avatar" src="'+
-a.avatar+'"><div class="mention-user-username">'+a.username+'</div><div class="mention-user-name">'+a.name+"</div></li>"}),g?(g.innerHTML='<ul class="mention-user-list">'+l+"</ul>",g.style.left=m.left+"px",g.style.top=m.top+"px"):(k='<div class="mention-user" style="left:'+m.left+"px;top:"+m.top+'px"><ul class="mention-user-list">'+l+"</ul></div>",c.dom.querySelector("#idisqus").insertAdjacentHTML("beforeend",k)),h(c.dom.getElementsByClassName("mention-user-item"),"mouseover",function(){c.dom.querySelector(".mention-user-item.active").classList.remove("active");
-this.classList.add("active")}),h(c.dom.getElementsByClassName("mention-user-item"),"click",function(){var a="@"+this.dataset.username+" ";b.value=b.value.slice(0,e)+a+b.value.slice(d);c.dom.querySelector(".mention-user").outerHTML="";b.focus();b.setSelectionRange(e+a.length,e+a.length);b.removeEventListener("keydown",c.handle.keySelect,!1)}),b.addEventListener("keydown",c.handle.keySelect,!1)):g&&(g.outerHTML="",b.removeEventListener("keydown",c.handle.keySelect,!1))}}else g&&(g.outerHTML="",b.removeEventListener("keydown",
-c.handle.keySelect,!1))};f.prototype.getCaretCoord=function(a){var c=a.selectionEnd,b=k.createElement("div"),d=k.createElement("span"),e=getComputedStyle(a);[].forEach.call(e,function(a){b.style[a]=e[a]});b.style.position="absolute";this.dom.appendChild(b);b.textContent=a.value.substr(0,c);d.textContent=a.value.substr(c)||".";b.appendChild(d);a={top:a.offsetTop-a.scrollTop+d.offsetTop+parseFloat(e.lineHeight),left:a.offsetLeft-a.scrollLeft+d.offsetLeft};this.dom.removeChild(b);return a};f.prototype.keySelect=
-function(a){var c=a.currentTarget,b=c.selectionStart,d=c.value.slice(0,b).lastIndexOf("@");c.value.slice(d,b);this.dom.querySelector(".mention-user");var e=this.dom.querySelector(".mention-user-item.active");switch(a.keyCode){case 13:e="@"+e.dataset.username+" ";c.value=c.value.slice(0,d)+e+c.value.slice(b);c.setSelectionRange(d+e.length,d+e.length);this.dom.querySelector(".mention-user").outerHTML="";c.removeEventListener("keydown",this.handle.keySelect,!1);a.preventDefault();break;case 38:e.previousSibling&&
-(e.previousSibling.classList.add("active"),e.classList.remove("active"));a.preventDefault();break;case 40:e.nextSibling&&(e.nextSibling.classList.add("active"),e.classList.remove("active")),a.preventDefault()}};f.prototype.jump=function(a){var c=a.currentTarget.href,b=k.createElement("a");b.href=c;c=b.hash;b=this.dom.querySelector("#idisqus "+c);history.replaceState(void 0,void 0,c);window.scrollBy(0,b.getBoundingClientRect().top);a.preventDefault()};f.prototype.field=function(a){var c=a.currentTarget;
-a=c.closest(".comment-form").querySelector(".comment-form-textarea");var b=a.selectionStart;c=0==b?c.dataset.code+" ":" "+c.dataset.code+" ";a.value=a.value.slice(0,b)+c+a.value.slice(b);a.focus();a.setSelectionRange(b+c.length,b+c.length)};f.prototype.show=function(a){var c=a.currentTarget;a=c.closest(".comment-item");var b=this.dom.querySelector(".comment-item .comment-box:not([data-current-id])");if(b){var d=b.closest(".comment-item").querySelector(".comment-item-cancel");d.outerHTML=d.outerHTML.replace("cancel",
-"reply");b.outerHTML=""}"comment-item-reply"==c.className&&(c.outerHTML=c.outerHTML.replace("reply","cancel"),c=this.box.replace(/emoji-input/g,"emoji-input-"+a.dataset.id).replace(/upload-input/g,"upload-input-"+a.dataset.id),a.querySelector(".comment-item-children").insertAdjacentHTML("beforebegin",c),this.guest.init(),a.querySelector(".comment-form-textarea").addEventListener("blur",this.handle.focus,!1),a.querySelector(".comment-form-textarea").addEventListener("focus",this.handle.focus,!1),a.querySelector(".comment-form-textarea").addEventListener("keyup",
-this.handle.mention,!1),a.querySelector(".comment-form-textarea").addEventListener("input",this.handle.input,!1),a.querySelector(".comment-form-email").addEventListener("blur",this.handle.verify,!1),a.querySelector(".comment-form-submit").addEventListener("click",this.handle.post,!1),a.querySelector(".comment-image-input").addEventListener("change",this.handle.upload,!1),h(a.getElementsByClassName("emojione-item"),"click",this.handle.field),a.querySelector(".comment-form-textarea").focus());h(this.dom.getElementsByClassName("comment-item-reply"),
-"click",this.handle.show);h(this.dom.getElementsByClassName("comment-item-cancel"),"click",this.handle.show)};f.prototype.verify=function(a){var c=this;a=a.currentTarget.closest(".comment-box");var b=a.querySelector(".comment-avatar-image"),d=a.querySelector(".comment-form-email");a.querySelector(".comment-form-alert");/^[A-Z0-9._%+-]+@[A-Z0-9.-]+\.[A-Z]{2,}$/i.test(d.value)&&g(c.opts.api+"/getgravatar.php?email="+d.value,function(a){"false"==a?c.errorTips("\u60a8\u6240\u586b\u5199\u7684\u90ae\u7bb1\u5730\u5740\u6709\u8bef\u3002",
-d):b.src=a},function(){})};f.prototype.upload=function(a){var c=this;a=a.currentTarget;var b=a.closest(".comment-form"),d=b.querySelector(".comment-image-progress"),e=b.querySelector(".comment-image-loaded"),f=b.querySelector(".comment-form-wrapper"),g=b.querySelector(".comment-form-alert");g.innerHTML="";if(0!==a.files.length){var h=a.files[0].size;if(5E6<h)g.innerHTML="\u8bf7\u9009\u62e9 5M \u4ee5\u4e0b\u56fe\u7247\u3002",setTimeout(function(){g.innerHTML=""},3E3);else if(-1==c.stat.imageSize.indexOf(h)){d.style.width=
-"80px";f.classList.add("expanded");var m=new FormData;m.append("file",a.files[0]);var l=a.files[0].name,k,q=new XMLHttpRequest;q.onreadystatechange=function(){if(4==q.readyState&&200==q.status){var a=JSON.parse(q.responseText);if(0==a.code){c.stat.imageSize.push(h);var d=a.response[l].url;a=new Image;a.src=d;a.onload=function(){k.innerHTML='<img class="comment-image-object" src="'+d+'">';k.dataset.imageUrl=d;k.classList.remove("loading");k.addEventListener("click",c.handle.remove,!1)}}else g.innerHTML=
-"\u56fe\u7247\u4e0a\u4f20\u51fa\u9519\u3002",k.innerHTML="",b.getElementsByClassName("comment-image-item").length&&f.classList.remove("expanded"),setTimeout(function(){g.innerHTML=""},3E3)}};q.upload.addEventListener("progress",function(a){e.style.width=Math.ceil(a.loaded/a.total*100)+"%"},!1);q.upload.addEventListener("load",function(a){e.style.width=0;d.style.width=0;a='<li class="comment-image-item loading" data-image-size="'+h+'">\n <svg version="1.1" class="comment-image-object" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" x="0px" y="0px"\n width="24px" height="30px" viewBox="0 0 24 30" style="enable-background: new 0 0 50 50;" xml:space="preserve">\n <rect x="0" y="10" width="4" height="10" fill="rgba(127,145,158,1)" opacity="0.2">\n <animate attributeName="opacity" attributeType="XML" values="0.2; 1; .2" begin="0s" dur="0.6s" repeatCount="indefinite" />\n <animate attributeName="height" attributeType="XML" values="10; 20; 10" begin="0s" dur="0.6s" repeatCount="indefinite" />\n <animate attributeName="y" attributeType="XML" values="10; 5; 10" begin="0s" dur="0.6s" repeatCount="indefinite" />\n </rect>\n <rect x="8" y="10" width="4" height="10" fill="rgba(127,145,158,1)" opacity="0.2">\n <animate attributeName="opacity" attributeType="XML" values="0.2; 1; .2" begin="0.15s" dur="0.6s" repeatCount="indefinite" />\n <animate attributeName="height" attributeType="XML" values="10; 20; 10" begin="0.15s" dur="0.6s" repeatCount="indefinite" />\n <animate attributeName="y" attributeType="XML" values="10; 5; 10" begin="0.15s" dur="0.6s" repeatCount="indefinite" />\n </rect>\n <rect x="16" y="10" width="4" height="10" fill="rgba(127,145,158,1)" opacity="0.2">\n <animate attributeName="opacity" attributeType="XML" values="0.2; 1; .2" begin="0.3s" dur="0.6s" repeatCount="indefinite" />\n <animate attributeName="height" attributeType="XML" values="10; 20; 10" begin="0.3s" dur="0.6s" repeatCount="indefinite" />\n <animate attributeName="y" attributeType="XML" values="10; 5; 10" begin="0.3s" dur="0.6s" repeatCount="indefinite" />\n </rect>\n </svg>\n</li>\n';
-b.querySelector(".comment-image-list").insertAdjacentHTML("beforeend",a);k=b.querySelector('[data-image-size="'+h+'"]')},!1);q.open("POST",c.opts.api+"/upload.php",!0);q.send(m)}else g.innerHTML="\u8bf7\u52ff\u9009\u62e9\u5df2\u5b58\u5728\u7684\u56fe\u7247\u3002",setTimeout(function(){g.innerHTML=""},3E3)}};f.prototype.remove=function(a){var c=this,b=a.currentTarget.closest(".comment-image-item");a=a.currentTarget.closest(".comment-form-wrapper");b.outerHTML="";c.stat.imageSize=[];b=a.getElementsByClassName("comment-image-item");
-[].forEach.call(b,function(a,b){c.stat.imageSize[b]=a.dataset.imageSize});0==c.stat.imageSize.length&&a.classList.remove("expanded");a.querySelector(".comment-image-input").value=""};f.prototype.errorTips=function(a,c){var b=this;"true"==b.guest.logged_in&&b.handle.guestReset();var d=b.dom.querySelector("#idisqus"),e=b.dom.querySelector(".comment-form-error");e&&(e.outerHTML="");d.insertAdjacentHTML("beforeend",'<div class="comment-form-error" style="top:'+c.offsetTop+"px;left:"+c.offsetLeft+'px;">'+
-a+"</div>");setTimeout(function(){var a=b.dom.querySelector(".comment-form-error");a&&(a.outerHTML="")},3E3)};f.prototype.post=function(a){var c=this,b=a.currentTarget.closest(".comment-box[data-current-id]")||a.currentTarget.closest(".comment-item")||a.currentTarget.closest(".comment-box");a=b.querySelector(".comment-form-textarea").value;var d=b.dataset.id?b.dataset.id:"",e=b.getElementsByClassName("comment-image-item"),f=[],g="";[].forEach.call(e,function(a,b){f[b]=a.dataset.imageUrl;g+=" "+a.dataset.imageUrl});
-if(!b.dataset.currentId){e=b.querySelector(".comment-form-name");var h=b.querySelector(".comment-form-email"),k=b.querySelector(".comment-form-url"),l={name:e.value,email:h.value,url:k.value.replace(/\s/g,""),avatar:b.querySelector(".comment-avatar-image").src},p=b.querySelector(".comment-form-alert");if(/^\s*$/i.test(l.name)){c.errorTips("\u540d\u5b57\u4e0d\u80fd\u4e3a\u7a7a\u3002",e);return}if(/^\s*$/i.test(l.email)){c.errorTips("\u90ae\u7bb1\u4e0d\u80fd\u4e3a\u7a7a\u3002",h);return}if(!/^[A-Z0-9._%+-]+@[A-Z0-9.-]+\.[A-Z]{2,}$/i.test(l.email)){c.errorTips("\u8bf7\u6b63\u786e\u586b\u5199\u90ae\u7bb1\u3002",
-h);return}if(!/^([hH][tT]{2}[pP]:\/\/|[hH][tT]{2}[pP][sS]:\/\/)(([A-Za-z0-9-~]+)\.)+([A-Za-z0-9-~\/])+$|^\s*$/i.test(l.url)){c.errorTips("\u8bf7\u6b63\u786e\u586b\u5199\u7f51\u5740\u3002",k);return}c.guest.submit(l);c.stat.message||c.stat.mediaHtml||(c.box=c.dom.querySelector(".comment-box").outerHTML.replace(/<label class="comment-actions-label exit"(.|\n)*<\/label>\n/,"").replace("comment-form-wrapper","comment-form-wrapper editing").replace(/\u52a0\u5165\u8ba8\u8bba\u2026\u2026/,""));if(!c.guest.name&&
-!c.guest.email)return;if(0==f.length&&/^\s*$/i.test(a)){p.innerHTML="\u8bc4\u8bba\u4e0d\u80fd\u4e3a\u7a7a\u6216\u7a7a\u683c\u3002";b.querySelector(".comment-form-textarea").focus();return}var q=a;c.opts.emoji_preview?q=q.replace(/:([-+\w]+):/g,function(a){var b=a.replace(/:/g,"");return c.eac[b]?'<img class="emojione" width="24" height="24" alt="'+b+'" title=":'+b+':" src="'+c.opts.emoji_path+c.eac[b]+'.png">':a}):c.emoji_list.forEach(function(a){q=q.replace(":"+a.code+":",'<img class="emojione" width="24" height="24" src="'+
-c.opts.emoji_path+a.unicode+'.png" />')});e={url:c.guest.url?c.guest.url:"",isMod:!1,username:null,name:c.guest.name,avatar:c.guest.avatar,id:"preview",parent:d,createdAt:(new Date).toJSON(),message:"<p>"+q+"</p>",media:f};c.load(e);c.timeAgo();c.stat.message=a;c.stat.mediaHtml=b.querySelector(".comment-image-list").innerHTML;d?b.querySelector(".comment-item-cancel").click():(b.querySelector(".comment-form-textarea").value="",b.querySelector(".comment-image-list").innerHTML="",b.querySelector(".comment-form-wrapper").classList.remove("expanded",
-"editing"))}if(e=a.match(/@\w+/g))e=e.filter(function(a){return-1<c.stat.users.map(function(a){return a.username}).indexOf(a.slice(1))}),0<e.length&&(e=new RegExp("("+e.join("|")+")","g"),a=a.replace(e,"$1:disqus"));a+=g;b.dataset.currentId?(a={id:b.dataset.currentId,message:a},m(c.opts.api+"/updatecomment.php",a,function(a){a=JSON.parse(a);0===a.code?(c.stat.message=null,c.stat.mediaHtml=null,c.load(a.response)):c.load(c.stat.editing);c.timeAgo();c.stat.editing=!1},function(){c.load(c.stat.editing);
-c.timeAgo();c.stat.editing=!1})):(a={thread:c.stat.thread,parent:d,message:a,name:c.guest.name,email:c.guest.email,url:c.guest.url,link:c.opts.url,title:c.opts.title},m(c.opts.api+"/postcomment.php",a,function(a){a=JSON.parse(a);0===a.code?(c.dom.querySelector('.comment-item[data-id="preview"]').outerHTML="",c.stat.count+=1,c.dom.querySelector("#comment-count").innerHTML=c.stat.count+" \u6761\u8bc4\u8bba",a=a.response,a.isPost=!0,c.load(a),c.timeAgo()):2===a.code&&(p.innerHTML=a.response,c.dom.querySelector('.comment-item[data-id="preview"]').outerHTML=
-"",c.reEdit(b),-1<a.response.indexOf("author")&&c.handle.guestReset())},function(){p.innerHTML="\u63d0\u4ea4\u51fa\u9519\uff0c\u8bf7\u7a0d\u540e\u91cd\u8bd5\u3002";alertClear();c.dom.querySelector('.comment-item[data-id="preview"]').outerHTML="";c.reEdit(b)}))};f.prototype.reEdit=function(a){a.dataset.id?a.querySelector(".comment-item-reply").click():a.querySelector(".comment-form-wrapper").classList.add("editing");this.stat.message&&(a.querySelector(".comment-form-textarea").value=this.stat.message);
-this.stat.mediaHtml&&(a.querySelector(".comment-form-wrapper").classList.add("expanded"),a.querySelector(".comment-image-list").innerHTML=this.stat.mediaHtml,h(a.getElementsByClassName("comment-image-item"),"click",this.handle.remove))};f.prototype.edit=function(a){var c=this,b=c.box.replace("comment-box","comment-box comment-box-"+a.id).replace(/emoji-input/g,"emoji-input-"+a.id).replace(/upload-input/g,"upload-input-"+a.id);c.dom.querySelector('.comment-item[data-id="'+a.id+'"] .comment-item-body').outerHTML=
-b;c.guest.init();b=c.dom.querySelector(".comment-box-"+a.id);b.dataset.currentId=a.id;b.querySelector(".comment-form-textarea").addEventListener("blur",c.handle.focus,!1);b.querySelector(".comment-form-textarea").addEventListener("focus",c.handle.focus,!1);b.querySelector(".comment-form-textarea").addEventListener("input",c.handle.input,!1);b.querySelector(".comment-form-textarea").addEventListener("keyup",c.handle.mention,!1);b.querySelector(".comment-form-email").addEventListener("blur",c.handle.verify,
-!1);b.querySelector(".comment-form-submit").addEventListener("click",c.handle.post,!1);b.querySelector(".comment-image-input").addEventListener("change",c.handle.upload,!1);h(b.getElementsByClassName("emojione-item"),"click",c.handle.field);b.querySelector(".comment-form-textarea").focus();b.querySelector(".comment-actions-form").insertAdjacentHTML("afterbegin",'<a class="comment-form-cancel" href="javascript:;">\u53d6\u6d88</a>');b.querySelector(".comment-form-cancel").addEventListener("click",function(){c.stat.editing=
-!1;c.load(a);c.timeAgo()},!1);c.stat.message&&(b.querySelector(".comment-form-textarea").value=c.stat.message);c.stat.mediaHtml&&(b.querySelector(".comment-form-wrapper").classList.add("expanded"),b.querySelector(".comment-image-list").innerHTML=c.stat.mediaHtml,h(b.getElementsByClassName("comment-image-item"),"click",c.handle.remove))};f.prototype.create=function(){this.opts.auto?(this.dom.querySelector(".loading-container").dataset.tip="\u6b63\u5728\u521b\u5efa Thread\u2026\u2026",this.postThread({url:this.opts.link,
-identifier:this.opts.identifier,title:this.opts.title,slug:this.opts.slug,message:this.opts.desc})):(this.dom.querySelector("#idisqus").classList.remove("loading"),this.dom.querySelector("#idisqus").innerHTML='<div class="comment-header"><span class="comment-header-item">\u521b\u5efa Thread</span></div><div class="comment-thread-form"><p>\u7531\u4e8e Disqus \u6ca1\u6709\u672c\u9875\u9762\u7684\u76f8\u5173 Thread\uff0c\u6545\u9700\u5148\u521b\u5efa Thread</p><div class="comment-form-item"><label class="comment-form-label">url:</label><input class="comment-form-input" id="thread-url" name="url" value="'+
-this.opts.link+'" disabled /></div><div class="comment-form-item"><label class="comment-form-label">identifier:</label><input class="comment-form-input" id="thread-identifier" name="identifier" value="'+this.opts.identifier+'" disabled /></div><div class="comment-form-item"><label class="comment-form-label">title:</label><input class="comment-form-input" id="thread-title" name="title" value="'+this.opts.title+'" disabled /></div><div class="comment-form-item"><label class="comment-form-label">slug:</label><input class="comment-form-input" id="thread-slug" name="slug" value="'+
-this.opts.slug+'" /></div><div class="comment-form-item"><label class="comment-form-label">message:</label><textarea class="comment-form-textarea" id="thread-message" name="message">'+this.opts.desc+'</textarea></div><button id="thread-submit" class="comment-form-submit">\u63d0\u4ea4</button></div>',this.dom.querySelector("#thread-submit").addEventListener("click",this.handle.postThread,!1))};f.prototype.postThread=function(a){a=a.target?{url:this.dom.querySelector("#thread-url").value,identifier:this.dom.querySelector("#thread-identifier").value,
-title:this.dom.querySelector("#thread-title").value,slug:this.dom.querySelector("#thread-slug").value.replace(/[^A-Za-z0-9_-]+/g,""),message:this.dom.querySelector("#thread-message").value}:a;m(this.opts.api+"/createthread.php",a,function(a){a=JSON.parse(a);if(0===a.code)alert("\u521b\u5efa Thread \u6210\u529f\uff0c\u5237\u65b0\u540e\u4fbf\u53ef\u6109\u5feb\u5730\u8bc4\u8bba\u4e86\uff01"),setTimeout(function(){location.reload()},2E3);else{if(2===a.code){if(-1<a.response.indexOf("A thread already exists with link")){alert(a.response.replace("A thread already exists with link,",
-"\u5df2\u5b58\u5728\u6b64\u94fe\u63a5\u7684\u76f8\u5173 Thread\uff0c"));return}if(-1<a.response.indexOf("Invalid URL")){alert("\u53c2\u6570\u9519\u8bef\uff0c\u65e0\u6548\u7684'URL'");return}if(-1<a.response.indexOf("Invalid slug")){alert("\u53c2\u6570\u9519\u8bef\uff0c\u65e0\u6548\u7684'slug'");return}}alert(a.response)}},function(){alert("\u521b\u5efa Thread \u51fa\u9519\uff0c\u8bf7\u7a0d\u540e\u91cd\u8bd5\uff01")})};f.prototype.destroy=function(){this.dom.querySelector(".exit").removeEventListener("click",
-this.handle.guestReset,!1);l(this.dom.getElementsByClassName("comment-form-textarea"),"blur",this.handle.focus);l(this.dom.getElementsByClassName("comment-form-textarea"),"focus",this.handle.focus);l(this.dom.getElementsByClassName("comment-form-textarea"),"keyup",this.handle.mention);l(this.dom.getElementsByClassName("comment-form-email"),"blur",this.handle.verify);l(this.dom.getElementsByClassName("comment-form-submit"),"click",this.handle.post);l(this.dom.getElementsByClassName("comment-image-input"),
-"change",this.handle.upload);l(this.dom.getElementsByClassName("comment-item-reply"),"click",this.handle.show);l(this.dom.getElementsByClassName("comment-loadmore"),"click",this.handle.loadMore);l(this.dom.getElementsByClassName("emojione-item"),"click",this.handle.field);this.dom.innerHTML="";delete this.box;delete this.dom;delete this.emoji_list;delete this.guest;delete this.handle;delete this.opts;delete this.stat};"function"===typeof require&&"object"===typeof module&&module&&"object"===typeof exports&&
-exports?module.exports=f:"function"===typeof define&&define.amd?define(function(){return f}):d.iDisqus=d.iDisqus||f})(window||this);
+!function(e,t){"object"==typeof exports&&"object"==typeof module?module.exports=t():"function"==typeof define&&define.amd?define([],t):"object"==typeof exports?exports.iDisqus=t():e.iDisqus=t()}(window,(function(){return function(e){var t={};function o(a){if(t[a])return t[a].exports;var n=t[a]={i:a,l:!1,exports:{}};return e[a].call(n.exports,n,n.exports,o),n.l=!0,n.exports}return o.m=e,o.c=t,o.d=function(e,t,a){o.o(e,t)||Object.defineProperty(e,t,{enumerable:!0,get:a})},o.r=function(e){"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(e,"__esModule",{value:!0})},o.t=function(e,t){if(1&t&&(e=o(e)),8&t)return e;if(4&t&&"object"==typeof e&&e&&e.__esModule)return e;var a=Object.create(null);if(o.r(a),Object.defineProperty(a,"default",{enumerable:!0,value:e}),2&t&&"string"!=typeof e)for(var n in e)o.d(a,n,function(t){return e[t]}.bind(null,n));return a},o.n=function(e){var t=e&&e.__esModule?function(){return e.default}:function(){return e};return o.d(t,"a",t),t},o.o=function(e,t){return Object.prototype.hasOwnProperty.call(e,t)},o.p="",o(o.s=0)}([function(e,t,o){(function(e){var a;
+/*!
+ *
+ * @author fooleap
+ * @email fooleap@gmail.com
+ * @create 2017-06-17 20:48:25
+ * @update 2021-05-11 11:58:38
+ * @version 0.2.31
+ * Copyright 2017-2021 fooleap
+ * Released under the MIT license
+ */o(2),function(n){"use strict";var i,r=document,s=localStorage,m=r.scripts,c=m[m.length-1].src,l=(c.substring(0,c.lastIndexOf("/")),navigator.userAgent.indexOf("Edge")>-1),d=!!window.ActiveXObject||"ActiveXObject"in window;function u(e,t,o){var a=new XMLHttpRequest;return a.open("GET",encodeURI(e)),a.onreadystatechange=function(){4==a.readyState&&200==a.status&&t(a.responseText)},a.onerror=o,a.withCredentials=!0,a.send(),a}function p(e,t,o,a){var n="string"==typeof t?t:Object.keys(t).filter((function(e){return null!=t[e]})).map((function(e){return encodeURIComponent(e)+"="+encodeURIComponent(t[e])})).join("&"),i=new XMLHttpRequest;return i.open("POST",e),i.onreadystatechange=function(){4==i.readyState&&200==i.status&&o(i.responseText)},i.onerror=a,i.withCredentials=!0,i.setRequestHeader("Content-Type","application/x-www-form-urlencoded"),i.send(n),i}function f(){var e=Number((new Date).getTime().toString().substring(3)),t=Math.abs(e+Math.floor(1e5*Math.random())-48e6+Math.floor(1e6*Math.random())).toString(32);return t+=Math.floor(1e9*Math.random()).toString(32)}"function"!=typeof(i=window.Element.prototype).matches&&(i.matches=i.msMatchesSelector||i.mozMatchesSelector||i.webkitMatchesSelector||function(e){for(var t=(this.document||this.ownerDocument).querySelectorAll(e),o=0;t[o]&&t[o]!==this;)++o;return Boolean(t[o])}),"function"!=typeof i.closest&&(i.closest=function(e){for(var t=this;t&&1===t.nodeType;){if(t.matches(e))return t;t=t.parentNode}return null}),i.on=function(e,t,o){this.addEventListener(e,(function(e){for(var a=e.target;a&&a!=this;a=a.parentNode)if(a.matches(t)){o.call(null,e,a);break}}),!0)};var v=function(){this.dom=arguments[0],this.opts=arguments[1],this.init(),this.autologin()};v.prototype={init:function(){var e=this;e.name=s.getItem("name"),e.email=s.getItem("email"),e.url=s.getItem("url"),e.avatar=s.getItem("avatar"),e.type=s.getItem("type"),e.logged_in=s.getItem("logged_in"),e.unique=s.getItem("disqus_unique"),s.getItem("vote")||s.setItem("vote",JSON.stringify({})),s.getItem("reaction_vote")||s.setItem("reaction_vote",JSON.stringify({})),e.vote=JSON.parse(s.getItem("vote")),e.reactionVote=JSON.parse(s.getItem("reaction_vote"));var t=e.dom.getElementsByClassName("comment-box");if("true"==e.logged_in?[].forEach.call(t,(function(t){"1"==e.type&&t.querySelector(".comment-form-wrapper").classList.add("logged-in"),t.querySelector(".comment-form-name").value=e.name,t.querySelector(".comment-form-email").value=e.email,t.querySelector(".comment-form-url").value=e.url,t.querySelector(".comment-avatar-image").src=e.avatar})):([].forEach.call(t,(function(t){t.querySelector(".comment-form-wrapper").classList.remove("logged-in"),t.querySelector(".comment-form-name").value="",t.querySelector(".comment-form-email").value="",t.querySelector(".comment-form-url").value="",t.querySelector(".comment-avatar-image").src=e.dom.querySelector(".comment-avatar-image").dataset.avatar})),s.setItem("logged_in","false")),"1"==e.type&&"true"==e.logged_in){var o=e.dom.querySelector(".comment-login");o&&(o.innerHTML=e.name+'<label class="comment-logout" title="退出" for="comment-user">退出登录</label>',o.title=e.name,o.classList.add("comment-user"),o.classList.remove("comment-login"),e.dom.querySelector("#comment-user").checked=!1)}else{var a=e.dom.querySelector(".comment-user");a&&(a.innerHTML="登录",a.title="使用 Disqus 帐号授权登录",a.classList.add("comment-login"),a.classList.remove("comment-user"))}},autologin:function(){var e=this;u(e.opts.api+"/user.php",(function(t){var o=JSON.parse(t);if(0==o.code){var a=o.response;e.avatar=a.avatar,e.name=a.name,e.username=a.username,e.url=a.url,e.type=a.type,e.submit()}else"1"==e.type?(s.setItem("logged_in","false"),e.init()):(s.setItem("type","0"),e.unique||s.setItem("disqus_unique",f()),e.init())}),(function(){}))},login:function(){var e,t=this,o=window.open(t.opts.api+"/login.php","Disqus Oauth","width=470,height=508");e=setInterval((function(){o&&o.closed&&(clearInterval(e),t.user.autologin())}),100)},logout:function(){var e=this;p(e.opts.api+"/logout.php",{},(function(t){s.setItem("logged_in","false"),s.removeItem("type"),s.removeItem("email"),s.removeItem("avatar"),s.removeItem("name"),s.removeItem("url"),s.removeItem("disqus_unique"),s.removeItem("vote"),s.removeItem("reaction_vote"),e.user.init()}))},submit:function(){var e=this;s.setItem("email",e.email),s.setItem("type",e.type),s.setItem("name",e.name),s.setItem("url",e.url),s.setItem("avatar",e.avatar),s.setItem("disqus_unique",e.unique),s.setItem("logged_in","true"),this.init()}};var h=function(){var e=this;if(e.opts="object"==typeof arguments[1]?arguments[1]:arguments[0],e.dom=r.getElementById("string"==typeof arguments[0]?arguments[0]:"comment"),e.opts.api="/"==e.opts.api.slice(-1)?e.opts.api.slice(0,-1):e.opts.api,e.opts.site=e.opts.site||location.origin,e.opts.url){var t=e.opts.url.replace(e.opts.site,"");e.opts.url="/"!=t.slice(0,1)?"/"+t:t}else e.opts.url=l||d?encodeURI(location.pathname)+encodeURI(location.search):location.pathname+location.search;e.opts.identifier=e.opts.identifier||e.opts.url,e.opts.link=e.opts.site+e.opts.url,e.opts.title=e.opts.title||r.title,e.opts.slug=e.opts.slug?e.opts.slug.replace(/[^A-Za-z0-9_-]+/g,""):"",e.opts.desc=e.opts.desc||(r.querySelector('[name="description"]')?r.querySelector('[name="description"]').content:""),e.opts.mode=e.opts.mode||1,e.opts.timeout=e.opts.timeout||3e3,e.opts.toggle=e.opts.toggle?r.getElementById(e.opts.toggle):null,e.opts.autoCreate=!!e.opts.autoCreate||!!e.opts.auto,e.opts.relatedType=e.opts.relatedType||"related",e.opts.emojiPath=e.opts.emojiPath||e.opts.emoji_path||"https://github.githubassets.com/images/icons/emoji/unicode/",e.emojiList=e.opts.emojiList||e.opts.emoji_list||[{code:"smile",title:"笑脸",unicode:"1f604"},{code:"mask",title:"生病",unicode:"1f637"},{code:"joy",title:"破涕为笑",unicode:"1f602"},{code:"stuck_out_tongue_closed_eyes",title:"吐舌",unicode:"1f61d"},{code:"flushed",title:"脸红",unicode:"1f633"},{code:"scream",title:"恐惧",unicode:"1f631"},{code:"pensive",title:"失望",unicode:"1f614"},{code:"unamused",title:"无语",unicode:"1f612"},{code:"grin",title:"露齿笑",unicode:"1f601"},{code:"heart_eyes",title:"色",unicode:"1f60d"},{code:"sweat",title:"汗",unicode:"1f613"},{code:"smirk",title:"得意",unicode:"1f60f"},{code:"relieved",title:"满意",unicode:"1f60c"},{code:"rolling_eyes",title:"翻白眼",unicode:"1f644"},{code:"ok_hand",title:"OK",unicode:"1f44c"},{code:"v",title:"胜利",unicode:"270c"}],(e.opts.emoji_preview||e.opts.emojiPreview)&&u(e.opts.api+"/eac.php",(function(t){e.eac=JSON.parse(t)}),(function(){})),e.stat={current:"idisqus",loaded:!1,loading:!1,editing:!1,offsetTop:0,next:null,message:null,mediaHtml:null,forum:{},thread:{},post:{},media:{},root:[],order:"desc",users:[],imageSize:[],disqusLoaded:!1},window.disqus_config=function(){this.page.identifier=e.opts.identifier,this.page.title=e.opts.title,this.page.url=e.opts.link,this.callbacks.onReady.push((function(){e.stat.current="disqus",e.stat.disqusLoaded=!0,e.dom.querySelector("#idisqus").style.display="none",e.dom.querySelector("#disqus_thread").style.display="block",3==e.opts.mode&&e.opts.toggle&&(e.opts.toggle.disabled="",e.opts.toggle.checked=!0,e.opts.toggle.addEventListener("change",e.handle.toggle,!1))})),this.callbacks.onNewComment=[function(t,o){var a={id:t.id};setTimeout((function(){p(e.opts.api+"/sendemail.php",a,(function(e){console.info("邮件发送成功!")}))}),2e3)}]},e.opts.init&&e.init()};h.prototype.timeAgo=function(){var e=this,t={prefix:"",suffix:"前",seconds:"几秒",minute:"1分钟",minutes:"%d分钟",hour:"1小时",hours:"%d小时",day:"1天",days:"%d天",week:"1周",weeks:"%d周",month:"1个月",months:"%d个月",year:"1年",years:"%d年"},o=function(e,o){return t[e]&&t[e].replace(/%d/i,Math.abs(Math.round(o)))},a=function(e){if(e){e=(e=(e=(e=e.replace(/\.\d+/,"")).replace(/-/,"/").replace(/-/,"/")).replace(/T/," ").replace(/Z/," UTC")).replace(/([\+\-]\d\d)\:?(\d\d)/," $1$2"),e=new Date(1e3*e||e);var a=.001*((new Date).getTime()-e)>>0,n=a/60,i=n/60,r=i/24,s=r/30,m=r/365;return t.prefix+(a<45&&o("seconds",a)||a<90&&o("minute",1)||n<45&&o("minutes",n)||n<90&&o("hour",1)||i<24&&o("hours",i)||i<42&&o("day",1)||r<30&&o("days",r)||r<45&&o("month",1)||r<365&&o("months",s)||m<1.5&&o("year",1)||o("years",m))+t.suffix}},n=e.dom.querySelectorAll("time[datetime]");for(var i in n){var r=n[i];"object"==typeof r&&(r.title=new Date(r.getAttribute("datetime")),r.innerHTML=a(r.getAttribute("datetime")))}setTimeout(e.timeAgo.bind(e),6e4)},h.prototype.init=function(){var e=this;if(e.dom){var t="";e.emojiList.forEach((function(o){t+='<li class="emojione-item" title="'+o.title+'" data-code=":'+o.code+':"><img class="emojione-item-image" src="'+e.opts.emojiPath+o.unicode+'.png" /></li>'})),e.dom.innerHTML=`<div class="comment init" id="idisqus">\n <div class="comment-reaction">\n <div class="comment-reaction-header">\n <div class="comment-reaction-prompt"></div>\n <div class="comment-reaction-total"></div>\n </div>\n <div class="comment-reaction-list"></div>\n </div>\n <div class="init-container" data-tips="正在初始化……"><svg class="init-bg" width="72" height="72" viewBox="0 0 720 720" version="1.1" xmlns="http://www.w3.org/2000/svg"><path class="ring" fill="none" stroke="#9d9ea1" d="M 0 -260 A 260 260 0 1 1 -80 -260" transform="translate(400,400)" stroke-width="50" /><polygon transform="translate(305,20)" points="50,0 0,100 18,145 50,82 92,145 100,100" style="fill:#9d9ea1"/></svg></div>\n <div class="comment-header">\n <div class="comment-header-primary">\n <span class="comment-header-item" id="comment-count">评论</span>\n <a class="comment-header-item" id="comment-link" target="_blank">在线讨论</a>\n </div>\n <div class="comment-header-menu">\n <input class="comment-header-checkbox" type="checkbox" id="comment-user">\n <label class="comment-header-item comment-login" title="使用 Disqus 帐号授权登录" for="comment-user">登录</label>\n </div>\n </div>\n <div class="comment-navbar">\n <div class="comment-navbar-item">\n <a class="comment-recommend" href="javascript:;"><svg t="1537508059126" class="icon" style="" viewBox="0 0 1024 1024" version="1.1" xmlns="http://www.w3.org/2000/svg" p-id="3234" xmlns:xlink="http://www.w3.org/1999/xlink" width="24" height="24"><path d="M489.993 887.107 177.906 586.021c-4.002-3.501-114.033-104.031-114.033-224.063 0-146.54 89.526-234.065 239.069-234.065 87.523 0 169.546 69.019 209.058 108.03 39.512-39.011 121.535-108.03 209.059-108.03 149.542 0 239.068 87.525 239.068 234.065 0 120.033-110.031 220.563-114.533 225.065L534.007 887.107c-6 6-14.003 9-22.007 9C503.997 896.107 495.993 893.107 489.993 887.107z" p-id="3235"></path></svg><span class="comment-recommend-text">推荐</span><span class="comment-recommend-count"></span></a>\n </div>\n <div class="comment-navbar-item comment-order">\n <input class="comment-order-radio" id="order-popular" type="radio" name="comment-order" value="popular" />\n <label class="comment-order-label" for="order-popular" title="按评分高低排序">最佳</label>\n <input class="comment-order-radio" id="order-desc" type="radio" name="comment-order" value="desc" />\n <label class="comment-order-label" for="order-desc" title="按从新到旧排序">最新</label>\n <input class="comment-order-radio" id="order-asc" type="radio" name="comment-order" value="asc" />\n <label class="comment-order-label" for="order-asc" title="按从旧到新排序">最早</label>\n </div>\n </div>\n <div class="comment-box">\n <div class="comment-avatar avatar"><img class="comment-avatar-image" src="//a.disquscdn.com/images/noavatar92.png" data-avatar="//a.disquscdn.com/images/noavatar92.png"></div>\n <div class="comment-form">\n <div class="comment-form-wrapper">\n <textarea class="comment-form-textarea" placeholder="加入讨论……"></textarea>\n <div class="comment-form-alert"></div>\n <div class="comment-image">\n <ul class="comment-image-list"></ul>\n <div class="comment-image-progress"><div class="comment-image-loaded"></div></div>\n </div>\n \n <div class="comment-actions">\n \n <div class="comment-actions-group">\n <input id="emoji-input" class="comment-actions-input" type="checkbox">\n <label class="comment-actions-label emojione" for="emoji-input">\n <svg class="icon" fill="#c2c6cc" viewBox="0 0 1024 1024" version="1.1" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" width="200" height="200">\n <g>\n <title>选择表情</title>\n <path d="M512 1024c-282.713043 0-512-229.286957-512-512s229.286957-512 512-512c282.713043 0 512 229.286957 512 512S792.486957 1024 512 1024zM512 44.521739c-258.226087 0-467.478261 209.252174-467.478261 467.478261 0 258.226087 209.252174 467.478261 467.478261 467.478261s467.478261-209.252174 467.478261-467.478261C979.478261 253.773913 768 44.521739 512 44.521739z"></path>\n <path d="M801.391304 554.295652c0 160.278261-129.113043 289.391304-289.391304 289.391304s-289.391304-129.113043-289.391304-289.391304L801.391304 554.295652z"></path>\n <path d="M674.504348 349.495652m-57.878261 0a2.6 2.6 0 1 0 115.756522 0 2.6 2.6 0 1 0-115.756522 0Z"></path>\n <path d="M347.269565 349.495652m-57.878261 0a2.6 2.6 0 1 0 115.756522 0 2.6 2.6 0 1 0-115.756522 0Z"></path>\n </g>\n </svg>\n <ul class="emojione-list">${t}</ul>\n </label>\n <input id="upload-input" class="comment-actions-input comment-image-input" type="file" accept="image/*" name="file">\n <label class="comment-actions-label" for="upload-input">\n <svg class="icon" fill="#c2c6cc" viewBox="0 0 1024 1024" version="1.1" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" width="200" height="200">\n <g>\n <title>上传图片</title>\n <path d="M15.515152 15.515152 15.515152 15.515152 15.515152 15.515152Z"></path>\n <path d="M15.515152 139.636364l0 806.787879 992.969697 0 0-806.787879-992.969697 0zM946.424242 884.363636l-868.848485 0 0-682.666667 868.848485 0 0 682.666667zM698.181818 356.848485c0-51.417212 41.673697-93.090909 93.090909-93.090909s93.090909 41.673697 93.090909 93.090909c0 51.417212-41.673697 93.090909-93.090909 93.090909s-93.090909-41.673697-93.090909-93.090909zM884.363636 822.30303l-744.727273 0 186.181818-496.484848 248.242424 310.30303 124.121212-93.090909z"></path>\n </g>\n </svg>\n </label>\n </div>\n \n <div class="comment-actions-form">\n <button class="comment-form-submit">\n <svg class="icon" viewBox="0 0 1024 1024" version="1.1" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" width="200" height="200">\n <path d="M565.747623 792.837176l260.819261 112.921839 126.910435-845.424882L66.087673 581.973678l232.843092 109.933785 562.612725-511.653099-451.697589 563.616588-5.996574 239.832274L565.747623 792.837176z" fill="#ffffff"></path>\n </svg>\n </button>\n </div>\n </div>\n\n </div>\n <div class="comment-form-user">\n <form class="comment-form-guest"><input class="comment-form-input comment-form-name" type="text" name="name" placeholder="名字(必填)" autocomplete="name" /><input class="comment-form-input comment-form-email" type="email" name="email" placeholder="邮箱(必填)" autocomplete="email" /><input class="comment-form-input comment-form-url" type="url" name="url" placeholder="网址(可选)" autocomplete="url" /></form>\n </div>\n </div>\n </div>\n <ul id="comments" class="comment-list" data-tips="评论加载中……"></ul>\n <a href="javascript:;" class="comment-loadmore hide">加载更多</a>\n <div class="comment-related"></div>\n </div>\n <div class="comment" id="disqus_thread"></div>`,e.user=new v(e.dom,e.opts),e.handle={logout:e.user.logout.bind(e),login:e.user.login.bind(e),loadMore:e.loadMore.bind(e),loadMoreReply:e.loadMoreReply.bind(e),post:e.post.bind(e),threadCreate:e.threadCreate.bind(e),threadVote:e.threadVote.bind(e),reactionVote:e.reactionVote.bind(e),remove:e.remove.bind(e),show:e.show.bind(e),toggle:e.toggle.bind(e),upload:e.upload.bind(e),verify:e.verify.bind(e),jump:e.jump.bind(e),mention:e.mention.bind(e),keySelect:e.keySelect.bind(e),field:e.field.bind(e),focus:e.focus,input:e.input.bind(e),parentShow:e.parentShow.bind(e),selectOrder:e.selectOrder.bind(e)};var o=e.dom.querySelector("#idisqus");switch(o.on("blur",".comment-form-textarea",e.handle.focus),o.on("focus",".comment-form-textarea",e.handle.focus),o.on("input",".comment-form-textarea",e.handle.input),o.on("propertychange",".comment-form-textarea",e.handle.input),o.on("keyup",".comment-form-textarea",e.handle.mention),o.on("keydown",".comment-form-textarea",e.handle.keySelect),o.on("blur",".comment-form-name",e.handle.verify),o.on("blur",".comment-form-email",e.handle.verify),o.on("click",".comment-form-submit",e.handle.post),o.on("click",".comment-login",e.handle.login),o.on("change",".comment-image-input",e.handle.upload),o.on("click",".emojione-item",e.handle.field),o.on("click",".comment-logout",e.handle.logout),o.on("click",".comment-item-reply",e.handle.show),o.on("click",".comment-item-cancel",e.handle.show),o.on("click",".comment-item-avatar",e.handle.jump),o.on("click",".comment-item-pname",e.handle.jump),o.on("mouseover",".comment-item-pname",e.handle.parentShow),o.on("click",".comment-loadmore",e.handle.loadMore),o.on("click",".comment-item-loadmore",e.handle.loadMoreReply),o.on("click","#thread-submit",e.handle.threadCreate),o.on("click",".comment-recommend",e.handle.threadVote),o.on("click",".comment-reaction-btn:not(.selected)",e.handle.reactionVote),o.on("change",".comment-order-radio",e.handle.selectOrder),e.opts.mode){case 1:e.disqus();break;case 2:e.threadInit();break;case 3:e.threadInit(),e.disqus();break;default:e.disqus()}}},h.prototype.toggle=function(){var e=this;"disqus"==e.stat.current?(e.stat.current="idisqus",e.dom.querySelector("#idisqus").style.display="block",e.dom.querySelector("#disqus_thread").style.display="none"):e.disqus()},h.prototype.disqus=function(){var e=this;e.dom.querySelector(".init-container").dataset.tips;if(e.opts.site!=location.origin)return console.log("本地环境不加载 Disqus 评论框!"),void(1==e.opts.mode&&e.threadInit());if(e.stat.disqusLoaded)e.stat.current="disqus",e.dom.querySelector("#idisqus").style.display="none",e.dom.querySelector("#disqus_thread").style.display="block";else{"尝试连接 Disqus……";var t=r.createElement("script");t.src="//"+e.opts.forum+".disqus.com/embed.js",t.dataset.timestamp=Date.now(),t.onload=function(){e.stat.disqusLoaded=!0,"连接成功,加载 Disqus 评论框……"},t.onerror=function(){1==e.opts.mode&&("连接失败,加载简易评论框……",e.threadInit())};var o=new Image;o.onerror=function(){1==e.opts.mode&&("连接超时,加载简易评论框……",e.threadInit())},o.onload=function(){(r.head||r.body).appendChild(t),clearTimeout(a)},o.src="https://disqus.com/favicon.ico?"+Date.now();var a=setTimeout((function(){o.complete&&o.naturalWidth||1==e.opts.mode&&("连接失败,加载简易评论框……",e.threadInit())}),e.opts.timeout)}},h.prototype.addListener=function(e,t,o){var a=this.dom.getElementsByClassName(e);[].forEach.call(a,(function(e){e.addEventListener(t,o,!1)}))},h.prototype.count=function(){var e=r.querySelectorAll("[data-disqus-url]"),t=e.length;if(t>0){for(var o=[],a=0;a<t;a++)o[a]=e[a].dataset.disqusUrl.replace(this.opts.site,"");u(this.opts.api+"/threadsList.php?links="+o.join(","),(function(e){JSON.parse(e).response.forEach((function(e){var t=document.createElement("a");t.href=e.link;var o=t.href.replace(t.origin,""),a=r.querySelector('[data-disqus-url$="'+o+'"]');a&&(a.innerHTML=e.posts,a.dataset.disqusCount=e.posts)}))}),(function(){console.log("获取数据失败!")}))}},h.prototype.postsList=function(e,t){e=e||5;var o=r.getElementById("string"==typeof t?t:"disqusPostsList");o&&u(this.opts.api+"/postsList.php?limit="+e,(function(e){var t=JSON.parse(e).response,a="";t.forEach((function(e){a+=`<li style="list-style-type: none;">${e.name}: ${e.raw_message}</br>评: <a href="${e.thread.link}">${e.thread.title}</a></li>`})),a=`<ul>${a}</ul`,o.innerHTML=a}),(function(){console.log("获取数据失败!")}))},h.prototype.loadRelated=function(){var e=this;0==e.stat.forum.settings.organicDiscoveryEnabled||e.stat.relatedLoaded||u(e.opts.api+"/threadsList.php?type="+e.opts.relatedType.toLowerCase()+"&thread="+e.stat.thread.id,(function(t){var o=JSON.parse(t);if(0==o.code){e.stat.relatedLoaded=!0;var a=o.response,n="";a.forEach((function(e){var t=e.topPost.message.replace(/<[^>]*>/g,"");n+=`<li class="related-item">\n <a class="related-item-link" href="${e.link}" title="${e.title}">\n <div class="related-item-title">${e.title}</div>\n <div class="related-item-desc">${e.posts}条评论<span class="related-item-bullet"> • </span><time class="related-item-time" datetime="${e.createdAt}"></time></div></a>\n <a class="related-item-link" href="${e.link}?#comment-${e.topPost.id}" title="${t}">\n <div class="related-item-post">\n <div class="related-item-avatar"><img src="${e.topPost.avatar}" /></div>\n <div class="related-item-main">\n <div class="related-item-name">${e.topPost.name}</div>\n <div class="related-item-message">${t}</div>\n </div>\n </div></a>\n </li>`})),n=`<div class="comment-related-title">在<span class="comment-related-forumname">${e.stat.forum.name}</span>上还有</div><div class="comment-related-content"><ul class="related-list">${n}</ul></div>`,e.dom.querySelector(".comment-related").innerHTML=n,e.timeAgo()}}),(function(){console.log("获取数据失败!")}))},h.prototype.loadReactions=function(){var e=this;0!=e.stat.forum.settings.threadReactionsEnabled&&u(e.opts.api+"/threadReactionsLoadReations.php?thread="+e.stat.thread.id,(function(t){var o=JSON.parse(t);if(o.response.eligible){e.dom.querySelector(".comment-reaction-prompt").innerHTML=o.response.prompt;var a=o.response.reactions,n=0,i="",r=e.user.reactionVote[e.stat.thread.id];r=r||(o.selected?o.selected.id:0),a.forEach((function(e){n+=e.votes,i+=`<li class="comment-reaction-item"><a class="comment-reaction-btn${r==e.id?" selected":""}" data-id="${e.id}" href="javascript:;"><img class="comment-reaction-image" src="${e.imageUrl}"> ${e.text}</a><div class="comment-reaction-count">${e.votes}</div></li>`})),e.dom.querySelector(".comment-reaction-list").innerHTML=i,e.dom.querySelector(".comment-reaction-total").innerHTML=n+" 人次参与"}}),(function(){}))},h.prototype.reactionVote=function(e,t){var o=this,a=t.closest(".comment-reaction-item").querySelector(".comment-reaction-count"),n=t.dataset.id,i={thread:o.stat.thread.id,unique:o.user.unique,reaction:n};p(o.opts.api+"/threadReactionsVote.php",i,(function(e){o.user.reactionVote[o.stat.thread.id]=n,s.setItem("reaction_vote",JSON.stringify(o.user.reactionVote)),t.classList.add("selected"),a.innerHTML++}))},h.prototype.selectOrder=function(e,t){var o=this,a=t.value;sessionStorage.setItem("order",a),o.stat.order=a,o.dom.querySelector(".comment-list").innerHTML="",o.dom.querySelector(".comment-loadmore").classList.add("hide"),o.stat.next=null,o.getlist()},h.prototype.getlist=function(){var e=this;e.stat.loading=!0,e.dom.querySelector("#idisqus").classList.add("loading"),e.dom.querySelector(".comment-list").dataset.tips="评论加载中……",u(e.opts.api+"/getcomments.php?thread="+e.stat.thread.id+(e.stat.next?"&cursor="+e.stat.next:"")+"&order="+e.stat.order,(function(t){var o=JSON.parse(t);if(0===o.code){e.stat.offsetTop=r.documentElement.scrollTop||r.body.scrollTop,e.dom.querySelector("#idisqus").classList.remove("loading");var a=e.dom.querySelector(".comment-loadmore"),n=o.response?o.response:[];if(e.stat.root=[],n.forEach((function(t){e.load(t),t.parent||e.stat.root.unshift(t.id)})),o.cursor.hasPrev&&e.stat.root.forEach((function(t){e.dom.querySelector(".comment-list").appendChild(e.dom.querySelector("#comment-"+t))})),o.cursor.hasNext?(e.stat.next=o.cursor.next,a.classList.remove("loading"),a.classList.remove("hide")):(e.stat.next=null,a.classList.add("hide")),0==e.stat.thread.posts)return void(e.dom.querySelector(".comment-list").dataset.tips="来做第一个留言的人吧!");if(0==n.length)return;e.timeAgo();var i=e.dom.querySelectorAll(".comment-item-body iframe");if([].forEach.call(i,(function(e){e.style.width=e.clientWidth+"px",e.style.height=9*e.clientWidth/16+"px",setTimeout((function(){e.src=e.src}),1e3)})),e.dom.querySelectorAll(".comment-item-body .twitter-tweet").length>0){var s=document.getElementsByTagName("head")[0],m=document.createElement("script");m.type="text/javascript",m.src="//platform.twitter.com/widgets.js",s.appendChild(m)}if(window.scrollTo(0,e.stat.offsetTop),/^#disqus|^#comment-/.test(location.hash)&&!o.cursor.hasPrev&&!e.stat.disqusLoaded&&!e.stat.loaded){var c=e.dom.querySelector("#idisqus "+location.hash);c&&window.scrollBy(0,c.getBoundingClientRect().top)}e.stat.loading=!1,e.stat.loaded=!0}}),(function(){alert("获取数据失败,请检查服务器设置。")}))},h.prototype.load=function(e){var t=this;t.stat.post[e.id]=e;var o=t.dom.querySelector('.comment-item[data-id="'+e.parent+'"]'),a={username:e.username,name:e.name,avatar:e.avatar};e.username&&-1==t.stat.users.map((function(e){return e.username})).indexOf(e.username)&&t.stat.users.push(a);var n=e.parent?{name:`<a class="comment-item-pname" data-parent="${e.parent}" href="#${o.id}"><svg class="icon" viewBox="0 0 1024 1024" version="1.1" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" width="200" height="200"><path d="M1.664 902.144s97.92-557.888 596.352-557.888V129.728L1024 515.84l-425.984 360.448V628.8c-270.464 0-455.232 23.872-596.352 273.28"></path></svg>${o.dataset.name}</a>`,dom:o.querySelector(".comment-item-children"),insert:"afterbegin"}:{name:"",dom:t.dom.querySelector(".comment-list"),insert:"preview"==e.id||e.isPost?"afterbegin":"beforeend"},i=`<li class="comment-item" data-id="${e.id}" data-name="${e.name}" id="comment-${e.id}">\n <div class="comment-item-body">\n <a class="comment-item-avatar" href="#comment-${e.id}"><img src="${e.avatar}"></a>\n <div class="comment-item-main">\n <div class="comment-item-header"><a class="comment-item-name" title="${e.name}" rel="nofollow" target="_blank" href="${e.url||"javascript:;"}">${e.name}</a>${e.isMod?`<span class="comment-item-badge">${t.opts.badge}</span>`:""}${n.name}<span class="comment-item-bullet"> • </span><time class="comment-item-time" datetime="${e.createdAt}"></time></div>\n <div class="comment-item-content">${e.message}</div>\n <div class="comment-item-footer">${e.isPost?'<span class="comment-item-manage"><a class="comment-item-edit" href="javascript:;">编辑</a><span class="comment-item-bullet"> • </span><a class="comment-item-delete" href="javascript:;">删除</a><span class="comment-item-bullet"> • </span></span>':""}<a class="comment-item-reply" href="javascript:;">回复</a></div>\n </div></div>\n <ul class="comment-item-children">\n ${e.hasMore?'<li><a class="comment-item-loadmore" href="javascript:;">显示更多回复</a></li>':""}\n </ul>\n </li>`;if(e.isDeleted&&(i=`<li class="comment-item" data-id="${e.id}" id="comment-${e.id}" data-name="${e.name}">\n <div class="comment-item-body">\n <a class="comment-item-avatar" href="#comment-${e.id}"><img src="${e.avatar}"></a>\n <div class="comment-item-main" data-message="此评论已被删除。"></div></div>\n <ul class="comment-item-children">\n ${e.hasMore?'<li><a class="comment-item-loadmore" href="javascript:;">显示更多回复</a></li>':""}\n </ul>\n </li>`),t.dom.querySelector('.comment-item[data-id="'+e.id+'"]')?t.dom.querySelector('.comment-item[data-id="'+e.id+'"]').outerHTML=i:n.dom.insertAdjacentHTML(n.insert,i),e.isPost&&!t.stat.editing){var r=t.dom.querySelector('.comment-item[data-id="'+e.id+'"]'),s=setTimeout((function(){r.querySelector(".comment-item-manage")&&(r.querySelector(".comment-item-manage").outerHTML="")}),6e5);r.querySelector(".comment-item-delete").addEventListener("click",(function(o){var a={id:e.id};o.currentTarget.innerHTML="删除中",p(t.opts.api+"/removecomment.php",a,(function(e){var o=JSON.parse(e);0===o.code?1==o.response.isDeleted?(r.outerHTML="",t.stat.thread.posts=parseInt(t.dom.querySelector("#comment-count").innerHTML)-1,t.dom.querySelector("#comment-count").innerHTML=t.stat.thread.posts+" 条评论"):(alert(o.response.message),r.querySelector(".comment-item-manage").outerHTML=""):2===o.code&&(alert(o.response),r.querySelector(".comment-item-manage").outerHTML="")}),(function(){alert("删除出错,请稍后重试")})),clearTimeout(s)}),!1),r.querySelector(".comment-item-edit").addEventListener("click",(function(){t.stat.editing=e,t.edit(e)}),!1)}},h.prototype.loadMore=function(e,t){var o=this;o.stat.offsetTop=r.documentElement.scrollTop||r.body.scrollTop,o.stat.loading||(t.classList.add("loading"),o.getlist())},h.prototype.loadMoreReply=function(e,t){var o=this;t.innerHTML="加载中……";var a=t.closest(".comment-item-children"),n=t.closest(".comment-item");u(o.opts.api+"/descendants.php?post="+n.dataset.id,(function(e){var n=JSON.parse(e);0==n.code?(a.removeChild(t.parentNode),n.response.forEach((function(e){o.load(e)})),o.timeAgo()):t.innerHTML="读取失败"}),(function(){t.innerHTML="读取出错"}))},h.prototype.focus=function(e,t){var o=t.closest(".comment-form-wrapper");o.classList.add("editing"),o.classList.contains("focus")?o.classList.remove("focus"):o.classList.add("focus")},h.prototype.input=function(e,t){var o=this,a=t.closest(".comment-form");a.querySelector(".comment-form-alert").innerHTML="";var n=a.querySelector(".comment-form-wrapper"),i=t.value.replace(/<code>.*?<\/code>/g,"").match(/(^|\s|\r|\n)*(http:\/\/|https:\/\/)(\w|-|\.)*(disqus|sinaimg|giphy|imgur|instagram|twimg|twitter|youtube|youtu\.be)((\w|=|\?|\.|\/|&|\%|-)*)(jpg|png|gif|gallery\/\w+|p\/[a-zA-Z0-9]{11}.*|status\/\d{19}|v=[a-zA-Z0-9]{11}|\/[a-zA-Z0-9]{11})(\s|$|\n)/g);a.querySelector(".comment-image-list").innerHTML="",i?i.forEach((function(e,t){e=e.replace("/\n|\r\n|^s|s$/g","");var i=o.stat.media[e];if(i){var r=`<li class="comment-image-item" data-image-url="${i.thumbnailUrl}"><img class="comment-image-object" src="https:${i.thumbnailUrl}"></li>`;return a.querySelector(".comment-image-list").insertAdjacentHTML("beforeend",r),void n.classList.add("expanded")}p(o.opts.api+"/media.php",{url:e},(function(t){var r=JSON.parse(t);if(0==r.code){var s=`<li class="comment-image-item" data-image-url="${(i=r.response).thumbnailUrl}"><img class="comment-image-object" src="https:${i.thumbnailUrl}"></li>`;a.querySelector(".comment-image-list").insertAdjacentHTML("beforeend",s),o.stat.media[e]=i,n.classList.add("expanded")}}),(function(){}))})):n.classList.remove("expanded")},h.prototype.mention=function(e,t){var o=this,a=t,n=a.selectionStart,i=a.value.slice(0,n).lastIndexOf("@"),r=a.value.slice(i,n),s=o.dom.querySelector(".mention-user"),m=o.stat.users.filter((function(e){var t=new RegExp(r.slice(1),"i");return e.username.search(t)>-1}));if(0==r.search(/^@\w+$|^@$/)&&m.length>0){if(38==e.keyCode||40==e.keyCode)return;var c=o.getCaretCoord(a),l="",d="";m.forEach((function(e,t){l+=`<li class="mention-user-item${0==t?" active":""}" data-username="${e.username}"><img class="mention-user-avatar" src="${e.avatar}"><div class="mention-user-username">${e.username}</div><div class="mention-user-name">${e.name}</div></li>`})),s?(s.innerHTML='<ul class="mention-user-list">'+l+"</ul>",s.style.left=c.left+"px",s.style.top=c.top+"px"):(d=`<div class="mention-user" style="left:${c.left}px;top:${c.top}px"><ul class="mention-user-list">${l}</ul></div>`,o.dom.querySelector("#idisqus").insertAdjacentHTML("beforeend",d)),o.addListener("mention-user-item","mouseover",(function(){o.dom.querySelector(".mention-user-item.active").classList.remove("active"),this.classList.add("active")})),o.addListener("mention-user-item","click",(function(){var e="@"+this.dataset.username+" ";a.value=a.value.slice(0,i)+e+a.value.slice(n),s.outerHTML="",a.focus(),a.setSelectionRange(i+e.length,i+e.length)}))}else s&&(s.outerHTML="")},h.prototype.getCaretCoord=function(e){var t=e.selectionEnd,o=r.createElement("div"),a=r.createElement("span"),n=getComputedStyle(e);[].forEach.call(n,(function(e){o.style[e]=n[e]})),o.style.position="absolute",this.dom.appendChild(o),o.textContent=e.value.substr(0,t),a.textContent=e.value.substr(t)||".",o.appendChild(a);var i={top:e.offsetTop-e.scrollTop+a.offsetTop+parseFloat(n.lineHeight),left:e.offsetLeft-e.scrollLeft+a.offsetLeft};return this.dom.removeChild(o),i},h.prototype.keySelect=function(e,t){var o=this,a=t,n=a.selectionStart,i=a.value.slice(0,n).lastIndexOf("@");a.value.slice(i,n);if(o.dom.querySelector(".mention-user")){var r=o.dom.querySelector(".mention-user-item.active");switch(e.keyCode){case 13:var s="@"+r.dataset.username+" ";a.value=a.value.slice(0,i)+s+a.value.slice(n),a.setSelectionRange(i+s.length,i+s.length),o.dom.querySelector(".mention-user").outerHTML="",e.preventDefault();break;case 38:r.previousSibling&&(r.previousSibling.classList.add("active"),r.classList.remove("active")),e.preventDefault();break;case 40:r.nextSibling&&(r.nextSibling.classList.add("active"),r.classList.remove("active")),e.preventDefault()}}},h.prototype.jump=function(e,t){var o,a,n=(o=t.href,a=r.createElement("a"),a.href=o,a).hash,i=this.dom.querySelector("#idisqus "+n);history.replaceState(void 0,void 0,n),window.scrollBy(0,i.getBoundingClientRect().top),e.preventDefault()},h.prototype.parentShow=function(e,t){if(!t.querySelector(".comment-item-parent")){var o=this.stat.post[t.dataset.parent];if(!o.isDeleted){var a=o.message.replace(/<[^>]*>/g,""),n=`<div class="comment-item-parent"><a class="comment-item-avatar" href="javascript:;"><img src="${o.avatar}"></a><div class="comment-item-pmain"><div class="comment-item-pheader">${o.name}</div><div class="comment-item-pcontent" title="${a}">${a}</div></div></div>`;t.insertAdjacentHTML("beforeend",n)}}},h.prototype.field=function(e,t){var o=t,a=o.closest(".comment-form").querySelector(".comment-form-textarea");this.appendText(a,o.dataset.code)},h.prototype.show=function(e,t){var o=this,a=t,n=a.closest(".comment-item"),i=o.dom.querySelector(".comment-item .comment-box:not([data-current-id])");if(i){var r=i.closest(".comment-item").querySelector(".comment-item-cancel");r.outerHTML=r.outerHTML.replace("cancel","reply"),i.outerHTML=""}if("comment-item-reply"==a.className){a.outerHTML=a.outerHTML.replace("reply","cancel");var s=o.box.replace(/emoji-input/g,"emoji-input-"+n.dataset.id).replace(/upload-input/g,"upload-input-"+n.dataset.id);n.querySelector(".comment-item-children").insertAdjacentHTML("beforebegin",s),o.user.init(),n.querySelector(".comment-form-textarea").focus()}},h.prototype.verify=function(e,t){var o=this,a=t,n=a.closest(".comment-box"),i=n.querySelector(".comment-avatar-image"),r=n.querySelector(".comment-form-name"),s=n.querySelector(".comment-form-email");n.querySelector(".comment-form-alert");""!=s.value&&u(o.opts.api+"/getgravatar.php?email="+s.value+"&name="+r.value,(function(e){var t=JSON.parse(e);t.isEmail||a!=s||o.errorTips("您所填写的邮箱地址有误。",s),""!=r.value&&(i.src=t.gravatar)}),(function(){}))},h.prototype.appendText=function(e,t){var o=e.selectionStart;t=0==o?t+" ":" "+t+" ";e.value=e.value.slice(0,o)+t+e.value.slice(o),e.focus(),e.setSelectionRange(o+t.length,o+t.length)},h.prototype.upload=function(e,t){var o=this,a=t,n=a.closest(".comment-form"),i=n.querySelector(".comment-image-progress"),r=n.querySelector(".comment-image-loaded"),s=n.querySelector(".comment-form-wrapper"),m=n.querySelector(".comment-form-alert");if(m.innerHTML="",0!==a.files.length){var c=a.files[0].size;if(c>5e6)return m.innerHTML="请选择 5M 以下图片。",void setTimeout((function(){m.innerHTML=""}),3e3);if(-1!=o.stat.imageSize.indexOf(c))return m.innerHTML="请勿选择已存在的图片。",void setTimeout((function(){m.innerHTML=""}),3e3);i.style.width="80px",s.classList.add("expanded");var l=new FormData;l.append("file",a.files[0]);a.files[0].name;var d,u=new XMLHttpRequest;u.withCredentials=!0,u.onreadystatechange=function(){if(4==u.readyState&&200==u.status){var e=JSON.parse(u.responseText);if(0==e.code){o.stat.imageSize.push(c);var t=e.response.thumbnailUrl,a=n.querySelector(".comment-form-textarea");o.appendText(a,"https:"+t);var i=new Image;i.src=t,i.onload=function(){d.innerHTML='<img class="comment-image-object" src="https:'+t+'">',d.dataset.imageUrl=t,d.classList.remove("loading")}}else m.innerHTML="图片上传出错。",d.innerHTML="",n.getElementsByClassName("comment-image-item").length&&s.classList.remove("expanded"),setTimeout((function(){m.innerHTML=""}),3e3)}},u.upload.addEventListener("progress",(function(e){r.style.width=Math.ceil(e.loaded/e.total*100)+"%"}),!1),u.upload.addEventListener("load",(function(e){r.style.width=0,i.style.width=0;var t=`<li class="comment-image-item loading" data-image-size="${c}">\n <svg version="1.1" class="comment-image-object" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" x="0px" y="0px" width="24px" height="30px" viewBox="0 0 24 30" style="enable-background: new 0 0 50 50;" xml:space="preserve">\n <rect x="0" y="10" width="4" height="10" fill="rgba(127,145,158,1)" opacity="0.2">\n <animate attributeName="opacity" attributeType="XML" values="0.2; 1; .2" begin="0s" dur="0.6s" repeatCount="indefinite" />\n <animate attributeName="height" attributeType="XML" values="10; 20; 10" begin="0s" dur="0.6s" repeatCount="indefinite" />\n <animate attributeName="y" attributeType="XML" values="10; 5; 10" begin="0s" dur="0.6s" repeatCount="indefinite" />\n </rect>\n <rect x="8" y="10" width="4" height="10" fill="rgba(127,145,158,1)" opacity="0.2">\n <animate attributeName="opacity" attributeType="XML" values="0.2; 1; .2" begin="0.15s" dur="0.6s" repeatCount="indefinite" />\n <animate attributeName="height" attributeType="XML" values="10; 20; 10" begin="0.15s" dur="0.6s" repeatCount="indefinite" />\n <animate attributeName="y" attributeType="XML" values="10; 5; 10" begin="0.15s" dur="0.6s" repeatCount="indefinite" />\n </rect>\n <rect x="16" y="10" width="4" height="10" fill="rgba(127,145,158,1)" opacity="0.2">\n <animate attributeName="opacity" attributeType="XML" values="0.2; 1; .2" begin="0.3s" dur="0.6s" repeatCount="indefinite" />\n <animate attributeName="height" attributeType="XML" values="10; 20; 10" begin="0.3s" dur="0.6s" repeatCount="indefinite" />\n <animate attributeName="y" attributeType="XML" values="10; 5; 10" begin="0.3s" dur="0.6s" repeatCount="indefinite" />\n </rect>\n </svg>\n </li>`;n.querySelector(".comment-image-list").insertAdjacentHTML("beforeend",t),d=n.querySelector('[data-image-size="'+c+'"]')}),!1),u.open("POST",o.opts.api+"/media.php",!0),u.send(l)}},h.prototype.remove=function(e){var t=this,o=e.currentTarget.closest(".comment-image-item"),a=e.currentTarget.closest(".comment-form-wrapper");o.outerHTML="",t.stat.imageSize=[];var n=a.getElementsByClassName("comment-image-item");[].forEach.call(n,(function(e,o){t.stat.imageSize[o]=e.dataset.imageSize})),0==t.stat.imageSize.length&&a.classList.remove("expanded"),a.querySelector(".comment-image-input").value=""},h.prototype.errorTips=function(e,t){var o=this;"true"==o.user.logged_in&&o.handle.logout();var a=o.dom.querySelector("#idisqus"),n=o.dom.querySelector(".comment-form-error");n&&(n.outerHTML="");var i='<div class="comment-form-error" style="top:'+t.offsetTop+"px;left:"+t.offsetLeft+'px;">'+e+"</div>";a.insertAdjacentHTML("beforeend",i),setTimeout((function(){var e=o.dom.querySelector(".comment-form-error");e&&(e.outerHTML="")}),3e3)},h.prototype.post=function(e,t){var o=this,a=t.closest(".comment-box[data-current-id]")||t.closest(".comment-item")||t.closest(".comment-box"),n=a.querySelector(".comment-form-textarea").value,i=a.dataset.id?a.dataset.id:"";a.getElementsByClassName("comment-image-item");if(!a.dataset.currentId){var r=a.querySelector(".comment-form-name"),s=a.querySelector(".comment-form-email"),m=a.querySelector(".comment-form-url"),c=a.querySelector(".comment-form-alert"),l=function(){setTimeout((function(){c.innerHTML=""}),3e3)};if("1"!=o.user.type){var d=r.value,u=s.value,v=m.value.replace(/\s/g,"");if(/^\s*$/i.test(d))return void o.errorTips("名字不能为空或空格。",r);if(/^\s*$/i.test(u))return void o.errorTips("邮箱不能为空或空格。",s);if(!/^[A-Z0-9._%+-]+@[A-Z0-9.-]+\.[A-Z]{2,}$/i.test(u))return void o.errorTips("请正确填写邮箱。",s);if(!/^([hH][tT]{2}[pP]:\/\/|[hH][tT]{2}[pP][sS]:\/\/)(([A-Za-z0-9-~]+)\.)+([A-Za-z0-9-~\/])+$|^\s*$/i.test(v))return void o.errorTips("请正确填写网址。",m);if(o.user.unique=o.user.email==u?o.user.unique:f(),o.user.name=d,o.user.email=u,o.user.url=v,o.user.avatar=a.querySelector(".comment-avatar-image").src,o.user.submit(),!o.user.name&&!o.user.email)return}if(o.stat.message||o.stat.mediaHtml||(o.box=o.dom.querySelector(".comment-box").outerHTML.replace("comment-form-wrapper","comment-form-wrapper editing").replace(/加入讨论……/,"")),/^\s*$/i.test(n))return c.innerHTML="评论不能为空或空格。",void a.querySelector(".comment-form-textarea").focus();var h=n;o.opts.emoji_preview?h=h.replace(/:([-+\w]+):/g,(function(e){var t=e.replace(/:/g,"");return o.eac[t]?`<img class="emojione" width="24" height="24" alt="'+emojiShort+'" title=":${t}:" src="${o.opts.emojiPath+o.eac[t]}.png">`:e})):o.emojiList.forEach((function(e){h=h.replace(`:${e.code}:`,`<img class="emojione" width="24" height="24" src="${o.opts.emojiPath+e.unicode}.png" />`)}));var g={url:o.user.url?o.user.url:"",isMod:!1,username:null,name:o.user.name,avatar:o.user.avatar,id:"preview",parent:i,createdAt:(new Date).toJSON(),message:"<p>"+h+"</p>"};o.load(g),o.timeAgo(),o.stat.message=n,o.stat.mediaHtml=a.querySelector(".comment-image-list").innerHTML,i?a.querySelector(".comment-item-cancel").click():(a.querySelector(".comment-form-textarea").value="",a.querySelector(".comment-image-list").innerHTML="",a.querySelector(".comment-form-wrapper").classList.remove("expanded","editing"))}var y=n.match(/@\w+/g);if(y&&(y=y.filter((function(e){return o.stat.users.map((function(e){return e.username})).indexOf(e.slice(1))>-1}))).length>0){var b=new RegExp("("+y.join("|")+")","g");n=n.replace(b,"$1:disqus")}if(a.dataset.currentId){var q={id:a.dataset.currentId,message:n,unique:o.user.unique};p(o.opts.api+"/updatecomment.php",q,(function(e){var t=JSON.parse(e);if(0===t.code){o.stat.message=null,o.stat.mediaHtml=null;var a=t.response;o.load(a),o.timeAgo(),o.stat.editing=!1}else o.load(o.stat.editing),o.timeAgo(),o.stat.editing=!1}),(function(){o.load(o.stat.editing),o.timeAgo(),o.stat.editing=!1}))}else{q={thread:o.stat.thread.id,parent:i,message:n,name:o.user.name,email:o.user.email,url:o.user.url,unique:o.user.unique};p(o.opts.api+"/postcomment.php",q,(function(e){var t=JSON.parse(e);if(0===t.code){o.dom.querySelector('.comment-item[data-id="preview"]').outerHTML="",o.stat.thread=t.thread,o.stat.thread.posts=parseInt(o.dom.querySelector("#comment-count").innerHTML)+1,o.dom.querySelector("#comment-count").innerHTML=o.stat.thread.posts+" 条评论";var n=t.response;n.isPost=!0,o.load(n),o.timeAgo();var r={post:JSON.stringify(n),thread:JSON.stringify(o.stat.thread),parent:JSON.stringify(o.stat.post[i]),code:t.verifyCode};t.verifyCode&&p(o.opts.api+"/sendemail.php",r,(function(e){console.info("邮件发送成功!")}))}else 2===t.code?(c.innerHTML=t.response,o.dom.querySelector('.comment-item[data-id="preview"]').outerHTML="",o.reEdit(a),t.response.indexOf("author")>-1&&o.handle.logout()):(c.innerHTML="提交失败,请稍后重试,错误代码:"+t.code,l(),o.dom.querySelector('.comment-item[data-id="preview"]').outerHTML="",o.reEdit(a))}),(function(){c.innerHTML="提交出错,请稍后重试。",l(),o.dom.querySelector('.comment-item[data-id="preview"]').outerHTML="",o.reEdit(a)}))}},h.prototype.reEdit=function(e){var t=this;e.dataset.id?e.querySelector(".comment-item-reply").click():e.querySelector(".comment-form-wrapper").classList.add("editing"),t.stat.message&&(e.querySelector(".comment-form-textarea").value=t.stat.message),t.stat.mediaHtml&&(e.querySelector(".comment-form-wrapper").classList.add("expanded"),e.querySelector(".comment-image-list").innerHTML=t.stat.mediaHtml)},h.prototype.edit=function(e){var t=this,o=t.box.replace("comment-box","comment-box comment-box-"+e.id).replace(/emoji-input/g,"emoji-input-"+e.id).replace(/upload-input/g,"upload-input-"+e.id);t.dom.querySelector('.comment-item[data-id="'+e.id+'"] .comment-item-body').outerHTML=o,t.user.init();var a=t.dom.querySelector(".comment-box-"+e.id);a.dataset.currentId=e.id,a.querySelector(".comment-form-textarea").focus(),a.querySelector(".comment-actions-form").insertAdjacentHTML("afterbegin",'<a class="comment-form-cancel" href="javascript:;">取消</a>'),a.querySelector(".comment-form-cancel").addEventListener("click",(function(){t.stat.editing=!1,t.load(e),t.timeAgo()}),!1),t.stat.message&&(a.querySelector(".comment-form-textarea").value=t.stat.message),t.stat.mediaHtml&&(a.querySelector(".comment-form-wrapper").classList.add("expanded"),a.querySelector(".comment-image-list").innerHTML=t.stat.mediaHtml)},h.prototype.threadInit=function(e,t){var o=this;o.dom.querySelector("#idisqus").style.display="block",o.dom.querySelector("#disqus_thread").style.display="none",u(o.opts.api+"/threadsDetails.php?ident="+o.opts.identifier+"&link="+o.opts.url,(function(e){var t=JSON.parse(e);if(0==t.code){if(o.stat.thread=t.response,o.stat.forum=t.forum,o.dom.querySelector("#comment-link").href=`https://disqus.com/home/discussion/${o.stat.forum.id}/${o.stat.thread.slug}/?l=zh`,o.dom.querySelector(".comment-avatar-image").dataset.avatar=o.stat.forum.avatar,o.dom.querySelector(".comment-recommend-count").innerHTML=o.stat.thread.likes||"",0==o.stat.forum.settings.mediaembedEnabled&&(o.dom.querySelector(".comment-image-input").outerHTML="",o.dom.querySelector('[for="upload-input"]').outerHTML=""),"false"==o.user.logged_in&&(o.dom.querySelector(".comment-avatar-image").src=o.stat.forum.avatar),o.box=o.dom.querySelector(".comment-box").outerHTML.replace(/<label class="comment-actions-label exit"(.|\n)*<\/label>\n/,"").replace("comment-form-wrapper","comment-form-wrapper editing").replace(/加入讨论……/,""),o.opts.badge=o.stat.forum.moderatorBadgeText,!o.stat.order)switch(o.stat.forum.order){case 1:o.stat.order="asc";break;case 2:o.stat.order="desc";break;case 4:o.stat.order="popular"}o.dom.querySelector('.comment-order-radio[value="'+o.stat.order+'"]').checked=!0;var a=t.votedusers,n=0;n=1==o.user.type?a.filter((function(e){return e.username==o.user.username})).length>0?1:0:o.user.vote[o.stat.thread.id]?1:0,o.user.vote[o.stat.thread.id]=n,s.setItem("vote",JSON.stringify(o.user.vote)),n&&(o.dom.querySelector(".comment-recommend").classList.add("voted"),o.dom.querySelector(".comment-recommend-text").innerHTML="已推荐"),o.dom.querySelector("#idisqus").classList.remove("init"),o.loadRelated(),o.loadReactions(),o.dom.querySelector("#comment-count").innerHTML=o.stat.thread.posts+" 条评论",o.getlist()}else if(2===t.code){if(o.opts.autoCreate){o.dom.querySelector(".init-container").dataset.tips="正在创建 Thread……";var i={url:o.opts.link,identifier:o.opts.identifier,title:o.opts.title,slug:o.opts.slug,message:o.opts.desc};return void o.threadCreate(i)}o.dom.querySelector("#idisqus").classList.remove("init");var r=`<div class="comment-header"><span class="comment-header-item">创建 Thread</span></div>\n <div class="comment-thread-form">\n <p>由于 Disqus 没有本页面的相关 Thread,故需先创建 Thread</p>\n <div class="comment-form-item"><label class="comment-form-label">url:</label><input class="comment-form-input" id="thread-url" name="url" value="${o.opts.link}" disabled /></div>\n <div class="comment-form-item"><label class="comment-form-label">identifier:</label><input class="comment-form-input" id="thread-identifier" name="identifier" value="${o.opts.identifier}" disabled /></div>\n <div class="comment-form-item"><label class="comment-form-label">title:</label><input class="comment-form-input" id="thread-title" name="title" value="${o.opts.title}" disabled /></div>\n <div class="comment-form-item"><label class="comment-form-label">slug:</label><input class="comment-form-input" id="thread-slug" name="slug" value="${o.opts.slug}" /></div>\n <div class="comment-form-item"><label class="comment-form-label">message:</label><textarea class="comment-form-textarea" id="thread-message" name="message">${o.opts.desc}</textarea></div>\n <button id="thread-submit" class="comment-form-submit">提交</button></div>`;o.dom.querySelector("#idisqus").innerHTML=r}}),(function(){}))},h.prototype.threadVote=function(e,t){var o=this,a=o.user.vote[o.stat.thread.id]?0:1,n={thread:o.stat.thread.id,unique:o.user.unique,vote:a};p(o.opts.api+"/threadsVote.php",n,(function(e){o.user.vote[o.stat.thread.id]=a,s.setItem("vote",JSON.stringify(o.user.vote)),a?(o.dom.querySelector(".comment-recommend").classList.add("voted"),o.stat.thread.likes++):(o.dom.querySelector(".comment-recommend").classList.remove("voted"),o.stat.thread.likes=0==o.stat.thread.likes?0:o.stat.thread.likes-1),o.dom.querySelector(".comment-recommend-count").innerHTML=o.stat.thread.likes||""}))},h.prototype.threadCreate=function(e,t){var o=this;if(t)var a={url:o.dom.querySelector("#thread-url").value,identifier:o.dom.querySelector("#thread-identifier").value,title:o.dom.querySelector("#thread-title").value,slug:o.dom.querySelector("#thread-slug").value.replace(/[^A-Za-z0-9_-]+/g,""),message:o.dom.querySelector("#thread-message").value};else a=arguments[0];p(o.opts.api+"/createthread.php",a,(function(e){var t=JSON.parse(e);if(0!==t.code)return 2===t.code?t.response.indexOf("A thread already exists with link")>-1?void alert(t.response.replace("A thread already exists with link,","已存在此链接的相关 Thread,")):t.response.indexOf("Invalid URL")>-1?void alert("参数错误,无效的'URL'"):t.response.indexOf("Invalid slug")>-1?void alert("参数错误,无效的'slug'"):void alert(t.response):void alert(t.response);alert("创建 Thread 成功,刷新后便可愉快地评论了!"),setTimeout((function(){location.reload()}),2e3)}),(function(){alert("创建 Thread 出错,请稍后重试!")}))},h.prototype.destroy=function(){var e=this;e.dom.innerHTML="",delete e.dom,delete e.box,delete e.emojiList,delete e.user,delete e.handle,delete e.stat,delete e.opts},e&&"object"==typeof t&&t?e.exports=h:void 0===(a=function(){return h}.call(t,o,t,e))||(e.exports=a)}(window)}).call(this,o(1)(e))},function(e,t){e.exports=function(e){return e.webpackPolyfill||(e.deprecate=function(){},e.paths=[],e.children||(e.children=[]),Object.defineProperty(e,"loaded",{enumerable:!0,get:function(){return e.l}}),Object.defineProperty(e,"id",{enumerable:!0,get:function(){return e.i}}),e.webpackPolyfill=1),e}},function(e,t,o){}])}));
+//# sourceMappingURL=iDisqus.min.js.map \ No newline at end of file
diff --git a/static/js/iDisqus.min.js.map b/static/js/iDisqus.min.js.map
new file mode 100644
index 0000000..261c038
--- /dev/null
+++ b/static/js/iDisqus.min.js.map
@@ -0,0 +1 @@
+{"version":3,"sources":["webpack://[name]/webpack/universalModuleDefinition","webpack://[name]/webpack/bootstrap","webpack://[name]/./src/iDisqus.js","webpack://[name]/(webpack)/buildin/module.js"],"names":["root","factory","exports","module","define","amd","window","installedModules","__webpack_require__","moduleId","i","l","modules","call","m","c","d","name","getter","o","Object","defineProperty","enumerable","get","r","Symbol","toStringTag","value","t","mode","__esModule","ns","create","key","bind","n","object","property","prototype","hasOwnProperty","p","s","global","ElementProto","document","localStorage","scripts","lasturl","length","src","isEdge","substring","lastIndexOf","navigator","userAgent","indexOf","isIE","ActiveXObject","getAjax","url","success","error","xhr","XMLHttpRequest","open","encodeURI","onreadystatechange","readyState","status","responseText","onerror","withCredentials","send","postAjax","data","params","keys","filter","k","map","encodeURIComponent","join","setRequestHeader","generateGUID","time","Number","Date","getTime","toString","guid","Math","abs","floor","random","Element","matches","msMatchesSelector","mozMatchesSelector","webkitMatchesSelector","selector","elements","this","ownerDocument","querySelectorAll","index","Boolean","closest","element","nodeType","parentNode","on","eventName","handler","addEventListener","e","target","User","dom","arguments","opts","init","autologin","_","getItem","email","avatar","type","logged_in","unique","setItem","JSON","stringify","vote","parse","reactionVote","boxarr","getElementsByClassName","forEach","item","querySelector","classList","add","remove","dataset","$login","innerHTML","title","checked","$user","api","resp","code","user","response","username","submit","login","timer","popup","setInterval","closed","clearInterval","logout","removeItem","iDisqus","getElementById","slice","site","location","origin","optsUrl","replace","pathname","search","identifier","link","slug","desc","content","timeout","toggle","autoCreate","auto","relatedType","emojiPath","emoji_path","emojiList","emoji_list","unicode","emoji_preview","emojiPreview","eac","stat","current","loaded","loading","editing","offsetTop","next","message","mediaHtml","forum","thread","post","media","order","users","imageSize","disqusLoaded","disqus_config","page","callbacks","onReady","push","style","display","disabled","handle","onNewComment","comment","a","postData","id","setTimeout","console","info","timeAgo","templates","prefix","suffix","seconds","minute","minutes","hour","hours","day","days","week","weeks","month","months","year","years","template","round","$this","getAttribute","loadMore","loadMoreReply","threadCreate","threadVote","show","upload","verify","jump","mention","keySelect","field","focus","input","parentShow","selectOrder","$iDisqus","disqus","threadInit","tips","log","createElement","timestamp","now","onload","img","Image","head","body","appendChild","clearTimeout","complete","naturalWidth","addListener","els","evt","func","el","count","counts","qty","commentArr","disqusUrl","href","itemLink","posts","disqusCount","postsList","listLimit","containerId","listContainer","popHtml","raw_message","loadRelated","settings","organicDiscoveryEnabled","relatedLoaded","toLowerCase","threads","topPost","createdAt","loadReactions","threadReactionsEnabled","eligible","prompt","reactions","total","reaListHtml","selectedId","selected","votes","imageUrl","text","$count","reactionId","reaction","sessionStorage","getlist","documentElement","scrollTop","loadmore","load","parent","unshift","cursor","hasPrev","hasNext","iframe","width","clientWidth","height","getElementsByTagName","script","scrollTo","test","hash","scrollBy","getBoundingClientRect","top","alert","parentPostDom","parentPost","insert","isPost","html","isMod","badge","hasMore","isDeleted","outerHTML","insertAdjacentHTML","postEdit","currentTarget","parseInt","edit","$children","$post","removeChild","wrapper","contains","form","urls","match","image","imageHtml","thumbnailUrl","textarea","selStart","selectionStart","mentionIndex","mentionText","mentionDom","showUsers","re","RegExp","keyCode","coord","getCaretCoord","list","left","setSelectionRange","carPos","selectionEnd","div","span","copyStyle","getComputedStyle","prop","position","textContent","substr","coords","parseFloat","lineHeight","offsetLeft","scrollLeft","preventDefault","previousSibling","nextSibling","history","replaceState","undefined","parentHtml","appendText","box","cancel","className","commentBox","$avatar","$name","$email","isEmail","errorTips","gravatar","file","progress","alertmsg","files","size","FormData","append","$item","xhrUpload","ceil","imageItem","imageArr","Text","Dom","idisqus","errorDom","errorHtml","parentId","currentId","elName","elEmail","elUrl","alertClear","anonName","anonEmail","anonUrl","preMessage","emojiShort","toJSON","click","mentions","verifyCode","reEdit","likes","mediaembedEnabled","moderatorBadgeText","votedusers","threadForm","reload","destroy","webpackPolyfill","deprecate","paths","children"],"mappings":"CAAA,SAA2CA,EAAMC,GAC1B,iBAAZC,SAA0C,iBAAXC,OACxCA,OAAOD,QAAUD,IACQ,mBAAXG,QAAyBA,OAAOC,IAC9CD,OAAO,GAAIH,GACe,iBAAZC,QACdA,QAAiB,QAAID,IAErBD,EAAc,QAAIC,IARpB,CASGK,QAAQ,WACX,O,YCTE,IAAIC,EAAmB,GAGvB,SAASC,EAAoBC,GAG5B,GAAGF,EAAiBE,GACnB,OAAOF,EAAiBE,GAAUP,QAGnC,IAAIC,EAASI,EAAiBE,GAAY,CACzCC,EAAGD,EACHE,GAAG,EACHT,QAAS,IAUV,OANAU,EAAQH,GAAUI,KAAKV,EAAOD,QAASC,EAAQA,EAAOD,QAASM,GAG/DL,EAAOQ,GAAI,EAGJR,EAAOD,QA0Df,OArDAM,EAAoBM,EAAIF,EAGxBJ,EAAoBO,EAAIR,EAGxBC,EAAoBQ,EAAI,SAASd,EAASe,EAAMC,GAC3CV,EAAoBW,EAAEjB,EAASe,IAClCG,OAAOC,eAAenB,EAASe,EAAM,CAAEK,YAAY,EAAMC,IAAKL,KAKhEV,EAAoBgB,EAAI,SAAStB,GACX,oBAAXuB,QAA0BA,OAAOC,aAC1CN,OAAOC,eAAenB,EAASuB,OAAOC,YAAa,CAAEC,MAAO,WAE7DP,OAAOC,eAAenB,EAAS,aAAc,CAAEyB,OAAO,KAQvDnB,EAAoBoB,EAAI,SAASD,EAAOE,GAEvC,GADU,EAAPA,IAAUF,EAAQnB,EAAoBmB,IAC/B,EAAPE,EAAU,OAAOF,EACpB,GAAW,EAAPE,GAA8B,iBAAVF,GAAsBA,GAASA,EAAMG,WAAY,OAAOH,EAChF,IAAII,EAAKX,OAAOY,OAAO,MAGvB,GAFAxB,EAAoBgB,EAAEO,GACtBX,OAAOC,eAAeU,EAAI,UAAW,CAAET,YAAY,EAAMK,MAAOA,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K8B,IAAM,oBAAqBwE,GAAU,SAAUvE,GAC3D,IAAI5E,EAAOwD,KAAKG,MAAMiB,GACtB,GAAkB,IAAd5E,EAAK6E,KAGF,OAAkB,IAAd7E,EAAK6E,KACR7E,EAAK+E,SAASlG,QAAQ,sCAAwC,OAC9DkS,MAAM/Q,EAAK+E,SAASkB,QAAQ,qCAAsC,sBAGlEjG,EAAK+E,SAASlG,QAAQ,gBAAkB,OACxCkS,MAAM,iBAGN/Q,EAAK+E,SAASlG,QAAQ,iBAAmB,OACzCkS,MAAM,uBAGVA,MAAM/Q,EAAK+E,eAGXgM,MAAM/Q,EAAK+E,UAlBXgM,MAAM,6BACN1H,YAAW,WAAcvD,SAASkS,WAAa,QAoBpD,WACCjH,MAAM,2BAKdrL,EAAQ9H,UAAUqa,QAAU,WACxB,IAAIjV,EAAIrB,KACRqB,EAAEL,IAAI4B,UAAY,UACXvB,EAAEL,WACFK,EAAEgS,WACFhS,EAAEgE,iBACFhE,EAAE8B,YACF9B,EAAE+F,cACF/F,EAAEsE,YACFtE,EAAEH,MAIsDpH,GAA6B,iBAAZD,GAAwBA,EACxGC,EAAOD,QAAUkK,OAKhB,KAFD,aACI,OAAOA,GACV,8BAn5DT,CAw5DG9J,U,kCCn6DHH,EAAOD,QAAU,SAASC,GAoBzB,OAnBKA,EAAOyc,kBACXzc,EAAO0c,UAAY,aACnB1c,EAAO2c,MAAQ,GAEV3c,EAAO4c,WAAU5c,EAAO4c,SAAW,IACxC3b,OAAOC,eAAelB,EAAQ,SAAU,CACvCmB,YAAY,EACZC,IAAK,WACJ,OAAOpB,EAAOQ,KAGhBS,OAAOC,eAAelB,EAAQ,KAAM,CACnCmB,YAAY,EACZC,IAAK,WACJ,OAAOpB,EAAOO,KAGhBP,EAAOyc,gBAAkB,GAEnBzc,I","file":"iDisqus.min.js","sourcesContent":["(function webpackUniversalModuleDefinition(root, factory) {\n\tif(typeof exports === 'object' && typeof module === 'object')\n\t\tmodule.exports = factory();\n\telse if(typeof define === 'function' && define.amd)\n\t\tdefine([], factory);\n\telse if(typeof exports === 'object')\n\t\texports[\"iDisqus\"] = factory();\n\telse\n\t\troot[\"iDisqus\"] = factory();\n})(window, function() {\nreturn "," \t// The module cache\n \tvar installedModules = {};\n\n \t// The require function\n \tfunction __webpack_require__(moduleId) {\n\n \t\t// Check if module is in cache\n \t\tif(installedModules[moduleId]) {\n \t\t\treturn installedModules[moduleId].exports;\n \t\t}\n \t\t// Create a new module (and put it into the cache)\n \t\tvar module = installedModules[moduleId] = {\n \t\t\ti: moduleId,\n \t\t\tl: false,\n \t\t\texports: {}\n \t\t};\n\n \t\t// Execute the module function\n \t\tmodules[moduleId].call(module.exports, module, module.exports, __webpack_require__);\n\n \t\t// Flag the module as loaded\n \t\tmodule.l = true;\n\n \t\t// Return the exports of the module\n \t\treturn module.exports;\n \t}\n\n\n \t// expose the modules object (__webpack_modules__)\n \t__webpack_require__.m = modules;\n\n \t// expose the module cache\n \t__webpack_require__.c = installedModules;\n\n \t// define getter function for harmony exports\n \t__webpack_require__.d = function(exports, name, getter) {\n \t\tif(!__webpack_require__.o(exports, name)) {\n \t\t\tObject.defineProperty(exports, name, { enumerable: true, get: getter });\n \t\t}\n \t};\n\n \t// define __esModule on exports\n \t__webpack_require__.r = function(exports) {\n \t\tif(typeof Symbol !== 'undefined' && Symbol.toStringTag) {\n \t\t\tObject.defineProperty(exports, Symbol.toStringTag, { value: 'Module' });\n \t\t}\n \t\tObject.defineProperty(exports, '__esModule', { value: true });\n \t};\n\n \t// create a fake namespace object\n \t// mode & 1: value is a module id, require it\n \t// mode & 2: merge all properties of value into the ns\n \t// mode & 4: return value when already ns object\n \t// mode & 8|1: behave like require\n \t__webpack_require__.t = function(value, mode) {\n \t\tif(mode & 1) value = __webpack_require__(value);\n \t\tif(mode & 8) return value;\n \t\tif((mode & 4) && typeof value === 'object' && value && value.__esModule) return value;\n \t\tvar ns = Object.create(null);\n \t\t__webpack_require__.r(ns);\n \t\tObject.defineProperty(ns, 'default', { enumerable: true, value: value });\n \t\tif(mode & 2 && typeof value != 'string') for(var key in value) __webpack_require__.d(ns, key, function(key) { return value[key]; }.bind(null, key));\n \t\treturn ns;\n \t};\n\n \t// getDefaultExport function for compatibility with non-harmony modules\n \t__webpack_require__.n = function(module) {\n \t\tvar getter = module && module.__esModule ?\n \t\t\tfunction getDefault() { return module['default']; } :\n \t\t\tfunction getModuleExports() { return module; };\n \t\t__webpack_require__.d(getter, 'a', getter);\n \t\treturn getter;\n \t};\n\n \t// Object.prototype.hasOwnProperty.call\n \t__webpack_require__.o = function(object, property) { return Object.prototype.hasOwnProperty.call(object, property); };\n\n \t// __webpack_public_path__\n \t__webpack_require__.p = \"\";\n\n\n \t// Load entry module and return exports\n \treturn __webpack_require__(__webpack_require__.s = 0);\n","/*!\r\n * \r\n * @author fooleap\r\n * @email fooleap@gmail.com\r\n * @create 2017-06-17 20:48:25\r\n * @update 2021-05-11 11:58:38\r\n * @version 0.2.31\r\n * Copyright 2017-2021 fooleap\r\n * Released under the MIT license\r\n */\r\nrequire('./iDisqus.scss');\r\n(function (global) {\r\n 'use strict';\r\n\r\n var d = document,\r\n l = localStorage,\r\n scripts = d.scripts,\r\n lasturl = scripts[scripts.length - 1].src,\r\n filepath = lasturl.substring(0, lasturl.lastIndexOf('/')),\r\n isEdge = navigator.userAgent.indexOf(\"Edge\") > -1,\r\n isIE = !!window.ActiveXObject || \"ActiveXObject\" in window;\r\n\r\n function getLocation(href) {\r\n var link = d.createElement('a');\r\n link.href = href;\r\n return link;\r\n }\r\n\r\n function getAjax(url, success, error) {\r\n var xhr = new XMLHttpRequest();\r\n xhr.open('GET', encodeURI(url));\r\n xhr.onreadystatechange = function () {\r\n if (xhr.readyState == 4 && xhr.status == 200) {\r\n success(xhr.responseText);\r\n }\r\n }\r\n xhr.onerror = error;\r\n xhr.withCredentials = true;\r\n xhr.send();\r\n return xhr;\r\n }\r\n\r\n function postAjax(url, data, success, error) {\r\n var params = typeof data == 'string' ? data : Object.keys(data).filter(function (k) {\r\n return data[k] != null;\r\n }).map(function (k) {\r\n return encodeURIComponent(k) + '=' + encodeURIComponent(data[k])\r\n }).join('&');\r\n\r\n var xhr = new XMLHttpRequest();\r\n xhr.open('POST', url);\r\n xhr.onreadystatechange = function () {\r\n if (xhr.readyState == 4 && xhr.status == 200) {\r\n success(xhr.responseText);\r\n }\r\n };\r\n xhr.onerror = error;\r\n xhr.withCredentials = true;\r\n xhr.setRequestHeader('Content-Type', 'application/x-www-form-urlencoded');\r\n xhr.send(params);\r\n return xhr;\r\n }\r\n\r\n function generateGUID() {\r\n var time = Number(new Date().getTime().toString().substring(3));\r\n var guid = Math.abs(time + Math.floor(Math.random() * 1e5) - 48 * 1e6 + Math.floor(Math.random() * 1e6)).toString(32);\r\n guid += Math.floor(Math.random() * 1e9).toString(32);\r\n return guid;\r\n }\r\n\r\n (function (ElementProto) {\r\n // matches & closest polyfill https://github.com/jonathantneal/closest\r\n if (typeof ElementProto.matches !== 'function') {\r\n ElementProto.matches = ElementProto.msMatchesSelector || ElementProto.mozMatchesSelector || ElementProto.webkitMatchesSelector || function matches(selector) {\r\n var element = this;\r\n var elements = (element.document || element.ownerDocument).querySelectorAll(selector);\r\n var index = 0;\r\n\r\n while (elements[index] && elements[index] !== element) {\r\n ++index;\r\n }\r\n\r\n return Boolean(elements[index]);\r\n };\r\n }\r\n\r\n if (typeof ElementProto.closest !== 'function') {\r\n ElementProto.closest = function closest(selector) {\r\n var element = this;\r\n\r\n while (element && element.nodeType === 1) {\r\n if (element.matches(selector)) {\r\n return element;\r\n }\r\n\r\n element = element.parentNode;\r\n }\r\n\r\n return null;\r\n };\r\n }\r\n\r\n // 事件委托\r\n ElementProto.on = function on(eventName, selector, handler) {\r\n this.addEventListener(eventName, function (e) {\r\n for (var target = e.target; target && target != this; target = target.parentNode) {\r\n if (target.matches(selector)) {\r\n handler.call(null, e, target);\r\n break;\r\n }\r\n }\r\n }, true);\r\n };\r\n\r\n })(window.Element.prototype);\r\n\r\n // 访客信息\r\n var User = function () {\r\n this.dom = arguments[0];\r\n this.opts = arguments[1];\r\n this.init();\r\n this.autologin();\r\n }\r\n\r\n User.prototype = {\r\n // 初始化访客信息\r\n init: function () {\r\n var _ = this;\r\n // 读取访客信息\r\n _.name = l.getItem('name');\r\n _.email = l.getItem('email');\r\n _.url = l.getItem('url');\r\n _.avatar = l.getItem('avatar');\r\n _.type = l.getItem('type');\r\n _.logged_in = l.getItem('logged_in');\r\n _.unique = l.getItem('disqus_unique')\r\n if (!l.getItem('vote')) {\r\n l.setItem('vote', JSON.stringify({}));\r\n }\r\n if (!l.getItem('reaction_vote')) {\r\n l.setItem('reaction_vote', JSON.stringify({}));\r\n }\r\n _.vote = JSON.parse(l.getItem('vote'));\r\n _.reactionVote = JSON.parse(l.getItem('reaction_vote'));\r\n\r\n var boxarr = _.dom.getElementsByClassName('comment-box');\r\n if (_.logged_in == 'true') {\r\n [].forEach.call(boxarr, function (item) {\r\n if (_.type == '1') {\r\n item.querySelector('.comment-form-wrapper').classList.add('logged-in');\r\n }\r\n item.querySelector('.comment-form-name').value = _.name;\r\n item.querySelector('.comment-form-email').value = _.email;\r\n item.querySelector('.comment-form-url').value = _.url;\r\n item.querySelector('.comment-avatar-image').src = _.avatar;\r\n });\r\n } else {\r\n [].forEach.call(boxarr, function (item) {\r\n item.querySelector('.comment-form-wrapper').classList.remove('logged-in');\r\n item.querySelector('.comment-form-name').value = '';\r\n item.querySelector('.comment-form-email').value = '';\r\n item.querySelector('.comment-form-url').value = '';\r\n item.querySelector('.comment-avatar-image').src = _.dom.querySelector('.comment-avatar-image').dataset.avatar;\r\n });\r\n l.setItem('logged_in', 'false');\r\n }\r\n\r\n if (_.type == '1' && _.logged_in == 'true') {\r\n var $login = _.dom.querySelector('.comment-login');\r\n if (!!$login) {\r\n $login.innerHTML = _.name + '<label class=\"comment-logout\" title=\"退出\" for=\"comment-user\">退出登录</label>';\r\n $login.title = _.name;\r\n $login.classList.add('comment-user');\r\n $login.classList.remove('comment-login');\r\n _.dom.querySelector('#comment-user').checked = false;\r\n }\r\n } else {\r\n var $user = _.dom.querySelector('.comment-user');\r\n if (!!$user) {\r\n $user.innerHTML = '登录';\r\n $user.title = '使用 Disqus 帐号授权登录';\r\n $user.classList.add('comment-login');\r\n $user.classList.remove('comment-user');\r\n }\r\n }\r\n\r\n },\r\n\r\n // 自动登录\r\n autologin: function () {\r\n var _ = this;\r\n getAjax(_.opts.api + '/user.php', function (resp) {\r\n var data = JSON.parse(resp);\r\n if (data.code == 0) {\r\n var user = data.response;\r\n _.avatar = user.avatar;\r\n _.name = user.name;\r\n _.username = user.username;\r\n _.url = user.url;\r\n _.type = user.type\r\n _.submit();\r\n } else {\r\n if (_.type == '1') {\r\n l.setItem('logged_in', 'false');\r\n _.init();\r\n } else {\r\n l.setItem('type', '0');\r\n if (!_.unique) {\r\n l.setItem('disqus_unique', generateGUID());\r\n }\r\n _.init();\r\n }\r\n }\r\n }, function () {\r\n })\r\n },\r\n\r\n // 登录\r\n login: function () {\r\n\r\n var _ = this;\r\n var popup = window.open(_.opts.api + '/login.php', 'Disqus Oauth', 'width=470,height=508');\r\n var timer;\r\n function isLogged() {\r\n if (!popup || !popup.closed) return;\r\n clearInterval(timer);\r\n _.user.autologin();\r\n }\r\n timer = setInterval(isLogged, 100);\r\n\r\n },\r\n\r\n // 退出登录\r\n logout: function () {\r\n var _ = this;\r\n postAjax(_.opts.api + '/logout.php', {}, function (resp) {\r\n l.setItem('logged_in', 'false');\r\n l.removeItem('type');\r\n l.removeItem('email');\r\n l.removeItem('avatar');\r\n l.removeItem('name');\r\n l.removeItem('url');\r\n l.removeItem('disqus_unique');\r\n l.removeItem('vote');\r\n l.removeItem('reaction_vote');\r\n _.user.init();\r\n })\r\n },\r\n\r\n // 提交访客信息\r\n submit: function () {\r\n var _ = this;\r\n l.setItem('email', _.email);\r\n l.setItem('type', _.type);\r\n l.setItem('name', _.name);\r\n l.setItem('url', _.url);\r\n l.setItem('avatar', _.avatar);\r\n l.setItem('disqus_unique', _.unique);\r\n l.setItem('logged_in', 'true');\r\n this.init();\r\n }\r\n }\r\n\r\n var iDisqus = function () {\r\n var _ = this;\r\n\r\n // 配置\r\n _.opts = typeof (arguments[1]) == 'object' ? arguments[1] : arguments[0];\r\n _.dom = d.getElementById(typeof (arguments[0]) == 'string' ? arguments[0] : 'comment');\r\n _.opts.api = _.opts.api.slice(-1) == '/' ? _.opts.api.slice(0, -1) : _.opts.api;\r\n _.opts.site = _.opts.site || location.origin;\r\n if (!!_.opts.url) {\r\n var optsUrl = _.opts.url.replace(_.opts.site, '');\r\n _.opts.url = optsUrl.slice(0, 1) != '/' ? '/' + optsUrl : optsUrl;\r\n } else if (isEdge || isIE) {\r\n _.opts.url = encodeURI(location.pathname) + encodeURI(location.search);\r\n } else {\r\n _.opts.url = location.pathname + location.search;\r\n }\r\n _.opts.identifier = _.opts.identifier || _.opts.url;\r\n _.opts.link = _.opts.site + _.opts.url;\r\n _.opts.title = _.opts.title || d.title;\r\n _.opts.slug = !!_.opts.slug ? _.opts.slug.replace(/[^A-Za-z0-9_-]+/g, '') : '';\r\n _.opts.desc = _.opts.desc || (!!d.querySelector('[name=\"description\"]') ? d.querySelector('[name=\"description\"]').content : '');\r\n _.opts.mode = _.opts.mode || 1;\r\n _.opts.timeout = _.opts.timeout || 3000;\r\n _.opts.toggle = !!_.opts.toggle ? d.getElementById(_.opts.toggle) : null;\r\n _.opts.autoCreate = !!_.opts.autoCreate || !!_.opts.auto;\r\n _.opts.relatedType = _.opts.relatedType || 'related'\r\n\r\n // emoji 表情\r\n _.opts.emojiPath = _.opts.emojiPath || _.opts.emoji_path || 'https://github.githubassets.com/images/icons/emoji/unicode/';\r\n _.emojiList = _.opts.emojiList || _.opts.emoji_list || [{\r\n code: 'smile',\r\n title: '笑脸',\r\n unicode: '1f604'\r\n }, {\r\n code: 'mask',\r\n title: '生病',\r\n unicode: '1f637'\r\n }, {\r\n code: 'joy',\r\n title: '破涕为笑',\r\n unicode: '1f602'\r\n }, {\r\n code: 'stuck_out_tongue_closed_eyes',\r\n title: '吐舌',\r\n unicode: '1f61d'\r\n }, {\r\n code: 'flushed',\r\n title: '脸红',\r\n unicode: '1f633'\r\n }, {\r\n code: 'scream',\r\n title: '恐惧',\r\n unicode: '1f631'\r\n }, {\r\n code: 'pensive',\r\n title: '失望',\r\n unicode: '1f614'\r\n }, {\r\n code: 'unamused',\r\n title: '无语',\r\n unicode: '1f612'\r\n }, {\r\n code: 'grin',\r\n title: '露齿笑',\r\n unicode: '1f601'\r\n }, {\r\n code: 'heart_eyes',\r\n title: '色',\r\n unicode: '1f60d'\r\n }, {\r\n code: 'sweat',\r\n title: '汗',\r\n unicode: '1f613'\r\n }, {\r\n code: 'smirk',\r\n title: '得意',\r\n unicode: '1f60f'\r\n }, {\r\n code: 'relieved',\r\n title: '满意',\r\n unicode: '1f60c'\r\n }, {\r\n code: 'rolling_eyes',\r\n title: '翻白眼',\r\n unicode: '1f644'\r\n }, {\r\n code: 'ok_hand',\r\n title: 'OK',\r\n unicode: '1f44c'\r\n }, {\r\n code: 'v',\r\n title: '胜利',\r\n unicode: '270c'\r\n }];\r\n\r\n if (!!_.opts.emoji_preview || !!_.opts.emojiPreview) {\r\n getAjax(_.opts.api + '/eac.php', function (resp) {\r\n _.eac = JSON.parse(resp);\r\n }, function () {\r\n })\r\n }\r\n\r\n // 默认状态\r\n _.stat = {\r\n current: 'idisqus', // 当前显示评论框\r\n loaded: false, // 评论框已加载\r\n loading: false, // 评论加载中\r\n editing: false, // 评论编辑中\r\n offsetTop: 0, // 高度位置\r\n next: null, // 下条评论\r\n message: null, // 新评论\r\n mediaHtml: null, // 新上传图片\r\n forum: {}, // 站点信息\r\n thread: {}, // 文章信息\r\n post: {}, // 评论数据\r\n media: {}, // 媒体信息\r\n root: [], // 根评论\r\n order: 'desc', // 排序\r\n users: [], // Disqus 会员\r\n imageSize: [], // 已上传图片大小\r\n disqusLoaded: false // Disqus 已加载\r\n };\r\n\r\n // Disqus 评论框设置\r\n window.disqus_config = function () {\r\n this.page.identifier = _.opts.identifier;\r\n this.page.title = _.opts.title;\r\n this.page.url = _.opts.link;\r\n this.callbacks.onReady.push(function () {\r\n _.stat.current = 'disqus';\r\n _.stat.disqusLoaded = true;\r\n _.dom.querySelector('#idisqus').style.display = 'none';\r\n _.dom.querySelector('#disqus_thread').style.display = 'block';\r\n if (_.opts.mode == 3 && !!_.opts.toggle) {\r\n _.opts.toggle.disabled = '';\r\n _.opts.toggle.checked = true;\r\n _.opts.toggle.addEventListener('change', _.handle.toggle, false);\r\n }\r\n });\r\n // 原生评论框发邮件\r\n this.callbacks.onNewComment = [function (comment, a) {\r\n var postData = {\r\n id: comment.id\r\n }\r\n // 异步发送邮件\r\n setTimeout(function () {\r\n postAjax(_.opts.api + '/sendemail.php', postData, function (resp) {\r\n console.info('邮件发送成功!');\r\n })\r\n }, 2000);\r\n }];\r\n }\r\n\r\n // 自动初始化\r\n if (!!_.opts.init) {\r\n _.init();\r\n //console.log(_);\r\n }\r\n }\r\n\r\n // TimeAgo https://coderwall.com/p/uub3pw/javascript-timeago-func-e-g-8-hours-ago\r\n iDisqus.prototype.timeAgo = function () {\r\n\r\n var _ = this;\r\n var templates = {\r\n prefix: \"\",\r\n suffix: \"前\",\r\n seconds: \"几秒\",\r\n minute: \"1分钟\",\r\n minutes: \"%d分钟\",\r\n hour: \"1小时\",\r\n hours: \"%d小时\",\r\n day: \"1天\",\r\n days: \"%d天\",\r\n week: \"1周\",\r\n weeks: \"%d周\",\r\n month: \"1个月\",\r\n months: \"%d个月\",\r\n year: \"1年\",\r\n years: \"%d年\"\r\n };\r\n var template = function (t, n) {\r\n return templates[t] && templates[t].replace(/%d/i, Math.abs(Math.round(n)));\r\n };\r\n\r\n var timer = function (time) {\r\n if (!time) return;\r\n time = time.replace(/\\.\\d+/, \"\"); // remove milliseconds\r\n time = time.replace(/-/, \"/\").replace(/-/, \"/\");\r\n time = time.replace(/T/, \" \").replace(/Z/, \" UTC\");\r\n time = time.replace(/([\\+\\-]\\d\\d)\\:?(\\d\\d)/, \" $1$2\"); // -04:00 -> -0400\r\n time = new Date(time * 1000 || time);\r\n\r\n var now = new Date();\r\n var seconds = ((now.getTime() - time) * .001) >> 0;\r\n var minutes = seconds / 60;\r\n var hours = minutes / 60;\r\n var days = hours / 24;\r\n var weeks = days / 7;\r\n var months = days / 30;\r\n var years = days / 365;\r\n\r\n return templates.prefix + (seconds < 45 && template('seconds', seconds) || seconds < 90 && template('minute', 1) || minutes < 45 && template('minutes', minutes) || minutes < 90 && template('hour', 1) || hours < 24 && template('hours', hours) || hours < 42 && template('day', 1) || days < 30 && template('days', days) || days < 45 && template('month', 1) || days < 365 && template('months', months) || years < 1.5 && template('year', 1) || template('years', years)) + templates.suffix;\r\n };\r\n\r\n var elements = _.dom.querySelectorAll('time[datetime]');\r\n for (var i in elements) {\r\n var $this = elements[i];\r\n if (typeof $this === 'object') {\r\n $this.title = new Date($this.getAttribute('datetime'));\r\n $this.innerHTML = timer($this.getAttribute('datetime'));\r\n }\r\n }\r\n\r\n // update time every minute\r\n setTimeout(_.timeAgo.bind(_), 60000);\r\n\r\n }\r\n\r\n // 初始化评论框\r\n iDisqus.prototype.init = function () {\r\n var _ = this;\r\n if (!_.dom) {\r\n //console.log('该页面没有评论框!');\r\n return\r\n }\r\n // 表情\r\n var emojiList = '';\r\n _.emojiList.forEach(function (item) {\r\n emojiList += '<li class=\"emojione-item\" title=\"' + item.title + '\" data-code=\":' + item.code + ':\"><img class=\"emojione-item-image\" src=\"' + _.opts.emojiPath + item.unicode + '.png\" /></li>';\r\n })\r\n _.dom.innerHTML = `<div class=\"comment init\" id=\"idisqus\">\r\n <div class=\"comment-reaction\">\r\n <div class=\"comment-reaction-header\">\r\n <div class=\"comment-reaction-prompt\"></div>\r\n <div class=\"comment-reaction-total\"></div>\r\n </div>\r\n <div class=\"comment-reaction-list\"></div>\r\n </div>\r\n <div class=\"init-container\" data-tips=\"正在初始化……\"><svg class=\"init-bg\" width=\"72\" height=\"72\" viewBox=\"0 0 720 720\" version=\"1.1\" xmlns=\"http://www.w3.org/2000/svg\"><path class=\"ring\" fill=\"none\" stroke=\"#9d9ea1\" d=\"M 0 -260 A 260 260 0 1 1 -80 -260\" transform=\"translate(400,400)\" stroke-width=\"50\" /><polygon transform=\"translate(305,20)\" points=\"50,0 0,100 18,145 50,82 92,145 100,100\" style=\"fill:#9d9ea1\"/></svg></div>\r\n <div class=\"comment-header\">\r\n <div class=\"comment-header-primary\">\r\n <span class=\"comment-header-item\" id=\"comment-count\">评论</span>\r\n <a class=\"comment-header-item\" id=\"comment-link\" target=\"_blank\">在线讨论</a>\r\n </div>\r\n <div class=\"comment-header-menu\">\r\n <input class=\"comment-header-checkbox\" type=\"checkbox\" id=\"comment-user\">\r\n <label class=\"comment-header-item comment-login\" title=\"使用 Disqus 帐号授权登录\" for=\"comment-user\">登录</label>\r\n </div>\r\n </div>\r\n <div class=\"comment-navbar\">\r\n <div class=\"comment-navbar-item\">\r\n <a class=\"comment-recommend\" href=\"javascript:;\"><svg t=\"1537508059126\" class=\"icon\" style=\"\" viewBox=\"0 0 1024 1024\" version=\"1.1\" xmlns=\"http://www.w3.org/2000/svg\" p-id=\"3234\" xmlns:xlink=\"http://www.w3.org/1999/xlink\" width=\"24\" height=\"24\"><path d=\"M489.993 887.107 177.906 586.021c-4.002-3.501-114.033-104.031-114.033-224.063 0-146.54 89.526-234.065 239.069-234.065 87.523 0 169.546 69.019 209.058 108.03 39.512-39.011 121.535-108.03 209.059-108.03 149.542 0 239.068 87.525 239.068 234.065 0 120.033-110.031 220.563-114.533 225.065L534.007 887.107c-6 6-14.003 9-22.007 9C503.997 896.107 495.993 893.107 489.993 887.107z\" p-id=\"3235\"></path></svg><span class=\"comment-recommend-text\">推荐</span><span class=\"comment-recommend-count\"></span></a>\r\n </div>\r\n <div class=\"comment-navbar-item comment-order\">\r\n <input class=\"comment-order-radio\" id=\"order-popular\" type=\"radio\" name=\"comment-order\" value=\"popular\" />\r\n <label class=\"comment-order-label\" for=\"order-popular\" title=\"按评分高低排序\">最佳</label>\r\n <input class=\"comment-order-radio\" id=\"order-desc\" type=\"radio\" name=\"comment-order\" value=\"desc\" />\r\n <label class=\"comment-order-label\" for=\"order-desc\" title=\"按从新到旧排序\">最新</label>\r\n <input class=\"comment-order-radio\" id=\"order-asc\" type=\"radio\" name=\"comment-order\" value=\"asc\" />\r\n <label class=\"comment-order-label\" for=\"order-asc\" title=\"按从旧到新排序\">最早</label>\r\n </div>\r\n </div>\r\n <div class=\"comment-box\">\r\n <div class=\"comment-avatar avatar\"><img class=\"comment-avatar-image\" src=\"//a.disquscdn.com/images/noavatar92.png\" data-avatar=\"//a.disquscdn.com/images/noavatar92.png\"></div>\r\n <div class=\"comment-form\">\r\n <div class=\"comment-form-wrapper\">\r\n <textarea class=\"comment-form-textarea\" placeholder=\"加入讨论……\"></textarea>\r\n <div class=\"comment-form-alert\"></div>\r\n <div class=\"comment-image\">\r\n <ul class=\"comment-image-list\"></ul>\r\n <div class=\"comment-image-progress\"><div class=\"comment-image-loaded\"></div></div>\r\n </div>\r\n \r\n <div class=\"comment-actions\">\r\n \r\n <div class=\"comment-actions-group\">\r\n <input id=\"emoji-input\" class=\"comment-actions-input\" type=\"checkbox\">\r\n <label class=\"comment-actions-label emojione\" for=\"emoji-input\">\r\n <svg class=\"icon\" fill=\"#c2c6cc\" viewBox=\"0 0 1024 1024\" version=\"1.1\" xmlns=\"http://www.w3.org/2000/svg\" xmlns:xlink=\"http://www.w3.org/1999/xlink\" width=\"200\" height=\"200\">\r\n <g>\r\n <title>选择表情</title>\r\n <path d=\"M512 1024c-282.713043 0-512-229.286957-512-512s229.286957-512 512-512c282.713043 0 512 229.286957 512 512S792.486957 1024 512 1024zM512 44.521739c-258.226087 0-467.478261 209.252174-467.478261 467.478261 0 258.226087 209.252174 467.478261 467.478261 467.478261s467.478261-209.252174 467.478261-467.478261C979.478261 253.773913 768 44.521739 512 44.521739z\"></path>\r\n <path d=\"M801.391304 554.295652c0 160.278261-129.113043 289.391304-289.391304 289.391304s-289.391304-129.113043-289.391304-289.391304L801.391304 554.295652z\"></path>\r\n <path d=\"M674.504348 349.495652m-57.878261 0a2.6 2.6 0 1 0 115.756522 0 2.6 2.6 0 1 0-115.756522 0Z\"></path>\r\n <path d=\"M347.269565 349.495652m-57.878261 0a2.6 2.6 0 1 0 115.756522 0 2.6 2.6 0 1 0-115.756522 0Z\"></path>\r\n </g>\r\n </svg>\r\n <ul class=\"emojione-list\">${ emojiList}</ul>\r\n </label>\r\n <input id=\"upload-input\" class=\"comment-actions-input comment-image-input\" type=\"file\" accept=\"image/*\" name=\"file\">\r\n <label class=\"comment-actions-label\" for=\"upload-input\">\r\n <svg class=\"icon\" fill=\"#c2c6cc\" viewBox=\"0 0 1024 1024\" version=\"1.1\" xmlns=\"http://www.w3.org/2000/svg\" xmlns:xlink=\"http://www.w3.org/1999/xlink\" width=\"200\" height=\"200\">\r\n <g>\r\n <title>上传图片</title>\r\n <path d=\"M15.515152 15.515152 15.515152 15.515152 15.515152 15.515152Z\"></path>\r\n <path d=\"M15.515152 139.636364l0 806.787879 992.969697 0 0-806.787879-992.969697 0zM946.424242 884.363636l-868.848485 0 0-682.666667 868.848485 0 0 682.666667zM698.181818 356.848485c0-51.417212 41.673697-93.090909 93.090909-93.090909s93.090909 41.673697 93.090909 93.090909c0 51.417212-41.673697 93.090909-93.090909 93.090909s-93.090909-41.673697-93.090909-93.090909zM884.363636 822.30303l-744.727273 0 186.181818-496.484848 248.242424 310.30303 124.121212-93.090909z\"></path>\r\n </g>\r\n </svg>\r\n </label>\r\n </div>\r\n \r\n <div class=\"comment-actions-form\">\r\n <button class=\"comment-form-submit\">\r\n <svg class=\"icon\" viewBox=\"0 0 1024 1024\" version=\"1.1\" xmlns=\"http://www.w3.org/2000/svg\" xmlns:xlink=\"http://www.w3.org/1999/xlink\" width=\"200\" height=\"200\">\r\n <path d=\"M565.747623 792.837176l260.819261 112.921839 126.910435-845.424882L66.087673 581.973678l232.843092 109.933785 562.612725-511.653099-451.697589 563.616588-5.996574 239.832274L565.747623 792.837176z\" fill=\"#ffffff\"></path>\r\n </svg>\r\n </button>\r\n </div>\r\n </div>\r\n\r\n </div>\r\n <div class=\"comment-form-user\">\r\n <form class=\"comment-form-guest\"><input class=\"comment-form-input comment-form-name\" type=\"text\" name=\"name\" placeholder=\"名字(必填)\" autocomplete=\"name\" /><input class=\"comment-form-input comment-form-email\" type=\"email\" name=\"email\" placeholder=\"邮箱(必填)\" autocomplete=\"email\" /><input class=\"comment-form-input comment-form-url\" type=\"url\" name=\"url\" placeholder=\"网址(可选)\" autocomplete=\"url\" /></form>\r\n </div>\r\n </div>\r\n </div>\r\n <ul id=\"comments\" class=\"comment-list\" data-tips=\"评论加载中……\"></ul>\r\n <a href=\"javascript:;\" class=\"comment-loadmore hide\">加载更多</a>\r\n <div class=\"comment-related\"></div>\r\n </div>\r\n <div class=\"comment\" id=\"disqus_thread\"></div>`;\r\n\r\n _.user = new User(_.dom, _.opts);\r\n _.handle = {\r\n logout: _.user.logout.bind(_),\r\n login: _.user.login.bind(_),\r\n loadMore: _.loadMore.bind(_),\r\n loadMoreReply: _.loadMoreReply.bind(_),\r\n post: _.post.bind(_),\r\n threadCreate: _.threadCreate.bind(_),\r\n threadVote: _.threadVote.bind(_),\r\n reactionVote: _.reactionVote.bind(_),\r\n remove: _.remove.bind(_),\r\n show: _.show.bind(_),\r\n toggle: _.toggle.bind(_),\r\n upload: _.upload.bind(_),\r\n verify: _.verify.bind(_),\r\n jump: _.jump.bind(_),\r\n mention: _.mention.bind(_),\r\n keySelect: _.keySelect.bind(_),\r\n field: _.field.bind(_),\r\n focus: _.focus,\r\n input: _.input.bind(_),\r\n parentShow: _.parentShow.bind(_),\r\n selectOrder: _.selectOrder.bind(_)\r\n };\r\n\r\n var $iDisqus = _.dom.querySelector('#idisqus');\r\n $iDisqus.on('blur', '.comment-form-textarea', _.handle.focus);\r\n $iDisqus.on('focus', '.comment-form-textarea', _.handle.focus);\r\n $iDisqus.on('input', '.comment-form-textarea', _.handle.input);\r\n $iDisqus.on('propertychange', '.comment-form-textarea', _.handle.input);\r\n $iDisqus.on('keyup', '.comment-form-textarea', _.handle.mention);\r\n $iDisqus.on('keydown', '.comment-form-textarea', _.handle.keySelect);\r\n $iDisqus.on('blur', '.comment-form-name', _.handle.verify);\r\n $iDisqus.on('blur', '.comment-form-email', _.handle.verify);\r\n $iDisqus.on('click', '.comment-form-submit', _.handle.post);\r\n $iDisqus.on('click', '.comment-login', _.handle.login);\r\n $iDisqus.on('change', '.comment-image-input', _.handle.upload);\r\n $iDisqus.on('click', '.emojione-item', _.handle.field);\r\n $iDisqus.on('click', '.comment-logout', _.handle.logout);\r\n $iDisqus.on('click', '.comment-item-reply', _.handle.show);\r\n $iDisqus.on('click', '.comment-item-cancel', _.handle.show);\r\n $iDisqus.on('click', '.comment-item-avatar', _.handle.jump);\r\n $iDisqus.on('click', '.comment-item-pname', _.handle.jump);\r\n $iDisqus.on('mouseover', '.comment-item-pname', _.handle.parentShow);\r\n $iDisqus.on('click', '.comment-loadmore', _.handle.loadMore);\r\n $iDisqus.on('click', '.comment-item-loadmore', _.handle.loadMoreReply);\r\n $iDisqus.on('click', '#thread-submit', _.handle.threadCreate);\r\n $iDisqus.on('click', '.comment-recommend', _.handle.threadVote);\r\n $iDisqus.on('click', '.comment-reaction-btn:not(.selected)', _.handle.reactionVote);\r\n $iDisqus.on('change', '.comment-order-radio', _.handle.selectOrder);\r\n\r\n switch (_.opts.mode) {\r\n case 1:\r\n _.disqus();\r\n break;\r\n case 2:\r\n _.threadInit();\r\n break;\r\n case 3:\r\n _.threadInit();\r\n _.disqus();\r\n break;\r\n default:\r\n _.disqus();\r\n break;\r\n }\r\n }\r\n\r\n // 切换评论框\r\n iDisqus.prototype.toggle = function () {\r\n var _ = this;\r\n if (_.stat.current == 'disqus') {\r\n _.stat.current = 'idisqus';\r\n _.dom.querySelector('#idisqus').style.display = 'block';\r\n _.dom.querySelector('#disqus_thread').style.display = 'none';\r\n } else {\r\n _.disqus();\r\n }\r\n }\r\n\r\n // 加载 Disqus 评论\r\n iDisqus.prototype.disqus = function () {\r\n var _ = this;\r\n var _tips = _.dom.querySelector('.init-container').dataset.tips;\r\n if (_.opts.site != location.origin) {\r\n console.log('本地环境不加载 Disqus 评论框!');\r\n if (_.opts.mode == 1) {\r\n _.threadInit();\r\n }\r\n return;\r\n }\r\n if (!_.stat.disqusLoaded) {\r\n _tips = '尝试连接 Disqus……';\r\n\r\n var s = d.createElement('script');\r\n s.src = '//' + _.opts.forum + '.disqus.com/embed.js';\r\n s.dataset.timestamp = Date.now();\r\n s.onload = function () {\r\n _.stat.disqusLoaded = true;\r\n _tips = '连接成功,加载 Disqus 评论框……'\r\n }\r\n s.onerror = function () {\r\n if (_.opts.mode == 1) {\r\n _tips = '连接失败,加载简易评论框……';\r\n _.threadInit();\r\n }\r\n }\r\n\r\n\r\n var img = new Image();\r\n img.onerror = function () {\r\n if (_.opts.mode == 1) {\r\n _tips = '连接超时,加载简易评论框……';\r\n _.threadInit();\r\n }\r\n }\r\n img.onload = function () {\r\n (d.head || d.body).appendChild(s);\r\n clearTimeout(timer)\r\n };\r\n img.src = 'https://disqus.com/favicon.ico?' + Date.now();\r\n var timer = setTimeout(function () {\r\n if ( !img.complete || !img.naturalWidth ) {\r\n if (_.opts.mode == 1) {\r\n _tips = '连接失败,加载简易评论框……';\r\n _.threadInit();\r\n }\r\n }\r\n }, _.opts.timeout);\r\n } else {\r\n _.stat.current = 'disqus';\r\n _.dom.querySelector('#idisqus').style.display = 'none';\r\n _.dom.querySelector('#disqus_thread').style.display = 'block';\r\n }\r\n }\r\n\r\n // 添加事件监听\r\n iDisqus.prototype.addListener = function (els, evt, func) {\r\n var _ = this;\r\n var el = _.dom.getElementsByClassName(els);\r\n [].forEach.call(el, function (item) {\r\n item.addEventListener(evt, func, false);\r\n });\r\n }\r\n\r\n // 评论计数\r\n iDisqus.prototype.count = function () {\r\n var _ = this;\r\n var counts = d.querySelectorAll('[data-disqus-url]');\r\n var qty = counts.length;\r\n if (qty > 0) {\r\n var commentArr = [];\r\n for (var i = 0; i < qty; i++) {\r\n commentArr[i] = counts[i].dataset.disqusUrl.replace(_.opts.site, '');\r\n }\r\n getAjax(\r\n _.opts.api + '/threadsList.php?links=' + commentArr.join(','),\r\n function (resp) {\r\n var data = JSON.parse(resp);\r\n var posts = data.response;\r\n posts.forEach(function (item) {\r\n var link = document.createElement('a');\r\n link.href = item.link;\r\n var itemLink = link.href.replace(link.origin, '');\r\n var el = d.querySelector('[data-disqus-url$=\"' + itemLink + '\"]')\r\n if (!!el) {\r\n el.innerHTML = item.posts;\r\n el.dataset.disqusCount = item.posts;\r\n }\r\n });\r\n }, function () {\r\n console.log('获取数据失败!')\r\n }\r\n );\r\n }\r\n };\r\n\r\n // 加载最近评论\r\n iDisqus.prototype.postsList = function (listLimit, containerId) {\r\n var _ = this;\r\n listLimit = listLimit || 5;\r\n var listContainer = d.getElementById(typeof (containerId) == 'string' ? containerId : 'disqusPostsList');\r\n if (listContainer) {\r\n getAjax(\r\n _.opts.api + '/postsList.php?limit=' + listLimit,\r\n function (resp) {\r\n var data = JSON.parse(resp);\r\n var posts = data.response;\r\n var popHtml = '';\r\n posts.forEach(function (item) {\r\n popHtml += `<li style=\"list-style-type: none;\">${item.name}: ${item.raw_message}</br>评: <a href=\"${item.thread.link}\">${item.thread.title}</a></li>`;\r\n });\r\n popHtml = `<ul>${popHtml}</ul`;\r\n listContainer.innerHTML = popHtml;\r\n }, function () {\r\n console.log('获取数据失败!')\r\n }\r\n );\r\n }\r\n };\r\n\r\n // 加载相关话题\r\n iDisqus.prototype.loadRelated = function () {\r\n var _ = this;\r\n if (_.stat.forum.settings.organicDiscoveryEnabled == false || _.stat.relatedLoaded) {\r\n return;\r\n }\r\n getAjax(\r\n _.opts.api + '/threadsList.php?type=' + _.opts.relatedType.toLowerCase() + '&thread=' + _.stat.thread.id,\r\n function (resp) {\r\n var data = JSON.parse(resp);\r\n if (data.code == 0) {\r\n _.stat.relatedLoaded = true;\r\n var threads = data.response;\r\n var popHtml = '';\r\n threads.forEach(function (item) {\r\n var message = item.topPost.message.replace(/<[^>]*>/g, '');\r\n popHtml += `<li class=\"related-item\">\r\n <a class=\"related-item-link\" href=\"${item.link}\" title=\"${item.title}\">\r\n <div class=\"related-item-title\">${item.title}</div>\r\n <div class=\"related-item-desc\">${item.posts}条评论<span class=\"related-item-bullet\"> • </span><time class=\"related-item-time\" datetime=\"${item.createdAt}\"></time></div></a>\r\n <a class=\"related-item-link\" href=\"${item.link}?#comment-${item.topPost.id}\" title=\"${message}\">\r\n <div class=\"related-item-post\">\r\n <div class=\"related-item-avatar\"><img src=\"${item.topPost.avatar}\" /></div>\r\n <div class=\"related-item-main\">\r\n <div class=\"related-item-name\">${ item.topPost.name}</div>\r\n <div class=\"related-item-message\">${ message}</div>\r\n </div>\r\n </div></a>\r\n </li>`;\r\n });\r\n popHtml = `<div class=\"comment-related-title\">在<span class=\"comment-related-forumname\">${_.stat.forum.name}</span>上还有</div><div class=\"comment-related-content\"><ul class=\"related-list\">${popHtml}</ul></div>`;\r\n _.dom.querySelector('.comment-related').innerHTML = popHtml;\r\n _.timeAgo();\r\n }\r\n }, function () {\r\n console.log('获取数据失败!')\r\n }\r\n );\r\n };\r\n\r\n // 加载反应\r\n iDisqus.prototype.loadReactions = function () {\r\n var _ = this;\r\n if (_.stat.forum.settings.threadReactionsEnabled == false) {\r\n return;\r\n }\r\n getAjax(_.opts.api + '/threadReactionsLoadReations.php' + '?thread=' + _.stat.thread.id, function (resp) {\r\n var data = JSON.parse(resp);\r\n if (data.response.eligible) {\r\n _.dom.querySelector('.comment-reaction-prompt').innerHTML = data.response.prompt;\r\n var reactions = data.response.reactions;\r\n var total = 0;\r\n var reaListHtml = '';\r\n var selectedId = _.user.reactionVote[_.stat.thread.id];\r\n selectedId = selectedId || (!!data.selected ? data.selected.id : 0);\r\n reactions.forEach(function (item) {\r\n total += item.votes;\r\n reaListHtml += `<li class=\"comment-reaction-item\"><a class=\"comment-reaction-btn${(selectedId == item.id ? ' selected' : '')}\" data-id=\"${item.id}\" href=\"javascript:;\"><img class=\"comment-reaction-image\" src=\"${item.imageUrl}\"> ${item.text}</a><div class=\"comment-reaction-count\">${item.votes}</div></li>`;\r\n })\r\n _.dom.querySelector('.comment-reaction-list').innerHTML = reaListHtml;\r\n _.dom.querySelector('.comment-reaction-total').innerHTML = total + ' 人次参与';\r\n }\r\n }, function () { })\r\n\r\n };\r\n\r\n // 反应打分事件\r\n iDisqus.prototype.reactionVote = function (e, target) {\r\n var _ = this;\r\n var $reaction = target.closest('.comment-reaction-item');\r\n var $count = $reaction.querySelector('.comment-reaction-count');\r\n var reactionId = target.dataset.id;\r\n var postData = {\r\n thread: _.stat.thread.id,\r\n unique: _.user.unique,\r\n reaction: reactionId\r\n }\r\n postAjax(_.opts.api + '/threadReactionsVote.php', postData, function (resp) {\r\n _.user.reactionVote[_.stat.thread.id] = reactionId;\r\n l.setItem('reaction_vote', JSON.stringify(_.user.reactionVote));\r\n target.classList.add('selected');\r\n $count.innerHTML++\r\n })\r\n }\r\n\r\n // 排序\r\n iDisqus.prototype.selectOrder = function (e, target) {\r\n var _ = this;\r\n var order = target.value;\r\n sessionStorage.setItem('order', order);\r\n _.stat.order = order;\r\n _.dom.querySelector('.comment-list').innerHTML = '';\r\n _.dom.querySelector('.comment-loadmore').classList.add('hide');\r\n _.stat.next = null;\r\n _.getlist();\r\n }\r\n\r\n // 获取评论列表\r\n iDisqus.prototype.getlist = function () {\r\n var _ = this;\r\n _.stat.loading = true;\r\n _.dom.querySelector('#idisqus').classList.add('loading');\r\n _.dom.querySelector('.comment-list').dataset.tips = '评论加载中……';\r\n getAjax(\r\n _.opts.api + '/getcomments.php?thread=' + _.stat.thread.id + (!!_.stat.next ? '&cursor=' + _.stat.next : '') + '&order=' + _.stat.order,\r\n function (resp) {\r\n var data = JSON.parse(resp);\r\n if (data.code === 0) {\r\n _.stat.offsetTop = d.documentElement.scrollTop || d.body.scrollTop;\r\n\r\n _.dom.querySelector('#idisqus').classList.remove('loading')\r\n var loadmore = _.dom.querySelector('.comment-loadmore');\r\n var posts = !!data.response ? data.response : [];\r\n _.stat.root = [];\r\n posts.forEach(function (item) {\r\n _.load(item);\r\n if (!item.parent) {\r\n _.stat.root.unshift(item.id);\r\n }\r\n });\r\n\r\n if (data.cursor.hasPrev) {\r\n _.stat.root.forEach(function (item) {\r\n _.dom.querySelector('.comment-list').appendChild(_.dom.querySelector('#comment-' + item));\r\n })\r\n }\r\n if (data.cursor.hasNext) {\r\n _.stat.next = data.cursor.next;\r\n loadmore.classList.remove('loading');\r\n loadmore.classList.remove('hide');\r\n } else {\r\n _.stat.next = null;\r\n loadmore.classList.add('hide');\r\n }\r\n\r\n if (_.stat.thread.posts == 0) {\r\n _.dom.querySelector('.comment-list').dataset.tips = '来做第一个留言的人吧!';\r\n return;\r\n }\r\n\r\n if (posts.length == 0) {\r\n return;\r\n }\r\n _.timeAgo();\r\n\r\n var iframe = _.dom.querySelectorAll('.comment-item-body iframe');\r\n [].forEach.call(iframe, function (item) {\r\n item.style.width = item.clientWidth + 'px';\r\n item.style.height = item.clientWidth * 9 / 16 + 'px';\r\n setTimeout(function () {\r\n item.src = item.src;\r\n }, 1000)\r\n })\r\n var tweet = _.dom.querySelectorAll('.comment-item-body .twitter-tweet');\r\n if (tweet.length > 0) {\r\n var head = document.getElementsByTagName('head')[0];\r\n var script = document.createElement('script');\r\n script.type = 'text/javascript';\r\n script.src = '//platform.twitter.com/widgets.js';\r\n head.appendChild(script);\r\n }\r\n\r\n window.scrollTo(0, _.stat.offsetTop);\r\n\r\n if (/^#disqus|^#comment-/.test(location.hash) && !data.cursor.hasPrev && !_.stat.disqusLoaded && !_.stat.loaded) {\r\n var el = _.dom.querySelector('#idisqus ' + location.hash)\r\n if (!!el) {\r\n window.scrollBy(0, el.getBoundingClientRect().top);\r\n }\r\n }\r\n _.stat.loading = false;\r\n _.stat.loaded = true;\r\n }\r\n }, function () {\r\n alert('获取数据失败,请检查服务器设置。')\r\n }\r\n );\r\n }\r\n\r\n // 读取评论\r\n iDisqus.prototype.load = function (post) {\r\n\r\n var _ = this;\r\n\r\n _.stat.post[post.id] = post;\r\n\r\n var parentPostDom = _.dom.querySelector('.comment-item[data-id=\"' + post.parent + '\"]');\r\n\r\n var user = {\r\n username: post.username,\r\n name: post.name,\r\n avatar: post.avatar\r\n }\r\n if (!!post.username && _.stat.users.map(function (user) { return user.username; }).indexOf(post.username) == -1) {\r\n _.stat.users.push(user);\r\n }\r\n\r\n var parentPost = !!post.parent ? {\r\n name: `<a class=\"comment-item-pname\" data-parent=\"${post.parent}\" href=\"#${parentPostDom.id}\"><svg class=\"icon\" viewBox=\"0 0 1024 1024\" version=\"1.1\" xmlns=\"http://www.w3.org/2000/svg\" xmlns:xlink=\"http://www.w3.org/1999/xlink\" width=\"200\" height=\"200\"><path d=\"M1.664 902.144s97.92-557.888 596.352-557.888V129.728L1024 515.84l-425.984 360.448V628.8c-270.464 0-455.232 23.872-596.352 273.28\"></path></svg>${parentPostDom.dataset.name}</a>`,\r\n dom: parentPostDom.querySelector('.comment-item-children'),\r\n insert: 'afterbegin'\r\n } : {\r\n name: '',\r\n dom: _.dom.querySelector('.comment-list'),\r\n insert: post.id == 'preview' || !!post.isPost ? 'afterbegin' : 'beforeend'\r\n };\r\n\r\n\r\n var html = `<li class=\"comment-item\" data-id=\"${post.id}\" data-name=\"${post.name}\" id=\"comment-${post.id}\">\r\n <div class=\"comment-item-body\">\r\n <a class=\"comment-item-avatar\" href=\"#comment-${ post.id}\"><img src=\"${post.avatar}\"></a>\r\n <div class=\"comment-item-main\">\r\n <div class=\"comment-item-header\"><a class=\"comment-item-name\" title=\"${ post.name}\" rel=\"nofollow\" target=\"_blank\" href=\"${(post.url || 'javascript:;')}\">${post.name}</a>${(post.isMod ? `<span class=\"comment-item-badge\">${_.opts.badge}</span>` : ``)}${parentPost.name}<span class=\"comment-item-bullet\"> • </span><time class=\"comment-item-time\" datetime=\"${post.createdAt}\"></time></div>\r\n <div class=\"comment-item-content\">${ post.message}</div>\r\n <div class=\"comment-item-footer\">${!!post.isPost ? `<span class=\"comment-item-manage\"><a class=\"comment-item-edit\" href=\"javascript:;\">编辑</a><span class=\"comment-item-bullet\"> • </span><a class=\"comment-item-delete\" href=\"javascript:;\">删除</a><span class=\"comment-item-bullet\"> • </span></span>` : ``}<a class=\"comment-item-reply\" href=\"javascript:;\">回复</a></div>\r\n </div></div>\r\n <ul class=\"comment-item-children\">\r\n ${ post.hasMore ? `<li><a class=\"comment-item-loadmore\" href=\"javascript:;\">显示更多回复</a></li>` : `` }\r\n </ul>\r\n </li>`;\r\n\r\n // 已删除评论\r\n if (!!post.isDeleted) {\r\n html = `<li class=\"comment-item\" data-id=\"${post.id}\" id=\"comment-${post.id}\" data-name=\"${post.name}\">\r\n <div class=\"comment-item-body\">\r\n <a class=\"comment-item-avatar\" href=\"#comment-${ post.id}\"><img src=\"${post.avatar}\"></a>\r\n <div class=\"comment-item-main\" data-message=\"此评论已被删除。\"></div></div>\r\n <ul class=\"comment-item-children\">\r\n ${ post.hasMore ? `<li><a class=\"comment-item-loadmore\" href=\"javascript:;\">显示更多回复</a></li>` : `` }\r\n </ul>\r\n </li>`;\r\n }\r\n\r\n\r\n // 更新 or 创建\r\n if (!!_.dom.querySelector('.comment-item[data-id=\"' + post.id + '\"]')) {\r\n _.dom.querySelector('.comment-item[data-id=\"' + post.id + '\"]').outerHTML = html;\r\n } else {\r\n parentPost.dom.insertAdjacentHTML(parentPost.insert, html);\r\n }\r\n\r\n // 发布留言,可编辑删除\r\n if (!!post.isPost && !_.stat.editing) {\r\n var $this = _.dom.querySelector('.comment-item[data-id=\"' + post.id + '\"]');\r\n\r\n var postEdit = setTimeout(function () {\r\n // 十分钟后\r\n if (!!$this.querySelector('.comment-item-manage')) {\r\n $this.querySelector('.comment-item-manage').outerHTML = '';\r\n }\r\n }, 6 * 1e5);\r\n\r\n // 删除\r\n $this.querySelector('.comment-item-delete').addEventListener('click', function (e) {\r\n var postData = {\r\n id: post.id\r\n }\r\n var delDom = e.currentTarget;\r\n delDom.innerHTML = '删除中';\r\n postAjax(_.opts.api + '/removecomment.php', postData, function (resp) {\r\n var data = JSON.parse(resp);\r\n if (data.code === 0) {\r\n if (data.response.isDeleted == true) {\r\n $this.outerHTML = '';\r\n _.stat.thread.posts = parseInt(_.dom.querySelector('#comment-count').innerHTML) - 1;\r\n _.dom.querySelector('#comment-count').innerHTML = _.stat.thread.posts + ' 条评论';\r\n } else {\r\n alert(data.response.message);\r\n $this.querySelector('.comment-item-manage').outerHTML = '';\r\n }\r\n } else if (data.code === 2) {\r\n alert(data.response);\r\n $this.querySelector('.comment-item-manage').outerHTML = '';\r\n }\r\n }, function () {\r\n alert('删除出错,请稍后重试');\r\n })\r\n clearTimeout(postEdit);\r\n }, false)\r\n\r\n // 编辑\r\n $this.querySelector('.comment-item-edit').addEventListener('click', function () {\r\n _.stat.editing = post;\r\n _.edit(post);\r\n }, false)\r\n }\r\n }\r\n\r\n // 读取更多\r\n iDisqus.prototype.loadMore = function (e, target) {\r\n var _ = this;\r\n _.stat.offsetTop = d.documentElement.scrollTop || d.body.scrollTop;\r\n if (!_.stat.loading) {\r\n target.classList.add('loading');\r\n _.getlist();\r\n }\r\n }\r\n\r\n // 读取更多回复\r\n iDisqus.prototype.loadMoreReply = function (e, target) {\r\n var _ = this;\r\n target.innerHTML = '加载中……';\r\n var $children = target.closest('.comment-item-children');\r\n var $post = target.closest('.comment-item');\r\n getAjax(\r\n _.opts.api + '/descendants.php?post=' + $post.dataset.id,\r\n function (resp) {\r\n var data = JSON.parse(resp);\r\n if( data.code == 0 ){\r\n $children.removeChild(target.parentNode);\r\n var posts = data.response;\r\n posts.forEach(function (item) {\r\n _.load(item);\r\n });\r\n _.timeAgo();\r\n } else {\r\n target.innerHTML = '读取失败';\r\n }\r\n }, function () {\r\n target.innerHTML = '读取出错';\r\n }\r\n );\r\n }\r\n\r\n // 评论框焦点\r\n iDisqus.prototype.focus = function (e, target) {\r\n var wrapper = target.closest('.comment-form-wrapper');\r\n wrapper.classList.add('editing');\r\n if (wrapper.classList.contains('focus')) {\r\n wrapper.classList.remove('focus');\r\n } else {\r\n wrapper.classList.add('focus');\r\n }\r\n }\r\n\r\n // 输入事件\r\n iDisqus.prototype.input = function (e, target) {\r\n var _ = this;\r\n var form = target.closest('.comment-form');\r\n var alertmsg = form.querySelector('.comment-form-alert');\r\n alertmsg.innerHTML = '';\r\n var wrapper = form.querySelector('.comment-form-wrapper');\r\n var filterText = target.value.replace(/<code>.*?<\\/code>/g, '');\r\n var urls = filterText.match(/(^|\\s|\\r|\\n)*(http:\\/\\/|https:\\/\\/)(\\w|-|\\.)*(disqus|sinaimg|giphy|imgur|instagram|twimg|twitter|youtube|youtu\\.be)((\\w|=|\\?|\\.|\\/|&|\\%|-)*)(jpg|png|gif|gallery\\/\\w+|p\\/[a-zA-Z0-9]{11}.*|status\\/\\d{19}|v=[a-zA-Z0-9]{11}|\\/[a-zA-Z0-9]{11})(\\s|$|\\n)/g);\r\n form.querySelector('.comment-image-list').innerHTML = '';\r\n if (!!urls) {\r\n urls.forEach(function (item, i) {\r\n item = item.replace('/\\n|\\r\\n|^\\s|\\s$/g', '');\r\n var image = _.stat.media[item];\r\n if (!!image) {\r\n var imageHtml = `<li class=\"comment-image-item\" data-image-url=\"${image.thumbnailUrl}\"><img class=\"comment-image-object\" src=\"https:${image.thumbnailUrl}\"></li>`;\r\n form.querySelector('.comment-image-list').insertAdjacentHTML('beforeend', imageHtml);\r\n wrapper.classList.add('expanded');\r\n return;\r\n }\r\n postAjax(_.opts.api + '/media.php', { url: item }, function (resp) {\r\n var data = JSON.parse(resp);\r\n if (data.code == 0) {\r\n image = data.response;\r\n var imageHtml = `<li class=\"comment-image-item\" data-image-url=\"${image.thumbnailUrl}\"><img class=\"comment-image-object\" src=\"https:${image.thumbnailUrl}\"></li>`;\r\n form.querySelector('.comment-image-list').insertAdjacentHTML('beforeend', imageHtml);\r\n _.stat.media[item] = image;\r\n wrapper.classList.add('expanded');\r\n }\r\n }, function () {\r\n })\r\n })\r\n } else {\r\n wrapper.classList.remove('expanded');\r\n }\r\n\r\n }\r\n\r\n // 提醒用户 @ mention \r\n iDisqus.prototype.mention = function (e, target) {\r\n var _ = this;\r\n var textarea = target;\r\n var selStart = textarea.selectionStart;\r\n var mentionIndex = textarea.value.slice(0, selStart).lastIndexOf('@');\r\n var mentionText = textarea.value.slice(mentionIndex, selStart);\r\n var mentionDom = _.dom.querySelector('.mention-user');\r\n var showUsers = _.stat.users.filter(function (user) {\r\n var re = new RegExp(mentionText.slice(1), 'i');\r\n return user.username.search(re) > -1;\r\n });\r\n if (mentionText.search(/^@\\w+$|^@$/) == 0 && showUsers.length > 0) {\r\n if (e.keyCode == 38 || e.keyCode == 40) {\r\n return;\r\n }\r\n var coord = _.getCaretCoord(textarea);\r\n var list = '', html = '';\r\n\r\n showUsers.forEach(function (item, i) {\r\n list += `<li class=\"mention-user-item${(i == 0 ? ' active' : '')}\" data-username=\"${item.username}\"><img class=\"mention-user-avatar\" src=\"${item.avatar}\"><div class=\"mention-user-username\">${item.username}</div><div class=\"mention-user-name\">${item.name}</div></li>`;\r\n })\r\n if (!!mentionDom) {\r\n mentionDom.innerHTML = '<ul class=\"mention-user-list\">' + list + '</ul>';\r\n mentionDom.style.left = coord.left + 'px';\r\n mentionDom.style.top = coord.top + 'px';\r\n } else {\r\n html = `<div class=\"mention-user\" style=\"left:${coord.left}px;top:${coord.top}px\"><ul class=\"mention-user-list\">${list}</ul></div>`;\r\n _.dom.querySelector('#idisqus').insertAdjacentHTML('beforeend', html);\r\n }\r\n\r\n // 鼠标悬浮\r\n _.addListener('mention-user-item', 'mouseover', function () {\r\n _.dom.querySelector('.mention-user-item.active').classList.remove('active');\r\n this.classList.add('active');\r\n })\r\n\r\n // 鼠标点击\r\n _.addListener('mention-user-item', 'click', function () {\r\n var username = '@' + this.dataset.username + ' ';\r\n textarea.value = textarea.value.slice(0, mentionIndex) + username + textarea.value.slice(selStart);\r\n mentionDom.outerHTML = '';\r\n textarea.focus();\r\n textarea.setSelectionRange(mentionIndex + username.length, mentionIndex + username.length)\r\n })\r\n } else if (!!mentionDom) {\r\n mentionDom.outerHTML = '';\r\n }\r\n }\r\n\r\n // 获取光标坐标 https://medium.com/@_jh3y/how-to-where-s-the-caret-getting-the-xy-position-of-the-caret-a24ba372990a\r\n iDisqus.prototype.getCaretCoord = function (textarea) {\r\n var _ = this;\r\n var carPos = textarea.selectionEnd,\r\n div = d.createElement('div'),\r\n span = d.createElement('span'),\r\n copyStyle = getComputedStyle(textarea);\r\n [].forEach.call(copyStyle, function (prop) {\r\n div.style[prop] = copyStyle[prop];\r\n });\r\n div.style.position = 'absolute';\r\n _.dom.appendChild(div);\r\n div.textContent = textarea.value.substr(0, carPos);\r\n span.textContent = textarea.value.substr(carPos) || '.';\r\n div.appendChild(span);\r\n var coords = {\r\n 'top': textarea.offsetTop - textarea.scrollTop + span.offsetTop + parseFloat(copyStyle.lineHeight),\r\n 'left': textarea.offsetLeft - textarea.scrollLeft + span.offsetLeft\r\n };\r\n _.dom.removeChild(div);\r\n return coords;\r\n }\r\n\r\n // 键盘选择用户\r\n iDisqus.prototype.keySelect = function (e, target) {\r\n var _ = this;\r\n var textarea = target;\r\n var selStart = textarea.selectionStart;\r\n var mentionIndex = textarea.value.slice(0, selStart).lastIndexOf('@');\r\n var mentionText = textarea.value.slice(mentionIndex, selStart);\r\n var mentionDom = _.dom.querySelector('.mention-user');\r\n if (!mentionDom) {\r\n return;\r\n }\r\n var current = _.dom.querySelector('.mention-user-item.active')\r\n switch (e.keyCode) {\r\n case 13:\r\n //回车\r\n var username = '@' + current.dataset.username + ' ';\r\n textarea.value = textarea.value.slice(0, mentionIndex) + username + textarea.value.slice(selStart);\r\n textarea.setSelectionRange(mentionIndex + username.length, mentionIndex + username.length)\r\n _.dom.querySelector('.mention-user').outerHTML = '';\r\n e.preventDefault();\r\n break;\r\n case 38:\r\n //上\r\n if (!!current.previousSibling) {\r\n current.previousSibling.classList.add('active');\r\n current.classList.remove('active');\r\n }\r\n e.preventDefault();\r\n break;\r\n case 40:\r\n //下\r\n if (!!current.nextSibling) {\r\n current.nextSibling.classList.add('active');\r\n current.classList.remove('active');\r\n }\r\n e.preventDefault();\r\n break;\r\n default:\r\n break;\r\n }\r\n }\r\n\r\n // 跳到评论\r\n iDisqus.prototype.jump = function (e, target) {\r\n var _ = this;\r\n var hash = getLocation(target.href).hash;\r\n var el = _.dom.querySelector('#idisqus ' + hash);\r\n history.replaceState(undefined, undefined, hash);\r\n window.scrollBy(0, el.getBoundingClientRect().top);\r\n e.preventDefault();\r\n }\r\n\r\n // 显示父评论\r\n iDisqus.prototype.parentShow = function (e, target) {\r\n var _ = this;\r\n if (!!target.querySelector('.comment-item-parent')) {\r\n return;\r\n }\r\n var comment = _.stat.post[target.dataset.parent];\r\n if (comment.isDeleted) {\r\n return;\r\n }\r\n var message = comment.message.replace(/<[^>]*>/g, '');\r\n var parentHtml = `<div class=\"comment-item-parent\"><a class=\"comment-item-avatar\" href=\"javascript:;\"><img src=\"${comment.avatar}\"></a><div class=\"comment-item-pmain\"><div class=\"comment-item-pheader\">${comment.name}</div><div class=\"comment-item-pcontent\" title=\"${message}\">${message}</div></div></div>`;\r\n target.insertAdjacentHTML('beforeend', parentHtml);\r\n }\r\n\r\n // 点选表情\r\n iDisqus.prototype.field = function (e, target) {\r\n var _ = this;\r\n var item = target;\r\n var form = item.closest('.comment-form');\r\n var textarea = form.querySelector('.comment-form-textarea');\r\n _.appendText(textarea, item.dataset.code);\r\n }\r\n\r\n // 显示回复框 or 取消回复框\r\n iDisqus.prototype.show = function (e, target) {\r\n var _ = this;\r\n\r\n var $this = target;\r\n var item = $this.closest('.comment-item');\r\n\r\n // 无论取消还是回复,移除已显示回复框\r\n var box = _.dom.querySelector('.comment-item .comment-box:not([data-current-id])');\r\n if (box) {\r\n var $show = box.closest('.comment-item');\r\n var cancel = $show.querySelector('.comment-item-cancel')\r\n cancel.outerHTML = cancel.outerHTML.replace('cancel', 'reply');\r\n box.outerHTML = '';\r\n }\r\n\r\n // 回复时,显示评论框\r\n if ($this.className == 'comment-item-reply') {\r\n $this.outerHTML = $this.outerHTML.replace('reply', 'cancel');\r\n var commentBox = _.box.replace(/emoji-input/g, 'emoji-input-' + item.dataset.id).replace(/upload-input/g, 'upload-input-' + item.dataset.id);\r\n item.querySelector('.comment-item-children').insertAdjacentHTML('beforebegin', commentBox);\r\n _.user.init();\r\n\r\n item.querySelector('.comment-form-textarea').focus();\r\n }\r\n\r\n }\r\n\r\n // 验证表单\r\n iDisqus.prototype.verify = function (e, target) {\r\n var _ = this;\r\n var $this = target;\r\n var box = $this.closest('.comment-box');\r\n var $avatar = box.querySelector('.comment-avatar-image');\r\n var $name = box.querySelector('.comment-form-name');\r\n var $email = box.querySelector('.comment-form-email');\r\n var alertmsg = box.querySelector('.comment-form-alert');\r\n if ($email.value == '') {\r\n return;\r\n }\r\n getAjax(\r\n _.opts.api + '/getgravatar.php?email=' + $email.value + '&name=' + $name.value,\r\n function (resp) {\r\n var data = JSON.parse(resp);\r\n if (!data.isEmail && $this == $email) {\r\n _.errorTips('您所填写的邮箱地址有误。', $email);\r\n }\r\n if ($name.value != '') {\r\n $avatar.src = data.gravatar;\r\n }\r\n }, function () {\r\n }\r\n );\r\n }\r\n\r\n // 添加文本\r\n iDisqus.prototype.appendText = function (textarea, text) {\r\n var _ = this;\r\n var selStart = textarea.selectionStart;\r\n var text = selStart == 0 ? text + ' ' : ' ' + text + ' ';\r\n textarea.value = textarea.value.slice(0, selStart) + text + textarea.value.slice(selStart);\r\n textarea.focus();\r\n textarea.setSelectionRange(selStart + text.length, selStart + text.length);\r\n }\r\n\r\n // 上传图片\r\n iDisqus.prototype.upload = function (e, target) {\r\n var _ = this;\r\n var file = target;\r\n var form = file.closest('.comment-form');\r\n var progress = form.querySelector('.comment-image-progress');\r\n var loaded = form.querySelector('.comment-image-loaded');\r\n var wrapper = form.querySelector('.comment-form-wrapper');\r\n var alertmsg = form.querySelector('.comment-form-alert');\r\n alertmsg.innerHTML = '';\r\n if (file.files.length === 0) {\r\n return;\r\n }\r\n\r\n // 以文件大小识别是否为同张图片\r\n var size = file.files[0].size;\r\n\r\n if (size > 5 * 1e6) {\r\n alertmsg.innerHTML = '请选择 5M 以下图片。';\r\n setTimeout(function () {\r\n alertmsg.innerHTML = '';\r\n }, 3000);\r\n return;\r\n }\r\n\r\n if (_.stat.imageSize.indexOf(size) == -1) {\r\n progress.style.width = '80px';\r\n } else {\r\n alertmsg.innerHTML = '请勿选择已存在的图片。';\r\n setTimeout(function () {\r\n alertmsg.innerHTML = '';\r\n }, 3000);\r\n return;\r\n }\r\n\r\n // 展开图片上传界面\r\n wrapper.classList.add('expanded');\r\n\r\n // 图片上传请求\r\n var data = new FormData();\r\n data.append('file', file.files[0]);\r\n var filename = file.files[0].name;\r\n\r\n var $item;\r\n\r\n var xhrUpload = new XMLHttpRequest();\r\n xhrUpload.withCredentials = true;\r\n xhrUpload.onreadystatechange = function () {\r\n if (xhrUpload.readyState == 4 && xhrUpload.status == 200) {\r\n var data = JSON.parse(xhrUpload.responseText);\r\n if (data.code == 0) {\r\n _.stat.imageSize.push(size);\r\n var imageUrl = data.response.thumbnailUrl;\r\n var textarea = form.querySelector('.comment-form-textarea');\r\n _.appendText(textarea, 'https:'+imageUrl);\r\n\r\n var image = new Image();\r\n image.src = imageUrl;\r\n image.onload = function () {\r\n $item.innerHTML = '<img class=\"comment-image-object\" src=\"https:' + imageUrl + '\">';\r\n $item.dataset.imageUrl = imageUrl;\r\n $item.classList.remove('loading');\r\n }\r\n } else {\r\n alertmsg.innerHTML = '图片上传出错。';\r\n $item.innerHTML = '';\r\n if (!!form.getElementsByClassName('comment-image-item').length) {\r\n wrapper.classList.remove('expanded');\r\n }\r\n setTimeout(function () {\r\n alertmsg.innerHTML = '';\r\n }, 3000);\r\n }\r\n }\r\n };\r\n xhrUpload.upload.addEventListener('progress', function (e) {\r\n loaded.style.width = Math.ceil((e.loaded / e.total) * 100) + '%';\r\n }, false);\r\n xhrUpload.upload.addEventListener('load', function (e) {\r\n loaded.style.width = 0;\r\n progress.style.width = 0;\r\n var imageItem = `<li class=\"comment-image-item loading\" data-image-size=\"${size}\">\r\n <svg version=\"1.1\" class=\"comment-image-object\" xmlns=\"http://www.w3.org/2000/svg\" xmlns:xlink=\"http://www.w3.org/1999/xlink\" x=\"0px\" y=\"0px\" width=\"24px\" height=\"30px\" viewBox=\"0 0 24 30\" style=\"enable-background: new 0 0 50 50;\" xml:space=\"preserve\">\r\n <rect x=\"0\" y=\"10\" width=\"4\" height=\"10\" fill=\"rgba(127,145,158,1)\" opacity=\"0.2\">\r\n <animate attributeName=\"opacity\" attributeType=\"XML\" values=\"0.2; 1; .2\" begin=\"0s\" dur=\"0.6s\" repeatCount=\"indefinite\" />\r\n <animate attributeName=\"height\" attributeType=\"XML\" values=\"10; 20; 10\" begin=\"0s\" dur=\"0.6s\" repeatCount=\"indefinite\" />\r\n <animate attributeName=\"y\" attributeType=\"XML\" values=\"10; 5; 10\" begin=\"0s\" dur=\"0.6s\" repeatCount=\"indefinite\" />\r\n </rect>\r\n <rect x=\"8\" y=\"10\" width=\"4\" height=\"10\" fill=\"rgba(127,145,158,1)\" opacity=\"0.2\">\r\n <animate attributeName=\"opacity\" attributeType=\"XML\" values=\"0.2; 1; .2\" begin=\"0.15s\" dur=\"0.6s\" repeatCount=\"indefinite\" />\r\n <animate attributeName=\"height\" attributeType=\"XML\" values=\"10; 20; 10\" begin=\"0.15s\" dur=\"0.6s\" repeatCount=\"indefinite\" />\r\n <animate attributeName=\"y\" attributeType=\"XML\" values=\"10; 5; 10\" begin=\"0.15s\" dur=\"0.6s\" repeatCount=\"indefinite\" />\r\n </rect>\r\n <rect x=\"16\" y=\"10\" width=\"4\" height=\"10\" fill=\"rgba(127,145,158,1)\" opacity=\"0.2\">\r\n <animate attributeName=\"opacity\" attributeType=\"XML\" values=\"0.2; 1; .2\" begin=\"0.3s\" dur=\"0.6s\" repeatCount=\"indefinite\" />\r\n <animate attributeName=\"height\" attributeType=\"XML\" values=\"10; 20; 10\" begin=\"0.3s\" dur=\"0.6s\" repeatCount=\"indefinite\" />\r\n <animate attributeName=\"y\" attributeType=\"XML\" values=\"10; 5; 10\" begin=\"0.3s\" dur=\"0.6s\" repeatCount=\"indefinite\" />\r\n </rect>\r\n </svg>\r\n </li>`;\r\n form.querySelector('.comment-image-list').insertAdjacentHTML('beforeend', imageItem);\r\n $item = form.querySelector('[data-image-size=\"' + size + '\"]');\r\n }, false);\r\n xhrUpload.open('POST', _.opts.api + '/media.php', true);\r\n xhrUpload.send(data);\r\n }\r\n\r\n // 移除图片\r\n iDisqus.prototype.remove = function (e) {\r\n var _ = this;\r\n var $item = e.currentTarget.closest('.comment-image-item');\r\n var wrapper = e.currentTarget.closest('.comment-form-wrapper');\r\n $item.outerHTML = '';\r\n _.stat.imageSize = [];\r\n var imageArr = wrapper.getElementsByClassName('comment-image-item');\r\n [].forEach.call(imageArr, function (item, i) {\r\n _.stat.imageSize[i] = item.dataset.imageSize;\r\n });\r\n if (_.stat.imageSize.length == 0) {\r\n wrapper.classList.remove('expanded');\r\n }\r\n wrapper.querySelector('.comment-image-input').value = '';\r\n }\r\n\r\n // 错误提示\r\n iDisqus.prototype.errorTips = function (Text, Dom) {\r\n var _ = this;\r\n if (_.user.logged_in == 'true') {\r\n _.handle.logout();\r\n }\r\n var idisqus = _.dom.querySelector('#idisqus');\r\n var errorDom = _.dom.querySelector('.comment-form-error');\r\n if (!!errorDom) {\r\n errorDom.outerHTML = '';\r\n }\r\n var Top = Dom.offsetTop;\r\n var Left = Dom.offsetLeft;\r\n var errorHtml = '<div class=\"comment-form-error\" style=\"top:' + Top + 'px;left:' + Left + 'px;\">' + Text + '</div>';\r\n idisqus.insertAdjacentHTML('beforeend', errorHtml);\r\n setTimeout(function () {\r\n var errorDom = _.dom.querySelector('.comment-form-error');\r\n if (!!errorDom) {\r\n errorDom.outerHTML = '';\r\n }\r\n }, 3000);\r\n }\r\n\r\n // 发表/回复评论\r\n iDisqus.prototype.post = function (e, target) {\r\n var _ = this;\r\n var item = target.closest('.comment-box[data-current-id]') || target.closest('.comment-item') || target.closest('.comment-box');\r\n var message = item.querySelector('.comment-form-textarea').value;\r\n var parentId = !!item.dataset.id ? item.dataset.id : '';\r\n var imgArr = item.getElementsByClassName('comment-image-item');\r\n\r\n // 不是编辑框需预览\r\n if (!item.dataset.currentId) {\r\n var elName = item.querySelector('.comment-form-name');\r\n var elEmail = item.querySelector('.comment-form-email');\r\n var elUrl = item.querySelector('.comment-form-url');\r\n var alertmsg = item.querySelector('.comment-form-alert');\r\n var alertClear = function () {\r\n setTimeout(function () {\r\n alertmsg.innerHTML = '';\r\n }, 3000);\r\n }\r\n\r\n if (_.user.type != '1') {\r\n var anonName = elName.value;\r\n var anonEmail = elEmail.value;\r\n var anonUrl = elUrl.value.replace(/\\s/g, '');\r\n if (/^\\s*$/i.test(anonName)) {\r\n _.errorTips('名字不能为空或空格。', elName);\r\n return;\r\n }\r\n if (/^\\s*$/i.test(anonEmail)) {\r\n _.errorTips('邮箱不能为空或空格。', elEmail);\r\n return;\r\n }\r\n if (!/^[A-Z0-9._%+-]+@[A-Z0-9.-]+\\.[A-Z]{2,}$/i.test(anonEmail)) {\r\n _.errorTips('请正确填写邮箱。', elEmail);\r\n return;\r\n }\r\n if (!/^([hH][tT]{2}[pP]:\\/\\/|[hH][tT]{2}[pP][sS]:\\/\\/)(([A-Za-z0-9-~]+)\\.)+([A-Za-z0-9-~\\/])+$|^\\s*$/i.test(anonUrl)) {\r\n _.errorTips('请正确填写网址。', elUrl);\r\n return;\r\n }\r\n _.user.unique = _.user.email == anonEmail ? _.user.unique : generateGUID();\r\n _.user.name = anonName;\r\n _.user.email = anonEmail;\r\n _.user.url = anonUrl;\r\n _.user.avatar = item.querySelector('.comment-avatar-image').src;\r\n _.user.submit();\r\n\r\n if (!_.user.name && !_.user.email) {\r\n return;\r\n }\r\n }\r\n\r\n if (!_.stat.message && !_.stat.mediaHtml) {\r\n _.box = _.dom.querySelector('.comment-box').outerHTML.replace('comment-form-wrapper', 'comment-form-wrapper editing').replace(/加入讨论……/, '');\r\n }\r\n\r\n if (/^\\s*$/i.test(message)) {\r\n alertmsg.innerHTML = '评论不能为空或空格。';\r\n item.querySelector('.comment-form-textarea').focus();\r\n return;\r\n };\r\n\r\n var preMessage = message;\r\n\r\n if (!!_.opts.emoji_preview) {\r\n preMessage = preMessage.replace(/:([-+\\w]+):/g, function (match) {\r\n var emojiShort = match.replace(/:/g, '');\r\n var emojiImage = !!_.eac[emojiShort] ? `<img class=\"emojione\" width=\"24\" height=\"24\" alt=\"'+emojiShort+'\" title=\":${emojiShort}:\" src=\"${_.opts.emojiPath + _.eac[emojiShort]}.png\">` : match;\r\n return emojiImage;\r\n });\r\n } else {\r\n _.emojiList.forEach(function (item) {\r\n preMessage = preMessage.replace(`:${item.code}:`, `<img class=\"emojione\" width=\"24\" height=\"24\" src=\"${_.opts.emojiPath + item.unicode}.png\" />`);\r\n });\r\n }\r\n\r\n var post = {\r\n 'url': !!_.user.url ? _.user.url : '',\r\n 'isMod': false,\r\n 'username': null,\r\n 'name': _.user.name,\r\n 'avatar': _.user.avatar,\r\n 'id': 'preview',\r\n 'parent': parentId,\r\n 'createdAt': (new Date()).toJSON(),\r\n 'message': '<p>' + preMessage + '</p>',\r\n };\r\n\r\n _.load(post);\r\n\r\n _.timeAgo();\r\n\r\n // 清空或移除评论框\r\n _.stat.message = message;\r\n _.stat.mediaHtml = item.querySelector('.comment-image-list').innerHTML;\r\n\r\n if (parentId) {\r\n item.querySelector('.comment-item-cancel').click();\r\n } else {\r\n item.querySelector('.comment-form-textarea').value = '';\r\n item.querySelector('.comment-image-list').innerHTML = '';\r\n item.querySelector('.comment-form-wrapper').classList.remove('expanded', 'editing');\r\n }\r\n }\r\n\r\n // @\r\n var mentions = message.match(/@\\w+/g);\r\n if (!!mentions) {\r\n mentions = mentions.filter(function (mention) {\r\n return _.stat.users.map(function (user) { return user.username; }).indexOf(mention.slice(1)) > -1;\r\n });\r\n if (mentions.length > 0) {\r\n var re = new RegExp('(' + mentions.join('|') + ')', 'g');\r\n message = message.replace(re, '$1:disqus');\r\n }\r\n }\r\n\r\n // POST 操作\r\n // 编辑框则更新评论\r\n if (!!item.dataset.currentId) {\r\n var postData = {\r\n id: item.dataset.currentId,\r\n message: message,\r\n unique: _.user.unique\r\n }\r\n postAjax(_.opts.api + '/updatecomment.php', postData, function (resp) {\r\n var data = JSON.parse(resp);\r\n if (data.code === 0) {\r\n _.stat.message = null;\r\n _.stat.mediaHtml = null;\r\n var post = data.response;\r\n _.load(post);\r\n _.timeAgo();\r\n _.stat.editing = false;\r\n } else {\r\n // 取消编辑\r\n _.load(_.stat.editing)\r\n _.timeAgo();\r\n _.stat.editing = false;\r\n }\r\n }, function () {\r\n // 取消编辑\r\n _.load(_.stat.editing)\r\n _.timeAgo();\r\n _.stat.editing = false;\r\n })\r\n } else {\r\n var postData = {\r\n thread: _.stat.thread.id,\r\n parent: parentId,\r\n message: message,\r\n name: _.user.name,\r\n email: _.user.email,\r\n url: _.user.url,\r\n unique: _.user.unique\r\n }\r\n postAjax(_.opts.api + '/postcomment.php', postData, function (resp) {\r\n var data = JSON.parse(resp);\r\n if (data.code === 0) {\r\n _.dom.querySelector('.comment-item[data-id=\"preview\"]').outerHTML = '';\r\n _.stat.thread = data.thread;\r\n _.stat.thread.posts = parseInt(_.dom.querySelector('#comment-count').innerHTML) + 1;\r\n _.dom.querySelector('#comment-count').innerHTML = _.stat.thread.posts + ' 条评论';\r\n var post = data.response;\r\n post.isPost = true;\r\n _.load(post);\r\n _.timeAgo();\r\n var postData = {\r\n post: JSON.stringify(post),\r\n thread: JSON.stringify(_.stat.thread),\r\n parent: JSON.stringify(_.stat.post[parentId]),\r\n code: data.verifyCode\r\n }\r\n if (!!data.verifyCode) {\r\n // 异步发送邮件\r\n postAjax(_.opts.api + '/sendemail.php', postData, function (resp) {\r\n console.info('邮件发送成功!');\r\n })\r\n }\r\n } else if (data.code === 2) {\r\n alertmsg.innerHTML = data.response;\r\n _.dom.querySelector('.comment-item[data-id=\"preview\"]').outerHTML = '';\r\n _.reEdit(item);\r\n\r\n if (data.response.indexOf('author') > -1) {\r\n _.handle.logout();\r\n }\r\n } else {\r\n alertmsg.innerHTML = '提交失败,请稍后重试,错误代码:' + data.code;\r\n alertClear();\r\n\r\n _.dom.querySelector('.comment-item[data-id=\"preview\"]').outerHTML = '';\r\n _.reEdit(item);\r\n }\r\n\r\n }, function () {\r\n alertmsg.innerHTML = '提交出错,请稍后重试。';\r\n alertClear();\r\n\r\n _.dom.querySelector('.comment-item[data-id=\"preview\"]').outerHTML = '';\r\n _.reEdit(item);\r\n })\r\n }\r\n }\r\n\r\n // 重新编辑\r\n iDisqus.prototype.reEdit = function (item) {\r\n var _ = this;\r\n\r\n if (!!item.dataset.id) {\r\n item.querySelector('.comment-item-reply').click();\r\n } else {\r\n item.querySelector('.comment-form-wrapper').classList.add('editing');\r\n }\r\n\r\n // 重新填充文本图片\r\n if (!!_.stat.message) {\r\n item.querySelector('.comment-form-textarea').value = _.stat.message;\r\n }\r\n if (!!_.stat.mediaHtml) {\r\n item.querySelector('.comment-form-wrapper').classList.add('expanded');\r\n item.querySelector('.comment-image-list').innerHTML = _.stat.mediaHtml;\r\n }\r\n }\r\n\r\n // 编辑\r\n iDisqus.prototype.edit = function (post) {\r\n var _ = this;\r\n var commentBox = _.box.replace('comment-box', 'comment-box comment-box-' + post.id).replace(/emoji-input/g, 'emoji-input-' + post.id).replace(/upload-input/g, 'upload-input-' + post.id);\r\n var $this = _.dom.querySelector('.comment-item[data-id=\"' + post.id + '\"] .comment-item-body');\r\n $this.outerHTML = commentBox;\r\n _.user.init();\r\n var item = _.dom.querySelector('.comment-box-' + post.id);\r\n item.dataset.currentId = post.id;\r\n item.querySelector('.comment-form-textarea').focus();\r\n\r\n // 取消编辑\r\n item.querySelector('.comment-actions-form').insertAdjacentHTML('afterbegin', '<a class=\"comment-form-cancel\" href=\"javascript:;\">取消</a>')\r\n item.querySelector('.comment-form-cancel').addEventListener('click', function () {\r\n _.stat.editing = false;\r\n _.load(post);\r\n _.timeAgo();\r\n }, false);\r\n\r\n // 重新填充文本图片,连续回复、连续编辑会有 bug\r\n if (!!_.stat.message) {\r\n item.querySelector('.comment-form-textarea').value = _.stat.message;\r\n }\r\n if (!!_.stat.mediaHtml) {\r\n item.querySelector('.comment-form-wrapper').classList.add('expanded');\r\n item.querySelector('.comment-image-list').innerHTML = _.stat.mediaHtml;\r\n }\r\n\r\n }\r\n\r\n // Thread 初始化\r\n iDisqus.prototype.threadInit = function (e, target) {\r\n var _ = this;\r\n _.dom.querySelector('#idisqus').style.display = 'block';\r\n _.dom.querySelector('#disqus_thread').style.display = 'none';\r\n getAjax(_.opts.api + '/threadsDetails.php?ident=' + _.opts.identifier + '&link=' + _.opts.url, function (resp) {\r\n var data = JSON.parse(resp);\r\n if (data.code == 0) {\r\n _.stat.thread = data.response;\r\n _.stat.forum = data.forum;\r\n _.dom.querySelector('#comment-link').href = `https://disqus.com/home/discussion/${_.stat.forum.id}/${_.stat.thread.slug}/?l=zh`;\r\n _.dom.querySelector('.comment-avatar-image').dataset.avatar = _.stat.forum.avatar;\r\n _.dom.querySelector('.comment-recommend-count').innerHTML = _.stat.thread.likes || '';\r\n if (_.stat.forum.settings.mediaembedEnabled == false) {\r\n _.dom.querySelector('.comment-image-input').outerHTML = ''\r\n _.dom.querySelector('[for=\"upload-input\"]').outerHTML = ''\r\n }\r\n if (_.user.logged_in == 'false') {\r\n _.dom.querySelector('.comment-avatar-image').src = _.stat.forum.avatar;\r\n }\r\n _.box = _.dom.querySelector('.comment-box').outerHTML.replace(/<label class=\"comment-actions-label exit\"(.|\\n)*<\\/label>\\n/, '').replace('comment-form-wrapper', 'comment-form-wrapper editing').replace(/加入讨论……/, '');\r\n _.opts.badge = _.stat.forum.moderatorBadgeText;\r\n if (!_.stat.order) {\r\n switch (_.stat.forum.order) {\r\n case 1:\r\n _.stat.order = 'asc';\r\n break;\r\n case 2:\r\n _.stat.order = 'desc';\r\n break;\r\n case 4:\r\n _.stat.order = 'popular';\r\n break;\r\n }\r\n }\r\n _.dom.querySelector('.comment-order-radio[value=\"' + _.stat.order + '\"]').checked = true;\r\n\r\n var users = data.votedusers;\r\n var vote = 0;\r\n if (_.user.type == 1) {\r\n // 已登录\r\n vote = users.filter(function (user) {\r\n return user.username == _.user.username;\r\n }).length > 0 ? 1 : 0;\r\n } else {\r\n // 未登录\r\n vote = !!_.user.vote[_.stat.thread.id] ? 1 : 0;;\r\n }\r\n _.user.vote[_.stat.thread.id] = vote;\r\n l.setItem('vote', JSON.stringify(_.user.vote));\r\n if (!!vote) {\r\n _.dom.querySelector('.comment-recommend').classList.add('voted');\r\n _.dom.querySelector('.comment-recommend-text').innerHTML = '已推荐';\r\n }\r\n _.dom.querySelector('#idisqus').classList.remove('init')\r\n _.loadRelated();\r\n _.loadReactions();\r\n _.dom.querySelector('#comment-count').innerHTML = _.stat.thread.posts + ' 条评论';\r\n _.getlist();\r\n } else if (data.code === 2) {\r\n // 自动创建\r\n if (_.opts.autoCreate) {\r\n _.dom.querySelector('.init-container').dataset.tips = '正在创建 Thread……';\r\n var postData = {\r\n url: _.opts.link,\r\n identifier: _.opts.identifier,\r\n title: _.opts.title,\r\n slug: _.opts.slug,\r\n message: _.opts.desc\r\n }\r\n _.threadCreate(postData);\r\n return;\r\n }\r\n _.dom.querySelector('#idisqus').classList.remove('init');\r\n var threadForm = `<div class=\"comment-header\"><span class=\"comment-header-item\">创建 Thread</span></div>\r\n <div class=\"comment-thread-form\">\r\n <p>由于 Disqus 没有本页面的相关 Thread,故需先创建 Thread</p>\r\n <div class=\"comment-form-item\"><label class=\"comment-form-label\">url:</label><input class=\"comment-form-input\" id=\"thread-url\" name=\"url\" value=\"${ _.opts.link}\" disabled /></div>\r\n <div class=\"comment-form-item\"><label class=\"comment-form-label\">identifier:</label><input class=\"comment-form-input\" id=\"thread-identifier\" name=\"identifier\" value=\"${ _.opts.identifier}\" disabled /></div>\r\n <div class=\"comment-form-item\"><label class=\"comment-form-label\">title:</label><input class=\"comment-form-input\" id=\"thread-title\" name=\"title\" value=\"${ _.opts.title}\" disabled /></div>\r\n <div class=\"comment-form-item\"><label class=\"comment-form-label\">slug:</label><input class=\"comment-form-input\" id=\"thread-slug\" name=\"slug\" value=\"${ _.opts.slug}\" /></div>\r\n <div class=\"comment-form-item\"><label class=\"comment-form-label\">message:</label><textarea class=\"comment-form-textarea\" id=\"thread-message\" name=\"message\">${ _.opts.desc}</textarea></div>\r\n <button id=\"thread-submit\" class=\"comment-form-submit\">提交</button></div>`;\r\n _.dom.querySelector('#idisqus').innerHTML = threadForm;\r\n }\r\n }, function () { })\r\n }\r\n\r\n // Thread 打分事件\r\n iDisqus.prototype.threadVote = function (e, target) {\r\n var _ = this;\r\n var vote = !!_.user.vote[_.stat.thread.id] ? 0 : 1;\r\n var postData = {\r\n thread: _.stat.thread.id,\r\n unique: _.user.unique,\r\n vote: vote\r\n }\r\n postAjax(_.opts.api + '/threadsVote.php', postData, function (resp) {\r\n _.user.vote[_.stat.thread.id] = vote;\r\n l.setItem('vote', JSON.stringify(_.user.vote));\r\n if (!!vote) {\r\n _.dom.querySelector('.comment-recommend').classList.add('voted');\r\n _.stat.thread.likes++;\r\n } else {\r\n _.dom.querySelector('.comment-recommend').classList.remove('voted');\r\n _.stat.thread.likes = _.stat.thread.likes == 0 ? 0 : _.stat.thread.likes - 1;\r\n }\r\n _.dom.querySelector('.comment-recommend-count').innerHTML = _.stat.thread.likes || '';\r\n })\r\n }\r\n\r\n // Thread Create 事件\r\n iDisqus.prototype.threadCreate = function (e, target) {\r\n var _ = this;\r\n if (!!target) {\r\n var postData = {\r\n url: _.dom.querySelector('#thread-url').value,\r\n identifier: _.dom.querySelector('#thread-identifier').value,\r\n title: _.dom.querySelector('#thread-title').value,\r\n slug: _.dom.querySelector('#thread-slug').value.replace(/[^A-Za-z0-9_-]+/g, ''),\r\n message: _.dom.querySelector('#thread-message').value\r\n }\r\n } else {\r\n var postData = arguments[0];\r\n }\r\n postAjax(_.opts.api + '/createthread.php', postData, function (resp) {\r\n var data = JSON.parse(resp);\r\n if (data.code === 0) {\r\n alert('创建 Thread 成功,刷新后便可愉快地评论了!');\r\n setTimeout(function () { location.reload(); }, 2000);\r\n } else if (data.code === 2) {\r\n if (data.response.indexOf('A thread already exists with link') > -1) {\r\n alert(data.response.replace('A thread already exists with link,', '已存在此链接的相关 Thread,'));\r\n return;\r\n }\r\n if (data.response.indexOf('Invalid URL') > -1) {\r\n alert('参数错误,无效的\\'URL\\'');\r\n return;\r\n }\r\n if (data.response.indexOf('Invalid slug') > -1) {\r\n alert('参数错误,无效的\\'slug\\'');\r\n return;\r\n }\r\n alert(data.response);\r\n return;\r\n } else {\r\n alert(data.response);\r\n return;\r\n }\r\n }, function () {\r\n alert('创建 Thread 出错,请稍后重试!');\r\n })\r\n }\r\n\r\n // 销毁评论框\r\n iDisqus.prototype.destroy = function () {\r\n var _ = this;\r\n _.dom.innerHTML = '';\r\n delete _.dom;\r\n delete _.box;\r\n delete _.emojiList;\r\n delete _.user;\r\n delete _.handle;\r\n delete _.stat;\r\n delete _.opts;\r\n }\r\n\r\n /* CommonJS */\r\n if (typeof require === 'function' && typeof module === 'object' && module && typeof exports === 'object' && exports)\r\n module.exports = iDisqus;\r\n /* AMD */\r\n else if (typeof define === 'function' && define['amd'])\r\n define(function () {\r\n return iDisqus;\r\n });\r\n /* Global */\r\n else\r\n global['iDisqus'] = global['iDisqus'] || iDisqus;\r\n\r\n})(window || this);\r\n","module.exports = function(module) {\n\tif (!module.webpackPolyfill) {\n\t\tmodule.deprecate = function() {};\n\t\tmodule.paths = [];\n\t\t// module.parent = undefined by default\n\t\tif (!module.children) module.children = [];\n\t\tObject.defineProperty(module, \"loaded\", {\n\t\t\tenumerable: true,\n\t\t\tget: function() {\n\t\t\t\treturn module.l;\n\t\t\t}\n\t\t});\n\t\tObject.defineProperty(module, \"id\", {\n\t\t\tenumerable: true,\n\t\t\tget: function() {\n\t\t\t\treturn module.i;\n\t\t\t}\n\t\t});\n\t\tmodule.webpackPolyfill = 1;\n\t}\n\treturn module;\n};\n"],"sourceRoot":""} \ No newline at end of file