annotate public/viewer/viewer.html @ 53:a405991e39d8

modified ClaiMode/computeUnaimously method
author one
date Thu, 04 Oct 2012 18:01:16 +0900
parents a76259e2ca9f
children 2f6b0b1bd03b
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
rev   line source
51
a76259e2ca9f add public/viewer
one
parents:
diff changeset
1 <meta http-equiv="content-type" content="text/html;charset=utf-8" />
53
a405991e39d8 modified ClaiMode/computeUnaimously method
one
parents: 51
diff changeset
2 <title>R-Consensus</title>
51
a76259e2ca9f add public/viewer
one
parents:
diff changeset
3 <link rel='stylesheet' href="form.css">
a76259e2ca9f add public/viewer
one
parents:
diff changeset
4 <script src='form.js'></script>
a76259e2ca9f add public/viewer
one
parents:
diff changeset
5 <script type="text/javascript" src="js/lib/jquery-1.8.1-min.js"></script>
a76259e2ca9f add public/viewer
one
parents:
diff changeset
6 <script type="text/javascript" src="js/lib/jquery-ui-1.8.23-min.js"></script>
a76259e2ca9f add public/viewer
one
parents:
diff changeset
7 <script type="text/javascript" src="js/lib/jquery.ui.touch-punch.min.js"></script>
a76259e2ca9f add public/viewer
one
parents:
diff changeset
8 <script type="text/javascript" src="js/lib/jsBezier-0.4-min.js"></script>
a76259e2ca9f add public/viewer
one
parents:
diff changeset
9 <script type="text/javascript" src="js/1.3.15/jsPlumb-util-1.3.15-RC1.js"></script>
a76259e2ca9f add public/viewer
one
parents:
diff changeset
10 <script type="text/javascript" src="js/1.3.15/jsPlumb-dom-adapter-1.3.15-RC1.js"></script>
a76259e2ca9f add public/viewer
one
parents:
diff changeset
11 <script type="text/javascript" src="js/1.3.15/jsPlumb-1.3.15-RC1.js"></script>
a76259e2ca9f add public/viewer
one
parents:
diff changeset
12 <script type="text/javascript" src="js/1.3.15/jsPlumb-defaults-1.3.15-RC1.js"></script>
a76259e2ca9f add public/viewer
one
parents:
diff changeset
13 <script type="text/javascript" src="js/1.3.15/jsPlumb-renderers-svg-1.3.15-RC1.js"></script>
a76259e2ca9f add public/viewer
one
parents:
diff changeset
14 <script type="text/javascript" src="js/1.3.15/jsPlumb-renderers-canvas-1.3.15-RC1.js"></script>
a76259e2ca9f add public/viewer
one
parents:
diff changeset
15 <script type="text/javascript" src="js/1.3.15/jsPlumb-renderers-vml-1.3.15-RC1.js"></script>
a76259e2ca9f add public/viewer
one
parents:
diff changeset
16 <script type="text/javascript" src="js/1.3.15/jquery.jsPlumb-1.3.15-RC1.js"></script>
a76259e2ca9f add public/viewer
one
parents:
diff changeset
17 <script type="text/javascript" src='treeArrangement.js'></script>
a76259e2ca9f add public/viewer
one
parents:
diff changeset
18 <script type="text/javascript">
a76259e2ca9f add public/viewer
one
parents:
diff changeset
19 var LOAD_INTERVAL=5;
a76259e2ca9f add public/viewer
one
parents:
diff changeset
20 var BASE_URL="";
a76259e2ca9f add public/viewer
one
parents:
diff changeset
21 if(!Array.prototype.filter){
a76259e2ca9f add public/viewer
one
parents:
diff changeset
22 Array.prototype.filter=function(func){
a76259e2ca9f add public/viewer
one
parents:
diff changeset
23 var arr=[];
a76259e2ca9f add public/viewer
one
parents:
diff changeset
24 for(var i=0;i<this.length;i++)if(func(this[i]))arr.push(this[i]);
a76259e2ca9f add public/viewer
one
parents:
diff changeset
25 return arr;
a76259e2ca9f add public/viewer
one
parents:
diff changeset
26 }
a76259e2ca9f add public/viewer
one
parents:
diff changeset
27 }
a76259e2ca9f add public/viewer
one
parents:
diff changeset
28
53
a405991e39d8 modified ClaiMode/computeUnaimously method
one
parents: 51
diff changeset
29 var userName;
a405991e39d8 modified ClaiMode/computeUnaimously method
one
parents: 51
diff changeset
30
51
a76259e2ca9f add public/viewer
one
parents:
diff changeset
31 var treeInfo;
a76259e2ca9f add public/viewer
one
parents:
diff changeset
32 var userList=[];
a76259e2ca9f add public/viewer
one
parents:
diff changeset
33 var root_id;
a76259e2ca9f add public/viewer
one
parents:
diff changeset
34 function loadConsensus(id){
a76259e2ca9f add public/viewer
one
parents:
diff changeset
35 function onload(json){
53
a405991e39d8 modified ClaiMode/computeUnaimously method
one
parents: 51
diff changeset
36 document.title="R-Consensus : "+json.toulmin.title;
51
a76259e2ca9f add public/viewer
one
parents:
diff changeset
37 $("#header_title").text("R-Consensus : "+json.toulmin.title)
a76259e2ca9f add public/viewer
one
parents:
diff changeset
38 if(treeInfo){
a76259e2ca9f add public/viewer
one
parents:
diff changeset
39 updateToNew(json);
a76259e2ca9f add public/viewer
one
parents:
diff changeset
40 }else{
a76259e2ca9f add public/viewer
one
parents:
diff changeset
41 console.log(JSON.parse(JSON.stringify(json)));
a76259e2ca9f add public/viewer
one
parents:
diff changeset
42 treeInfo=createJSONTreeInfo(json)
a76259e2ca9f add public/viewer
one
parents:
diff changeset
43 //userList=getUserListFromJSONTree(treeInfo.root);
a76259e2ca9f add public/viewer
one
parents:
diff changeset
44 showUserList([]);
a76259e2ca9f add public/viewer
one
parents:
diff changeset
45 updateNode(treeInfo.root);
a76259e2ca9f add public/viewer
one
parents:
diff changeset
46 updateTree();
a76259e2ca9f add public/viewer
one
parents:
diff changeset
47 }
a76259e2ca9f add public/viewer
one
parents:
diff changeset
48 }
a76259e2ca9f add public/viewer
one
parents:
diff changeset
49 $.ajax({
a76259e2ca9f add public/viewer
one
parents:
diff changeset
50 url:BASE_URL+"/consensus/browse/"+id,
a76259e2ca9f add public/viewer
one
parents:
diff changeset
51 success:function(o){onload(o)},
a76259e2ca9f add public/viewer
one
parents:
diff changeset
52 type:"GET",cache:false,
a76259e2ca9f add public/viewer
one
parents:
diff changeset
53 error:function(o){console.log("ERROR",o)}
a76259e2ca9f add public/viewer
one
parents:
diff changeset
54 });
a76259e2ca9f add public/viewer
one
parents:
diff changeset
55 }
a76259e2ca9f add public/viewer
one
parents:
diff changeset
56 function loadUserList(){
a76259e2ca9f add public/viewer
one
parents:
diff changeset
57 $.ajax({
a76259e2ca9f add public/viewer
one
parents:
diff changeset
58 url:BASE_URL+"/users/all",
53
a405991e39d8 modified ClaiMode/computeUnaimously method
one
parents: 51
diff changeset
59 success:function(o){userList=o.sort();showUserList([]);},
51
a76259e2ca9f add public/viewer
one
parents:
diff changeset
60 type:"GET",cache:false,
a76259e2ca9f add public/viewer
one
parents:
diff changeset
61 error:function(o){console.log("ERROR",o)}
a76259e2ca9f add public/viewer
one
parents:
diff changeset
62 });
a76259e2ca9f add public/viewer
one
parents:
diff changeset
63 }
a76259e2ca9f add public/viewer
one
parents:
diff changeset
64
a76259e2ca9f add public/viewer
one
parents:
diff changeset
65
a76259e2ca9f add public/viewer
one
parents:
diff changeset
66 $(function(){
53
a405991e39d8 modified ClaiMode/computeUnaimously method
one
parents: 51
diff changeset
67 userName=localStorage.userName;
a405991e39d8 modified ClaiMode/computeUnaimously method
one
parents: 51
diff changeset
68 if(userName)start();
a405991e39d8 modified ClaiMode/computeUnaimously method
one
parents: 51
diff changeset
69 else $("#loginPopup").css("display","block");
a405991e39d8 modified ClaiMode/computeUnaimously method
one
parents: 51
diff changeset
70 })
a405991e39d8 modified ClaiMode/computeUnaimously method
one
parents: 51
diff changeset
71 function login(uname){
a405991e39d8 modified ClaiMode/computeUnaimously method
one
parents: 51
diff changeset
72 userName=localStorage.userName=uname;
a405991e39d8 modified ClaiMode/computeUnaimously method
one
parents: 51
diff changeset
73 start();
a405991e39d8 modified ClaiMode/computeUnaimously method
one
parents: 51
diff changeset
74 }
a405991e39d8 modified ClaiMode/computeUnaimously method
one
parents: 51
diff changeset
75 function start(){
a405991e39d8 modified ClaiMode/computeUnaimously method
one
parents: 51
diff changeset
76 $.ajax({
a405991e39d8 modified ClaiMode/computeUnaimously method
one
parents: 51
diff changeset
77 url:BASE_URL+"/users/create/"+userName,
a405991e39d8 modified ClaiMode/computeUnaimously method
one
parents: 51
diff changeset
78 success:function(o){console.log(o)},
a405991e39d8 modified ClaiMode/computeUnaimously method
one
parents: 51
diff changeset
79 type:"PUT",cache:false,
a405991e39d8 modified ClaiMode/computeUnaimously method
one
parents: 51
diff changeset
80 error:function(o){console.log(o)}
a405991e39d8 modified ClaiMode/computeUnaimously method
one
parents: 51
diff changeset
81 });
a405991e39d8 modified ClaiMode/computeUnaimously method
one
parents: 51
diff changeset
82
51
a76259e2ca9f add public/viewer
one
parents:
diff changeset
83 popupInit();
a76259e2ca9f add public/viewer
one
parents:
diff changeset
84 jsPlumb.importDefaults({
a76259e2ca9f add public/viewer
one
parents:
diff changeset
85 Connector : [ "Straight", { curviness:50 } ],
a76259e2ca9f add public/viewer
one
parents:
diff changeset
86 PaintStyle : { strokeStyle:"gray", lineWidth:2 },
a76259e2ca9f add public/viewer
one
parents:
diff changeset
87 EndpointStyle : {},
a76259e2ca9f add public/viewer
one
parents:
diff changeset
88 Anchors: ["BottomCenter","TopCenter"]
a76259e2ca9f add public/viewer
one
parents:
diff changeset
89 });
a76259e2ca9f add public/viewer
one
parents:
diff changeset
90 var consensus_id=(location.search.match("[0-9]+")||[])[0];
a76259e2ca9f add public/viewer
one
parents:
diff changeset
91 if(consensus_id){
a76259e2ca9f add public/viewer
one
parents:
diff changeset
92 root_id=consensus_id;
a76259e2ca9f add public/viewer
one
parents:
diff changeset
93 loadUserList()
a76259e2ca9f add public/viewer
one
parents:
diff changeset
94 loadConsensus(consensus_id);
a76259e2ca9f add public/viewer
one
parents:
diff changeset
95 setInterval(function(){loadUserList();loadConsensus(consensus_id)},LOAD_INTERVAL*1000);
a76259e2ca9f add public/viewer
one
parents:
diff changeset
96 }else{
a76259e2ca9f add public/viewer
one
parents:
diff changeset
97 document.body.innerHTML="<div style='color:white;font-size:64px'>No ClaimID Specified.<br><a href='index.html' style='color:#88f'>back</a></div>";
a76259e2ca9f add public/viewer
one
parents:
diff changeset
98 }
53
a405991e39d8 modified ClaiMode/computeUnaimously method
one
parents: 51
diff changeset
99 }
51
a76259e2ca9f add public/viewer
one
parents:
diff changeset
100
a76259e2ca9f add public/viewer
one
parents:
diff changeset
101 function updateToNew(json){
a76259e2ca9f add public/viewer
one
parents:
diff changeset
102 var t2=createJSONTreeInfo(json)
a76259e2ca9f add public/viewer
one
parents:
diff changeset
103 updateJSONTreeDiff(treeInfo.root,t2.root);
a76259e2ca9f add public/viewer
one
parents:
diff changeset
104
a76259e2ca9f add public/viewer
one
parents:
diff changeset
105 updateNode(treeInfo.root);
a76259e2ca9f add public/viewer
one
parents:
diff changeset
106 treeInfo.newLayout=t2.layout;
a76259e2ca9f add public/viewer
one
parents:
diff changeset
107 var cnt=0,time=500;
a76259e2ca9f add public/viewer
one
parents:
diff changeset
108 var time0=new Date();
a76259e2ca9f add public/viewer
one
parents:
diff changeset
109 var prevCnt=0;
a76259e2ca9f add public/viewer
one
parents:
diff changeset
110 function tfunc(t){return 2*t-t*t}
a76259e2ca9f add public/viewer
one
parents:
diff changeset
111 function animation(){
a76259e2ca9f add public/viewer
one
parents:
diff changeset
112 var cnt=(new Date()-time0)/time;
a76259e2ca9f add public/viewer
one
parents:
diff changeset
113 if(cnt<1){
a76259e2ca9f add public/viewer
one
parents:
diff changeset
114 if(prevCnt!=cnt){
a76259e2ca9f add public/viewer
one
parents:
diff changeset
115 var pt=tfunc(prevCnt);
a76259e2ca9f add public/viewer
one
parents:
diff changeset
116 var t=tfunc(cnt);
a76259e2ca9f add public/viewer
one
parents:
diff changeset
117 animateTree((t-1)/(pt-t));
a76259e2ca9f add public/viewer
one
parents:
diff changeset
118 prevCnt=cnt;
a76259e2ca9f add public/viewer
one
parents:
diff changeset
119
a76259e2ca9f add public/viewer
one
parents:
diff changeset
120 }
a76259e2ca9f add public/viewer
one
parents:
diff changeset
121 setTimeout(animation,10);
a76259e2ca9f add public/viewer
one
parents:
diff changeset
122 }else{
a76259e2ca9f add public/viewer
one
parents:
diff changeset
123 animateTree(0);
a76259e2ca9f add public/viewer
one
parents:
diff changeset
124 }
a76259e2ca9f add public/viewer
one
parents:
diff changeset
125 updateNode(treeInfo.root);
a76259e2ca9f add public/viewer
one
parents:
diff changeset
126 updateTree();
a76259e2ca9f add public/viewer
one
parents:
diff changeset
127 }
a76259e2ca9f add public/viewer
one
parents:
diff changeset
128 animation();
a76259e2ca9f add public/viewer
one
parents:
diff changeset
129 }
a76259e2ca9f add public/viewer
one
parents:
diff changeset
130
a76259e2ca9f add public/viewer
one
parents:
diff changeset
131 var ViewParam={
a76259e2ca9f add public/viewer
one
parents:
diff changeset
132 offsetTop:100,
a76259e2ca9f add public/viewer
one
parents:
diff changeset
133 offsetBottom:100,
a76259e2ca9f add public/viewer
one
parents:
diff changeset
134 offsetLeft:100,
a76259e2ca9f add public/viewer
one
parents:
diff changeset
135 offsetRight:100,
a76259e2ca9f add public/viewer
one
parents:
diff changeset
136 nodeWidth:120,
a76259e2ca9f add public/viewer
one
parents:
diff changeset
137 nodeHeight:60,
a76259e2ca9f add public/viewer
one
parents:
diff changeset
138 intervalX:140,
a76259e2ca9f add public/viewer
one
parents:
diff changeset
139 intervalY:120
a76259e2ca9f add public/viewer
one
parents:
diff changeset
140 };
a76259e2ca9f add public/viewer
one
parents:
diff changeset
141
a76259e2ca9f add public/viewer
one
parents:
diff changeset
142 function animateTree(t){
a76259e2ca9f add public/viewer
one
parents:
diff changeset
143 function animateNodePosition(node,t){
a76259e2ca9f add public/viewer
one
parents:
diff changeset
144 node.position.x=(node.position.x*t+node.newPosition.x)/(1+t);
a76259e2ca9f add public/viewer
one
parents:
diff changeset
145 node.position.y=(node.position.y*t+node.newPosition.y)/(1+t);
a76259e2ca9f add public/viewer
one
parents:
diff changeset
146 for(var i=0;i<node.mentions.length;i++){
a76259e2ca9f add public/viewer
one
parents:
diff changeset
147 animateNodePosition(node.mentions[i],t);
a76259e2ca9f add public/viewer
one
parents:
diff changeset
148 }
a76259e2ca9f add public/viewer
one
parents:
diff changeset
149 if(t==0){
a76259e2ca9f add public/viewer
one
parents:
diff changeset
150 if(node.newPosition.remove){
a76259e2ca9f add public/viewer
one
parents:
diff changeset
151 jsPlumb.removeAllEndpoints(node.view);
a76259e2ca9f add public/viewer
one
parents:
diff changeset
152 $(node.view).remove();
a76259e2ca9f add public/viewer
one
parents:
diff changeset
153 }
a76259e2ca9f add public/viewer
one
parents:
diff changeset
154 node.mentions=node.mentions.filter(function(n){return !n.newPosition.remove});
a76259e2ca9f add public/viewer
one
parents:
diff changeset
155 }
a76259e2ca9f add public/viewer
one
parents:
diff changeset
156 }
a76259e2ca9f add public/viewer
one
parents:
diff changeset
157 animateNodePosition(treeInfo.root,t);
a76259e2ca9f add public/viewer
one
parents:
diff changeset
158 treeInfo.layout.left=(treeInfo.layout.left*t+treeInfo.newLayout.left)/(1+t);
a76259e2ca9f add public/viewer
one
parents:
diff changeset
159 treeInfo.layout.right=(treeInfo.layout.right*t+treeInfo.newLayout.right)/(1+t);
a76259e2ca9f add public/viewer
one
parents:
diff changeset
160 treeInfo.layout.depth=(treeInfo.layout.depth*t+treeInfo.newLayout.depth)/(1+t);
a76259e2ca9f add public/viewer
one
parents:
diff changeset
161 }
a76259e2ca9f add public/viewer
one
parents:
diff changeset
162
a76259e2ca9f add public/viewer
one
parents:
diff changeset
163 function updateTree(){
a76259e2ca9f add public/viewer
one
parents:
diff changeset
164 with(treeInfo.layout){
a76259e2ca9f add public/viewer
one
parents:
diff changeset
165 $("#treeRoot").css({
a76259e2ca9f add public/viewer
one
parents:
diff changeset
166 left:ViewParam.offsetLeft+ViewParam.nodeWidth/2-ViewParam.intervalX*left,
a76259e2ca9f add public/viewer
one
parents:
diff changeset
167 top:ViewParam.offsetTop+ViewParam.nodeHeight/2});
a76259e2ca9f add public/viewer
one
parents:
diff changeset
168 $("#treeMain").css({
a76259e2ca9f add public/viewer
one
parents:
diff changeset
169 width:ViewParam.intervalX*(right-left)+ViewParam.nodeWidth+ViewParam.offsetLeft+ViewParam.offsetRight,
a76259e2ca9f add public/viewer
one
parents:
diff changeset
170 height:ViewParam.intervalY*(depth-1)+ViewParam.nodeHeight+ViewParam.offsetTop+ViewParam.offsetBottom,
a76259e2ca9f add public/viewer
one
parents:
diff changeset
171 top:50});
a76259e2ca9f add public/viewer
one
parents:
diff changeset
172 }
a76259e2ca9f add public/viewer
one
parents:
diff changeset
173 jsPlumb.repaintEverything();
a76259e2ca9f add public/viewer
one
parents:
diff changeset
174 }
a76259e2ca9f add public/viewer
one
parents:
diff changeset
175
a76259e2ca9f add public/viewer
one
parents:
diff changeset
176
a76259e2ca9f add public/viewer
one
parents:
diff changeset
177 var relationJPMap={
a76259e2ca9f add public/viewer
one
parents:
diff changeset
178 suggestion:"提案",
a76259e2ca9f add public/viewer
one
parents:
diff changeset
179 refutation:"反論",
a76259e2ca9f add public/viewer
one
parents:
diff changeset
180 question:"質問"
a76259e2ca9f add public/viewer
one
parents:
diff changeset
181 };
a76259e2ca9f add public/viewer
one
parents:
diff changeset
182 function updateNode(node){
a76259e2ca9f add public/viewer
one
parents:
diff changeset
183 if(updateClaimElement(node)){
a76259e2ca9f add public/viewer
one
parents:
diff changeset
184 var fc=$("#treeRoot")[0].firstChild;
a76259e2ca9f add public/viewer
one
parents:
diff changeset
185 if(fc)$("#treeRoot")[0].insertBefore(node.view[0],fc);
a76259e2ca9f add public/viewer
one
parents:
diff changeset
186 else $("#treeRoot").append(node.view);
a76259e2ca9f add public/viewer
one
parents:
diff changeset
187 }
a76259e2ca9f add public/viewer
one
parents:
diff changeset
188 node.view.css({
a76259e2ca9f add public/viewer
one
parents:
diff changeset
189 left:node.position.x*ViewParam.intervalX-ViewParam.nodeWidth/2,
a76259e2ca9f add public/viewer
one
parents:
diff changeset
190 top:node.position.y*ViewParam.intervalY-ViewParam.nodeHeight/2
a76259e2ca9f add public/viewer
one
parents:
diff changeset
191 });
a76259e2ca9f add public/viewer
one
parents:
diff changeset
192 var childs=node.mentions;
a76259e2ca9f add public/viewer
one
parents:
diff changeset
193 for(var i=0;i<childs.length;i++){
a76259e2ca9f add public/viewer
one
parents:
diff changeset
194 var child=childs[i];
a76259e2ca9f add public/viewer
one
parents:
diff changeset
195 var created=!child.view;
a76259e2ca9f add public/viewer
one
parents:
diff changeset
196 updateNode(child);
a76259e2ca9f add public/viewer
one
parents:
diff changeset
197 if(created){
a76259e2ca9f add public/viewer
one
parents:
diff changeset
198 var c=jsPlumb.connect({source:node.view[0],target:child.view[0]});
a76259e2ca9f add public/viewer
one
parents:
diff changeset
199 c.setLabel({label:"<span style='color:white'>"+(relationJPMap[child.relation]||child.relation)+"</span>",cssStyle:"color:white"});
a76259e2ca9f add public/viewer
one
parents:
diff changeset
200 }
a76259e2ca9f add public/viewer
one
parents:
diff changeset
201 }
a76259e2ca9f add public/viewer
one
parents:
diff changeset
202 }
a76259e2ca9f add public/viewer
one
parents:
diff changeset
203
a76259e2ca9f add public/viewer
one
parents:
diff changeset
204 var focusedUser=null;
a76259e2ca9f add public/viewer
one
parents:
diff changeset
205 function setFocusedShadowEverything(){
a76259e2ca9f add public/viewer
one
parents:
diff changeset
206 function recFocusShadow(node){
a76259e2ca9f add public/viewer
one
parents:
diff changeset
207 setFocusedShadow(node);
a76259e2ca9f add public/viewer
one
parents:
diff changeset
208 for(var i=0;i<node.mentions.length;i++){
a76259e2ca9f add public/viewer
one
parents:
diff changeset
209 recFocusShadow(node.mentions[i]);
a76259e2ca9f add public/viewer
one
parents:
diff changeset
210 }
a76259e2ca9f add public/viewer
one
parents:
diff changeset
211 }
a76259e2ca9f add public/viewer
one
parents:
diff changeset
212 recFocusShadow(treeInfo.root);
a76259e2ca9f add public/viewer
one
parents:
diff changeset
213 }
a76259e2ca9f add public/viewer
one
parents:
diff changeset
214 function setFocusedShadow(node){
a76259e2ca9f add public/viewer
one
parents:
diff changeset
215 var name=focusedUser||userName;
a76259e2ca9f add public/viewer
one
parents:
diff changeset
216 var color;
a76259e2ca9f add public/viewer
one
parents:
diff changeset
217 console.log(node.info.author)
a76259e2ca9f add public/viewer
one
parents:
diff changeset
218 if(node.info.author==name)color="#afa";
a76259e2ca9f add public/viewer
one
parents:
diff changeset
219 else{
a76259e2ca9f add public/viewer
one
parents:
diff changeset
220 var users=node.info.users,status;
a76259e2ca9f add public/viewer
one
parents:
diff changeset
221 for(var i=0;i<users.length;i++){
a76259e2ca9f add public/viewer
one
parents:
diff changeset
222 var u=users[i];
a76259e2ca9f add public/viewer
one
parents:
diff changeset
223 if(u.id==name){status=u.status;break;}
a76259e2ca9f add public/viewer
one
parents:
diff changeset
224 }
a76259e2ca9f add public/viewer
one
parents:
diff changeset
225 color=({agreed:"#aaf",denied:"#faa",pend:"white",unknown:"white"})[status];
a76259e2ca9f add public/viewer
one
parents:
diff changeset
226 }
a76259e2ca9f add public/viewer
one
parents:
diff changeset
227 node.view.css("box-shadow",color?color+" 0 0 30px":"none");
a76259e2ca9f add public/viewer
one
parents:
diff changeset
228 }
a76259e2ca9f add public/viewer
one
parents:
diff changeset
229 function updateClaimElement(node){
a76259e2ca9f add public/viewer
one
parents:
diff changeset
230 var created=false;
a76259e2ca9f add public/viewer
one
parents:
diff changeset
231 if(!node.view){
a76259e2ca9f add public/viewer
one
parents:
diff changeset
232 created=true
a76259e2ca9f add public/viewer
one
parents:
diff changeset
233 node.view=$("<div class='claimNode'/>");
a76259e2ca9f add public/viewer
one
parents:
diff changeset
234 node.view.click(function(){showClaim(node);});
a76259e2ca9f add public/viewer
one
parents:
diff changeset
235 node.view.hover(
a76259e2ca9f add public/viewer
one
parents:
diff changeset
236 function(){div.css("box-shadow","white 0 0 50px");showUserList(node.info.users,node.info.author)},
a76259e2ca9f add public/viewer
one
parents:
diff changeset
237 function(){try{setFocusedShadow(node);}catch(e){console.log(e);}showUserList([])}
a76259e2ca9f add public/viewer
one
parents:
diff changeset
238 )
a76259e2ca9f add public/viewer
one
parents:
diff changeset
239 }
a76259e2ca9f add public/viewer
one
parents:
diff changeset
240 setFocusedShadow(node);
a76259e2ca9f add public/viewer
one
parents:
diff changeset
241 var div=node.view;
a76259e2ca9f add public/viewer
one
parents:
diff changeset
242 div.text(node.info.toulmin.title);
a76259e2ca9f add public/viewer
one
parents:
diff changeset
243 var statusBackground={pass:"#aaf",unknown:"#fff",failed:"#faa",fail:"#faa"};
a76259e2ca9f add public/viewer
one
parents:
diff changeset
244 var statusBorder={pass:"#66a",unknown:"#aaa",failed:"#a66",fail:"#a66"};
a76259e2ca9f add public/viewer
one
parents:
diff changeset
245 div.css("background",statusBackground[node.info.status]||"white");
a76259e2ca9f add public/viewer
one
parents:
diff changeset
246 div.css("border-color",statusBorder[node.info.status]||"white");
a76259e2ca9f add public/viewer
one
parents:
diff changeset
247 return created;
a76259e2ca9f add public/viewer
one
parents:
diff changeset
248 }
a76259e2ca9f add public/viewer
one
parents:
diff changeset
249
a76259e2ca9f add public/viewer
one
parents:
diff changeset
250
a76259e2ca9f add public/viewer
one
parents:
diff changeset
251 function showUserList(users,author){
a76259e2ca9f add public/viewer
one
parents:
diff changeset
252 var statusMap={};
a76259e2ca9f add public/viewer
one
parents:
diff changeset
253 var userListElement=$(".userList");
a76259e2ca9f add public/viewer
one
parents:
diff changeset
254 userListElement.text('')
a76259e2ca9f add public/viewer
one
parents:
diff changeset
255 if(author)statusMap['#'+author]='author';
a76259e2ca9f add public/viewer
one
parents:
diff changeset
256 for(var i=0;i<users.length;i++){
a76259e2ca9f add public/viewer
one
parents:
diff changeset
257 statusMap['#'+users[i].id]=users[i].status;
a76259e2ca9f add public/viewer
one
parents:
diff changeset
258 }
a76259e2ca9f add public/viewer
one
parents:
diff changeset
259 for(var i=0;i<userList.length;i++){
a76259e2ca9f add public/viewer
one
parents:
diff changeset
260 var u=userList[i];
a76259e2ca9f add public/viewer
one
parents:
diff changeset
261 var ue=createUserElement(u==userName?"あなた("+u+")":u,statusMap['#'+u]);
a76259e2ca9f add public/viewer
one
parents:
diff changeset
262 if(u==userName){
a76259e2ca9f add public/viewer
one
parents:
diff changeset
263 ue.css({fontWeight:"bold"})
a76259e2ca9f add public/viewer
one
parents:
diff changeset
264 }
a76259e2ca9f add public/viewer
one
parents:
diff changeset
265 ue.appendTo(userListElement);
a76259e2ca9f add public/viewer
one
parents:
diff changeset
266 with({name:u,element:ue}){
a76259e2ca9f add public/viewer
one
parents:
diff changeset
267 ue.hover(
a76259e2ca9f add public/viewer
one
parents:
diff changeset
268 function(){
a76259e2ca9f add public/viewer
one
parents:
diff changeset
269 element.css("opacity",1);
a76259e2ca9f add public/viewer
one
parents:
diff changeset
270 focusedUser=name;setFocusedShadowEverything()
a76259e2ca9f add public/viewer
one
parents:
diff changeset
271 },
a76259e2ca9f add public/viewer
one
parents:
diff changeset
272 function(){
a76259e2ca9f add public/viewer
one
parents:
diff changeset
273 element.css("opacity",0.5);
a76259e2ca9f add public/viewer
one
parents:
diff changeset
274 focusedUser=userName;setFocusedShadowEverything()
a76259e2ca9f add public/viewer
one
parents:
diff changeset
275 }
a76259e2ca9f add public/viewer
one
parents:
diff changeset
276 )
a76259e2ca9f add public/viewer
one
parents:
diff changeset
277 }
a76259e2ca9f add public/viewer
one
parents:
diff changeset
278
a76259e2ca9f add public/viewer
one
parents:
diff changeset
279 }
a76259e2ca9f add public/viewer
one
parents:
diff changeset
280 $(".userList").css("opacity","1");
a76259e2ca9f add public/viewer
one
parents:
diff changeset
281 }
a76259e2ca9f add public/viewer
one
parents:
diff changeset
282 function hideUserList(){
a76259e2ca9f add public/viewer
one
parents:
diff changeset
283 $(".userStatus").css("background","none");
a76259e2ca9f add public/viewer
one
parents:
diff changeset
284 $(".userItem").css("opacity","1");
a76259e2ca9f add public/viewer
one
parents:
diff changeset
285 $(".userList").css("opacity","0.2");
a76259e2ca9f add public/viewer
one
parents:
diff changeset
286 }
a76259e2ca9f add public/viewer
one
parents:
diff changeset
287 </script>
a76259e2ca9f add public/viewer
one
parents:
diff changeset
288 <style>
a76259e2ca9f add public/viewer
one
parents:
diff changeset
289 div.claimNode{
a76259e2ca9f add public/viewer
one
parents:
diff changeset
290 z-index:20;
a76259e2ca9f add public/viewer
one
parents:
diff changeset
291 position:absolute;width:92px;height:40px;font-size:12px;padding:4px;background:white;
a76259e2ca9f add public/viewer
one
parents:
diff changeset
292 border:2px solid silver;
a76259e2ca9f add public/viewer
one
parents:
diff changeset
293 overflow:hidden;
a76259e2ca9f add public/viewer
one
parents:
diff changeset
294 border-radius:5px;
a76259e2ca9f add public/viewer
one
parents:
diff changeset
295 cursor:pointer;
a76259e2ca9f add public/viewer
one
parents:
diff changeset
296 }
a76259e2ca9f add public/viewer
one
parents:
diff changeset
297 body{background-color:black;}
a76259e2ca9f add public/viewer
one
parents:
diff changeset
298
a76259e2ca9f add public/viewer
one
parents:
diff changeset
299 div.userList{
a76259e2ca9f add public/viewer
one
parents:
diff changeset
300 position:fixed;
a76259e2ca9f add public/viewer
one
parents:
diff changeset
301 z-index:30;
a76259e2ca9f add public/viewer
one
parents:
diff changeset
302 right:0;top:0;
a76259e2ca9f add public/viewer
one
parents:
diff changeset
303 width:160px;
a76259e2ca9f add public/viewer
one
parents:
diff changeset
304 }
a76259e2ca9f add public/viewer
one
parents:
diff changeset
305 div.header{
a76259e2ca9f add public/viewer
one
parents:
diff changeset
306 position:absolute;
a76259e2ca9f add public/viewer
one
parents:
diff changeset
307 left:0;top:0;
a76259e2ca9f add public/viewer
one
parents:
diff changeset
308 z-index:5;
a76259e2ca9f add public/viewer
one
parents:
diff changeset
309 height:50px;
a76259e2ca9f add public/viewer
one
parents:
diff changeset
310 width:100%;
a76259e2ca9f add public/viewer
one
parents:
diff changeset
311 background:#223;
53
a405991e39d8 modified ClaiMode/computeUnaimously method
one
parents: 51
diff changeset
312 background:-moz-linear-gradient(top,#002,#223);
51
a76259e2ca9f add public/viewer
one
parents:
diff changeset
313 background:-webkit-gradient(linear,left top,left bottom,from(#002),to(#223));
a76259e2ca9f add public/viewer
one
parents:
diff changeset
314 color:silver;
a76259e2ca9f add public/viewer
one
parents:
diff changeset
315 font-size:40px;
a76259e2ca9f add public/viewer
one
parents:
diff changeset
316 }
a76259e2ca9f add public/viewer
one
parents:
diff changeset
317
a76259e2ca9f add public/viewer
one
parents:
diff changeset
318
a76259e2ca9f add public/viewer
one
parents:
diff changeset
319 </style>
a76259e2ca9f add public/viewer
one
parents:
diff changeset
320 <script>
a76259e2ca9f add public/viewer
one
parents:
diff changeset
321 function resetMentionForm(){
a76259e2ca9f add public/viewer
one
parents:
diff changeset
322 var keys=['title','contents','w','d','b','q','r'];
a76259e2ca9f add public/viewer
one
parents:
diff changeset
323 for(var i=0;i<keys.length;i++)$("#mentionform_"+keys[i]).val("");
a76259e2ca9f add public/viewer
one
parents:
diff changeset
324 $("#mention_option")[0].className="option";
a76259e2ca9f add public/viewer
one
parents:
diff changeset
325 }
a76259e2ca9f add public/viewer
one
parents:
diff changeset
326 var formClaim;
a76259e2ca9f add public/viewer
one
parents:
diff changeset
327 var claimUserMap,mentionUserMap;
a76259e2ca9f add public/viewer
one
parents:
diff changeset
328 function showClaim(claim){
a76259e2ca9f add public/viewer
one
parents:
diff changeset
329 formClaim=claim;
a76259e2ca9f add public/viewer
one
parents:
diff changeset
330 var info=claim.info;
a76259e2ca9f add public/viewer
one
parents:
diff changeset
331 var keys=['title','contents','w','d','b','q','r'];
a76259e2ca9f add public/viewer
one
parents:
diff changeset
332 for(var i=0;i<keys.length;i++)$("#claimform_"+keys[i]).val(info.toulmin[keys[i]]);
a76259e2ca9f add public/viewer
one
parents:
diff changeset
333
a76259e2ca9f add public/viewer
one
parents:
diff changeset
334 var status="";
a76259e2ca9f add public/viewer
one
parents:
diff changeset
335 for(var i=0;i<info.users.length;i++)if(info.users[i].id==userName)status=info.users[i].status;
a76259e2ca9f add public/viewer
one
parents:
diff changeset
336 var op=({denied:1,pend:2,agreed:3})[status];
a76259e2ca9f add public/viewer
one
parents:
diff changeset
337
a76259e2ca9f add public/viewer
one
parents:
diff changeset
338 $("#claim_status").text(info.status)
a76259e2ca9f add public/viewer
one
parents:
diff changeset
339 $("#claim_status").css("color",({pass:"blue",failed:"red",fail:"red",unknown:"black"})[info.status]);
a76259e2ca9f add public/viewer
one
parents:
diff changeset
340 $("#agree_option")[0].className="option"+(op?" option"+op:"");
a76259e2ca9f add public/viewer
one
parents:
diff changeset
341 $("#agree_option").css("display",status?"block":"none");
a76259e2ca9f add public/viewer
one
parents:
diff changeset
342
a76259e2ca9f add public/viewer
one
parents:
diff changeset
343 $("#claim_button").css("display",(userName==info.author)?"block":"none");
a76259e2ca9f add public/viewer
one
parents:
diff changeset
344 $("#claimvote_option").css("display",status?"block":"none");
a76259e2ca9f add public/viewer
one
parents:
diff changeset
345
a76259e2ca9f add public/viewer
one
parents:
diff changeset
346 $("#claimbody")[0].className="claim_contents";
a76259e2ca9f add public/viewer
one
parents:
diff changeset
347 $("#mentionbody")[0].className="mention_contents";
a76259e2ca9f add public/viewer
one
parents:
diff changeset
348
a76259e2ca9f add public/viewer
one
parents:
diff changeset
349 $("#claim_author").text(info.author);
a76259e2ca9f add public/viewer
one
parents:
diff changeset
350 $("#mention_author").text(userName);
a76259e2ca9f add public/viewer
one
parents:
diff changeset
351 $("#claimvote_option")[0].className="option option"+(claim.agreeType=="majority"?2:1);
a76259e2ca9f add public/viewer
one
parents:
diff changeset
352 $("#mentionvote_option")[0].className="option option1";
a76259e2ca9f add public/viewer
one
parents:
diff changeset
353 var stateMap={};
a76259e2ca9f add public/viewer
one
parents:
diff changeset
354 for(var i=0;i<info.users.length;i++)stateMap['#'+info.users[i].id]=info.users[i].status;
a76259e2ca9f add public/viewer
one
parents:
diff changeset
355 claimUserMap=new HashSet(info.users.map(function(u){return u.id}));
a76259e2ca9f add public/viewer
one
parents:
diff changeset
356 mentionUserMap=new HashSet();
a76259e2ca9f add public/viewer
one
parents:
diff changeset
357 $("#claim_users").text("");
a76259e2ca9f add public/viewer
one
parents:
diff changeset
358 $("#mention_users").text("");
a76259e2ca9f add public/viewer
one
parents:
diff changeset
359 if(userName!=info.author)mentionUserMap.add(info.author);
a76259e2ca9f add public/viewer
one
parents:
diff changeset
360 for(var i=0;i<userList.length;i++){
a76259e2ca9f add public/viewer
one
parents:
diff changeset
361 var name=userList[i];
a76259e2ca9f add public/viewer
one
parents:
diff changeset
362 if(name!=info.author){
a76259e2ca9f add public/viewer
one
parents:
diff changeset
363 var status=stateMap['#'+name];
a76259e2ca9f add public/viewer
one
parents:
diff changeset
364 createUserSelectItem(name,status,claimUserMap).appendTo($("#claim_users"));
a76259e2ca9f add public/viewer
one
parents:
diff changeset
365 }if(name!=userName){
a76259e2ca9f add public/viewer
one
parents:
diff changeset
366 createUserSelectItem(name,name==info.author?"unknown":"",mentionUserMap).appendTo($("#mention_users"));
a76259e2ca9f add public/viewer
one
parents:
diff changeset
367 }
a76259e2ca9f add public/viewer
one
parents:
diff changeset
368 }
a76259e2ca9f add public/viewer
one
parents:
diff changeset
369 resetMentionForm();
a76259e2ca9f add public/viewer
one
parents:
diff changeset
370 popupShowMain()
a76259e2ca9f add public/viewer
one
parents:
diff changeset
371 }
a76259e2ca9f add public/viewer
one
parents:
diff changeset
372
a76259e2ca9f add public/viewer
one
parents:
diff changeset
373
a76259e2ca9f add public/viewer
one
parents:
diff changeset
374 function claimSave(){
a76259e2ca9f add public/viewer
one
parents:
diff changeset
375 var claim=formClaim;
a76259e2ca9f add public/viewer
one
parents:
diff changeset
376 var info=claim.info;
a76259e2ca9f add public/viewer
one
parents:
diff changeset
377 var id=claim.id||root_id;
a76259e2ca9f add public/viewer
one
parents:
diff changeset
378 var agreeType=[null,"unanimously","majority"][($('#claimvote_option')[0].className.match("[0-9]+")||"0")[0]];
a76259e2ca9f add public/viewer
one
parents:
diff changeset
379 var title=$('#claimform_title').val();
a76259e2ca9f add public/viewer
one
parents:
diff changeset
380 var contents=$('#claimform_contents').val();
a76259e2ca9f add public/viewer
one
parents:
diff changeset
381 var d=$('#claimform_d').val();
a76259e2ca9f add public/viewer
one
parents:
diff changeset
382 var w=$('#claimform_w').val();
a76259e2ca9f add public/viewer
one
parents:
diff changeset
383 var b=$('#claimform_b').val();
a76259e2ca9f add public/viewer
one
parents:
diff changeset
384 var q=$('#claimform_q').val();
a76259e2ca9f add public/viewer
one
parents:
diff changeset
385 var r=$('#claimform_r').val();
a76259e2ca9f add public/viewer
one
parents:
diff changeset
386 var users=claimUserMap.toArray();
a76259e2ca9f add public/viewer
one
parents:
diff changeset
387 var errors=[];
a76259e2ca9f add public/viewer
one
parents:
diff changeset
388 if(!title)errors.push("タイトル");
a76259e2ca9f add public/viewer
one
parents:
diff changeset
389 if(!agreeType)errors.push("採決方法");
a76259e2ca9f add public/viewer
one
parents:
diff changeset
390 if(users.length==0)errors.push("同意を取るユーザ");
a76259e2ca9f add public/viewer
one
parents:
diff changeset
391 if(errors.length){
a76259e2ca9f add public/viewer
one
parents:
diff changeset
392 alert("未入力項目:"+errors.join(", "));
a76259e2ca9f add public/viewer
one
parents:
diff changeset
393 }else{
a76259e2ca9f add public/viewer
one
parents:
diff changeset
394 $.ajax({
a76259e2ca9f add public/viewer
one
parents:
diff changeset
395 url:BASE_URL+"/claims/edit/"+id,
a76259e2ca9f add public/viewer
one
parents:
diff changeset
396 success:function(o){loadConsensus(root_id)},
a76259e2ca9f add public/viewer
one
parents:
diff changeset
397 type:"POST",cache:false,
a76259e2ca9f add public/viewer
one
parents:
diff changeset
398 contentType:"application/json",
a76259e2ca9f add public/viewer
one
parents:
diff changeset
399 data:JSON.stringify({type:agreeType,toulmin:{title:title,contents:contents,q:q,d:d,w:w,b:b,r:r},author:userName,users:users}),
a76259e2ca9f add public/viewer
one
parents:
diff changeset
400 error:function(o){console.log("ERROR",o)}
a76259e2ca9f add public/viewer
one
parents:
diff changeset
401 });
a76259e2ca9f add public/viewer
one
parents:
diff changeset
402 popupHideAll();
a76259e2ca9f add public/viewer
one
parents:
diff changeset
403 }
a76259e2ca9f add public/viewer
one
parents:
diff changeset
404 }
a76259e2ca9f add public/viewer
one
parents:
diff changeset
405 function claimAgree(status){
a76259e2ca9f add public/viewer
one
parents:
diff changeset
406 var claim=formClaim;
a76259e2ca9f add public/viewer
one
parents:
diff changeset
407 var info=claim.info;
a76259e2ca9f add public/viewer
one
parents:
diff changeset
408 var id=claim.id||root_id;
a76259e2ca9f add public/viewer
one
parents:
diff changeset
409 $.ajax({
a76259e2ca9f add public/viewer
one
parents:
diff changeset
410 url:BASE_URL+"/claims/answer/"+id+"/"+userName+"/"+status,
a76259e2ca9f add public/viewer
one
parents:
diff changeset
411 success:function(o){loadConsensus(root_id)},
a76259e2ca9f add public/viewer
one
parents:
diff changeset
412 type:"POST",cache:false,
a76259e2ca9f add public/viewer
one
parents:
diff changeset
413 error:function(o){console.log("ERROR",o)}
a76259e2ca9f add public/viewer
one
parents:
diff changeset
414 });
a76259e2ca9f add public/viewer
one
parents:
diff changeset
415 popupHideAll();
a76259e2ca9f add public/viewer
one
parents:
diff changeset
416 }
a76259e2ca9f add public/viewer
one
parents:
diff changeset
417 function mentionSave(){
a76259e2ca9f add public/viewer
one
parents:
diff changeset
418 var claim=formClaim;
a76259e2ca9f add public/viewer
one
parents:
diff changeset
419 var info=claim.info;
a76259e2ca9f add public/viewer
one
parents:
diff changeset
420 var id=claim.id||root_id;
a76259e2ca9f add public/viewer
one
parents:
diff changeset
421 var mentionType=[null,"refutation","question","suggestion"][($('#mention_option')[0].className.match("[0-9]+")||"0")[0]];
a76259e2ca9f add public/viewer
one
parents:
diff changeset
422 var agreeType=[null,"unanimously","majority"][($('#mentionvote_option')[0].className.match("[0-9]+")||"0")[0]];
a76259e2ca9f add public/viewer
one
parents:
diff changeset
423 var title=$('#mentionform_title').val();
a76259e2ca9f add public/viewer
one
parents:
diff changeset
424 var contents=$('#mentionform_contents').val();
a76259e2ca9f add public/viewer
one
parents:
diff changeset
425 var d=$('#mentionform_d').val();
a76259e2ca9f add public/viewer
one
parents:
diff changeset
426 var w=$('#mentionform_w').val();
a76259e2ca9f add public/viewer
one
parents:
diff changeset
427 var b=$('#mentionform_b').val();
a76259e2ca9f add public/viewer
one
parents:
diff changeset
428 var q=$('#mentionform_q').val();
a76259e2ca9f add public/viewer
one
parents:
diff changeset
429 var r=$('#mentionform_r').val();
a76259e2ca9f add public/viewer
one
parents:
diff changeset
430 var users=mentionUserMap.toArray();
a76259e2ca9f add public/viewer
one
parents:
diff changeset
431 var author=userName;
a76259e2ca9f add public/viewer
one
parents:
diff changeset
432 var errors=[];
a76259e2ca9f add public/viewer
one
parents:
diff changeset
433 if(!title)errors.push("タイトル");
a76259e2ca9f add public/viewer
one
parents:
diff changeset
434 if(!agreeType)errors.push("採決方法");
a76259e2ca9f add public/viewer
one
parents:
diff changeset
435 if(!mentionType)errors.push("反論質問提案");
a76259e2ca9f add public/viewer
one
parents:
diff changeset
436 if(users.length==0)errors.push("同意を取るユーザ");
a76259e2ca9f add public/viewer
one
parents:
diff changeset
437 if(errors.length){
a76259e2ca9f add public/viewer
one
parents:
diff changeset
438 alert("未入力項目:"+errors.join(", "));
a76259e2ca9f add public/viewer
one
parents:
diff changeset
439 }else{
a76259e2ca9f add public/viewer
one
parents:
diff changeset
440 $.ajax({
a76259e2ca9f add public/viewer
one
parents:
diff changeset
441 url:BASE_URL+"/claims/"+mentionType+"/"+id+"/create",
a76259e2ca9f add public/viewer
one
parents:
diff changeset
442 success:function(o){loadConsensus(root_id)},
a76259e2ca9f add public/viewer
one
parents:
diff changeset
443 type:"POST",cache:false,contentType:"application/json",
a76259e2ca9f add public/viewer
one
parents:
diff changeset
444 data:JSON.stringify({type:agreeType,toulmin:{title:title,contents:contents,q:q,d:d,w:w,b:b,r:r},author:author,users:users}),
a76259e2ca9f add public/viewer
one
parents:
diff changeset
445 error:function(o){console.log("ERROR",o)}
a76259e2ca9f add public/viewer
one
parents:
diff changeset
446 });
a76259e2ca9f add public/viewer
one
parents:
diff changeset
447 popupHideAll();
a76259e2ca9f add public/viewer
one
parents:
diff changeset
448 }
a76259e2ca9f add public/viewer
one
parents:
diff changeset
449 }
a76259e2ca9f add public/viewer
one
parents:
diff changeset
450
a76259e2ca9f add public/viewer
one
parents:
diff changeset
451 </script>
a76259e2ca9f add public/viewer
one
parents:
diff changeset
452 <div class='header'>
a76259e2ca9f add public/viewer
one
parents:
diff changeset
453 <nobr id='header_title'>R-Consensus : loading</nobr>
a76259e2ca9f add public/viewer
one
parents:
diff changeset
454 </div>
a76259e2ca9f add public/viewer
one
parents:
diff changeset
455
a76259e2ca9f add public/viewer
one
parents:
diff changeset
456 <div style="position:relative;left:0;top:0;" id='treeMain'>
a76259e2ca9f add public/viewer
one
parents:
diff changeset
457 <div style="position:absolute;width:0;height:0;left:100;" id='treeRoot'>
a76259e2ca9f add public/viewer
one
parents:
diff changeset
458 </div>
a76259e2ca9f add public/viewer
one
parents:
diff changeset
459 </div>
a76259e2ca9f add public/viewer
one
parents:
diff changeset
460
a76259e2ca9f add public/viewer
one
parents:
diff changeset
461 <div class='userList'></div>
a76259e2ca9f add public/viewer
one
parents:
diff changeset
462
a76259e2ca9f add public/viewer
one
parents:
diff changeset
463
a76259e2ca9f add public/viewer
one
parents:
diff changeset
464 <div id='popup_base' style='display:none;z-index:100'>
a76259e2ca9f add public/viewer
one
parents:
diff changeset
465 <div id='popup_background'></div>
a76259e2ca9f add public/viewer
one
parents:
diff changeset
466 <div class='popup_center'>
a76259e2ca9f add public/viewer
one
parents:
diff changeset
467 <div class='claiminfo' id='claiminfo'>
a76259e2ca9f add public/viewer
one
parents:
diff changeset
468 <div class='claim_title'><input placeholder="title" id='claimform_title'></div>
a76259e2ca9f add public/viewer
one
parents:
diff changeset
469 <div id='claimbody' class='claim_contents'>
a76259e2ca9f add public/viewer
one
parents:
diff changeset
470 <div class='claim_menu'>
a76259e2ca9f add public/viewer
one
parents:
diff changeset
471 <div class='menu_item menu_contents' onclick="$('#claimbody')[0].className='claim_contents'">Contents</div>
a76259e2ca9f add public/viewer
one
parents:
diff changeset
472 <div class='menu_item menu_toulmin' onclick="$('#claimbody')[0].className='claim_toulmin'">Toulmin</div>
a76259e2ca9f add public/viewer
one
parents:
diff changeset
473 <div class='menu_item menu_users' onclick="$('#claimbody')[0].className='claim_users'">Users</div>
a76259e2ca9f add public/viewer
one
parents:
diff changeset
474 <div id='claim_status'></div>
a76259e2ca9f add public/viewer
one
parents:
diff changeset
475 </div>
a76259e2ca9f add public/viewer
one
parents:
diff changeset
476 <div class='claim_main main_contents'>
a76259e2ca9f add public/viewer
one
parents:
diff changeset
477 <textarea placeholder='contents' id='claimform_contents'></textarea>
a76259e2ca9f add public/viewer
one
parents:
diff changeset
478 </div>
a76259e2ca9f add public/viewer
one
parents:
diff changeset
479 <div class='claim_main main_toulmin'>
a76259e2ca9f add public/viewer
one
parents:
diff changeset
480 <div class='item_toulmin'><span>データ</span><input id='claimform_d'></div>
a76259e2ca9f add public/viewer
one
parents:
diff changeset
481 <div class='item_toulmin'><span>論拠 </span><input id='claimform_w'></div>
a76259e2ca9f add public/viewer
one
parents:
diff changeset
482 <div class='item_toulmin'><span>裏付け</span><input id='claimform_b'></div>
a76259e2ca9f add public/viewer
one
parents:
diff changeset
483 <div class='item_toulmin'><span>限定詞</span><input id='claimform_q'></div>
a76259e2ca9f add public/viewer
one
parents:
diff changeset
484 <div class='item_toulmin'><span>反駁 </span><input id='claimform_r'></div>
a76259e2ca9f add public/viewer
one
parents:
diff changeset
485 </div>
a76259e2ca9f add public/viewer
one
parents:
diff changeset
486 <div class='claim_main main_users'>
a76259e2ca9f add public/viewer
one
parents:
diff changeset
487 <span class='author_label'>作者:</span>
a76259e2ca9f add public/viewer
one
parents:
diff changeset
488 <span class='author_name' id='claim_author'></span>
a76259e2ca9f add public/viewer
one
parents:
diff changeset
489 <div class='option option1' id='claimvote_option'>
a76259e2ca9f add public/viewer
one
parents:
diff changeset
490 <span class='option option1 vote1' onclick="$('#claimvote_option')[0].className='option option1'">全会一致</span>
a76259e2ca9f add public/viewer
one
parents:
diff changeset
491 <span class='option option2 vote2' onclick="$('#claimvote_option')[0].className='option option2'">多数決</span>
a76259e2ca9f add public/viewer
one
parents:
diff changeset
492 </div>
a76259e2ca9f add public/viewer
one
parents:
diff changeset
493 <div id='claim_users'></div>
a76259e2ca9f add public/viewer
one
parents:
diff changeset
494 </div>
a76259e2ca9f add public/viewer
one
parents:
diff changeset
495 </div>
a76259e2ca9f add public/viewer
one
parents:
diff changeset
496 <div class='claim_footer'>
a76259e2ca9f add public/viewer
one
parents:
diff changeset
497 <span onclick='popupShowSubMain()' class='button mention_button'>mention</span>
a76259e2ca9f add public/viewer
one
parents:
diff changeset
498 <div class='option' id='agree_option'>
a76259e2ca9f add public/viewer
one
parents:
diff changeset
499 <span class='option option1 agree1' onclick="$('#agree_option')[0].className='option option1';claimAgree('denied');">否認</span>
a76259e2ca9f add public/viewer
one
parents:
diff changeset
500 <span class='option option2 agree2' onclick="$('#agree_option')[0].className='option option2';claimAgree('pend');">保留</span>
a76259e2ca9f add public/viewer
one
parents:
diff changeset
501 <span class='option option3 agree3' onclick="$('#agree_option')[0].className='option option3';claimAgree('agreed');">合意</span>
a76259e2ca9f add public/viewer
one
parents:
diff changeset
502 </div>
a76259e2ca9f add public/viewer
one
parents:
diff changeset
503 <div id='claim_button'>
a76259e2ca9f add public/viewer
one
parents:
diff changeset
504 <span class='button cancel' onclick="popupHideAll()">cancel</span>
a76259e2ca9f add public/viewer
one
parents:
diff changeset
505 <span class='button save' onclick="claimSave()">save</span>
a76259e2ca9f add public/viewer
one
parents:
diff changeset
506 </div>
a76259e2ca9f add public/viewer
one
parents:
diff changeset
507 </div>
a76259e2ca9f add public/viewer
one
parents:
diff changeset
508 <div class='cover' id='claim_cover'></div>
a76259e2ca9f add public/viewer
one
parents:
diff changeset
509 </div>
a76259e2ca9f add public/viewer
one
parents:
diff changeset
510
a76259e2ca9f add public/viewer
one
parents:
diff changeset
511
a76259e2ca9f add public/viewer
one
parents:
diff changeset
512 <div class='mentioninfo' id='mentioninfo'>
a76259e2ca9f add public/viewer
one
parents:
diff changeset
513 <div class='claim_title'><input placeholder="title" id='mentionform_title'></div>
a76259e2ca9f add public/viewer
one
parents:
diff changeset
514 <div id='mentionbody' class='mention_contents'>
a76259e2ca9f add public/viewer
one
parents:
diff changeset
515 <div class='claim_menu'>
a76259e2ca9f add public/viewer
one
parents:
diff changeset
516 <div class='menu_item menu_contents' onclick="$('#mentionbody')[0].className='mention_contents'">Contents</div>
a76259e2ca9f add public/viewer
one
parents:
diff changeset
517 <div class='menu_item menu_toulmin' onclick="$('#mentionbody')[0].className='mention_toulmin'">Toulmin</div>
a76259e2ca9f add public/viewer
one
parents:
diff changeset
518 <div class='menu_item menu_users' onclick="$('#mentionbody')[0].className='mention_users'">Users</div>
a76259e2ca9f add public/viewer
one
parents:
diff changeset
519 </div>
a76259e2ca9f add public/viewer
one
parents:
diff changeset
520 <div class='mention_main main_contents'>
a76259e2ca9f add public/viewer
one
parents:
diff changeset
521 <textarea placeholder='contents' id='mentionform_contents'></textarea>
a76259e2ca9f add public/viewer
one
parents:
diff changeset
522 </div>
a76259e2ca9f add public/viewer
one
parents:
diff changeset
523 <div class='mention_main main_toulmin'>
a76259e2ca9f add public/viewer
one
parents:
diff changeset
524 <div class='item_toulmin'><span>データ</span><input id='mentionform_d'></div>
a76259e2ca9f add public/viewer
one
parents:
diff changeset
525 <div class='item_toulmin'><span>論拠 </span><input id='mentionform_w'></div>
a76259e2ca9f add public/viewer
one
parents:
diff changeset
526 <div class='item_toulmin'><span>裏付け</span><input id='mentionform_b'></div>
a76259e2ca9f add public/viewer
one
parents:
diff changeset
527 <div class='item_toulmin'><span>限定詞</span><input id='mentionform_q'></div>
a76259e2ca9f add public/viewer
one
parents:
diff changeset
528 <div class='item_toulmin'><span>反駁 </span><input id='mentionform_r'></div>
a76259e2ca9f add public/viewer
one
parents:
diff changeset
529 </div>
a76259e2ca9f add public/viewer
one
parents:
diff changeset
530 <div class='mention_main main_users'>
a76259e2ca9f add public/viewer
one
parents:
diff changeset
531 <span class='author_label'>作者:</span>
a76259e2ca9f add public/viewer
one
parents:
diff changeset
532 <span class='author_name' id='mention_author'></span>
a76259e2ca9f add public/viewer
one
parents:
diff changeset
533 <div class='option option1' id='mentionvote_option'>
a76259e2ca9f add public/viewer
one
parents:
diff changeset
534 <span class='option option1 vote1' onclick="$('#mentionvote_option')[0].className='option option1'">全会一致</span>
a76259e2ca9f add public/viewer
one
parents:
diff changeset
535 <span class='option option2 vote2' onclick="$('#mentionvote_option')[0].className='option option2'">多数決</span>
a76259e2ca9f add public/viewer
one
parents:
diff changeset
536 </div>
a76259e2ca9f add public/viewer
one
parents:
diff changeset
537 <div id='mention_users'></div>
a76259e2ca9f add public/viewer
one
parents:
diff changeset
538 </div>
a76259e2ca9f add public/viewer
one
parents:
diff changeset
539 </div>
a76259e2ca9f add public/viewer
one
parents:
diff changeset
540 <div class='claim_footer'>
a76259e2ca9f add public/viewer
one
parents:
diff changeset
541 <div class='option' id='mention_option'>
a76259e2ca9f add public/viewer
one
parents:
diff changeset
542 <span class='option option1 mention1' onclick="$('#mention_option')[0].className='option option1'">反論</span>
a76259e2ca9f add public/viewer
one
parents:
diff changeset
543 <span class='option option2 mention2' onclick="$('#mention_option')[0].className='option option2'">質問</span>
a76259e2ca9f add public/viewer
one
parents:
diff changeset
544 <span class='option option3 mention3' onclick="$('#mention_option')[0].className='option option3'">提案</span>
a76259e2ca9f add public/viewer
one
parents:
diff changeset
545 </div>
a76259e2ca9f add public/viewer
one
parents:
diff changeset
546 <span class='button cancel' onclick="popupShowMain()">cancel</span>
a76259e2ca9f add public/viewer
one
parents:
diff changeset
547 <span class='button save' onclick="mentionSave()">save</span>
a76259e2ca9f add public/viewer
one
parents:
diff changeset
548 </div>
a76259e2ca9f add public/viewer
one
parents:
diff changeset
549 <div class='cover' id='mention_cover'></div>
a76259e2ca9f add public/viewer
one
parents:
diff changeset
550 </div>
a76259e2ca9f add public/viewer
one
parents:
diff changeset
551 </div>
53
a405991e39d8 modified ClaiMode/computeUnaimously method
one
parents: 51
diff changeset
552 </div>
a405991e39d8 modified ClaiMode/computeUnaimously method
one
parents: 51
diff changeset
553
a405991e39d8 modified ClaiMode/computeUnaimously method
one
parents: 51
diff changeset
554
a405991e39d8 modified ClaiMode/computeUnaimously method
one
parents: 51
diff changeset
555
a405991e39d8 modified ClaiMode/computeUnaimously method
one
parents: 51
diff changeset
556
a405991e39d8 modified ClaiMode/computeUnaimously method
one
parents: 51
diff changeset
557 <div id="loginPopup" style='position:fixed;left:0;top:0;width:100%;height:100%;z-index:10;display:none;'>
a405991e39d8 modified ClaiMode/computeUnaimously method
one
parents: 51
diff changeset
558 <div style='position:absolute;left:0;top:0;width:100%;height:100%;background:black;opacity:0.5'></div>
a405991e39d8 modified ClaiMode/computeUnaimously method
one
parents: 51
diff changeset
559 <div style='position:absolute;left:50%;top:50%;'>
a405991e39d8 modified ClaiMode/computeUnaimously method
one
parents: 51
diff changeset
560 <div style='position:absolute;left:-160px;top:-80px;width:320px;height:120px;background:white'>
a405991e39d8 modified ClaiMode/computeUnaimously method
one
parents: 51
diff changeset
561 <form onsubmit="try{a=$('#loginUserName');if(a.val()){login(a.val());$('#loginPopup').remove();}}catch(e){console.log(e)}return false">
a405991e39d8 modified ClaiMode/computeUnaimously method
one
parents: 51
diff changeset
562 <div style='position:absolute;left:20px;top:15px;font-size:24px;width:280;text-align:center;'>
a405991e39d8 modified ClaiMode/computeUnaimously method
one
parents: 51
diff changeset
563 R-Consensus Login
a405991e39d8 modified ClaiMode/computeUnaimously method
one
parents: 51
diff changeset
564 </div>
a405991e39d8 modified ClaiMode/computeUnaimously method
one
parents: 51
diff changeset
565 <input type=text placeholder='username' style='position:absolute;left:20px;top:70px;width:180px;font-size:16px;height:24px;' id='loginUserName'>
a405991e39d8 modified ClaiMode/computeUnaimously method
one
parents: 51
diff changeset
566 <span style='position:absolute;left:220px;top:70px;width:80px;font-size:16px;height:24px;line-height:24px;' class='button' value='login' onclick="try{a=$('#loginUserName');if(a.val()){login(a.val());$('#loginPopup').remove();}}catch(e){console.log(e)}return false">login</span>
a405991e39d8 modified ClaiMode/computeUnaimously method
one
parents: 51
diff changeset
567 </form>
a405991e39d8 modified ClaiMode/computeUnaimously method
one
parents: 51
diff changeset
568 </div>
a405991e39d8 modified ClaiMode/computeUnaimously method
one
parents: 51
diff changeset
569 </div>
a405991e39d8 modified ClaiMode/computeUnaimously method
one
parents: 51
diff changeset
570 </div>