diff options
author | Anton Luka Šijanec <sijanecantonluka@gmail.com> | 2020-02-08 22:46:08 +0100 |
---|---|---|
committer | Anton Luka Šijanec <sijanecantonluka@gmail.com> | 2020-02-08 22:46:08 +0100 |
commit | 7a294b9add248992f1d35c6d451ed16c215cdbb6 (patch) | |
tree | e146242f379a13c579d3856a5786a11cf04d1675 /js | |
parent | always check if it works before commiting (diff) | |
download | beziapp-7a294b9add248992f1d35c6d451ed16c215cdbb6.tar beziapp-7a294b9add248992f1d35c6d451ed16c215cdbb6.tar.gz beziapp-7a294b9add248992f1d35c6d451ed16c215cdbb6.tar.bz2 beziapp-7a294b9add248992f1d35c6d451ed16c215cdbb6.tar.lz beziapp-7a294b9add248992f1d35c6d451ed16c215cdbb6.tar.xz beziapp-7a294b9add248992f1d35c6d451ed16c215cdbb6.tar.zst beziapp-7a294b9add248992f1d35c6d451ed16c215cdbb6.zip |
Diffstat (limited to 'js')
-rw-r--r-- | js/initialize.js | 18 |
1 files changed, 17 insertions, 1 deletions
diff --git a/js/initialize.js b/js/initialize.js index 39ed505..2023921 100644 --- a/js/initialize.js +++ b/js/initialize.js @@ -1,3 +1,15 @@ +function getUrlParameter(sParam) { + var sPageURL = window.location.search.substring(1), + sURLVariables = sPageURL.split('&'), + sParameterName, + i; + for (i = 0; i < sURLVariables.length; i++) { + sParameterName = sURLVariables[i].split('='); + if (sParameterName[0] === sParam) { + return sParameterName[1] === undefined ? true : decodeURIComponent(sParameterName[1]); + } + } +}; function setupStorage() { promises_to_run = [ localforage.setItem("logged_in", false), @@ -28,7 +40,11 @@ localforage.getItem("logged_in") } else if (value === false) { window.location.replace("/login.html"); } else { - window.location.replace("/pages/timetable.html"); + if(getUrlParameter("m")) { + window.location.replace("pages/messaging.html?"+getUrlParameter("m")); + } else { + window.location.replace("/pages/timetable.html"); + } } } ).catch( |