New info icons for export
* if format will include turns * warning fit with server download
This commit is contained in:
parent
3e81d80cc5
commit
a376c4725c
4 changed files with 25 additions and 8 deletions
|
|
@ -590,6 +590,10 @@ table.dataTable.display tbody tr:hover.selected {
|
||||||
line-height: 24px;
|
line-height: 24px;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
.format-turns-enabled {
|
||||||
|
font-size: 0.8em;
|
||||||
|
}
|
||||||
|
|
||||||
/* tooltip */
|
/* tooltip */
|
||||||
|
|
||||||
.editing-tooltip,
|
.editing-tooltip,
|
||||||
|
|
|
||||||
|
|
@ -450,6 +450,7 @@
|
||||||
checked
|
checked
|
||||||
/>
|
/>
|
||||||
<span data-i18n="export.format_gpx">GPX</span>
|
<span data-i18n="export.format_gpx">GPX</span>
|
||||||
|
<i class="fa fa-location-arrow format-turns-enabled" hidden></i>
|
||||||
</label>
|
</label>
|
||||||
</div>
|
</div>
|
||||||
<div class="form-check">
|
<div class="form-check">
|
||||||
|
|
@ -498,6 +499,7 @@
|
||||||
value="fit"
|
value="fit"
|
||||||
/>
|
/>
|
||||||
<span data-i18n="export.format_fit">FIT</span>
|
<span data-i18n="export.format_fit">FIT</span>
|
||||||
|
<i class="fa fa-location-arrow format-turns-enabled" hidden></i>
|
||||||
</label>
|
</label>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
|
|
@ -532,7 +534,7 @@
|
||||||
<i class="fa fa-cloud-download"></i>
|
<i class="fa fa-cloud-download"></i>
|
||||||
<i
|
<i
|
||||||
hidden
|
hidden
|
||||||
id="export-beeline-warning"
|
id="export-download-warning"
|
||||||
class="fa fa-exclamation-triangle"
|
class="fa fa-exclamation-triangle"
|
||||||
style="font-size: 10px; position: absolute; margin-top: -3px; margin-left: -1px"
|
style="font-size: 10px; position: absolute; margin-top: -3px; margin-left: -1px"
|
||||||
></i>
|
></i>
|
||||||
|
|
|
||||||
|
|
@ -31,7 +31,9 @@ BR.Export = L.Class.extend({
|
||||||
|
|
||||||
L.DomEvent.addListener(document, 'keydown', this._keydownListener, this);
|
L.DomEvent.addListener(document, 'keydown', this._keydownListener, this);
|
||||||
|
|
||||||
$('#export').on('show.bs.modal', this._warnStraightLine.bind(this));
|
$('#export').on('show.bs.modal', this._warnDownload.bind(this));
|
||||||
|
$('#export input[name=format]').on('change', this._warnDownload.bind(this));
|
||||||
|
$('#export').on('show.bs.modal', this._turnInstructionInfo.bind(this));
|
||||||
|
|
||||||
this.update([]);
|
this.update([]);
|
||||||
},
|
},
|
||||||
|
|
@ -47,16 +49,27 @@ BR.Export = L.Class.extend({
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
|
|
||||||
_warnStraightLine: function () {
|
_warnDownload: function () {
|
||||||
const hasBeeline = BR.Routing.hasBeeline(this.segments);
|
const hasBeeline = BR.Routing.hasBeeline(this.segments);
|
||||||
document.getElementById('export-beeline-warning').hidden = !hasBeeline;
|
const isFit = $('#format-fit').prop('checked');
|
||||||
|
$('#export-download-warning').prop('hidden', !hasBeeline && !isFit);
|
||||||
let title = 'Download from server (deprecated)';
|
let title = 'Download from server (deprecated)';
|
||||||
if (hasBeeline) {
|
if (hasBeeline) {
|
||||||
title = '[Warning: straight lines not supported] ' + title;
|
title = '[Warning: straight lines not supported] ' + title;
|
||||||
}
|
}
|
||||||
|
if (isFit) {
|
||||||
|
title = '[Warning: FIT not supported] ' + title;
|
||||||
|
}
|
||||||
document.getElementById('serverExport').title = title;
|
document.getElementById('serverExport').title = title;
|
||||||
},
|
},
|
||||||
|
|
||||||
|
_turnInstructionInfo: function () {
|
||||||
|
const turnInstructionMode = +this.profile.getProfileVar('turnInstructionMode');
|
||||||
|
$('.format-turns-enabled')
|
||||||
|
.prop('hidden', turnInstructionMode <= 1)
|
||||||
|
.attr('title', i18next.t('export.turns_enabled'));
|
||||||
|
},
|
||||||
|
|
||||||
_getMimeType: function (format) {
|
_getMimeType: function (format) {
|
||||||
const mimeTypeMap = {
|
const mimeTypeMap = {
|
||||||
gpx: 'application/gpx+xml;charset=utf-8',
|
gpx: 'application/gpx+xml;charset=utf-8',
|
||||||
|
|
@ -109,9 +122,6 @@ BR.Export = L.Class.extend({
|
||||||
} else {
|
} else {
|
||||||
if (format === 'fit') {
|
if (format === 'fit') {
|
||||||
// Server can't handle fit - downgrade to gpx
|
// Server can't handle fit - downgrade to gpx
|
||||||
// Maybe it's better to show a Info to the user e.g.:
|
|
||||||
// BR.message.showWarning(i18next.t('warning.fit-not-possible-from-server'));
|
|
||||||
// but the warning stays invisible behind the dialog :)
|
|
||||||
format = 'gpx';
|
format = 'gpx';
|
||||||
}
|
}
|
||||||
var serverUrl = this.router.getUrl(
|
var serverUrl = this.router.getUrl(
|
||||||
|
|
|
||||||
|
|
@ -39,7 +39,8 @@
|
||||||
"route-from-to": "{{from}} - {{to}} ({{distance}}km)",
|
"route-from-to": "{{from}} - {{to}} ({{distance}}km)",
|
||||||
"route-loop": "{{from}} ({{distance}}km)",
|
"route-loop": "{{from}} ({{distance}}km)",
|
||||||
"title": "Export route",
|
"title": "Export route",
|
||||||
"trackname": "Name"
|
"trackname": "Name",
|
||||||
|
"turns_enabled": "Includes turn instructions"
|
||||||
},
|
},
|
||||||
"footer": {
|
"footer": {
|
||||||
"ascend": "Ascend",
|
"ascend": "Ascend",
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue