From f50bae766a5086ae5f9caf4668d2ec34fdb4d70c Mon Sep 17 00:00:00 2001
From: Jacek Kowalski <Jacek@jacekk.info>
Date: Tue, 03 Jan 2017 21:20:18 +0000
Subject: [PATCH] Include stop name in page title

---
 index.js |    4 ++++
 1 files changed, 4 insertions(+), 0 deletions(-)

diff --git a/index.js b/index.js
index d317dd4..0a132bd 100644
--- a/index.js
+++ b/index.js
@@ -2,6 +2,9 @@
 var ttss_base = '/proxy.php';
 var ttss_refresh = 20000; // 20 seconds
 
+var page_title_pattern = 'TTSS Krak\u00F3w - $ - Real-time tram departures';
+var page_title = document.getElementsByTagName('title')[0];
+
 var stop_id;
 var stop_name = document.getElementById('stop-name');
 var stop_name_form = stop_name.form;
@@ -270,6 +273,7 @@
 			+ '&mode=departure'
 	).done(function(data) {
 		setText(times_stop_name, data.stopName);
+		setText(page_title, page_title_pattern.replace('$', data.stopName));
 		deleteChildren(times_alerts);
 		deleteChildren(times_table);
 		deleteChildren(times_lines);

--
Gitblit v1.9.1