2015-08-25 17:46:14 +02:00
|
|
|
function l(){var key=arguments[0],value=key;labels[key]?value=labels[key]:clabels[key]&&(value=clabels[key]);for(var i=1,j=0;i<arguments.length;i++,j++)value=value.replace("%{"+j+"}",arguments[i]);return value}!function(){"use strict";function configure($mdThemingProvider){$mdThemingProvider.definePalette("sogo-green",{50:"eaf5e9",100:"cbe5c8",200:"aad6a5",300:"88c781",400:"66b86a",500:"56b04c",600:"4da143",700:"388e3c",800:"367d2e",900:"225e1b",A100:"b9f6ca",A200:"69f0ae",A400:"00e676",A700:"00c853",contrastDefaultColor:"dark",contrastDarkColors:"50 100 200",contrastLightColors:"300 400 500 600 700 800 900"}),$mdThemingProvider.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"],contrastLightColors:["300","400","500","600","700","800","900","A100","A200","A400","A700"]}),$mdThemingProvider.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"}),$mdThemingProvider.theme("default").primaryPalette("sogo-blue",{"default":"300","hue-1":"100","hue-2":"400","hue-3":"A700"}).accentPalette("sogo-green",{"default":"500","hue-1":"200","hue-2":"300","hue-3":"A700"}).backgroundPalette("sogo-paper",{"default":"100","hue-1":"200","hue-2":"50","hue-3":"500"})}angular.module("SOGo.Common",["ngMaterial"]).value("sgSettings",{baseURL:function(){return ApplicationBaseURL||null},activeUser:function(param){var settings={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,logoff:UserLogoffPath||null}};return param?settings[param]:settings}}).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",{sm:"(max-width: 600px)","gt-sm":"(min-width: 600px)",md:"(min-width: 600px) and (max-width: 1024px)","gt-md":"(min-width: 1025px)",lg:"(min-width: 1024px) and (max-width: 1280px)","gt-lg":"(min-width: 1280px)"}).config(configure),configure.$inject=["$mdThemingProvider"]}(),function(){"use strict";function decodeUri($window){return $window.decodeURIComponent}decodeUri.$inject=["$window"],angular.module("SOGo.Common").filter("decodeUri",decodeUri)}(),function(){"use strict";function encodeUri($window){return $window.encodeURIComponent}encodeUri.$inject=["$window"],angular.module("SOGo.Common").filter("encodeUri",encodeUri)}(),function(){"use strict";function loc(){return l}angular.module("SOGo.Common").filter("loc",loc)}(),function(){"use strict";function range(){return function(n){for(var res=[],i=0;i<parseInt(n);i++)res.push(i);return res}}angular.module("SOGo.Common").filter("range",range)}(),function(){"use strict";function AclController($mdDialog,Dialog,usersWithACL,User,folder){function userFilter($query){return User.$filter($query,folder.$acl.users)}function closeModal(){folder.$acl.$resetUsersRights(),$md
|
|
|
|
function link(scope,iElement,attrs,ctrl){function toggle(day){var i=_.findIndex(modelDays,function(o){return modelAttr?o[modelAttr]==day:o==day});if(0>i)if(modelAttr){var o={};o[modelAttr]=day,modelDays.push(o)}else modelDays.push(day);else modelDays.splice(i,1)}var tile,i,modelDays,modelAttr,ensureInitRunsOnce,toggleClass,tiles=iElement.find("md-grid-tile");for(ensureInitRunsOnce=scope.$watch(function(){return $parse(attrs.sgToggleGrid)(scope)},function(days){if(angular.isDefined(days)){var flattenedDays=days;modelDays=days,attrs.sgToggleGridAttr&&(modelAttr=attrs.sgToggleGridAttr,flattenedDays=_.pluck(days,attrs.sgToggleGridAttr)),_.each(tiles,function(o){var tile=angular.element(o);_.contains(flattenedDays,tile.attr("value"))&&tile.addClass("sg-active")}),ensureInitRunsOnce()}}),toggleClass=function(){var tile=angular.element(this),day=tile.attr("value");tile.toggleClass("sg-active"),toggle(day)},i=0;i<tiles.length;i++)tile=angular.element(tiles[i]),tile.addClass("iconButton"),tile.find("figure").addClass("md-icon"),tile.on("click",toggleClass)}return{restrict:"A",link:link}}sgToggleGrid.$inject=["$parse"],angular.module("SOGo.Common").directive("sgToggleGrid",sgToggleGrid)}(),String.prototype.endsWith=function(suffix){return-1!==this.indexOf(suffix,this.length-suffix.length)},String.prototype.startsWith=function(pattern,position){return position=angular.isNumber(position)?position:0,this.lastIndexOf(pattern,position)===position},String.prototype._base64_keyStr="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/=",String.prototype.base64encode=function(){for(var chr1,chr2,chr3,enc1,enc2,enc3,enc4,output="",i=0,input=this.utf8encode();i<input.length;)chr1=input.charCodeAt(i++),chr2=input.charCodeAt(i++),chr3=input.charCodeAt(i++),enc1=chr1>>2,enc2=(3&chr1)<<4|chr2>>4,enc3=(15&chr2)<<2|chr3>>6,enc4=63&chr3,isNaN(chr2)?enc3=enc4=64:isNaN(chr3)&&(enc4=64),output=output+this._base64_keyStr.charAt(enc1)+this._base64_keyStr.charAt(enc2)+this._base64_keyStr.charAt(enc3)+this._base64_keyStr.charAt(enc4);return output},String.prototype.base64decode=function(){for(var chr1,chr2,chr3,enc1,enc2,enc3,enc4,output="",i=0,input=""+this;i<input.length;)enc1=this._base64_keyStr.indexOf(input.charAt(i++)),enc2=this._base64_keyStr.indexOf(input.charAt(i++)),enc3=this._base64_keyStr.indexOf(input.charAt(i++)),enc4=this._base64_keyStr.indexOf(input.charAt(i++)),chr1=enc1<<2|enc2>>4,chr2=(15&enc2)<<4|enc3>>2,chr3=(3&enc3)<<6|enc4,output+=String.fromCharCode(chr1),64!=enc3&&(output+=String.fromCharCode(chr2)),64!=enc4&&(output+=String.fromCharCode(chr3));return output},String.prototype.md5=function(){if(this.length){var md5=function(s){function L(k,d){return k<<d|k>>>32-d}function K(G,k){var I,d,F,H,x;return F=2147483648&G,H=2147483648&k,I=1073741824&G,d=1073741824&k,x=(1073741823&G)+(1073741823&k),I&d?2147483648^x^F^H:I|d?1073741824&x?3221225472^x^F^H:1073741824^x^F^H:x^F^H}function r(d,F,k){return d&F|~d&k}function q(d,F,k){return d&k|F&~k}function p(d,F,k){return d^F^k}function n(d,F,k){return F^(d|~k)}function u(G,F,aa,Z,k,H,I){return G=K(G,K(K(r(F,aa,Z),k),I)),K(L(G,H),F)}function f(G,F,aa,Z,k,H,I){return G=K(G,K(K(q(F,aa,Z),k),I)),K(L(G,H),F)}function D(G,F,aa,Z,k,H,I){return G=K(G,K(K(p(F,aa,Z),k),I)),K(L(G,H),F)}function t(G,F,aa,Z,k,H,I){return G=K(G,K(K(n(F,aa,Z),k),I)),K(L(G,H),F)}function e(G){for(var Z,F=G.length,x=F+8,k=(x-x%64)/64,I=16*(k+1),aa=Array(I-1),d=0,H=0;F>H;)Z=(H-H%4)/4,d=H%4*8,aa[Z]=aa[Z]|G.charCodeAt(H)<<d,H++;return Z=(H-H%4)/4,d=H%4*8,aa[Z]=aa[Z]|128<<d,aa[I-2]=F<<3,aa[I-1]=F>>>29,aa}function B(x){var G,d,k="",F="";for(d=0;3>=d;d++)G=x>>>8*d&255,F="0"+G.toString(16),k+=F.substr(F.length-2,2);return k}function J(k){k=k.replace(/rn/g,"n");for(var d="",F=0;F<k.length;F++){var x=k.charCodeAt(F);128>x?d+=String.fromCharCode(x):x>127&&2048>x?(d+=String.fromCharCode(x>>6|192),d+=String.fromCharCode(63&x|128)):(d+=String.fromCharCode(x>>12|224),d+=String.fromCharCode(x>>6&63|128),d+=String.fromCharCode(63&x|128))}return d}var P,h,E,v,g,Y,X,W,V,C=Array(),S=7,Q=12,N=17,M=22,A=5,z=9,y=14,w=20,o=4,m=11,l=16,j=2
|