This repository was archived by the owner on Jul 1, 2025. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathresultSubjComps.html
More file actions
83 lines (76 loc) · 2.96 KB
/
resultSubjComps.html
File metadata and controls
83 lines (76 loc) · 2.96 KB
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
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
<html>
<head>
<link rel="stylesheet" type="text/css" href="default.css" />
<script src="https://ajax.googleapis.com/ajax/libs/jquery/1.12.0/jquery.min.js"></script>
<script>
var queryString = window.location.href.slice(window.location.href.indexOf('?') + 1);
$.getScript("library/tableBuilder.js");
$(document).ready(function() {
if(getUrlParameter('pdf')) {
$('.loader').fadeOut("fast");
var newUrl = getUrlParameter("target") + ".php?" + queryString;
window.location.href = newUrl;
} else {
$.ajax({
url: getUrlParameter("target") + ".php?" + queryString, //'/tests/sample2',
dataType: 'json',
error: function () {
$('.loader').fadeOut("fast");
if (!getUrlParameter("target")) {
$("#title").append("<H2>Bad Request, target must be specified</H2>");
} else {
timeout();
}
},
success: function (data, textStatus, jqXHR) {
// since we are using jQuery, you don't need to parse response
if (data.error) {
errorPage(data);
} else {
addTitle();
drawTable(data);
}
$('.loader').fadeOut("slow");
},
timeout: 30000 // sets timeout to 10 seconds
});
}
});
function timeout(){
$("#title").append("<H2>Timeout occurred searching for comps. Please try again.</H2>");
}
function getUrlParameter(param){
var params = queryString.split('&');
for( var i =0; i < params.length; i++){
var currParam = params[i].split('=');
if(currParam[0] === param){
return currParam[1];
}
}
}
function removeMe(propId) {
var params = queryString.split('&');
var found = false;
var newQueryString = '';
for( var i =0; i < params.length; i++){
var currParam = params[i].split('=');
if(currParam[0] === 'exclude'){
currParam[1] = currParam[1] + '_' + propId;
found = true
}
newQueryString = newQueryString + currParam.join('=') + "&";
}
if(!found){
newQueryString = params.join("&") + '&exclude=' + propId;
}
var newUrl = "resultSubjComps.html?"+ newQueryString;
window.location.href = newUrl;
}
</script>
</head>
<body>
<div class="loader"></div>
<h2><div id="title"/></h2>
<div id="main">
</body>
</html>