forked from lmc-eu/bower-ngx
-
Notifications
You must be signed in to change notification settings - Fork 0
/
ngx.min.js
7 lines (7 loc) · 31.5 KB
/
ngx.min.js
1
2
3
4
5
6
7
/**
* NGX - extension library for AngularJS
* @version v0.0.2 - 2013-02-22
* @link http://github.com/lmc-eu/ngx-library
* @license MIT License, http://www.opensource.org/licenses/MIT
*/
(function(e){"use strict";e.module("ngx",["ngx.config","ngx.date","ngx.dictionary","ngx.loader","ngx.smap","ngx.utils","ngx.ui.addressInput","ngx.ui.checkboxlist","ngx.ui.ckeditor","ngx.ui.dateInput","ngx.ui.dialog","ngx.ui.gallery","ngx.ui.geomap","ngx.ui.hashtagInput","ngx.ui.imageupload","ngx.ui.invalid","ngx.ui.lightbox","ngx.ui.scrollTo","ngx.ui.smap","ngx.ui.tagsInput","ngx.ui.timeInput","ngx.ui.tooltip","ngx.ui.translate","ngx.ui.validate","ngx.ui.wwwInput","ngx.ui.wysiwyg"])})(window.angular),function(e){"use strict";e.prototype.indexOf||(e.prototype.indexOf=function(e){for(var t=0;t<this.length;t++)if(this[t]===e)return t;return-1})}(window.Array),function(e,t){"use strict";function m(e){if(e._done)return;e(),e._done=1}function g(e){var t=e.split("/"),n=t[t.length-1],r=n.indexOf("?");return r!=-1?n.substring(0,r):n}function y(e){var t;if(typeof e=="object")for(var n in e)e[n]&&(t={name:n,url:e[n]});else t={name:g(e),url:e};var r=a[t.name];return r&&r.url===t.url?r:(a[t.name]=t,t)}function b(e,t){if(!e)return;typeof e=="object"&&(e=[].slice.call(e));for(var n=0;n<e.length;n++)t.call(e,e[n],n)}function w(e){return Object.prototype.toString.call(e)=="[object Function]"}function E(e){e=e||a;var t;for(var n in e){if(e.hasOwnProperty(n)&&e[n].state!=v)return!1;t=!0}return t}function S(e){e.state=h,b(e.onpreload,function(e){e.call()})}function x(e,t){e.state===undefined&&(e.state=p,e.onpreload=[],N({src:e.url,type:"cache"},function(){S(e)}))}function T(e,t){if(e.state==v)return t&&t();if(e.state==d)return c.ready(e.name,t);if(e.state==p)return e.onpreload.push(function(){T(e,t)});e.state=d,N(e.url,function(){e.state=v,t&&t(),b(u[e.name],function(e){m(e)}),E()&&i&&b(u.ALL,function(e){m(e)})})}function N(t,r){var i=e.createElement("script");i.type="text/"+(t.type||"javascript"),i.src=t.src||t,i.async=!1,i.onreadystatechange=i.onload=function(){var e=i.readyState;!r.done&&(!e||/loaded|complete/.test(e))&&(r.done=!0,r())},(e.body||n).appendChild(i)}function C(){i||(i=!0,b(s,function(e){m(e)}))}var n=e.documentElement,r,i,s=[],o=[],u={},a={},f=e.createElement("script").async===!0||"MozAppearance"in e.documentElement.style||t.opera,l=t.head_conf&&t.head_conf.head||"head",c=t[l]=t[l]||function(){c.ready.apply(null,arguments)},h=1,p=2,d=3,v=4;f?c.js=function(){var e=arguments,t=e[e.length-1],n={};return w(t)||(t=null),b(e,function(r,i){r!=t&&(r=y(r),n[r.name]=r,T(r,t&&i==e.length-2?function(){E(n)&&m(t)}:null))}),c}:c.js=function(){var e=arguments,t=[].slice.call(e,1),n=t[0];return r?(n?(b(t,function(e){w(e)||x(y(e))}),T(y(e[0]),w(n)?n:function(){c.js.apply(null,t)})):T(y(e[0])),c):(o.push(function(){c.js.apply(null,e)}),c)},c.ready=function(t,n){if(t==e)return i?m(n):s.push(n),c;w(t)&&(n=t,t="ALL");if(typeof t!="string"||!w(n))return c;var r=a[t];if(r&&r.state==v||t=="ALL"&&E()&&i)return m(n),c;var o=u[t];return o?o.push(n):o=u[t]=[n],c},c.ready(e,function(){E()&&b(u.ALL,function(e){m(e)}),c.feature&&c.feature("domloaded",!0)});if(t.addEventListener)e.addEventListener("DOMContentLoaded",C,!1),t.addEventListener("load",C,!1);else if(t.attachEvent){e.attachEvent("onreadystatechange",function(){e.readyState==="complete"&&C()});var k=1;try{k=t.frameElement}catch(L){}!k&&n.doScroll&&function(){try{n.doScroll("left"),C()}catch(e){var r=arguments;t.setTimeout(r.callee,1);return}}(),t.attachEvent("onload",C)}if(!e.readyState&&e.addEventListener){var A;e.readyState="loading",e.addEventListener("DOMContentLoaded",A=function(){e.removeEventListener("DOMContentLoaded",A,!1),e.readyState="complete"},!1)}t.setTimeout(function(){r=!0,b(o,function(e){e()})},300)}(window.document,window),function(e,t){"use strict";var n=null,r=/ngx(\.min)?\.js(.*)$/;e.forEach(t.getElementsByTagName("script"),function(e){e.src.match(r)&&(n=e.src.replace(r,""))});if(n===null)throw new Error("ngx base path cannot be determined.");var i=e.module("ngx.config",[]);i.value("ngxConfig",{basePath:n,libsPath:n+"libs/",templatesPath:n+"templates/",ui:{}})}(window.angular,window.document),function(e){"use strict";var t={};t.format=function(e,t){var n=this,r,i,s=/\\?([a-z])/gi,o,u=function(e,t){return(e+="").length<t?(new Array(++t-e.length)).join("0")+e:e},a=["Sun","Mon","Tues","Wednes","Thurs","Fri","Satur","January","February","March","April","May","June","July","August","September","October","November","December"];return o=function(e,t){return i[e]?i[e]():t},i={d:function(){return u(i.j(),2)},D:function(){return i.l().slice(0,3)},j:function(){return r.getDate()},l:function(){return a[i.w()]+"day"},N:function(){return i.w()||7},S:function(){var e=i.j();return e<4||e>20&&["st","nd","rd"][e%10-1]||"th"},w:function(){return r.getDay()},z:function(){var e=new Date(i.Y(),i.n()-1,i.j()),t=new Date(i.Y(),0,1);return Math.round((e-t)/864e5)+1},W:function(){var e=new Date(i.Y(),i.n()-1,i.j()-i.N()+3),t=new Date(e.getFullYear(),0,4);return u(1+Math.round((e-t)/864e5/7),2)},F:function(){return a[6+i.n()]},m:function(){return u(i.n(),2)},M:function(){return i.F().slice(0,3)},n:function(){return r.getMonth()+1},t:function(){return(new Date(i.Y(),i.n(),0)).getDate()},L:function(){var e=i.Y();return e%4===0&&e%100!==0||e%400===0},o:function(){var e=i.n(),t=i.W(),n=i.Y();return n+(e===12&&t<9?-1:e===1&&t>9)},Y:function(){return r.getFullYear()},y:function(){return(i.Y()+"").slice(-2)},a:function(){return r.getHours()>11?"pm":"am"},A:function(){return i.a().toUpperCase()},B:function(){var e=r.getUTCHours()*3600,t=r.getUTCMinutes()*60,n=r.getUTCSeconds();return u(Math.floor((e+t+n+3600)/86.4)%1e3,3)},g:function(){return i.G()%12||12},G:function(){return r.getHours()},h:function(){return u(i.g(),2)},H:function(){return u(i.G(),2)},i:function(){return u(r.getMinutes(),2)},s:function(){return u(r.getSeconds(),2)},u:function(){return u(r.getMilliseconds()*1e3,6)},e:function(){throw"Not supported (see source code of date() for timezone on how to add support)"},I:function(){var e=new Date(i.Y(),0),t=Date.UTC(i.Y(),0),n=new Date(i.Y(),6),r=Date.UTC(i.Y(),6);return 0+(e-t!==n-r)},O:function(){var e=r.getTimezoneOffset(),t=Math.abs(e);return(e>0?"-":"+")+u(Math.floor(t/60)*100+t%60,4)},P:function(){var e=i.O();return e.substr(0,3)+":"+e.substr(3,2)},T:function(){return"UTC"},Z:function(){return-r.getTimezoneOffset()*60},c:function(){return"Y-m-d\\Th:i:sP".replace(s,o)},r:function(){return"D, d M Y H:i:s O".replace(s,o)},U:function(){return parseInt(r/1e3,10)}},this.date=function(e,t){return n=this,r=t===null?new Date:t instanceof Date?new Date(t):new Date(t*1e3),e.replace(s,o)},this.date(e,t)},t.check=function(e,t,n){return t>0&&t<13&&e>0&&e<32768&&n>0&&n<=(new Date(e,t,0)).getDate()},e.module("ngx.date",[]).value("ngxDate",t)}(window.angular),function(e){"use strict";var t=e.module("ngx.dictionary",[]);t.factory("ngxDictionary",function(t){function i(e,t){return n[t?t:r][e]}var n={},r=t.id.split("-")[0];return i.setLanguage=function(e){return r=e,this},i.addItems=function(t,r){return e.isUndefined(n[t])&&(n[t]={}),e.extend(n[t],r),this},i})}(window.angular),function(e,t){"use strict";var n=e.module("ngx.loader",["ngx.config"]);n.factory("ngxLoader",["ngxConfig",function(n){function i(e){for(var t=0;t<r.length;t++)if(r[t]===e)return!0;return!1}var r=[],s=function(s,o){var u=[],a=[];e.forEach(typeof s=="string"?[s]:s,function(e){e.match(/^(\/|http)/)||(e=n.basePath+e);if(i(e))return;if(e.match(/\.css$/i))a.push(e);else{if(!e.match(/\.js$/i))throw new Error("File type not supported");u.push(e)}r.push(e)}),u.length?(t.js.apply(this,u),t.ready(o)):o(),a.length&&e.forEach(a,function(t){e.element("head").append(e.element('<link rel="stylesheet" type="text/css" href="'+t+'"></link>'))})};return s.getLoaded=function(){return r},s}])}(window.angular,window.head),function(e,t,n){"use strict";var r=e.module("ngx.smap",[]);r.config(function(){n.console.DEBUG=!0}),r.factory("ngxSmap",function(){function i(i){function p(e){return typeof e=="object"?e.toWGS84?e:r.Coords.fromWGS84(e.lon!==undefined?e.lon:e[0],e.lon!==undefined?e.lat:e[1]):typeof e=="string"?(e=e.split(","),p({lat:e[0],lon:e[1]})):undefined}var s,o,u,a,f=this,l={coords:{},query:{}},c={stre:"street",addr:"number",muni:"city",dist:"district",regi:"region",ward:"ward",coun:"country",base:"base",firm:"firm"},h={street:"^ulice ",number:"^č\\.p\\. ",city:"^obec ",district:"^okres ",region:"^(kraj( Hlavní město)?|provincie) ",ward:"^(čtvrť|část obce) "};this.create=function(e){s=new r(i),s.addDefaultLayer(r.DEF_BASE).enable(),e||(e={}),e.controls!=="off"&&s.addDefaultControls(),o=new r.Card(230),t(o.getBody()).css("padding-right","18px"),u=new r.Layer.Marker,s.addLayer(u),u.enable(),s.getSignals().addListener(n,"map-click",function(e){t(f).triggerHandler("click",[r.Coords.fromEvent(e.data.event,s)])})},this.geocodeQuery=function(t,n){l.query[t]?n(l.query[t]):(a&&a.abort(),a=new r.Geocoder(t,function(r){var i=r.getResults();i=i[0]&&i[0].results&&i[0].results.length?i[0].results:[],e.forEach(i,function(e,t){i[t].type=c[e.source],i[t].coords=f.formatCoords(e.coords)}),l.query[t]=i,n(i)}))},this.geocodeCoords=function(n,i){function s(e){i&&i(e),t(f).triggerHandler("geocodeCoords",[e])}n=p(n);var o=n.x+"-"+n.y;if(l.coords[o]){s(l.coords[o]);return}var u=new r.Geocoder.Reverse(n,function(t){var n=t.getResults(),r=n.coords.toWGS84(),i={coords:f.formatCoords(r),label:n.label,meta:{}},u,a;e.forEach(n.items,function(e){u=c[e.type];if(!u)return;a=e.name,h[u]&&(a=a.replace(new RegExp(h[u],"i"),"")),i[u]=a,i.meta[u]={id:e.id,coords:f.formatCoords(e.coords)};switch(u){case"number":var t=a.split("/");i.registry_number=t[0],i.house_number=t[1]?t[1]:undefined;break;case"city":try{var r=(new RegExp(", ([0-9]{3}) ([0-9]{2}) "+a)).exec(n.label);r&&(i.zip_code=r[1]+" "+r[2])}catch(s){}}}),!i.street&&i.ward&&(i.street=i.ward),l.coords[o]=i,s(i)})},this.setCenter=function(e,t){if(!e)return;e=p(e),t.zoom?s.setCenterZoom(e,t.zoom===!0?15:t.zoom):s.setCenter(e),t.marker&&(u.removeAll(),u.addMarker(new r.Marker(e,"marker"))),t.card&&(s.addCard(o,e),o.getBody().innerHTML=t.card)},this.formatLabel=function(e,t){if(t.source==="firm"||t.source==="addr"){var n=(e.street?e.street:e.ward)+" "+e.number;return e.city&&(n+=", "+(e.zip_code?e.zip_code+" ":"")+e.city),e.country&&(n+=", "+e.country),n}return t.label},this.formatCoords=function(e){var t=p(e).toWGS84();return{lon:t[0],lat:t[1]}}}var r=n.SMap;if(r===undefined)throw"Seznam map API is not loaded, see http://api4.mapy.cz/view?page=instruction";return function(e){return new i(e)}})}(window.angular,window.jQuery,window),function(e,t){"use strict";var n=e.module("ngx.ui.addressInput",["ngx.ui.smap","ngx.ui.geomap"]);n.directive("ngxAddressInput",["$timeout","$window","ngxSmap",function(n,r,i){return{require:"ngModel",compile:function(s,o){var u=e.isDefined(o.geomap);return function(s,o,a,f){function p(t){f.$setValidity("found",e.isNumber(t)?t>0:t)}function d(e){f.loading=e}function v(e){l=e,t(l).bind("geocodeCoords",function(e,t){n(function(){f.$setViewValue(t)},0)})}function m(n,r){d(!0),e.isUndefined(r)&&(r={source:"addr"}),l.geocodeCoords(n,function(n){n.label=l.formatLabel(n,r),t(a.geomap).is(":visible")&&l.setCenter(n.coords,{zoom:!0,card:n.label}),d(!1),p(!0),e.forEach(h,function(e){f.$setValidity(e,n&&n[e])})})}var l,c=a.allowedTypes?a.allowedTypes.replace(/[ ]+/g,"").split(","):[],h=a.requiredTypes?a.requiredTypes.replace(/[ ]+/g,"").split(","):[];f.$parsers.push(function(t){var n;if(e.isObject(t))n=t,a.meta!=="true"&&delete n.meta,o.val(t.label);else{if(!e.isString(t)&&!e.isUndefined(t))throw"Invalid address data";n={label:t}}return n}),f.$formatters.push(function(t){return e.isObject(t)?(t.coords&&m(t.coords),e.isString(t.label)?t.label:""):""}),f.loading=!1,u?a.$observe("geomap",function(t){v(e.element(t).data("ngx.ui.geomap"))}):v(i()),o.autocomplete({delay:500,source:function(t,n){d(!0),s.$apply(),l.geocodeQuery(t.term,function(t){var r=[];e.forEach(t,function(e){(!c.length||c.indexOf(e.type)>-1)&&r.push(e)}),p(r.length),n(r),d(!1),s.$apply()})},select:function(e,t){return m(t.item.coords,t.item),s.$apply(),!1}}),t(r).click(function(){o.autocomplete("close")})}}}}])}(window.angular,window.jQuery,window),function(e){"use strict";var t=e.module("ngx.ui.checkboxlist",[]);t.directive("ngxCheckboxlist",["$interpolate",function(t){var n={};return{require:"ngModel",link:function(r,i,s,o){function c(t){o.$setValidity("required",a?t.length>0:!0),o.$setValidity("min",e.isNumber(f)?t.length>=f:!0),o.$setValidity("max",e.isNumber(l)?t.length<=l:!0)}var u=s.ngModel,a=e.isDefined(s.required),f=s.min?parseInt(s.min,10):null,l=s.max?parseInt(s.max,10):null;o.value=t(i.val())(r),n[u]||(n[u]={ctrl:[],list:{}}),n[u].ctrl.push(o),n[u].list[o.value]=s.title,o.list=n[u].list,o.$parsers.push(function(){var t=[];return e.forEach(n[u].ctrl,function(e){e.$viewValue&&t.push(e.value)}),c(t),t}),o.$formatters.push(function(e){e||(e=[]),c(e);for(var t=0;t<e.length;t++)if(e[t]===o.value)return!0;return!1})}}}])}(window.angular),window.CKEDITOR_BASEPATH="",function(e,t){"use strict";var n=e.module("ngx.ui.ckeditor",["ngx.config","ngx.loader"]);n.directive("ngxCkeditor",["$parse","ngxConfig","ngxLoader",function(n,r,i){t.CKEDITOR_BASEPATH=r.libsPath+"ckeditor/";var s=[t.CKEDITOR_BASEPATH+"ckeditor.js"];return{restrict:"A",require:"ngModel",link:function(r,o,u,a){o.hide(),i(s,function(){o.show();var i=t.CKEDITOR.replace(o[0],{toolbar:u.toolbarItems?[u.toolbarItems.split(",")]:[["Bold","BulletedList","Link"]],toolbarLocation:u.toolbarLocation?u.toolbarLocation:"bottom",toolbarCanCollapse:!1,removePlugins:"elementspath",extraPlugins:"autogrow",autoGrow_onStartup:!0,autoGrow_minHeight:150,resize_enabled:!1,forcePasteAsPlainText:!0,linkShowAdvancedTab:!1,linkShowTargetTab:!1,entities:!1},o.val());i.on("contentDom",function(){function t(){var e=i.getData().replace(/<p>\n\t/gi,"<p>").replace(/\n$/,"");n(u.ngModel).assign(r,e),r.$apply()}e.forEach(["focus","blur"],function(e){i.on(e,function(){o.triggerHandler(e)})}),i.document.on("keyup",t),i.on("focus",t),i.on("blur",t),i.on("afterCommandExec",t)}),a.$parsers.push(function(e){i.setData(e)})})}}}])}(window.angular,window),function(e,t){"use strict";var n=e.module("ngx.ui.dateInput",["ngx.date"]);n.directive("ngxDateInput",["$parse","ngxDate",function(e,n){return{require:"ngModel",link:function(r,i,s,o){i=t(i),i.datepicker({dateFormat:"d.m.yy",firstDay:1,showButtonPanel:!1,showMinute:!1,closeText:"Zavřít",prevText:"Předchozí",nextText:"Další",currentText:"Nyní",monthNames:["Leden","Únor","Březen","Duben","Květen","Červen","Červenec","Srpen","Září","Říjen","Listopad","Prosinec"],dayNamesMin:["Ne","Po","Út","St","Čt","Pá","So"],onSelect:function(e){r.$apply(function(){o.$setViewValue(e)})}}),o.element=i,s.rangeInput?(o.range={type:"max",ctrl:e(s.rangeInput)(r)},o.range.ctrl.range={type:"min",ctrl:o}):o.range=null,o.$parsers.push(function(e){var t,r=!0;if(e&&o.$dirty){var i=(new RegExp("^([0-9]{1,2}). ?([0-9]{1,2}). ?([0-9]{4})")).exec(e);r=i&&n.check(i[3],i[2],i[1]);if(r){t=new Date(i[3],i[2]-1,i[1]);if(o.timeInput)if(o.timeInput.$valid){var s=o.timeInput.hours,u=o.timeInput.minutes;o.range&&o.range.type==="max"&&s===undefined&&(s=23,u=59),s!==undefined&&(t.setHours(s),t.setMinutes(u))}else r=!1}}var a=t&&r?n.format("Y-m-d",t):undefined;o.timestampValue=t&&r?t.getTime()/1e3:undefined,o.$setValidity("date",r);if(o.range){o.$error.date||o.range.ctrl.element.datepicker("option",o.range.type+"Date",e);var f=o.range.type==="min"?o.timestampValue:o.range.ctrl.timestampValue,l=o.range.type==="max"?o.timestampValue:o.range.ctrl.timestampValue;r=f&&l?f<=l:!0,o.$setValidity("range",r),o.range.ctrl.$setValidity("range",r)}return a})}}}])}(window.angular,window.jQuery),function(e,t){"use strict";var n=e.module("ngx.ui.dialog",[]);n.directive("ngxDialog",["$timeout","$rootScope",function(e,n){return{restrict:"EA",controller:["$scope","$element",function(e,t){this.close=function(){t.dialog("close")}}],link:function(r,i,s,o){i.addClass("ngx-dialog").css("display","block").hide();var u={autoOpen:!1,width:s.width?s.width:"auto",height:s.height?s.height:"auto",modal:s.modal?!0:!1,title:s.title,resizable:!1};i.dialog(u),t(s.trigger).click(function(e){return e.preventDefault(),i.dialog("open"),!1}),s.title===undefined&&s.$observe("title",function(e){i.dialog("option","title",e)}),s.onclose&&i.dialog("option","close",function(){e(function(){r.$eval(s.onclose)},0)}),n.$on("$routeChangeSuccess",function(){o.close()})}}}]),n.directive("ngxDialogButton",["$parse",function(e){return{require:"^ngxDialog",link:function(t,n,r,i){n.addClass("ngx-dialog-button");var s=r.ngxDialogButton;n.bind("click",function(n){return s==="@close"?i.close():t.$apply(function(){e(s)(t,{$dialog:i})}),n.preventDefault(),!1})}}}])}(window.angular,window.jQuery),function(e,t){"use strict";var n=e.module("ngx.ui.gallery",["ngx.config","ngx.ui.lightbox"]);n.directive("ngxGallery",["$timeout","ngxConfig",function(n,r){return{restrict:"EA",replace:!0,templateUrl:r.templatesPath+"ui/gallery/gallery.html",transclude:!0,controller:["$scope",function(t){e.isArray(t.items)||(t.items=[]),this.add=function(e,n){n.type=e,t.items.push(n)}}],scope:{items:"=ngxGallery"},link:function(e,r){e.src=function(e){return e.thumbSrc?e.thumbSrc:e.src},t(r).find("div[ng-transclude]").remove(),n(function(){r.triggerHandler("link",[r])},0)}}}]),n.directive("ngxGalleryItem",function(){return{restrict:"EA",require:"^ngxGallery",replace:!0,link:function(t,n,r,i){var s={};e.forEach(["src","thumbSrc","title"],function(e){r[e]&&(s[e]=r[e])}),i.add(r.type?r.type:"image",s)}}}),n.directive("ngxGalleryToggle",function(){return{replace:!0,template:'<a class="ngx-gallery-toggle" ng-click="toggle()" ng-transclude></a>',transclude:!0,link:function(e,n,r){var i,s;t(r.ngxGalleryToggle).bind("link",function(e,t){i=t.css("max-height",t.height()).addClass("collapsed")}),e.toggle=function(){i.toggleClass("collapsed"),s=n.html(),n.html(r.toggleText),r.$set("toggleText",s)}}}})}(window.angular,window.jQuery),function(e){"use strict";var t=e.module("ngx.ui.geomap",["ngx.ui.smap"]);t.directive("ngxGeomap",["$compile",function(e){return{link:function(t,n,r){r.$set("ngxGeomap",undefined),r.$set("ngxSmap",""),e(n)(t)}}}])}(window.angular),function(e){"use strict";var t=e.module("ngx.ui.hashtagInput",[]);t.directive("ngxHashtagInput",function(){return{require:"ngModel",link:function(e,t,n,r){r.$parsers.push(function(e){return e===""||e==="#"||typeof e!="string"?e="":e="#"+e.replace(/^([#]+)/,""),t.val(e),r.$setValidity("hashtag",!e||!e.substring(1).match(/(\s|#)/)),e})}}})}(window.angular),function(e,t,n){"use strict";function i(e,t,n,r){var i=[1];return e>t&&i.push(t/e),n>r&&i.push(r/n),i.sort(),i[0]}var r=e.module("ngx.ui.imageupload",["ngx.config","ngx.loader","ngx.dictionary","ngx.ui.translate"]);r.directive("ngxImageupload",["$timeout","ngxConfig","ngxLoader","ngxDictionary",function(r,s,o,u){var a=[s.libsPath+"jquery.jcrop/jquery.Jcrop.js",s.libsPath+"jquery.jcrop/jquery.Jcrop.css",s.libsPath+"jquery.fileupload/jquery.fileupload.js",s.libsPath+"jquery.iframe-transport/jquery.iframe-transport.js"];return{restrict:"EA",replace:!0,require:"ngModel",templateUrl:s.templatesPath+"ui/imageupload/imageupload.html",scope:{model:"=ngModel",config:"="},link:function(f,l,c){function E(){m=undefined,f.isSource=!1}function S(e){var n=t(e),r=n.data("width")?n.data("width"):e.width,s=n.data("height")?n.data("height"):e.height;f.isSource=e?!0:!1,n.css({"max-width":h[0]+"px","max-height":h[1]+"px"}).show();if(w.crop){var o=i(r,h[0],s,h[1]),u={setSelect:[0,0,v[0],v[1]],bgColor:"transparent",onSelect:function(n){function r(t,r,s,o){if(!y){var u=i(n.w,r,n.h,s);r=Math.floor(n.w*u),s=Math.floor(n.h*u)}return t.width=r,t.height=s,o&&(o.width=r,o.height=s),t.getContext("2d").drawImage(e,n.x,n.y,n.w-2,n.h-2,0,0,r,s),t.toDataURL(b,.9)}n.x=Math.floor(n.x/o),n.y=Math.floor(n.y/o),n.w=Math.floor(n.w/o),n.h=Math.floor(n.h/o),m={},m.src=r(g,v[0],v[1],m),p&&(m.thumbSrc=r(d,p[0],p[1])),t("[data-imageupload-rel=result]").attr(m)}};y&&(u.aspectRatio=v[0]/v[1]);var a=n.data("Jcrop");a&&a.destroy(),n.Jcrop(u,function(){u.onSelect(this.tellSelect())})}else m={width:r,height:s,src:n.attr("src")}}function x(){var r=t(l),i=e.extend({},s.ui.imageupload,f.config,c);h=(i.sourceScale||"400x400").split("x"),v=(i.resultScale||"215x125").split("x"),y=!e.isUndefined(i.resultFixed),b="image/"+((i.resultFormat||"").match(/^jpe?g$/)?"jpeg":"png"),p=i.resultThumbScale||undefined,p&&(p=p.split("x")),f.resultWidth=v[0],f.resultHeight=v[1],E(),r.find(".source").css({width:h[0]+"px",height:h[1]+"px"}),r.find(".result").css({width:v[0]+"px",height:v[1]+"px"}),f.features=w,f.featureClass=[],e.forEach(["crop","fileApi"],function(e){f.featureClass.push(w[e]?e:"no-"+e.toLowerCase())}),f.featureClass=f.featureClass.join(" "),i.dialogTrigger&&(t(i.dialogTrigger).click(function(e){return e.preventDefault(),r.dialog("open"),!1}),r.dialog({autoOpen:!1,minWidth:parseInt(h[0],10)+parseInt(v[0],10)+70,minHeight:parseInt(h[1]>v[1]?h[1]:v[1],10)+50,resizable:!1,modal:e.isDefined(c.dialogModal)&&c.dialogModal!=="false",title:i.dialogTitle,buttons:[{text:u("NGX_UI_IMAGEUPLOAD_DIALOG_SUBMIT"),click:function(){f.model=i.resultMode==="simple"?m.src:m,t(this).dialog("close")}},{text:u("NGX_UI_IMAGEUPLOAD_DIALOG_CANCEL"),click:function(){t(this).dialog("close")}}],close:function(){E(),f.$apply()}})),r.fileupload({url:i.sourceContentUrl,fileInput:r.find("input[type=file]"),dropZone:t("[data-imageupload-rel=dragdrop]"),dataType:"json",replaceFileInput:!0,formData:{crop:w.crop?"true":"false"},add:function(e,r){var i=r.files[0],s=t("[data-imageupload-rel=source]")[0];t(s).hide(),s.onload=function(){S(this),f.$apply()},s.onerror=function(){n.alert(u("NGX_UI_IMAGEUPLOAD_INVALID_IMAGE"))};if(w.fileApi){var o=new n.FileReader;o.onload=function(e){s.src=e.target.result},o.readAsDataURL(i)}else r.submit().success(function(e){t(s).data("width",e.width).data("height",e.height),s.src=e.src}).error(function(){n.alert(u("NGX_UI_IMAGEUPLOAD_PROCESS_ERROR"))})}})}var h,p,d=t("<canvas/>")[0],v,m,g=t("<canvas/>")[0],y,b,w={crop:g.getContext?!0:!1,fileApi:typeof n.FileReader!="undefined"};l.hide(),o(a,function(){l.show(),r(x,0)})}}}])}(window.angular,window.jQuery,window),document.createElement("ngx-invalid"),function(e){"use strict";var t=e.module("ngx.ui.invalid",[]);t.directive("ngxInvalid",function(){return{restrict:"EA",link:function(t,n,r){n.addClass("ngx-invalid");var i=r.ngxInvalid?r.ngxInvalid.split(" "):[],s=r.input?r.input:i[0],o=r.error?r.error:i[1],u=[];o?e.forEach(o.split(","),function(e){u.push(s+".$error."+e)}):u.push(s+".$invalid"),u=[u.length>1?"("+u.join(" || ")+")":u[0]],r.ngShow&&u.push(r.ngShow),r.expression&&u.push(r.expression),t.$watch(u.join(" && "),function(e){n.toggle(e?!0:!1)})}}})}(window.angular),function(e,t){"use strict";var n=e.module("ngx.ui.lightbox",["ngx.config","ngx.loader"]);n.directive("ngxLightbox",["ngxConfig","ngxLoader",function(n,r){var i=[n.libsPath+"jquery.fancybox/jquery.fancybox.js",n.libsPath+"jquery.fancybox/css/fancybox.css"];return{link:function(n,s,o){o.ngxLightbox&&s.attr("rel",o.ngxLightbox),r(i,function(){t(s).fancybox({onStart:function(n,r,i){var s={height:"100%",bottom:0};return e.extend(i,{href:o.href||o.src,title:o.title,titlePosition:"inside",speedIn:150,speedOut:150}),i.href.match(/youtube\.com/)?(e.extend(i,{type:"swf",href:o.href+"?autoplay=1&fs=1",width:661,height:481,swf:{wmode:"transparent",allowfullscreen:!0}}),e.extend(s,{height:"40%",bottom:"30%"})):i.href.match(/(jpg|png|gif|bmp)$/)||i.href.match(/^data:image\//)?i.type="image":e.extend(i,{type:"iframe",width:"90%",height:"95%"}),e.forEach(["width","height","title","type"],function(e){o[e]&&(i[e]=o[e])}),t("#fancybox-left").css(s),t("#fancybox-right").css(s),i}})})}}}])}(window.angular,window.jQuery),function(e,t){"use strict";var n=e.module("ngx.ui.scrollTo",[]);n.directive("ngxScrollTo",function(){return function(e,n,r){n.bind("click",function(e){return e.preventDefault(),t("html, body").animate({scrollTop:t(r.ngxScrollTo).offset().top+(r.offset?parseInt(r.offset,10):0)},600),!1})}})}(window.angular,window.jQuery),function(e){"use strict";var t=e.module("ngx.ui.smap",["ngx.smap"]);t.directive("ngxSmap",["ngxSmap",function(e){return{link:function(t,n,r){function s(e){i.setCenter(e,{zoom:!0,marker:!0})}n.addClass("ngx-smap");var i=e(n[0]);i.create({controls:r.controls}),n.data("ngx.ui.geomap",i),r.$observe("coords",function(e){e&&s(e)})}}}])}(window.angular),function(e,t){"use strict";var n=e.module("ngx.ui.tagsInput",["ngx.config","ngx.loader"]);n.directive("ngxTagsInput",["$http","$filter","$timeout","ngxConfig","ngxLoader",function(n,r,i,s,o){var u=[s.libsPath+"jquery.tagsinput/jquery.tagsinput.js",s.libsPath+"jquery.tagsinput/jquery.tagsinput.css"],a=0;return{require:"ngModel",link:function(s,f,l,c){var h=l.min?parseInt(l.min,10):null,p=l.max?parseInt(l.max,10):null;f=t(f),l.id||l.$set("id","tags_input_"+a++);var d;if(l.autocompleteUrl||l.autocompleteSource)d={url:l.autocompleteUrl?l.autocompleteUrl:!0,data:l.autocompleteSource?s.$eval(l.autocompleteSource):undefined,source:function(e,t){d.data===undefined?n.get(d.url).success(function(n){d.data=n,t(d.filter(e.term))}):t(d.filter(e.term))},filter:function(e){return r("filter")(d.data,e)}};o(u,function(){f.tagsInput({autocomplete_url:d?d.url:undefined,autocomplete:d?{source:d.source,minLength:l.autocompleteMinLength?parseInt(l.autocompleteMinLength,10):2}:undefined,maxChars:30,maxCount:p?p:null,width:null,height:null,defaultText:"",onChange:function(e){var n=f.data("ngx.tagsInput.onchange");n&&n(t(e).val())}});var n=t("#"+l.id+"_tag");e.forEach(["focus","blur"],function(e){n.bind(e,function(){f.triggerHandler(e,[this])})}),c.$parsers.push(function(e){var t;return typeof e=="string"&&e.length&&(t=e.split(",")),h&&c.$setValidity("min",t&&t.length>=h),p&&c.$setValidity("max",t?t.length<=p:!0),t}),c.$render=function(){c.$modelValue&&f.importTags(c.$modelValue.join(","))},f.data("ngx.tagsInput.onchange",function(e){i(function(){c.$setViewValue(e)},0)})})}}}])}(window.angular,window.jQuery),function(e){"use strict";var t=e.module("ngx.ui.timeInput",[]);t.directive("ngxTimeInput",["$parse",function(e){return{require:"ngModel",link:function(t,n,r,i){var s;r.dateInput&&(s=e(r.dateInput)(t),s.timeInput=i);var o=[];for(var u=0;u<=23;u++)for(var a=0;a<=59;a+=15)o.push((u<10?"0"+u:u)+":"+(a<10?"0"+a:a));n.autocomplete({source:o,minLength:0,delay:0,open:function(){n.autocomplete("widget").css("width","60px")},select:function(e,n){t.$apply(function(){i.$setViewValue(n.item.value)})}}).focus(function(){n.autocomplete("search",n.val())}),i.$parsers.push(function(e){i.hours=undefined,i.minutes=undefined;var t=!0;if(e&&e.length){var n=(new RegExp("([0-9]{1,2}):([0-9]{2})$")).exec(e);t=n&&n[1]>=0&&n[1]<=23&&n[2]>=0&&n[2]<=59,t&&(i.hours=parseInt(n[1],10),i.minutes=parseInt(n[2],10))}return i.$setValidity("time",t),s&&s.$setViewValue(s.$viewValue),e})}}}])}(window.angular),function(e,t){"use strict";var n=e.module("ngx.ui.tooltip",[]);n.directive("ngxTooltip",function(){return{restrict:"EA",replace:!0,transclude:!0,template:'<div class="ngx-tooltip" ng-transclude><span class="arrow"><span></span></span></div>',link:function(e,n,r){if(r.ngxTooltip)return;(r.element?t(r.element):n.prevAll("input,select,textarea")).bind({focus:function(e,r){if(r&&t(r).is(":disabled"))return;n.show()},blur:function(){n.hide()}}),n.hide()}}})}(window.angular,window.jQuery),function(e){"use strict";var t=e.module("ngx.ui.translate",["ngx.dictionary"]),n;t.config(["$interpolateProvider",function(e){n=e.startSymbol()}]),t.directive("ngxTranslate",["ngxDictionary","$interpolate","$log",function(e,t){return{link:function(r,i,s){var o=s.ngxTranslate?s.ngxTranslate:i.html();if(o.length){var u=e(o,s.language);u.indexOf(n)!==-1&&r.$watch(function(){return t(u)(r)},function(e){i.html(e)}),i.html(u)}}}}])}(window.angular),function(e,t){"use strict";var n=e.module("ngx.ui.validate",[]);n.directive("ngxValidate",function(){return{restrict:"EA",require:"?ngModel",link:function(t,n,r,i){var s=t.$eval(r.ngxValidate?r.ngxValidate:r.validators);e.isObject(s)||(s={validation:s}),e.forEach(s,function(n,r){function o(i){var o=[],u;return s.length>1?e.forEach(s,function(e){o.push(e.$viewValue)}):o.push(i),u=n.apply(t,o),e.forEach(s,function(e){e.$setValidity(r,u)}),u?i:undefined}var s=i?[i]:[];e.isArray(n)&&(e.forEach(n.slice(1),function(e){s.push(e)}),n=n[0]);if(!e.isFunction(n))return;e.forEach(s,function(e){e.$formatters.push(o),e.$parsers.push(o)})})}}})}(window.angular,window.console),function(e){"use strict";var t=e.module("ngx.ui.wwwInput",[]);t.directive("ngxWwwInput",function(){var e=/https?:\/\/(((([a-z]|\d|-|\.|_|~|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])|(%[\da-f]{2})|[!\$&'\(\)\*\+,;=]|:)*@)?(((\d|[1-9]\d|1\d\d|2[0-4]\d|25[0-5])\.(\d|[1-9]\d|1\d\d|2[0-4]\d|25[0-5])\.(\d|[1-9]\d|1\d\d|2[0-4]\d|25[0-5])\.(\d|[1-9]\d|1\d\d|2[0-4]\d|25[0-5]))|((([a-z]|\d|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])|(([a-z]|\d|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])([a-z]|\d|-|\.|_|~|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])*([a-z]|\d|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])))\.)+(([a-z]|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])|(([a-z]|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])([a-z]|\d|-|\.|_|~|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])*([a-z]|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])))\.?)(:\d*)?)(\/((([a-z]|\d|-|\.|_|~|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])|(%[\da-f]{2})|[!\$&'\(\)\*\+,;=]|:|@)+(\/(([a-z]|\d|-|\.|_|~|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])|(%[\da-f]{2})|[!\$&'\(\)\*\+,;=]|:|@)*)*)?)?(\?((([a-z]|\d|-|\.|_|~|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])|(%[\da-f]{2})|[!\$&'\(\)\*\+,;=]|:|@)|[\uE000-\uF8FF]|\/|\?)*)?(\#((([a-z]|\d|-|\.|_|~|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])|(%[\da-f]{2})|[!\$&'\(\)\*\+,;=]|:|@)|\/|\?)*)?$/i,t=/^https?:\/\//;return{require:"ngModel",link:function(n,r,i,s){function o(n){var r=n!==undefined&&n.length?t.test(n)?n:"http://"+n:undefined,i=!(r&&r.length&&!e.test(r));return s.$setValidity("www",i),i?r:n}s.$parsers.push(o),s.$render=function(){s.$setViewValue(s.$viewValue),r.val(s.$modelValue)}}}})}(window.angular),function(e){"use strict";var t=e.module("ngx.ui.wysiwyg",["ngx.ui.ckeditor"]);t.directive("ngxWysiwyg",["$compile",function(e){return{require:"ngModel",link:function(t,n,r){r.$set("ngxWysiwyg",undefined),r.$set("ngxCkeditor",""),e(n)(t)}}}])}(window.angular),function(e){"use strict";var t={};t.extendRecursive=function(n,r){return e.forEach(arguments,function(r,i){if(i===0)return;e.forEach(r,function(r,i){e.isObject(r)&&e.isObject(n[i])?t.extendRecursive(n[i],r):n[i]=r})}),n},e.module("ngx.utils",[]).value("ngxUtils",t)}(window.angular),function(e){"use strict";e.module("ngx.ui.imageupload").run(["ngxDictionary",function(e){e.addItems("cs",{NGX_UI_IMAGEUPLOAD_PREVIEW:"náhled",NGX_UI_IMAGEUPLOAD_INPUT_DRAG:"Sem přetáhněte obrázek",NGX_UI_IMAGEUPLOAD_INPUT_OR:"nebo můžete...",NGX_UI_IMAGEUPLOAD_INPUT_BROWSE:"vybrat z počítače",NGX_UI_IMAGEUPLOAD_SCALE_INFO:"maximální povolené rozměry obrázku jsou {{resultWidth}} x {{resultHeight}}",NGX_UI_IMAGEUPLOAD_DIALOG_SUBMIT:"Nahrát",NGX_UI_IMAGEUPLOAD_DIALOG_CANCEL:"Zrušit",NGX_UI_IMAGEUPLOAD_INVALID_IMAGE:"Neplatný obrázek",NGX_UI_IMAGEUPLOAD_PROCESS_ERROR:"Chyba při zpracování obrázku anebo neplatný obrázek"})}])}(window.angular),function(e){"use strict";e.module("ngx.ui.imageupload").run(["ngxDictionary",function(e){e.addItems("en",{NGX_UI_IMAGEUPLOAD_PREVIEW:"preview",NGX_UI_IMAGEUPLOAD_INPUT_DRAG:"Drag image here",NGX_UI_IMAGEUPLOAD_INPUT_OR:"or...",NGX_UI_IMAGEUPLOAD_INPUT_BROWSE:"choose from your disk",NGX_UI_IMAGEUPLOAD_SCALE_INFO:"maximum allowed dimensions are {{resultWidth}} x {{resultHeight}}",NGX_UI_IMAGEUPLOAD_DIALOG_SUBMIT:"Submit",NGX_UI_IMAGEUPLOAD_DIALOG_CANCEL:"Cancel",NGX_UI_IMAGEUPLOAD_INVALID_IMAGE:"Invalid image",NGX_UI_IMAGEUPLOAD_PROCESS_ERROR:"Error processing image or invalid image"})}])}(window.angular);