/** * @license almond 0.3.3 Copyright jQuery Foundation and other contributors. * Released under MIT license, http://github.com/requirejs/almond/LICENSE */ /* Copyright (C) 2013 Gregory Schier Copyright (C) 2013 Martin Zimmermann Inspired by http://codepen.io/gschier/pen/GLvAy */ /* * Copyright 2014, Martin Zimmermann . All rights reserved. * Distributed under the MIT license */ !function(){var requirejs,require,define;!function(e){function t(e,t){return x.call(e,t)}function n(e,t){var n,o,i,a,r,s,m,c,d,p,l,u,f=t&&t.split("/"),h=v.map,b=h&&h["*"]||{};if(e){for(e=e.split("/"),r=e.length-1,v.nodeIdCompat&&g.test(e[r])&&(e[r]=e[r].replace(g,"")),"."===e[0].charAt(0)&&f&&(u=f.slice(0,f.length-1),e=u.concat(e)),d=0;d0&&(e.splice(d-1,2),d-=2)}e=e.join("/")}if((f||b)&&h){for(n=e.split("/"),d=n.length;d>0;d-=1){if(o=n.slice(0,d).join("/"),f)for(p=f.length;p>0;p-=1)if((i=h[f.slice(0,p).join("/")])&&(i=i[o])){a=i,s=d;break}if(a)break;!m&&b&&b[o]&&(m=b[o],c=d)}!a&&m&&(a=m,s=c),a&&(n.splice(0,s,a),e=n.join("/"))}return e}function o(t,n){return function(){var o=w.call(arguments,0);return"string"!=typeof o[0]&&1===o.length&&o.push(null),p.apply(e,o.concat([t,n]))}}function i(e){return function(t){return n(t,e)}}function a(e){return function(t){f[e]=t}}function r(n){if(t(h,n)){var o=h[n];delete h[n],b[n]=!0,d.apply(e,o)}if(!t(f,n)&&!t(b,n))throw new Error("No "+n);return f[n]}function s(e){var t,n=e?e.indexOf("!"):-1;return n>-1&&(t=e.substring(0,n),e=e.substring(n+1,e.length)),[t,e]}function m(e){return e?s(e):[]}function c(e){return function(){return v&&v.config&&v.config[e]||{}}}var d,p,l,u,f={},h={},v={},b={},x=Object.prototype.hasOwnProperty,w=[].slice,g=/\.js$/;l=function(e,t){var o,a=s(e),m=a[0],c=t[1];return e=a[1],m&&(m=n(m,c),o=r(m)),m?e=o&&o.normalize?o.normalize(e,i(c)):n(e,c):(e=n(e,c),a=s(e),m=a[0],e=a[1],m&&(o=r(m))),{f:m?m+"!"+e:e,n:e,pr:m,p:o}},u={require:function(e){return o(e)},exports:function(e){var t=f[e];return void 0!==t?t:f[e]={}},module:function(e){return{id:e,uri:"",exports:f[e],config:c(e)}}},d=function(n,i,s,c){var d,p,v,x,w,g,y,k=[],j=typeof s;if(c=c||n,g=m(c),"undefined"===j||"function"===j){for(i=!i.length&&s.length?["require","exports","module"]:i,w=0;w1?1:0]};case"ru":return function(e,t){return t%10==1&&t%100!=11?e[0]:t%10>=2&&t%10<=4&&(t%100<10||t%100>=20)?e[1]:void 0!==e[2]?e[2]:e[1]};case"oc":return function(e,t){return e[t>1?1:0]};case"pl":return function(e,t){return 1===t?e[0]:t%10>=2&&t%10<=4&&(t%100<10||t%100>=20)?e[1]:void 0!==e[2]?e[2]:e[1]};case"sk":return function(e,t){return 1===t?e[0]:2===t||3===t||4===t?e[1]:void 0!==e[2]?e[2]:e[1]};default:return null}},A=e.lang;S(A)||(A="en");var E={bg:t,cs:n,da:o,de:i,el:g,en:a,eo:u,es:y,fa:r,fi:s,fr:m,it:l,hr:c,hu:d,oc:f,pl:h,pt:v,pt_BR:v,ru:p,sk:b,sv:x,nl:w,vi:k,zh:z,zh_CN:z,zh_TW:C},T=S(A),N=function(t){return e[t+"-text-"+A]||E[A][t]||a[t]||"???"};return{lang:A,translate:N,pluralize:function(e,t){var n;return n=N(e),n.indexOf("\n")>-1&&(n=T(n.split("\n"),+t)),n?n.replace("{{ n }}",+t):n}}}),define("app/lib/promise",[],function(){"use strict";var e=function(e){console.log(e)},t=function(){this.success=[],this.errors=[]};t.prototype.then=function(t,n){this.success.push(t),n?this.errors.push(n):this.errors.push(e)};var n=function(){this.promise=new t};n.prototype={promise:t,resolve:function(e){this.promise.success.forEach(function(t){window.setTimeout(function(){t(e)},0)})},reject:function(e){this.promise.errors.forEach(function(t){window.setTimeout(function(){t(e)},0)})}};var o=function(e,n){return e instanceof t?e.then(n):n(e)};return{defer:function(){return new n},when:o}}),define("app/globals",[],function(){"use strict";var e=function(){this.values=[]};return e.prototype.update=function(e){this.values.push((new Date).getTime()-e.getTime())},e.prototype.localTime=function(){return new Date((new Date).getTime()-this.values.reduce(function(e,t){return e+t})/this.values.length)},{offset:new e}}),define("app/api",["app/lib/promise","app/globals"],function(e,t){"use strict";for(var n,o,i=function(){return window.location.pathname},a=document.getElementsByTagName("script"),r=0;r=500?a&&a(s.body):i({status:s.status,body:s.responseText})}var s=new XMLHttpRequest;try{s.open(e,n,!0),s.withCredentials=!0,s.setRequestHeader("Content-Type","application/json"),s.onreadystatechange=function(){4===s.readyState&&r()}}catch(e){(a||console.log)(e.message)}s.send(o)},m=function(e){var t="";for(var n in e)e.hasOwnProperty(n)&&null!==e[n]&&void 0!==e[n]&&(t+=n+"="+encodeURIComponent(e[n])+"&");return t.substring(0,t.length-1)};return{endpoint:o,salt:"Eech7co8Ohloopo9Ol6baimi",create:function(t,n){var a=e.defer();return s("POST",o+"/new?"+m({uri:t||i()}),JSON.stringify(n),function(e){201===e.status||202===e.status?a.resolve(JSON.parse(e.body)):a.reject(e.body)}),a.promise},modify:function(t,n){var i=e.defer();return s("PUT",o+"/id/"+t,JSON.stringify(n),function(e){403===e.status?i.reject("Not authorized to modify this comment!"):200===e.status?i.resolve(JSON.parse(e.body)):i.reject(e.body)}),i.promise},remove:function(t){var n=e.defer();return s("DELETE",o+"/id/"+t,null,function(e){403===e.status?n.reject("Not authorized to remove this comment!"):200===e.status?n.resolve(null===JSON.parse(e.body)):n.reject(e.body)}),n.promise},view:function(t,n){var i=e.defer();return s("GET",o+"/id/"+t+"?"+m({plain:n}),null,function(e){i.resolve(JSON.parse(e.body))}),i.promise},fetch:function(t,n,a,r,c){void 0===n&&(n="inf"),void 0===a&&(a="inf"),void 0===r&&(r=null);var d={uri:t||i(),after:c,parent:r};"inf"!==n&&(d.limit=n),"inf"!==a&&(d.nested_limit=a);var p=e.defer();return s("GET",o+"/?"+m(d),null,function(e){200===e.status?p.resolve(JSON.parse(e.body)):404===e.status?p.resolve({total_replies:0}):p.reject(e.body)}),p.promise},count:function(t){var n=e.defer();return s("POST",o+"/count",JSON.stringify(t),function(e){200===e.status?n.resolve(JSON.parse(e.body)):n.reject(e.body)}),n.promise},like:function(t){var n=e.defer();return s("POST",o+"/id/"+t+"/like",null,function(e){n.resolve(JSON.parse(e.body))}),n.promise},dislike:function(t){var n=e.defer();return s("POST",o+"/id/"+t+"/dislike",null,function(e){n.resolve(JSON.parse(e.body))}),n.promise},feed:function(e){return o+"/feed?"+m({uri:e||i()})},preview:function(t){var n=e.defer();return s("POST",o+"/preview",JSON.stringify({text:t}),function(e){200===e.status?n.resolve(JSON.parse(e.body).text):n.reject(e.body)}),n.promise}}}),define("app/dom",[],function(){"use strict";function e(e){this.obj=e,this.replace=function(t){var o=n.htmlify(t);return e.parentNode.replaceChild(o.obj,e),o},this.prepend=function(t){var o=n.htmlify(t);return e.insertBefore(o.obj,e.firstChild),o},this.append=function(t){var o=n.htmlify(t);return e.appendChild(o.obj),o},this.insertAfter=function(t){var o=n.htmlify(t);return e.parentNode.insertBefore(o.obj,e.nextSibling),o},this.on=function(t,n,o){e.addEventListener(t,function(e){n(e),(void 0===o||o)&&e.preventDefault()})},this.toggle=function(e,n,o){var i=new t(n,o);this.on(e,function(){i.next()})},this.detach=function(){return e.parentNode.removeChild(this.obj),this},this.remove=function(){e.parentNode.removeChild(this.obj)},this.show=function(){e.style.display="block"},this.hide=function(){e.style.display="none"},this.setText=function(t){e.textContent=t},this.setHtml=function(t){e.innerHTML=t},this.blur=function(){e.blur()},this.focus=function(){e.focus()},this.scrollIntoView=function(t){e.scrollIntoView(t)},this.checked=function(){return e.checked},this.setAttribute=function(t,n){e.setAttribute(t,n)},this.getAttribute=function(t){return e.getAttribute(t)},this.classList=e.classList,Object.defineProperties(this,{textContent:{get:function(){return e.textContent},set:function(t){e.textContent=t}},innerHTML:{get:function(){return e.innerHTML},set:function(t){e.innerHTML=t}},value:{get:function(){return e.value},set:function(t){e.value=t}},placeholder:{get:function(){return e.placeholder},set:function(t){e.placeholder=t}}})}var t=function(e,t){this.state=!1,this.next=function(){this.state?(this.state=!1,t(this)):(this.state=!0,e(this))},this.wait=function(){this.state=!this.state}},n=function(t,n,o){void 0===o&&(o=!0),n||(n=window.document),n instanceof e&&(n=n.obj);var i=[].slice.call(n.querySelectorAll(t),0);return 0===i.length?null:1===i.length&&o?new e(i[0]):(i=[].slice.call(i,0),i.map(function(t){return new e(t)}))};return n.htmlify=function(t){if(t instanceof e)return t;if(t instanceof window.Element)return new e(t);var o=n.new("div");return o.innerHTML=t,new e(o.firstChild)},n.new=function(e,t){var n=document.createElement(e.split(".")[0]);return e.split(".").slice(1).forEach(function(e){n.classList.add(e)}),["A","LINK"].indexOf(n.nodeName)>-1&&(n.href="#"),t||0===t||(t=""),["TEXTAREA","INPUT"].indexOf(n.nodeName)>-1?n.value=t:n.textContent=t,n},n.each=function(e,t){Array.prototype.forEach.call(document.getElementsByTagName(e),t)},n}),define("app/utils",["app/i18n"],function(e){"use strict";var t,n=function(e){return(document.cookie.match("(^|; )"+e+"=([^;]*)")||0)[2]},o=function(e,t,n){return n=n||"0",e+="",e.length>=t?e:new Array(t-e.length+1).join(n)+e},i=function(t,n){var o=(t.getTime()-n.getTime())/1e3;(isNaN(o)||o<0)&&(o=0);var i=Math.floor(o/60),a=Math.floor(i/60),r=Math.floor(a/24);return o<=45&&e.translate("date-now")||o<=90&&e.pluralize("date-minute",1)||i<=45&&e.pluralize("date-minute",i)||i<=90&&e.pluralize("date-hour",1)||a<=22&&e.pluralize("date-hour",a)||a<=36&&e.pluralize("date-day",1)||r<=5&&e.pluralize("date-day",r)||r<=8&&e.pluralize("date-week",1)||r<=21&&e.pluralize("date-week",Math.floor(r/7))||r<=45&&e.pluralize("date-month",1)||r<=345&&e.pluralize("date-month",Math.floor(r/30))||r<=547&&e.pluralize("date-year",1)||e.pluralize("date-year",Math.floor(r/365.25))},a={"&":"&","<":"<",">":">",'"':""","'":"'","/":"/"},r=function(e){return String(e).replace(/[&<>"'\/]/g,function(e){return a[e]})},s=function(e){var t=document.createElement("div");return t.innerHTML=e.replace(/

<\/div>/gi,"
").replace(/
/gi,"
").replace(/
/gi,"\n").replace(/ /gi," "),t.textContent.trim()},m=function(e){return e=r(e),e.replace(/\n\n/gi,"

").replace(/\n/gi,"
")};try{localStorage.setItem("x","y"),localStorage.removeItem("x"),t=localStorage}catch(e){t=function(e){return{setItem:function(t,n){e[t]=n},getItem:function(t){return void 0!==e[t]?e[t]:null},removeItem:function(t){delete e[t]}}}({})}return{cookie:n,pad:o,ago:i,text:s,detext:m,localStorageImpl:t}}),function(e){if("object"==typeof exports&&"undefined"!=typeof module)module.exports=e();else if("function"==typeof define&&define.amd)define("libjs-jade-runtime",[],e);else{var t;t="undefined"!=typeof window?window:"undefined"!=typeof global?global:"undefined"!=typeof self?self:this,t.jade=e()}}(function(){return function e(t,n,o){function i(r,s){if(!n[r]){if(!t[r]){var m="function"==typeof require&&require;if(!s&&m)return m(r,!0);if(a)return a(r,!0);var c=new Error("Cannot find module '"+r+"'");throw c.code="MODULE_NOT_FOUND",c}var d=n[r]={exports:{}};t[r][0].call(d.exports,function(e){var n=t[r][1][e];return i(n||e)},d,d.exports,e,t,n,o)}return n[r].exports}for(var a="function"==typeof require&&require,r=0;r":">",'"':"""},m=/[&<>"]/g;n.escape=r,n.rethrow=function t(n,o,i,a){if(!(n instanceof Error))throw n;if(!("undefined"==typeof window&&o||a))throw n.message+=" on line "+i,n;try{a=a||e("fs").readFileSync(o,"utf8")}catch(e){t(n,null,i)}var r=3,s=a.split("\n"),m=Math.max(i-r,0),c=Math.min(s.length,i+r),r=s.slice(m,c).map(function(e,t){var n=t+m+1;return(n==i?" > ":" ")+n+"| "+e}).join("\n");throw n.path=o,n.message=(o||"Jade")+":"+i+"\n"+r+"\n\n"+n.message,n},n.DebugItem=function(e,t){this.lineno=e,this.filename=t}},{fs:2}],2:[function(e,t,n){},{}]},{},[1])(1)}),define("jade",{load:function(e){throw new Error("Dynamic load not allowed: "+e)}}),define("jade!app/text/postbox",function(){var e=function(e){return function(t){var n,o=[],i=t||{};return function(t,i,a,r){o.push('
'+e.escape(null==(n=a("postbox-text"))?"":n)+'

")}.call(this,"author"in i?i.author:"undefined"!=typeof author?author:void 0,"email"in i?i.email:"undefined"!=typeof email?email:void 0,"i18n"in i?i.i18n:"undefined"!=typeof i18n?i18n:void 0,"website"in i?i.website:"undefined"!=typeof website?website:void 0),o.join("")}};return e.compiled=!0,e}),define("jade!app/text/comment",function(){var e=function(e){return function(t){var n,o=[],i=t||{};return function(t,i,a,r,s,m,c){o.push("'),a.gravatar&&o.push('
"),a.avatar&&o.push('
"),o.push('
'),t(i.website)?o.push("'+e.escape(null==(n=t(i.author)?i.author:m("comment-anonymous"))?"":n)+""):o.push(''+e.escape(null==(n=t(i.author)?i.author:m("comment-anonymous"))?"":n)+""),o.push(''+e.escape(null==(n=2==i.mode?m("comment-queued"):4==i.mode?m("comment-deleted"):"")?"":n)+'
'),4==i.mode?o.push("

 

"):o.push(null==(n=i.text)?"":n),o.push('
')}.call(this,"bool"in i?i.bool:"undefined"!=typeof bool?bool:void 0,"comment"in i?i.comment:"undefined"!=typeof comment?comment:void 0,"conf"in i?i.conf:"undefined"!=typeof conf?conf:void 0,"datetime"in i?i.datetime:"undefined"!=typeof datetime?datetime:void 0,"humanize"in i?i.humanize:"undefined"!=typeof humanize?humanize:void 0,"i18n"in i?i.i18n:"undefined"!=typeof i18n?i18n:void 0,"svg"in i?i.svg:"undefined"!=typeof svg?svg:void 0),o.join("")}};return e.compiled=!0,e}),define("jade!app/text/comment-loader",function(){var e=function(e){return function(t){var n,o=[],i=t||{};return function(t,i){o.push("'+e.escape(null==(n=i("comment-hidden",t.hidden_replies))?"":n)+"
")}.call(this,"comment"in i?i.comment:"undefined"!=typeof comment?comment:void 0,"pluralize"in i?i.pluralize:"undefined"!=typeof pluralize?pluralize:void 0),o.join("")}};return e.compiled=!0,e}),define("app/jade",["libjs-jade-runtime","app/utils","jade!app/text/postbox","jade!app/text/comment","jade!app/text/comment-loader"],function(runtime,utils,tt_postbox,tt_comment,tt_comment_loader){"use strict";var globals={},templates={},load=function(name,js){templates[name]=function(jade){var fn;return js.compiled?js(jade):(eval("fn = "+js),fn)}(runtime)},set=function(e,t){globals[e]=t};return load("postbox",tt_postbox),load("comment",tt_comment),load("comment-loader",tt_comment_loader),set("bool",function(e){return!!e}),set("humanize",function(e){return"object"!=typeof e&&(e=new Date(1e3*parseInt(e,10))),e.toString()}),set("datetime",function(e){return"object"!=typeof e&&(e=new Date(1e3*parseInt(e,10))),[e.getUTCFullYear(),utils.pad(e.getUTCMonth(),2),utils.pad(e.getUTCDay(),2)].join("-")+"T"+[utils.pad(e.getUTCHours(),2),utils.pad(e.getUTCMinutes(),2),utils.pad(e.getUTCSeconds(),2)].join(":")+"Z"}),{set:set,render:function(e,t){var n;if(!templates[e])throw new Error("Template not found: '"+e+"'");t=t||{};var o=[];for(var i in t)t.hasOwnProperty(i)&&!globals.hasOwnProperty(i)&&(o.push(i),globals[i]=t[i]);n=templates[e](globals);for(var a=0;a=t?e:new Array(t-e.length+1).join("0")+e},o=function(e,t,n,o,i,a){var r=document.createElementNS("http://www.w3.org/2000/svg","rect");r.setAttribute("x",o+t*i),r.setAttribute("y",o+n*i),r.setAttribute("width",i),r.setAttribute("height",i),r.setAttribute("style","fill: "+a),e.appendChild(r)},i=function(i,a,r){var s=document.createElementNS("http://www.w3.org/2000/svg","svg");return s.setAttribute("version","1.1"),s.setAttribute("viewBox","0 0 "+r+" "+r),s.setAttribute("preserveAspectRatio","xMinYMin meet"),s.setAttribute("shape-rendering","crispEdges"),o(s,0,0,0,r+2*a,t["avatar-bg"]),null===typeof i?s:(e.when(i,function(e){var i=n((parseInt(e.substr(-16),16)%Math.pow(2,18)).toString(2),18),r=0;s.setAttribute("data-hash",e);for(var m=parseInt(i.substring(i.length-3,i.length),2),c=t["avatar-fg"][m%t["avatar-fg"].length],d=0;d0?e(".notification-section",m).show():e(".notification-section",m).hide()};e("[name='email']",m).on("input",c),c(),n["require-email"]&&e("[name='email']",m).setAttribute("placeholder",e("[name='email']",m).getAttribute("placeholder").replace(/ \(.*\)/,"")),n["require-author"]&&(e("[name='author']",m).placeholder=e("[name='author']",m).placeholder.replace(/ \(.*\)/,"")),e("[name='preview']",m).on("click",function(){o.preview(t.text(e(".textarea",m).innerHTML)).then(function(t){e(".preview .text",m).innerHTML=t,m.classList.add("preview-mode")})});var p=function(){e(".preview .text",m).innerHTML="",m.classList.remove("preview-mode")};return e("[name='edit']",m).on("click",p),e(".preview",m).on("click",p),e("[type=submit]",m).on("click",function(){if(p(),m.validate()){var n=e("[name=author]",m).value||null,i=e("[name=email]",m).value||null,r=e("[name=website]",m).value||null;s.setItem("author",JSON.stringify(n)),s.setItem("email",JSON.stringify(i)),s.setItem("website",JSON.stringify(r)),o.create(e("#isso-thread").getAttribute("data-isso-id"),{author:n,email:i,website:r,text:t.text(e(".textarea",m).innerHTML),parent:a||null,title:e("#isso-thread").getAttribute("data-title")||null,notification:e("[name=notification]",m).checked()?1:0}).then(function(t){e(".textarea",m).innerHTML="",e(".textarea",m).blur(),d(t,!0),null!==a&&m.onsuccess()})}}),r.editorify(e(".textarea",m)),m},c=function(t,a){var r;null===t.id?(r=e("#isso-root"),t.name="null"):(r=e("#isso-"+t.id+" > .text-wrapper > .isso-follow-up"),t.name=t.id);var s=e.htmlify(i.render("comment-loader",{comment:t}));r.append(s),e("a.load_hidden",s).on("click",function(){s.remove(),o.fetch(e("#isso-thread").getAttribute("data-isso-id"),n["reveal-on-click"],n["max-comments-nested"],t.id,a).then(function(e){if(0!==e.total_replies){var t=0;e.replies.forEach(function(e){d(e,!1),e.created>t&&(t=e.created)}),e.hidden_replies>0&&c(e,t)}},function(e){console.log(e)})})},d=function(p,l){var u=e.htmlify(i.render("comment",{comment:p})),f=function(){e(".permalink > time",u).textContent=t.ago(s.offset.localTime(),new Date(1e3*parseInt(p.created,10))),setTimeout(f,6e4)};f(),n.avatar&&e("div.avatar > svg",u).replace(r.identicons.generate(p.hash,4,48));var h;h=e(null===p.parent?"#isso-root":"#isso-"+p.parent+" > .text-wrapper > .isso-follow-up"),h.append(u),l&&u.scrollIntoView();var v=e("#isso-"+p.id+" > .text-wrapper > .isso-comment-footer"),b=e("#isso-"+p.id+" > .text-wrapper > .isso-comment-header"),x=e("#isso-"+p.id+" > .text-wrapper > .text"),w=null;if(e("a.reply",v).toggle("click",function(t){w=v.insertAfter(new m(null===p.parent?p.id:p.parent)),w.onsuccess=function(){t.next()},e(".textarea",w).focus(),e("a.reply",v).textContent=a.translate("comment-close")},function(){w.remove(),e("a.reply",v).textContent=a.translate("comment-reply")}),n.vote){var g=n["vote-levels"];"string"==typeof g&&(g=g.split(","));var y=function(t){var n=e("span.votes",v);if(null===n?v.prepend(e.new("span.votes",t)):n.textContent=t,t?u.classList.remove("isso-no-votes"):u.classList.add("isso-no-votes"),g)for(var o=!0,i=0;i<=g.length;i++)o&&(i>=g.length||t 

",e("a.edit",v).remove(),e("a.delete",v).remove()),t.textContent=a.translate("comment-delete")})});var k=function(n){t.cookie("isso-"+p.id)?setTimeout(function(){k(n)},15e3):null!==e(n,v)&&e(n,v).remove()};k("a.edit"),k("a.delete");var j=function(e){t.cookie("isso-"+p.id)?setTimeout(function(){j(e)},15e3):v.append(e)};if(!n["reply-to-self"]&&t.cookie("isso-"+p.id)&&j(e("a.reply",v).detach()),p.hasOwnProperty("replies")){var z=0;p.replies.forEach(function(e){d(e,!1),e.created>z&&(z=e.created)}),p.hidden_replies>0&&c(p,z)}};return{insert:d,insert_loader:c,Postbox:m}}),define("app/count",["app/api","app/dom","app/i18n"],function(e,t,n){return function(){var o={};t.each("a",function(e){if(e.href.match&&e.href.match(/#isso-thread$/)){var t=e.getAttribute("data-isso-id")||e.href.match(/^(.+)#isso-thread$/)[1].replace(/^.*\/\/[^\/]+/,"");t in o?o[t].push(e):o[t]=[e]}});var i=Object.keys(o);e.count(i).then(function(e){for(var t in o)if(o.hasOwnProperty(t))for(var a=i.indexOf(t),r=0;r h4 {\n color: #555;\n font-weight: bold;\n}\n#isso-thread > .isso-feedlink {\n float: right;\n padding-left: 1em;\n}\n#isso-thread > .isso-feedlink > a {\n font-size: 0.8em;\n vertical-align: bottom;\n}\n#isso-thread .textarea {\n min-height: 58px;\n outline: 0;\n}\n#isso-thread .textarea.placeholder {\n color: #757575;\n}\n\n#isso-root .isso-comment {\n max-width: 68em;\n padding-top: 0.95em;\n margin: 0.95em auto;\n}\n#isso-root .preview .isso-comment {\n padding-top: 0;\n margin: 0;\n}\n#isso-root .isso-comment:not(:first-of-type),\n.isso-follow-up .isso-comment {\n border-top: 1px solid rgba(0, 0, 0, 0.1);\n}\n.isso-comment > div.avatar {\n display: block;\n float: left;\n width: 7%;\n margin: 3px 15px 0 0;\n}\n.isso-comment > div.avatar > svg {\n max-width: 48px;\n max-height: 48px;\n border: 1px solid rgba(0, 0, 0, 0.2);\n border-radius: 3px;\n box-shadow: 0 1px 2px rgba(0, 0, 0, 0.1);\n}\n.isso-comment > div.text-wrapper {\n display: block;\n}\n.isso-comment .isso-follow-up {\n padding-left: calc(7% + 20px);\n}\n.isso-comment > div.text-wrapper > .isso-comment-header, .isso-comment > div.text-wrapper > .isso-comment-footer {\n font-size: 0.95em;\n}\n.isso-comment > div.text-wrapper > .isso-comment-header {\n font-size: 0.85em;\n}\n.isso-comment > div.text-wrapper > .isso-comment-header .spacer {\n padding: 0 6px;\n}\n.isso-comment > div.text-wrapper > .isso-comment-header .spacer,\n.isso-comment > div.text-wrapper > .isso-comment-header a.permalink,\n.isso-comment > div.text-wrapper > .isso-comment-header .note,\n.isso-comment > div.text-wrapper > .isso-comment-header a.parent {\n color: gray !important;\n font-weight: normal;\n text-shadow: none !important;\n}\n.isso-comment > div.text-wrapper > .isso-comment-header .spacer:hover,\n.isso-comment > div.text-wrapper > .isso-comment-header a.permalink:hover,\n.isso-comment > div.text-wrapper > .isso-comment-header .note:hover,\n.isso-comment > div.text-wrapper > .isso-comment-header a.parent:hover {\n color: #606060 !important;\n}\n.isso-comment > div.text-wrapper > .isso-comment-header .note {\n float: right;\n}\n.isso-comment > div.text-wrapper > .isso-comment-header .author {\n font-weight: bold;\n color: #555;\n}\n.isso-comment > div.text-wrapper > .textarea-wrapper .textarea,\n.isso-comment > div.text-wrapper > .textarea-wrapper .preview {\n margin-top: 0.2em;\n}\n.isso-comment > div.text-wrapper > div.text p {\n margin-top: 0.2em;\n}\n.isso-comment > div.text-wrapper > div.text p:last-child {\n margin-bottom: 0.2em;\n}\n.isso-comment > div.text-wrapper > div.text h1,\n.isso-comment > div.text-wrapper > div.text h2,\n.isso-comment > div.text-wrapper > div.text h3,\n.isso-comment > div.text-wrapper > div.text h4,\n.isso-comment > div.text-wrapper > div.text h5,\n.isso-comment > div.text-wrapper > div.text h6 {\n font-size: 130%;\n font-weight: bold;\n}\n.isso-comment > div.text-wrapper > div.textarea-wrapper .textarea,\n.isso-comment > div.text-wrapper > div.textarea-wrapper .preview {\n width: 100%;\n border: 1px solid #f0f0f0;\n border-radius: 2px;\n box-shadow: 0 0 2px #888;\n}\n.isso-comment > div.text-wrapper > .isso-comment-footer {\n font-size: 0.80em;\n color: gray !important;\n clear: left;\n}\n.isso-feedlink,\n.isso-comment > div.text-wrapper > .isso-comment-footer a {\n font-weight: bold;\n text-decoration: none;\n}\n.isso-feedlink:hover,\n.isso-comment > div.text-wrapper > .isso-comment-footer a:hover {\n color: #111111 !important;\n text-shadow: #aaaaaa 0 0 1px !important;\n}\n.isso-comment > div.text-wrapper > .isso-comment-footer > a {\n position: relative;\n top: .2em;\n}\n.isso-comment > div.text-wrapper > .isso-comment-footer > a + a {\n padding-left: 1em;\n}\n.isso-comment > div.text-wrapper > .isso-comment-footer .votes {\n color: gray;\n}\n.isso-comment > div.text-wrapper > .isso-comment-footer .upvote svg,\n.isso-comment > div.text-wrapper > .isso-comment-footer .downvote svg {\n position: relative;\n top: .2em;\n}\n.isso-comment .isso-postbox {\n margin-top: 0.8em;\n}\n.isso-comment.isso-no-votes > * > .isso-comment-footer span.votes {\n display: none;\n}\n\n.isso-postbox {\n max-width: 68em;\n margin: 0 auto 2em;\n clear: right;\n}\n.isso-postbox > .form-wrapper {\n display: block;\n padding: 0;\n}\n.isso-postbox > .form-wrapper > .auth-section,\n.isso-postbox > .form-wrapper > .auth-section .post-action {\n display: block;\n}\n.isso-postbox > .form-wrapper .textarea,\n.isso-postbox > .form-wrapper .preview {\n margin: 0 0 .3em;\n padding: .4em .8em;\n border-radius: 3px;\n background-color: #fff;\n border: 1px solid rgba(0, 0, 0, 0.2);\n box-shadow: 0 1px 2px rgba(0, 0, 0, 0.1);\n}\n.isso-postbox > .form-wrapper input[type=checkbox] {\n vertical-align: middle;\n position: relative;\n bottom: 1px;\n margin-left: 0;\n}\n.isso-postbox > .form-wrapper .notification-section {\n font-size: 0.90em;\n padding-top: .3em;\n}\n#isso-thread .textarea:focus,\n#isso-thread input:focus {\n border-color: rgba(0, 0, 0, 0.8);\n}\n.isso-postbox > .form-wrapper > .auth-section .input-wrapper {\n display: inline-block;\n position: relative;\n max-width: 25%;\n margin: 0;\n}\n.isso-postbox > .form-wrapper > .auth-section .input-wrapper input {\n padding: .3em 10px;\n max-width: 100%;\n border-radius: 3px;\n background-color: #fff;\n line-height: 1.4em;\n border: 1px solid rgba(0, 0, 0, 0.2);\n box-shadow: 0 1px 2px rgba(0, 0, 0, 0.1);\n}\n.isso-postbox > .form-wrapper > .auth-section .post-action {\n display: inline-block;\n float: right;\n margin: 0 0 0 5px;\n}\n.isso-postbox > .form-wrapper > .auth-section .post-action > input {\n padding: calc(.3em - 1px);\n border-radius: 2px;\n border: 1px solid #CCC;\n background-color: #DDD;\n cursor: pointer;\n outline: 0;\n line-height: 1.4em;\n box-shadow: 0 1px 2px rgba(0, 0, 0, 0.1);\n}\n.isso-postbox > .form-wrapper > .auth-section .post-action > input:hover {\n background-color: #CCC;\n}\n.isso-postbox > .form-wrapper > .auth-section .post-action > input:active {\n background-color: #BBB;\n}\n.isso-postbox > .form-wrapper .preview,\n.isso-postbox > .form-wrapper input[name="edit"],\n.isso-postbox.preview-mode > .form-wrapper input[name="preview"],\n.isso-postbox.preview-mode > .form-wrapper .textarea {\n display: none;\n}\n.isso-postbox.preview-mode > .form-wrapper .preview {\n display: block;\n}\n.isso-postbox.preview-mode > .form-wrapper input[name="edit"] {\n display: inline;\n}\n.isso-postbox > .form-wrapper .preview {\n background-color: #f8f8f8;\n background: repeating-linear-gradient(\n -45deg,\n #f8f8f8,\n #f8f8f8 10px,\n #fff 10px,\n #fff 20px\n );\n}\n.isso-postbox > .form-wrapper > .notification-section {\n display: none;\n padding-bottom: 10px;\n}\n@media screen and (max-width:600px) {\n .isso-postbox > .form-wrapper > .auth-section .input-wrapper {\n display: block;\n max-width: 100%;\n margin: 0 0 .3em;\n }\n .isso-postbox > .form-wrapper > .auth-section .input-wrapper input {\n width: 100%;\n }\n}\n'}),define("app/text/css",["text!../../../css/isso.css"],function(e){return{inline:e}}),define("text!app/text/arrow-down.svg",[],function(){return'\x3c!-- Generator: IcoMoon.io --\x3e\n \n \n \n \n\n'}),define("text!app/text/arrow-up.svg",[],function(){return'\x3c!-- Generator: IcoMoon.io --\x3e\n \n \n \n \n\n'}),define("app/text/svg",["text!./arrow-down.svg","text!./arrow-up.svg"],function(e,t){return{"arrow-down":e,"arrow-up":t}}),require(["app/lib/ready","app/config","app/i18n","app/api","app/isso","app/count","app/dom","app/text/css","app/text/svg","app/jade"],function(e,t,n,o,i,a,r,s,m,c){"use strict";function d(){if(l=r("#isso-thread"),u=r.new("h4"),t.css&&null===r("style#isso-style")){var e=r.new("style");e.id="isso-style",e.type="text/css",e.textContent=s.inline,r("head").append(e)}if(a(),null===l)return console.log("abort, #isso-thread is missing");if(t.feed){var m=r.new("a",n.translate("atom-feed")),c=r.new("span.isso-feedlink");m.href=o.feed(l.getAttribute("data-isso-id")),c.appendChild(m),l.append(c)}l.append(u),l.append(new i.Postbox(null)),l.append('
')}function p(){0!=r("#isso-root").length&&(r("#isso-root").textContent="",o.fetch(l.getAttribute("data-isso-id")||location.pathname,t["max-comments-top"],t["max-comments-nested"]).then(function(e){if(0===e.total_replies)return void(u.textContent=n.translate("no-comments"));var t=0,o=e.total_replies;e.replies.forEach(function(e){i.insert(e,!1),e.created>t&&(t=e.created),o+=e.total_replies}),u.textContent=n.pluralize("num-comments",o),e.hidden_replies>0&&i.insert_loader(e,t),window.location.hash.length>0&&window.location.hash.match("^#isso-[0-9]+$")&&r(window.location.hash).scrollIntoView()},function(e){console.log(e)}))}c.set("conf",t),c.set("i18n",n.translate),c.set("pluralize",n.pluralize),c.set("svg",m);var l,u;e(function(){d(),p()}),window.Isso={init:d,fetchComments:p}}),define("embed",function(){})}();