Skip to content

Commit

Permalink
Merge branch 'devel' and bump version to 1.3.4
Browse files Browse the repository at this point in the history
  • Loading branch information
tmuguet committed Feb 4, 2018
2 parents 888911b + a52f9cb commit f63c19e
Show file tree
Hide file tree
Showing 44 changed files with 212 additions and 276 deletions.
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -32,4 +32,4 @@ Pre-requisites:
Rebuild:
* `gulp` to launch checks and re-bundle the javascript and css resources
* `gulp bundle` just to re-bundle
* `gulp watch` to watch for modifications of the javascript files and re-bundle the javascript resources on the fly
* `gulp watch` to watch for modifications of the javascript and css files and re-bundle resources on the fly
2 changes: 1 addition & 1 deletion css/map2gpx.min.css

Large diffs are not rendered by default.

7 changes: 7 additions & 0 deletions css/map2gpx.src.css

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

30 changes: 27 additions & 3 deletions gulpfile.js
Original file line number Diff line number Diff line change
@@ -1,4 +1,8 @@

const sources_js_loader = [
"src/js/loader.js"
]

const sources_js = [
"src/js/jquery.localstorage.js",
"src/js/jquery.querystring.js",
Expand Down Expand Up @@ -39,7 +43,7 @@ gulp.task("jshint", function () {

const jshint = require("gulp-jshint");

return gulp.src(sources_js)
return gulp.src(sources_js_loader.concat(sources_js))
.pipe($.plumber())
.pipe(jshint(".jshintrc"))
.pipe(jshint.reporter("default", { verbose : true }))
Expand All @@ -50,13 +54,31 @@ gulp.task("jscs", function () {

const jscs = require("gulp-jscs");

return gulp.src(sources_js)
return gulp.src(sources_js_loader.concat(sources_js))
.pipe($.plumber())
.pipe(jscs())
.pipe(jscs.reporter())
.pipe(jscs.reporter("fail"));
});

gulp.task("bundle-js-loader", function() {

const babel = require('gulp-babel');
const concat = require('gulp-concat');
const rename = require('gulp-rename');
const uglify = require('gulp-uglify');

return gulp.src(sources_js_loader)
.pipe(concat('map2gpx-loader.src.js'))
.pipe(gulp.dest(dest_js))
.pipe(babel({ presets: ['env'] }))
.pipe(rename("map2gpx-loader.babel.js"))
.pipe(gulp.dest(dest_js))
.pipe(uglify())
.pipe(rename("map2gpx-loader.min.js"))
.pipe(gulp.dest(dest_js));
});

gulp.task("bundle-js", function() {

const babel = require('gulp-babel');
Expand Down Expand Up @@ -90,12 +112,14 @@ gulp.task("bundle-css", function() {
});

gulp.task("check", ['jshint', 'jscs']);
gulp.task("bundle", ['bundle-js', 'bundle-css']);
gulp.task("bundle", ['bundle-js-loader', 'bundle-js', 'bundle-css']);

gulp.task("default", function(cb) {
runSequence("check", "bundle", cb);
});

gulp.task('watch', function () {
gulp.watch(sources_js, ['bundle-js']);
gulp.watch(sources_js_loader, ['bundle-js-loader']);
gulp.watch(sources_css, ['bundle-css']);
});
Binary file removed ico/logo.ico
Binary file not shown.
78 changes: 15 additions & 63 deletions index.html
Original file line number Diff line number Diff line change
Expand Up @@ -8,80 +8,32 @@
<meta name="author" content="Thomas Muguet">

<title>map2gpx by tmuguet</title>
<link rel="shortcut icon" href="ico/logo.ico">
<link rel="apple-touch-icon" sizes="144x144" href="ico/logo-144.png">
<link rel="apple-touch-icon" sizes="114x114" href="ico/logo-114.png">
<link rel="apple-touch-icon" sizes="72x72" href="ico/logo-medium-72.png">
<link rel="icon" type="image/png" sizes="72x72" href="ico/logo-medium-72.png">
<link rel="apple-touch-icon" sizes="57x57" href="ico/logo-medium-57.png">
<link rel="apple-touch-icon" sizes="72x72" href="ico/logo-medium-72.png">
<link rel="apple-touch-icon" sizes="114x114" href="ico/logo-114.png">
<link rel="apple-touch-icon" sizes="144x144" href="ico/logo-144.png">

<link href="https://maxcdn.bootstrapcdn.com/font-awesome/4.7.0/css/font-awesome.min.css" rel="stylesheet">

<script src="https://code.jquery.com/jquery-2.2.4.min.js" integrity="sha256-BbhdlvQf/xTY9gja0Dq3HiwQF8LaCRTXxZKRutelT44=" crossorigin="anonymous"></script>

<script>
var msgs = [
'Génération des montagnes...',
'Ajout des ruisseaux...',
'Remplissage des lacs...',
'Danse du soleil...',
'Appel des marmottes...',
'Plantation de lis des Alpes...',
'Ajout des bouquetins...',
'Surveillance des salamandres tachetées...',
'Recherche de campanule barbue...',
'Découverte d\'une hermine...',
'Tentative de lutte contre le réchauffement climatique...',
];

function showLoadingMessage(m) {
$('<div>' + m + '</div>').insertAfter($('#loading h3')).fadeOut(2000, function () {$(this).remove();});
}

var endOfMessage = 0;
var gotError = false;
var interval = window.setInterval(function () {
var m = msgs.shift();
if (m === undefined) {
m = Math.random().toString(36).substr(2);

if (!gotError) {
if (endOfMessage == 0) {
$('<div>Le chargement prend plus de temps que prévu...</div>').hide().prependTo($('#loading h3')).slideDown();
$('#loading').animate({ backgroundColor: '#C0C0C0' });
} else if (endOfMessage == 5) {
$('#loading h2 i.fa').removeClass('fa-pulse').addClass('fa-spin');
$('<div>Une erreur s\'est peut-être produite. N\'hésitez pas à ouvrir un ticket sur <a href="https://github.com/tmuguet/map2gpx" target="_blank" rel="noopener noreferrer">Github</a> ou à m\'envoyer un mail à <a href="mailto:[email protected]">[email protected]</a>.</div>').hide().appendTo($('#loading h3')).slideDown();
$('#loading').animate({ backgroundColor: '#999999', color: '#FFFFFF' });
} else if (endOfMessage > 5 && endOfMessage < 15) {
var color = 14 - endOfMessage;
$('#loading').animate({ backgroundColor: '#' + color.toString().repeat(6) });
}
endOfMessage++;
}
}

showLoadingMessage(m);

}, 800);

showLoadingMessage('Chargement des bibliothèques...');
</script>
<script src="https://code.jquery.com/jquery-3.3.1.min.js" integrity="sha256-FgpCb/KJQlLNfOu91ta32o/NMZxltwRo8QtmkMRdAu8=" crossorigin="anonymous"></script>
<script src="js/map2gpx-loader.min.js"></script>

<script src="https://code.jquery.com/ui/1.12.1/jquery-ui.min.js"></script>

<link rel="stylesheet" href="https://unpkg.com/leaflet@1.0.0/dist/leaflet.css" />
<script src="https://unpkg.com/leaflet@1.0.0/dist/leaflet.js"></script>
<link rel="stylesheet" href="https://unpkg.com/leaflet@1.3.1/dist/leaflet.css" integrity="sha512-Rksm5RenBEKSKFjgI3a41vrjkw4EVPlJ3+OiI65vTjIdo9brlAacEuKOiQ5OFh7cOI1bkDwLqdLw3Zg0cRJAAQ==" crossorigin=""/>
<script src="https://unpkg.com/leaflet@1.3.1/dist/leaflet.js" integrity="sha512-/Nsx9X4HebavoBvEBuyp3I7od5tA0UzAxs+j83KgC8PU0kgB4XiK4Lfe4y4cgBtaRJQEIFCW+oC506aPT2L1zw==" crossorigin=""></script>

<script src="leaflet/L.Polyline.SnakeAnim.js"></script>

<link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/Leaflet.awesome-markers/2.0.2/leaflet.awesome-markers.css" integrity="sha256-EFpFyBbuttUJtoocYzsBnERPWee2JYz4cn5nkUBjW0A=" crossorigin="anonymous" />
<script src="https://cdnjs.cloudflare.com/ajax/libs/Leaflet.awesome-markers/2.0.2/leaflet.awesome-markers.min.js" integrity="sha256-IqiRR5X1QtAdcq5lG4vBB1/WxwrRCkkjno4pfvWyag0=" crossorigin="anonymous"></script>

<link rel="stylesheet" href="https://unpkg.com/leaflet-easybutton@2.0.0/src/easy-button.css">
<script src="https://unpkg.com/leaflet-easybutton@2.0.0/src/easy-button.js"></script>
<link rel="stylesheet" href="https://unpkg.com/leaflet-easybutton@2.3.0/src/easy-button.css">
<script src="https://unpkg.com/leaflet-easybutton@2.3.0/src/easy-button.js"></script>

<link rel="stylesheet" href="leaflet/GpPluginLeaflet.css" />
<script data-key="jwwl8p4ie5qcwbgohl0uv7zx" src="leaflet/GpPluginLeaflet.js"></script>
<link rel="stylesheet" href="https://unpkg.com/geoportal-extensions-leaflet@1.0.0/dist/GpPluginLeaflet.css" />
<script data-key="jwwl8p4ie5qcwbgohl0uv7zx" src="https://unpkg.com/geoportal-extensions-leaflet@1.0.0/dist/GpPluginLeaflet.js"></script>
<script>
var keyIgn = 'jwwl8p4ie5qcwbgohl0uv7zx';
</script>
Expand All @@ -90,8 +42,8 @@
<script src="leaflet/Control.MiniMap.min.js"></script>
<script src="leaflet/gpx.js"></script>

<script src="https://cdnjs.cloudflare.com/ajax/libs/Chart.js/2.7.0/Chart.min.js" integrity="sha256-UGwvyUFH6Qqn0PSyQVw4q3vIX0wV1miKTracNJzAWPc=" crossorigin="anonymous"></script>
<script src="https://cdnjs.cloudflare.com/ajax/libs/chartjs-plugin-annotation/0.5.5/chartjs-plugin-annotation.min.js" integrity="sha256-/C1C5fYwTKrHH6KPq9CnTsBllYnqnMwxiBPr9rWgQjQ=" crossorigin="anonymous"></script>
<script src="https://cdnjs.cloudflare.com/ajax/libs/Chart.js/2.7.1/Chart.min.js" integrity="sha256-c0m8xzX5oOBawsnLVpHnU2ieISOvxi584aNElFl2W6M=" crossorigin="anonymous"></script>
<script src="https://cdnjs.cloudflare.com/ajax/libs/chartjs-plugin-annotation/0.5.7/chartjs-plugin-annotation.min.js" integrity="sha256-Olnajf3o9kfkFGloISwP1TslJiWUDd7IYmfC+GdCKd4=" crossorigin="anonymous"></script>

<script src="js/FileSaver.min.js"></script>

Expand Down Expand Up @@ -169,7 +121,7 @@
Le code source est disponible sur <a href="https://github.com/tmuguet/map2gpx" target="_blank" rel="noopener noreferrer">GitHub</a> (vous aurez besoin de votre propre clé <a href="http://professionnels.ign.fr/" target="_blank" rel="noopener noreferrer">Géoservices API</a>).</p>
<hr>
<p>map2gpx utilise:</p>
<ul>
<ul class="columns-2">
<li><a href="http://fontawesome.io" target="_blank" rel="noopener noreferrer">Font Awesome</a> par Dave Gandy (SIL OFL 1.1)</li>
<li><a href="http://jquery.com/" target="_blank" rel="noopener noreferrer">jQuery</a> (MIT license)</li>
<li><a href="http://jqueryui.com/" target="_blank" rel="noopener noreferrer">jQuery UI</a> (MIT license)</li>
Expand Down
38 changes: 38 additions & 0 deletions js/map2gpx-loader.babel.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,38 @@
'use strict';

var msgs = ['Génération des montagnes...', 'Ajout des ruisseaux...', 'Remplissage des lacs...', 'Danse du soleil...', 'Appel des marmottes...', 'Plantation de lis des Alpes...', 'Ajout des bouquetins...', 'Surveillance des salamandres tachetées...', 'Recherche de campanule barbue...', 'Découverte d\'une hermine...', 'Tentative de lutte contre le réchauffement climatique...'];

function showLoadingMessage(m) {
$('<div>' + m + '</div>').insertAfter($('#loading h3')).fadeOut(2000, function () {
$(this).remove();
});
}

var endOfMessage = 0;
var gotError = false;
var interval = window.setInterval(function () {
var m = msgs.shift();
if (m === undefined) {
m = Math.random().toString(36).substr(2);

if (!gotError) {
if (endOfMessage == 0) {
$('<div>Le chargement prend plus de temps que prévu...</div>').hide().prependTo($('#loading h3')).slideDown();
$('#loading').animate({ backgroundColor: '#C0C0C0' });
} else if (endOfMessage == 5) {
$('#loading h2 i.fa').removeClass('fa-pulse').addClass('fa-spin');
$('<div>Une erreur s\'est peut-être produite. ' + 'N\'hésitez pas à ouvrir un ticket sur <a href="https://github.com/tmuguet/map2gpx" target="_blank" rel="noopener noreferrer">Github</a> ' + 'ou à m\'envoyer un mail à <a href="mailto:[email protected]">[email protected]</a>.</div>').hide().appendTo($('#loading h3')).slideDown();
$('#loading').animate({ backgroundColor: '#999999', color: '#FFFFFF' });
} else if (endOfMessage > 5 && endOfMessage < 15) {
var color = 14 - endOfMessage;
$('#loading').animate({ backgroundColor: '#' + color.toString().repeat(6) });
}

endOfMessage++;
}
}

showLoadingMessage(m);
}, 800);

showLoadingMessage('Chargement des bibliothèques...');
1 change: 1 addition & 0 deletions js/map2gpx-loader.min.js

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

50 changes: 50 additions & 0 deletions js/map2gpx-loader.src.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,50 @@
var msgs = [
'Génération des montagnes...',
'Ajout des ruisseaux...',
'Remplissage des lacs...',
'Danse du soleil...',
'Appel des marmottes...',
'Plantation de lis des Alpes...',
'Ajout des bouquetins...',
'Surveillance des salamandres tachetées...',
'Recherche de campanule barbue...',
'Découverte d\'une hermine...',
'Tentative de lutte contre le réchauffement climatique...',
];

function showLoadingMessage(m) {
$('<div>' + m + '</div>').insertAfter($('#loading h3')).fadeOut(2000, function () {$(this).remove();});
}

var endOfMessage = 0;
var gotError = false;
var interval = window.setInterval(function () {
var m = msgs.shift();
if (m === undefined) {
m = Math.random().toString(36).substr(2);

if (!gotError) {
if (endOfMessage == 0) {
$('<div>Le chargement prend plus de temps que prévu...</div>').hide().prependTo($('#loading h3')).slideDown();
$('#loading').animate({ backgroundColor: '#C0C0C0' });
} else if (endOfMessage == 5) {
$('#loading h2 i.fa').removeClass('fa-pulse').addClass('fa-spin');
$('<div>Une erreur s\'est peut-être produite. ' +
'N\'hésitez pas à ouvrir un ticket sur <a href="https://github.com/tmuguet/map2gpx" target="_blank" rel="noopener noreferrer">Github</a> ' +
'ou à m\'envoyer un mail à <a href="mailto:[email protected]">[email protected]</a>.</div>')
.hide().appendTo($('#loading h3')).slideDown();
$('#loading').animate({ backgroundColor: '#999999', color: '#FFFFFF' });
} else if (endOfMessage > 5 && endOfMessage < 15) {
var color = 14 - endOfMessage;
$('#loading').animate({ backgroundColor: '#' + color.toString().repeat(6) });
}

endOfMessage++;
}
}

showLoadingMessage(m);

}, 800);

showLoadingMessage('Chargement des bibliothèques...');
7 changes: 4 additions & 3 deletions js/map2gpx.babel.js
Original file line number Diff line number Diff line change
Expand Up @@ -673,8 +673,8 @@ L.polyline_interpolate = function (coords) {
var p = 1;
if (this.options.total > 0) p = this.options.progress / this.options.total;

this.$progress.text(Math.round(p * 100) + '%');
this.$progressbar.css('width', Math.round(p * 100) + '%');
this.$progress.text(Math.floor(p * 100) + '%');
this.$progressbar.css('width', Math.floor(p * 100) + '%');

if (Math.round(p * 100) == 42) $('<div><small>La grande question sur la vie, l\'univers et le reste répondue</small></div>').insertAfter(this.$h2).fadeOut(400, function () {
$(this).remove();
Expand Down Expand Up @@ -2641,7 +2641,8 @@ L.Layer.include({
_initializeHelpButtons: function _initializeHelpButtons() {
var _this14 = this;

var infoPopup = L.popup().setContent(L.DomUtil.get('about'));
var infoPopupMaxSize = window.innerWidth - $('.leaflet-control-minimap').width() - $('.leaflet-top.leaflet-right .GPpanel').width();
var infoPopup = L.popup({ maxWidth: infoPopupMaxSize }).setContent(L.DomUtil.get('about'));

var infoBtn = L.easyButton({
position: 'bottomright',
Expand Down
2 changes: 1 addition & 1 deletion js/map2gpx.min.js

Large diffs are not rendered by default.

7 changes: 4 additions & 3 deletions js/map2gpx.src.js
Original file line number Diff line number Diff line change
Expand Up @@ -707,8 +707,8 @@ L.polyline_interpolate = function (coords) {
if (this.options.total > 0)
p = this.options.progress / this.options.total;

this.$progress.text(Math.round(p * 100) + '%');
this.$progressbar.css('width', Math.round(p * 100) + '%');
this.$progress.text(Math.floor(p * 100) + '%');
this.$progressbar.css('width', Math.floor(p * 100) + '%');

if (Math.round(p * 100) == 42)
$('<div><small>La grande question sur la vie, l\'univers et le reste répondue</small></div>').insertAfter(this.$h2).fadeOut(400, function () {$(this).remove();});
Expand Down Expand Up @@ -2700,7 +2700,8 @@ L.Layer.include({
},

_initializeHelpButtons: function () {
const infoPopup = L.popup().setContent(L.DomUtil.get('about'));
const infoPopupMaxSize = window.innerWidth - $('.leaflet-control-minimap').width() - $('.leaflet-top.leaflet-right .GPpanel').width();
const infoPopup = L.popup({ maxWidth: infoPopupMaxSize }).setContent(L.DomUtil.get('about'));

const infoBtn = L.easyButton({
position: 'bottomright',
Expand Down
Loading

0 comments on commit f63c19e

Please sign in to comment.