From 073349d6235f00c1302849ad720177b621ebee4d Mon Sep 17 00:00:00 2001 From: metrakit Date: Wed, 16 Sep 2015 17:23:17 +0200 Subject: [PATCH] [DEV]form design --- bin/.hook_template | 2 +- dist/comments.js | 14 +++++++++-- dist/comments.min.js | 4 +-- public/form.html | 16 +++++++++--- public/form.scss | 59 +++++++++++++++++++++++++++++++++++++++++--- src/jst.js | 4 +-- src/main.js | 10 ++++++++ 7 files changed, 94 insertions(+), 15 deletions(-) diff --git a/bin/.hook_template b/bin/.hook_template index a107adb..2a35555 100644 --- a/bin/.hook_template +++ b/bin/.hook_template @@ -1,5 +1,5 @@ //This file is generated by bin/hook.js -var template = require('template'); +var template = require('lodash.template'); module.exports = { <% templates.forEach(function(template) { %> '<%= template.name %>': template('<%= template.content %>'), diff --git a/dist/comments.js b/dist/comments.js index 7c923bf..320a372 100644 --- a/dist/comments.js +++ b/dist/comments.js @@ -1764,13 +1764,13 @@ module.exports = { add: template(""), - form: template("
\t\t\t

<%- addAt %> 0 <%- minutes %>

