2016-07-12 18:46:51 +02:00
|
|
|
function l(){var a,b,c=arguments[0],d=c,e=arguments;for(labels[c]?d=labels[c]:clabels[c]&&(d=clabels[c]),a=1,b=0;a<e.length;a++,b++)d=d.replace("%{"+b+"}",e[a]);return a=1,e.length>1&&(d=d.replace(/%((%)|s|d)/g,function(b){var c=null;if(b[2])c=b[2];else{switch(c=e[a],b){case"%d":c=parseFloat(c),isNaN(c)&&(c=0)}a++}return c})),d}function hexToRgb(a){var b=/^#?([a-f\d]{2})([a-f\d]{2})([a-f\d]{2})$/i.exec(a);return b?{r:parseInt(b[1],16),g:parseInt(b[2],16),b:parseInt(b[3],16)}:null}function contrast(a){var b,c,d=1;if(b=hexToRgb(a)){c=[b.r/255,b.g/255,b.b/255];for(var e=0;e<c.length;++e)c[e]<=.03928?c[e]=c[e]/12.92:c[e]=Math.pow((c[e]+.055)/1.055,2.4);d=.2126*c[0]+.7152*c[1]+.0722*c[2]}return d>.179?"black":"white"}function guid(){function a(){return(65536*(1+Math.random())|0).toString(16).substring(1)}return(a()+a()+"-"+a()+"-4"+a().substr(0,3)+"-"+a()+"-"+a()+a()+a()).toLowerCase()}!function(){"use strict";function a(a,b,c,d){d.definePalette("sogo-green",{50:"eaf5e9",100:"cbe5c8",200:"aad6a5",300:"88c781",400:"66b86a",500:"56b04c",600:"4da143",700:"388e3c",800:"367d2e",900:"225e1b",A100:"fafafa",A200:"69f0ae",A400:"00e676",A700:"00c853",contrastDefaultColor:"dark",contrastLightColors:["300","400","500","600","700","800","900"]}),d.definePalette("sogo-blue",{50:"f0faf9",100:"e1f5f3",200:"ceebe8",300:"bfe0dd",400:"b2d6d3",500:"a1ccc8",600:"8ebfbb",700:"7db3b0",800:"639997",900:"4d8080",A100:"d4f7fa",A200:"c3f5fa",A400:"53e3f0",A700:"00b0c0",contrastDefaultColor:"light",contrastDarkColors:["50","100","200"]}),d.definePalette("sogo-paper",{50:"fcf7f8",100:"f7f1dc",200:"ede5ca",300:"e6d8ba",400:"e2d2a3",500:"d6c48d",600:"baa870",700:"857545",800:"524517",900:"433809",1000:"000000",A100:"ffffff",A200:"eeeeee",A400:"bdbdbd",A700:"616161",contrastDefaultColor:"dark",contrastLightColors:["800","900"]}),d.theme("default").primaryPalette("sogo-blue",{"default":"900","hue-1":"400","hue-2":"800","hue-3":"A700"}).accentPalette("sogo-green",{"default":"500","hue-1":"A100","hue-2":"300","hue-3":"A700"}).backgroundPalette("grey",{"default":"50","hue-1":"200","hue-2":"300","hue-3":"500"}),DebugEnabled||(a.debugEnabled(!1),b.debugInfoEnabled(!1)),c.interceptors.push("AuthInterceptor"),c.interceptors.push("ErrorInterceptor")}function b(a,b){return{response:function(c){return c&&/^application\/json/.test(c.config.headers.Accept)&&/^<!DOCTYPE html>/.test(c.data)?(a.location.reload(!0),b.reject()):c}}}function c(a,b){return{responseError:function(c){return/^application\/json/.test(c.config.headers.Accept)&&a.$broadcast("http:Error",c),b.reject(c)}}}angular.module("SOGo.Common",["ngAnimate","ngMessages","ngSanitize","ngMaterial","mdColors"]).value("sgSettings",{isPopup:document.body.classList.contains("popup"),baseURL:function(){return ApplicationBaseURL||null},resourcesURL:function(){return ResourcesURL||null},activeUser:function(a){var b={login:UserLogin||null,identification:UserIdentification||null,email:UserEmail||null,language:UserLanguage||null,folderURL:UserFolderURL||null,isSuperUser:IsSuperUser||null,path:{calendar:UserCalendarPath||null,contacts:UserContactsPath||null,mail:UserMailPath||null,preferences:UserPreferencesPath||null,administration:IsSuperUser?UserAdministrationPath:null,help:HelpURL||null,logoff:UserLogoffPath||null}};return a?b[a]:b}}).constant("sgColors",{selection:["#FFFFFF","#330033","#C0C0C0","#999999","#666666","#333333","#000000","#FFCCCC","#FF6666","#FF0000","#CC0000","#990000","#660000","#330000","#FFCC99","#FF9966","#FF9900","#FF6600","#CC6600","#993300","#663300","#FFFF99","#FFFF66","#FFCC66","#FFCC33","#CC9933","#996633","#663333","#FFFFCC","#FFFF33","#FFFF00","#FFCC00","#999900","#666600","#333300","#CCCCCC","#66FF99","#33FF33","#33CC00","#009900","#006600","#003300","#99FFFF","#33FFFF","#66CCCC","#00CCCC","#339999","#336666","#003333","#CCFFFF","#66FFFF","#33CCFF","#3366FF","#3333FF","#000099","#000066","#CCCCFF","#9999FF","#6666CC","#6633FF","#6600CC","#333399","#330099","#FFCCFF","#FF99FF","#CC66CC","#CC33CC","#993399","#663366","#99FF99"]}).constant("sgConstant",{xs:"(max-width: 599px)","gt-xs":"(min-widt
|
|
|
|
controller:a,controllerAs:"cssCtrl",template:['<style type="text/css">'," .bg-folder{{ cssCtrl.ngModel.id }} {"," background-color: {{ cssCtrl.ngModel.color }} !important;"," color: {{ cssCtrl.contrast(cssCtrl.ngModel.color) }} !important;"," }"," .sg-event.bg-folder{{ cssCtrl.ngModel.id }} md-icon {"," color: {{ cssCtrl.contrast(cssCtrl.ngModel.color) }} !important;"," }"," md-toolbar.bg-folder{{ cssCtrl.ngModel.id }} md-icon:not(.sg-icon-toolbar-bg) {"," color: {{ cssCtrl.contrast(cssCtrl.ngModel.color) }} !important;"," }"," .bg-folder{{ cssCtrl.ngModel.id }} label,"," .bg-folder{{ cssCtrl.ngModel.id }} .md-input {"," color: {{ cssCtrl.contrast(cssCtrl.ngModel.color) }} !important;"," opacity: 0.8;"," }"," .fg-folder{{ cssCtrl.ngModel.id }},"," .sg-event.fg-folder{{ cssCtrl.ngModel.id }} md-icon {"," color: {{ cssCtrl.ngModel.color }} !important;"," }"," .bdr-folder{{ cssCtrl.ngModel.id }} {"," border-color: {{ cssCtrl.ngModel.color }} !important;"," }"," .contrast-bdr-folder{{ cssCtrl.ngModel.id }} {"," border-color: {{ cssCtrl.contrast(cssCtrl.ngModel.color) }} !important;"," }"," .checkbox-folder{{ cssCtrl.ngModel.id }} .md-icon {"," background-color: {{ cssCtrl.ngModel.color }} !important;"," }"," .checkbox-folder{{ cssCtrl.ngModel.id }}.md-checked .md-icon:after {"," border-color: {{ cssCtrl.contrast(cssCtrl.ngModel.color) }} !important;"," }","</style>"].join("")}}angular.module("SOGo.Common").directive("sgFolderStylesheet",a)}(),function(){"use strict";function a(){return{restrict:"A",scope:{placeholder:"=sgPlaceholder"},link:function(a,b,c){a.$watch("placeholder",function(){b[0].placeholder=a.placeholder})}}}angular.module("SOGo.Common").directive("sgPlaceholder",a)}(),function(){"use strict";function a(a,b,c,d){function e(a,b){return function(a,b,c,d){function e(a){b[0].hasAttribute("disabled")||(g.classList.contains("ng-hide")?(angular.element(h).css({overflow:"hidden"}),g.classList.remove("ng-hide"),f.css({top:a.pageY-h.offsetTop+"px",left:a.pageX-h.offsetLeft+"px",width:"400vw",height:"400vw"})):(g.classList.add("ng-hide"),f.css({top:a.pageY-h.offsetTop+"px",left:a.pageX-h.offsetLeft+"px",height:"0px",width:"0px"})))}var f,g,h,i;for(i=b.attr("sg-ripple-click"),h=b[0].parentNode;h&&h.id!=i;)h=h.parentNode;f=h.querySelector(".sg-ripple"),f?f=angular.element(f):(f=angular.element('<div class="sg-ripple md-default-theme md-bg"></div>'),h.appendChild(f[0])),g=h.querySelector(".sg-ripple-content"),g.classList.contains("ng-hide")||g.classList.add("ng-hide"),b.on("click",e)}}return{restrict:"A",compile:e}}angular.module("SOGo.Common").directive("sgRippleClick",a),a.$inject=["$parse","$mdAria","$document","$mdUtil"]}(),function(){"use strict";function a(a){function b(b,c){var d=(b.find("md-input-container"),b.find("input")),e=b.find("md-select"),f=b.find("md-button");return d.attr("ng-model","$sgSearchController.searchText"),d.attr("ng-model-options","$sgSearchController.searchTextOptions"),d.attr("ng-change","$sgSearchController.onChange()"),e&&(e.attr("ng-model","$sgSearchController.searchField"),e.attr("ng-change","$sgSearchController.onChange()")),f&&f.attr("sg-search-cancel")?(f.attr("ng-click",f.attr("sg-search-cancel")),f.removeAttr("sg-search-cancel")):f=null,function(b,c,e,g){var h=c.find("button");g.formName=c.attr("name"),g.inputName=d.attr("name"),g.allowDot=a(c.attr("sg-allow-dot"))(b),g.doSearch=a(c.attr("sg-search")),f&&h&&h.on("click",g.cancelSearch)}}return{restrict:"A",controller:"sgSearchController",controllerAs:"$sgSearchController",priority:1001,compile:b}}function b(){function a(a,b){return function(a,b,c,d,e){e(function(a){b.append(a)})}}return{restrict:"A",priority:1e3,transclude:!0,compile:a}}function c(a,b,c){var d,e=this;d=angular.isNumber(a.minimumSearchLength)?a.minimumSearchLength:2,e.searchText=null,e.searchTextOptions={updateOn:"default blur",debounce:{"default":300,blur:0}},e.onChange=function(){var a=b[e.formName],c=a[e.inputName],d=c.$viewValue;(e.allowDot&&"."==d||a.$valid&&d)&&("."==d&&c.$setValidity("minlength",!0),e.doSearc
|