move getParameterByName() into loginwindow JS
authorRobert Kaiser <kairo@kairo.at>
Fri, 10 Nov 2017 20:27:46 +0000 (21:27 +0100)
committerRobert Kaiser <kairo@kairo.at>
Fri, 10 Nov 2017 20:27:46 +0000 (21:27 +0100)
js/loginwindow.js
js/ui.js

index ebbdde4f7f840a088e74c9fbd0f0def0faa12b2b..cd8d7653ebb51d72cd5ccbb7c3051b807e0388bb 100644 (file)
@@ -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, " "));
+}
index 7526763ee78e184c467375382ee02881a5dd1e3f..1a0e23e94bc711caaf3defb5914f6a0681440b84 100644 (file)
--- 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, " "));
-}