From a44409477969aaa1f762b84e1085a634288478a2 Mon Sep 17 00:00:00 2001 From: Manuel Friedli Date: Sun, 7 Dec 2014 12:59:33 +0100 Subject: [PATCH 1/5] first version of URL parameters. l=language, t=theme. --- js/uhr.js | 24 ++++++++++++++++++++++++ 1 file changed, 24 insertions(+) diff --git a/js/uhr.js b/js/uhr.js index eb53a63..17690b2 100644 --- a/js/uhr.js +++ b/js/uhr.js @@ -130,9 +130,33 @@ this.timer = null; this.currentMinute = -1; var userTime = this.options.time; + var hash, params; if (this.options.time === undefined) { this.options.time = new Date(); } + // parse the URL params + hash = window.location.hash; + if (hash !== undefined && typeof hash === 'string' && hash.charAt(0) === '#') { + hash = hash.substring(1); + hash = decodeURIComponent(hash); + params = hash.split('&'); + params.forEach(function (element) { + var pair = element.split('='); + var key = pair[0]; + var value = pair[1]; + switch (key) { + case 'l': + this.options.language = value; + this.options.force = true; + break; + case 't': + this.options.theme = value; + this.options.force = true; + break; + } + }.bind(this)); + } + // end parse the URL params setupHTML.bind(this)(); wireFunctionality.bind(this)(); if (userTime !== undefined) { From f952690dd159f164d7ef09bdc2c5201bc86cc9c9 Mon Sep 17 00:00:00 2001 From: Manuel Friedli Date: Sun, 7 Dec 2014 13:03:34 +0100 Subject: [PATCH 2/5] added parameters for mode and status --- js/uhr.js | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/js/uhr.js b/js/uhr.js index 17690b2..0eaf5a7 100644 --- a/js/uhr.js +++ b/js/uhr.js @@ -153,6 +153,14 @@ this.options.theme = value; this.options.force = true; break; + case 'm': + this.options.mode = value; + this.options.force = true; + break; + case 's': + this.options.status = value; + this.options.force = true; + break; } }.bind(this)); } From 3b497435aec33c48a35211874101cbc3c9d5787a Mon Sep 17 00:00:00 2001 From: Manuel Friedli Date: Sun, 7 Dec 2014 23:45:33 +0100 Subject: [PATCH 3/5] support long named parameters --- js/uhr.js | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/js/uhr.js b/js/uhr.js index 0eaf5a7..c053ad5 100644 --- a/js/uhr.js +++ b/js/uhr.js @@ -146,18 +146,22 @@ var value = pair[1]; switch (key) { case 'l': + case 'language': this.options.language = value; this.options.force = true; break; case 't': + case 'theme': this.options.theme = value; this.options.force = true; break; case 'm': + case 'mode': this.options.mode = value; this.options.force = true; break; case 's': + case 'status': this.options.status = value; this.options.force = true; break; From b431a46dfb487f4d0bdc47624660cc75661a5e3c Mon Sep 17 00:00:00 2001 From: Manuel Friedli Date: Sun, 7 Dec 2014 23:48:48 +0100 Subject: [PATCH 4/5] updated version to 7.0 --- VERSION | 2 +- manifest.appcache | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/VERSION b/VERSION index bf99405..4fedf1d 100644 --- a/VERSION +++ b/VERSION @@ -1 +1 @@ -6.7-next +7.0 diff --git a/manifest.appcache b/manifest.appcache index bcb7cb0..e5a6912 100644 --- a/manifest.appcache +++ b/manifest.appcache @@ -1,5 +1,5 @@ CACHE MANIFEST -# 6.7-next +# 7.0 css/uhr.css css/uhr-black.css From 589751be5fb9f27d502e7ffc3da5f4d6c7188fd2 Mon Sep 17 00:00:00 2001 From: Manuel Friedli Date: Sun, 7 Dec 2014 23:50:39 +0100 Subject: [PATCH 5/5] increased version to next development cycle --- VERSION | 2 +- manifest.appcache | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/VERSION b/VERSION index 4fedf1d..cc9b20e 100644 --- a/VERSION +++ b/VERSION @@ -1 +1 @@ -7.0 +7.0-next diff --git a/manifest.appcache b/manifest.appcache index e5a6912..069b0ba 100644 --- a/manifest.appcache +++ b/manifest.appcache @@ -1,5 +1,5 @@ CACHE MANIFEST -# 7.0 +# 7.0-next css/uhr.css css/uhr-black.css