diff options
| -rw-r--r-- | ws2a/bugview.html | 9 | ||||
| -rw-r--r-- | ws2a/bugview.js | 22 |
2 files changed, 26 insertions, 5 deletions
diff --git a/ws2a/bugview.html b/ws2a/bugview.html index 8e64517..9a9ef61 100644 --- a/ws2a/bugview.html +++ b/ws2a/bugview.html @@ -49,12 +49,15 @@ Submitter:<id id="submitter">Loading...</id> </div> <div class="col-sm-4"> - Date submited:<id id="date">Loading...</id></div> - <div class="col-sm-4">Status:<id id="status">Loading...</id></div> + Date submited:<id id="date">Loading...</id> + </div> + <div class="col-sm-4"> + Status:<id id="status">Loading...</id> + </div> </div> </div> - <div class="panel-body">Long description</div> + <div class="panel-body" id="longdesc">Long description</div> <div id="Comments"> </div> diff --git a/ws2a/bugview.js b/ws2a/bugview.js index 4c8b007..2f9740f 100644 --- a/ws2a/bugview.js +++ b/ws2a/bugview.js @@ -1,11 +1,29 @@ +function getQueryStrings() { + var assoc = {}; + var decode = function (s) { return decodeURIComponent(s.replace(/\+/g, " ")); }; + var queryString = location.search.substring(1); + var keyValues = queryString.split('&'); + + for(var i in keyValues) { + var key = keyValues[i].split('='); + if (key.length > 1) { + assoc[decode(key[0])] = decode(key[1]); + } + } + + return assoc; +} + function loadLastBugs() { var xhttp = new XMLHttpRequest(); xhttp.onreadystatechange = function() { if (xhttp.readyState == 4 && xhttp.status == 200) { - document.getElementById("bugstable").innerHTML = xhttp.responseText; + document.getElementById("longdesc").innerHTML = xhttp.responseText; } }; - xhttp.open("GET", "/cgi-bin/bugsdata.cgi", true); + var query = getQueryStrings(); + var bugnum = qs["id"]; + xhttp.open("GET", "/cgi-bin/showbug.cgi?id="+bugnum, true); xhttp.send(); } window.onload = loadLastBugs |
