From c7daa6aa40a79ad36dc7baf16e138aff467c6aa0 Mon Sep 17 00:00:00 2001 From: Robert Kaiser Date: Fri, 10 Nov 2017 21:27:46 +0100 Subject: [PATCH] move getParameterByName() into loginwindow JS --- js/loginwindow.js | 8 ++++++++ js/ui.js | 8 -------- 2 files changed, 8 insertions(+), 8 deletions(-) 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, " ")); -} -- 2.43.0