From 448c31f9d1b2e0a399f2d42b06cfe7a36d1e16c3 Mon Sep 17 00:00:00 2001
From: Jacek Kowalski <Jacek@jacekk.info>
Date: Sun, 14 Apr 2019 09:57:55 +0000
Subject: [PATCH] Add stop type to the header in timetables
---
index.js | 2 ++
index.html | 4 ++--
index.css | 3 +++
3 files changed, 7 insertions(+), 2 deletions(-)
diff --git a/index.css b/index.css
index 38820bd..d75bd72 100644
--- a/index.css
+++ b/index.css
@@ -34,6 +34,9 @@
font-size: inherit;
}
+h2#times-stop {
+ margin-top: 0;
+}
.vehicleInfo {
font-size: 21px;
}
diff --git a/index.html b/index.html
index d8f447d..28b25ab 100644
--- a/index.html
+++ b/index.html
@@ -56,7 +56,7 @@
<div class="row">
<div class="col-md-6">
- <h2 id="times-stop-name"></h2>
+ <h2 id="times-stop"><small id="times-stop-type"></small><br /><span id="times-stop-name"></span></h2>
<div id="times-alerts"></div>
@@ -136,6 +136,6 @@
<script src="https://polyfill.io/v3/polyfill.min.js?features=Promise,XMLHttpRequest"></script>
<script type="text/javascript" src="lang_pl.js?v7" id="lang_script"></script>
<script type="text/javascript" src="common.js?v8"></script>
- <script type="text/javascript" src="index.js?v6"></script>
+ <script type="text/javascript" src="index.js?v7"></script>
</body>
</html>
diff --git a/index.js b/index.js
index fd60868..6c74d57 100644
--- a/index.js
+++ b/index.js
@@ -17,6 +17,7 @@
var times_xhr;
var times_timer;
+var times_stop_type = document.getElementById('times-stop-type');
var times_stop_name = document.getElementById('times-stop-name');
var times_alerts = document.getElementById('times-alerts');
var times_table = document.getElementById('times-table');
@@ -103,6 +104,7 @@
+ '?stop=' + encodeURIComponent(stop)
+ '&mode=departure'
).done(function(data) {
+ setText(times_stop_type, lang.types['s' + prefix]);
setText(times_stop_name, data.stopName);
setText(page_title, lang.page_title_stop_name.replace('$stop', data.stopName));
deleteChildren(times_alerts);
--
Gitblit v1.9.1