/*
 ZeroClipboard
 The ZeroClipboard library provides an easy way to copy text to the clipboard using an invisible Adobe Flash movie and a JavaScript interface.
 Copyright (c) 2014 Jon Rohan, James M. Greene
 Licensed MIT
 http://zeroclipboard.org/
 v1.3.5
*/
Ext.namespace("Zarafa.plugins.files.backend.Owncloud");
Zarafa.plugins.files.backend.Owncloud.OwncloudBackend=Ext.extend(Zarafa.core.Plugin,{constructor:function(a){a=a||{};Zarafa.plugins.files.backend.Owncloud.OwncloudBackend.superclass.constructor.call(this,a)},initPlugin:function(){Zarafa.plugins.files.backend.Owncloud.OwncloudBackend.superclass.initPlugin.apply(this,arguments);this.registerInsertionPoint("plugin.files.sharedialog",this.createShareDialogInsertionPoint,this);Zarafa.core.data.SharedComponentType.addProperty("filesplugin.owncloud.useredit")},createShareDialogInsertionPoint:function(){return{xtype:"filesplugin.owncloud.filessharedialogpanel"}},
bidSharedComponent:function(a,c){var e=-1;switch(a){case Zarafa.core.data.SharedComponentType["filesplugin.owncloud.useredit"]:e=1}return e},getSharedComponent:function(a,c){var e;switch(a){case Zarafa.core.data.SharedComponentType["filesplugin.owncloud.useredit"]:e=Zarafa.plugins.files.backend.Owncloud.ui.FilesShareUserEditContentPanel}return e}});
Zarafa.onReady(function(){container.registerPlugin(new Zarafa.core.PluginMetaData({name:"filesbackendOwncloud",displayName:dgettext("plugin_filesbackendOwncloud","Files: ownCloud Backend"),allowUserDisable:!1,pluginConstructor:Zarafa.plugins.files.backend.Owncloud.OwncloudBackend}))});Ext.namespace("Zarafa.plugins.files.backend.Owncloud.data");Zarafa.plugins.files.backend.Owncloud.data.RecipientTypes=Zarafa.core.Enum.create({USER:0,GROUP:1,LINK:3});Ext.namespace("Zarafa.plugins.files.backend.Owncloud.data");
Zarafa.plugins.files.backend.Owncloud.data.ResponseHandler=Ext.extend(Zarafa.core.data.AbstractResponseHandler,{successCallback:null,failureCallback:null,doLoadsharingdetails:function(a){this.successCallback(a)},doCreatenewshare:function(a){this.successCallback(a)},doDeleteexistingshare:function(a){this.successCallback(a)},doUpdateexistingshare:function(a){this.successCallback(a)},doError:function(a){Zarafa.common.dialogs.MessageBox.show({title:a.header,msg:a.message,icon:Zarafa.common.dialogs.MessageBox.ERROR,
buttons:Zarafa.common.dialogs.MessageBox.OK});this.failureCallback(a)}});Ext.reg("filesplugin.owncloud.responsehandler",Zarafa.plugins.files.backend.Owncloud.data.ResponseHandler);Ext.namespace("Zarafa.plugins.files.backend.Owncloud.data");
Zarafa.plugins.files.backend.Owncloud.data.ShareGridRecord=Ext.data.Record.create({name:"id",type:"string"},{name:"shareWith",type:"string"},{name:"shareWithDisplayname",type:"string"},{name:"type",type:"string"},{name:"permissionCreate",type:"bool"},{name:"permissionChange",type:"bool"},{name:"permissionDelete",type:"bool"},{name:"permissionShare",type:"bool"});Ext.namespace("Zarafa.plugins.files.backend.Owncloud.data");
Zarafa.plugins.files.backend.Owncloud.data.ShareGridStore=Ext.extend(Ext.data.ArrayStore,{constructor:function(a){Zarafa.plugins.files.backend.Owncloud.data.ShareGridStore.superclass.constructor.call(this,{fields:"id shareWith shareWithDisplayname type permissionCreate permissionChange permissionDelete permissionShare".split(" "),fileType:a})}});Ext.reg("filesplugin.owncloud.sharegridstore",Zarafa.plugins.files.backend.Owncloud.data.ShareGridStore);Ext.namespace("Zarafa.plugins.files.backend.Owncloud.data.singleton");
Zarafa.plugins.files.backend.Owncloud.data.singleton.ShareStore=Ext.extend(Object,{store:void 0,init:function(a){this.store=new Zarafa.plugins.files.backend.Owncloud.data.ShareGridStore(a)},addUser:function(a){var c=!1,e=!1,k=!1,m=!1;1<=a.permissions-16&&(m=!0,a.permissions-=16);1<=a.permissions-8&&(k=!0,a.permissions-=8);1<=a.permissions-4&&(c=!0,a.permissions-=4);1<=a.permissions-2&&(e=!0);this.store.loadData([[a.id,a.shareWith,a.shareWithDisplayname,"user",c,e,k,m]],!0)},addGroup:function(a){var c=
!1,e=!1,k=!1,m=!1;1<=a.permissions-16&&(m=!0,a.permissions-=16);1<=a.permissions-8&&(k=!0,a.permissions-=8);1<=a.permissions-4&&(c=!0,a.permissions-=4);1<=a.permissions-2&&(e=!0);this.store.loadData([[a.id,a.shareWith,a.shareWithDisplayname,"group",c,e,k,m]],!0)},getStore:function(){return this.store}});Zarafa.plugins.files.backend.Owncloud.data.singleton.ShareStore=new Zarafa.plugins.files.backend.Owncloud.data.singleton.ShareStore;Ext.namespace("Ext.ux");
Ext.ux.CopyButton=Ext.extend(Ext.Button,{zclipboard:void 0,completeText:"Text copied to clipboard",swfPath:"ZeroClipboard.swf",constructor:function(a){a=a||{};Ext.ux.CopyButton.superclass.constructor.call(this,a);this.init()},init:function(){ZeroClipboard.config({moviePath:this.swfPath});this.zclipboard=new ZeroClipboard},afterRender:function(){Ext.ux.CopyButton.superclass.afterRender.call(this);this.zclipboard.clip(this.getEl().dom);this.zclipboard.on("complete",this.onCopyComplete.createDelegate(this));
this.zclipboard.on("dataRequested",this.onDataRequested.createDelegate(this))},onDestroy:function(){this.zclipboard.destroy();Ext.ux.CopyButton.superclass.onDestroy.call(this)},onDataRequested:function(a,c){a.setText(this.getValue())},onCopyComplete:function(a,c){alert(this.completeText)},setValue:function(a){this.value=String(a)},getValue:function(){return this.value}});Ext.reg("copybutton",Ext.ux.CopyButton);
(function(a){function c(b){return b.replace(/,/g,".").replace(/[^0-9\.]/g,"")}var e,k=null,m="0.0.0",x=null,B=null,v=null,C={},S=0,q={},T=0,z={},F=null,G=null,U=function(){var b,a,d,n,f="ZeroClipboard.swf";if(!document.currentScript||!(n=document.currentScript.src)){var c=document.getElementsByTagName("script");if("readyState"in c[0])for(b=c.length;b--&&("interactive"!==c[b].readyState||!(n=c[b].src)););else if("loading"===document.readyState)n=c[c.length-1].src;else{for(b=c.length;b--;){d=c[b].src;
if(!d){a=null;break}d=d.split("#")[0].split("?")[0];d=d.slice(0,d.lastIndexOf("/")+1);if(null==a)a=d;else if(a!==d){a=null;break}}null!==a&&(n=a)}}n&&(n=n.split("#")[0].split("?")[0],f=n.slice(0,n.lastIndexOf("/")+1)+f);return f}(),V=function(){var b=/\-([a-z])/g,a=function(b,a){return a.toUpperCase()};return function(d){return d.replace(b,a)}}(),J=function(b){b||(b=a.event);var h;this!==a?h=this:b.target?h=b.target:b.srcElement&&(h=b.srcElement);l.activate(h)},H=function(b,a){if(!b||1!==b.nodeType)return b;
if(b.classList)return b.classList.contains(a)||b.classList.add(a),b;if(a&&"string"===typeof a){var d=(a||"").split(/\s+/);if(1===b.nodeType)if(b.className){for(var h=" "+b.className+" ",f=b.className,c=0,e=d.length;c<e;c++)0>h.indexOf(" "+d[c]+" ")&&(f+=" "+d[c]);b.className=f.replace(/^\s+|\s+$/g,"")}else b.className=a}return b},D=function(b,a){if(!b||1!==b.nodeType)return b;if(b.classList)return b.classList.contains(a)&&b.classList.remove(a),b;if(a&&"string"===typeof a||void 0===a){var d=(a||"").split(/\s+/);
if(1===b.nodeType&&b.className)if(a){for(var h=(" "+b.className+" ").replace(/[\n\t]/g," "),c=0,p=d.length;c<p;c++)h=h.replace(" "+d[c]+" "," ");b.className=h.replace(/^\s+|\s+$/g,"")}else b.className=""}return b},y=function(b,a,d){if("function"===typeof a.indexOf)return a.indexOf(b,d);var h=a.length;for("undefined"===typeof d?d=0:0>d&&(d=h+d);d<h;d++)if(a.hasOwnProperty(d)&&a[d]===b)return d;return-1},L=function(b){if("string"===typeof b)throw new TypeError("ZeroClipboard doesn't accept query strings.");
return b.length?b:[b]},W=function(b,h,d,c){c?a.setTimeout(function(){b.apply(h,d)},0):b.apply(h,d)},M=function(b){var a,d;b&&("number"===typeof b&&0<b?a=b:"string"===typeof b&&(d=parseInt(b,10))&&!isNaN(d)&&0<d&&(a=d));a||("number"===typeof g.zIndex&&0<g.zIndex?a=g.zIndex:"string"===typeof g.zIndex&&(d=parseInt(g.zIndex,10))&&!isNaN(d)&&0<d&&(a=d));return a||0},r=function(b,a){if(b&&!1!==a&&"undefined"!==typeof console&&console&&(console.warn||console.log)){var d="`"+b+"` is deprecated. See docs for more info:\n    https://github.com/zeroclipboard/zeroclipboard/blob/master/docs/instructions.md#deprecations";
console.warn?console.warn(d):console.log(d)}},N=function(){var b,a,d,c,f,p=arguments[0]||{};b=1;for(a=arguments.length;b<a;b++)if(null!=(d=arguments[b]))for(c in d)d.hasOwnProperty(c)&&(f=d[c],p!==f&&void 0!==f&&(p[c]=f));return p},I=function(b){if(null==b||""===b)return null;b=b.replace(/^\s+|\s+$/g,"");if(""===b)return null;var a=b.indexOf("//");b=-1===a?b:b.slice(a+2);var d=b.indexOf("/");return(b=-1===d?b:-1===a||0===d?null:b.slice(0,d))&&".swf"===b.slice(-4).toLowerCase()?null:b||null},X=function(){var b=
function(b,a){var d,h,c;if(null!=b&&"*"!==a[0]&&("string"===typeof b&&(b=[b]),"object"===typeof b&&"length"in b))for(d=0,h=b.length;d<h;d++)if(b.hasOwnProperty(d)&&(c=I(b[d]))){if("*"===c){a.length=0;a.push("*");break}-1===y(c,a)&&a.push(c)}},a={always:"always",samedomain:"sameDomain",never:"never"};return function(d,h){var c,n=h.allowScriptAccess;if("string"===typeof n&&(c=n.toLowerCase())&&/^always|samedomain|never$/.test(c))return a[c];c=I(h.moviePath);null===c&&(c=d);n=[];b(h.trustedOrigins,n);
b(h.trustedDomains,n);var e=n.length;if(0<e){if(1===e&&"*"===n[0])return"always";if(-1!==y(d,n))return 1===e&&d===c?"sameDomain":"always"}return"never"}}(),O=function(b){if(null==b)return[];if(Object.keys)return Object.keys(b);var a=[],d;for(d in b)b.hasOwnProperty(d)&&a.push(d);return a},P=function(){var b=!1;if("boolean"===typeof x)b=!1===x;else{if("function"===typeof ActiveXObject)try{new ActiveXObject("ShockwaveFlash.ShockwaveFlash"),b=!0}catch(h){}!b&&navigator.mimeTypes["application/x-shockwave-flash"]&&
(b=!0)}return b},l=function(b,h){if(!(this instanceof l))return new l(b,h);this.id=""+S++;q[this.id]={instance:this,elements:[],handlers:{}};b&&this.clip(b);"undefined"!==typeof h&&(r("new ZeroClipboard(elements, options)",g.debug),l.config(h));this.options=l.config();"boolean"!==typeof x&&(x=!P());if(!1===x&&!0!==B&&null===k){v=B=!1;var d,c,f=document.getElementById("global-zeroclipboard-html-bridge");if(!f){d=l.config();d.jsModuleId="string"===typeof F&&F||"string"===typeof G&&G||null;var f=X(a.location.host,
g),e,K,u,t=[],w=[],m=[];d.trustedOrigins&&("string"===typeof d.trustedOrigins?w.push(d.trustedOrigins):"object"===typeof d.trustedOrigins&&"length"in d.trustedOrigins&&(w=w.concat(d.trustedOrigins)));d.trustedDomains&&("string"===typeof d.trustedDomains?w.push(d.trustedDomains):"object"===typeof d.trustedDomains&&"length"in d.trustedDomains&&(w=w.concat(d.trustedDomains)));if(w.length)for(e=0,K=w.length;e<K;e++)if(w.hasOwnProperty(e)&&w[e]&&"string"===typeof w[e]&&(u=I(w[e]))){if("*"===u){m=[u];break}m.push.apply(m,
[u,"//"+u,a.location.protocol+"//"+u])}m.length&&t.push("trustedOrigins="+encodeURIComponent(m.join(",")));"string"===typeof d.jsModuleId&&d.jsModuleId&&t.push("jsModuleId="+encodeURIComponent(d.jsModuleId));d=t.join("&");e=g.moviePath+(null==g||g&&!0===g.cacheBust&&!0===g.useNoCache?(-1===g.moviePath.indexOf("?")?"?":"&")+"noCache="+(new Date).getTime():"");d='      <object classid="clsid:d27cdb6e-ae6d-11cf-96b8-444553540000" id="global-zeroclipboard-flash-bridge" width="100%" height="100%">         <param name="movie" value="'+
e+'"/>         <param name="allowScriptAccess" value="'+f+'"/>         <param name="scale" value="exactfit"/>         <param name="loop" value="false"/>         <param name="menu" value="false"/>         <param name="quality" value="best" />         <param name="bgcolor" value="#ffffff"/>         <param name="wmode" value="transparent"/>         <param name="flashvars" value="'+d+'"/>         <embed src="'+e+'"           loop="false" menu="false"           quality="best" bgcolor="#ffffff"           width="100%" height="100%"           name="global-zeroclipboard-flash-bridge"           allowScriptAccess="'+
f+'"           allowFullScreen="false"           type="application/x-shockwave-flash"           wmode="transparent"           pluginspage="http://www.macromedia.com/go/getflashplayer"           flashvars="'+d+'"           scale="exactfit">         </embed>       </object>';f=document.createElement("div");f.id="global-zeroclipboard-html-bridge";f.setAttribute("class","global-zeroclipboard-container");f.style.position="absolute";f.style.left="0px";f.style.top="-9999px";f.style.width="15px";f.style.height=
"15px";f.style.zIndex=""+M(g.zIndex);document.body.appendChild(f);f.innerHTML=d}(d=document["global-zeroclipboard-flash-bridge"])&&(c=d.length)&&(d=d[c-1]);k=d||f.children[0].lastElementChild}};l.prototype.setText=function(b){b&&""!==b&&(C["text/plain"]=b,!0===v&&k&&"function"===typeof k.setText?k.setText(b):v=!1);return this};l.prototype.setSize=function(b,a){!0===v&&k&&"function"===typeof k.setSize?k.setSize(b,a):v=!1;return this};var Q=function(b){!0===v&&k&&"function"===typeof k.setHandCursor?
k.setHandCursor(b):v=!1};l.prototype.destroy=function(){this.unclip();this.off();delete q[this.id]};l.version="1.3.5";var g={swfPath:U,trustedDomains:a.location.host?[a.location.host]:[],cacheBust:!0,forceHandCursor:!1,zIndex:999999999,debug:!0,title:null,autoActivate:!0};l.config=function(b){"object"===typeof b&&null!==b&&N(g,b);if("string"===typeof b&&b){if(g.hasOwnProperty(b))return g[b]}else{b={};for(var a in g)g.hasOwnProperty(a)&&(b[a]="object"===typeof g[a]&&null!==g[a]?"length"in g[a]?g[a].slice(0):
N({},g[a]):g[a]);return b}};l.destroy=function(){l.deactivate();for(var b in q)if(q.hasOwnProperty(b)&&q[b]){var a=q[b].instance;a&&"function"===typeof a.destroy&&a.destroy()}(b=E(k))&&b.parentNode&&(b.parentNode.removeChild(b),k=v=null)};l.activate=function(b){e&&(D(e,g.hoverClass),D(e,g.activeClass));e=b;H(b,g.hoverClass);R();var c=g.title||b.getAttribute("title");if(c){var d=E(k);d&&d.setAttribute("title",c)}if(!(c=!0===g.forceHandCursor)){a:{a.getComputedStyle?c=a.getComputedStyle(b,null).getPropertyValue("cursor"):
(c=V("cursor"),c=b.currentStyle?b.currentStyle[c]:b.style[c]);if(!c||"auto"===c)if(b=b.tagName.toLowerCase(),"a"===b){b="pointer";break a}b=c}c="pointer"===b}Q(c)};l.deactivate=function(){var a=E(k);a&&(a.style.left="0px",a.style.top="-9999px",a.removeAttribute("title"));e&&(D(e,g.hoverClass),D(e,g.activeClass),e=null)};var E=function(a){var b=/^OBJECT|EMBED$/;for(a=a&&a.parentNode;a&&b.test(a.nodeName)&&a.parentNode;)a=a.parentNode;return a||null},R=function(){if(e){var b=e,c=0,d=0,n=0,f=0,p=M(g.zIndex)-
1;b.getBoundingClientRect&&(f=b.getBoundingClientRect(),"pageXOffset"in a&&"pageYOffset"in a?(c=a.pageXOffset,d=a.pageYOffset):(c=1,"function"===typeof document.body.getBoundingClientRect&&(c=document.body.getBoundingClientRect(),c=c.right-c.left,d=document.body.offsetWidth,c=Math.round(c/d*100)/100),d=c,c=Math.round(document.documentElement.scrollLeft/d),d=Math.round(document.documentElement.scrollTop/d)),n=document.documentElement.clientTop||0,c=f.left+c-(document.documentElement.clientLeft||0),
d=f.top+d-n,n="width"in f?f.width:f.right-f.left,f="height"in f?f.height:f.bottom-f.top);if(b=E(k))b.style.top=d+"px",b.style.left=c+"px",b.style.width=n+"px",b.style.height=f+"px",b.style.zIndex=p+1;!0===v&&k&&"function"===typeof k.setSize?k.setSize(n,f):v=!1}return this};l.prototype.on=function(a,c){var b,e,f,h={},g=q[this.id]&&q[this.id].handlers;if("string"===typeof a&&a)f=a.toLowerCase().split(/\s+/);else if("object"===typeof a&&a&&"undefined"===typeof c)for(b in a)if(a.hasOwnProperty(b)&&"string"===
typeof b&&b&&"function"===typeof a[b])this.on(b,a[b]);if(f&&f.length){b=0;for(e=f.length;b<e;b++)a=f[b].replace(/^on/,""),h[a]=!0,g[a]||(g[a]=[]),g[a].push(c);h.noflash&&x&&A.call(this,"noflash",{});h.wrongflash&&B&&A.call(this,"wrongflash",{flashVersion:m});h.load&&v&&A.call(this,"load",{flashVersion:m})}return this};l.prototype.off=function(a,c){var b,e,f,h,g,k=q[this.id]&&q[this.id].handlers;if(0===arguments.length)h=O(k);else if("string"===typeof a&&a)h=a.split(/\s+/);else if("object"===typeof a&&
a&&"undefined"===typeof c)for(b in a)a.hasOwnProperty(b)&&"string"===typeof b&&b&&"function"===typeof a[b]&&this.off(b,a[b]);if(h&&h.length)for(b=0,e=h.length;b<e;b++)if(a=h[b].toLowerCase().replace(/^on/,""),(g=k[a])&&g.length)if(c)for(f=y(c,g);-1!==f;)g.splice(f,1),f=y(c,g,f);else k[a].length=0;return this};l.prototype.handlers=function(a){var b,d=null,c=q[this.id]&&q[this.id].handlers;if(c){if("string"===typeof a&&a)return c[a]?c[a].slice(0):null;d={};for(b in c)c.hasOwnProperty(b)&&c[b]&&(d[b]=
c[b].slice(0))}return d};l.prototype.clip=function(a){a=L(a);for(var b=0;b<a.length;b++)if(a.hasOwnProperty(b)&&a[b]&&1===a[b].nodeType){if(a[b].zcClippingId)-1===y(this.id,z[a[b].zcClippingId])&&z[a[b].zcClippingId].push(this.id);else if(a[b].zcClippingId="zcClippingId_"+T++,z[a[b].zcClippingId]=[this.id],!0===g.autoActivate){var c=a[b],e=J;c&&1===c.nodeType&&(c.addEventListener?c.addEventListener("mouseover",e,!1):c.attachEvent&&c.attachEvent("onmouseover",e))}c=q[this.id].elements;-1===y(a[b],
c)&&c.push(a[b])}return this};l.prototype.unclip=function(a){var b=q[this.id];if(b){var b=b.elements,c;a="undefined"===typeof a?b.slice(0):L(a);for(var e=a.length;e--;)if(a.hasOwnProperty(e)&&a[e]&&1===a[e].nodeType){for(c=0;-1!==(c=y(a[e],b,c));)b.splice(c,1);var f=z[a[e].zcClippingId];if(f){for(c=0;-1!==(c=y(this.id,f,c));)f.splice(c,1);0===f.length&&(!0===g.autoActivate&&(c=a[e],f=J,c&&1===c.nodeType&&(c.removeEventListener?c.removeEventListener("mouseover",f,!1):c.detachEvent&&c.detachEvent("onmouseover",
f))),delete a[e].zcClippingId)}}}return this};l.prototype.elements=function(){var a=q[this.id];return a&&a.elements?a.elements.slice(0):[]};g.hoverClass="zeroclipboard-is-hover";g.activeClass="zeroclipboard-is-active";g.trustedOrigins=null;g.allowScriptAccess=null;g.useNoCache=!0;g.moviePath="ZeroClipboard.swf";l.detectFlashSupport=function(){r("ZeroClipboard.detectFlashSupport",g.debug);return P()};l.dispatch=function(a,c){if("string"===typeof a&&a){var b=a.toLowerCase().replace(/^on/,"");if(b){var h;
if(e&&!0===g.autoActivate){var f,k,m,u;h=[];if(e&&1===e.nodeType&&(f=e.zcClippingId)&&z.hasOwnProperty(f)&&(f=z[f])&&f.length)for(k=0,m=f.length;k<m;k++)(u=q[f[k]].instance)&&u instanceof l&&h.push(u)}else{m=[];u=O(q);h=0;for(f=u.length;h<f;h++)(k=q[u[h]].instance)&&k instanceof l&&m.push(k);h=m}f=0;for(k=h.length;f<k;f++)A.call(h[f],b,c)}}};l.prototype.setHandCursor=function(a){r("ZeroClipboard.prototype.setHandCursor",g.debug);a="boolean"===typeof a?a:!!a;Q(a);g.forceHandCursor=a;return this};l.prototype.reposition=
function(){r("ZeroClipboard.prototype.reposition",g.debug);return R()};l.prototype.receiveEvent=function(a,c){r("ZeroClipboard.prototype.receiveEvent",g.debug);if("string"===typeof a&&a){var b=a.toLowerCase().replace(/^on/,"");b&&A.call(this,b,c)}};l.prototype.setCurrent=function(a){r("ZeroClipboard.prototype.setCurrent",g.debug);l.activate(a);return this};l.prototype.resetBridge=function(){r("ZeroClipboard.prototype.resetBridge",g.debug);l.deactivate();return this};l.prototype.setTitle=function(a){r("ZeroClipboard.prototype.setTitle",
g.debug);if(a=a||g.title||e&&e.getAttribute("title")){var b=E(k);b&&b.setAttribute("title",a)}return this};l.setDefaults=function(a){r("ZeroClipboard.setDefaults",g.debug);l.config(a)};l.prototype.addEventListener=function(a,c){r("ZeroClipboard.prototype.addEventListener",g.debug);return this.on(a,c)};l.prototype.removeEventListener=function(a,c){r("ZeroClipboard.prototype.removeEventListener",g.debug);return this.off(a,c)};l.prototype.ready=function(){r("ZeroClipboard.prototype.ready",g.debug);return!0===
v};var A=function(b,k){b=b.toLowerCase().replace(/^on/,"");var d=k&&k.flashVersion&&c(k.flashVersion)||null,h=e,f=!0;switch(b){case "load":if(d){if(!(10<=parseFloat(c(d)))){A.call(this,"onWrongFlash",{flashVersion:d});return}B=!1;v=!0;m=d}break;case "wrongflash":!d||10<=parseFloat(c(d))||(B=!0,v=!1,m=d);break;case "mouseover":H(h,g.hoverClass);break;case "mouseout":!0===g.autoActivate&&l.deactivate();break;case "mousedown":H(h,g.activeClass);break;case "mouseup":D(h,g.activeClass);break;case "datarequested":if(h){var p=
h.getAttribute("data-clipboard-target");(p=(p=p?document.getElementById(p):null)?p.value||p.textContent||p.innerText:h.getAttribute("data-clipboard-text"))&&this.setText(p)}f=!1;break;case "complete":if(C)for(var r in C)C.hasOwnProperty(r)&&delete C[r];if(d=h){a:{try{p=document.activeElement;break a}catch(Y){}p=null}d=h!==p}d&&h.focus&&h.focus()}p=[this,k];if((d=q[this.id]&&q[this.id].handlers[b])&&d.length){var u,t,w=h||this;r=0;for(u=d.length;r<u;r++)t=d[r],h=w,"string"===typeof t&&"function"===
typeof a[t]&&(t=a[t]),"object"===typeof t&&t&&"function"===typeof t.handleEvent&&(h=t,t=t.handleEvent),"function"===typeof t&&W(t,h,p,f)}return this};"function"===typeof define&&define.amd?define(["require","exports","module"],function(a,c,d){F=d&&d.id||null;return l}):"object"===typeof module&&module&&"object"===typeof module.exports&&module.exports&&"function"===typeof a.require?(G=module.id||null,module.exports=l):a.ZeroClipboard=l})(function(){return this}());Ext.namespace("Zarafa.plugins.files.backend.Owncloud.ui");
Zarafa.plugins.files.backend.Owncloud.ui.FilesShareDialogPanel=Ext.extend(Zarafa.plugins.files.ui.dialogs.SharePanel,{loadMask:void 0,passwordChanged:!1,expirationDateChanged:!1,pubUploadChanged:!1,linkShareID:-1,recordId:void 0,parentRecord:void 0,constructor:function(a){a=a||{};var c=a.ownerCt.records[0].get("type");this.recordId=a.ownerCt.records[0].get("id");this.parentRecord=a.ownerCt.records[0];Zarafa.plugins.files.backend.Owncloud.data.singleton.ShareStore.init(c);this.setupGridStoreListeners();
Ext.applyIf(a,{listeners:{afterrender:this.checkSharedRecord},height:450,width:780,items:[{xtype:"fieldset",title:dgettext("plugin_filesbackendOwncloud","Share with user/group"),autoHeight:!0,ref:"userfieldset",items:[{xtype:"filesplugin.owncloud.filesshareusergrid",ref:"../usergrid",height:200,recordId:this.recordId}]},{xtype:"checkbox",fieldLabel:"",boxLabel:dgettext("plugin_filesbackendOwncloud","Share via link"),ref:"linkcheckbox",inputValue:"sharelink",style:{marginTop:"5px",marginLeft:"6px"},
listeners:{check:this.onShareViaLinkChecked.createDelegate(this)}},{xtype:"fieldset",title:dgettext("plugin_filesbackendOwncloud","Share via link"),autoHeight:!0,ref:"linkfieldset",hidden:!0,items:[{layout:"column",border:!1,defaults:{border:!1},anchor:"0",items:[{columnWidth:.95,layout:"form",items:{xtype:"textfield",fieldLabel:dgettext("plugin_filesbackendOwncloud","Public link"),ref:"../../../linkfield",anchor:"100%",selectOnFocus:!0,readOnly:!0}},{columnWidth:.05,items:{xtype:"copybutton",swfPath:"plugins/filesbackendOwncloud/resources/flash/ZeroClipboard.swf",
completeText:dgettext("plugin_filesbackendOwncloud","Link copied to clipboard"),iconCls:"icon_copy_clipboard",getValue:this.getPublicLinkValue.createDelegate(this)}}]},{xtype:"checkbox",fieldLabel:dgettext("plugin_filesbackendOwncloud","Password protect"),boxLabel:"",ref:"../passwordcheckbox",inputValue:"pwprotected",listeners:{check:this.onUsePasswordChecked.createDelegate(this)}},{xtype:"textfield",fieldLabel:dgettext("plugin_filesbackendOwncloud","Password"),ref:"../passwordfield",hidden:!0,inputType:"password",
name:"textvalue",listeners:{change:this.onPasswordChange.createDelegate(this),keyup:this.onPasswordChange.createDelegate(this)}},{xtype:"checkbox",fieldLabel:dgettext("plugin_filesbackendOwncloud","Public upload"),boxLabel:"",hidden:!0,ref:"../editcheckbox",inputValue:"allowediting",listeners:{check:this.onAllowEditingChecked.createDelegate(this)}},{xtype:"checkbox",fieldLabel:dgettext("plugin_filesbackendOwncloud","Expiration date"),boxLabel:"",ref:"../expirationcheckbox",inputValue:"useexpiration",
listeners:{check:this.onUseExpirationDateChecked.createDelegate(this)}},{xtype:"datefield",ref:"../expirationfield",hidden:!0,fieldLabel:dgettext("plugin_filesbackendOwncloud","Date"),minValue:new Date((new Date).getTime()+864E5),width:170,format:"Y-m-d",listeners:{change:this.onExpirationDateChange.createDelegate(this),keyup:this.onExpirationDateChange.createDelegate(this)}}]}],buttons:[{xtype:"button",text:dgettext("plugin_filesbackendOwncloud","Ok"),handler:this.onDoneButtonClick,ref:"../doneButton",
scope:this},{xtype:"button",text:dgettext("plugin_filesbackendOwncloud","Cancel"),handler:this.onCancel,scope:this}]});Zarafa.plugins.files.backend.Owncloud.ui.FilesShareDialogPanel.superclass.constructor.call(this,a)},setupGridStoreListeners:function(){var a=Zarafa.plugins.files.backend.Owncloud.data.singleton.ShareStore.getStore();a.on("add",this.onGridStoreAdd,this);a.on("update",this.onGridStoreUpdate,this);a.on("remove",this.onGridStoreRemove,this)},onGridStoreRemove:function(a,c){""!=c.get("id")&&
-1!=c.get("id")&&this.removeShareByID(c.get("id"))},onGridStoreUpdate:function(a,c){this.updateExistingShare(c)},onGridStoreAdd:function(a,c){if(1!=c.length||-1!=c[0].get("id"))return!0;this.createShare(c[0],a,!1)},onShareViaLinkChecked:function(a,c){c?(this.linkfieldset.show(),this.createShareByLink()):(this.linkfieldset.hide(),this.removeShareByID(this.linkShareID),this.linkShareID=-1)},onUsePasswordChecked:function(a,c){c?this.passwordfield.show():this.passwordfield.hide()},onPasswordChange:function(a,
c){this.passwordChanged=!0},onAllowEditingChecked:function(a,c){this.pubUploadChanged=!0},onUseExpirationDateChecked:function(a,c){c?this.expirationfield.show():this.expirationfield.hide()},onExpirationDateChange:function(){this.expirationDateChanged=!0},onCancel:function(){this.dialog.close()},getPublicLinkValue:function(){return this.linkfield.getValue()},closeDialog:function(){var a=Zarafa.plugins.files.backend.Owncloud.data.singleton.ShareStore.getStore();a.un("update",this.onGridStoreUpdate,
this);a.un("remove",this.onGridStoreRemove,this);this.dialog.close()},closeLoadMask:function(){this.loadMask.hide()},onDoneButtonClick:function(){this.linkcheckbox.getValue()?this.updateExistingShare():this.closeDialog()},checkSharedRecord:function(){this.loadMask=new Ext.LoadMask(this.getEl(),{msg:dgettext("plugin_filesbackendOwncloud","Loading details...")});Ext.isDefined(this.parentRecord)&&(this.parentRecord.get("type")===Zarafa.plugins.files.data.FileTypes.FOLDER&&this.editcheckbox.show(),!0===
this.parentRecord.get("isshared")&&this.initSharedRecord())},initSharedRecord:function(){this.loadMask.show();var a=[this.recordId];container.getRequest().singleRequest("filesbrowsermodule","loadsharingdetails",{records:a},new Zarafa.plugins.files.backend.Owncloud.data.ResponseHandler({successCallback:this.initGuiFromSharedRecord.createDelegate(this)}))},initGuiFromSharedRecord:function(a){a=a.shares[this.recordId];for(var c in a){var e=a[c];e.shareType===Zarafa.plugins.files.backend.Owncloud.data.RecipientTypes.LINK?
(this.linkShareID=c,this.linkfieldset.show(),this.linkcheckbox.suspendEvents(!1),this.linkcheckbox.setValue(!0),this.linkcheckbox.resumeEvents(),this.linkfield.setValue(e.url),Ext.isEmpty(e.expiration)||(this.expirationcheckbox.setValue(!0),this.expirationfield.setValue(new Date(e.expiration))),Ext.isEmpty(e.shareWith)||(this.passwordcheckbox.setValue(!0),this.passwordfield.setValue("******")),Ext.isEmpty(e.permissions)||7!==parseInt(e.permissions)||(this.editcheckbox.suspendEvents(!1),this.editcheckbox.setValue(!0),
this.editcheckbox.resumeEvents())):e.shareType===Zarafa.plugins.files.backend.Owncloud.data.RecipientTypes.GROUP?Zarafa.plugins.files.backend.Owncloud.data.singleton.ShareStore.addGroup(e):Zarafa.plugins.files.backend.Owncloud.data.singleton.ShareStore.addUser(e);this.doneButton.setDisabled(!1)}this.loadMask.hide()},createShareByLink:function(){this.loadMask.show();var a=[this.recordId],c={shareType:Zarafa.plugins.files.backend.Owncloud.data.RecipientTypes.LINK};container.getRequest().singleRequest("filesbrowsermodule",
"createnewshare",{records:a,options:c},new Zarafa.plugins.files.backend.Owncloud.data.ResponseHandler({successCallback:this.shareByLinkCreated.createDelegate(this),failureCallback:this.closeDialog.createDelegate(this)}))},shareByLinkCreated:function(a){a=a.shares[this.recordId.replace(/\/+$/g,"")];this.linkfield.setValue(a.url);this.linkShareID=a.id;var c=this.parentRecord.get("sharedid")||[];c.push(a.id);this.parentRecord.set("sharedid",c);this.parentRecord.set("isshared",!0);this.doneButton.setDisabled(!1);
this.loadMask.hide()},removeShareByID:function(a){this.loadMask.show();var c=this.parentRecord.getAccount().get("id");container.getRequest().singleRequest("filesbrowsermodule","deleteexistingshare",{records:[a],accountid:c},new Zarafa.plugins.files.backend.Owncloud.data.ResponseHandler({successCallback:this.shareByIDRemoved.createDelegate(this,[a],!0),failureCallback:this.closeDialog.createDelegate(this)}))},shareByIDRemoved:function(a,c){var e=this.parentRecord.get("sharedid")||[],k=e.indexOf(c);
-1<k&&e.splice(k,1);this.parentRecord.set("sharedid",e);0==e.length&&this.parentRecord.set("isshared",!1);this.loadMask.hide()},createShare:function(a,c){this.loadMask.show();var e=[this.recordId],k=this.getPermissions(a),k={shareType:"user"===a.get("type")?Zarafa.plugins.files.backend.Owncloud.data.RecipientTypes.USER:Zarafa.plugins.files.backend.Owncloud.data.RecipientTypes.GROUP,shareWith:a.get("shareWith"),permissions:k,shareWithDisplayname:a.get("shareWithDisplayname")};container.getRequest().singleRequest("filesbrowsermodule",
"createnewshare",{records:e,options:k},new Zarafa.plugins.files.backend.Owncloud.data.ResponseHandler({successCallback:this.shareCreated.createDelegate(this,[k,a],!0),failureCallback:this.shareFailed.createDelegate(this,[c,a])}))},shareCreated:function(a,c,e){a=a.shares[this.recordId.replace(/\/+$/g,"")];var k=this.parentRecord.get("sharedid")||[];k.push(a.id);e.data.id=a.id;this.parentRecord.set("sharedid",k);this.parentRecord.set("isshared",!0);c.id=a.id;this.loadMask.hide()},shareFailed:function(a,
c){a.remove(c);this.loadMask.hide()},updateExistingShare:function(a){this.loadMask.show();var c={},e=[];Ext.isDefined(a)?(c.permissions=this.getPermissions(a),e.push(a.get("id"))):(this.passwordChanged&&(c.password=this.passwordfield.getValue()),this.passwordcheckbox.getValue()||(c.password=""),this.pubUploadChanged&&(this.editcheckbox.getValue()?c.permissions=7:c.permissions=1),this.expirationDateChanged&&(c.expireDate=this.expirationfield.getRawValue()),this.expirationcheckbox.getValue()||(c.expireDate=
""),e.push(this.linkShareID));container.getRequest().singleRequest("filesbrowsermodule","updateexistingshare",{records:e,accountid:this.parentRecord.getAccount().get("id"),options:c},new Zarafa.plugins.files.backend.Owncloud.data.ResponseHandler({successCallback:this.shareByLinkUpdated.createDelegate(this,[a]),failureCallback:this.closeLoadMask.createDelegate(this)}))},shareByLinkUpdated:function(a){this.loadMask.hide();Ext.isDefined(a)||this.closeDialog()},getPermissions:function(a){var c=1;a.get("permissionChange")&&
(c+=2);a.get("permissionCreate")&&(c+=4);a.get("permissionDelete")&&(c+=8);a.get("permissionShare")&&(c+=16);return c}});Ext.reg("filesplugin.owncloud.filessharedialogpanel",Zarafa.plugins.files.backend.Owncloud.ui.FilesShareDialogPanel);Ext.namespace("Zarafa.plugins.files.backend.Owncloud.ui");
Zarafa.plugins.files.backend.Owncloud.ui.FilesShareUserEditContentPanel=Ext.extend(Zarafa.core.ui.ContentPanel,{loadMask:void 0,constructor:function(a){Ext.applyIf(a,{layout:"fit",title:dgettext("plugin_filesbackendOwncloud","Share Details"),closeOnSave:!0,model:!0,autoSave:!1,width:480,height:445,items:{xtype:"filesplugin.owncloud.filesshareusereditpanel",record:a.record,store:a.store,recordId:a.recordId}});Zarafa.plugins.files.backend.Owncloud.ui.FilesShareUserEditContentPanel.superclass.constructor.call(this,
a)}});Ext.reg("filesplugin.owncloud.filesshareusereditcontentpanel",Zarafa.plugins.files.backend.Owncloud.ui.FilesShareUserEditContentPanel);Ext.namespace("Zarafa.plugins.files.backend.Owncloud.ui");
Zarafa.plugins.files.backend.Owncloud.ui.FilesShareUserEditPanel=Ext.extend(Ext.form.FormPanel,{record:void 0,store:void 0,recordId:void 0,constructor:function(a){a.record&&(this.record=a.record);a.store&&(this.store=a.store);a.recordId&&(this.recordId=a.recordId);Ext.applyIf(a||{},{labelAlign:"left",defaultType:"textfield",items:this.createPanelItems(),buttons:[{text:dgettext("plugin_filesbackendOwncloud","Save"),handler:this.doSave,scope:this},{text:dgettext("plugin_filesbackendOwncloud","Cancel"),
handler:this.doClose,scope:this}]});Zarafa.plugins.files.backend.Owncloud.ui.FilesShareUserEditPanel.superclass.constructor.call(this,a)},doClose:function(){this.ownerCt.dialog.close()},doSave:function(){var a=this.shareWith.getStore().getAt(this.shareWith.selectedIndex);this.record?(this.record.beginEdit(),a&&(this.record.set("type",this.type.getValue()),this.record.set("shareWith",a.data.shareWith),this.record.set("shareWithDisplayname",a.data.display_name)),this.record.set("permissionShare",this.permissionShare.getValue()),
this.record.set("permissionChange",this.permissionChange.getValue()),this.record.set("permissionCreate",this.store.fileType===Zarafa.plugins.files.data.FileTypes.FOLDER?this.permissionCreate.getValue():!1),this.record.set("permissionDelete",this.store.fileType===Zarafa.plugins.files.data.FileTypes.FOLDER?this.permissionDelete.getValue():!1),this.record.endEdit()):(a=new this.store.recordType({id:-1,type:this.type.getValue(),shareWith:a.data.shareWith,shareWithDisplayname:a.data.display_name,permissionCreate:this.store.fileType===
Zarafa.plugins.files.data.FileTypes.FOLDER?this.permissionCreate.getValue():!1,permissionChange:this.permissionChange.getValue(),permissionDelete:this.store.fileType===Zarafa.plugins.files.data.FileTypes.FOLDER?this.permissionDelete.getValue():!1,permissionShare:this.permissionShare.getValue()}),this.store.add(a));this.ownerCt.dialog.close()},createPanelItems:function(){var a="user",c="",e=!1,k=!1,m=!1,x=!1;this.record&&(a=this.record.get("type"),this.record.get("shareWith"),c=this.record.get("shareWithDisplayname"),
x=this.record.get("permissionShare"),k=this.record.get("permissionChange"),this.store.fileType===Zarafa.plugins.files.data.FileTypes.FOLDER&&(e=this.record.get("permissionCreate"),m=this.record.get("permissionDelete")));k=[{xtype:"checkbox",fieldLabel:dgettext("plugin_filesbackendOwncloud","Re-share"),name:"permissionShare",ref:"../permissionShare",checked:x},{xtype:"checkbox",fieldLabel:dgettext("plugin_filesbackendOwncloud","Change"),name:"permissionChange",ref:"../permissionChange",checked:k}];
this.store.fileType===Zarafa.plugins.files.data.FileTypes.FOLDER&&k.push({xtype:"checkbox",fieldLabel:dgettext("plugin_filesbackendOwncloud","Create"),name:"permissionCreate",ref:"../permissionCreate",checked:e},{xtype:"checkbox",fieldLabel:dgettext("plugin_filesbackendOwncloud","Delete"),name:"permissionDelete",ref:"../permissionDelete",checked:m});return[{xtype:"filesplugin.owncloud.usergrouppredictorfield",fieldLabel:dgettext("plugin_filesbackendOwncloud","Share with"),name:"shareWith",ref:"shareWith",
allowBlank:!1,value:c,recordId:this.recordId},{xtype:"selectbox",fieldLabel:dgettext("plugin_filesbackendOwncloud","Type"),name:"type",ref:"type",allowBlank:!1,value:a,store:[["user","User"],["group","Group"]],mode:"local"},{xtype:"fieldset",title:dgettext("plugin_filesbackendOwncloud","Permissions"),defaults:{labelWidth:89,anchor:"100%",xtype:"textfield"},items:k}]}});Ext.reg("filesplugin.owncloud.filesshareusereditpanel",Zarafa.plugins.files.backend.Owncloud.ui.FilesShareUserEditPanel);Ext.namespace("Zarafa.plugins.files.backend.Owncloud.ui");
Zarafa.plugins.files.backend.Owncloud.ui.FilesShareUserGrid=Ext.extend(Ext.grid.GridPanel,{store:void 0,recordId:void 0,constructor:function(a){a=a||{};this.store=Zarafa.plugins.files.backend.Owncloud.data.singleton.ShareStore.getStore();Ext.applyIf(a,{xtype:"filesplugin.owncloud.filesshareusergrid",ref:"sharegrid",store:this.store,border:!1,baseCls:"shareGrid",enableHdMenu:!1,loadMask:this.initLoadMask(),viewConfig:this.initViewConfig(),sm:this.initSelectionModel(),cm:this.initColumnModel(),listeners:{rowdblclick:this.onRowDblClick,
scope:this},tbar:[{iconCls:"filesplugin_icon_add",text:dgettext("plugin_filesbackendOwncloud","Add"),handler:this.onAdd.createDelegate(this)},"-",{iconCls:"filesplugin_icon_delete",text:dgettext("plugin_filesbackendOwncloud","Delete"),ref:"../removeAccountBtn",disabled:!0,handler:this.onDelete.createDelegate(this)}]});Zarafa.plugins.files.backend.Owncloud.ui.FilesShareUserGrid.superclass.constructor.call(this,a)},initLoadMask:function(){return{msg:dgettext("plugin_filesbackendOwncloud","Loading users and groups")+
"..."}},initViewConfig:function(){return{enableRowBody:!1,forceFit:!0,emptyText:"<div class='emptytext'>"+dgettext("plugin_filesbackendOwncloud","Add users or groups to share files.")+"</div>",deferEmptyText:!1}},initSelectionModel:function(){return new Ext.grid.RowSelectionModel({singleSelect:!0,listeners:{selectionchange:this.onRowSelected}})},initColumnModel:function(){return new Zarafa.plugins.files.backend.Owncloud.ui.FilesShareUserGridColumnModel({fileType:this.store.fileType})},onRowSelected:function(a){this.grid.removeAccountBtn.setDisabled(1!=
a.getCount())},onRowDblClick:function(a,c){Zarafa.core.data.UIFactory.openLayerComponent(Zarafa.core.data.SharedComponentType["filesplugin.owncloud.useredit"],void 0,{store:a.getStore(),record:a.getStore().getAt(c),manager:Ext.WindowMgr,recordId:this.recordId})},onAdd:function(a,c){Zarafa.core.data.UIFactory.openLayerComponent(Zarafa.core.data.SharedComponentType["filesplugin.owncloud.useredit"],void 0,{store:this.store,manager:Ext.WindowMgr,recordId:this.recordId})},onDelete:function(a,c){var e=
this.getSelectionModel().getSelected();if(!e)return!1;this.store.remove(e)}});Ext.reg("filesplugin.owncloud.filesshareusergrid",Zarafa.plugins.files.backend.Owncloud.ui.FilesShareUserGrid);Ext.namespace("Zarafa.plugins.files.backend.Owncloud.ui");
Zarafa.plugins.files.backend.Owncloud.ui.FilesShareUserGridColumnModel=Ext.extend(Zarafa.common.ui.grid.ColumnModel,{constructor:function(a){a=a||{};this.defaultColumns=this.createDefaultColumns(a.fileType);Ext.applyIf(a,{columns:this.defaultColumns,defaults:{sortable:!0}});Ext.apply(this,a);Zarafa.plugins.files.backend.Owncloud.ui.FilesShareUserGridColumnModel.superclass.constructor.call(this,a)},createDefaultColumns:function(a){var c=[{header:dgettext("plugin_filesbackendOwncloud","Name"),dataIndex:"shareWithDisplayname",
flex:1,sortable:!0,tooltip:dgettext("plugin_filesbackendOwncloud","Sort by: Name")},{header:dgettext("plugin_filesbackendOwncloud","Type"),dataIndex:"type",flex:1,align:"center",sortable:!0,renderer:this.shareTypeRenderer,tooltip:dgettext("plugin_filesbackendOwncloud","Sort by: Type")},{header:dgettext("plugin_filesbackendOwncloud","Share"),dataIndex:"permissionShare",flex:1,align:"center",sortable:!1,renderer:this.yesNoRenderer},{header:dgettext("plugin_filesbackendOwncloud","Change"),dataIndex:"permissionChange",
flex:1,align:"center",sortable:!1,renderer:this.yesNoRenderer}];a===Zarafa.plugins.files.data.FileTypes.FOLDER&&c.push({header:dgettext("plugin_filesbackendOwncloud","Create"),dataIndex:"permissionCreate",flex:1,align:"center",sortable:!1,renderer:this.yesNoRenderer},{header:dgettext("plugin_filesbackendOwncloud","Delete"),dataIndex:"permissionDelete",flex:1,align:"center",sortable:!1,renderer:this.yesNoRenderer});return c},shareTypeRenderer:function(a,c,e){c.css="shareicon_16_"+a;c.css+=" zarafa-grid-empty-cell";
return""},yesNoRenderer:function(a,c,e){c.css=a?"shareicon_16_yes":"shareicon_16_no";c.css+=" zarafa-grid-empty-cell";return""}});Ext.namespace("Zarafa.plugins.files.backend.Owncloud.ui");
Zarafa.plugins.files.backend.Owncloud.ui.UserGroupPredictorField=Ext.extend(Ext.form.ComboBox,{constructor:function(a){var c=new Ext.data.ArrayStore({proxy:new Ext.data.HttpProxy({method:"GET",url:container.getBasePath()+"index.php"}),method:"GET",baseParams:{load:"custom",name:"files_get_recipients",id:a.recordId},id:1,fields:["display_name","shareWith","object_type"]});a=a||{};Ext.applyIf(a,{store:c,displayField:"display_name",typeAhead:!1,forceSelection:!0,triggerAction:"query",itemId:"predictor",
mode:"remote",minChars:2,emptyText:dgettext("plugin_filesbackendOwncloud","Type to search"),loadingText:dgettext("plugin_filesbackendOwncloud","Loading..."),listEmptyText:dgettext("plugin_filesbackendOwncloud","No results"),itemSelector:"div.ugpredic_search_item",tpl:new Ext.XTemplate('<tpl for=".">','<div class="ugpredic_search_item">',"<h3>",'<tpl if="object_type == Zarafa.plugins.files.backend.Owncloud.data.RecipientTypes.USER"><span><div class="shareicon_16_user">&nbsp;</div></span></tpl>','<tpl if="object_type == Zarafa.plugins.files.backend.Owncloud.data.RecipientTypes.GROUP"><span><div class="shareicon_16_group">&nbsp;</div></span></tpl>',
"{display_name:htmlEncode}","</h3>","</div>","</tpl>","</tpl>"),onSelect:this.onSuggestionSelect,listeners:{invalid:this.onInvalid,scope:this}});Zarafa.plugins.files.backend.Owncloud.ui.UserGroupPredictorField.superclass.constructor.call(this,a)},onSuggestionSelect:function(a){this.setRawValue(a.get("display_name"));this.ownerCt.type.setValue(a.get("object_type")==Zarafa.plugins.files.backend.Owncloud.data.RecipientTypes.USER?"user":"group");this.collapse()},onInvalid:function(){this.isExpanded()&&
(this.store.removeAll(),this.collapse())}});Ext.reg("filesplugin.owncloud.usergrouppredictorfield",Zarafa.plugins.files.backend.Owncloud.ui.UserGroupPredictorField);//# sourceMappingURL=filesbackendOwncloud.js.map
