From e319569b2c56b0b5e08fa8c8c4da66d3165c5b43 Mon Sep 17 00:00:00 2001 From: ctucx Date: Sat, 8 Feb 2020 00:36:44 +0100 Subject: [PATCH] [client] travelynx checkin --- client/css/style.css | 7 ++++ client/img/travelynx.svg | 79 ++++++++++++++++++++++++++++++++++++++ client/js/app_functions.js | 3 +- client/js/journeyView.js | 4 +- client/js/languages.js | 9 ++++- client/js/settingsView.js | 5 ++- 6 files changed, 102 insertions(+), 5 deletions(-) create mode 100644 client/img/travelynx.svg diff --git a/client/css/style.css b/client/css/style.css index 0876a0d..005d2af 100644 --- a/client/css/style.css +++ b/client/css/style.css @@ -678,3 +678,10 @@ input:focus{ /*.showremarks:hover+.remarks { display: inline-block; }*/ + + +.travelynx { + vertical-align: bottom; + cursor: pointer; + content: url("../img/travelynx.svg"); +} \ No newline at end of file diff --git a/client/img/travelynx.svg b/client/img/travelynx.svg new file mode 100644 index 0000000..9a553f2 --- /dev/null +++ b/client/img/travelynx.svg @@ -0,0 +1,79 @@ + + + + + + image/svg+xml + + + + + + + + + + + + + + + + diff --git a/client/js/app_functions.js b/client/js/app_functions.js index e63dc25..c676290 100644 --- a/client/js/app_functions.js +++ b/client/js/app_functions.js @@ -208,7 +208,8 @@ export const restoreDataStorage = () => { showRIL100Names: false, writeDebugLog: false, enableCanvas: false, - language: language + language: language, + travelynx: fase } } diff --git a/client/js/journeyView.js b/client/js/journeyView.js index b79674e..352a3a0 100644 --- a/client/js/journeyView.js +++ b/client/js/journeyView.js @@ -1,5 +1,6 @@ 'use strict'; +import { dataStorage } from './app.js'; import { showDiv, hideDiv, ElementById, parseDateTime, formatDuration } from './helpers.js'; import { getCache, addCache, ConsoleLog, parseName, ds100Names, t } from './app_functions.js'; import { showModal } from './overlays.js'; @@ -21,7 +22,7 @@ const remarksModalTemplate = (type, remarks) => html` `; const showRemarksModal = (type, remarks) => { - showModal("Remarks", remarksModalTemplate(type, remarks)); + showModal(t('remarks'), remarksModalTemplate(type, remarks)); }; const remarksTemplate = ([type, remarks]) => !!remarks.length ? html` showRemarksModal(type, remarks)}> @@ -49,6 +50,7 @@ const legTemplate = (element) => { ${element.line.name} ${element.line.additionalName ? '('+element.line.additionalName+')' : ''} → ${element.direction} ${element.cancelled ? html`${t('cancelled-ride')}` : ''} ${Object.entries(remarks).map(remarksTemplate)} + ${dataStorage.settings.travelynx && element.line.mode == 'Train' ? html`` : ''} diff --git a/client/js/languages.js b/client/js/languages.js index 6a4aec4..fada692 100644 --- a/client/js/languages.js +++ b/client/js/languages.js @@ -45,8 +45,11 @@ export const languages = { 'language': 'Sprache', 'de': 'Deutsch', 'en': 'Englisch', - 'cancelled-ride': 'Fahrt entfällt!' + 'cancelled-ride': 'Fahrt entfällt!', + 'remarks': 'Hinweise', + 'travelynx-checkin': 'Travelynx checkin anzeigen?' }, + 'en': { 'arrival': 'Arrival', 'departure': 'Departure', @@ -93,6 +96,8 @@ export const languages = { 'language': 'Language', 'de': 'German', 'en': 'English', - 'cancelled-ride': 'Cancelled!' + 'cancelled-ride': 'Cancelled!', + 'remarks': 'Remarks', + 'travelynx-checkin': 'show travelynx checkin?' } } diff --git a/client/js/settingsView.js b/client/js/settingsView.js index 7a052b6..9e708b4 100644 --- a/client/js/settingsView.js +++ b/client/js/settingsView.js @@ -26,6 +26,7 @@ const settingsTemplate = () => html`