\t
\t\t\t
"), + form: template("
\t<%- addAt %> 0 <%- minutes %>
\t
\t\t\t
\t\t
\t\t\t\t\t\t
\t\t\t\t\t
\t
"), CSS: { add: ".comments-controls[data-comments-controls]{display:inline-block;float:left;color:#fff;line-height:32px;font-size:10px;font-weight:700;margin-right:3px}.comments-controls[data-comments-controls] .add-comment{cursor:pointer;opacity:.8;font-weight:lighter}.comments-controls[data-comments-controls] .add-comment:before{font-size:16px}.comments-controls[data-comments-controls] .add-comment:hover{text-shadow:rgba(255,255,255,.8) 0 0 5px;opacity:1}.comments-bar{display:inline-block;float:left;line-height:32px;font-size:10px;font-weight:700;margin-left:6px}.comment-pointer{position:absolute;left:20px;top:8px;width:2px;height:8px;background:#90ee90;color:#90ee90;transition:background .2s linear}.comment-pointer:hover{background:red}.video-comment{color:#fff;text-align:left;font-size:12px!important}.comment-actif{padding:5px!important}.img-comment{min-width:100px;min-height:50px}.img-comment img{max-width:200px;max-height:200px}.img-comment .spinner-three-bounce{top:25%}.img-comment .spinner-three-bounce>div{width:10px;height:10px}.media-control[data-media-control] .media-control-layer[data-controls] .bar-container[data-seekbar] .bar-scrubber[data-seekbar]{z-index:99}.seek-time[data-seek-time]{height:initial!important}", - form: ".form-comment{position:absolute;width:50%;margin-left:auto;margin-right:auto;text-align:left;background:#fff;right:5px;bottom:100px;z-index:999999;padding:5px!important;visibility:hidden;opacity:0;transition:hidden 0s .2s,opacity .2s linear;border-radius:5px;cursor:default}.form-comment button,.form-comment input,.form-comment textarea{font:initial;font-size:initial;line-height:initial;color:initial}.form-comment p{color:initial;font-size:initial!important}.form-comment input[type=file]{display:none}.form-comment textarea{width:100%}.form-comment .submit-comment{text-align:center}.show-form{visibility:visible;opacity:.9}" } + form: ".form-comment{position:absolute;width:50%;margin-left:auto;margin-right:auto;text-align:left;background:#fff;right:5px;bottom:100px;z-index:999999;visibility:hidden;opacity:0;transition:hidden 0s .2s,opacity .2s linear;border-radius:5px;cursor:default}.form-comment .form-comment-header{padding:2px 5px;background:#888;border-top-left-radius:5px;border-top-right-radius:5px}.form-comment form{padding:5px!important}.form-comment img{max-height:50px;max-width:100px}.form-comment button,.form-comment input,.form-comment textarea{font-family:\"Helvetica Neue\",Helvetica,Arial,sans-serif;font-size:initial;line-height:initial;color:initial}.form-comment p{color:initial;font-size:initial!important}.form-comment input[type=file]{width:.1px;height:.1px;opacity:0;overflow:hidden;position:absolute;z-index:-1}.form-comment button[type=button],.form-comment input[type=file]+label{display:inline-block;padding:2px 5px;font-size:1.25em;font-weight:700}.form-comment input[type=file]+label{color:#fff;background-color:#000;cursor:pointer}.form-comment button[type=button]{color:#fff;background-color:green;cursor:pointer;border:0;line-height:1.4}.form-comment button[type=button]:focus,.form-comment button[type=button]:hover,.form-comment input[type=file]+label:hover,.form-comment input[type=file]:focus+label{background-color:red}.form-comment .text-center{text-align:center}.form-comment textarea{width:100%}.form-comment .submit-comment{display:inline-block}.show-form{visibility:visible;opacity:.9}" } }; },{"lodash.template":3}],19:[function(require,module,exports){ @@ -1949,6 +1949,16 @@ var Comments = (function (_UICorePlugin) { this.core.mediaControl.$seekBarContainer.append(this.commentPointer); this.core.mediaControl.seekTime.$el.prepend("
"); + + $(".form-comment input[type=\"file\"]").change(function () { + if (this.files && this.files[0]) { + var reader = new FileReader(); + reader.onload = function (e) { + $(".form-comment img").attr("src", e.target.result); + }; + reader.readAsDataURL(this.files[0]); + } + }); } }, getComments: { diff --git a/dist/comments.min.js b/dist/comments.min.js index 0fbb11d..79d635c 100644 --- a/dist/comments.min.js +++ b/dist/comments.min.js @@ -1,2 +1,2 @@ -!function t(e,n,r){function o(a,s){if(!n[a]){if(!e[a]){var c="function"==typeof require&&require;if(!s&&c)return c(a,!0);if(i)return i(a,!0);var u=new Error("Cannot find module '"+a+"'");throw u.code="MODULE_NOT_FOUND",u}var l=n[a]={exports:{}};e[a][0].call(l.exports,function(t){var n=e[a][1][t];return o(n?n:t)},l,l.exports,t,e,n,r)}return n[a].exports}for(var i="function"==typeof require&&require,a=0;a0?$.fn.concat.apply([],t):t}function u(t){return t.replace(/::/g,"/").replace(/([A-Z]+)([A-Z][a-z])/g,"$1_$2").replace(/([a-z\d])([A-Z])/g,"$1_$2").replace(/_/g,"-").toLowerCase()}function l(t){return t in F?F[t]:F[t]=new RegExp("(^|\\s)"+t+"(\\s|$)")}function f(t,e){return"number"!=typeof e||M[u(t)]?e:e+"px"}function p(t){var e,n;return N[t]||(e=A.createElement(t),A.body.appendChild(e),n=getComputedStyle(e,"").getPropertyValue("display"),e.parentNode.removeChild(e),"none"==n&&(n="block"),N[t]=n),N[t]}function h(t){return"children"in t?k.call(t.children):$.map(t.childNodes,function(t){return 1==t.nodeType?t:void 0})}function m(t,e){var n,r=t?t.length:0;for(n=0;r>n;n++)this[n]=t[n];this.length=r,this.selector=e||""}function d(t,e,n){for(j in e)n&&(i(e[j])||Q(e[j]))?(i(e[j])&&!i(t[j])&&(t[j]={}),Q(e[j])&&!Q(t[j])&&(t[j]=[]),d(t[j],e[j],n)):e[j]!==C&&(t[j]=e[j])}function g(t,e){return null==e?$(t):$(t).filter(e)}function v(t,n,r,o){return e(n)?n.call(t,r,o):n}function y(t,e,n){null==n?t.removeAttribute(e):t.setAttribute(e,n)}function b(t,e){var n=t.className||"",r=n&&n.baseVal!==C;return e===C?r?n.baseVal:n:void(r?n.baseVal=e:t.className=e)}function x(t){try{return t?"true"==t||("false"==t?!1:"null"==t?null:+t+""==t?+t:/^[\[\{]/.test(t)?$.parseJSON(t):t):t}catch(e){return t}}function w(t,e){e(t);for(var n=0,r=t.childNodes.length;r>n;n++)w(t.childNodes[n],e)}var C,j,$,E,T,S,O=[],P=O.concat,_=O.filter,k=O.slice,A=window.document,N={},F={},M={"column-count":1,columns:1,"font-weight":1,"line-height":1,opacity:1,"z-index":1,zoom:1},D=/^\s*<(\w+|!)[^>]*>/,R=/^<(\w+)\s*\/?>(?:<\/\1>|)$/,L=/<(?!area|br|col|embed|hr|img|input|link|meta|param)(([\w:]+)[^>]*)\/>/gi,U=/^(?:body|html)$/i,q=/([A-Z])/g,z=["val","css","html","text","data","width","height","offset"],I=["after","prepend","before","append"],B=A.createElement("table"),W=A.createElement("tr"),Z={tr:A.createElement("tbody"),tbody:B,thead:B,tfoot:B,td:W,th:W,"*":A.createElement("div")},H=/complete|loaded|interactive/,X=/^[\w-]*$/,V={},G=V.toString,Y={},J=A.createElement("div"),K={tabindex:"tabIndex",readonly:"readOnly","for":"htmlFor","class":"className",maxlength:"maxLength",cellspacing:"cellSpacing",cellpadding:"cellPadding",rowspan:"rowSpan",colspan:"colSpan",usemap:"useMap",frameborder:"frameBorder",contenteditable:"contentEditable"},Q=Array.isArray||function(t){return t instanceof Array};return Y.matches=function(t,e){if(!e||!t||1!==t.nodeType)return!1;var n=t.webkitMatchesSelector||t.mozMatchesSelector||t.oMatchesSelector||t.matchesSelector;if(n)return n.call(t,e);var r,o=t.parentNode,i=!o;return i&&(o=J).appendChild(t),r=~Y.qsa(o,e).indexOf(t),i&&J.removeChild(t),r},T=function(t){return t.replace(/-+(.)?/g,function(t,e){return e?e.toUpperCase():""})},S=function(t){return _.call(t,function(e,n){return t.indexOf(e)==n})},Y.fragment=function(t,e,n){var r,o,a;return R.test(t)&&(r=$(A.createElement(RegExp.$1))),r||(t.replace&&(t=t.replace(L,"<$1>")),e===C&&(e=D.test(t)&&RegExp.$1),e in Z||(e="*"),a=Z[e],a.innerHTML=""+t,r=$.each(k.call(a.childNodes),function(){a.removeChild(this)})),i(n)&&(o=$(r),$.each(n,function(t,e){z.indexOf(t)>-1?o[t](e):o.attr(t,e)})),r},Y.Z=function(t,e){return new m(t,e)},Y.isZ=function(t){return t instanceof Y.Z},Y.init=function(t,n){var r;if(!t)return Y.Z();if("string"==typeof t)if(t=t.trim(),"<"==t[0]&&D.test(t))r=Y.fragment(t,RegExp.$1,n),t=null;else{if(n!==C)return $(n).find(t);r=Y.qsa(A,t)}else{if(e(t))return $(A).ready(t);if(Y.isZ(t))return t;if(Q(t))r=s(t);else if(o(t))r=[t],t=null;else if(D.test(t))r=Y.fragment(t.trim(),RegExp.$1,n),t=null;else{if(n!==C)return $(n).find(t);r=Y.qsa(A,t)}}return Y.Z(r,t)},$=function(t,e){return Y.init(t,e)},$.extend=function(t){var e,n=k.call(arguments,1);return"boolean"==typeof t&&(e=t,t=n.shift()),n.forEach(function(n){d(t,n,e)}),t},Y.qsa=function(t,e){var n,r="#"==e[0],o=!r&&"."==e[0],i=r||o?e.slice(1):e,a=X.test(i);return t.getElementById&&a&&r?(n=t.getElementById(i))?[n]:[]:1!==t.nodeType&&9!==t.nodeType&&11!==t.nodeType?[]:k.call(a&&!r&&t.getElementsByClassName?o?t.getElementsByClassName(i):t.getElementsByTagName(e):t.querySelectorAll(e))},$.contains=A.documentElement.contains?function(t,e){return t!==e&&t.contains(e)}:function(t,e){for(;e&&(e=e.parentNode);)if(e===t)return!0;return!1},$.type=t,$.isFunction=e,$.isWindow=n,$.isArray=Q,$.isPlainObject=i,$.isEmptyObject=function(t){var e;for(e in t)return!1;return!0},$.inArray=function(t,e,n){return O.indexOf.call(e,t,n)},$.camelCase=T,$.trim=function(t){return null==t?"":String.prototype.trim.call(t)},$.uuid=0,$.support={},$.expr={},$.noop=function(){},$.map=function(t,e){var n,r,o,i=[];if(a(t))for(r=0;r=0?t:t+this.length]},toArray:function(){return this.get()},size:function(){return this.length},remove:function(){return this.each(function(){null!=this.parentNode&&this.parentNode.removeChild(this)})},each:function(t){return O.every.call(this,function(e,n){return t.call(e,n,e)!==!1}),this},filter:function(t){return e(t)?this.not(this.not(t)):$(_.call(this,function(e){return Y.matches(e,t)}))},add:function(t,e){return $(S(this.concat($(t,e))))},is:function(t){return this.length>0&&Y.matches(this[0],t)},not:function(t){var n=[];if(e(t)&&t.call!==C)this.each(function(e){t.call(this,e)||n.push(this)});else{var r="string"==typeof t?this.filter(t):a(t)&&e(t.item)?k.call(t):$(t);this.forEach(function(t){r.indexOf(t)<0&&n.push(t)})}return $(n)},has:function(t){return this.filter(function(){return o(t)?$.contains(this,t):$(this).find(t).size()})},eq:function(t){return-1===t?this.slice(t):this.slice(t,+t+1)},first:function(){var t=this[0];return t&&!o(t)?t:$(t)},last:function(){var t=this[this.length-1];return t&&!o(t)?t:$(t)},find:function(t){var e,n=this;return e=t?"object"==typeof t?$(t).filter(function(){var t=this;return O.some.call(n,function(e){return $.contains(e,t)})}):1==this.length?$(Y.qsa(this[0],t)):this.map(function(){return Y.qsa(this,t)}):$()},closest:function(t,e){var n=this[0],o=!1;for("object"==typeof t&&(o=$(t));n&&!(o?o.indexOf(n)>=0:Y.matches(n,t));)n=n!==e&&!r(n)&&n.parentNode;return $(n)},parents:function(t){for(var e=[],n=this;n.length>0;)n=$.map(n,function(t){return(t=t.parentNode)&&!r(t)&&e.indexOf(t)<0?(e.push(t),t):void 0});return g(e,t)},parent:function(t){return g(S(this.pluck("parentNode")),t)},children:function(t){return g(this.map(function(){return h(this)}),t)},contents:function(){return this.map(function(){return this.contentDocument||k.call(this.childNodes)})},siblings:function(t){return g(this.map(function(t,e){return _.call(h(e.parentNode),function(t){return t!==e})}),t)},empty:function(){return this.each(function(){this.innerHTML=""})},pluck:function(t){return $.map(this,function(e){return e[t]})},show:function(){return this.each(function(){"none"==this.style.display&&(this.style.display=""),"none"==getComputedStyle(this,"").getPropertyValue("display")&&(this.style.display=p(this.nodeName))})},replaceWith:function(t){return this.before(t).remove()},wrap:function(t){var n=e(t);if(this[0]&&!n)var r=$(t).get(0),o=r.parentNode||this.length>1;return this.each(function(e){$(this).wrapAll(n?t.call(this,e):o?r.cloneNode(!0):r)})},wrapAll:function(t){if(this[0]){$(this[0]).before(t=$(t));for(var e;(e=t.children()).length;)t=e.first();$(t).append(this)}return this},wrapInner:function(t){var n=e(t);return this.each(function(e){var r=$(this),o=r.contents(),i=n?t.call(this,e):t;o.length?o.wrapAll(i):r.append(i)})},unwrap:function(){return this.parent().each(function(){$(this).replaceWith($(this).children())}),this},clone:function(){return this.map(function(){return this.cloneNode(!0)})},hide:function(){return this.css("display","none")},toggle:function(t){return this.each(function(){var e=$(this);(t===C?"none"==e.css("display"):t)?e.show():e.hide()})},prev:function(t){return $(this.pluck("previousElementSibling")).filter(t||"*")},next:function(t){return $(this.pluck("nextElementSibling")).filter(t||"*")},html:function(t){return 0 in arguments?this.each(function(e){var n=this.innerHTML;$(this).empty().append(v(this,t,e,n))}):0 in this?this[0].innerHTML:null},text:function(t){return 0 in arguments?this.each(function(e){var n=v(this,t,e,this.textContent);this.textContent=null==n?"":""+n}):0 in this?this[0].textContent:null},attr:function(t,e){var n;return"string"!=typeof t||1 in arguments?this.each(function(n){if(1===this.nodeType)if(o(t))for(j in t)y(this,j,t[j]);else y(this,t,v(this,e,n,this.getAttribute(t)))}):this.length&&1===this[0].nodeType?!(n=this[0].getAttribute(t))&&t in this[0]?this[0][t]:n:C},removeAttr:function(t){return this.each(function(){1===this.nodeType&&t.split(" ").forEach(function(t){y(this,t)},this)})},prop:function(t,e){return t=K[t]||t,1 in arguments?this.each(function(n){this[t]=v(this,e,n,this[t])}):this[0]&&this[0][t]},data:function(t,e){var n="data-"+t.replace(q,"-$1").toLowerCase(),r=1 in arguments?this.attr(n,e):this.attr(n);return null!==r?x(r):C},val:function(t){return 0 in arguments?this.each(function(e){this.value=v(this,t,e,this.value)}):this[0]&&(this[0].multiple?$(this[0]).find("option").filter(function(){return this.selected}).pluck("value"):this[0].value)},offset:function(t){if(t)return this.each(function(e){var n=$(this),r=v(this,t,e,n.offset()),o=n.offsetParent().offset(),i={top:r.top-o.top,left:r.left-o.left};"static"==n.css("position")&&(i.position="relative"),n.css(i)});if(!this.length)return null;if(!$.contains(A.documentElement,this[0]))return{top:0,left:0};var e=this[0].getBoundingClientRect();return{left:e.left+window.pageXOffset,top:e.top+window.pageYOffset,width:Math.round(e.width),height:Math.round(e.height)}},css:function(e,n){if(arguments.length<2){var r,o=this[0];if(!o)return;if(r=getComputedStyle(o,""),"string"==typeof e)return o.style[T(e)]||r.getPropertyValue(e);if(Q(e)){var i={};return $.each(e,function(t,e){i[e]=o.style[T(e)]||r.getPropertyValue(e)}),i}}var a="";if("string"==t(e))n||0===n?a=u(e)+":"+f(e,n):this.each(function(){this.style.removeProperty(u(e))});else for(j in e)e[j]||0===e[j]?a+=u(j)+":"+f(j,e[j])+";":this.each(function(){this.style.removeProperty(u(j))});return this.each(function(){this.style.cssText+=";"+a})},index:function(t){return t?this.indexOf($(t)[0]):this.parent().children().indexOf(this[0])},hasClass:function(t){return t?O.some.call(this,function(t){return this.test(b(t))},l(t)):!1},addClass:function(t){return t?this.each(function(e){if("className"in this){E=[];var n=b(this),r=v(this,t,e,n);r.split(/\s+/g).forEach(function(t){$(this).hasClass(t)||E.push(t)},this),E.length&&b(this,n+(n?" ":"")+E.join(" "))}}):this},removeClass:function(t){return this.each(function(e){if("className"in this){if(t===C)return b(this,"");E=b(this),v(this,t,e,E).split(/\s+/g).forEach(function(t){E=E.replace(l(t)," ")}),b(this,E.trim())}})},toggleClass:function(t,e){return t?this.each(function(n){var r=$(this),o=v(this,t,n,b(this));o.split(/\s+/g).forEach(function(t){(e===C?!r.hasClass(t):e)?r.addClass(t):r.removeClass(t)})}):this},scrollTop:function(t){if(this.length){var e="scrollTop"in this[0];return t===C?e?this[0].scrollTop:this[0].pageYOffset:this.each(e?function(){this.scrollTop=t}:function(){this.scrollTo(this.scrollX,t)})}},scrollLeft:function(t){if(this.length){var e="scrollLeft"in this[0];return t===C?e?this[0].scrollLeft:this[0].pageXOffset:this.each(e?function(){this.scrollLeft=t}:function(){this.scrollTo(t,this.scrollY)})}},position:function(){if(this.length){var t=this[0],e=this.offsetParent(),n=this.offset(),r=U.test(e[0].nodeName)?{top:0,left:0}:e.offset();return n.top-=parseFloat($(t).css("margin-top"))||0,n.left-=parseFloat($(t).css("margin-left"))||0,r.top+=parseFloat($(e[0]).css("border-top-width"))||0,r.left+=parseFloat($(e[0]).css("border-left-width"))||0,{top:n.top-r.top,left:n.left-r.left}}},offsetParent:function(){return this.map(function(){for(var t=this.offsetParent||A.body;t&&!U.test(t.nodeName)&&"static"==$(t).css("position");)t=t.offsetParent;return t})}},$.fn.detach=$.fn.remove,["width","height"].forEach(function(t){var e=t.replace(/./,function(t){return t[0].toUpperCase()});$.fn[t]=function(o){var i,a=this[0];return o===C?n(a)?a["inner"+e]:r(a)?a.documentElement["scroll"+e]:(i=this.offset())&&i[t]:this.each(function(e){a=$(this),a.css(t,v(this,o,e,a[t]()))})}}),I.forEach(function(e,n){var r=n%2;$.fn[e]=function(){var e,o,i=$.map(arguments,function(n){return e=t(n),"object"==e||"array"==e||null==n?n:Y.fragment(n)}),a=this.length>1;return i.length<1?this:this.each(function(t,e){o=r?e:e.parentNode,e=0==n?e.nextSibling:1==n?e.firstChild:2==n?e:null;var s=$.contains(A.documentElement,o);i.forEach(function(t){if(a)t=t.cloneNode(!0);else if(!o)return $(t).remove();o.insertBefore(t,e),s&&w(t,function(t){null==t.nodeName||"SCRIPT"!==t.nodeName.toUpperCase()||t.type&&"text/javascript"!==t.type||t.src||window.eval.call(window,t.innerHTML)})})})},$.fn[r?e+"To":"insert"+(n?"Before":"After")]=function(t){return $(t)[e](this),this}}),Y.Z.prototype=m.prototype=$.fn,Y.uniq=S,Y.deserializeValue=x,$.zepto=Y,$}();window.Zepto=r,void 0===window.$&&(window.$=r),function(t){function e(t){return t._zid||(t._zid=p++)}function n(t,n,i,a){if(n=r(n),n.ns)var s=o(n.ns);return(g[e(t)]||[]).filter(function(t){return!(!t||n.e&&t.e!=n.e||n.ns&&!s.test(t.ns)||i&&e(t.fn)!==e(i)||a&&t.sel!=a)})}function r(t){var e=(""+t).split(".");return{e:e[0],ns:e.slice(1).sort().join(" ")}}function o(t){return new RegExp("(?:^| )"+t.replace(" "," .* ?")+"(?: |$)")}function i(t,e){return t.del&&!y&&t.e in b||!!e}function a(t){return x[t]||y&&b[t]||t}function s(n,o,s,c,l,p,h){var m=e(n),d=g[m]||(g[m]=[]);o.split(/\s/).forEach(function(e){if("ready"==e)return t(document).ready(s);var o=r(e);o.fn=s,o.sel=l,o.e in x&&(s=function(e){var n=e.relatedTarget;return!n||n!==this&&!t.contains(this,n)?o.fn.apply(this,arguments):void 0}),o.del=p;var m=p||s;o.proxy=function(t){if(t=u(t),!t.isImmediatePropagationStopped()){t.data=c;var e=m.apply(n,t._args==f?[t]:[t].concat(t._args));return e===!1&&(t.preventDefault(),t.stopPropagation()),e}},o.i=d.length,d.push(o),"addEventListener"in n&&n.addEventListener(a(o.e),o.proxy,i(o,h))})}function c(t,r,o,s,c){var u=e(t);(r||"").split(/\s/).forEach(function(e){n(t,e,o,s).forEach(function(e){delete g[u][e.i],"removeEventListener"in t&&t.removeEventListener(a(e.e),e.proxy,i(e,c))})})}function u(e,n){return(n||!e.isDefaultPrevented)&&(n||(n=e),t.each($,function(t,r){var o=n[t];e[t]=function(){return this[r]=w,o&&o.apply(n,arguments)},e[r]=C}),(n.defaultPrevented!==f?n.defaultPrevented:"returnValue"in n?n.returnValue===!1:n.getPreventDefault&&n.getPreventDefault())&&(e.isDefaultPrevented=w)),e}function l(t){var e,n={originalEvent:t};for(e in t)j.test(e)||t[e]===f||(n[e]=t[e]);return u(n,t)}var f,p=1,h=Array.prototype.slice,m=t.isFunction,d=function(t){return"string"==typeof t},g={},v={},y="onfocusin"in window,b={focus:"focusin",blur:"focusout"},x={mouseenter:"mouseover",mouseleave:"mouseout"};v.click=v.mousedown=v.mouseup=v.mousemove="MouseEvents",t.event={add:s,remove:c},t.proxy=function(n,r){var o=2 in arguments&&h.call(arguments,2);if(m(n)){var i=function(){return n.apply(r,o?o.concat(h.call(arguments)):arguments)};return i._zid=e(n),i}if(d(r))return o?(o.unshift(n[r],n),t.proxy.apply(null,o)):t.proxy(n[r],n);throw new TypeError("expected function")},t.fn.bind=function(t,e,n){return this.on(t,e,n)},t.fn.unbind=function(t,e){return this.off(t,e)},t.fn.one=function(t,e,n,r){return this.on(t,e,n,r,1)};var w=function(){return!0},C=function(){return!1},j=/^([A-Z]|returnValue$|layer[XY]$)/,$={preventDefault:"isDefaultPrevented",stopImmediatePropagation:"isImmediatePropagationStopped",stopPropagation:"isPropagationStopped"};t.fn.delegate=function(t,e,n){return this.on(e,t,n)},t.fn.undelegate=function(t,e,n){return this.off(e,t,n)},t.fn.live=function(e,n){return t(document.body).delegate(this.selector,e,n),this},t.fn.die=function(e,n){return t(document.body).undelegate(this.selector,e,n),this},t.fn.on=function(e,n,r,o,i){var a,u,p=this;return e&&!d(e)?(t.each(e,function(t,e){p.on(t,n,r,e,i)}),p):(d(n)||m(o)||o===!1||(o=r,r=n,n=f),(o===f||r===!1)&&(o=r,r=f),o===!1&&(o=C),p.each(function(f,p){i&&(a=function(t){return c(p,t.type,o),o.apply(this,arguments)}),n&&(u=function(e){var r,i=t(e.target).closest(n,p).get(0);return i&&i!==p?(r=t.extend(l(e),{currentTarget:i,liveFired:p}),(a||o).apply(i,[r].concat(h.call(arguments,1)))):void 0}),s(p,e,o,r,n,u||a)}))},t.fn.off=function(e,n,r){var o=this;return e&&!d(e)?(t.each(e,function(t,e){o.off(t,n,e)}),o):(d(n)||m(r)||r===!1||(r=n,n=f),r===!1&&(r=C),o.each(function(){c(this,e,r,n)}))},t.fn.trigger=function(e,n){return e=d(e)||t.isPlainObject(e)?t.Event(e):u(e),e._args=n,this.each(function(){e.type in b&&"function"==typeof this[e.type]?this[e.type]():"dispatchEvent"in this?this.dispatchEvent(e):t(this).triggerHandler(e,n)})},t.fn.triggerHandler=function(e,r){var o,i;return this.each(function(a,s){o=l(d(e)?t.Event(e):e),o._args=r,o.target=s,t.each(n(s,e.type||e),function(t,e){return i=e.proxy(o),o.isImmediatePropagationStopped()?!1:void 0})}),i},"focusin focusout focus blur load resize scroll unload click dblclick mousedown mouseup mousemove mouseover mouseout mouseenter mouseleave change select keydown keypress keyup error".split(" ").forEach(function(e){t.fn[e]=function(t){return 0 in arguments?this.bind(e,t):this.trigger(e)}}),t.Event=function(t,e){d(t)||(e=t,t=e.type);var n=document.createEvent(v[t]||"Events"),r=!0;if(e)for(var o in e)"bubbles"==o?r=!!e[o]:n[o]=e[o];return n.initEvent(t,r,!0),u(n)}}(r),function(t){function e(e,n,r){var o=t.Event(n);return t(e).trigger(o,r),!o.isDefaultPrevented()}function n(t,n,r,o){return t.global?e(n||y,r,o):void 0}function r(e){e.global&&0===t.active++&&n(e,null,"ajaxStart")}function o(e){e.global&&!--t.active&&n(e,null,"ajaxStop")}function i(t,e){var r=e.context;return e.beforeSend.call(r,t,e)===!1||n(e,r,"ajaxBeforeSend",[t,e])===!1?!1:void n(e,r,"ajaxSend",[t,e])}function a(t,e,r,o){var i=r.context,a="success";r.success.call(i,t,a,e),o&&o.resolveWith(i,[t,a,e]),n(r,i,"ajaxSuccess",[e,r,t]),c(a,e,r)}function s(t,e,r,o,i){var a=o.context;o.error.call(a,r,e,t),i&&i.rejectWith(a,[r,e,t]),n(o,a,"ajaxError",[r,o,t||e]),c(e,r,o)}function c(t,e,r){var i=r.context;r.complete.call(i,e,t),n(r,i,"ajaxComplete",[e,r]),o(r)}function u(){}function l(t){return t&&(t=t.split(";",2)[0]),t&&(t==j?"html":t==C?"json":x.test(t)?"script":w.test(t)&&"xml")||"text"}function f(t,e){return""==e?t:(t+"&"+e).replace(/[&?]{1,2}/,"?")}function p(e){e.processData&&e.data&&"string"!=t.type(e.data)&&(e.data=t.param(e.data,e.traditional)),!e.data||e.type&&"GET"!=e.type.toUpperCase()||(e.url=f(e.url,e.data),e.data=void 0)}function h(e,n,r,o){return t.isFunction(n)&&(o=r,r=n,n=void 0),t.isFunction(r)||(o=r,r=void 0),{url:e,data:n,success:r,dataType:o}}function m(e,n,r,o){var i,a=t.isArray(n),s=t.isPlainObject(n);t.each(n,function(n,c){i=t.type(c),o&&(n=r?o:o+"["+(s||"object"==i||"array"==i?n:"")+"]"),!o&&a?e.add(c.name,c.value):"array"==i||!r&&"object"==i?m(e,c,r,n):e.add(n,c)})}var d,g,v=0,y=window.document,b=/)<[^<]*)*<\/script>/gi,x=/^(?:text|application)\/javascript/i,w=/^(?:text|application)\/xml/i,C="application/json",j="text/html",$=/^\s*$/,E=y.createElement("a");E.href=window.location.href,t.active=0,t.ajaxJSONP=function(e,n){if(!("type"in e))return t.ajax(e);var r,o,c=e.jsonpCallback,u=(t.isFunction(c)?c():c)||"jsonp"+ ++v,l=y.createElement("script"),f=window[u],p=function(e){t(l).triggerHandler("error",e||"abort")},h={abort:p};return n&&n.promise(h),t(l).on("load error",function(i,c){clearTimeout(o),t(l).off().remove(),"error"!=i.type&&r?a(r[0],h,e,n):s(null,c||"error",h,e,n),window[u]=f,r&&t.isFunction(f)&&f(r[0]),f=r=void 0}),i(h,e)===!1?(p("abort"),h):(window[u]=function(){r=arguments},l.src=e.url.replace(/\?(.+)=\?/,"?$1="+u),y.head.appendChild(l),e.timeout>0&&(o=setTimeout(function(){p("timeout")},e.timeout)),h)},t.ajaxSettings={type:"GET",beforeSend:u,success:u,error:u,complete:u,context:null,global:!0,xhr:function(){return new window.XMLHttpRequest},accepts:{script:"text/javascript, application/javascript, application/x-javascript",json:C,xml:"application/xml, text/xml",html:j,text:"text/plain"},crossDomain:!1,timeout:0,processData:!0,cache:!0},t.ajax=function(e){var n,o,c=t.extend({},e||{}),h=t.Deferred&&t.Deferred();for(d in t.ajaxSettings)void 0===c[d]&&(c[d]=t.ajaxSettings[d]);r(c),c.crossDomain||(n=y.createElement("a"),n.href=c.url,n.href=n.href,c.crossDomain=E.protocol+"//"+E.host!=n.protocol+"//"+n.host),c.url||(c.url=window.location.toString()),(o=c.url.indexOf("#"))>-1&&(c.url=c.url.slice(0,o)),p(c);var m=c.dataType,v=/\?.+=\?/.test(c.url);if(v&&(m="jsonp"),c.cache!==!1&&(e&&e.cache===!0||"script"!=m&&"jsonp"!=m)||(c.url=f(c.url,"_="+Date.now())),"jsonp"==m)return v||(c.url=f(c.url,c.jsonp?c.jsonp+"=?":c.jsonp===!1?"":"callback=?")),t.ajaxJSONP(c,h);var b,x=c.accepts[m],w={},C=function(t,e){w[t.toLowerCase()]=[t,e]},j=/^([\w-]+:)\/\//.test(c.url)?RegExp.$1:window.location.protocol,T=c.xhr(),S=T.setRequestHeader;if(h&&h.promise(T),c.crossDomain||C("X-Requested-With","XMLHttpRequest"),C("Accept",x||"*/*"),(x=c.mimeType||x)&&(x.indexOf(",")>-1&&(x=x.split(",",2)[0]),T.overrideMimeType&&T.overrideMimeType(x)),(c.contentType||c.contentType!==!1&&c.data&&"GET"!=c.type.toUpperCase())&&C("Content-Type",c.contentType||"application/x-www-form-urlencoded"),c.headers)for(g in c.headers)C(g,c.headers[g]);if(T.setRequestHeader=C,T.onreadystatechange=function(){if(4==T.readyState){T.onreadystatechange=u,clearTimeout(b);var e,n=!1;if(T.status>=200&&T.status<300||304==T.status||0==T.status&&"file:"==j){m=m||l(c.mimeType||T.getResponseHeader("content-type")),e=T.responseText;try{"script"==m?(1,eval)(e):"xml"==m?e=T.responseXML:"json"==m&&(e=$.test(e)?null:t.parseJSON(e))}catch(r){n=r}n?s(n,"parsererror",T,c,h):a(e,T,c,h)}else s(T.statusText||null,T.status?"error":"abort",T,c,h)}},i(T,c)===!1)return T.abort(),s(null,"abort",T,c,h),T;if(c.xhrFields)for(g in c.xhrFields)T[g]=c.xhrFields[g];var O="async"in c?c.async:!0;T.open(c.type,c.url,O,c.username,c.password);for(g in w)S.apply(T,w[g]);return c.timeout>0&&(b=setTimeout(function(){T.onreadystatechange=u,T.abort(),s(null,"timeout",T,c,h)},c.timeout)),T.send(c.data?c.data:null),T},t.get=function(){return t.ajax(h.apply(null,arguments))},t.post=function(){var e=h.apply(null,arguments);return e.type="POST",t.ajax(e)},t.getJSON=function(){var e=h.apply(null,arguments);return e.dataType="json",t.ajax(e)},t.fn.load=function(e,n,r){if(!this.length)return this;var o,i=this,a=e.split(/\s/),s=h(e,n,r),c=s.success;return a.length>1&&(s.url=a[0],o=a[1]),s.success=function(e){i.html(o?t("
").html(e.replace(b,"")).find(o):e),c&&c.apply(i,arguments)},t.ajax(s),this};var T=encodeURIComponent;t.param=function(e,n){var r=[];return r.add=function(e,n){t.isFunction(n)&&(n=n()),null==n&&(n=""),this.push(T(e)+"="+T(n))},m(r,e,n),r.join("&").replace(/%20/g,"+")}}(r),function(t){t.Callbacks=function(e){e=t.extend({},e);var n,r,o,i,a,s,c=[],u=!e.once&&[],l=function(t){for(n=e.memory&&t,r=!0,s=i||0,i=0,a=c.length,o=!0;c&&a>s;++s)if(c[s].apply(t[0],t[1])===!1&&e.stopOnFalse){n=!1;break}o=!1,c&&(u?u.length&&l(u.shift()):n?c.length=0:f.disable())},f={add:function(){if(c){var r=c.length,s=function(n){t.each(n,function(t,n){"function"==typeof n?e.unique&&f.has(n)||c.push(n):n&&n.length&&"string"!=typeof n&&s(n)})};s(arguments),o?a=c.length:n&&(i=r,l(n))}return this},remove:function(){return c&&t.each(arguments,function(e,n){for(var r;(r=t.inArray(n,c,r))>-1;)c.splice(r,1),o&&(a>=r&&--a,s>=r&&--s)}),this},has:function(e){return!(!c||!(e?t.inArray(e,c)>-1:c.length))},empty:function(){return a=c.length=0,this},disable:function(){return c=u=n=void 0,this},disabled:function(){return!c},lock:function(){return u=void 0,n||f.disable(),this},locked:function(){return!u},fireWith:function(t,e){return!c||r&&!u||(e=e||[],e=[t,e.slice?e.slice():e],o?u.push(e):l(e)),this},fire:function(){return f.fireWith(this,arguments)},fired:function(){return!!r}};return f}}(r),function(t){function e(n){var r=[["resolve","done",t.Callbacks({once:1,memory:1}),"resolved"],["reject","fail",t.Callbacks({once:1,memory:1}),"rejected"],["notify","progress",t.Callbacks({memory:1})]],o="pending",i={state:function(){return o},always:function(){return a.done(arguments).fail(arguments),this},then:function(){var n=arguments;return e(function(e){t.each(r,function(r,o){var s=t.isFunction(n[r])&&n[r];a[o[1]](function(){var n=s&&s.apply(this,arguments);if(n&&t.isFunction(n.promise))n.promise().done(e.resolve).fail(e.reject).progress(e.notify);else{var r=this===i?e.promise():this,a=s?[n]:arguments;e[o[0]+"With"](r,a)}})}),n=null}).promise()},promise:function(e){return null!=e?t.extend(e,i):i}},a={};return t.each(r,function(t,e){var n=e[2],s=e[3];i[e[1]]=n.add,s&&n.add(function(){o=s},r[1^t][2].disable,r[2][2].lock),a[e[0]]=function(){return a[e[0]+"With"](this===a?i:this,arguments),this},a[e[0]+"With"]=n.fireWith}),i.promise(a),n&&n.call(a,a),a}var n=Array.prototype.slice;t.when=function(r){var o,i,a,s=n.call(arguments),c=s.length,u=0,l=1!==c||r&&t.isFunction(r.promise)?c:0,f=1===l?r:e(),p=function(t,e,r){return function(i){e[t]=this,r[t]=arguments.length>1?n.call(arguments):i,r===o?f.notifyWith(e,r):--l||f.resolveWith(e,r)}};if(c>1)for(o=new Array(c),i=new Array(c),a=new Array(c);c>u;++u)s[u]&&t.isFunction(s[u].promise)?s[u].promise().done(p(u,a,s)).fail(f.reject).progress(p(u,i,o)):--l;return l||f.resolveWith(a,s),f.promise()},t.Deferred=e}(r),function(t){function e(t,e,n,r){return Math.abs(t-e)>=Math.abs(n-r)?t-e>0?"Left":"Right":n-r>0?"Up":"Down"}function n(){l=null,p.last&&(p.el.trigger("longTap"),p={})}function r(){l&&clearTimeout(l),l=null}function o(){s&&clearTimeout(s),c&&clearTimeout(c),u&&clearTimeout(u),l&&clearTimeout(l),s=c=u=l=null,p={}}function i(t){return("touch"==t.pointerType||t.pointerType==t.MSPOINTER_TYPE_TOUCH)&&t.isPrimary}function a(t,e){return t.type=="pointer"+e||t.type.toLowerCase()=="mspointer"+e}var s,c,u,l,f,p={},h=750;t(document).ready(function(){var m,d,g,v,y=0,b=0;"MSGesture"in window&&(f=new MSGesture,f.target=document.body),t(document).bind("MSGestureEnd",function(t){var e=t.velocityX>1?"Right":t.velocityX<-1?"Left":t.velocityY>1?"Down":t.velocityY<-1?"Up":null;e&&(p.el.trigger("swipe"),p.el.trigger("swipe"+e))}).on("touchstart MSPointerDown pointerdown",function(e){(!(v=a(e,"down"))||i(e))&&(g=v?e:e.touches[0],e.touches&&1===e.touches.length&&p.x2&&(p.x2=void 0,p.y2=void 0),m=Date.now(),d=m-(p.last||m),p.el=t("tagName"in g.target?g.target:g.target.parentNode),s&&clearTimeout(s),p.x1=g.pageX,p.y1=g.pageY,d>0&&250>=d&&(p.isDoubleTap=!0),p.last=m,l=setTimeout(n,h),f&&v&&f.addPointer(e.pointerId))}).on("touchmove MSPointerMove pointermove",function(t){(!(v=a(t,"move"))||i(t))&&(g=v?t:t.touches[0],r(),p.x2=g.pageX,p.y2=g.pageY,y+=Math.abs(p.x1-p.x2),b+=Math.abs(p.y1-p.y2))}).on("touchend MSPointerUp pointerup",function(n){(!(v=a(n,"up"))||i(n))&&(r(),p.x2&&Math.abs(p.x1-p.x2)>30||p.y2&&Math.abs(p.y1-p.y2)>30?u=setTimeout(function(){p.el.trigger("swipe"),p.el.trigger("swipe"+e(p.x1,p.x2,p.y1,p.y2)),p={}},0):"last"in p&&(30>y&&30>b?c=setTimeout(function(){var e=t.Event("tap");e.cancelTouch=o,p.el.trigger(e),p.isDoubleTap?(p.el&&p.el.trigger("doubleTap"),p={}):s=setTimeout(function(){s=null,p.el&&p.el.trigger("singleTap"),p={}},250)},0):p={}),y=b=0)}).on("touchcancel MSPointerCancel pointercancel",o),t(window).on("scroll",o)}),["swipe","swipeLeft","swipeRight","swipeUp","swipeDown","doubleTap","tap","singleTap","longTap"].forEach(function(e){t.fn[e]=function(t){return this.on(e,t)}})}(r),function(t){function e(e){return e=t(e),!(!e.width()&&!e.height())&&"none"!==e.css("display")}function n(t,e){t=t.replace(/=#\]/g,'="#"]');var n,r,o=s.exec(t);if(o&&o[2]in a&&(n=a[o[2]],r=o[3],t=o[1],r)){var i=Number(r);r=isNaN(i)?r.replace(/^["']|["']$/g,""):i}return e(t,n,r)}var r=t.zepto,o=r.qsa,i=r.matches,a=t.expr[":"]={visible:function(){return e(this)?this:void 0},hidden:function(){return e(this)?void 0:this},selected:function(){return this.selected?this:void 0},checked:function(){return this.checked?this:void 0},parent:function(){return this.parentNode},first:function(t){return 0===t?this:void 0},last:function(t,e){return t===e.length-1?this:void 0},eq:function(t,e,n){return t===n?this:void 0},contains:function(e,n,r){return t(this).text().indexOf(r)>-1?this:void 0},has:function(t,e,n){return r.qsa(this,n).length?this:void 0}},s=new RegExp("(.*):(\\w+)(?:\\(([^)]+)\\))?$\\s*"),c=/^\s*>/,u="Zepto"+ +new Date;r.qsa=function(e,i){return n(i,function(n,a,s){try{var l;!n&&a?n="*":c.test(n)&&(l=t(e).addClass(u),n="."+u+" "+n);var f=o(e,n)}catch(p){throw console.error("error performing selector: %o",i),p}finally{l&&l.removeClass(u)}return a?r.uniq(t.map(f,function(t,e){return a.call(t,e,f,s)})):f})},r.matches=function(t,e){return n(e,function(e,n,r){return!(e&&!i(t,e)||n&&n.call(t,null,r)!==t)})}}(r),function(){try{getComputedStyle(void 0)}catch(t){var e=getComputedStyle;window.getComputedStyle=function(t){try{return e(t)}catch(n){return null}}}}(),e.exports=r},{}],3:[function(t,e,n){function r(t){return"\\"+O[t]}function o(t){return!!t&&"object"==typeof t}function i(t,e,n,r){return void 0!==t&&k.call(r,n)?t:e}function a(t,e,n){var r=y(e);F.apply(r,D(e));for(var o=-1,i=r.length;++o-1&&t%1==0&&e>t}function a(t,e,n){if(!c(n))return!1;var r=typeof e;if("number"==r?o(n)&&i(e,n.length):"string"==r&&e in n){var a=n[e];return t===t?t===a:a!==a}return!1}function s(t){return"number"==typeof t&&t>-1&&t%1==0&&l>=t}function c(t){var e=typeof t;return!!t&&("object"==e||"function"==e)}var u=/^\d+$/,l=9007199254740991,f=r("length");e.exports=a},{}],8:[function(t,e,n){var r=/<%=([\s\S]+?)%>/g;e.exports=r},{}],9:[function(t,e,n){function r(t){return c[t]}function o(t){return t=i(t),t&&s.test(t)?t.replace(a,r):t}var i=t("lodash._basetostring"),a=/[&<>"'`]/g,s=RegExp(a.source),c={"&":"&","<":"<",">":">",'"':""","'":"'","`":"`"};e.exports=o},{"lodash._basetostring":5}],10:[function(t,e,n){function r(t){return!!t&&"object"==typeof t}function o(t){return null==t?!1:i(t)?l.test(c.call(t)):r(t)&&a.test(t)}var i=t("lodash.isfunction"),a=/^\[object .+?Constructor\]$/,s=Object.prototype,c=Function.prototype.toString,u=s.hasOwnProperty,l=RegExp("^"+c.call(u).replace(/[\\^$.*+?()[\]{}|]/g,"\\$&").replace(/hasOwnProperty|(function).*?(?=\\\()| for .+?(?=\\\])/g,"$1.*?")+"$");e.exports=o},{"lodash.isfunction":11}],11:[function(t,e,n){function r(t){return o(t)&&s.call(t)==i}function o(t){var e=typeof t;return!!t&&("object"==e||"function"==e)}var i="[object Function]",a=Object.prototype,s=a.toString;e.exports=r},{}],12:[function(t,e,n){function r(t){return function(e){return null==e?void 0:e[t]}}function o(t){return null!=t&&a(y(t))}function i(t,e){return t="number"==typeof t||h.test(t)?+t:-1,e=null==e?v:e,t>-1&&t%1==0&&e>t}function a(t){return"number"==typeof t&&t>-1&&t%1==0&&v>=t}function s(t){for(var e=u(t),n=e.length,r=n&&t.length,o=!!r&&a(r)&&(p(t)||f(t)),s=-1,c=[];++s0;++r-1&&t%1==0&&f>=t}function s(t){return r(t)&&i(t)&&u.call(t,"callee")&&!l.call(t,"callee")}var c=Object.prototype,u=c.hasOwnProperty,l=c.propertyIsEnumerable,f=9007199254740991,p=o("length");e.exports=s},{}],15:[function(t,e,n){function r(t){return!!t&&"object"==typeof t}function o(t,e){var n=null==t?void 0:t[e];return c(n)?n:void 0}function i(t){return"number"==typeof t&&t>-1&&t%1==0&&y>=t}function a(t){return s(t)&&d.call(t)==l}function s(t){var e=typeof t;return!!t&&("object"==e||"function"==e)}function c(t){return null==t?!1:a(t)?g.test(h.call(t)):r(t)&&f.test(t)}var u="[object Array]",l="[object Function]",f=/^\[object .+?Constructor\]$/,p=Object.prototype,h=Function.prototype.toString,m=p.hasOwnProperty,d=p.toString,g=RegExp("^"+h.call(m).replace(/[\\^$.*+?()[\]{}|]/g,"\\$&").replace(/hasOwnProperty|(function).*?(?=\\\()| for .+?(?=\\\])/g,"$1.*?")+"$"),v=o(Array,"isArray"),y=9007199254740991,b=v||function(t){return r(t)&&i(t.length)&&d.call(t)==u};e.exports=b},{}],16:[function(t,e,n){function r(t,e){if("function"!=typeof t)throw new TypeError(o);return e=i(void 0===e?t.length-1:+e||0,0),function(){for(var n=arguments,r=-1,o=i(n.length-e,0),a=Array(o);++r/g,a=/<%([\s\S]+?)%>/g,s={escape:i,evaluate:a,interpolate:r,variable:"",imports:{_:{escape:o}}};e.exports=s},{"lodash._reinterpolate":8,"lodash.escape":9}],18:[function(t,e,n){"use strict";var r=t("lodash.template");e.exports={add:r(''),form:r('

<%- addAt %> 0 <%- minutes %>

'),CSS:{add:".comments-controls[data-comments-controls]{display:inline-block;float:left;color:#fff;line-height:32px;font-size:10px;font-weight:700;margin-right:3px}.comments-controls[data-comments-controls] .add-comment{cursor:pointer;opacity:.8;font-weight:lighter}.comments-controls[data-comments-controls] .add-comment:before{font-size:16px}.comments-controls[data-comments-controls] .add-comment:hover{text-shadow:rgba(255,255,255,.8) 0 0 5px;opacity:1}.comments-bar{display:inline-block;float:left;line-height:32px;font-size:10px;font-weight:700;margin-left:6px}.comment-pointer{position:absolute;left:20px;top:8px;width:2px;height:8px;background:#90ee90;color:#90ee90;transition:background .2s linear}.comment-pointer:hover{background:red}.video-comment{color:#fff;text-align:left;font-size:12px!important}.comment-actif{padding:5px!important}.img-comment{min-width:100px;min-height:50px}.img-comment img{max-width:200px;max-height:200px}.img-comment .spinner-three-bounce{top:25%}.img-comment .spinner-three-bounce>div{width:10px;height:10px}.media-control[data-media-control] .media-control-layer[data-controls] .bar-container[data-seekbar] .bar-scrubber[data-seekbar]{z-index:99}.seek-time[data-seek-time]{height:initial!important}",form:".form-comment{position:absolute;width:50%;margin-left:auto;margin-right:auto;text-align:left;background:#fff;right:5px;bottom:100px;z-index:999999;padding:5px!important;visibility:hidden;opacity:0;transition:hidden 0s .2s,opacity .2s linear;border-radius:5px;cursor:default}.form-comment button,.form-comment input,.form-comment textarea{font:initial;font-size:initial;line-height:initial;color:initial}.form-comment p{color:initial;font-size:initial!important}.form-comment input[type=file]{display:none}.form-comment textarea{width:100%}.form-comment .submit-comment{text-align:center}.show-form{visibility:visible;opacity:.9}"}}},{"lodash.template":3}],19:[function(t,e,n){"use strict";var r=function(){function t(t,e){for(var n in e){var r=e[n];r.configurable=!0,r.value&&(r.writable=!0)}Object.defineProperties(t,e)}return function(e,n,r){return n&&t(e.prototype,n),r&&t(e,r),e}}(),o=function f(t,e,n){var r=Object.getOwnPropertyDescriptor(t,e);if(void 0===r){var o=Object.getPrototypeOf(t);return null===o?void 0:f(o,e,n)}if("value"in r&&r.writable)return r.value;var i=r.get;return void 0===i?void 0:i.call(n)},i=function(t,e){if("function"!=typeof e&&null!==e)throw new TypeError("Super expression must either be null or a function, not "+typeof e);t.prototype=Object.create(e&&e.prototype,{constructor:{value:t,enumerable:!1,writable:!0,configurable:!0}}),e&&(t.__proto__=e)},a=function(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")},s=Clappr.UICorePlugin,c=t("./jst"),u=t("./styler"),l=(Clappr.Events,function(t){function e(t){a(this,e),o(Object.getPrototypeOf(e.prototype),"constructor",this).call(this,t),this.core=t,this.actualTime=0}return i(e,t),r(e,{name:{get:function(){return"comments"}},events:{get:function(){return{"click .add-comment":"clickOnContainer"}}},attributes:{get:function(){return{"class":"comments-controls","data-comments-controls":""}}},bindEvents:{value:function(){this.listenTo(this.core.mediaControl,"mediacontrol:rendered",this.make),this.listenTo(this.core.mediaControl.container,"container:timeupdate",this.timeUpdate),this.listenTo(this.core.mediaControl.container,"container:play",this.play)}},render:{value:function(){this.core.options.commentImg=void 0!=this.core.options.commentImg?this.core.options.commentImg:!0,this.videoId=this.core.$el.parent().attr("data-video-id"),this.make()}},play:{value:function(){this.dismissForm()}},make:{value:function(){var t=this,e=u.getStyleFor("add");console.log(e[0]),this.$playButton=this.core.mediaControl.$el.find(".media-control-button"),this.$el.html(c.add).append(e[0]),this.core.mediaControl.$(".media-control-right-panel[data-media-control]").append(this.$el);var n=u.getStyleFor("form"),r='",this.$el.formComment=document.createElement("div"),this.core.options.texts)var o={addAt:this.core.options.texts.addComment?this.core.options.texts.addComment:"Add a comment at",minutes:this.core.options.texts.minutes?this.core.options.texts.minutes:"minutes",placeholder:this.core.options.texts.commentPlaceholder?this.core.options.texts.commentPlaceholder:"Put a comment here",send:this.core.options.texts.sendComment?this.core.options.texts.sendComment:"Send"};else var o={addAt:"Add a comment at",minutes:"minutes",placeholder:"Put a comment here",send:"Send"};$(this.$el.formComment).html(c.form(o)).addClass("form-comment").append(n[0]).append(r),this.core.mediaControl.container.$el.append(this.$el.formComment),this.core.mediaControl.container.$el.find(".form-comment").click(function(t){t.stopPropagation()}),this.core.options.iconComment?this.core.mediaControl.$el.find(".add-comment").addClass(this.core.options.iconComment):this.core.options.texts&&this.core.options.texts.addCommentLink?this.core.mediaControl.$el.find(".add-comment").text(this.core.options.texts.addCommentLink):this.core.mediaControl.$el.find(".add-comment").text("Comment"),this.core.options.enablePicture&&this.core.mediaControl.container.$el.find('input[type="file"]').show(),isNaN(this.core.mediaControl.container.getDuration())?this.videoUnReady=!0:this.getComments(this.core.options.videoId),this.core.mediaControl.container.$el.find(".submit-comment").click(function(){return t.submitComment(t)}),this.core.mediaControl.$seekBarContainer.append(this.commentPointer),this.core.mediaControl.seekTime.$el.prepend('
')}},getComments:{value:function(t){if(!this.pointers){if(this.pointers=new Array,!this.core.options.urlGetComments)return void alert('An url is needed in the options for the API (POST). Option "urlGetComments"');$.get(this.core.options.urlGetComments+"/"+t,function(t){for(var e=0;e
');var n=$("").attr("src",$(e).attr("data-imgUrl"));n.on("load",function(){console.log("test"),this.complete&&"undefined"!=typeof this.naturalWidth&&0!=this.naturalWidth&&(console.log(this),t.core.mediaControl.seekTime.$(".img-comment").html(this))})}}},hideComment:{value:function(t){t.core.mediaControl.seekTime.$(".video-comment").html("").removeClass("comment-actif")}},submitComment:{value:function(t){if(!this.core.options.urlAddComments)return void alert('An url is needed in the options for the API (POST). Option "urlAddComments"');var e=t.core.mediaControl.container.$el.find("form"),n=new FormData;if(this.core.options.enablePicture){var r=$('input[type="file"]')[1].files;1==r.length&&n.append("picture",r[0])}var o=$(e).serializeArray();$.each(o,function(t,e){n.append(e.name,e.value)}),n.append("time",Math.round(t.actualTime)),$.ajax({url:this.core.options.urlAddComments,type:"POST",data:n,async:!1,success:function(e){t.createCommentPointer(e),t.displayingComment(t),t.dismissForm()},cache:!1,contentType:!1,processData:!1})}},dismissForm:{value:function(){"visible"==$(this.$el.formComment).css("visibility")&&$(this.$el.formComment).removeClass("show-form")}},clickOnContainer:{value:function(){if("visible"==$(this.$el.formComment).css("visibility"))$(this.$el.formComment).removeClass("show-form");else{this.core.mediaControl.container.pause(),this.$playButton.addClass("paused");var t=Math.round(this.actualTime)/100;$(this.$el.formComment).find(".comment-time").text(t),$(this.$el.formComment).addClass("show-form")}}},timeUpdate:{value:function(t,e){this.actualTime=t,"visible"==$(this.$el.formComment).css("visibility")&&$(this.$el.formComment).find(".comment-time").text(Math.round(this.actualTime)/100),this.videoUnReady&&1==this.videoUnReady&&(this.getComments(this.core.options.videoId),0==this.videoUnReady)}}}),e}(s));e.exports=window.Comments=l},{"./jst":18,"./styler":20}],20:[function(t,e,n){"use strict";var r=t("./jst"),o=t("clappr-zepto"),i={getStyleFor:function(t){return o("").html(r.CSS[t].toString())}};e.exports=i},{"./jst":18,"clappr-zepto":2}]},{},[1]); \ No newline at end of file +!function t(e,n,r){function o(a,s){if(!n[a]){if(!e[a]){var c="function"==typeof require&&require;if(!s&&c)return c(a,!0);if(i)return i(a,!0);var u=new Error("Cannot find module '"+a+"'");throw u.code="MODULE_NOT_FOUND",u}var l=n[a]={exports:{}};e[a][0].call(l.exports,function(t){var n=e[a][1][t];return o(n?n:t)},l,l.exports,t,e,n,r)}return n[a].exports}for(var i="function"==typeof require&&require,a=0;a0?$.fn.concat.apply([],t):t}function u(t){return t.replace(/::/g,"/").replace(/([A-Z]+)([A-Z][a-z])/g,"$1_$2").replace(/([a-z\d])([A-Z])/g,"$1_$2").replace(/_/g,"-").toLowerCase()}function l(t){return t in F?F[t]:F[t]=new RegExp("(^|\\s)"+t+"(\\s|$)")}function f(t,e){return"number"!=typeof e||D[u(t)]?e:e+"px"}function p(t){var e,n;return N[t]||(e=A.createElement(t),A.body.appendChild(e),n=getComputedStyle(e,"").getPropertyValue("display"),e.parentNode.removeChild(e),"none"==n&&(n="block"),N[t]=n),N[t]}function h(t){return"children"in t?k.call(t.children):$.map(t.childNodes,function(t){return 1==t.nodeType?t:void 0})}function m(t,e){var n,r=t?t.length:0;for(n=0;r>n;n++)this[n]=t[n];this.length=r,this.selector=e||""}function d(t,e,n){for(j in e)n&&(i(e[j])||Q(e[j]))?(i(e[j])&&!i(t[j])&&(t[j]={}),Q(e[j])&&!Q(t[j])&&(t[j]=[]),d(t[j],e[j],n)):e[j]!==C&&(t[j]=e[j])}function g(t,e){return null==e?$(t):$(t).filter(e)}function v(t,n,r,o){return e(n)?n.call(t,r,o):n}function y(t,e,n){null==n?t.removeAttribute(e):t.setAttribute(e,n)}function b(t,e){var n=t.className||"",r=n&&n.baseVal!==C;return e===C?r?n.baseVal:n:void(r?n.baseVal=e:t.className=e)}function x(t){try{return t?"true"==t||("false"==t?!1:"null"==t?null:+t+""==t?+t:/^[\[\{]/.test(t)?$.parseJSON(t):t):t}catch(e){return t}}function w(t,e){e(t);for(var n=0,r=t.childNodes.length;r>n;n++)w(t.childNodes[n],e)}var C,j,$,E,T,S,O=[],P=O.concat,_=O.filter,k=O.slice,A=window.document,N={},F={},D={"column-count":1,columns:1,"font-weight":1,"line-height":1,opacity:1,"z-index":1,zoom:1},M=/^\s*<(\w+|!)[^>]*>/,R=/^<(\w+)\s*\/?>(?:<\/\1>|)$/,L=/<(?!area|br|col|embed|hr|img|input|link|meta|param)(([\w:]+)[^>]*)\/>/gi,U=/^(?:body|html)$/i,z=/([A-Z])/g,q=["val","css","html","text","data","width","height","offset"],I=["after","prepend","before","append"],B=A.createElement("table"),W=A.createElement("tr"),Z={tr:A.createElement("tbody"),tbody:B,thead:B,tfoot:B,td:W,th:W,"*":A.createElement("div")},H=/complete|loaded|interactive/,X=/^[\w-]*$/,V={},G=V.toString,Y={},J=A.createElement("div"),K={tabindex:"tabIndex",readonly:"readOnly","for":"htmlFor","class":"className",maxlength:"maxLength",cellspacing:"cellSpacing",cellpadding:"cellPadding",rowspan:"rowSpan",colspan:"colSpan",usemap:"useMap",frameborder:"frameBorder",contenteditable:"contentEditable"},Q=Array.isArray||function(t){return t instanceof Array};return Y.matches=function(t,e){if(!e||!t||1!==t.nodeType)return!1;var n=t.webkitMatchesSelector||t.mozMatchesSelector||t.oMatchesSelector||t.matchesSelector;if(n)return n.call(t,e);var r,o=t.parentNode,i=!o;return i&&(o=J).appendChild(t),r=~Y.qsa(o,e).indexOf(t),i&&J.removeChild(t),r},T=function(t){return t.replace(/-+(.)?/g,function(t,e){return e?e.toUpperCase():""})},S=function(t){return _.call(t,function(e,n){return t.indexOf(e)==n})},Y.fragment=function(t,e,n){var r,o,a;return R.test(t)&&(r=$(A.createElement(RegExp.$1))),r||(t.replace&&(t=t.replace(L,"<$1>")),e===C&&(e=M.test(t)&&RegExp.$1),e in Z||(e="*"),a=Z[e],a.innerHTML=""+t,r=$.each(k.call(a.childNodes),function(){a.removeChild(this)})),i(n)&&(o=$(r),$.each(n,function(t,e){q.indexOf(t)>-1?o[t](e):o.attr(t,e)})),r},Y.Z=function(t,e){return new m(t,e)},Y.isZ=function(t){return t instanceof Y.Z},Y.init=function(t,n){var r;if(!t)return Y.Z();if("string"==typeof t)if(t=t.trim(),"<"==t[0]&&M.test(t))r=Y.fragment(t,RegExp.$1,n),t=null;else{if(n!==C)return $(n).find(t);r=Y.qsa(A,t)}else{if(e(t))return $(A).ready(t);if(Y.isZ(t))return t;if(Q(t))r=s(t);else if(o(t))r=[t],t=null;else if(M.test(t))r=Y.fragment(t.trim(),RegExp.$1,n),t=null;else{if(n!==C)return $(n).find(t);r=Y.qsa(A,t)}}return Y.Z(r,t)},$=function(t,e){return Y.init(t,e)},$.extend=function(t){var e,n=k.call(arguments,1);return"boolean"==typeof t&&(e=t,t=n.shift()),n.forEach(function(n){d(t,n,e)}),t},Y.qsa=function(t,e){var n,r="#"==e[0],o=!r&&"."==e[0],i=r||o?e.slice(1):e,a=X.test(i);return t.getElementById&&a&&r?(n=t.getElementById(i))?[n]:[]:1!==t.nodeType&&9!==t.nodeType&&11!==t.nodeType?[]:k.call(a&&!r&&t.getElementsByClassName?o?t.getElementsByClassName(i):t.getElementsByTagName(e):t.querySelectorAll(e))},$.contains=A.documentElement.contains?function(t,e){return t!==e&&t.contains(e)}:function(t,e){for(;e&&(e=e.parentNode);)if(e===t)return!0;return!1},$.type=t,$.isFunction=e,$.isWindow=n,$.isArray=Q,$.isPlainObject=i,$.isEmptyObject=function(t){var e;for(e in t)return!1;return!0},$.inArray=function(t,e,n){return O.indexOf.call(e,t,n)},$.camelCase=T,$.trim=function(t){return null==t?"":String.prototype.trim.call(t)},$.uuid=0,$.support={},$.expr={},$.noop=function(){},$.map=function(t,e){var n,r,o,i=[];if(a(t))for(r=0;r=0?t:t+this.length]},toArray:function(){return this.get()},size:function(){return this.length},remove:function(){return this.each(function(){null!=this.parentNode&&this.parentNode.removeChild(this)})},each:function(t){return O.every.call(this,function(e,n){return t.call(e,n,e)!==!1}),this},filter:function(t){return e(t)?this.not(this.not(t)):$(_.call(this,function(e){return Y.matches(e,t)}))},add:function(t,e){return $(S(this.concat($(t,e))))},is:function(t){return this.length>0&&Y.matches(this[0],t)},not:function(t){var n=[];if(e(t)&&t.call!==C)this.each(function(e){t.call(this,e)||n.push(this)});else{var r="string"==typeof t?this.filter(t):a(t)&&e(t.item)?k.call(t):$(t);this.forEach(function(t){r.indexOf(t)<0&&n.push(t)})}return $(n)},has:function(t){return this.filter(function(){return o(t)?$.contains(this,t):$(this).find(t).size()})},eq:function(t){return-1===t?this.slice(t):this.slice(t,+t+1)},first:function(){var t=this[0];return t&&!o(t)?t:$(t)},last:function(){var t=this[this.length-1];return t&&!o(t)?t:$(t)},find:function(t){var e,n=this;return e=t?"object"==typeof t?$(t).filter(function(){var t=this;return O.some.call(n,function(e){return $.contains(e,t)})}):1==this.length?$(Y.qsa(this[0],t)):this.map(function(){return Y.qsa(this,t)}):$()},closest:function(t,e){var n=this[0],o=!1;for("object"==typeof t&&(o=$(t));n&&!(o?o.indexOf(n)>=0:Y.matches(n,t));)n=n!==e&&!r(n)&&n.parentNode;return $(n)},parents:function(t){for(var e=[],n=this;n.length>0;)n=$.map(n,function(t){return(t=t.parentNode)&&!r(t)&&e.indexOf(t)<0?(e.push(t),t):void 0});return g(e,t)},parent:function(t){return g(S(this.pluck("parentNode")),t)},children:function(t){return g(this.map(function(){return h(this)}),t)},contents:function(){return this.map(function(){return this.contentDocument||k.call(this.childNodes)})},siblings:function(t){return g(this.map(function(t,e){return _.call(h(e.parentNode),function(t){return t!==e})}),t)},empty:function(){return this.each(function(){this.innerHTML=""})},pluck:function(t){return $.map(this,function(e){return e[t]})},show:function(){return this.each(function(){"none"==this.style.display&&(this.style.display=""),"none"==getComputedStyle(this,"").getPropertyValue("display")&&(this.style.display=p(this.nodeName))})},replaceWith:function(t){return this.before(t).remove()},wrap:function(t){var n=e(t);if(this[0]&&!n)var r=$(t).get(0),o=r.parentNode||this.length>1;return this.each(function(e){$(this).wrapAll(n?t.call(this,e):o?r.cloneNode(!0):r)})},wrapAll:function(t){if(this[0]){$(this[0]).before(t=$(t));for(var e;(e=t.children()).length;)t=e.first();$(t).append(this)}return this},wrapInner:function(t){var n=e(t);return this.each(function(e){var r=$(this),o=r.contents(),i=n?t.call(this,e):t;o.length?o.wrapAll(i):r.append(i)})},unwrap:function(){return this.parent().each(function(){$(this).replaceWith($(this).children())}),this},clone:function(){return this.map(function(){return this.cloneNode(!0)})},hide:function(){return this.css("display","none")},toggle:function(t){return this.each(function(){var e=$(this);(t===C?"none"==e.css("display"):t)?e.show():e.hide()})},prev:function(t){return $(this.pluck("previousElementSibling")).filter(t||"*")},next:function(t){return $(this.pluck("nextElementSibling")).filter(t||"*")},html:function(t){return 0 in arguments?this.each(function(e){var n=this.innerHTML;$(this).empty().append(v(this,t,e,n))}):0 in this?this[0].innerHTML:null},text:function(t){return 0 in arguments?this.each(function(e){var n=v(this,t,e,this.textContent);this.textContent=null==n?"":""+n}):0 in this?this[0].textContent:null},attr:function(t,e){var n;return"string"!=typeof t||1 in arguments?this.each(function(n){if(1===this.nodeType)if(o(t))for(j in t)y(this,j,t[j]);else y(this,t,v(this,e,n,this.getAttribute(t)))}):this.length&&1===this[0].nodeType?!(n=this[0].getAttribute(t))&&t in this[0]?this[0][t]:n:C},removeAttr:function(t){return this.each(function(){1===this.nodeType&&t.split(" ").forEach(function(t){y(this,t)},this)})},prop:function(t,e){return t=K[t]||t,1 in arguments?this.each(function(n){this[t]=v(this,e,n,this[t])}):this[0]&&this[0][t]},data:function(t,e){var n="data-"+t.replace(z,"-$1").toLowerCase(),r=1 in arguments?this.attr(n,e):this.attr(n);return null!==r?x(r):C},val:function(t){return 0 in arguments?this.each(function(e){this.value=v(this,t,e,this.value)}):this[0]&&(this[0].multiple?$(this[0]).find("option").filter(function(){return this.selected}).pluck("value"):this[0].value)},offset:function(t){if(t)return this.each(function(e){var n=$(this),r=v(this,t,e,n.offset()),o=n.offsetParent().offset(),i={top:r.top-o.top,left:r.left-o.left};"static"==n.css("position")&&(i.position="relative"),n.css(i)});if(!this.length)return null;if(!$.contains(A.documentElement,this[0]))return{top:0,left:0};var e=this[0].getBoundingClientRect();return{left:e.left+window.pageXOffset,top:e.top+window.pageYOffset,width:Math.round(e.width),height:Math.round(e.height)}},css:function(e,n){if(arguments.length<2){var r,o=this[0];if(!o)return;if(r=getComputedStyle(o,""),"string"==typeof e)return o.style[T(e)]||r.getPropertyValue(e);if(Q(e)){var i={};return $.each(e,function(t,e){i[e]=o.style[T(e)]||r.getPropertyValue(e)}),i}}var a="";if("string"==t(e))n||0===n?a=u(e)+":"+f(e,n):this.each(function(){this.style.removeProperty(u(e))});else for(j in e)e[j]||0===e[j]?a+=u(j)+":"+f(j,e[j])+";":this.each(function(){this.style.removeProperty(u(j))});return this.each(function(){this.style.cssText+=";"+a})},index:function(t){return t?this.indexOf($(t)[0]):this.parent().children().indexOf(this[0])},hasClass:function(t){return t?O.some.call(this,function(t){return this.test(b(t))},l(t)):!1},addClass:function(t){return t?this.each(function(e){if("className"in this){E=[];var n=b(this),r=v(this,t,e,n);r.split(/\s+/g).forEach(function(t){$(this).hasClass(t)||E.push(t)},this),E.length&&b(this,n+(n?" ":"")+E.join(" "))}}):this},removeClass:function(t){return this.each(function(e){if("className"in this){if(t===C)return b(this,"");E=b(this),v(this,t,e,E).split(/\s+/g).forEach(function(t){E=E.replace(l(t)," ")}),b(this,E.trim())}})},toggleClass:function(t,e){return t?this.each(function(n){var r=$(this),o=v(this,t,n,b(this));o.split(/\s+/g).forEach(function(t){(e===C?!r.hasClass(t):e)?r.addClass(t):r.removeClass(t)})}):this},scrollTop:function(t){if(this.length){var e="scrollTop"in this[0];return t===C?e?this[0].scrollTop:this[0].pageYOffset:this.each(e?function(){this.scrollTop=t}:function(){this.scrollTo(this.scrollX,t)})}},scrollLeft:function(t){if(this.length){var e="scrollLeft"in this[0];return t===C?e?this[0].scrollLeft:this[0].pageXOffset:this.each(e?function(){this.scrollLeft=t}:function(){this.scrollTo(t,this.scrollY)})}},position:function(){if(this.length){var t=this[0],e=this.offsetParent(),n=this.offset(),r=U.test(e[0].nodeName)?{top:0,left:0}:e.offset();return n.top-=parseFloat($(t).css("margin-top"))||0,n.left-=parseFloat($(t).css("margin-left"))||0,r.top+=parseFloat($(e[0]).css("border-top-width"))||0,r.left+=parseFloat($(e[0]).css("border-left-width"))||0,{top:n.top-r.top,left:n.left-r.left}}},offsetParent:function(){return this.map(function(){for(var t=this.offsetParent||A.body;t&&!U.test(t.nodeName)&&"static"==$(t).css("position");)t=t.offsetParent;return t})}},$.fn.detach=$.fn.remove,["width","height"].forEach(function(t){var e=t.replace(/./,function(t){return t[0].toUpperCase()});$.fn[t]=function(o){var i,a=this[0];return o===C?n(a)?a["inner"+e]:r(a)?a.documentElement["scroll"+e]:(i=this.offset())&&i[t]:this.each(function(e){a=$(this),a.css(t,v(this,o,e,a[t]()))})}}),I.forEach(function(e,n){var r=n%2;$.fn[e]=function(){var e,o,i=$.map(arguments,function(n){return e=t(n),"object"==e||"array"==e||null==n?n:Y.fragment(n)}),a=this.length>1;return i.length<1?this:this.each(function(t,e){o=r?e:e.parentNode,e=0==n?e.nextSibling:1==n?e.firstChild:2==n?e:null;var s=$.contains(A.documentElement,o);i.forEach(function(t){if(a)t=t.cloneNode(!0);else if(!o)return $(t).remove();o.insertBefore(t,e),s&&w(t,function(t){null==t.nodeName||"SCRIPT"!==t.nodeName.toUpperCase()||t.type&&"text/javascript"!==t.type||t.src||window.eval.call(window,t.innerHTML)})})})},$.fn[r?e+"To":"insert"+(n?"Before":"After")]=function(t){return $(t)[e](this),this}}),Y.Z.prototype=m.prototype=$.fn,Y.uniq=S,Y.deserializeValue=x,$.zepto=Y,$}();window.Zepto=r,void 0===window.$&&(window.$=r),function(t){function e(t){return t._zid||(t._zid=p++)}function n(t,n,i,a){if(n=r(n),n.ns)var s=o(n.ns);return(g[e(t)]||[]).filter(function(t){return!(!t||n.e&&t.e!=n.e||n.ns&&!s.test(t.ns)||i&&e(t.fn)!==e(i)||a&&t.sel!=a)})}function r(t){var e=(""+t).split(".");return{e:e[0],ns:e.slice(1).sort().join(" ")}}function o(t){return new RegExp("(?:^| )"+t.replace(" "," .* ?")+"(?: |$)")}function i(t,e){return t.del&&!y&&t.e in b||!!e}function a(t){return x[t]||y&&b[t]||t}function s(n,o,s,c,l,p,h){var m=e(n),d=g[m]||(g[m]=[]);o.split(/\s/).forEach(function(e){if("ready"==e)return t(document).ready(s);var o=r(e);o.fn=s,o.sel=l,o.e in x&&(s=function(e){var n=e.relatedTarget;return!n||n!==this&&!t.contains(this,n)?o.fn.apply(this,arguments):void 0}),o.del=p;var m=p||s;o.proxy=function(t){if(t=u(t),!t.isImmediatePropagationStopped()){t.data=c;var e=m.apply(n,t._args==f?[t]:[t].concat(t._args));return e===!1&&(t.preventDefault(),t.stopPropagation()),e}},o.i=d.length,d.push(o),"addEventListener"in n&&n.addEventListener(a(o.e),o.proxy,i(o,h))})}function c(t,r,o,s,c){var u=e(t);(r||"").split(/\s/).forEach(function(e){n(t,e,o,s).forEach(function(e){delete g[u][e.i],"removeEventListener"in t&&t.removeEventListener(a(e.e),e.proxy,i(e,c))})})}function u(e,n){return(n||!e.isDefaultPrevented)&&(n||(n=e),t.each($,function(t,r){var o=n[t];e[t]=function(){return this[r]=w,o&&o.apply(n,arguments)},e[r]=C}),(n.defaultPrevented!==f?n.defaultPrevented:"returnValue"in n?n.returnValue===!1:n.getPreventDefault&&n.getPreventDefault())&&(e.isDefaultPrevented=w)),e}function l(t){var e,n={originalEvent:t};for(e in t)j.test(e)||t[e]===f||(n[e]=t[e]);return u(n,t)}var f,p=1,h=Array.prototype.slice,m=t.isFunction,d=function(t){return"string"==typeof t},g={},v={},y="onfocusin"in window,b={focus:"focusin",blur:"focusout"},x={mouseenter:"mouseover",mouseleave:"mouseout"};v.click=v.mousedown=v.mouseup=v.mousemove="MouseEvents",t.event={add:s,remove:c},t.proxy=function(n,r){var o=2 in arguments&&h.call(arguments,2);if(m(n)){var i=function(){return n.apply(r,o?o.concat(h.call(arguments)):arguments)};return i._zid=e(n),i}if(d(r))return o?(o.unshift(n[r],n),t.proxy.apply(null,o)):t.proxy(n[r],n);throw new TypeError("expected function")},t.fn.bind=function(t,e,n){return this.on(t,e,n)},t.fn.unbind=function(t,e){return this.off(t,e)},t.fn.one=function(t,e,n,r){return this.on(t,e,n,r,1)};var w=function(){return!0},C=function(){return!1},j=/^([A-Z]|returnValue$|layer[XY]$)/,$={preventDefault:"isDefaultPrevented",stopImmediatePropagation:"isImmediatePropagationStopped",stopPropagation:"isPropagationStopped"};t.fn.delegate=function(t,e,n){return this.on(e,t,n)},t.fn.undelegate=function(t,e,n){return this.off(e,t,n)},t.fn.live=function(e,n){return t(document.body).delegate(this.selector,e,n),this},t.fn.die=function(e,n){return t(document.body).undelegate(this.selector,e,n),this},t.fn.on=function(e,n,r,o,i){var a,u,p=this;return e&&!d(e)?(t.each(e,function(t,e){p.on(t,n,r,e,i)}),p):(d(n)||m(o)||o===!1||(o=r,r=n,n=f),(o===f||r===!1)&&(o=r,r=f),o===!1&&(o=C),p.each(function(f,p){i&&(a=function(t){return c(p,t.type,o),o.apply(this,arguments)}),n&&(u=function(e){var r,i=t(e.target).closest(n,p).get(0);return i&&i!==p?(r=t.extend(l(e),{currentTarget:i,liveFired:p}),(a||o).apply(i,[r].concat(h.call(arguments,1)))):void 0}),s(p,e,o,r,n,u||a)}))},t.fn.off=function(e,n,r){var o=this;return e&&!d(e)?(t.each(e,function(t,e){o.off(t,n,e)}),o):(d(n)||m(r)||r===!1||(r=n,n=f),r===!1&&(r=C),o.each(function(){c(this,e,r,n)}))},t.fn.trigger=function(e,n){return e=d(e)||t.isPlainObject(e)?t.Event(e):u(e),e._args=n,this.each(function(){e.type in b&&"function"==typeof this[e.type]?this[e.type]():"dispatchEvent"in this?this.dispatchEvent(e):t(this).triggerHandler(e,n)})},t.fn.triggerHandler=function(e,r){var o,i;return this.each(function(a,s){o=l(d(e)?t.Event(e):e),o._args=r,o.target=s,t.each(n(s,e.type||e),function(t,e){return i=e.proxy(o),o.isImmediatePropagationStopped()?!1:void 0})}),i},"focusin focusout focus blur load resize scroll unload click dblclick mousedown mouseup mousemove mouseover mouseout mouseenter mouseleave change select keydown keypress keyup error".split(" ").forEach(function(e){t.fn[e]=function(t){return 0 in arguments?this.bind(e,t):this.trigger(e)}}),t.Event=function(t,e){d(t)||(e=t,t=e.type);var n=document.createEvent(v[t]||"Events"),r=!0;if(e)for(var o in e)"bubbles"==o?r=!!e[o]:n[o]=e[o];return n.initEvent(t,r,!0),u(n)}}(r),function(t){function e(e,n,r){var o=t.Event(n);return t(e).trigger(o,r),!o.isDefaultPrevented()}function n(t,n,r,o){return t.global?e(n||y,r,o):void 0}function r(e){e.global&&0===t.active++&&n(e,null,"ajaxStart")}function o(e){e.global&&!--t.active&&n(e,null,"ajaxStop")}function i(t,e){var r=e.context;return e.beforeSend.call(r,t,e)===!1||n(e,r,"ajaxBeforeSend",[t,e])===!1?!1:void n(e,r,"ajaxSend",[t,e])}function a(t,e,r,o){var i=r.context,a="success";r.success.call(i,t,a,e),o&&o.resolveWith(i,[t,a,e]),n(r,i,"ajaxSuccess",[e,r,t]),c(a,e,r)}function s(t,e,r,o,i){var a=o.context;o.error.call(a,r,e,t),i&&i.rejectWith(a,[r,e,t]),n(o,a,"ajaxError",[r,o,t||e]),c(e,r,o)}function c(t,e,r){var i=r.context;r.complete.call(i,e,t),n(r,i,"ajaxComplete",[e,r]),o(r)}function u(){}function l(t){return t&&(t=t.split(";",2)[0]),t&&(t==j?"html":t==C?"json":x.test(t)?"script":w.test(t)&&"xml")||"text"}function f(t,e){return""==e?t:(t+"&"+e).replace(/[&?]{1,2}/,"?")}function p(e){e.processData&&e.data&&"string"!=t.type(e.data)&&(e.data=t.param(e.data,e.traditional)),!e.data||e.type&&"GET"!=e.type.toUpperCase()||(e.url=f(e.url,e.data),e.data=void 0)}function h(e,n,r,o){return t.isFunction(n)&&(o=r,r=n,n=void 0),t.isFunction(r)||(o=r,r=void 0),{url:e,data:n,success:r,dataType:o}}function m(e,n,r,o){var i,a=t.isArray(n),s=t.isPlainObject(n);t.each(n,function(n,c){i=t.type(c),o&&(n=r?o:o+"["+(s||"object"==i||"array"==i?n:"")+"]"),!o&&a?e.add(c.name,c.value):"array"==i||!r&&"object"==i?m(e,c,r,n):e.add(n,c)})}var d,g,v=0,y=window.document,b=/)<[^<]*)*<\/script>/gi,x=/^(?:text|application)\/javascript/i,w=/^(?:text|application)\/xml/i,C="application/json",j="text/html",$=/^\s*$/,E=y.createElement("a");E.href=window.location.href,t.active=0,t.ajaxJSONP=function(e,n){if(!("type"in e))return t.ajax(e);var r,o,c=e.jsonpCallback,u=(t.isFunction(c)?c():c)||"jsonp"+ ++v,l=y.createElement("script"),f=window[u],p=function(e){t(l).triggerHandler("error",e||"abort")},h={abort:p};return n&&n.promise(h),t(l).on("load error",function(i,c){clearTimeout(o),t(l).off().remove(),"error"!=i.type&&r?a(r[0],h,e,n):s(null,c||"error",h,e,n),window[u]=f,r&&t.isFunction(f)&&f(r[0]),f=r=void 0}),i(h,e)===!1?(p("abort"),h):(window[u]=function(){r=arguments},l.src=e.url.replace(/\?(.+)=\?/,"?$1="+u),y.head.appendChild(l),e.timeout>0&&(o=setTimeout(function(){p("timeout")},e.timeout)),h)},t.ajaxSettings={type:"GET",beforeSend:u,success:u,error:u,complete:u,context:null,global:!0,xhr:function(){return new window.XMLHttpRequest},accepts:{script:"text/javascript, application/javascript, application/x-javascript",json:C,xml:"application/xml, text/xml",html:j,text:"text/plain"},crossDomain:!1,timeout:0,processData:!0,cache:!0},t.ajax=function(e){var n,o,c=t.extend({},e||{}),h=t.Deferred&&t.Deferred();for(d in t.ajaxSettings)void 0===c[d]&&(c[d]=t.ajaxSettings[d]);r(c),c.crossDomain||(n=y.createElement("a"),n.href=c.url,n.href=n.href,c.crossDomain=E.protocol+"//"+E.host!=n.protocol+"//"+n.host),c.url||(c.url=window.location.toString()),(o=c.url.indexOf("#"))>-1&&(c.url=c.url.slice(0,o)),p(c);var m=c.dataType,v=/\?.+=\?/.test(c.url);if(v&&(m="jsonp"),c.cache!==!1&&(e&&e.cache===!0||"script"!=m&&"jsonp"!=m)||(c.url=f(c.url,"_="+Date.now())),"jsonp"==m)return v||(c.url=f(c.url,c.jsonp?c.jsonp+"=?":c.jsonp===!1?"":"callback=?")),t.ajaxJSONP(c,h);var b,x=c.accepts[m],w={},C=function(t,e){w[t.toLowerCase()]=[t,e]},j=/^([\w-]+:)\/\//.test(c.url)?RegExp.$1:window.location.protocol,T=c.xhr(),S=T.setRequestHeader;if(h&&h.promise(T),c.crossDomain||C("X-Requested-With","XMLHttpRequest"),C("Accept",x||"*/*"),(x=c.mimeType||x)&&(x.indexOf(",")>-1&&(x=x.split(",",2)[0]),T.overrideMimeType&&T.overrideMimeType(x)),(c.contentType||c.contentType!==!1&&c.data&&"GET"!=c.type.toUpperCase())&&C("Content-Type",c.contentType||"application/x-www-form-urlencoded"),c.headers)for(g in c.headers)C(g,c.headers[g]);if(T.setRequestHeader=C,T.onreadystatechange=function(){if(4==T.readyState){T.onreadystatechange=u,clearTimeout(b);var e,n=!1;if(T.status>=200&&T.status<300||304==T.status||0==T.status&&"file:"==j){m=m||l(c.mimeType||T.getResponseHeader("content-type")),e=T.responseText;try{"script"==m?(1,eval)(e):"xml"==m?e=T.responseXML:"json"==m&&(e=$.test(e)?null:t.parseJSON(e))}catch(r){n=r}n?s(n,"parsererror",T,c,h):a(e,T,c,h)}else s(T.statusText||null,T.status?"error":"abort",T,c,h)}},i(T,c)===!1)return T.abort(),s(null,"abort",T,c,h),T;if(c.xhrFields)for(g in c.xhrFields)T[g]=c.xhrFields[g];var O="async"in c?c.async:!0;T.open(c.type,c.url,O,c.username,c.password);for(g in w)S.apply(T,w[g]);return c.timeout>0&&(b=setTimeout(function(){T.onreadystatechange=u,T.abort(),s(null,"timeout",T,c,h)},c.timeout)),T.send(c.data?c.data:null),T},t.get=function(){return t.ajax(h.apply(null,arguments))},t.post=function(){var e=h.apply(null,arguments);return e.type="POST",t.ajax(e)},t.getJSON=function(){var e=h.apply(null,arguments);return e.dataType="json",t.ajax(e)},t.fn.load=function(e,n,r){if(!this.length)return this;var o,i=this,a=e.split(/\s/),s=h(e,n,r),c=s.success;return a.length>1&&(s.url=a[0],o=a[1]),s.success=function(e){i.html(o?t("
").html(e.replace(b,"")).find(o):e),c&&c.apply(i,arguments)},t.ajax(s),this};var T=encodeURIComponent;t.param=function(e,n){var r=[];return r.add=function(e,n){t.isFunction(n)&&(n=n()),null==n&&(n=""),this.push(T(e)+"="+T(n))},m(r,e,n),r.join("&").replace(/%20/g,"+")}}(r),function(t){t.Callbacks=function(e){e=t.extend({},e);var n,r,o,i,a,s,c=[],u=!e.once&&[],l=function(t){for(n=e.memory&&t,r=!0,s=i||0,i=0,a=c.length,o=!0;c&&a>s;++s)if(c[s].apply(t[0],t[1])===!1&&e.stopOnFalse){n=!1;break}o=!1,c&&(u?u.length&&l(u.shift()):n?c.length=0:f.disable())},f={add:function(){if(c){var r=c.length,s=function(n){t.each(n,function(t,n){"function"==typeof n?e.unique&&f.has(n)||c.push(n):n&&n.length&&"string"!=typeof n&&s(n)})};s(arguments),o?a=c.length:n&&(i=r,l(n))}return this},remove:function(){return c&&t.each(arguments,function(e,n){for(var r;(r=t.inArray(n,c,r))>-1;)c.splice(r,1),o&&(a>=r&&--a,s>=r&&--s)}),this},has:function(e){return!(!c||!(e?t.inArray(e,c)>-1:c.length))},empty:function(){return a=c.length=0,this},disable:function(){return c=u=n=void 0,this},disabled:function(){return!c},lock:function(){return u=void 0,n||f.disable(),this},locked:function(){return!u},fireWith:function(t,e){return!c||r&&!u||(e=e||[],e=[t,e.slice?e.slice():e],o?u.push(e):l(e)),this},fire:function(){return f.fireWith(this,arguments)},fired:function(){return!!r}};return f}}(r),function(t){function e(n){var r=[["resolve","done",t.Callbacks({once:1,memory:1}),"resolved"],["reject","fail",t.Callbacks({once:1,memory:1}),"rejected"],["notify","progress",t.Callbacks({memory:1})]],o="pending",i={state:function(){return o},always:function(){return a.done(arguments).fail(arguments),this},then:function(){var n=arguments;return e(function(e){t.each(r,function(r,o){var s=t.isFunction(n[r])&&n[r];a[o[1]](function(){var n=s&&s.apply(this,arguments);if(n&&t.isFunction(n.promise))n.promise().done(e.resolve).fail(e.reject).progress(e.notify);else{var r=this===i?e.promise():this,a=s?[n]:arguments;e[o[0]+"With"](r,a)}})}),n=null}).promise()},promise:function(e){return null!=e?t.extend(e,i):i}},a={};return t.each(r,function(t,e){var n=e[2],s=e[3];i[e[1]]=n.add,s&&n.add(function(){o=s},r[1^t][2].disable,r[2][2].lock),a[e[0]]=function(){return a[e[0]+"With"](this===a?i:this,arguments),this},a[e[0]+"With"]=n.fireWith}),i.promise(a),n&&n.call(a,a),a}var n=Array.prototype.slice;t.when=function(r){var o,i,a,s=n.call(arguments),c=s.length,u=0,l=1!==c||r&&t.isFunction(r.promise)?c:0,f=1===l?r:e(),p=function(t,e,r){return function(i){e[t]=this,r[t]=arguments.length>1?n.call(arguments):i,r===o?f.notifyWith(e,r):--l||f.resolveWith(e,r)}};if(c>1)for(o=new Array(c),i=new Array(c),a=new Array(c);c>u;++u)s[u]&&t.isFunction(s[u].promise)?s[u].promise().done(p(u,a,s)).fail(f.reject).progress(p(u,i,o)):--l;return l||f.resolveWith(a,s),f.promise()},t.Deferred=e}(r),function(t){function e(t,e,n,r){return Math.abs(t-e)>=Math.abs(n-r)?t-e>0?"Left":"Right":n-r>0?"Up":"Down"}function n(){l=null,p.last&&(p.el.trigger("longTap"),p={})}function r(){l&&clearTimeout(l),l=null}function o(){s&&clearTimeout(s),c&&clearTimeout(c),u&&clearTimeout(u),l&&clearTimeout(l),s=c=u=l=null,p={}}function i(t){return("touch"==t.pointerType||t.pointerType==t.MSPOINTER_TYPE_TOUCH)&&t.isPrimary}function a(t,e){return t.type=="pointer"+e||t.type.toLowerCase()=="mspointer"+e}var s,c,u,l,f,p={},h=750;t(document).ready(function(){var m,d,g,v,y=0,b=0;"MSGesture"in window&&(f=new MSGesture,f.target=document.body),t(document).bind("MSGestureEnd",function(t){var e=t.velocityX>1?"Right":t.velocityX<-1?"Left":t.velocityY>1?"Down":t.velocityY<-1?"Up":null;e&&(p.el.trigger("swipe"),p.el.trigger("swipe"+e))}).on("touchstart MSPointerDown pointerdown",function(e){(!(v=a(e,"down"))||i(e))&&(g=v?e:e.touches[0],e.touches&&1===e.touches.length&&p.x2&&(p.x2=void 0,p.y2=void 0),m=Date.now(),d=m-(p.last||m),p.el=t("tagName"in g.target?g.target:g.target.parentNode),s&&clearTimeout(s),p.x1=g.pageX,p.y1=g.pageY,d>0&&250>=d&&(p.isDoubleTap=!0),p.last=m,l=setTimeout(n,h),f&&v&&f.addPointer(e.pointerId))}).on("touchmove MSPointerMove pointermove",function(t){(!(v=a(t,"move"))||i(t))&&(g=v?t:t.touches[0],r(),p.x2=g.pageX,p.y2=g.pageY,y+=Math.abs(p.x1-p.x2),b+=Math.abs(p.y1-p.y2))}).on("touchend MSPointerUp pointerup",function(n){(!(v=a(n,"up"))||i(n))&&(r(),p.x2&&Math.abs(p.x1-p.x2)>30||p.y2&&Math.abs(p.y1-p.y2)>30?u=setTimeout(function(){p.el.trigger("swipe"),p.el.trigger("swipe"+e(p.x1,p.x2,p.y1,p.y2)),p={}},0):"last"in p&&(30>y&&30>b?c=setTimeout(function(){var e=t.Event("tap");e.cancelTouch=o,p.el.trigger(e),p.isDoubleTap?(p.el&&p.el.trigger("doubleTap"),p={}):s=setTimeout(function(){s=null,p.el&&p.el.trigger("singleTap"),p={}},250)},0):p={}),y=b=0)}).on("touchcancel MSPointerCancel pointercancel",o),t(window).on("scroll",o)}),["swipe","swipeLeft","swipeRight","swipeUp","swipeDown","doubleTap","tap","singleTap","longTap"].forEach(function(e){t.fn[e]=function(t){return this.on(e,t)}})}(r),function(t){function e(e){return e=t(e),!(!e.width()&&!e.height())&&"none"!==e.css("display")}function n(t,e){t=t.replace(/=#\]/g,'="#"]');var n,r,o=s.exec(t);if(o&&o[2]in a&&(n=a[o[2]],r=o[3],t=o[1],r)){var i=Number(r);r=isNaN(i)?r.replace(/^["']|["']$/g,""):i}return e(t,n,r)}var r=t.zepto,o=r.qsa,i=r.matches,a=t.expr[":"]={visible:function(){return e(this)?this:void 0},hidden:function(){return e(this)?void 0:this},selected:function(){return this.selected?this:void 0},checked:function(){return this.checked?this:void 0},parent:function(){return this.parentNode},first:function(t){return 0===t?this:void 0},last:function(t,e){return t===e.length-1?this:void 0},eq:function(t,e,n){return t===n?this:void 0},contains:function(e,n,r){return t(this).text().indexOf(r)>-1?this:void 0},has:function(t,e,n){return r.qsa(this,n).length?this:void 0}},s=new RegExp("(.*):(\\w+)(?:\\(([^)]+)\\))?$\\s*"),c=/^\s*>/,u="Zepto"+ +new Date;r.qsa=function(e,i){return n(i,function(n,a,s){try{var l;!n&&a?n="*":c.test(n)&&(l=t(e).addClass(u),n="."+u+" "+n);var f=o(e,n)}catch(p){throw console.error("error performing selector: %o",i),p}finally{l&&l.removeClass(u)}return a?r.uniq(t.map(f,function(t,e){return a.call(t,e,f,s)})):f})},r.matches=function(t,e){return n(e,function(e,n,r){return!(e&&!i(t,e)||n&&n.call(t,null,r)!==t)})}}(r),function(){try{getComputedStyle(void 0)}catch(t){var e=getComputedStyle;window.getComputedStyle=function(t){try{return e(t)}catch(n){return null}}}}(),e.exports=r},{}],3:[function(t,e,n){function r(t){return"\\"+O[t]}function o(t){return!!t&&"object"==typeof t}function i(t,e,n,r){return void 0!==t&&k.call(r,n)?t:e}function a(t,e,n){var r=y(e);F.apply(r,M(e));for(var o=-1,i=r.length;++o-1&&t%1==0&&e>t}function a(t,e,n){if(!c(n))return!1;var r=typeof e;if("number"==r?o(n)&&i(e,n.length):"string"==r&&e in n){var a=n[e];return t===t?t===a:a!==a}return!1}function s(t){return"number"==typeof t&&t>-1&&t%1==0&&l>=t}function c(t){var e=typeof t;return!!t&&("object"==e||"function"==e)}var u=/^\d+$/,l=9007199254740991,f=r("length");e.exports=a},{}],8:[function(t,e,n){var r=/<%=([\s\S]+?)%>/g;e.exports=r},{}],9:[function(t,e,n){function r(t){return c[t]}function o(t){return t=i(t),t&&s.test(t)?t.replace(a,r):t}var i=t("lodash._basetostring"),a=/[&<>"'`]/g,s=RegExp(a.source),c={"&":"&","<":"<",">":">",'"':""","'":"'","`":"`"};e.exports=o},{"lodash._basetostring":5}],10:[function(t,e,n){function r(t){return!!t&&"object"==typeof t}function o(t){return null==t?!1:i(t)?l.test(c.call(t)):r(t)&&a.test(t)}var i=t("lodash.isfunction"),a=/^\[object .+?Constructor\]$/,s=Object.prototype,c=Function.prototype.toString,u=s.hasOwnProperty,l=RegExp("^"+c.call(u).replace(/[\\^$.*+?()[\]{}|]/g,"\\$&").replace(/hasOwnProperty|(function).*?(?=\\\()| for .+?(?=\\\])/g,"$1.*?")+"$");e.exports=o},{"lodash.isfunction":11}],11:[function(t,e,n){function r(t){return o(t)&&s.call(t)==i}function o(t){var e=typeof t;return!!t&&("object"==e||"function"==e)}var i="[object Function]",a=Object.prototype,s=a.toString;e.exports=r},{}],12:[function(t,e,n){function r(t){return function(e){return null==e?void 0:e[t]}}function o(t){return null!=t&&a(y(t))}function i(t,e){return t="number"==typeof t||h.test(t)?+t:-1,e=null==e?v:e,t>-1&&t%1==0&&e>t}function a(t){return"number"==typeof t&&t>-1&&t%1==0&&v>=t}function s(t){for(var e=u(t),n=e.length,r=n&&t.length,o=!!r&&a(r)&&(p(t)||f(t)),s=-1,c=[];++s0;++r-1&&t%1==0&&f>=t}function s(t){return r(t)&&i(t)&&u.call(t,"callee")&&!l.call(t,"callee")}var c=Object.prototype,u=c.hasOwnProperty,l=c.propertyIsEnumerable,f=9007199254740991,p=o("length");e.exports=s},{}],15:[function(t,e,n){function r(t){return!!t&&"object"==typeof t}function o(t,e){var n=null==t?void 0:t[e];return c(n)?n:void 0}function i(t){return"number"==typeof t&&t>-1&&t%1==0&&y>=t}function a(t){return s(t)&&d.call(t)==l}function s(t){var e=typeof t;return!!t&&("object"==e||"function"==e)}function c(t){return null==t?!1:a(t)?g.test(h.call(t)):r(t)&&f.test(t)}var u="[object Array]",l="[object Function]",f=/^\[object .+?Constructor\]$/,p=Object.prototype,h=Function.prototype.toString,m=p.hasOwnProperty,d=p.toString,g=RegExp("^"+h.call(m).replace(/[\\^$.*+?()[\]{}|]/g,"\\$&").replace(/hasOwnProperty|(function).*?(?=\\\()| for .+?(?=\\\])/g,"$1.*?")+"$"),v=o(Array,"isArray"),y=9007199254740991,b=v||function(t){return r(t)&&i(t.length)&&d.call(t)==u};e.exports=b},{}],16:[function(t,e,n){function r(t,e){if("function"!=typeof t)throw new TypeError(o);return e=i(void 0===e?t.length-1:+e||0,0),function(){for(var n=arguments,r=-1,o=i(n.length-e,0),a=Array(o);++r/g,a=/<%([\s\S]+?)%>/g,s={escape:i,evaluate:a,interpolate:r,variable:"",imports:{_:{escape:o}}};e.exports=s},{"lodash._reinterpolate":8,"lodash.escape":9}],18:[function(t,e,n){"use strict";var r=t("lodash.template");e.exports={add:r(''),form:r('
<%- addAt %> 0 <%- minutes %>
'),CSS:{add:".comments-controls[data-comments-controls]{display:inline-block;float:left;color:#fff;line-height:32px;font-size:10px;font-weight:700;margin-right:3px}.comments-controls[data-comments-controls] .add-comment{cursor:pointer;opacity:.8;font-weight:lighter}.comments-controls[data-comments-controls] .add-comment:before{font-size:16px}.comments-controls[data-comments-controls] .add-comment:hover{text-shadow:rgba(255,255,255,.8) 0 0 5px;opacity:1}.comments-bar{display:inline-block;float:left;line-height:32px;font-size:10px;font-weight:700;margin-left:6px}.comment-pointer{position:absolute;left:20px;top:8px;width:2px;height:8px;background:#90ee90;color:#90ee90;transition:background .2s linear}.comment-pointer:hover{background:red}.video-comment{color:#fff;text-align:left;font-size:12px!important}.comment-actif{padding:5px!important}.img-comment{min-width:100px;min-height:50px}.img-comment img{max-width:200px;max-height:200px}.img-comment .spinner-three-bounce{top:25%}.img-comment .spinner-three-bounce>div{width:10px;height:10px}.media-control[data-media-control] .media-control-layer[data-controls] .bar-container[data-seekbar] .bar-scrubber[data-seekbar]{z-index:99}.seek-time[data-seek-time]{height:initial!important}",form:'.form-comment{position:absolute;width:50%;margin-left:auto;margin-right:auto;text-align:left;background:#fff;right:5px;bottom:100px;z-index:999999;visibility:hidden;opacity:0;transition:hidden 0s .2s,opacity .2s linear;border-radius:5px;cursor:default}.form-comment .form-comment-header{padding:2px 5px;background:#888;border-top-left-radius:5px;border-top-right-radius:5px}.form-comment form{padding:5px!important}.form-comment img{max-height:50px;max-width:100px}.form-comment button,.form-comment input,.form-comment textarea{font-family:"Helvetica Neue",Helvetica,Arial,sans-serif;font-size:initial;line-height:initial;color:initial}.form-comment p{color:initial;font-size:initial!important}.form-comment input[type=file]{width:.1px;height:.1px;opacity:0;overflow:hidden;position:absolute;z-index:-1}.form-comment button[type=button],.form-comment input[type=file]+label{display:inline-block;padding:2px 5px;font-size:1.25em;font-weight:700}.form-comment input[type=file]+label{color:#fff;background-color:#000;cursor:pointer}.form-comment button[type=button]{color:#fff;background-color:green;cursor:pointer;border:0;line-height:1.4}.form-comment button[type=button]:focus,.form-comment button[type=button]:hover,.form-comment input[type=file]+label:hover,.form-comment input[type=file]:focus+label{background-color:red}.form-comment .text-center{text-align:center}.form-comment textarea{width:100%}.form-comment .submit-comment{display:inline-block}.show-form{visibility:visible;opacity:.9}'}}},{"lodash.template":3}],19:[function(t,e,n){"use strict";var r=function(){function t(t,e){for(var n in e){var r=e[n];r.configurable=!0,r.value&&(r.writable=!0)}Object.defineProperties(t,e)}return function(e,n,r){return n&&t(e.prototype,n),r&&t(e,r),e}}(),o=function f(t,e,n){var r=Object.getOwnPropertyDescriptor(t,e);if(void 0===r){var o=Object.getPrototypeOf(t);return null===o?void 0:f(o,e,n)}if("value"in r&&r.writable)return r.value;var i=r.get;return void 0===i?void 0:i.call(n)},i=function(t,e){if("function"!=typeof e&&null!==e)throw new TypeError("Super expression must either be null or a function, not "+typeof e);t.prototype=Object.create(e&&e.prototype,{constructor:{value:t,enumerable:!1,writable:!0,configurable:!0}}),e&&(t.__proto__=e)},a=function(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")},s=Clappr.UICorePlugin,c=t("./jst"),u=t("./styler"),l=(Clappr.Events,function(t){function e(t){a(this,e),o(Object.getPrototypeOf(e.prototype),"constructor",this).call(this,t),this.core=t,this.actualTime=0}return i(e,t),r(e,{name:{get:function(){return"comments"}},events:{get:function(){return{"click .add-comment":"clickOnContainer"}}},attributes:{get:function(){return{"class":"comments-controls","data-comments-controls":""}}},bindEvents:{value:function(){this.listenTo(this.core.mediaControl,"mediacontrol:rendered",this.make),this.listenTo(this.core.mediaControl.container,"container:timeupdate",this.timeUpdate),this.listenTo(this.core.mediaControl.container,"container:play",this.play)}},render:{value:function(){this.core.options.commentImg=void 0!=this.core.options.commentImg?this.core.options.commentImg:!0,this.videoId=this.core.$el.parent().attr("data-video-id"),this.make()}},play:{value:function(){this.dismissForm()}},make:{value:function(){var t=this,e=u.getStyleFor("add");console.log(e[0]),this.$playButton=this.core.mediaControl.$el.find(".media-control-button"),this.$el.html(c.add).append(e[0]),this.core.mediaControl.$(".media-control-right-panel[data-media-control]").append(this.$el);var n=u.getStyleFor("form"),r='",this.$el.formComment=document.createElement("div"),this.core.options.texts)var o={addAt:this.core.options.texts.addComment?this.core.options.texts.addComment:"Add a comment at",minutes:this.core.options.texts.minutes?this.core.options.texts.minutes:"minutes",placeholder:this.core.options.texts.commentPlaceholder?this.core.options.texts.commentPlaceholder:"Put a comment here",send:this.core.options.texts.sendComment?this.core.options.texts.sendComment:"Send"};else var o={addAt:"Add a comment at",minutes:"minutes",placeholder:"Put a comment here",send:"Send"};$(this.$el.formComment).html(c.form(o)).addClass("form-comment").append(n[0]).append(r),this.core.mediaControl.container.$el.append(this.$el.formComment),this.core.mediaControl.container.$el.find(".form-comment").click(function(t){t.stopPropagation()}),this.core.options.iconComment?this.core.mediaControl.$el.find(".add-comment").addClass(this.core.options.iconComment):this.core.options.texts&&this.core.options.texts.addCommentLink?this.core.mediaControl.$el.find(".add-comment").text(this.core.options.texts.addCommentLink):this.core.mediaControl.$el.find(".add-comment").text("Comment"),this.core.options.enablePicture&&this.core.mediaControl.container.$el.find('input[type="file"]').show(),isNaN(this.core.mediaControl.container.getDuration())?this.videoUnReady=!0:this.getComments(this.core.options.videoId),this.core.mediaControl.container.$el.find(".submit-comment").click(function(){return t.submitComment(t)}),this.core.mediaControl.$seekBarContainer.append(this.commentPointer),this.core.mediaControl.seekTime.$el.prepend('
'),$('.form-comment input[type="file"]').change(function(){if(this.files&&this.files[0]){var t=new FileReader;t.onload=function(t){$(".form-comment img").attr("src",t.target.result)},t.readAsDataURL(this.files[0])}})}},getComments:{value:function(t){if(!this.pointers){if(this.pointers=new Array,!this.core.options.urlGetComments)return void alert('An url is needed in the options for the API (POST). Option "urlGetComments"');$.get(this.core.options.urlGetComments+"/"+t,function(t){for(var e=0;e
');var n=$("").attr("src",$(e).attr("data-imgUrl"));n.on("load",function(){console.log("test"),this.complete&&"undefined"!=typeof this.naturalWidth&&0!=this.naturalWidth&&(console.log(this),t.core.mediaControl.seekTime.$(".img-comment").html(this))})}}},hideComment:{value:function(t){t.core.mediaControl.seekTime.$(".video-comment").html("").removeClass("comment-actif")}},submitComment:{value:function(t){if(!this.core.options.urlAddComments)return void alert('An url is needed in the options for the API (POST). Option "urlAddComments"');var e=t.core.mediaControl.container.$el.find("form"),n=new FormData;if(this.core.options.enablePicture){var r=$('input[type="file"]')[1].files;1==r.length&&n.append("picture",r[0])}var o=$(e).serializeArray();$.each(o,function(t,e){n.append(e.name,e.value)}),n.append("time",Math.round(t.actualTime)),$.ajax({url:this.core.options.urlAddComments,type:"POST",data:n,async:!1,success:function(e){t.createCommentPointer(e),t.displayingComment(t),t.dismissForm()},cache:!1,contentType:!1,processData:!1})}},dismissForm:{value:function(){"visible"==$(this.$el.formComment).css("visibility")&&$(this.$el.formComment).removeClass("show-form")}},clickOnContainer:{value:function(){if("visible"==$(this.$el.formComment).css("visibility"))$(this.$el.formComment).removeClass("show-form");else{this.core.mediaControl.container.pause(),this.$playButton.addClass("paused");var t=Math.round(this.actualTime)/100;$(this.$el.formComment).find(".comment-time").text(t),$(this.$el.formComment).addClass("show-form")}}},timeUpdate:{value:function(t,e){this.actualTime=t,"visible"==$(this.$el.formComment).css("visibility")&&$(this.$el.formComment).find(".comment-time").text(Math.round(this.actualTime)/100),this.videoUnReady&&1==this.videoUnReady&&(this.getComments(this.core.options.videoId),0==this.videoUnReady)}}}),e}(s));e.exports=window.Comments=l},{"./jst":18,"./styler":20}],20:[function(t,e,n){"use strict";var r=t("./jst"),o=t("clappr-zepto"),i={getStyleFor:function(t){return o("").html(r.CSS[t].toString())}};e.exports=i},{"./jst":18,"clappr-zepto":2}]},{},[1]); \ No newline at end of file diff --git a/public/form.html b/public/form.html index ddfe3a0..8ec2139 100644 --- a/public/form.html +++ b/public/form.html @@ -1,8 +1,16 @@ +
+ <%- addAt %> 0 <%- minutes %> +
+
+ +
- -

<%- addAt %> 0 <%- minutes %>

-
- +
+ + +
+ +
diff --git a/public/form.scss b/public/form.scss index de5d50b..9b482cc 100644 --- a/public/form.scss +++ b/public/form.scss @@ -1,9 +1,23 @@ .form-comment { + .form-comment-header { + padding: 2px 5px 2px 5px; + background: #888888; + border-top-left-radius: 5px; + border-top-right-radius: 5px; + } + + form { + padding: 5px !important; + } + img { + max-height: 50px; + max-width: 100px; + } // RAZ (Bootstrap, ...) button, input, textarea { - font: initial; + font-family: "Helvetica Neue",Helvetica,Arial,sans-serif; font-size: initial; line-height: initial; color: initial; @@ -14,7 +28,44 @@ } input[type="file"] { - display: none; + width: 0.1px; + height: 0.1px; + opacity: 0; + overflow: hidden; + position: absolute; + z-index: -1; + } + + input[type="file"] + label, button[type="button"] { + display: inline-block; + padding: 2px 5px 2px 5px; + font-size: 1.25em; + font-weight: 700; + } + + input[type="file"] + label { + color: white; + background-color: black; + cursor: pointer; + } + + button[type="button"] { + color: white; + background-color: green; + cursor: pointer; + border: 0; + line-height: 1.4; + } + + input[type="file"]:focus + label, + input[type="file"] + label:hover, + button[type="button"]:focus, + button[type="button"]:hover { + background-color: red; + } + + .text-center { + text-align: center; } position: absolute; @@ -26,7 +77,6 @@ right:5px; bottom: 100px; z-index: 999999; - padding: 5px !important; visibility: hidden; opacity: 0; transition: hidden 0s 0.2s, opacity 0.2s linear; @@ -41,7 +91,8 @@ } .submit-comment { - text-align:center; + display: inline-block; + //text-align:center; } } diff --git a/src/jst.js b/src/jst.js index 0088654..76e346e 100644 --- a/src/jst.js +++ b/src/jst.js @@ -4,13 +4,13 @@ module.exports = { 'add': template(''), - 'form': template('

<%- addAt %> 0 <%- minutes %>

'), + 'form': template('
<%- addAt %> 0 <%- minutes %>
'), CSS: { 'add': '.comments-controls[data-comments-controls]{display:inline-block;float:left;color:#fff;line-height:32px;font-size:10px;font-weight:700;margin-right:3px}.comments-controls[data-comments-controls] .add-comment{cursor:pointer;opacity:.8;font-weight:lighter}.comments-controls[data-comments-controls] .add-comment:before{font-size:16px}.comments-controls[data-comments-controls] .add-comment:hover{text-shadow:rgba(255,255,255,.8) 0 0 5px;opacity:1}.comments-bar{display:inline-block;float:left;line-height:32px;font-size:10px;font-weight:700;margin-left:6px}.comment-pointer{position:absolute;left:20px;top:8px;width:2px;height:8px;background:#90ee90;color:#90ee90;transition:background .2s linear}.comment-pointer:hover{background:red}.video-comment{color:#fff;text-align:left;font-size:12px!important}.comment-actif{padding:5px!important}.img-comment{min-width:100px;min-height:50px}.img-comment img{max-width:200px;max-height:200px}.img-comment .spinner-three-bounce{top:25%}.img-comment .spinner-three-bounce>div{width:10px;height:10px}.media-control[data-media-control] .media-control-layer[data-controls] .bar-container[data-seekbar] .bar-scrubber[data-seekbar]{z-index:99}.seek-time[data-seek-time]{height:initial!important}', - 'form': '.form-comment{position:absolute;width:50%;margin-left:auto;margin-right:auto;text-align:left;background:#fff;right:5px;bottom:100px;z-index:999999;padding:5px!important;visibility:hidden;opacity:0;transition:hidden 0s .2s,opacity .2s linear;border-radius:5px;cursor:default}.form-comment button,.form-comment input,.form-comment textarea{font:initial;font-size:initial;line-height:initial;color:initial}.form-comment p{color:initial;font-size:initial!important}.form-comment input[type=file]{display:none}.form-comment textarea{width:100%}.form-comment .submit-comment{text-align:center}.show-form{visibility:visible;opacity:.9}', + 'form': '.form-comment{position:absolute;width:50%;margin-left:auto;margin-right:auto;text-align:left;background:#fff;right:5px;bottom:100px;z-index:999999;visibility:hidden;opacity:0;transition:hidden 0s .2s,opacity .2s linear;border-radius:5px;cursor:default}.form-comment .form-comment-header{padding:2px 5px;background:#888;border-top-left-radius:5px;border-top-right-radius:5px}.form-comment form{padding:5px!important}.form-comment img{max-height:50px;max-width:100px}.form-comment button,.form-comment input,.form-comment textarea{font-family:"Helvetica Neue",Helvetica,Arial,sans-serif;font-size:initial;line-height:initial;color:initial}.form-comment p{color:initial;font-size:initial!important}.form-comment input[type=file]{width:.1px;height:.1px;opacity:0;overflow:hidden;position:absolute;z-index:-1}.form-comment button[type=button],.form-comment input[type=file]+label{display:inline-block;padding:2px 5px;font-size:1.25em;font-weight:700}.form-comment input[type=file]+label{color:#fff;background-color:#000;cursor:pointer}.form-comment button[type=button]{color:#fff;background-color:green;cursor:pointer;border:0;line-height:1.4}.form-comment button[type=button]:focus,.form-comment button[type=button]:hover,.form-comment input[type=file]+label:hover,.form-comment input[type=file]:focus+label{background-color:red}.form-comment .text-center{text-align:center}.form-comment textarea{width:100%}.form-comment .submit-comment{display:inline-block}.show-form{visibility:visible;opacity:.9}', } }; diff --git a/src/main.js b/src/main.js index 9eb0d05..0f8d5f4 100644 --- a/src/main.js +++ b/src/main.js @@ -155,6 +155,16 @@ class Comments extends UICorePlugin { this.core.mediaControl.seekTime.$el.prepend('
') + $('.form-comment input[type="file"]').change(function(){ + if (this.files && this.files[0]) { + var reader = new FileReader(); + reader.onload = function (e) { + $('.form-comment img').attr('src', e.target.result); + } + reader.readAsDataURL(this.files[0]); + } + }); + }