20 lines
68 KiB
JavaScript
20 lines
68 KiB
JavaScript
|
/**
|
|||
|
* @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,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;d<e.length;d++)if("."===(l=e[d]))e.splice(d,1),d-=1;else if(".."===l){if(0===d||1===d&&".."===e[2]||".."===e[d-1])continue;d>0&&(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;w<i.length;w+=1)if(x=l(i[w],g),"require"===(p=x.f))k[w]=u.require(n);else if("exports"===p)k[w]=u.exports(n),y=!0;else if("module"===p)d=k[w]=u.module(n);else if(t(f,p)||t(h,p)||t(b,p))k[w]=r(p);else{if(!x.p)throw new Error(n+" missing "+p);x.p.load(x.n,o(c,!0),a(p),{}),k[w]=f[p]}v=s?s.apply(f[n],k):void 0,n&&(d&&d.exports!==e&&d.exports!==f[n]?f[n]=d.exports:v===e&&y||(f[n]=v))}else n&&(f[n]=s)},requirejs=require=p=function(t,n,o,i,a){if("string"==typeof t)return u[t]?u[t](n):r(l(t,m(n)).f);if(!t.splice){if(v=t,v.deps&&p(v.deps,v.callback),!n)return;n.splice?(t=n,n=o,o=null):t=e}return n=n||function(){},"function"==typeof o&&(o=i,i=a),i?d(e,t,n,o):setTimeout(function(){d(e,t,n,o)},4),p},p.config=function(e){return p(e)},requirejs._defined=f,define=function(e,n,o){if("string"!=typeof e)throw new Error("See almond README: incorrect module build, no module name");n.splice||(o=n,n=[]),t(f,e)||t(h,e)||(h[e]=[e,n,o])},define.amd={jQuery:!0}}(),define("components/almond/almond",function(){}),define("app/lib/ready",[],function(){"use strict";var e=!1,t=function(t){e||(e=!0,t())};return function(e){document.addEventListener("DOMContentLoaded",function(){t(e)}),"interactive"!==document.readyState&&"complete"!==document.readyState||t(e)}}),define("app/config",[],function(){"use strict";for(var e={css:!0,lang:(navigator.language||navigator.userLanguage).split("-")[0],"reply-to-self":!1,"require-email":!1,"require-author":!1,"reply-notifications":!1,"max-comments-top":"inf","max-comments-nested":5,"reveal-on-click":5,gravatar:!1,avatar:!0,"avatar-bg":"#f0f0f0","avatar-fg":["#9abf88","#5698c4","#e279a3","#9163b6","#be5168","#f19670","#e4bf80","#447c69"].join(" "),vote:!0,"vote-levels":null,feed:!1},t=document.getElementsByTagName("script"),n=0;n<t.length;n++)for(var o=0;o<t[n].attributes.length;o++){var i=t[n].attributes[o];if(/^data-isso-/.test(i.name))try{e[i.name.substring(10)]=JSON.parse(i.value)}catch(t){e[i.name.substring(10)]=i.value}}return e["avatar-fg"]=e["avatar-fg"].split(" "),e}),define("app/i18n/bg",{"postbox-text":"Въведете коментара си тук (поне 3 знака)","postbox-author":"<EFBFBD>
|
|||
|
for(r=0;r<a.length;r++)if(a[r].getAttribute("async")||a[r].getAttribute("defer"))throw"Isso's automatic configuration detection failed, please refer to https://github.com/posativ/isso#client-configuration and add a custom `data-isso` attribute.";n=a[a.length-1],o=n.src.substring(0,n.src.length-"/js/embed.min.js".length)}"/"===o[o.length-1]&&(o=o.substring(0,o.length-1));var s=function(e,n,o,i,a){function r(){var e=s.getResponseHeader("Date");null!==e&&t.offset.update(new Date(e));var n=s.getResponseHeader("X-Set-Cookie");n&&n.match(/^isso-/)&&(document.cookie=n),s.status>=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.classLi
|
|||
|
return'#isso-thread * {\n -webkit-box-sizing: border-box;\n -moz-box-sizing: border-box;\n box-sizing: border-box;\n}\n#isso-thread .isso-comment-header a {\n text-decoration: none;\n}\n\n#isso-thread {\n padding: 0;\n margin: 0;\n}\n#isso-thread > 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-foo
|