add context menu option for directories in file app to 'load in GpxEdit'
parent
5350c73f99
commit
940a3b3988
|
@ -18,6 +18,7 @@ and this project adheres to [Semantic Versioning](http://semver.org/).
|
||||||
- save/restore current tile layer
|
- save/restore current tile layer
|
||||||
- integration in "Files" and "File sharing" context menu for .gpx files
|
- integration in "Files" and "File sharing" context menu for .gpx files
|
||||||
[#11](https://gitlab.com/eneiluj/gpxedit-oc/issues/11) @rugk
|
[#11](https://gitlab.com/eneiluj/gpxedit-oc/issues/11) @rugk
|
||||||
|
- add directory context menu option in files app : load in GpxEdit
|
||||||
- notifications on tile layer add/remove
|
- notifications on tile layer add/remove
|
||||||
- makefile signs the app code
|
- makefile signs the app code
|
||||||
|
|
||||||
|
@ -30,6 +31,9 @@ and this project adheres to [Semantic Versioning](http://semver.org/).
|
||||||
- app is now compliant to occ check-code
|
- app is now compliant to occ check-code
|
||||||
- jshint and jslint in da place
|
- jshint and jslint in da place
|
||||||
- do not put @NoCSRFRequired everywhere in controllers
|
- do not put @NoCSRFRequired everywhere in controllers
|
||||||
|
- replace decodeURI by decodeURIComponent
|
||||||
|
[#12](https://gitlab.com/eneiluj/gpxedit-oc/issues/12) @gezgez
|
||||||
|
- remove escapeshellcmd to avoid errors with special char in file name
|
||||||
|
|
||||||
## 0.0.4 – 2017-01-17
|
## 0.0.4 – 2017-01-17
|
||||||
### Added
|
### Added
|
||||||
|
|
|
@ -2,6 +2,30 @@ $(document).ready(function() {
|
||||||
|
|
||||||
if (OCA.Files && OCA.Files.fileActions && !$('#sharingToken').val()) {
|
if (OCA.Files && OCA.Files.fileActions && !$('#sharingToken').val()) {
|
||||||
|
|
||||||
|
var token = $('#sharingToken').val();
|
||||||
|
|
||||||
|
// file action for directories
|
||||||
|
if (!token) {
|
||||||
|
OCA.Files.fileActions.registerAction({
|
||||||
|
name: 'viewDirectoryGpxEdit',
|
||||||
|
displayName: t('gpxedit','Load in GpxEdit'),
|
||||||
|
mime: 'httpd/unix-directory',
|
||||||
|
permissions: OC.PERMISSION_READ,
|
||||||
|
icon: function () {return OC.imagePath('gpxedit', 'app_black');},
|
||||||
|
actionHandler: function(file, data){
|
||||||
|
var dir;
|
||||||
|
if (data.dir === '/'){
|
||||||
|
dir = data.dir+file;
|
||||||
|
}
|
||||||
|
else{
|
||||||
|
dir = data.dir+'/'+file;
|
||||||
|
}
|
||||||
|
var url = OC.generateUrl('apps/gpxedit/?dir={dir}',{'dir': dir});
|
||||||
|
window.open(url, '_blank');
|
||||||
|
}
|
||||||
|
});
|
||||||
|
}
|
||||||
|
|
||||||
function openFile(file, data){
|
function openFile(file, data){
|
||||||
var url = OC.generateUrl('apps/gpxedit/?file={filepath}',{'filepath': data.dir+'/'+file});
|
var url = OC.generateUrl('apps/gpxedit/?file={filepath}',{'filepath': data.dir+'/'+file});
|
||||||
window.open(url, '_blank');
|
window.open(url, '_blank');
|
||||||
|
|
|
@ -1570,6 +1570,11 @@
|
||||||
if (fileparam && fileparam !== undefined) {
|
if (fileparam && fileparam !== undefined) {
|
||||||
loadAction(fileparam);
|
loadAction(fileparam);
|
||||||
}
|
}
|
||||||
|
// load a directory if 'dir' GET url parameter was given
|
||||||
|
var dirparam = getUrlParameter('dir');
|
||||||
|
if (dirparam && dirparam !== undefined) {
|
||||||
|
loadFolderAction(dirparam);
|
||||||
|
}
|
||||||
|
|
||||||
});
|
});
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue