/**
* @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 <gschier1990@gmail.com> Copyright (C) 2013 Martin Zimmermann <info@posativ.org> Inspired by http://codepen.io/gschier/pen/GLvAy
*/
/*
* Copyright 2014, Martin Zimmermann <info@posativ.org>. 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,a,i,r,s,m,c,d,l,u,p,f=t&&t.split(“/”),h=v.map,b=h&&h||{};if(e){for(e=e.split(“/”),r=e.length-1,v.nodeIdCompat&&w.test(e)&&(e=e.replace(w,“”)),“.”===e.charAt(0)&&f&&(p=f.slice(0,f.length-1),e=p.concat(e)),d=0;dt
”?“+m({plain:n}),null,function(e){a.resolve(JSON.parse(e.body))}),a.promise},fetch:function(t,n,i,r,c){void 0===n&&(n=”inf“),void 0===i&&(i=”inf“),void 0===r&&(r=null);var d={uri:t||a,after:c,parent:r};”inf“!==n&&(d.limit=n),”inf“!==i&&(d.nested_limit=i);var l=e.defer();return s(”GET“,o+”/?“+m(d),null,function(e){200===e.status?l.resolve(JSON.parse(e.body)):404===e.status?l.resolve({total_replies:0}):l.reject(e.body)}),l.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}}}),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 a=new t(n,o);this.on(e,function(){a.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.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 a=[].slice.call(n.querySelectorAll(t),0);return 0===a.length?null:1===a.length&&o?new e(a):(a=[].slice.call(a,0),a.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(”.“));return e.split(”.“).slice(1).forEach(function(e){n.classList.add(e)}),[”A“,”LINK“].indexOf(n.nodeName)>-1&&(n.href=”#“),t||0===t||(t=”“),.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“,,function(e){”use strict“;var t,n=function(e){return(document.cookie.match(”(^|; )“e
”=(*)“)||0)},o=function(e,t,n){return n=n||”0“,e+=”“,e.length>=t?e:new Array(t-e.length+1).join(n)+e},a=function(t,n){var o=(t.getTime()-n.getTime())/1e3;(isNaN(o)||o<0)&&(o=0);var a=Math.floor(o/60),i=Math.floor(a/60),r=Math.floor(i/24);return o<=45&&e.translate(”date-now“)||o<=90&&e.pluralize(”date-minute“,1)||a<=45&&e.pluralize(”date-minute“,a)||a<=90&&e.pluralize(”date-hour“,1)||i<=22&&e.pluralize(”date-hour“,i)||i<=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))},i={”&“:”&“,”<“:”<“,”>“:”>“,'”':“"”,“'”:“'”,“/”:“/”},r=function(e){return i})},s=function(e){var t=document.createElement(“div”);return t.innerHTML=e.replace(/<div>
</div>/gi,“
”).replace(/<div>/gi,“
”).replace(/
/gi,“n”).replace(/ /gi,“ ”),t.textContent.trim()},m=function(e){return e=r(e),e.replace(/nn/gi,“
<div>
</div>”).replace(/n/gi,“
”)};try{localStorage.setItem(“x”,“y”),localStorage.removeItem(“x”),t=localStorage}catch(e){t=function(e){return{setItem:function(t,n){e=n},getItem:function(t){return void 0!==e?e:null},removeItem:function(t){delete e}}}({})}return{cookie:n,pad:o,ago:a,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 a(r,s){if(!n){if(!t){var m=“function”==typeof require&&require;if(!s&&m)return m(r,!0);if(i)return i(r,!0);var c=new Error(“Cannot find module '”r
“'”);throw c.code=“MODULE_NOT_FOUND”,c}var d=n={exports:{}};t[0].call(d.exports,function(e){var n=t[1];return a(n||e)},d,d.exports,e,t,n,o)}return n.exports}for(var i=“function”==typeof require&&require,r=0;rr
'”':“”},n.style=function(e){return e&&“object”==typeof e?Object.keys(e).map(function(t){return t+“:”+e}).join(“;”):e},n.attr=function(e,t,o,a){return“style”===e&&(t=n.style(t)),“boolean”==typeof t||null==t?t?“ ”+(a?e:e+'=“'e
'”'):“”:0==e.indexOf(“data”)&&“string”!=typeof t?(-1!==JSON.stringify(t).indexOf(“&”)&&console.warn(“Since Jade 2.0.0, ampersands (`&`) in data attributes will be escaped to `&`”),t&&“function”==typeof t.toISOString&&console.warn(“Jade will eliminate the double quotes around dates in ISO form after 2.0.0”),“ ”e
“='”+JSON.stringify(t).replace(/'/g,“'”)+“'”):o?(t&&“function”==typeof t.toISOString&&console.warn(“Jade will stringify dates in ISO form after 2.0.0”),“ ”e
'=“'+n.escape(t)+'”'):(t&&“function”==typeof t.toISOString&&console.warn(“Jade will stringify dates in ISO form after 2.0.0”),“ ”e
'=“'t
'”')},n.attrs=function(e,t){var o=[],i=Object.keys(e);if(i.length)for(var r=0;r<i.length;++r){var s=i,m=e;“class”==s?(m=a(m))&&o.push(“ ”s
'=“'m
'”'):o.push(n.attr(s,m,!1,t))}return o.join(“”)};var s={“&”:“&”,“<”:“<”,“>”:“>”,'“':”"“},2:},{},[1])(1)}),define(”jade“,{load:function(e){throw new Error(”Dynamic load not allowed: “+e)}}),define(”jade!app/text/postbox“,function(){return function(e){var t,n=[],o=e||{};return function(e,o,a,i){n.push('<div class=”isso-postbox“><div class=”form-wrapper“><div class=”textarea-wrapper“><div contenteditable=”true“ class=”textarea placeholder“>'+jade.escape(null==(t=a(”postbox-text“))?”“:t)+'</div></div><section class=”auth-section“><p class=”input-wrapper“><input type=”text“ name=”author“'+jade.attr(”placeholder“,a(”postbox-author“),!0,!1)+jade.attr(”value“,null!==e?”“+e:”“,!0,!1)+'/></p><p class=”input-wrapper“><input type=”email“ name=”email“'+jade.attr(”placeholder“,a(”postbox-email“),!0,!1)+jade.attr(”value“,null!=o?”“+o:”“,!0,!1)+'/></p><p class=”input-wrapper“><input type=”text“ name=”website“'+jade.attr(”placeholder“,a(”postbox-website“),!0,!1)+jade.attr(”value“,null!=i?”“+i:”“,!0,!1)+'/></p><p class=”post-action“><input type=”submit“'+jade.attr(”value“,a(”postbox-submit“),!0,!1)+”/></p></section></div></div>“)}.call(this,”author“in o?o.author:”undefined“!=typeof author?author:void 0,”email“in o?o.email:”undefined“!=typeof email?email:void 0,”i18n“in o?o.i18n:”undefined“!=typeof i18n?i18n:void 0,”website“in o?o.website:”undefined“!=typeof website?website:void 0),n.join(”“)}}),define(”jade!app/text/comment“,function(){return function(e){var t,n=[],o=e||{};return function(e,o,a,i,r,s,m){n.push(”<div“+jade.attr(”id“,”isso-“+o.id,!0,!1)+' class=”isso-comment“>'),a.avatar&&n.push('<div class=”avatar“><svg'+jade.attr(”data-hash“,”“+o.hash,!0,!1)+”></svg></div>“),n.push('<div class=”text-wrapper“><div role=”meta“ class=”isso-comment-header“>'),e(o.website)?n.push(”<a“+jade.attr(”href“,”“+o.website,!0,!1)+' rel=”nofollow“ class=”author“>'+jade.escape(null==(t=e(o.author)?o.author:s(”comment-anonymous“))?”“:t)+”</a>“):n.push('<span class=”author“>'+jade.escape(null==(t=e(o.author)?o.author:s(”comment-anonymous“))?”“:t)+”</span>“),n.push('<span class=”spacer“>•</span><a'+jade.attr(”href“,”#isso-“+o.id,!0,!1)+' class=”permalink“><time'+jade.attr(”title“,”“+r(o.created),!0,!1)+jade.attr(”datetime“,”“+i(o.created),!0,!1)+'></time></a><span class=”note“>'+jade.escape(null==(t=2==o.mode?s(”comment-queued“):4==o.mode?s(”comment-deleted“):”“)?”“:t)+'</span></div><div class=”text“>'),4==o.mode?n.push(”<p> </p>“):n.push(null==(t=o.text)?”“:t),n.push('</div><div class=”isso-comment-footer“>'),a.vote&&n.push('<a href=”#“ class=”upvote“>’+(null==(t=m)?”“:t)+'</a><span class=”spacer“>|</span><a href=”#“ class=”downvote“>‘+(null==(t=m)?”“:t)+”</a>“),n.push('<a href=”#“ class=”reply“>'+jade.escape(null==(t=s(”comment-reply“))?”“:t)+'</a><a href=”#“ class=”edit“>'+jade.escape(null==(t=s(”comment-edit“))?”“:t)+'</a><a href=”#“ class=”delete“>'+jade.escape(null==(t=s(”comment-delete“))?”“:t)+'</a></div><div class=”isso-follow-up“></div></div></div>')}.call(this,”bool“in o?o.bool:”undefined“!=typeof bool?bool:void 0,”comment“in o?o.comment:”undefined“!=typeof comment?comment:void 0,”conf“in o?o.conf:”undefined“!=typeof conf?conf:void 0,”datetime“in o?o.datetime:”undefined“!=typeof datetime?datetime:void 0,”humanize“in o?o.humanize:”undefined“!=typeof humanize?humanize:void 0,”i18n“in o?o.i18n:”undefined“!=typeof i18n?i18n:void 0,”svg“in o?o.svg:”undefined“!=typeof svg?svg:void 0),n.join(”“)}}),define(”jade!app/text/comment-loader“,function(){return function(e){var t,n=[],o=e||{};return function(e,o){n.push(”<div“+jade.attr(”id“,”isso-loader-“+e.name,!0,!1)+' class=”isso-comment-loader“><a href=”#“ class=”load_hidden“>'+jade.escape(null==(t=o(”comment-hidden“,e.hidden_replies))?”“:t)+”</a></div>“)}.call(this,”comment“in o?o.comment:”undefined“!=typeof comment?comment:void 0,”pluralize“in o?o.pluralize:”undefined“!=typeof pluralize?pluralize:void 0),n.join(”“)}}),define(”app/jade“,,function(runtime,utils,tt_postbox,tt_comment,tt_comment_loader){”use strict“;var globals={},templates={},load=function(name,js){templates=function(jade){var fn;return eval(”fn = “+js),fn}(runtime)},set=function(e,t){globals=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))),.join(”-“)+”T“+.join(”:“)+”Z“}),{set:set,render:function(e,t){var n;if(!templates)throw new Error(”Template not found: '“e
”'“);t=t||{};var o=[];for(var a in t)t.hasOwnProperty(a)&&!globals.hasOwnProperty(a)&&(o.push(a),globals=t);n=templates(globals);for(var i=0;i<o.length;i++)delete globals[o];return n}}}),define(”app/lib/editor“,,function(e,t){”use strict“;return function(n){return n=e.htmlify(n),n.setAttribute(”contentEditable“,!0),n.on(”focus“,function(){n.classList.contains(”placeholder“)&&(n.innerHTML=”“,n.classList.remove(”placeholder“))}),n.on(”blur“,function(){0===n.textContent.length&&(n.textContent=t.translate(”postbox-text“),n.classList.add(”placeholder“))}),n}}),define(”app/lib/identicons“,,function(e,t){”use strict“;var n=function(e,t){return e.length>=t?e:new Array(t-e.length+1).join(”0“)+e},o=function(e,t,n,o,a,i){var r=document.createElementNS(”www.w3.org/2000/svg“,”rect“);r.setAttribute(”x“,o+t*a),r.setAttribute(”y“,o+n*a),r.setAttribute(”width“,a),r.setAttribute(”height“,a),r.setAttribute(”style“,”fill: “+i),e.appendChild®},a=function(a,i,r){var s=document.createElementNS(”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*i,t),null===typeof a?s:(e.when(a,function(e){var a=n((parseInt(e.substr(-16),16)%Math.pow(2,18)).toString(2),18),r=0;s.setAttribute(”data-hash“,e);for(var m=parseInt(a.substring(a.length-3,a.length),2),c=t[m%t.length],d=0;d<Math.ceil(2.5);d++)for(var l=0;l<5;l++)”1“===a.charAt®&&(o(s,d,l,i,8,c),d<Math.floor(2.5)&&o(s,4-d,l,i,8,c)),r++}),s)};return{generate:a,blank:function(e,t){var n=parseInt(.join(”“),2).toString(16),o=a(n,e,t);return o.setAttribute(”className“,”blank“),o}}}),define(”app/lib“,,function(e){return{editorify:e(”app/lib/editor“),identicons:e(”app/lib/identicons“)}}),define(”app/isso“,,function(e,t,n,o,a,i,r,s){”use strict“;var m=function(i){var s=t.localStorageImpl,m=e.htmlify(a.render(”postbox“,{author:JSON.parse(s.getItem(”author“)),email:JSON.parse(s.getItem(”email“)),website:JSON.parse(s.getItem(”website“))}));return m.onsuccess=function(){},m.validate=function(){return t.text(e(”.textarea“,this).innerHTML).length<3||e(".textarea",this).classList.contains("placeholder")?(e(".textarea",this).focus(),!1):n&&e(”“,this).value.length<=0?(e("”,this).focus(),!1):!(n&&e(“”,this).value.length<=0)||(e("“,this).focus(),!1)},n&&e(”“,m).setAttribute(”placeholder“,e(”“,m).getAttribute(”placeholder“).replace(/ (.*)/,”“)),n&&(e(”“,m).placeholder=e(”“,m).placeholder.replace(/ (.*)/,”“)),e(”“,m).on(”click“,function(){if(m.validate()){var n=e(”“,m).value||null,a=e(”“,m).value||null,r=e(”“,m).value||null;s.setItem(”author“,JSON.stringify(n)),s.setItem(”email“,JSON.stringify(a)),s.setItem(”website“,JSON.stringify®),o.create(e(”#isso-thread“).getAttribute(”data-isso-id“),{author:n,email:a,website:r,text:t.text(e(”.textarea“,m).innerHTML),parent:i||null,title:e(”#isso-thread“).getAttribute(”data-title“)||null}).then(function(t){e(”.textarea“,m).innerHTML=”“,e(”.textarea“,m).blur(),d(t,!0),null!==i&&m.onsuccess()})}}),r.editorify(e(”.textarea“,m)),m},c=function(t,i){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(a.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,n,t.id,i).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(l,u){var p=e.htmlify(a.render(”comment“,{comment:l})),f=function(){e(”.permalink > time“,p).textContent=t.ago(s.offset.localTime(),new Date(1e3*parseInt(l.created,10))),setTimeout(f,6e4)};f(),n.avatar&&e(”div.avatar > svg“,p).replace(r.identicons.generate(l.hash,4,48));var h;h=e(null===l.parent?”#isso-root“:”#isso-“l.parent
” > .text-wrapper > .isso-follow-up“),h.append(p),u&&p.scrollIntoView();var v=e(”#isso-“l.id
” > .text-wrapper > .isso-comment-footer“),b=e(”#isso-“l.id
” > .text-wrapper > .isso-comment-header“),x=e(”#isso-“l.id
” > .text-wrapper > .text“),g=null;if(e(”a.reply“,v).toggle(”click“,function(t){g=v.insertAfter(new m(null===l.parent?l.id:l.parent)),g.onsuccess=function(){t.next()},e(”.textarea“,g).focus(),e(”a.reply“,v).textContent=i.translate(”comment-close“)},function(){g.remove(),e(”a.reply“,v).textContent=i.translate(”comment-reply“)}),n.vote){var w=n;”string“==typeof w&&(w=w.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?p.classList.remove(”isso-no-votes“):p.classList.add(”isso-no-votes“),w)for(var o=!0,a=0;a<=w.length;a++)o&&(a>=w.length||t