-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathIndex.html
58 lines (49 loc) · 2.13 KB
/
Index.html
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
<!DOCTYPE html>
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<title>HIW JS API Tests</title>
<link type="text/css" rel="stylesheet" href="Content/Styles/qunit.css"/>
</head>
<body>
<fieldset>
<legend>Test Parameters</legend>
<label for="apiKey">API Key:</label>
<input id="apiKey" type="text" />
<label for="baseURL">Base URL:</label>
<input id="baseURL" type="text" />
<button id="run" type="button">Run Tests</button>
</fieldset>
<div id="qunit"></div>
<div id="qunit-fixture"></div>
<script type="text/javascript" src="Content/Scripts/jquery.min.js"></script>
<script type="text/javascript" src="Content/Scripts/qunit.js"></script>
<script type="text/javascript" src="Content/Scripts/API/Output/hiw-api.js"></script>
<script type="text/javascript" src="Content/Scripts/API/Output/hiw-api-test.js"></script>
<script type="text/javascript">
var apiKey_Key = "apiKey";
var baseURL_Key = "baseURL";
$(document).ready(function () {
getParameters();
$("#apiKey").change(function () { setParameter(apiKey_Key, $(this).val()); });
$("#baseURL").change(function () { setParameter(baseURL_Key, $(this).val()); });
$("#run").click(function () {
hiw.test.run($("#apiKey").val(), $("#baseURL").val());
});
});
function getParameters() {
var apiKey = null;
var baseURL = null;
if (typeof (Storage) !== "undefined") {
apiKey = localStorage.getItem(apiKey_Key);
baseURL = localStorage.getItem(baseURL_Key);
}
$("#apiKey").val(apiKey);
$("#baseURL").val(baseURL || hiw.API.DefaultBaseURL);
}
function setParameter(key, value) {
if (typeof (Storage) !== "undefined")
localStorage.setItem(key, value);
}
</script>
</body>
</html>