refs #11 add context menu entry in files app for gpx files to edit in GpxEdit

merge-requests/1/head
Julien Veyssier 2017-03-15 03:29:51 -03:00
parent 92a1edeb6b
commit 5b58e457dc
5 changed files with 82 additions and 1 deletions

View File

@ -13,6 +13,9 @@ namespace OCA\GpxEdit\AppInfo;
use OCP\AppFramework\App;
use OCP\Util;
Util::addScript('gpxedit', 'filetypes');
$app = new Application();
$container = $app->getContainer();

57
img/app_black.svg 100644
View File

@ -0,0 +1,57 @@
<?xml version="1.0" encoding="UTF-8" standalone="no"?>
<!-- Generator: Adobe Illustrator 16.0.0, SVG Export Plug-In . SVG Version: 6.00 Build 0) -->
<svg
xmlns:dc="http://purl.org/dc/elements/1.1/"
xmlns:cc="http://creativecommons.org/ns#"
xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#"
xmlns:svg="http://www.w3.org/2000/svg"
xmlns="http://www.w3.org/2000/svg"
xmlns:sodipodi="http://sodipodi.sourceforge.net/DTD/sodipodi-0.dtd"
xmlns:inkscape="http://www.inkscape.org/namespaces/inkscape"
version="1.1"
id="Layer_1"
x="0px"
y="0px"
width="512px"
height="512px"
viewBox="0 0 512 512"
enable-background="new 0 0 512 512"
xml:space="preserve"
inkscape:version="0.91 r13725"
sodipodi:docname="app_black.svg"><metadata
id="metadata9"><rdf:RDF><cc:Work
rdf:about=""><dc:format>image/svg+xml</dc:format><dc:type
rdf:resource="http://purl.org/dc/dcmitype/StillImage" /><dc:title></dc:title></cc:Work></rdf:RDF></metadata><defs
id="defs7" /><sodipodi:namedview
pagecolor="#ffffff"
bordercolor="#666666"
borderopacity="1"
objecttolerance="10"
gridtolerance="10"
guidetolerance="10"
inkscape:pageopacity="0"
inkscape:pageshadow="2"
inkscape:window-width="1323"
inkscape:window-height="716"
id="namedview5"
showgrid="false"
inkscape:zoom="0.92187498"
inkscape:cx="89.149866"
inkscape:cy="367.53914"
inkscape:window-x="43"
inkscape:window-y="24"
inkscape:window-maximized="0"
inkscape:current-layer="Layer_1" /><path
d="M256,0C149.969,0,64,85.969,64,192s160,320,192,320s192-213.969,192-320S362.031,0,256,0z M256,320 c-70.594,0-128-57.438-128-128S185.406,64,256,64s128,57.438,128,128S326.594,320,256,320z"
id="path3"
style="fill:#b3b3b3" /><path
style="opacity:1;fill:#000000;fill-opacity:1;stroke:#ff0000;stroke-width:0.87785804;stroke-linecap:butt;stroke-miterlimit:4;stroke-dasharray:1.75571607, 0.87785804000000001;stroke-dashoffset:0;stroke-opacity:1"
d="M 248.91673,509.24858 C 230.56801,500.07962 190.87269,454.55414 154.79361,401.30133 109.09773,333.85411 77.634458,268.76261 67.562633,220.8371 64.476451,206.15189 63.704442,185.37191 65.653374,169.44602 70.933923,126.29547 89.916923,87.289393 120.53926,56.667063 142.55287,34.653457 168.02941,18.997898 197.14663,9.5911583 c 20.07226,-6.4846296 36.32789,-8.96099834 58.799,-8.9573893 15.82056,0.002539 25.20235,0.8786925 38.58779,3.6036552 29.27974,5.9606698 57.25814,19.1024518 81.56571,38.3123618 7.16255,5.660455 23.62029,22.091106 29.14775,29.099766 27.68995,35.110068 42.05754,75.520398 42.11426,118.450638 0.0195,14.72113 -1.17042,24.05266 -5.0755,39.80466 -11.10768,44.80527 -40.59037,104.78432 -81.74458,166.29964 -43.60715,65.18186 -89.02708,115.3374 -104.44742,115.3374 -1.42318,0 -4.65279,-1.03199 -7.17691,-2.29331 z"
id="path3333"
inkscape:connector-curvature="0"
sodipodi:nodetypes="sssssssssssssss" /><path
style="fill:#ffffff;fill-opacity:1"
d="m 206.68845,335.92576 c -3.95443,-3.78626 -3.78004,-8.1268 0.47218,-11.7533 l 3.46099,-2.95167 -3.46099,-3.31381 c -4.2079,-4.02897 -4.3395,-6.38061 -0.60422,-10.79732 l 2.85673,-3.37791 48.08465,0 48.08464,0 2.85673,3.37791 c 3.73528,4.41671 3.60368,6.76835 -0.60423,10.79732 l -3.46098,3.31381 3.46098,2.95167 c 4.25223,3.6265 4.42662,7.96704 0.4722,11.7533 -2.86426,2.74246 -4.9813,2.86169 -50.80934,2.86169 -45.82805,0 -47.94509,-0.11919 -50.80934,-2.86169 z m 11.95513,-43.60515 c 0,-9.1776 -24.18164,-46.63112 -49.90907,-77.30122 l -9.60204,-11.44677 10.113,-10.01591 c 14.38175,-14.24374 29.69775,-37.27303 45.67705,-68.68054 11.31828,-22.24626 28.37971,-61.259659 36.29292,-82.988998 1.12669,-3.093888 1.59616,17.244785 1.68119,72.835828 l 0.11805,77.12835 -5.78027,4.73732 c -6.75405,5.53535 -8.56585,11.46004 -5.58999,18.27946 7.47115,17.12056 33.80624,12.5531 33.78055,-5.85879 -0.008,-5.24096 -4.98888,-12.93883 -9.70451,-14.99607 l -3.73951,-1.63133 0.11808,-77.39366 c 0.085,-55.77571 0.55461,-76.194637 1.68119,-73.101108 7.91322,21.729339 24.97462,60.742738 36.29291,82.988998 15.97931,31.40751 31.29528,54.4368 45.67705,68.68054 l 10.11299,10.01591 -9.60205,11.44677 c -25.72751,30.6701 -49.90913,68.12362 -49.90913,77.30122 l 0,3.5415 -38.8542,0 -38.85421,0 0,-3.5415 z"
id="path3205"
inkscape:connector-curvature="0" /></svg>

