forked from szcf-weiya/ESL-CN
-
Notifications
You must be signed in to change notification settings - Fork 0
/
iDisqus0.min.js
8 lines (8 loc) · 43.3 KB
/
iDisqus0.min.js
1
2
3
4
5
6
7
8
/*
* v 0.1.23
* https://github.com/fooleap/disqus-php-api
*
* Copyright 2017 fooleap
* Released under the MIT license
*/
(function(c){var n=document,h=localStorage,i=n.scripts,b=i[i.length-1].src,q=b.substring(0,b.lastIndexOf("/")),o=navigator.userAgent.indexOf("Edge")>-1,f=!!window.ActiveXObject||"ActiveXObject" in window;function g(d){var l=n.createElement("a");l.href=d;return l}function p(l,s,d){var r=new XMLHttpRequest();r.open("GET",encodeURI(l));r.onreadystatechange=function(){if(r.readyState==4&&r.status==200){s(r.responseText)}};r.onerror=d;r.send();return r}function k(l,r,u,d){var t=typeof r=="string"?r:Object.keys(r).map(function(v){return encodeURIComponent(v)+"="+encodeURIComponent(r[v])}).join("&");var s=new XMLHttpRequest();s.open("POST",l);s.onreadystatechange=function(){if(s.readyState==4&&s.status==200){u(s.responseText)}};s.onerror=d;s.setRequestHeader("Content-Type","application/x-www-form-urlencoded");s.send(t);return s}function a(l,d,r){[].forEach.call(l,function(s){s.addEventListener(d,r,false)})}function j(l,d,r){[].forEach.call(l,function(s){s.removeEventListener(d,r,false)})}(function(r){if(typeof r.matches!=="function"){r.matches=r.msMatchesSelector||r.mozMatchesSelector||r.webkitMatchesSelector||function l(s){var u=this;var v=(u.document||u.ownerDocument).querySelectorAll(s);var t=0;while(v[t]&&v[t]!==u){++t}return Boolean(v[t])}}if(typeof r.closest!=="function"){r.closest=function d(s){var t=this;while(t&&t.nodeType===1){if(t.matches(s)){return t}t=t.parentNode}return null}}})(window.Element.prototype);var e=function(){this.dom=arguments[0];this.init()};e.prototype={init:function(){var l=this;l.name=h.getItem("name");l.email=h.getItem("email");l.url=h.getItem("url");l.avatar=h.getItem("avatar");l.logged_in=h.getItem("logged_in");var d=l.dom.getElementsByClassName("comment-box");if(l.logged_in=="true"){[].forEach.call(d,function(r){r.querySelector(".comment-form-wrapper").classList.add("logged-in");r.querySelector(".comment-form-name").value=l.name;r.querySelector(".comment-form-email").value=l.email;r.querySelector(".comment-form-url").value=l.url;r.querySelector(".comment-avatar-image").src=l.avatar})}else{[].forEach.call(d,function(r){r.querySelector(".comment-form-wrapper").classList.remove("logged-in");r.querySelector(".comment-form-name").value=l.name;r.querySelector(".comment-form-email").value=l.email;r.querySelector(".comment-form-url").value=l.url;r.querySelector(".comment-avatar-image").src=!!l.avatar?l.avatar:r.querySelector(".comment-avatar-image").src});h.setItem("logged_in","false")}},reset:function(){h.setItem("logged_in","false");this.init()},submit:function(d){if(this.logged_in=="false"){h.setItem("name",d.name);h.setItem("email",d.email);h.setItem("url",d.url);h.setItem("avatar",d.avatar);h.setItem("logged_in","true");this.init()}}};var m=function(){var d=this;d.opts=typeof(arguments[1])=="object"?arguments[1]:arguments[0];d.dom=n.getElementById(typeof(arguments[0])=="string"?arguments[0]:"comment");d.opts.api=d.opts.api.slice(-1)=="/"?d.opts.api.slice(0,-1):d.opts.api;d.opts.site=!!d.opts.site?d.opts.site:location.origin;if(!!d.opts.url){var l=d.opts.url.replace(d.opts.site,"");d.opts.url=l.slice(0,1)!="/"?"/"+l:l}else{if(o||f){d.opts.url=encodeURI(location.pathname)}else{d.opts.url=location.pathname}}d.opts.identifier=!!d.opts.identifier?d.opts.identifier:d.opts.url;d.opts.link=d.opts.site+d.opts.url;d.opts.title=!!d.opts.title?d.opts.title:n.title;d.opts.slug=!!d.opts.slug?d.opts.slug.replace(/[^A-Za-z0-9_-]+/g,""):"";d.opts.desc=!!d.opts.desc?d.opts.desc:(!!n.querySelector('[name="description"]')?n.querySelector('[name="description"]').content:"");d.opts.mode=!!d.opts.mode?d.opts.mode:1;d.opts.timeout=!!d.opts.timeout?d.opts.timeout:3000;d.opts.toggle=!!d.opts.toggle?n.getElementById(d.opts.toggle):null;d.opts.badge=!!d.opts.badge?d.opts.badge:"管理员";d.opts.emoji_path=!!d.opts.emoji_path?d.opts.emoji_path:"https://github.githubassets.com/images/icons/emoji/unicode/";d.emoji_list=!!d.opts.emoji_list?d.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(!!d.opts.emoji_preview){p(q+"/eac.min.json",function(r){d.eac=JSON.parse(r)},function(){})}d.stat={current:"idisqus",loaded:false,loading:false,editing:false,offsetTop:0,thread:null,next:null,message:null,mediaHtml:null,root:[],count:0,users:[],imageSize:[],disqusLoaded:false};window.disqus_config=function(){this.page.identifier=d.opts.identifier;this.page.title=d.opts.title;this.page.url=d.opts.link;this.callbacks.onReady.push(function(){d.stat.current="disqus";d.stat.disqusLoaded=true;d.dom.querySelector("#idisqus").style.display="none";d.dom.querySelector("#disqus_thread").style.display="block";if(d.opts.mode==3&&!!d.opts.toggle){d.opts.toggle.disabled="";d.opts.toggle.checked=true;d.opts.toggle.addEventListener("change",d.handle.toggle,false)}})};if(!!d.opts.init){d.init()}};m.prototype.timeAgo=function(){var d=this;var r={prefix:"",suffix:"前",seconds:"几秒",minute:"1分钟",minutes:"%d分钟",hour:"1小时",hours:"%d小时",day:"1天",days:"%d天",month:"1个月",months:"%d个月",year:"1年",years:"%d年"};var s=function(w,x){return r[w]&&r[w].replace(/%d/i,Math.abs(Math.round(x)))};var v=function(A){if(!A){return}A=A.replace(/\.\d+/,"");A=A.replace(/-/,"/").replace(/-/,"/");A=A.replace(/T/," ").replace(/Z/," UTC");A=A.replace(/([\+\-]\d\d)\:?(\d\d)/," $1$2");A=new Date(A*1000||A);var x=new Date();var B=((x.getTime()-A)*0.001)>>0;var z=B/60;var w=z/60;var C=w/24;var y=C/365;return r.prefix+(B<45&&s("seconds",B)||B<90&&s("minute",1)||z<45&&s("minutes",z)||z<90&&s("hour",1)||w<24&&s("hours",w)||w<42&&s("day",1)||C<30&&s("days",C)||C<45&&s("month",1)||C<365&&s("months",C/30)||y<1.5&&s("year",1)||s("years",y))+r.suffix};var t=d.dom.querySelectorAll(".comment-item-time");for(var l in t){var u=t[l];if(typeof u==="object"){u.title=new Date(u.getAttribute("datetime"));u.innerHTML=v(u.getAttribute("datetime"))}}setTimeout(d.timeAgo.bind(d),60000)};m.prototype.init=function(){var d=this;if(!d.dom){return}var l="";d.emoji_list.forEach(function(r){l+='<li class="emojione-item" title="'+r.title+'" data-code=":'+r.code+':"><img class="emojione-item-image" src="'+d.opts.emoji_path+r.unicode+'.png" /></li>'});d.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="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="加入讨论……"></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="选择表情">\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">'+l+'</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="上传图片">\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="重置访客信息">\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="名字(必填)" autocomplete="name"><input class="comment-form-input comment-form-email" type="email" placeholder="邮箱(必填)" autocomplete="email"><input class="comment-form-input comment-form-url" type="url" placeholder="网址(可选)" autocomplete="url"></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>';d.guest=new e(d.dom);d.box=d.dom.querySelector(".comment-box").outerHTML.replace(/<label class="comment-actions-label exit"(.|\n)*<\/label>\n/,"").replace("comment-form-wrapper","comment-form-wrapper editing").replace(/加入讨论……/,"");d.handle={guestReset:d.guest.reset.bind(d.guest),loadMore:d.loadMore.bind(d),post:d.post.bind(d),postThread:d.postThread.bind(d),remove:d.remove.bind(d),show:d.show.bind(d),toggle:d.toggle.bind(d),upload:d.upload.bind(d),verify:d.verify.bind(d),jump:d.jump.bind(d),mention:d.mention.bind(d),keySelect:d.keySelect.bind(d),field:d.field,focus:d.focus,input:d.input};switch(d.opts.mode){case 1:d.disqus();break;case 2:d.getlist();break;case 3:d.getlist();d.disqus();break;default:d.disqus();break}};m.prototype.toggle=function(){var d=this;if(d.stat.current=="disqus"){d.stat.current="idisqus";d.dom.querySelector("#idisqus").style.display="block";d.dom.querySelector("#disqus_thread").style.display="none"}else{d.disqus()}};m.prototype.disqus=function(){var d=this;var r=d.dom.querySelector(".loading-container").dataset.tip;if(d.opts.site!=location.origin){if(d.opts.mode==1){d.getlist()}return}if(!d.stat.disqusLoaded){r="尝试连接 Disqus……";var l=n.createElement("script");l.src="//"+d.opts.forum+".disqus.com/embed.js";l.dataset.timestamp=Date.now();l.onload=function(){d.stat.disqusLoaded=true;r="连接成功,加载 Disqus 评论框……"};l.onerror=function(){if(d.opts.mode==1){r="连接失败,加载简易评论框……";d.getlist()}};var t=new XMLHttpRequest();t.open("GET","//disqus.com/next/config.json?"+Date.now(),true);t.timeout=d.opts.timeout;t.onreadystatechange=function(){if(t.readyState==4&&t.status==200){(n.head||n.body).appendChild(l)}};t.ontimeout=function(){t.abort();if(d.opts.mode==1){r="连接超时,加载简易评论框……";d.getlist()}};t.onerror=function(){if(d.opts.mode==1){r="连接失败,加载简易评论框……";d.getlist()}};t.send()}else{d.stat.current="disqus";d.dom.querySelector("#idisqus").style.display="none";d.dom.querySelector("#disqus_thread").style.display="block"}};m.prototype.count=function(){var d=this;var r=n.querySelectorAll("[data-disqus-url]");var t=r.length;if(t>0){var s=[];for(var l=0;l<t;l++){s[l]=r[l].dataset.disqusUrl.replace(d.opts.site,"")}p(d.opts.api+"/count.php?links="+s.join(","),function(w){var v=JSON.parse(w);var u=v.response;u.forEach(function(z){var y=z.link.replace(d.opts.site,"");var A=y.slice(0,1)!="/"?"/"+y:y;var x=n.querySelector('[data-disqus-url$="'+A+'"]');if(!!x){x.innerHTML=z.posts;x.dataset.disqusCount=z.posts}})},function(){console.log("获取数据失败!")})}};m.prototype.popular=function(){var d=this;if(!!d.opts.popular){p(d.opts.api+"/popular.php",function(t){var s=JSON.parse(t);if(s.code==0){var r=s.response;var l="";r.forEach(function(u){l+='<li><a href="'+u.link.replace(d.opts.site,"")+'" title="'+u.title+'">'+u.title+"</a></li>"});d.opts.popular.innerHTML=l}},function(){console.log("获取数据失败!")})}};m.prototype.getlist=function(){var d=this;d.stat.loading=true;d.dom.querySelector("#idisqus").style.display="block";d.dom.querySelector("#disqus_thread").style.display="none";p(d.opts.api+"/getcomments.php?link="+d.opts.url+(!!d.stat.next?"&cursor="+d.stat.next:""),function(u){var t=JSON.parse(u);if(!t.auth){alert("认证出错,请查看后端配置中,Disqus 帐号密码是否填写有误。")}if(t.code===0){d.stat.offsetTop=n.documentElement.scrollTop||n.body.scrollTop;d.stat.thread=t.thread;d.stat.count=t.posts;d.dom.querySelector("#idisqus").classList.remove("loading");d.dom.querySelector("#comment-link").href=t.link;d.dom.querySelector("#comment-count").innerHTML=d.stat.count+" 条评论";var l=d.dom.querySelector(".comment-loadmore");var s=!!t.response?t.response:[];d.stat.root=[];s.forEach(function(v){d.load(v);if(!v.parent){d.stat.root.unshift(v.id)}});if(t.cursor.hasPrev){d.stat.root.forEach(function(v){d.dom.querySelector(".comment-list").appendChild(d.dom.querySelector("#comment-"+v))})}else{l.addEventListener("click",d.handle.loadMore,false);d.dom.querySelector(".exit").addEventListener("click",d.handle.guestReset,false);d.dom.querySelector(".comment-form-textarea").addEventListener("blur",d.handle.focus,false);d.dom.querySelector(".comment-form-textarea").addEventListener("focus",d.handle.focus,false);d.dom.querySelector(".comment-form-textarea").addEventListener("input",d.handle.input,false);d.dom.querySelector(".comment-form-textarea").addEventListener("keyup",d.handle.mention,false);d.dom.querySelector(".comment-form-email").addEventListener("blur",d.handle.verify,false);d.dom.querySelector(".comment-form-submit").addEventListener("click",d.handle.post,false);d.dom.querySelector(".comment-image-input").addEventListener("change",d.handle.upload,false);a(d.dom.getElementsByClassName("emojione-item"),"click",d.handle.field)}if(t.cursor.hasNext){d.stat.next=t.cursor.next;l.classList.remove("loading")}else{d.stat.next=null;l.classList.add("hide")}if(s.length==0){return}window.scrollTo(0,d.stat.offsetTop);d.timeAgo();if(/^#disqus|^#comment/.test(location.hash)&&!t.cursor.hasPrev&&!d.stat.disqusLoaded){var r=d.dom.querySelector("#idisqus "+location.hash);window.scrollBy(0,r.getBoundingClientRect().top)}d.stat.loading=false;d.stat.loaded=true}else{if(t.code===2){d.create()}}},function(){alert("获取数据失败,请检查服务器设置。")})};m.prototype.load=function(w){var x=this;var u=x.dom.querySelector('.comment-item[data-id="'+w.parent+'"]');var r={username:w.username,name:w.name,avatar:w.avatar};if(!!w.username&&x.stat.users.map(function(y){return y.username}).indexOf(w.username)==-1){x.stat.users.push(r)}var d=!!w.parent?{name:'<a class="comment-item-pname" href="#'+u.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>'+u.dataset.name+"</a>",dom:u.querySelector(".comment-item-children"),insert:"afterbegin"}:{name:"",dom:x.dom.querySelector(".comment-list"),insert:w.id=="preview"||!!w.isPost?"afterbegin":"beforeend"};var l="";if(w.media.length>0){w.media.forEach(function(y){l+='<a class="comment-item-imagelink" target="_blank" href="'+y+'" ><img class="comment-item-image" src="'+y+'"></a>'});l='<div class="comment-item-images">'+l+"</div>"}var s='<li class="comment-item" data-id="'+w.id+'" data-name="'+w.name+'" id="comment-'+w.id+'"><div class="comment-item-body"><a class="comment-item-avatar" href="#comment-'+w.id+'"><img src="'+w.avatar+'"></a><div class="comment-item-main"><div class="comment-item-header"><a class="comment-item-name" title="'+w.name+'" rel="nofollow" target="_blank" href="'+(w.url?w.url:"javascript:;")+'">'+w.name+"</a>"+(w.isMod?'<span class="comment-item-badge">'+x.opts.badge+"</span>":"")+d.name+'<span class="comment-item-bullet"> • </span><time class="comment-item-time" datetime="'+w.createdAt+'"></time></div><div class="comment-item-content">'+w.message+l+'</div><div class="comment-item-footer">'+(!!w.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(!!w.isDeleted){s='<li class="comment-item" data-id="'+w.id+'" id="comment-'+w.id+'" data-name="已删除"><div class="comment-item-body"><a class="comment-item-avatar" href="#comment-'+w.id+'"><img src="'+w.avatar+'"></a><div class="comment-item-main" data-message="此评论已被删除。"></div></div><ul class="comment-item-children"></ul></li>'}if(!!x.dom.querySelector('.comment-item[data-id="'+w.id+'"]')){x.dom.querySelector('.comment-item[data-id="'+w.id+'"]').outerHTML=s}else{d.dom.insertAdjacentHTML(d.insert,s)}if(!w.isDeleted){x.dom.querySelector('.comment-item[data-id="'+w.id+'"] .comment-item-reply').addEventListener("click",x.handle.show,false);x.dom.querySelector('.comment-item[data-id="'+w.id+'"] .comment-item-avatar').addEventListener("click",x.handle.jump,false);if(!!w.parent){x.dom.querySelector('.comment-item[data-id="'+w.id+'"] .comment-item-pname').addEventListener("click",x.handle.jump,false)}}if(!!w.isPost&&!x.stat.editing){var v=x.dom.querySelector('.comment-item[data-id="'+w.id+'"]');v.querySelector(".comment-item-footer").insertAdjacentHTML("beforeend",'<span class="comment-item-tips">页面刷新前,十分钟内可编辑或删除</span>');setTimeout(function(){if(!!v.querySelector(".comment-item-tips")){v.querySelector(".comment-item-tips").outerHTML=""}},5000);var t=setTimeout(function(){if(!!v.querySelector(".comment-item-manage")){v.querySelector(".comment-item-manage").outerHTML=""}},600000);v.querySelector(".comment-item-delete").addEventListener("click",function(A){var y={id:w.id};var z=A.currentTarget;z.innerHTML="删除中";k(x.opts.api+"/removecomment.php",y,function(C){var B=JSON.parse(C);if(B.code===0){if(B.response.isDeleted==true){v.outerHTML=""}else{alert(B.response.message);v.querySelector(".comment-item-manage").outerHTML=""}}else{if(B.code===2){alert(B.response);v.querySelector(".comment-item-manage").outerHTML=""}}},function(){alert("删除出错,请稍后重试")});clearTimeout(t)},false);v.querySelector(".comment-item-edit").addEventListener("click",function(){x.stat.editing=w;x.edit(w)},false)}};m.prototype.loadMore=function(l){var d=this;if(!d.stat.loading){l.currentTarget.classList.add("loading");d.getlist()}};m.prototype.focus=function(d){var l=d.currentTarget.closest(".comment-form-wrapper");l.classList.add("editing");if(l.classList.contains("focus")){l.classList.remove("focus")}else{l.classList.add("focus")}};m.prototype.input=function(r){var d=r.currentTarget.closest(".comment-form");var l=d.querySelector(".comment-form-alert");l.innerHTML=""};m.prototype.mention=function(u){var y=this;var x=u.currentTarget;var d=x.selectionStart;var v=x.value.slice(0,d).lastIndexOf("@");var s=x.value.slice(v,d);var z=y.dom.querySelector(".mention-user");if(s.search(/^@\w+$|^@$/)==0){if(u.keyCode==38||u.keyCode==40){return}var w=y.stat.users.filter(function(A){var B=new RegExp(s.slice(1),"i");return A.username.search(B)>-1});var r=y.getCaretCoord(x);var t="",l="";if(w.length>0){w.forEach(function(B,A){t+='<li class="mention-user-item'+(A==0?" active":"")+'" data-username="'+B.username+'"><img class="mention-user-avatar" src="'+B.avatar+'"><div class="mention-user-username">'+B.username+'</div><div class="mention-user-name">'+B.name+"</div></li>"});if(!!z){z.innerHTML='<ul class="mention-user-list">'+t+"</ul>";z.style.left=r.left+"px";z.style.top=r.top+"px"}else{l='<div class="mention-user" style="left:'+r.left+"px;top:"+r.top+'px"><ul class="mention-user-list">'+t+"</ul></div>";y.dom.querySelector("#idisqus").insertAdjacentHTML("beforeend",l)}a(y.dom.getElementsByClassName("mention-user-item"),"mouseover",function(){y.dom.querySelector(".mention-user-item.active").classList.remove("active");this.classList.add("active")});a(y.dom.getElementsByClassName("mention-user-item"),"click",function(){var A="@"+this.dataset.username+" ";x.value=x.value.slice(0,v)+A+x.value.slice(d);y.dom.querySelector(".mention-user").outerHTML="";x.focus();x.setSelectionRange(v+A.length,v+A.length);x.removeEventListener("keydown",y.handle.keySelect,false)});x.addEventListener("keydown",y.handle.keySelect,false)}else{if(!!z){z.outerHTML="";x.removeEventListener("keydown",y.handle.keySelect,false)}}}else{if(!!z){z.outerHTML="";x.removeEventListener("keydown",y.handle.keySelect,false)}}};m.prototype.getCaretCoord=function(l){var r=this;var t=l.selectionEnd,v=n.createElement("div"),s=n.createElement("span"),d=getComputedStyle(l);[].forEach.call(d,function(w){v.style[w]=d[w]});v.style.position="absolute";r.dom.appendChild(v);v.textContent=l.value.substr(0,t);s.textContent=l.value.substr(t)||".";v.appendChild(s);var u={top:l.offsetTop-l.scrollTop+s.offsetTop+parseFloat(d.lineHeight),left:l.offsetLeft-l.scrollLeft+s.offsetLeft};r.dom.removeChild(v);return u};m.prototype.keySelect=function(s){var w=this;var v=s.currentTarget;var d=v.selectionStart;var u=v.value.slice(0,d).lastIndexOf("@");var r=v.value.slice(u,d);var x=w.dom.querySelector(".mention-user");var t=w.dom.querySelector(".mention-user-item.active");switch(s.keyCode){case 13:var l="@"+t.dataset.username+" ";v.value=v.value.slice(0,u)+l+v.value.slice(d);v.setSelectionRange(u+l.length,u+l.length);w.dom.querySelector(".mention-user").outerHTML="";v.removeEventListener("keydown",w.handle.keySelect,false);s.preventDefault();break;case 38:if(!!t.previousSibling){t.previousSibling.classList.add("active");t.classList.remove("active")}s.preventDefault();break;case 40:if(!!t.nextSibling){t.nextSibling.classList.add("active");t.classList.remove("active")}s.preventDefault();break;default:break}};m.prototype.jump=function(t){var d=this;var s=t.currentTarget;var r=g(s.href).hash;var l=d.dom.querySelector("#idisqus "+r);history.replaceState(undefined,undefined,r);window.scrollBy(0,l.getBoundingClientRect().top);t.preventDefault()};m.prototype.field=function(t){var s=t.currentTarget;var r=s.closest(".comment-form");var d=r.querySelector(".comment-form-textarea");var u=d.selectionStart;var l=u==0?s.dataset.code+" ":" "+s.dataset.code+" ";d.value=d.value.slice(0,u)+l+d.value.slice(u);d.focus();d.setSelectionRange(u+l.length,u+l.length)};m.prototype.show=function(w){var l=this;var v=w.currentTarget;var t=v.closest(".comment-item");var s=l.dom.querySelector(".comment-item .comment-box:not([data-current-id])");if(s){var u=s.closest(".comment-item");var r=u.querySelector(".comment-item-cancel");r.outerHTML=r.outerHTML.replace("cancel","reply");s.outerHTML=""}if(v.className=="comment-item-reply"){v.outerHTML=v.outerHTML.replace("reply","cancel");var d=l.box.replace(/emoji-input/g,"emoji-input-"+t.dataset.id).replace(/upload-input/g,"upload-input-"+t.dataset.id);t.querySelector(".comment-item-children").insertAdjacentHTML("beforebegin",d);l.guest.init();t.querySelector(".comment-form-textarea").addEventListener("blur",l.handle.focus,false);t.querySelector(".comment-form-textarea").addEventListener("focus",l.handle.focus,false);t.querySelector(".comment-form-textarea").addEventListener("keyup",l.handle.mention,false);t.querySelector(".comment-form-textarea").addEventListener("input",l.handle.input,false);t.querySelector(".comment-form-email").addEventListener("blur",l.handle.verify,false);t.querySelector(".comment-form-submit").addEventListener("click",l.handle.post,false);t.querySelector(".comment-image-input").addEventListener("change",l.handle.upload,false);a(t.getElementsByClassName("emojione-item"),"click",l.handle.field);t.querySelector(".comment-form-textarea").focus()}a(l.dom.getElementsByClassName("comment-item-reply"),"click",l.handle.show);a(l.dom.getElementsByClassName("comment-item-cancel"),"click",l.handle.show)};m.prototype.verify=function(u){var r=this;var s=u.currentTarget.closest(".comment-box");var l=s.querySelector(".comment-avatar-image");var d=s.querySelector(".comment-form-email");var t=s.querySelector(".comment-form-alert");if(/^[A-Z0-9._%+-]+@[A-Z0-9.-]+\.[A-Z]{2,}$/i.test(d.value)){p(r.opts.api+"/getgravatar.php?email="+d.value,function(v){if(v=="false"){r.errorTips("您所填写的邮箱地址有误。",d)}else{l.src=v}},function(){})}};m.prototype.upload=function(y){var A=this;var v=y.currentTarget;var t=v.closest(".comment-form");var l=t.querySelector(".comment-image-progress");var x=t.querySelector(".comment-image-loaded");var r=t.querySelector(".comment-form-wrapper");var s=t.querySelector(".comment-form-alert");s.innerHTML="";if(v.files.length===0){return}var B=v.files[0].size;if(B>5000000){s.innerHTML="请选择 5M 以下图片。";setTimeout(function(){s.innerHTML=""},3000);return}if(A.stat.imageSize.indexOf(B)==-1){l.style.width="80px"}else{s.innerHTML="请勿选择已存在的图片。";setTimeout(function(){s.innerHTML=""},3000);return}r.classList.add("expanded");var w=new FormData();w.append("file",v.files[0]);var d=v.files[0].name;var z;var u=new XMLHttpRequest();u.onreadystatechange=function(){if(u.readyState==4&&u.status==200){var D=JSON.parse(u.responseText);if(D.code==0){A.stat.imageSize.push(B);var C=D.response[d].url;var E=new Image();E.src=C;E.onload=function(){z.innerHTML='<img class="comment-image-object" src="'+C+'">';z.dataset.imageUrl=C;z.classList.remove("loading");z.addEventListener("click",A.handle.remove,false)}}else{s.innerHTML="图片上传出错。";z.innerHTML="";if(!!t.getElementsByClassName("comment-image-item").length){r.classList.remove("expanded")}setTimeout(function(){s.innerHTML=""},3000)}}};u.upload.addEventListener("progress",function(C){x.style.width=Math.ceil((C.loaded/C.total)*100)+"%"},false);u.upload.addEventListener("load",function(C){x.style.width=0;l.style.width=0;var D='<li class="comment-image-item loading" data-image-size="'+B+'">\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';t.querySelector(".comment-image-list").insertAdjacentHTML("beforeend",D);z=t.querySelector('[data-image-size="'+B+'"]')},false);u.open("POST",A.opts.api+"/upload.php",true);u.send(w)};m.prototype.remove=function(s){var r=this;var l=s.currentTarget.closest(".comment-image-item");var t=s.currentTarget.closest(".comment-form-wrapper");l.outerHTML="";r.stat.imageSize=[];var d=t.getElementsByClassName("comment-image-item");[].forEach.call(d,function(v,u){r.stat.imageSize[u]=v.dataset.imageSize});if(r.stat.imageSize.length==0){t.classList.remove("expanded")}t.querySelector(".comment-image-input").value=""};m.prototype.errorTips=function(w,s){var d=this;if(d.guest.logged_in=="true"){d.handle.guestReset()}var v=d.dom.querySelector("#idisqus");var u=d.dom.querySelector(".comment-form-error");if(!!u){u.outerHTML=""}var l=s.offsetTop;var r=s.offsetLeft;var t='<div class="comment-form-error" style="top:'+l+"px;left:"+r+'px;">'+w+"</div>";v.insertAdjacentHTML("beforeend",t);setTimeout(function(){var x=d.dom.querySelector(".comment-form-error");if(!!x){x.outerHTML=""}},3000)};m.prototype.post=function(C){var H=this;var E=C.currentTarget.closest(".comment-box[data-current-id]")||C.currentTarget.closest(".comment-item")||C.currentTarget.closest(".comment-box");var t=E.querySelector(".comment-form-textarea").value;var A=!!E.dataset.id?E.dataset.id:"";var B=E.getElementsByClassName("comment-image-item");var s=[];var D="";[].forEach.call(B,function(J,I){s[I]=J.dataset.imageUrl;D+=" "+J.dataset.imageUrl});if(!E.dataset.currentId){var r=E.querySelector(".comment-form-name");var w=E.querySelector(".comment-form-email");var G=E.querySelector(".comment-form-url");var u={name:r.value,email:w.value,url:G.value.replace(/\s/g,""),avatar:E.querySelector(".comment-avatar-image").src};var y=E.querySelector(".comment-form-alert");function F(){setTimeout(function(){y.innerHTML=""},3000)}if(/^\s*$/i.test(u.name)){H.errorTips("名字不能为空。",r);return}if(/^\s*$/i.test(u.email)){H.errorTips("邮箱不能为空。",w);return}if(!/^[A-Z0-9._%+-]+@[A-Z0-9.-]+\.[A-Z]{2,}$/i.test(u.email)){H.errorTips("请正确填写邮箱。",w);return}if(!/^([hH][tT]{2}[pP]:\/\/|[hH][tT]{2}[pP][sS]:\/\/)(([A-Za-z0-9-~]+)\.)+([A-Za-z0-9-~\/])+$|^\s*$/i.test(u.url)){H.errorTips("请正确填写网址。",G);return}H.guest.submit(u);if(!H.stat.message&&!H.stat.mediaHtml){H.box=H.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(!H.guest.name&&!H.guest.email){return}if(s.length==0&&/^\s*$/i.test(t)){y.innerHTML="评论不能为空或空格。";E.querySelector(".comment-form-textarea").focus();return}var d=t;if(!!H.opts.emoji_preview){d=d.replace(/:([-+\w]+):/g,function(J){var K=J.replace(/:/g,"");var I=!!H.eac[K]?'<img class="emojione" width="24" height="24" alt="'+K+'" title=":'+K+':" src="'+H.opts.emoji_path+H.eac[K]+'.png">':J;return I})}else{H.emoji_list.forEach(function(I){d=d.replace(":"+I.code+":",'<img class="emojione" width="24" height="24" src="'+H.opts.emoji_path+I.unicode+'.png" />')})}var z={url:!!H.guest.url?H.guest.url:"",isMod:false,username:null,name:H.guest.name,avatar:H.guest.avatar,id:"preview",parent:A,createdAt:(new Date()).toJSON(),message:"<p>"+d+"</p>",media:s};H.load(z);H.timeAgo();H.stat.message=t;H.stat.mediaHtml=E.querySelector(".comment-image-list").innerHTML;if(A){E.querySelector(".comment-item-cancel").click()}else{E.querySelector(".comment-form-textarea").value="";E.querySelector(".comment-image-list").innerHTML="";E.querySelector(".comment-form-wrapper").classList.remove("expanded","editing")}}var v=t.match(/@\w+/g);if(!!v){v=v.filter(function(I){return H.stat.users.map(function(J){return J.username}).indexOf(I.slice(1))>-1});if(v.length>0){var x=new RegExp("("+v.join("|")+")","g");t=t.replace(x,"$1:disqus")}}t+=D;if(!!E.dataset.currentId){var l={id:E.dataset.currentId,message:t,};k(H.opts.api+"/updatecomment.php",l,function(K){var J=JSON.parse(K);if(J.code===0){H.stat.message=null;H.stat.mediaHtml=null;var I=J.response;H.load(I);H.timeAgo();H.stat.editing=false}else{H.load(H.stat.editing);H.timeAgo();H.stat.editing=false}},function(){H.load(H.stat.editing);H.timeAgo();H.stat.editing=false})}else{var l={thread:H.stat.thread,parent:A,message:t,name:H.guest.name,email:H.guest.email,url:H.guest.url,link:H.opts.url,title:H.opts.title};k(H.opts.api+"/postcomment.php",l,function(K){var J=JSON.parse(K);if(J.code===0){H.dom.querySelector('.comment-item[data-id="preview"]').outerHTML="";H.stat.count+=1;H.dom.querySelector("#comment-count").innerHTML=H.stat.count+" 条评论";var I=J.response;I.isPost=true;H.load(I);H.timeAgo()}else{if(J.code===2){y.innerHTML=J.response;H.dom.querySelector('.comment-item[data-id="preview"]').outerHTML="";H.reEdit(E);if(J.response.indexOf("author")>-1){H.handle.guestReset()}}}},function(){y.innerHTML="提交出错,请稍后重试。";F();H.dom.querySelector('.comment-item[data-id="preview"]').outerHTML="";H.reEdit(E)})}};m.prototype.reEdit=function(l){var d=this;if(!!l.dataset.id){l.querySelector(".comment-item-reply").click()}else{l.querySelector(".comment-form-wrapper").classList.add("editing")}if(!!d.stat.message){l.querySelector(".comment-form-textarea").value=d.stat.message}if(!!d.stat.mediaHtml){l.querySelector(".comment-form-wrapper").classList.add("expanded");l.querySelector(".comment-image-list").innerHTML=d.stat.mediaHtml;a(l.getElementsByClassName("comment-image-item"),"click",d.handle.remove)}};m.prototype.edit=function(r){var l=this;var d=l.box.replace("comment-box","comment-box comment-box-"+r.id).replace(/emoji-input/g,"emoji-input-"+r.id).replace(/upload-input/g,"upload-input-"+r.id);var t=l.dom.querySelector('.comment-item[data-id="'+r.id+'"] .comment-item-body');t.outerHTML=d;l.guest.init();var s=l.dom.querySelector(".comment-box-"+r.id);s.dataset.currentId=r.id;s.querySelector(".comment-form-textarea").addEventListener("blur",l.handle.focus,false);s.querySelector(".comment-form-textarea").addEventListener("focus",l.handle.focus,false);s.querySelector(".comment-form-textarea").addEventListener("input",l.handle.input,false);s.querySelector(".comment-form-textarea").addEventListener("keyup",l.handle.mention,false);s.querySelector(".comment-form-email").addEventListener("blur",l.handle.verify,false);s.querySelector(".comment-form-submit").addEventListener("click",l.handle.post,false);s.querySelector(".comment-image-input").addEventListener("change",l.handle.upload,false);a(s.getElementsByClassName("emojione-item"),"click",l.handle.field);s.querySelector(".comment-form-textarea").focus();s.querySelector(".comment-actions-form").insertAdjacentHTML("afterbegin",'<a class="comment-form-cancel" href="javascript:;">取消</a>');s.querySelector(".comment-form-cancel").addEventListener("click",function(){l.stat.editing=false;l.load(r);l.timeAgo()},false);if(!!l.stat.message){s.querySelector(".comment-form-textarea").value=l.stat.message}if(!!l.stat.mediaHtml){s.querySelector(".comment-form-wrapper").classList.add("expanded");s.querySelector(".comment-image-list").innerHTML=l.stat.mediaHtml;a(s.getElementsByClassName("comment-image-item"),"click",l.handle.remove)}};m.prototype.create=function(){var l=this;if(!!l.opts.auto){l.dom.querySelector(".loading-container").dataset.tip="正在创建 Thread……";var d={url:l.opts.link,identifier:l.opts.identifier,title:l.opts.title,slug:l.opts.slug,message:l.opts.desc};l.postThread(d);return}l.dom.querySelector("#idisqus").classList.remove("loading");l.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="'+l.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="'+l.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="'+l.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="'+l.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">'+l.opts.desc+'</textarea></div><button id="thread-submit" class="comment-form-submit">提交</button></div>';l.dom.querySelector("#thread-submit").addEventListener("click",l.handle.postThread,false)};m.prototype.postThread=function(){var l=this;if(!!arguments[0].target){var d={url:l.dom.querySelector("#thread-url").value,identifier:l.dom.querySelector("#thread-identifier").value,title:l.dom.querySelector("#thread-title").value,slug:l.dom.querySelector("#thread-slug").value.replace(/[^A-Za-z0-9_-]+/g,""),message:l.dom.querySelector("#thread-message").value}}else{var d=arguments[0]}k(l.opts.api+"/createthread.php",d,function(s){var r=JSON.parse(s);if(r.code===0){alert("创建 Thread 成功,刷新后便可愉快地评论了!");setTimeout(function(){location.reload()},2000)}else{if(r.code===2){if(r.response.indexOf("A thread already exists with link")>-1){alert(r.response.replace("A thread already exists with link,","已存在此链接的相关 Thread,"));return}if(r.response.indexOf("Invalid URL")>-1){alert("参数错误,无效的'URL'");return}if(r.response.indexOf("Invalid slug")>-1){alert("参数错误,无效的'slug'");return}alert(r.response);return}else{alert(r.response);return}}},function(){alert("创建 Thread 出错,请稍后重试!")})};m.prototype.destroy=function(){var d=this;d.dom.querySelector(".exit").removeEventListener("click",d.handle.guestReset,false);j(d.dom.getElementsByClassName("comment-form-textarea"),"blur",d.handle.focus);j(d.dom.getElementsByClassName("comment-form-textarea"),"focus",d.handle.focus);j(d.dom.getElementsByClassName("comment-form-textarea"),"keyup",d.handle.mention);j(d.dom.getElementsByClassName("comment-form-email"),"blur",d.handle.verify);j(d.dom.getElementsByClassName("comment-form-submit"),"click",d.handle.post);j(d.dom.getElementsByClassName("comment-image-input"),"change",d.handle.upload);j(d.dom.getElementsByClassName("comment-item-reply"),"click",d.handle.show);j(d.dom.getElementsByClassName("comment-loadmore"),"click",d.handle.loadMore);j(d.dom.getElementsByClassName("emojione-item"),"click",d.handle.field);d.dom.innerHTML="";delete d.box;delete d.dom;delete d.emoji_list;delete d.guest;delete d.handle;delete d.opts;delete d.stat};if(typeof require==="function"&&typeof module==="object"&&module&&typeof exports==="object"&&exports){module.exports=m}else{if(typeof define==="function"&&define.amd){define(function(){return m})}else{c.iDisqus=c.iDisqus||m}}})(window||this);