Mercurial > hg > Members > nobuyasu > Consensus
changeset 88:75d45f808217 draft
modified revisionviewer.html
author | one |
---|---|
date | Mon, 11 Mar 2013 06:29:12 +0900 |
parents | a067d8d6458e |
children | 70b0137e590e |
files | public/viewer/revisionviewer.html public/viewer/viewer.html |
diffstat | 2 files changed, 21 insertions(+), 15 deletions(-) [+] |
line wrap: on
line diff
--- a/public/viewer/revisionviewer.html Mon Mar 11 05:44:46 2013 +0900 +++ b/public/viewer/revisionviewer.html Mon Mar 11 06:29:12 2013 +0900 @@ -62,6 +62,24 @@ }); } +function loadRevisionInfo(consensus_id) { + $.ajax({ + url:BASE_URL+"/claims/get/revision/"+consensus_id, + success:function(o){createOptionTag(consensus_id, o); console.log("revision = "+ o)}, + type:"GET",cache:false, + error:function(o){console.log("ERROR",o)} + }); +} + +function createOptionTag(consensus_id, revisionInfo) { + var selectArray = new Array(); + selectArray.push("<select>"); + for (var i=0; i<revisionInfo.length; i++) { + selectArray.push("<option>"+revisionInfo[i]+"</option>"); + } + selectArray.push("</select>"); + $('#revisionId')[0].innerHTML = "revision:"+selectArray.join(); +} $(function(){ userName=localStorage.userName; @@ -73,13 +91,6 @@ start(); } function start(){ - $.ajax({ - url:BASE_URL+"/users/create/"+userName, - success:function(o){/*console.log(o)*/}, - type:"PUT",cache:false, - error:function(o){console.log(o)} - }); - popupInit(); jsPlumb.importDefaults({ Connector : [ "Straight", { curviness:50 } ], @@ -90,7 +101,8 @@ var consensus_id=(location.search.match("[0-9]+")||[])[0]; if(consensus_id){ root_id=consensus_id; - loadUserList() + loadUserList(); + loadRevisionInfo(consensus_id); loadConsensus(consensus_id); setInterval(function(){loadUserList();loadConsensus(consensus_id)},LOAD_INTERVAL*1000); }else{ @@ -460,12 +472,7 @@ <div class='header'> <nobr id='header_title'><a href='index.html'>Home</a><span id='headertitle_main' style='margin-left:40px;'>loading</span></nobr> </div> -<div class="revision"> - revision: - <select id="revisionselect" name="revision" onchange="console.log(this.value)"> - <option>9</option> - <option>94</option> - </select> +<div class="revision" id="revisionId"> </div> <div style="position:relative;left:0;top:0;" id='treeMain'>