commit 2fa2cad6d1b718672cca4d563881702a20b61327
parent 96ef9f8c1af7f1ea471a4e67ace82c0540a1fdcb
Author: Katja (ctucx) <git@ctu.cx>
Date: Mon, 20 Jan 2025 10:14:04 +0100
parent 96ef9f8c1af7f1ea471a4e67ace82c0540a1fdcb
Author: Katja (ctucx) <git@ctu.cx>
Date: Mon, 20 Jan 2025 10:14:04 +0100
remove `ConsoleLog`
8 files changed, 7 insertions(+), 27 deletions(-)
diff --git a/src/app_functions.js b/src/app_functions.js @@ -19,8 +19,6 @@ subscribeSettings(async () => { const addJourneys = async data => { if (!data) return false; - ConsoleLog(data); - const historyEntry = { fromPoint: getFrom(data.journeys), //viaPoint: data.params.via, @@ -227,12 +225,6 @@ export const ds100Reverse = (name) => { return ds100R[name]; }; -export const ConsoleLog = (data) => { - if (settings.writeDebugLog) { - console.log(data); - } -}; - export const loadDS100 = async () => { const module = await import('./ds100.js'); ds100 = module.ds100;
diff --git a/src/departuresView.js b/src/departuresView.js @@ -1,6 +1,6 @@ import { settings } from './settings.js'; import { showDiv, hideDiv, ElementById, formatDateTime, formatDuration, formatPrice } from './helpers.js'; -import { ConsoleLog, parseName, t, timeTemplate, processLeg, platformTemplate } from './app_functions.js'; +import { parseName, t, timeTemplate, processLeg, platformTemplate } from './app_functions.js'; import { showAlertModal, showLoader, hideOverlay, showModal } from './overlays.js'; import { go } from './router.js'; import { html, render } from 'lit-html'; @@ -71,7 +71,6 @@ export const departuresView = async (match, isUpdate) => { } hideOverlay(); - ConsoleLog(data); render(departuresTemplate(data, profile), ElementById('content')); //if (!isUpdate) refreshJourneyView(refreshToken); // update data in the background
diff --git a/src/journeyView.js b/src/journeyView.js @@ -2,7 +2,7 @@ import { cachedCoachSequence } from './reihung'; import { settings } from './settings.js'; import { remarksTemplate } from './templates.js'; import { showDiv, hideDiv, ElementById, formatDateTime, formatDuration, formatPrice, formatTrainTypes, lineAdditionalName, lineDisplayName } from './helpers.js'; -import { ConsoleLog, parseName, t, timeTemplate, getJourney, refreshJourney, platformTemplate, stopTemplate } from './app_functions.js'; +import { parseName, t, timeTemplate, getJourney, refreshJourney, platformTemplate, stopTemplate } from './app_functions.js'; import { showAlertModal, showLoader, hideOverlay, showModal } from './overlays.js'; import { go } from './router.js'; import { html, render } from 'lit-html'; @@ -162,7 +162,6 @@ export const journeyView = async (match, isUpdate) => { } hideOverlay(); - ConsoleLog(data); render(journeyTemplate(data, profile), ElementById('content')); //if (!isUpdate) refreshJourneyView(refreshToken); // update data in the background
diff --git a/src/journeysView.js b/src/journeysView.js @@ -1,5 +1,5 @@ import { showDiv, hideDiv, ElementById, formatDuration, formatFromTo, getFrom, getTo, padZeros, formatPrice } from './helpers.js'; -import { parseName, ConsoleLog, t, timeTemplate, getJourneys, getMoreJourneys, refreshJourneys } from './app_functions.js'; +import { parseName, t, timeTemplate, getJourneys, getMoreJourneys, refreshJourneys } from './app_functions.js'; import { settings, modifySettings } from './settings.js'; import { setupCanvas } from './canvas.js'; import { go } from './router.js';
diff --git a/src/searchView.js b/src/searchView.js @@ -1,6 +1,6 @@ import { showDiv, ElementById, padZeros, isValidDate, formatFromTo } from './helpers.js'; import { db } from './dataStorage.js'; -import { parseName, ConsoleLog, t, loadDS100, getJourneys, newJourneys, ds100Reverse } from './app_functions.js'; +import { parseName, t, loadDS100, getJourneys, newJourneys, ds100Reverse } from './app_functions.js'; import { modifySettings, settings } from './settings.js'; import { go } from './router.js'; import { html, render } from 'lit-html'; @@ -145,7 +145,6 @@ const journeysHistoryTemplate = (journeysHistory) => html` `; const journeysHistoryAction = (journeysHistory, element) => { - ConsoleLog(element); showSelectModal(html` <a @click=${() => {setFromHistory(journeysHistory.length - 1 - journeysHistory.indexOf(element));hideOverlay();}}>${t('setfromto')}</a> <a @click=${() => {go('/'+element.slug+'/'+settings.journeysViewMode);hideOverlay();}}>${t('journeyoverview')}</a> @@ -255,8 +254,6 @@ export const search = async (requestId) => { timestamp = Math.round(new Date(split_date[0], split_date[1]-1, split_date[2], split_time[0], split_time[1]).getTime()/1000); - ConsoleLog(timestamp+'///'+date+' '+time+':00'); - const params = { from, to,
diff --git a/src/settings.js b/src/settings.js @@ -25,7 +25,6 @@ const defaultSettings = { journeysViewMode: 'canvas', showPrices: true, showRIL100Names: true, - writeDebugLog: false, }; const subscribers = [];
diff --git a/src/settingsView.js b/src/settingsView.js @@ -2,7 +2,7 @@ import { db, clearDataStorage } from './dataStorage.js'; import { modifySettings, settings } from './settings.js'; import { showModal } from './overlays.js'; import { hideDiv, ElementById } from './helpers.js'; -import { ConsoleLog, t } from './app_functions.js'; +import { t } from './app_functions.js'; import { html, render } from 'lit-html'; import { searchView } from './searchView.js'; import { initHafasClient } from './hafas_client'; @@ -15,7 +15,7 @@ const settingsTemplate = () => html` <div id="settingsView"> <b>${t('options')}:</b><br> <label><input type="checkbox" ?checked=${settings.showRIL100Names} id="ril100"> ${t('showds100')}</label><br> - <label><input type="checkbox" ?checked=${settings.writeDebugLog} id="debug-messages"> ${t('showdebug')}</label><br> + <label><input type="checkbox" ?checked=${settings.showPrices} id="feature-prices"> ${t('show-prices')} (${t("experimental")})</label><br> <br> <b>${t('language')}:</b><br> <label><input type="radio" name="language" ?checked=${settings.language === 'en'} value="en"> ${t('en')}</label><br> @@ -28,17 +28,13 @@ const settingsTemplate = () => html` <label><input type="radio" name="profile" ?checked=${settings.profile === 'bvg'} value="bvg"> BVG (${t("experimental")})</label><br> <label><input type="radio" name="profile" ?checked=${settings.profile === 'oebb'} value="oebb"> ÖBB (${t("experimental")})</label><br> <br> - <b>${t('experimental-features')}:</b><br> - <label><input type="checkbox" ?checked=${settings.showPrices} id="feature-prices"> ${t('show-prices')}</label><br> <button class="button" id="clear" @click=${clearDataStorage}><span>${t('clearstorage')}</span></button> <button class="button" id="save" @click=${saveSettings}><span>${t('save')}</span></button> - </div> `; const rebuildCache = () => { - ConsoleLog('sw update'); registration.update(); location.reload(); }; @@ -46,7 +42,6 @@ const rebuildCache = () => { const saveSettings = async () => { await modifySettings(settings => { settings.showRIL100Names = ElementById('ril100').checked; - settings.writeDebugLog = ElementById('debug-messages').checked; const language = document.querySelector('input[name="language"]:checked').value; settings.language = language;
diff --git a/src/tripView.js b/src/tripView.js @@ -1,7 +1,7 @@ import { settings } from './settings.js'; import { remarksTemplate } from './templates.js'; import { showDiv, hideDiv, ElementById, formatDateTime, formatDuration, formatPrice, lineAdditionalName, lineDisplayName } from './helpers.js'; -import { ConsoleLog, parseName, t, timeTemplate, processLeg, platformTemplate, stopTemplate } from './app_functions.js'; +import { parseName, t, timeTemplate, processLeg, platformTemplate, stopTemplate } from './app_functions.js'; import { showAlertModal, showLoader, hideOverlay, showModal } from './overlays.js'; import { go } from './router.js'; import { html, render } from 'lit-html'; @@ -113,6 +113,5 @@ export const tripView = async (match, isUpdate) => { } hideOverlay(); - ConsoleLog(data); render(tripTemplate(data.trip, profile), ElementById('content')); };