After

Width:  |  Height:  |  Size: 4.3 KiB

20
js/filetypes.js 100644
View File

@ -0,0 +1,20 @@
$(document).ready(function() {
if (OCA.Files && OCA.Files.fileActions) {
function openFile(file, data){
var url = OC.generateUrl('apps/gpxedit/?file={filepath}',{'filepath': data.dir+'/'+file});
window.open(url, '_blank');
}
OCA.Files.fileActions.registerAction({
name: 'editFileGpxEdit',
displayName: t('gpxedit', 'Edit in GpxEdit'),
mime: 'application/gpx+xml',
permissions: OC.PERMISSION_READ,
icon: function () {return OC.imagePath('gpxedit', 'app_black');},
actionHandler: openFile
});
}
});

View File

@ -1322,7 +1322,7 @@ $(document).ready(function(){
var urlfileparam = getUrlParameter('file');
var fileparam = decodeURI(urlfileparam);
if (urlfileparam && urlfileparam !== undefined){
loadAction(fileparam);
loadAction(fileparam.replace(/%2F/g, '/'));
}
});

View File

@ -46,6 +46,7 @@ OC.L10N.register(
"Impossible to add tile server" : "Impossible d'ajouter le serveur de tuiles",
"Failed to restore options values" : "Echec du chargement des valeurs des options",
"Failed to save options values" : "Echec à la sauvegarde des valeurs des options",
"Edit in GpxEdit" : "Éditer dans GpxEdit",
"Error" : "Erreur"
},
"nplurals=2; plural=(n > 1);");