From 3ea790fbdef1979577e4680144014ae5ae1911ab Mon Sep 17 00:00:00 2001 From: Paul Van Eck Date: Mon, 19 Jan 2015 13:23:38 -0800 Subject: [PATCH] Add GET test results and add report page output A GET handler was added for retrieving test results with URL of the form: /v1/results/{test_id}. The report page can now be used to view results. It should be accessed with URL of the form: /output.html?test_id={test_id}. This is just to keep it simple for now. Change-Id: I28e9ebf74cc7a6dad360232840b49c6aae27dab0 --- js/helpers.js | 12 ++++++++++++ 1 file changed, 12 insertions(+) diff --git a/js/helpers.js b/js/helpers.js index f95a5b1f..23dbd872 100644 --- a/js/helpers.js +++ b/js/helpers.js @@ -29,6 +29,18 @@ var capitaliseFirstLetter = function (string) { return string.charAt(0).toUpperCase() + string.slice(1); }; +// Get the value of a GET variable in the URL. +var getUrlParam = function(variable) { + var searchString = window.location.search.substring(1); + var searchVariables = searchString.split('&'); + for (var i = 0; i < searchVariables.length; i++) { + var getVar = searchVariables[i].split('='); + if (getVar[0] == variable) { + return getVar[1]; + } + } +} + // Function searches for test with specified test_id on github and opens result in new window var get_code_url = function (test_id) { var id = test_id.split('/').join('.'),