Mercurial > hg > Members > nobuyasu > Consensus
changeset 129:21e746cdc99e draft
modified viewer.html
author | Nobuyasu Oshiro <dimolto@cr.ie.u-ryukyu.ac.jp> |
---|---|
date | Wed, 24 Apr 2013 04:14:52 +0900 |
parents | c03c7198ec67 |
children | 7052135c036c |
files | public/viewer/revisionviewer.html public/viewer/viewer.html public/viewer/viewerLib.js |
diffstat | 3 files changed, 11 insertions(+), 2 deletions(-) [+] |
line wrap: on
line diff
--- a/public/viewer/revisionviewer.html Wed Apr 24 03:01:05 2013 +0900 +++ b/public/viewer/revisionviewer.html Wed Apr 24 04:14:52 2013 +0900 @@ -91,12 +91,14 @@ $(function(){ userName=localStorage.userName; if(userName)start(); - else $("#loginPopup").css("display","block"); + else displayBlock(); }) + function login(uname){ userName=localStorage.userName=uname; start(); } + function start(){ init(); var consensus_id=(location.search.match("[0-9]+")||[])[0];
--- a/public/viewer/viewer.html Wed Apr 24 03:01:05 2013 +0900 +++ b/public/viewer/viewer.html Wed Apr 24 04:14:52 2013 +0900 @@ -37,13 +37,14 @@ $(function(){ userName=localStorage.userName; if(userName)start(); - else $("#loginPopup").css("display","block"); + else displayBlock(); }) function login(uname){ userName=localStorage.userName=uname; start(); } + function start(){ $.ajax({ url:BASE_URL+"/users/create/"+userName, @@ -52,6 +53,8 @@ error:function(o){console.log(o)} }); init(); + var consensus_id=(location.search.match("[0-9]+")||[])[0]; + setInterval(function(){loadUserList();loadConsensus(consensus_id)},LOAD_INTERVAL*1000); }
--- a/public/viewer/viewerLib.js Wed Apr 24 03:01:05 2013 +0900 +++ b/public/viewer/viewerLib.js Wed Apr 24 04:14:52 2013 +0900 @@ -48,6 +48,10 @@ } } +function displayBlock() { + $("#loginPopup").css("display","block"); +} + function updateToNew(json){ var t2=createJSONTreeInfo(json) updateJSONTreeDiff(treeInfo.root,t2.root);