Index: openacs-4/packages/ajax-filestorage-ui/www/resources/ajaxfs-min.js =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/ajax-filestorage-ui/www/resources/ajaxfs-min.js,v diff -u -N -r1.7 -r1.8 --- openacs-4/packages/ajax-filestorage-ui/www/resources/ajaxfs-min.js 2 Jan 2008 07:12:12 -0000 1.7 +++ openacs-4/packages/ajax-filestorage-ui/www/resources/ajaxfs-min.js 14 Jan 2008 02:53:06 -0000 1.8 @@ -870,18 +870,16 @@ },params:{target_folder_id:_107,folder_id:_fe}}); }; if(_103==null){ -var _109=new Ext.Panel({id:"form_addtag",autoScroll:true,frame:true,html:"
Select the community where you wish to share the "+_ff+" folder with.

"}); -var _10a=[{text:"Ok",icon:"/resources/ajaxhelper/icons/disk.png",cls:"x-btn-text-icon",handler:_106.createDelegate(this)},{text:"Cancel",icon:"/resources/ajaxhelper/icons/cross.png",cls:"x-btn-text-icon",handler:function(){ +var _109=new Ext.data.JsonStore({url:_102+"list-communities",root:"communities",fields:["target_folder_id","instance_name"]}); +this.communityCombo=new Ext.form.ComboBox({id:"communities_list",store:_109,displayField:"instance_name",typeAhead:true,fieldLabel:"Community",triggerAction:"all",emptyText:"Select a community",hiddenName:"target_folder_id",valueField:"target_folder_id",forceSelection:true,handleHeight:80,selectOnFocus:true}); +var _10a=new Ext.form.FormPanel({id:"sharefolderform",title:"Select the community where you wish to share the "+_ff+" folder with.",frame:true,items:this.communityCombo}); +var _10b=[{text:"Ok",icon:"/resources/ajaxhelper/icons/disk.png",cls:"x-btn-text-icon",handler:_106.createDelegate(this)},{text:"Cancel",icon:"/resources/ajaxhelper/icons/cross.png",cls:"x-btn-text-icon",handler:function(){ _103.hide(); }.createDelegate(this)}]; -_103=new Ext.Window({id:"share-win",layout:"fit",width:380,height:200,title:"Share Folder",closeAction:"hide",modal:true,plain:true,autoScroll:false,resizable:false,items:_109,buttons:_10a}); -_103.on("show",function(){ -if(this.communityCombo==null){ -var _10b=new Ext.data.JsonStore({url:_102+"list-communities",root:"communities",fields:["target_folder_id","instance_name"]}); -this.communityCombo=new Ext.form.ComboBox({store:_10b,displayField:"instance_name",typeAhead:true,triggerAction:"all",emptyText:"Select a community",hiddenName:"target_folder_id",valueField:"target_folder_id",forceSelection:true,handleHeight:80,selectOnFocus:true,applyTo:"communities_list"}); -} -},this); +_103=new Ext.Window({id:"share-win",layout:"fit",width:380,height:200,title:"Share Folder",closeAction:"hide",modal:true,plain:true,autoScroll:false,resizable:false,items:_10a,buttons:_10b}); +this.sharefolderWindow=_103; }else{ +this.sharefolderWindow.findById("sharefolderform").setTitle("Select the community where you wish to share the "+_ff+" folder with."); this.communityCombo.reset(); } _103.show(); @@ -906,6 +904,7 @@ },showRevisions:function(grid,i,e){ var _123=grid; var node=_123.store.getAt(i); +_123.getSelectionModel().selectRow(i); var _125=node.get("id"); var _126=node.get("filename"); var _127=this.revisionsWindow; Index: openacs-4/packages/ajax-filestorage-ui/www/resources/ajaxfs.js =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/ajax-filestorage-ui/www/resources/ajaxfs.js,v diff -u -N -r1.10 -r1.11 --- openacs-4/packages/ajax-filestorage-ui/www/resources/ajaxfs.js 2 Jan 2008 07:12:12 -0000 1.10 +++ openacs-4/packages/ajax-filestorage-ui/www/resources/ajaxfs.js 14 Jan 2008 02:53:06 -0000 1.11 @@ -1626,11 +1626,32 @@ if(shareWindow == null) { - var shareFormBody = new Ext.Panel({ - id:'form_addtag', - autoScroll:true, + var communities = new Ext.data.JsonStore({ + url: xmlhttpurl+'list-communities', + root: 'communities', + fields: ['target_folder_id', 'instance_name'] + }); + + this.communityCombo = new Ext.form.ComboBox({ + id:'communities_list', + store: communities, + displayField:'instance_name', + typeAhead: true, + fieldLabel:'Community', + triggerAction: 'all', + emptyText:'Select a community', + hiddenName:'target_folder_id', + valueField:'target_folder_id', + forceSelection:true, + handleHeight: 80, + selectOnFocus:true + }); + + var shareFormBody = new Ext.form.FormPanel({ + id:'sharefolderform', + title:'Select the community where you wish to share the '+foldertitle+' folder with.', frame:true, - html: "
Select the community where you wish to share the "+foldertitle+" folder with.

" + items : this.communityCombo }); var shareBtns = [{ @@ -1662,44 +1683,18 @@ buttons: shareBtns }); - shareWindow.on("show",function() { + this.sharefolderWindow = shareWindow; - if(this.communityCombo == null) { - - var communities = new Ext.data.JsonStore({ - url: xmlhttpurl+'list-communities', - root: 'communities', - fields: ['target_folder_id', 'instance_name'] - }); - - this.communityCombo = new Ext.form.ComboBox({ - store: communities, - displayField:'instance_name', - typeAhead: true, - triggerAction: 'all', - emptyText:'Select a community', - hiddenName:'target_folder_id', - valueField:'target_folder_id', - forceSelection:true, - handleHeight: 80, - selectOnFocus:true, - applyTo:'communities_list' - }); - - } - - },this); - } else { + this.sharefolderWindow.findById('sharefolderform').setTitle('Select the community where you wish to share the '+foldertitle+' folder with.'); this.communityCombo.reset(); } shareWindow.show(); }, - // redirect to object views for a file redirectViews : function(grid,i,e) { var filepanel = grid; @@ -1734,6 +1729,7 @@ var filepanel = grid; var node = filepanel.store.getAt(i); + filepanel.getSelectionModel().selectRow(i); var object_id = node.get("id"); var fstitle = node.get("filename"); var revWindow = this.revisionsWindow;