lychee/dist/main.js

7 lines
194 KiB
JavaScript
Raw Normal View History

2016-10-25 16:34:25 +00:00
function _taggedTemplateLiteral(e,t){return Object.freeze(Object.defineProperties(e,{raw:{value:Object.freeze(t)}}))}function gup(e){e=e.replace(/[\[]/,"\\[").replace(/[\]]/,"\\]");var t="[\\?&]"+e+"=([^&#]*)",n=new RegExp(t),o=n.exec(window.location.href);return null===o?"":o[1]}!function(e,t){"use strict";"object"==typeof module&&"object"==typeof module.exports?module.exports=e.document?t(e,!0):function(e){if(!e.document)throw new Error("jQuery requires a window with a document");return t(e)}:t(e)}("undefined"!=typeof window?window:this,function(e,t){"use strict";function n(e,t){t=t||te;var n=t.createElement("script");n.text=e,t.head.appendChild(n).parentNode.removeChild(n)}function o(e){var t=!!e&&"length"in e&&e.length,n=fe.type(e);return"function"!==n&&!fe.isWindow(e)&&("array"===n||0===t||"number"==typeof t&&t>0&&t-1 in e)}function i(e,t,n){return fe.isFunction(t)?fe.grep(e,function(e,o){return!!t.call(e,o,e)!==n}):t.nodeType?fe.grep(e,function(e){return e===t!==n}):"string"!=typeof t?fe.grep(e,function(e){return re.call(t,e)>-1!==n}):Te.test(t)?fe.filter(t,e,n):(t=fe.filter(t,e),fe.grep(e,function(e){return re.call(t,e)>-1!==n&&1===e.nodeType}))}function a(e,t){for(;(e=e[t])&&1!==e.nodeType;);return e}function r(e){var t={};return fe.each(e.match(Ae)||[],function(e,n){t[n]=!0}),t}function l(e){return e}function s(e){throw e}function u(e,t,n){var o;try{e&&fe.isFunction(o=e.promise)?o.call(e).done(t).fail(n):e&&fe.isFunction(o=e.then)?o.call(e,t,n):t.call(void 0,e)}catch(e){n.call(void 0,e)}}function c(){te.removeEventListener("DOMContentLoaded",c),e.removeEventListener("load",c),fe.ready()}function d(){this.expando=fe.expando+d.uid++}function p(e){return"true"===e||"false"!==e&&("null"===e?null:e===+e+""?+e:Oe.test(e)?JSON.parse(e):e)}function h(e,t,n){var o;if(void 0===n&&1===e.nodeType)if(o="data-"+t.replace(qe,"-$&").toLowerCase(),n=e.getAttribute(o),"string"==typeof n){try{n=p(n)}catch(e){}Ne.set(e,t,n)}else n=void 0;return n}function f(e,t,n,o){var i,a=1,r=20,l=o?function(){return o.cur()}:function(){return fe.css(e,t,"")},s=l(),u=n&&n[3]||(fe.cssNumber[t]?"":"px"),c=(fe.cssNumber[t]||"px"!==u&&+s)&&Re.exec(fe.css(e,t));if(c&&c[3]!==u){u=u||c[3],n=n||[],c=+s||1;do a=a||".5",c/=a,fe.style(e,t,c+u);while(a!==(a=l()/s)&&1!==a&&--r)}return n&&(c=+c||+s||0,i=n[1]?c+(n[1]+1)*n[2]:+n[2],o&&(o.unit=u,o.start=c,o.end=i)),i}function m(e){var t,n=e.ownerDocument,o=e.nodeName,i=We[o];return i?i:(t=n.body.appendChild(n.createElement(o)),i=fe.css(t,"display"),t.parentNode.removeChild(t),"none"===i&&(i="block"),We[o]=i,i)}function b(e,t){for(var n,o,i=[],a=0,r=e.length;a<r;a++)o=e[a],o.style&&(n=o.style.display,t?("none"===n&&(i[a]=Le.get(o,"display")||null,i[a]||(o.style.display="")),""===o.style.display&&Ue(o)&&(i[a]=m(o))):"none"!==n&&(i[a]="none",Le.set(o,"display",n)));for(a=0;a<r;a++)null!=i[a]&&(e[a].style.display=i[a]);return e}function g(e,t){var n;return n="undefined"!=typeof e.getElementsByTagName?e.getElementsByTagName(t||"*"):"undefined"!=typeof e.querySelectorAll?e.querySelectorAll(t||"*"):[],void 0===t||t&&fe.nodeName(e,t)?fe.merge([e],n):n}function v(e,t){for(var n=0,o=e.length;n<o;n++)Le.set(e[n],"globalEval",!t||Le.get(t[n],"globalEval"))}function y(e,t,n,o,i){for(var a,r,l,s,u,c,d=t.createDocumentFragment(),p=[],h=0,f=e.length;h<f;h++)if(a=e[h],a||0===a)if("object"===fe.type(a))fe.merge(p,a.nodeType?[a]:a);else if(Ve.test(a)){for(r=r||d.appendChild(t.createElement("div")),l=(ze.exec(a)||["",""])[1].toLowerCase(),s=Ye[l]||Ye._default,r.innerHTML=s[1]+fe.htmlPrefilter(a)+s[2],c=s[0];c--;)r=r.lastChild;fe.merge(p,r.childNodes),r=d.firstChild,r.textContent=""}else p.push(t.createTextNode(a));for(d.textContent="",h=0;a=p[h++];)if(o&&fe.inArray(a,o)>-1)i&&i.push(a);else if(u=fe.contains(a.ownerDocument,a),r=g(d.appendChild(a),"script"),u&&v(r),n)for(c=0;a=r[c++];)Ke.test(a.type||"")&&n.push(a);return d}function w(){return!0}function x(){return!1}function j(){try{return te.activeElement}catch(e){}}function _(e,t,n,o,i,a){var r,l;if("object"==typeof t){"string"!=typeof n&&(o=o||n,n=void 0);for(l in t)_(e,l,n,o,t[
return pe.test(e||"")||t.error("unsupported lang: "+e),e=e.replace(ye,we).toLowerCase(),function(t){var n;do if(n=L?t.lang:t.getAttribute("xml:lang")||t.getAttribute("lang"))return n=n.toLowerCase(),n===e||0===n.indexOf(e+"-");while((t=t.parentNode)&&1===t.nodeType);return!1}}),target:function(t){var n=e.location&&e.location.hash;return n&&n.slice(1)===t.id},root:function(e){return e===P},focus:function(e){return e===I.activeElement&&(!I.hasFocus||I.hasFocus())&&!!(e.type||e.href||~e.tabIndex)},enabled:u(!1),disabled:u(!0),checked:function(e){var t=e.nodeName.toLowerCase();return"input"===t&&!!e.checked||"option"===t&&!!e.selected},selected:function(e){return e.parentNode&&e.parentNode.selectedIndex,e.selected===!0},empty:function(e){for(e=e.firstChild;e;e=e.nextSibling)if(e.nodeType<6)return!1;return!0},parent:function(e){return!_.pseudos.empty(e)},header:function(e){return me.test(e.nodeName)},input:function(e){return fe.test(e.nodeName)},button:function(e){var t=e.nodeName.toLowerCase();return"input"===t&&"button"===e.type||"button"===t},text:function(e){var t;return"input"===e.nodeName.toLowerCase()&&"text"===e.type&&(null==(t=e.getAttribute("type"))||"text"===t.toLowerCase())},first:c(function(){return[0]}),last:c(function(e,t){return[t-1]}),eq:c(function(e,t,n){return[n<0?n+t:n]}),even:c(function(e,t){for(var n=0;n<t;n+=2)e.push(n);return e}),odd:c(function(e,t){for(var n=1;n<t;n+=2)e.push(n);return e}),lt:c(function(e,t,n){for(var o=n<0?n+t:n;--o>=0;)e.push(o);return e}),gt:c(function(e,t,n){for(var o=n<0?n+t:n;++o<t;)e.push(o);return e})}},_.pseudos.nth=_.pseudos.eq;for(x in{radio:!0,checkbox:!0,file:!0,password:!0,image:!0})_.pseudos[x]=l(x);for(x in{submit:!0,reset:!0})_.pseudos[x]=s(x);return p.prototype=_.filters=_.pseudos,_.setFilters=new p,C=t.tokenize=function(e,n){var o,i,a,r,l,s,u,c=X[e+" "];if(c)return n?0:c.slice(0);for(l=e,s=[],u=_.preFilter;l;){o&&!(i=se.exec(l))||(i&&(l=l.slice(i[0].length)||l),s.push(a=[])),o=!1,(i=ue.exec(l))&&(o=i.shift(),a.push({value:o,type:i[0].replace(le," ")}),l=l.slice(o.length));for(r in _.filter)!(i=he[r].exec(l))||u[r]&&!(i=u[r](i))||(o=i.shift(),a.push({value:o,type:r,matches:i}),l=l.slice(o.length));if(!o)break}return n?l.length:l?t.error(e):X(e,s).slice(0)},k=t.compile=function(e,t){var n,o=[],i=[],a=z[e+" "];if(!a){for(t||(t=C(e)),n=t.length;n--;)a=y(t[n]),a[R]?o.push(a):i.push(a);a=z(e,w(i,o)),a.selector=e}return a},D=t.select=function(e,t,n,o){var i,a,r,l,s,u="function"==typeof e&&e,c=!o&&C(e=u.selector||e);if(n=n||[],1===c.length){if(a=c[0]=c[0].slice(0),a.length>2&&"ID"===(r=a[0]).type&&9===t.nodeType&&L&&_.relative[a[1].type]){if(t=(_.find.ID(r.matches[0].replace(ye,we),t)||[])[0],!t)return n;u&&(t=t.parentNode),e=e.slice(a.shift().value.length)}for(i=he.needsContext.test(e)?0:a.length;i--&&(r=a[i],!_.relative[l=r.type]);)if((s=_.find[l])&&(o=s(r.matches[0].replace(ye,we),ve.test(a[0].type)&&d(t.parentNode)||t))){if(a.splice(i,1),e=o.length&&h(a),!e)return Z.apply(n,o),n;break}}return(u||k(e,c))(o,t,!L,n,!t||ve.test(e)&&d(t.parentNode)||t),n},j.sortStable=R.split("").sort(K).join("")===R,j.detectDuplicates=!!S,E(),j.sortDetached=i(function(e){return 1&e.compareDocumentPosition(I.createElement("fieldset"))}),i(function(e){return e.innerHTML="<a href='#'></a>","#"===e.firstChild.getAttribute("href")})||a("type|href|height|width",function(e,t,n){if(!n)return e.getAttribute(t,"type"===t.toLowerCase()?1:2)}),j.attributes&&i(function(e){return e.innerHTML="<input/>",e.firstChild.setAttribute("value",""),""===e.firstChild.getAttribute("value")})||a("value",function(e,t,n){if(!n&&"input"===e.nodeName.toLowerCase())return e.defaultValue}),i(function(e){return null==e.getAttribute("disabled")})||a(te,function(e,t,n){var o;if(!n)return e[t]===!0?t.toLowerCase():(o=e.getAttributeNode(t))&&o.specified?o.value:null}),t}(e);fe.find=ye,fe.expr=ye.selectors,fe.expr[":"]=fe.expr.pseudos,fe.uniqueSort=fe.unique=ye.uniqueSort,fe.text=ye.getText,fe.isXMLDoc=ye.isXML,fe.contains=ye.contains,fe.escapeSelector=ye.escape;var we=function(e,t,n){for(var o=[],i=void 0!==n;(e=e[t])&&9!==e.
i||a.queue===!1?this.each(r):this.queue(a.queue,r)},stop:function(e,t,n){var o=function(e){var t=e.stop;delete e.stop,t(n)};return"string"!=typeof e&&(n=t,t=e,e=void 0),t&&e!==!1&&this.queue(e||"fx",[]),this.each(function(){var t=!0,i=null!=e&&e+"queueHooks",a=fe.timers,r=Le.get(this);if(i)r[i]&&r[i].stop&&o(r[i]);else for(i in r)r[i]&&r[i].stop&&bt.test(i)&&o(r[i]);for(i=a.length;i--;)a[i].elem!==this||null!=e&&a[i].queue!==e||(a[i].anim.stop(n),t=!1,a.splice(i,1));!t&&n||fe.dequeue(this,e)})},finish:function(e){return e!==!1&&(e=e||"fx"),this.each(function(){var t,n=Le.get(this),o=n[e+"queue"],i=n[e+"queueHooks"],a=fe.timers,r=o?o.length:0;for(n.finish=!0,fe.queue(this,e,[]),i&&i.stop&&i.stop.call(this,!0),t=a.length;t--;)a[t].elem===this&&a[t].queue===e&&(a[t].anim.stop(!0),a.splice(t,1));for(t=0;t<r;t++)o[t]&&o[t].finish&&o[t].finish.call(this);delete n.finish})}}),fe.each(["toggle","show","hide"],function(e,t){var n=fe.fn[t];fe.fn[t]=function(e,o,i){return null==e||"boolean"==typeof e?n.apply(this,arguments):this.animate(R(t,!0),e,o,i)}}),fe.each({slideDown:R("show"),slideUp:R("hide"),slideToggle:R("toggle"),fadeIn:{opacity:"show"},fadeOut:{opacity:"hide"},fadeToggle:{opacity:"toggle"}},function(e,t){fe.fn[e]=function(e,n,o){return this.animate(t,e,n,o)}}),fe.timers=[],fe.fx.tick=function(){var e,t=0,n=fe.timers;for(ht=fe.now();t<n.length;t++)e=n[t],e()||n[t]!==e||n.splice(t--,1);n.length||fe.fx.stop(),ht=void 0},fe.fx.timer=function(e){fe.timers.push(e),e()?fe.fx.start():fe.timers.pop()},fe.fx.interval=13,fe.fx.start=function(){ft||(ft=e.requestAnimationFrame?e.requestAnimationFrame(q):e.setInterval(fe.fx.tick,fe.fx.interval))},fe.fx.stop=function(){e.cancelAnimationFrame?e.cancelAnimationFrame(ft):e.clearInterval(ft),ft=null},fe.fx.speeds={slow:600,fast:200,_default:400},fe.fn.delay=function(t,n){return t=fe.fx?fe.fx.speeds[t]||t:t,n=n||"fx",this.queue(n,function(n,o){var i=e.setTimeout(n,t);o.stop=function(){e.clearTimeout(i)}})},function(){var e=te.createElement("input"),t=te.createElement("select"),n=t.appendChild(te.createElement("option"));e.type="checkbox",pe.checkOn=""!==e.value,pe.optSelected=n.selected,e=te.createElement("input"),e.value="t",e.type="radio",pe.radioValue="t"===e.value}();var gt,vt=fe.expr.attrHandle;fe.fn.extend({attr:function(e,t){return Ie(this,fe.attr,e,t,arguments.length>1)},removeAttr:function(e){return this.each(function(){fe.removeAttr(this,e)})}}),fe.extend({attr:function(e,t,n){var o,i,a=e.nodeType;if(3!==a&&8!==a&&2!==a)return"undefined"==typeof e.getAttribute?fe.prop(e,t,n):(1===a&&fe.isXMLDoc(e)||(i=fe.attrHooks[t.toLowerCase()]||(fe.expr.match.bool.test(t)?gt:void 0)),void 0!==n?null===n?void fe.removeAttr(e,t):i&&"set"in i&&void 0!==(o=i.set(e,n,t))?o:(e.setAttribute(t,n+""),n):i&&"get"in i&&null!==(o=i.get(e,t))?o:(o=fe.find.attr(e,t),null==o?void 0:o))},attrHooks:{type:{set:function(e,t){if(!pe.radioValue&&"radio"===t&&fe.nodeName(e,"input")){var n=e.value;return e.setAttribute("type",t),n&&(e.value=n),t}}}},removeAttr:function(e,t){var n,o=0,i=t&&t.match(Ae);if(i&&1===e.nodeType)for(;n=i[o++];)e.removeAttribute(n)}}),gt={set:function(e,t,n){return t===!1?fe.removeAttr(e,n):e.setAttribute(n,n),n}},fe.each(fe.expr.match.bool.source.match(/\w+/g),function(e,t){var n=vt[t]||fe.find.attr;vt[t]=function(e,t,o){var i,a,r=t.toLowerCase();return o||(a=vt[r],vt[r]=i,i=null!=n(e,t,o)?r:null,vt[r]=a),i}});var yt=/^(?:input|select|textarea|button)$/i,wt=/^(?:a|area)$/i;fe.fn.extend({prop:function(e,t){return Ie(this,fe.prop,e,t,arguments.length>1)},removeProp:function(e){return this.each(function(){delete this[fe.propFix[e]||e]})}}),fe.extend({prop:function(e,t,n){var o,i,a=e.nodeType;if(3!==a&&8!==a&&2!==a)return 1===a&&fe.isXMLDoc(e)||(t=fe.propFix[t]||t,i=fe.propHooks[t]),void 0!==n?i&&"set"in i&&void 0!==(o=i.set(e,n,t))?o:e[t]=n:i&&"get"in i&&null!==(o=i.get(e,t))?o:e[t]},propHooks:{tabIndex:{get:function(e){var t=fe.find.attr(e,"tabindex");return t?parseInt(t,10):yt.test(e.nodeName)||wt.test(e.nodeName)&&e.href?0:-1}}},propFix:{for:"htmlFor",class:"className"}}),pe.optSelected||
t.basicModal=e()}}(function(){return function e(t,n,o){function i(r,l){if(!n[r]){if(!t[r]){var s="function"==typeof require&&require;if(!l&&s)return s(r,!0);if(a)return a(r,!0);var u=new Error("Cannot find module '"+r+"'");throw u.code="MODULE_NOT_FOUND",u}var c=n[r]={exports:{}};t[r][0].call(c.exports,function(e){var n=t[r][1][e];return i(n?n:e)},c,c.exports,e,t,n,o)}return n[r].exports}for(var a="function"==typeof require&&require,r=0;r<o.length;r++)i(o[r]);return i}({1:[function(e,t,n){"use strict";Object.defineProperty(n,"__esModule",{value:!0});var o=null,i=(n.THEME={small:"basicModal__small",xclose:"basicModal__xclose"},function(){var e=arguments.length<=0||void 0===arguments[0]?"":arguments[0],t=!(arguments.length<=1||void 0===arguments[1])&&arguments[1];return t===!0?document.querySelectorAll(".basicModal "+e):document.querySelector(".basicModal "+e)}),a=function(e,t){return null!=e&&(e.constructor===Object?Array.prototype.forEach.call(Object.keys(e),function(n){return t(e[n],n,e)}):Array.prototype.forEach.call(e,function(n,o){return t(n,o,e)}))},r=function(e){return null==e||0===Object.keys(e).length?(console.error("Missing or empty modal configuration object"),!1):(null==e.body&&(e.body=""),null==e.class&&(e.class=""),e.closable!==!1&&(e.closable=!0),null==e.buttons?(console.error("basicModal requires at least one button"),!1):null!=e.buttons.action&&(null==e.buttons.action.class&&(e.buttons.action.class=""),null==e.buttons.action.title&&(e.buttons.action.title="OK"),null==e.buttons.action.fn)?(console.error("Missing fn for action-button"),!1):null==e.buttons.cancel||(null==e.buttons.cancel.class&&(e.buttons.cancel.class=""),null==e.buttons.cancel.title&&(e.buttons.cancel.title="Cancel"),null!=e.buttons.cancel.fn)||(console.error("Missing fn for cancel-button"),!1))},l=function(e){var t='<svg xmlns="http://www.w3.org/2000/svg" width="512" height="512" viewBox="0 0 512 512"><path d="M405 136.798l-29.798-29.798-119.202 119.202-119.202-119.202-29.798 29.798 119.202 119.202-119.202 119.202 29.798 29.798 119.202-119.202 119.202 119.202 29.798-29.798-119.202-119.202z"/></svg>',n="";return n+="\n\t <div class='basicModalContainer basicModalContainer--fadeIn' data-closable='"+e.closable+"'>\n\t <div class='basicModal basicModal--fadeIn "+e.class+"' role=\"dialog\">\n\t <div class='basicModal__content'>\n\t "+e.body+"\n\t </div>\n\t <div class='basicModal__buttons'>\n\t ",null!=e.buttons.cancel&&(n+=e.buttons.cancel.class.indexOf("basicModal__xclose")===-1?"<a id='basicModal__cancel' class='basicModal__button "+e.buttons.cancel.class+"'>"+e.buttons.cancel.title+"</a>":"<div id='basicModal__cancel' class='basicModal__button "+e.buttons.cancel.class+"' aria-label='close'>"+t+"</div>"),null!=e.buttons.action&&(n+="<a id='basicModal__action' class='basicModal__button "+e.buttons.action.class+"'>"+e.buttons.action.title+"</a>"),n+="\n\t </div>\n\t </div>\n\t </div>\n\t "},s=n.getValues=function(){var e={},t=i("input[name]",!0),n=i("select[name]",!0);return a(t,function(t){var n=t.getAttribute("name"),o=t.value;e[n]=o}),a(n,function(t){var n=t.getAttribute("name"),o=t.options[t.selectedIndex].value;e[n]=o}),0===Object.keys(e).length?null:e},u=function(e){return null!=e.buttons.cancel&&(i("#basicModal__cancel").onclick=function(){return this.classList.contains("basicModal__button--active")!==!0&&(this.classList.add("basicModal__button--active"),void e.buttons.cancel.fn())}),null!=e.buttons.action&&(i("#basicModal__action").onclick=function(){return this.classList.contains("basicModal__button--active")!==!0&&(this.classList.add("basicModal__button--active"),void e.buttons.action.fn(s()))}),a(i("input",!0),function(e){e.oninput=e.onblur=function(){this.classList.remove("error")}}),a(i("select",!0),function(e){e.onchange=e.onblur=function(){this.classList.remove("error")}}),!0},c=(n.show=function e(t){if(r(t)===!1)return!1;if(null!=i())return p(!0),setTimeout(function(){return e(t)},301),!1;o=document.
},albums._createSmartAlbums=function(e){e.unsorted={id:0,title:"Unsorted",sysdate:e.unsorted.num+" photos",unsorted:"1",thumbs:e.unsorted.thumbs},e.starred={id:"f",title:"Starred",sysdate:e.starred.num+" photos",star:"1",thumbs:e.starred.thumbs},e.public={id:"s",title:"Public",sysdate:e.public.num+" photos",public:"1",thumbs:e.public.thumbs},e.recent={id:"r",title:"Recent",sysdate:e.recent.num+" photos",recent:"1",thumbs:e.recent.thumbs}},albums.getByID=function(e){if(null!=e){e instanceof Array&&(e=e[0]);var t=void 0,n=function(){this.id==e&&(t=this)};return albums.json&&albums.json.albums?$.each(albums.json.albums,n):album.subjson&&album.subjson.albums&&$.each(album.subjson.albums,n),t}},albums.deleteByID=function(e){if(null==e)return!1;if(!albums.json)return!1;if(!albums.json.albums)return!1;var t=!1;return $.each(albums.json.albums,function(n){if(albums.json.albums[n].id==e)return albums.json.albums.splice(n,1),t=!0,!1}),t},albums.refresh=function(){albums.json=null},api={path:"php/index.php",onError:null},api.post=function(e,t,n){loadingBar.show(),t=$.extend({function:e},t);var o=function(e){return setTimeout(loadingBar.hide,100),"string"==typeof e&&"Error: "===e.substring(0,7)?(api.onError(e.substring(7,e.length),t,e),!1):void n(e)},i=function(e,n,o){api.onError("Server error or API not found.",t,o)};$.ajax({type:"POST",url:api.path,data:t,dataType:"json",success:o,error:i})},build={},build.iconic=function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:"",n="";return n+=lychee.html(_templateObject9,t,e)},build.divider=function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:"",n="";return n+=lychee.html(_templateObject10,t,e)},build.editIcon=function(e){var t="";return t+=lychee.html(_templateObject11,e,build.iconic("pencil"))},build.multiselect=function(e,t){return lychee.html(_templateObject12,e,t)},build.album=function(e){var t="",n=lychee.retinize(e.thumbs[0]),o=n.path,i=n.isPhoto;return t+=lychee.html(_templateObject13,e.id,e.thumbs[2],e.thumbs[1],e.thumbs[0],o,i,e.title,e.title,e.sysdate),lychee.publicMode===!1&&(t+=lychee.html(_templateObject14,"1"===e.star?"badge--visible":"",build.iconic("star"),"1"===e.public?"badge--visible":"",build.iconic("eye"),"1"===e.unsorted?"badge--visible":"",build.iconic("list"),"1"===e.recent?"badge--visible":"",build.iconic("clock"),"1"===e.password?"badge--visible":"",build.iconic("lock-locked"))),t+="</div>"},build.photo=function(e){var t="",n=lychee.retinize(e.thumbUrl),o=n.path;return t+=lychee.html(_templateObject15,e.album,e.id,e.thumbUrl,o,e.title,e.title),t+="1"===e.cameraDate?lychee.html(_templateObject16,build.iconic("camera-slr"),e.sysdate):lychee.html(_templateObject17,e.sysdate),t+="</div>",lychee.publicMode===!1&&(t+=lychee.html(_templateObject18,"1"===e.star?"badge--visible":"",build.iconic("star"),"1"===e.public&&"1"!==album.json.public?"badge--visible":"",build.iconic("eye"))),t+="</div>"},build.imageview=function(e,t){var n="",o=""!==e.medium;return n+=o===!1?lychee.html(_templateObject19,t===!0?"":"full",e.url):lychee.html(_templateObject20,t===!0?"":"full",e.url,e.medium,e.url,e.width),n+="\n\t <div class='arrow_wrapper arrow_wrapper--previous'><a id='previous'>"+build.iconic("caret-left")+"</a></div>\n\t <div class='arrow_wrapper arrow_wrapper--next'><a id='next'>"+build.iconic("caret-right")+"</a></div>\n\t "},build.no_content=function(e){var t="";switch(t+="\n\t <div class='no_content fadeIn'>\n\t "+build.iconic(e)+"\n\t ",e){case"magnifying-glass":t+="<p>No results</p>";break;case"eye":t+="<p>No public albums</p>";break;case"cog":t+="<p>No configuration</p>";break;case"question-mark":t+="<p>Photo not found</p>"}return t+="</div>"},build.uploadModal=function(e,t){var n="";n+=lychee.html(_templateObject21,e);for(var o=0;o<t.length;){var i=t[o];i.name.length>40&&(i.name=i.name.substr(0,17)+"..."+i.name.substr(i.name.length-20,20)),n+=lychee.html(_templateObject22,i.name),o++}return n+="</div>"},build.tags=function(e){var t="";return""!==e?(e=e.split(","),e.forEach(function(e,n,
setTimeout(function(){return $("#multiselect").remove()},300)},multiselect.close=function(){multiselect.clearSelection(),multiselect.hide()},password={value:""},password.get=function(e,t){lychee.publicMode===!1?t():album.json&&"0"===album.json.password?t():albums.json&&"0"===albums.getByID(e).password?t():albums.json||album.json?password.getDialog(e,t):(album.json={password:!0},t(""))},password.getDialog=function(e,t){var n=function(n){var o=n.password,i={albumID:e,password:o};api.post("Album::getPublic",i,function(e){e===!0?(basicModal.close(),password.value=o,t()):basicModal.error("password")})},o=function(){basicModal.close(),visible.albums()||lychee.goto()},i="\n\t <p>\n\t This album is protected by a password. Enter the password below to view the photos of this album:\n\t <input name='password' class='text' type='password' placeholder='password' value=''>\n\t </p>\n\t ";basicModal.show({body:i,buttons:{action:{title:"Enter",fn:n},cancel:{title:"Cancel",fn:o}}})},photo={json:null,cache:null},photo.getID=function(){var e=null;return e=photo.json?photo.json.id:$(".photo:hover, .photo.active").attr("data-id"),$.isNumeric(e)===!0&&e},photo.load=function(e,t){var n=function n(){null!=album.json?photo.load(e,t):setTimeout(n,100)},o=function n(){""!==password.value?photo.load(e,t):setTimeout(n,200)};if(null==album.json)return n(),!1;var i={photoID:e,albumID:t,password:password.value};api.post("Photo::get",i,function(t){return"Warning: Photo private!"===t?(lychee.content.show(),lychee.goto(),!1):"Warning: Wrong password!"===t?(o(),!1):(photo.json=t,visible.photo()||view.photo.show(),view.photo.init(),lychee.imageview.show(),void setTimeout(function(){lychee.content.show(),photo.preloadNext(e)},300))})},photo.preloadNext=function(e){if(album.json&&album.json.content&&album.json.content[e]&&""!=album.json.content[e].nextPhoto){var t=album.json.content[e].nextPhoto,n=album.json.content[t].url,o=album.json.content[t].medium,i=null!=o&&""!==o?o:n;$("head [data-prefetch]").remove(),$("head").append('<link data-prefetch rel="prefetch" href="'+i+'">')}},photo.parse=function(){photo.json.title||(photo.json.title="Untitled")},photo.previous=function(e){if(photo.getID()!==!1&&album.json&&album.json.content[photo.getID()]&&""!==album.json.content[photo.getID()].previousPhoto){var t=0;e===!0&&(t=200,$("#imageview #image").css({WebkitTransform:"translateX(100%)",MozTransform:"translateX(100%)",transform:"translateX(100%)",opacity:0})),setTimeout(function(){return photo.getID()!==!1&&void lychee.goto(album.getID()+"/"+album.json.content[photo.getID()].previousPhoto)},t)}},photo.next=function(e){if(photo.getID()!==!1&&album.json&&album.json.content[photo.getID()]&&""!==album.json.content[photo.getID()].nextPhoto){var t=0;e===!0&&(t=200,$("#imageview #image").css({WebkitTransform:"translateX(-100%)",MozTransform:"translateX(-100%)",transform:"translateX(-100%)",opacity:0})),setTimeout(function(){return photo.getID()!==!1&&void lychee.goto(album.getID()+"/"+album.json.content[photo.getID()].nextPhoto)},t)}},photo.duplicate=function(e){if(!e)return!1;e instanceof Array==!1&&(e=[e]),albums.refresh();var t={photoIDs:e.join()};api.post("Photo::duplicate",t,function(e){e!==!0?lychee.error(null,t,e):album.load(album.getID())})},photo.delete=function(e){var t={},n={},o="",i="";return!!e&&(e instanceof Array==!1&&(e=[e]),1===e.length&&(i=visible.photo()?photo.json.title:album.json.content[e].title,""===i&&(i="Untitled")),t.fn=function(){var t=null,n=null;basicModal.close(),e.forEach(function(e,o,i){""===album.json.content[e].nextPhoto&&""===album.json.content[e].previousPhoto||(t=album.json.content[e].nextPhoto,n=album.json.content[e].previousPhoto,album.json.content[n].nextPhoto=t,album.json.content[t].previousPhoto=n),delete album.json.content[e],view.album.content.delete(e)}),albums.refresh(),visible.photo()&&null!=t&&t!==photo.getID()?lychee.goto(album.getID()+"/"+t):visible.albums()||lychee.goto(album.getID());var o={photoIDs:e.join()};api.post("Photo::delete",o,function(e){e!==!0&&lychee.err
}},content:{init:function(){var e="";album.subjson&&album.subjson.albums&&0!==album.subjson.num&&(e=build.divider("Albums"),$.each(album.subjson.albums,function(){albums.parse(this),e+=build.album(this)})),album.json.content&&album.json.content!==!1&&(e+=build.divider("Photos","divider-photos"),$.each(album.json.content,function(){e+=build.photo(this)})),view.albums.content.scrollPosition=$(document).scrollTop(),requestAnimationFrame(function(){return $(document).scrollTop(0)}),lychee.content.html(e)},title:function(e){var t="",n="";if(album.json.content[e])n=".photo",t=album.json.content[e].title;else{n=".album";for(i in album.subjson.albums)if(album.subjson.albums[i].id==e){t=album.subjson.albums[i].title;break}}t=lychee.escapeHTML(t),$(n+'[data-id="'+e+'"] .overlay h1').html(t).attr("title",t)},star:function(e){var t=$('.photo[data-id="'+e+'"] .icn-star');"1"===album.json.content[e].star?t.addClass("badge--visible"):t.removeClass("badge--visible")},public:function(e){var t=$('.photo[data-id="'+e+'"] .icn-share');"1"===album.json.content[e].public?t.addClass("badge--visible"):t.removeClass("badge--visible")},delete:function(e){$('.photo[data-id="'+e+'"]').css("opacity",0).animate({width:0,marginLeft:0},300,function(){$(this).remove(),visible.albums()||(album.json.num--,view.album.num(),0==album.json.num&&$("#divider-photos").hide())})}},description:function(){sidebar.changeAttr("description",album.json.description)},num:function(){sidebar.changeAttr("images",album.json.num)},public:function(){"1"===album.json.public?($("#button_share_album").addClass("active").attr("title","Share Album"),$(".photo .iconic-share").remove(),album.json.init&&sidebar.changeAttr("public","Yes")):($("#button_share_album").removeClass("active").attr("title","Make Public"),album.json.init&&sidebar.changeAttr("public","No"))},hidden:function(){"1"===album.json.visible?sidebar.changeAttr("hidden","No"):sidebar.changeAttr("hidden","Yes")},downloadable:function(){"1"===album.json.downloadable?sidebar.changeAttr("downloadable","Yes"):sidebar.changeAttr("downloadable","No")},password:function(){"1"===album.json.password?sidebar.changeAttr("password","Yes"):sidebar.changeAttr("password","No")},sidebar:function(e){function t(){return e.apply(this,arguments)}return t.toString=function(){return e.toString()},t}(function(){if((visible.album()||!album.json.init)&&!visible.photo()){var e=sidebar.createStructure.album(album.json),t=sidebar.render(e);sidebar.dom(".sidebar__wrapper").html(t),sidebar.bind()}})},view.photo={init:function(){photo.parse(),view.photo.sidebar(),view.photo.title(),view.photo.star(),view.photo.public(),view.photo.photo(),photo.json.init=1},show:function(){lychee.content.addClass("view"),header.setMode("photo"),$("body").css("overflow","hidden");var e=null;$(document).bind("mousemove",function(){clearTimeout(e),header.show(),e=setTimeout(header.hide,2500)}),lychee.animate(lychee.imageview,"fadeIn")},hide:function(){header.show(),lychee.content.removeClass("view"),header.setMode("album"),$("body").css("overflow","auto"),$(document).unbind("mousemove"),lychee.animate(lychee.imageview,"fadeOut"),setTimeout(function(){lychee.imageview.hide(),view.album.sidebar()},300)},title:function(){photo.json.init&&sidebar.changeAttr("title",photo.json.title),lychee.setTitle(photo.json.title,!0)},description:function(){photo.json.init&&sidebar.changeAttr("description",photo.json.description)},star:function(){"1"===photo.json.star?$("#button_star").addClass("active").attr("title","Unstar Photo"):($("#button_star").removeClass("active"),$("#button_star").attr("title","Star Photo"))},public:function(){"1"===photo.json.public||"2"===photo.json.public?($("#button_share").addClass("active").attr("title","Share Photo"),photo.json.init&&sidebar.changeAttr("public","Yes")):($("#button_share").removeClass("active").attr("title","Make Public"),photo.json.init&&sidebar.changeAttr("public","No"))},tags:function(){sidebar.changeAttr("tags",build.tags(photo.json.tags),!0),sidebar.bind()},photo:function(e){function t(){return e.apply(this,arguments)}return t.toStrin