File tree Expand file tree Collapse file tree 2 files changed +33
-0
lines changed
Expand file tree Collapse file tree 2 files changed +33
-0
lines changed Original file line number Diff line number Diff line change 710710 }
711711 } ) ;
712712
713+ this . registerAction ( {
714+ name : 'EditLocally' ,
715+ displayName : function ( context ) {
716+ var locked = context . $file . data ( 'locked' ) ;
717+ if ( ! locked ) {
718+ return t ( 'files' , 'Edit locally' ) ;
719+ }
720+ } ,
721+ mime : 'all' ,
722+ order : - 23 ,
723+ iconClass : function ( filename , context ) {
724+ var locked = context . $file . data ( 'locked' ) ;
725+ if ( ! locked ) {
726+ return 'icon-rename' ;
727+ }
728+ } ,
729+ permissions : OC . PERMISSION_UPDATE ,
730+ actionHandler : function ( filename , context ) {
731+ var dir = context . dir || context . fileList . getCurrentDirectory ( ) ;
732+ var path = dir === '/' ? dir + filename : dir + '/' + filename ;
733+ context . fileList . openLocalClient ( path ) ;
734+ } ,
735+ } ) ;
736+
713737 this . registerAction ( {
714738 name : 'Open' ,
715739 mime : 'dir' ,
Original file line number Diff line number Diff line change 28072807 } ) ;
28082808 } ,
28092809
2810+ openLocalClient : function ( path ) {
2811+ var scheme = 'nc://' ;
2812+ var command = 'open' ;
2813+ var uid = OC . getCurrentUser ( ) . uid ;
2814+ var url = scheme + command + '/' + uid + '@' + window . location . host + ( window . location . port ? `:${ window . location . port } ` : '' ) + OC . encodePath ( path ) ;
2815+
2816+ window . location . href = url ;
2817+ } ,
2818+
28102819 /**
28112820 * Updates the given row with the given file info
28122821 *
You can’t perform that action at this time.
0 commit comments