Alfresco.Share=Alfresco.Share||{};Alfresco.Share.postActivity=function(g,a,h,d,c){if(!YAHOO.lang.isString(g)||g.length===0||!YAHOO.lang.isString(a)||a.length===0||!YAHOO.lang.isString(h)||h.length===0||!YAHOO.lang.isObject(c)===null||!(YAHOO.lang.isString(c.nodeRef)||YAHOO.lang.isString(c.parentNodeRef))){return}var b={method:"POST",url:Alfresco.constants.PROXY_URI+"slingshot/activity/create",dataObj:YAHOO.lang.merge({site:g,type:a,title:h,page:d},c)};Alfresco.logger.debug("Alfresco.Share.postActivity: ",b.dataObj);try{Alfresco.util.Ajax.jsonRequest(b)}catch(f){}};(function(){var e=YAHOO.util.Dom;var a=Alfresco.util.encodeHTML,f=Alfresco.util.combinePaths;Alfresco.Location=function h(i){if(YAHOO.lang.isString(i)){i=e.get(i)}else{if(!i.getAttribute("id")){Alfresco.uti.generateDomId(i)}}Alfresco.Location.superclass.constructor.call(this,"Alfresco.Location",i.getAttribute("id"),["json"]);this.widgets.spanEl=i;return this};YAHOO.extend(Alfresco.Location,Alfresco.component.Base,{options:{rootNode:null,siteId:""},_locations:null,onReady:function g(){},displayByNodeRef:function d(j){if(YAHOO.lang.isString(j)){j=Alfresco.util.NodeRef(j)}if(j){var i=Alfresco.constants.PROXY_URI+"slingshot/doclib/node/"+j.uri+"/location";if(this.options.siteId===""&&this.options.rootNode){i+="?libraryRoot="+encodeURIComponent(this.options.rootNode.toString())}Alfresco.util.Ajax.jsonGet({url:i,successCallback:{fn:function(l){if(l.json!==undefined){var k=l.json;this._locations=k;if(k.site){this.displayByPath(f(k.site.path,k.site.file),k.site.site,k.site.siteTitle)}else{this.displayByPath(f(k.repo.path,k.repo.file))}YAHOO.Bubbling.fire("itemLocationLoaded",{eventGroup:this,locations:k})}},scope:this},failureCallback:{fn:function(k){if(this.widgets.spanEl){this.widgets.spanEl.innerHTML='<span class="location error">'+this.msg("message.failure")+"</span>"}},scope:this}})}else{this.widgets.spanEl.innerHTML='<span class="location-none">'+this.msg("location.label.none")+"</span>"}},displayByPath:function c(i,k,j){this._locations=null;if(this.widgets.spanEl){this.widgets.spanEl.innerHTML=this.generateHTML(i,k,j)}},generateHTML:function b(k,p,m){var l=k.lastIndexOf("/"),o=l>=0?k.substring(0,l+1):"",j=l>=0?k.substring(l+1):k;if(p){if(Alfresco.util.arrayContains(["/",""],j+o)){k=this.msg("location.path.documents");j=this.msg("location.path.documents")}else{k=this.msg("location.path.documents")+k;j=".../"+j}}else{if(Alfresco.util.arrayContains(["/",""],j+o)){k=this.msg("location.path.repository");j=this.msg("location.path.repository")}else{k=this.msg("location.path.repository")+k;j=".../"+j}}var n='<span class="location-path" title="'+this.msg("location.tooltip.path",k)+'">'+a(j)+"</span>";if(p){if(p&&p!=this.options.siteId){var q='<span class="location-site" title="'+this.msg("location.tooltip.site",m?m:p)+'">'+a(m?m:p)+"</span>";return this.msg("location.label.site",n,q)}else{return this.msg("location.label.local",n)}}else{return this.msg("location.label.repository",n)}}})})();(function(){var b=YAHOO.util.Dom;Alfresco.widget.Resizer=function d(f){Alfresco.util.YUILoaderHelper.require(["resize"],this.onComponentsLoaded,this);this.name=f;this.widgets={};return this};Alfresco.widget.Resizer.prototype={MIN_FILTER_PANEL_HEIGHT:200,MIN_FILTER_PANEL_WIDTH:140,DEFAULT_FILTER_PANEL_WIDTH:160,MAX_FILTER_PANEL_WIDTH:500,widgets:null,divLeft:"alf-filters",divRight:"alf-content",documentHeight:-1,onComponentsLoaded:function c(){YAHOO.util.Event.onDOMReady(this.onReady,this,true)},onReady:function a(){this.widgets.horizResize=new YAHOO.util.Resize(this.divLeft,{handles:["r"],minWidth:this.MIN_FILTER_PANEL_WIDTH,maxWidth:this.MAX_FILTER_PANEL_WIDTH});this.widgets.horizResize.on("beforeResize",function(f){this.onResize(f.width)},this,true);this.widgets.horizResize.on("endResize",function(f){this.onResize(f.width)},this,true);YAHOO.util.Event.on(window,"resize",function(f){this.onResize()},this,true);this.documentHeight=b.getXY("alf-ft")[1];YAHOO.lang.later(1000,this,function(){var f=b.getXY("alf-ft")[1];if(Math.abs(this.documentHeight-f)>4){this.documentHeight=f;this.onResize()}},null,true);if(YAHOO.env.ua.ie>0){this.widgets.horizResize.resize(null,this.widgets.horizResize.get("element").offsetHeight,this.DEFAULT_FILTER_PANEL_WIDTH,0,0,true)}else{this.widgets.horizResize.resize(null,this.widgets.horizResize.get("height"),this.DEFAULT_FILTER_PANEL_WIDTH,0,0,true)}this.onResize(this.DEFAULT_FILTER_PANEL_WIDTH)},onResize:function e(k){var o=b.get(this.divLeft).childNodes,l=o[o.length-1];b.setStyle(this.divLeft,"height","auto");b.setStyle(l,"height","");var j=b.getXY("alf-ft")[1]-b.getXY("alf-hd")[1]-b.get("alf-hd").offsetHeight;if(YAHOO.env.ua.ie===6){var n=b.get("alf-hd"),m=0;for(var g=0,f=n.childNodes.length;g<f;g++){m+=n.childNodes[g].offsetHeight}j=b.get("alf-ft").parentNode.offsetTop-m}if(j<this.MIN_FILTER_PANEL_HEIGHT){j=this.MIN_FILTER_PANEL_HEIGHT}b.setStyle(l,"height",j+"px");if(k!==undefined){b.setStyle(this.divRight,"margin-left",8+k+"px")}}}})();(function(){var c=YAHOO.util.Dom,h=YAHOO.util.Event,a=YAHOO.util.Selector;Alfresco.widget.DashletResizer=function i(k,j){this.name="Alfresco.widget.DashletResizer";this.id=k;this.dashletId=j;Alfresco.util.YUILoaderHelper.require(["resize","selector"],this.onComponentsLoaded,this);this.widgets={};return this};Alfresco.widget.DashletResizer.prototype={options:{dashletHeight:-1,minDashletHeight:80,maxDashletHeight:1200},dashletId:"",widgets:null,dashlet:null,dashletBody:null,heightDelta:0,setOptions:function f(j){this.options=YAHOO.lang.merge(this.options,j);return this},onComponentsLoaded:function b(){h.onDOMReady(this.onReady,this,true)},onReady:function d(){if(!Alfresco.constants.DASHLET_RESIZE){return}this.dashlet=a.query("div.dashlet",c.get(this.id),true);if(!this.dashlet){return}c.addClass(this.dashlet,"resizable");this.dashletBody=a.query("div.body",this.dashlet,true);if(!this.dashletBody){return}var j=c.getStyle(this.dashlet,"height");if(j=="auto"){j=this.dashlet.offsetHeight-parseInt(c.getStyle(this.dashlet,"padding-bottom"),10)}else{j=parseInt(j,10)}this.heightDelta=j-parseInt(c.getStyle(this.dashletBody,"height"),10);this.widgets.resizer=new YAHOO.util.Resize(this.dashlet,{handles:["b"],minHeight:this.options.minDashletHeight,maxHeight:this.options.maxDashletHeight});this.widgets.resizer.on("resize",function(){this.onResize()},this,true);this.widgets.resizer.on("endResize",function(k){this.onEndResize(k.height)},this,true);c.setStyle(this.dashlet,"width","")},onResize:function e(){var j=parseInt(c.getStyle(this.dashlet,"height"),10)-this.heightDelta;c.setStyle(this.dashletBody,"height",j+"px");c.setStyle(this.dashletBody.getElementsByTagName("iframe"),"height",j+"px")},onEndResize:function g(j){c.setStyle(this.dashlet,"width","");Alfresco.util.Ajax.jsonRequest({method:"POST",url:Alfresco.constants.URL_SERVICECONTEXT+"modules/dashlet/config/"+this.dashletId,dataObj:{height:parseInt(c.getStyle(this.dashlet,"height"),10)-this.heightDelta},successCallback:function(){},successMessage:null,failureCallback:function(){},failureMessage:null})}}})();(function(){Alfresco.component.ShareFormManager=function c(d){Alfresco.component.ShareFormManager.superclass.constructor.call(this,d);this.name="Alfresco.component.ShareFormManager";Alfresco.util.ComponentManager.reregister(this);this.options=YAHOO.lang.merge(this.options,Alfresco.component.ShareFormManager.superclass.options);return this};YAHOO.extend(Alfresco.component.ShareFormManager,Alfresco.component.FormManager,{pageUsesAjaxState:function a(d){return(d.match(/documentlibrary([?]|$)/)||d.match(/repository([?]|$)/)||d.match(/my-workflows([?]|$)/)||d.match(/my-tasks([?]|$)/))},getSiteDefaultUrl:function b(){return Alfresco.util.uriTemplate("userdashboardpage",{userid:encodeURIComponent(Alfresco.constants.USERNAME)})}})})();
