From e747830167e22d97ea34969fab3cfe1c71c35f75 Mon Sep 17 00:00:00 2001 From: Steve Manuel Date: Sun, 30 Oct 2016 23:38:11 -0700 Subject: pulling getParam into utils file --- system/admin/static/common/js/util.js | 16 ++++++++++++++++ 1 file changed, 16 insertions(+) (limited to 'system/admin/static/common/js/util.js') diff --git a/system/admin/static/common/js/util.js b/system/admin/static/common/js/util.js index 7f4c8ab..8d5e74b 100644 --- a/system/admin/static/common/js/util.js +++ b/system/admin/static/common/js/util.js @@ -67,4 +67,20 @@ function getPartialDate(unix) { d.dd = day; return d; +} + +// Returns a part of the window URL 'search' string +function getParam(param) { + var qs = window.location.search.substring(1); + var qp = qs.split('&'); + var t = ''; + + for (var i = 0; i < qp.length; i++) { + var p = qp[i].split('=') + if (p[0] === param) { + t = p[1]; + } + } + + return t; } \ No newline at end of file -- cgit v1.2.3