From: Robert Kaiser Date: Fri, 10 Nov 2017 20:27:46 +0000 (+0100) Subject: move getParameterByName() into loginwindow JS X-Git-Tag: production~22^2~1 X-Git-Url: https://git-public.kairo.at/?a=commitdiff_plain;h=c7daa6aa40a79ad36dc7baf16e138aff467c6aa0;p=lantea.git move getParameterByName() into loginwindow JS --- diff --git a/js/loginwindow.js b/js/loginwindow.js index ebbdde4..cd8d765 100644 --- a/js/loginwindow.js +++ b/js/loginwindow.js @@ -17,3 +17,11 @@ window.onload = function() { document.getElementById("logininfo").textContent = "You have called this document outside of the login flow, which is not supported."; } } + +function getParameterByName(aName) { + // from http://stackoverflow.com/questions/901115/how-can-i-get-query-string-values-in-javascript + name = aName.replace(/[\[]/, "\\[").replace(/[\]]/, "\\]"); + var regex = new RegExp("[\\?&]" + name + "=([^&#]*)"), + results = regex.exec(location.search); + return results === null ? "" : decodeURIComponent(results[1].replace(/\+/g, " ")); +} diff --git a/js/ui.js b/js/ui.js index 7526763..1a0e23e 100644 --- a/js/ui.js +++ b/js/ui.js @@ -704,11 +704,3 @@ function fetchBackend(aEndpoint, aMethod, aSendData, aCallback, aCallbackForward aCallback(e, 500, aCallbackForwards); } } - -function getParameterByName(aName) { - // from http://stackoverflow.com/questions/901115/how-can-i-get-query-string-values-in-javascript - name = aName.replace(/[\[]/, "\\[").replace(/[\]]/, "\\]"); - var regex = new RegExp("[\\?&]" + name + "=([^&#]*)"), - results = regex.exec(location.search); - return results === null ? "" : decodeURIComponent(results[1].replace(/\+/g, " ")); -}