Mercurial > hg > Members > nobuyasu > Consensus
annotate public/viewer/viewer_white.html @ 105:9bf5e984f288 draft
modified label
author | Nobuyasu Oshiro <dimolto@cr.ie.u-ryukyu.ac.jp> |
---|---|
date | Sun, 17 Mar 2013 04:04:00 +0900 |
parents | 88c16240c78a |
children | 60a0ff0b3096 |
rev | line source |
---|---|
94
bf0cd5920429
modfied viewer_white.html
Nobuyasu Oshiro <dimolto@cr.ie.u-ryukyu.ac.jp>
parents:
diff
changeset
|
1 <meta http-equiv="content-type" content="text/html;charset=utf-8" /> |
bf0cd5920429
modfied viewer_white.html
Nobuyasu Oshiro <dimolto@cr.ie.u-ryukyu.ac.jp>
parents:
diff
changeset
|
2 <title>R-Consensus</title> |
bf0cd5920429
modfied viewer_white.html
Nobuyasu Oshiro <dimolto@cr.ie.u-ryukyu.ac.jp>
parents:
diff
changeset
|
3 <link rel='stylesheet' href="form.css"> |
bf0cd5920429
modfied viewer_white.html
Nobuyasu Oshiro <dimolto@cr.ie.u-ryukyu.ac.jp>
parents:
diff
changeset
|
4 <script src='form.js'></script> |
bf0cd5920429
modfied viewer_white.html
Nobuyasu Oshiro <dimolto@cr.ie.u-ryukyu.ac.jp>
parents:
diff
changeset
|
5 <script type="text/javascript" src="js/lib/jquery-1.8.1-min.js"></script> |
bf0cd5920429
modfied viewer_white.html
Nobuyasu Oshiro <dimolto@cr.ie.u-ryukyu.ac.jp>
parents:
diff
changeset
|
6 <script type="text/javascript" src="js/lib/jquery-ui-1.8.23-min.js"></script> |
bf0cd5920429
modfied viewer_white.html
Nobuyasu Oshiro <dimolto@cr.ie.u-ryukyu.ac.jp>
parents:
diff
changeset
|
7 <script type="text/javascript" src="js/lib/jquery.ui.touch-punch.min.js"></script> |
bf0cd5920429
modfied viewer_white.html
Nobuyasu Oshiro <dimolto@cr.ie.u-ryukyu.ac.jp>
parents:
diff
changeset
|
8 <script type="text/javascript" src="js/lib/jsBezier-0.4-min.js"></script> |
bf0cd5920429
modfied viewer_white.html
Nobuyasu Oshiro <dimolto@cr.ie.u-ryukyu.ac.jp>
parents:
diff
changeset
|
9 <script type="text/javascript" src="js/1.3.15/jsPlumb-util-1.3.15-RC1.js"></script> |
bf0cd5920429
modfied viewer_white.html
Nobuyasu Oshiro <dimolto@cr.ie.u-ryukyu.ac.jp>
parents:
diff
changeset
|
10 <script type="text/javascript" src="js/1.3.15/jsPlumb-dom-adapter-1.3.15-RC1.js"></script> |
bf0cd5920429
modfied viewer_white.html
Nobuyasu Oshiro <dimolto@cr.ie.u-ryukyu.ac.jp>
parents:
diff
changeset
|
11 <script type="text/javascript" src="js/1.3.15/jsPlumb-1.3.15-RC1.js"></script> |
bf0cd5920429
modfied viewer_white.html
Nobuyasu Oshiro <dimolto@cr.ie.u-ryukyu.ac.jp>
parents:
diff
changeset
|
12 <script type="text/javascript" src="js/1.3.15/jsPlumb-defaults-1.3.15-RC1.js"></script> |
bf0cd5920429
modfied viewer_white.html
Nobuyasu Oshiro <dimolto@cr.ie.u-ryukyu.ac.jp>
parents:
diff
changeset
|
13 <script type="text/javascript" src="js/1.3.15/jsPlumb-renderers-svg-1.3.15-RC1.js"></script> |
bf0cd5920429
modfied viewer_white.html
Nobuyasu Oshiro <dimolto@cr.ie.u-ryukyu.ac.jp>
parents:
diff
changeset
|
14 <script type="text/javascript" src="js/1.3.15/jsPlumb-renderers-canvas-1.3.15-RC1.js"></script> |
bf0cd5920429
modfied viewer_white.html
Nobuyasu Oshiro <dimolto@cr.ie.u-ryukyu.ac.jp>
parents:
diff
changeset
|
15 <script type="text/javascript" src="js/1.3.15/jsPlumb-renderers-vml-1.3.15-RC1.js"></script> |
bf0cd5920429
modfied viewer_white.html
Nobuyasu Oshiro <dimolto@cr.ie.u-ryukyu.ac.jp>
parents:
diff
changeset
|
16 <script type="text/javascript" src="js/1.3.15/jquery.jsPlumb-1.3.15-RC1.js"></script> |
104
88c16240c78a
add jquery.jsPlumb-1.3.15-all-min.js
Nobuyasu Oshiro <dimolto@cr.ie.u-ryukyu.ac.jp>
parents:
103
diff
changeset
|
17 <script type="text/javascript" src="js/1.3.15/jquery.jsPlumb-1.3.15-all-min.js"></script> |
94
bf0cd5920429
modfied viewer_white.html
Nobuyasu Oshiro <dimolto@cr.ie.u-ryukyu.ac.jp>
parents:
diff
changeset
|
18 <script type="text/javascript" src='treeArrangement.js'></script> |
95
341766c5a6e9
modified viewer_whit.html
Nobuyasu Oshiro <dimolto@cr.ie.u-ryukyu.ac.jp>
parents:
94
diff
changeset
|
19 |
341766c5a6e9
modified viewer_whit.html
Nobuyasu Oshiro <dimolto@cr.ie.u-ryukyu.ac.jp>
parents:
94
diff
changeset
|
20 <style> |
103
1b44197d02ef
mofidied body css
Nobuyasu Oshiro <dimolto@cr.ie.u-ryukyu.ac.jp>
parents:
102
diff
changeset
|
21 body { |
104
88c16240c78a
add jquery.jsPlumb-1.3.15-all-min.js
Nobuyasu Oshiro <dimolto@cr.ie.u-ryukyu.ac.jp>
parents:
103
diff
changeset
|
22 background-color:#ccf; |
103
1b44197d02ef
mofidied body css
Nobuyasu Oshiro <dimolto@cr.ie.u-ryukyu.ac.jp>
parents:
102
diff
changeset
|
23 background:-moz-linear-gradient(top,#fff,#ccf); |
1b44197d02ef
mofidied body css
Nobuyasu Oshiro <dimolto@cr.ie.u-ryukyu.ac.jp>
parents:
102
diff
changeset
|
24 background:-webkit-gradient(linear,left top,left bottom,from(#fff),to(#ccf)); |
1b44197d02ef
mofidied body css
Nobuyasu Oshiro <dimolto@cr.ie.u-ryukyu.ac.jp>
parents:
102
diff
changeset
|
25 } |
1b44197d02ef
mofidied body css
Nobuyasu Oshiro <dimolto@cr.ie.u-ryukyu.ac.jp>
parents:
102
diff
changeset
|
26 div.header { |
1b44197d02ef
mofidied body css
Nobuyasu Oshiro <dimolto@cr.ie.u-ryukyu.ac.jp>
parents:
102
diff
changeset
|
27 position:absolute; |
1b44197d02ef
mofidied body css
Nobuyasu Oshiro <dimolto@cr.ie.u-ryukyu.ac.jp>
parents:
102
diff
changeset
|
28 left:0;top:0; |
1b44197d02ef
mofidied body css
Nobuyasu Oshiro <dimolto@cr.ie.u-ryukyu.ac.jp>
parents:
102
diff
changeset
|
29 z-index:5; |
1b44197d02ef
mofidied body css
Nobuyasu Oshiro <dimolto@cr.ie.u-ryukyu.ac.jp>
parents:
102
diff
changeset
|
30 height:50px; |
1b44197d02ef
mofidied body css
Nobuyasu Oshiro <dimolto@cr.ie.u-ryukyu.ac.jp>
parents:
102
diff
changeset
|
31 width:100%; |
1b44197d02ef
mofidied body css
Nobuyasu Oshiro <dimolto@cr.ie.u-ryukyu.ac.jp>
parents:
102
diff
changeset
|
32 background:#ddd; |
1b44197d02ef
mofidied body css
Nobuyasu Oshiro <dimolto@cr.ie.u-ryukyu.ac.jp>
parents:
102
diff
changeset
|
33 background:-moz-linear-gradient(top,#fff,#ddd); |
1b44197d02ef
mofidied body css
Nobuyasu Oshiro <dimolto@cr.ie.u-ryukyu.ac.jp>
parents:
102
diff
changeset
|
34 background:-webkit-gradient(linear,left top,left bottom,from(#fff),to(#ddd)); |
1b44197d02ef
mofidied body css
Nobuyasu Oshiro <dimolto@cr.ie.u-ryukyu.ac.jp>
parents:
102
diff
changeset
|
35 color:silver; |
1b44197d02ef
mofidied body css
Nobuyasu Oshiro <dimolto@cr.ie.u-ryukyu.ac.jp>
parents:
102
diff
changeset
|
36 font-size:40px; |
95
341766c5a6e9
modified viewer_whit.html
Nobuyasu Oshiro <dimolto@cr.ie.u-ryukyu.ac.jp>
parents:
94
diff
changeset
|
37 } |
105
9bf5e984f288
modified label
Nobuyasu Oshiro <dimolto@cr.ie.u-ryukyu.ac.jp>
parents:
104
diff
changeset
|
38 span.edgeLabel { |
9bf5e984f288
modified label
Nobuyasu Oshiro <dimolto@cr.ie.u-ryukyu.ac.jp>
parents:
104
diff
changeset
|
39 |
9bf5e984f288
modified label
Nobuyasu Oshiro <dimolto@cr.ie.u-ryukyu.ac.jp>
parents:
104
diff
changeset
|
40 } |
9bf5e984f288
modified label
Nobuyasu Oshiro <dimolto@cr.ie.u-ryukyu.ac.jp>
parents:
104
diff
changeset
|
41 |
99 | 42 div.graphNode { |
101
098e87253903
modfied jsPlumb
Nobuyasu Oshiro <dimolto@cr.ie.u-ryukyu.ac.jp>
parents:
100
diff
changeset
|
43 position:absolute; |
098e87253903
modfied jsPlumb
Nobuyasu Oshiro <dimolto@cr.ie.u-ryukyu.ac.jp>
parents:
100
diff
changeset
|
44 font-size:12px; padding:4px; background:white; |
99 | 45 z-index:20; |
102
8d8e6c2bfec2
modified viewer_white.html
Nobuyasu Oshiro <dimolto@cr.ie.u-ryukyu.ac.jp>
parents:
101
diff
changeset
|
46 width: 45px; |
8d8e6c2bfec2
modified viewer_white.html
Nobuyasu Oshiro <dimolto@cr.ie.u-ryukyu.ac.jp>
parents:
101
diff
changeset
|
47 height: 40px; |
101
098e87253903
modfied jsPlumb
Nobuyasu Oshiro <dimolto@cr.ie.u-ryukyu.ac.jp>
parents:
100
diff
changeset
|
48 border-radius:50px; |
99 | 49 border:2px solid silver; |
50 overflow:hidden; | |
51 cursor:pointer; | |
100
06e419562734
add jsPlumb code
Nobuyasu Oshiro <dimolto@cr.ie.u-ryukyu.ac.jp>
parents:
99
diff
changeset
|
52 border-color:"blue"; |
103
1b44197d02ef
mofidied body css
Nobuyasu Oshiro <dimolto@cr.ie.u-ryukyu.ac.jp>
parents:
102
diff
changeset
|
53 } |
104
88c16240c78a
add jquery.jsPlumb-1.3.15-all-min.js
Nobuyasu Oshiro <dimolto@cr.ie.u-ryukyu.ac.jp>
parents:
103
diff
changeset
|
54 div.graphNodeContent { |
88c16240c78a
add jquery.jsPlumb-1.3.15-all-min.js
Nobuyasu Oshiro <dimolto@cr.ie.u-ryukyu.ac.jp>
parents:
103
diff
changeset
|
55 position:absolute; |
88c16240c78a
add jquery.jsPlumb-1.3.15-all-min.js
Nobuyasu Oshiro <dimolto@cr.ie.u-ryukyu.ac.jp>
parents:
103
diff
changeset
|
56 z-index:21; |
88c16240c78a
add jquery.jsPlumb-1.3.15-all-min.js
Nobuyasu Oshiro <dimolto@cr.ie.u-ryukyu.ac.jp>
parents:
103
diff
changeset
|
57 font-size:12px; |
88c16240c78a
add jquery.jsPlumb-1.3.15-all-min.js
Nobuyasu Oshiro <dimolto@cr.ie.u-ryukyu.ac.jp>
parents:
103
diff
changeset
|
58 background:white; |
88c16240c78a
add jquery.jsPlumb-1.3.15-all-min.js
Nobuyasu Oshiro <dimolto@cr.ie.u-ryukyu.ac.jp>
parents:
103
diff
changeset
|
59 width: 50%; |
88c16240c78a
add jquery.jsPlumb-1.3.15-all-min.js
Nobuyasu Oshiro <dimolto@cr.ie.u-ryukyu.ac.jp>
parents:
103
diff
changeset
|
60 height: 80%; |
88c16240c78a
add jquery.jsPlumb-1.3.15-all-min.js
Nobuyasu Oshiro <dimolto@cr.ie.u-ryukyu.ac.jp>
parents:
103
diff
changeset
|
61 left: 10px; |
88c16240c78a
add jquery.jsPlumb-1.3.15-all-min.js
Nobuyasu Oshiro <dimolto@cr.ie.u-ryukyu.ac.jp>
parents:
103
diff
changeset
|
62 top: 8px; |
88c16240c78a
add jquery.jsPlumb-1.3.15-all-min.js
Nobuyasu Oshiro <dimolto@cr.ie.u-ryukyu.ac.jp>
parents:
103
diff
changeset
|
63 } |
88c16240c78a
add jquery.jsPlumb-1.3.15-all-min.js
Nobuyasu Oshiro <dimolto@cr.ie.u-ryukyu.ac.jp>
parents:
103
diff
changeset
|
64 |
95
341766c5a6e9
modified viewer_whit.html
Nobuyasu Oshiro <dimolto@cr.ie.u-ryukyu.ac.jp>
parents:
94
diff
changeset
|
65 </style> |
341766c5a6e9
modified viewer_whit.html
Nobuyasu Oshiro <dimolto@cr.ie.u-ryukyu.ac.jp>
parents:
94
diff
changeset
|
66 |
99 | 67 <div class='header'> |
68 <nobr id='header_title' style='margin-left:40px;'><a href='index.html'>Home</a></nobr> | |
69 </div> | |
70 | |
104
88c16240c78a
add jquery.jsPlumb-1.3.15-all-min.js
Nobuyasu Oshiro <dimolto@cr.ie.u-ryukyu.ac.jp>
parents:
103
diff
changeset
|
71 <div id="miniDisplay" style='position:fixed; right:20; top:70; width:300px; height:300px; border:solid 1px; border-radius:5px; opacity:0.5; z-index:10; visibility:hidden;'> |
99 | 72 <div style='position:absolute; left:0; top:0; width:100%; height:100%; background:black; opacity:0.5;'> </div> |
73 <div id="closeMiniDisplay" style='position:absolute; right:5; top:-3; z-index:10;' onclick="$('#miniDisplay').css('visibility','hidden');" onmouseover="$('#closeMiniDisplay').css('color','blue');" onmouseout="$('#closeMiniDisplay').css('color','black')" >CLOSE</div> | |
74 <div style='position:absolute; width:90%; height:90%;'> | |
75 <div style='position:absolute; left:5%; top:5%; width:100%; height:100%; background:white;'> | |
76 <div id="miniDisplayTitle" style='position:absolute; left:10px; top:5px; font-size:24px; width:100%; text-align:left;'> | |
77 </div> | |
78 <div id="miniDisplayBody" style='position:absolute; left:20px; top:40px;'> | |
79 body | |
80 </div> | |
81 </form> | |
82 </div> | |
83 </div> | |
84 </div> | |
85 | |
86 <div style="position:relative;left:0;top:0;" id='graphMain'> | |
100
06e419562734
add jsPlumb code
Nobuyasu Oshiro <dimolto@cr.ie.u-ryukyu.ac.jp>
parents:
99
diff
changeset
|
87 <div style="position:absolute; width:0; height:0;left:0;" id='graphRoot'> |
99 | 88 </div> |
89 </div> | |
90 | |
91 | |
94
bf0cd5920429
modfied viewer_white.html
Nobuyasu Oshiro <dimolto@cr.ie.u-ryukyu.ac.jp>
parents:
diff
changeset
|
92 <script type="text/javascript"> |
bf0cd5920429
modfied viewer_white.html
Nobuyasu Oshiro <dimolto@cr.ie.u-ryukyu.ac.jp>
parents:
diff
changeset
|
93 var LOAD_INTERVAL = 5; |
bf0cd5920429
modfied viewer_white.html
Nobuyasu Oshiro <dimolto@cr.ie.u-ryukyu.ac.jp>
parents:
diff
changeset
|
94 var BASE_URL = ""; |
bf0cd5920429
modfied viewer_white.html
Nobuyasu Oshiro <dimolto@cr.ie.u-ryukyu.ac.jp>
parents:
diff
changeset
|
95 if(!Array.prototype.filter){ |
bf0cd5920429
modfied viewer_white.html
Nobuyasu Oshiro <dimolto@cr.ie.u-ryukyu.ac.jp>
parents:
diff
changeset
|
96 Array.prototype.filter=function(func){ |
bf0cd5920429
modfied viewer_white.html
Nobuyasu Oshiro <dimolto@cr.ie.u-ryukyu.ac.jp>
parents:
diff
changeset
|
97 var arr=[]; |
bf0cd5920429
modfied viewer_white.html
Nobuyasu Oshiro <dimolto@cr.ie.u-ryukyu.ac.jp>
parents:
diff
changeset
|
98 for(var i=0;i<this.length;i++)if(func(this[i]))arr.push(this[i]); |
bf0cd5920429
modfied viewer_white.html
Nobuyasu Oshiro <dimolto@cr.ie.u-ryukyu.ac.jp>
parents:
diff
changeset
|
99 return arr; |
bf0cd5920429
modfied viewer_white.html
Nobuyasu Oshiro <dimolto@cr.ie.u-ryukyu.ac.jp>
parents:
diff
changeset
|
100 } |
bf0cd5920429
modfied viewer_white.html
Nobuyasu Oshiro <dimolto@cr.ie.u-ryukyu.ac.jp>
parents:
diff
changeset
|
101 } |
bf0cd5920429
modfied viewer_white.html
Nobuyasu Oshiro <dimolto@cr.ie.u-ryukyu.ac.jp>
parents:
diff
changeset
|
102 |
bf0cd5920429
modfied viewer_white.html
Nobuyasu Oshiro <dimolto@cr.ie.u-ryukyu.ac.jp>
parents:
diff
changeset
|
103 var treeInfo; |
bf0cd5920429
modfied viewer_white.html
Nobuyasu Oshiro <dimolto@cr.ie.u-ryukyu.ac.jp>
parents:
diff
changeset
|
104 var userList = []; |
bf0cd5920429
modfied viewer_white.html
Nobuyasu Oshiro <dimolto@cr.ie.u-ryukyu.ac.jp>
parents:
diff
changeset
|
105 var root_id; |
bf0cd5920429
modfied viewer_white.html
Nobuyasu Oshiro <dimolto@cr.ie.u-ryukyu.ac.jp>
parents:
diff
changeset
|
106 function loadConsensus(id) { |
bf0cd5920429
modfied viewer_white.html
Nobuyasu Oshiro <dimolto@cr.ie.u-ryukyu.ac.jp>
parents:
diff
changeset
|
107 function onload(json) { |
bf0cd5920429
modfied viewer_white.html
Nobuyasu Oshiro <dimolto@cr.ie.u-ryukyu.ac.jp>
parents:
diff
changeset
|
108 var title = json.hogehoge ? json.hogehoge : "title"; |
bf0cd5920429
modfied viewer_white.html
Nobuyasu Oshiro <dimolto@cr.ie.u-ryukyu.ac.jp>
parents:
diff
changeset
|
109 document.title = title; |
bf0cd5920429
modfied viewer_white.html
Nobuyasu Oshiro <dimolto@cr.ie.u-ryukyu.ac.jp>
parents:
diff
changeset
|
110 $('#headertitle_main').text(title) |
bf0cd5920429
modfied viewer_white.html
Nobuyasu Oshiro <dimolto@cr.ie.u-ryukyu.ac.jp>
parents:
diff
changeset
|
111 } |
bf0cd5920429
modfied viewer_white.html
Nobuyasu Oshiro <dimolto@cr.ie.u-ryukyu.ac.jp>
parents:
diff
changeset
|
112 } |
bf0cd5920429
modfied viewer_white.html
Nobuyasu Oshiro <dimolto@cr.ie.u-ryukyu.ac.jp>
parents:
diff
changeset
|
113 |
bf0cd5920429
modfied viewer_white.html
Nobuyasu Oshiro <dimolto@cr.ie.u-ryukyu.ac.jp>
parents:
diff
changeset
|
114 function loadUserList() { |
bf0cd5920429
modfied viewer_white.html
Nobuyasu Oshiro <dimolto@cr.ie.u-ryukyu.ac.jp>
parents:
diff
changeset
|
115 $.ajax({ |
bf0cd5920429
modfied viewer_white.html
Nobuyasu Oshiro <dimolto@cr.ie.u-ryukyu.ac.jp>
parents:
diff
changeset
|
116 url:BASE_URL + "/users/all", |
bf0cd5920429
modfied viewer_white.html
Nobuyasu Oshiro <dimolto@cr.ie.u-ryukyu.ac.jp>
parents:
diff
changeset
|
117 success:function(o) { userList = o.sort(); showUserList([]); }, |
bf0cd5920429
modfied viewer_white.html
Nobuyasu Oshiro <dimolto@cr.ie.u-ryukyu.ac.jp>
parents:
diff
changeset
|
118 type:"GET", cache:false, |
bf0cd5920429
modfied viewer_white.html
Nobuyasu Oshiro <dimolto@cr.ie.u-ryukyu.ac.jp>
parents:
diff
changeset
|
119 error:function(o) { console.log("loadUserList error : ",o); } |
bf0cd5920429
modfied viewer_white.html
Nobuyasu Oshiro <dimolto@cr.ie.u-ryukyu.ac.jp>
parents:
diff
changeset
|
120 }); |
bf0cd5920429
modfied viewer_white.html
Nobuyasu Oshiro <dimolto@cr.ie.u-ryukyu.ac.jp>
parents:
diff
changeset
|
121 } |
bf0cd5920429
modfied viewer_white.html
Nobuyasu Oshiro <dimolto@cr.ie.u-ryukyu.ac.jp>
parents:
diff
changeset
|
122 |
bf0cd5920429
modfied viewer_white.html
Nobuyasu Oshiro <dimolto@cr.ie.u-ryukyu.ac.jp>
parents:
diff
changeset
|
123 $(function() { |
bf0cd5920429
modfied viewer_white.html
Nobuyasu Oshiro <dimolto@cr.ie.u-ryukyu.ac.jp>
parents:
diff
changeset
|
124 userName = localStorage.userName; |
100
06e419562734
add jsPlumb code
Nobuyasu Oshiro <dimolto@cr.ie.u-ryukyu.ac.jp>
parents:
99
diff
changeset
|
125 if(userName) {start();} |
102
8d8e6c2bfec2
modified viewer_white.html
Nobuyasu Oshiro <dimolto@cr.ie.u-ryukyu.ac.jp>
parents:
101
diff
changeset
|
126 else { } |
94
bf0cd5920429
modfied viewer_white.html
Nobuyasu Oshiro <dimolto@cr.ie.u-ryukyu.ac.jp>
parents:
diff
changeset
|
127 }) |
bf0cd5920429
modfied viewer_white.html
Nobuyasu Oshiro <dimolto@cr.ie.u-ryukyu.ac.jp>
parents:
diff
changeset
|
128 |
95
341766c5a6e9
modified viewer_whit.html
Nobuyasu Oshiro <dimolto@cr.ie.u-ryukyu.ac.jp>
parents:
94
diff
changeset
|
129 function beginScript() { |
97
5098c4967a3a
modified miniDisplay
Nobuyasu Oshiro <dimolto@cr.ie.u-ryukyu.ac.jp>
parents:
96
diff
changeset
|
130 DragHandler.attach($('#miniDisplay')[0]); |
95
341766c5a6e9
modified viewer_whit.html
Nobuyasu Oshiro <dimolto@cr.ie.u-ryukyu.ac.jp>
parents:
94
diff
changeset
|
131 } |
341766c5a6e9
modified viewer_whit.html
Nobuyasu Oshiro <dimolto@cr.ie.u-ryukyu.ac.jp>
parents:
94
diff
changeset
|
132 |
341766c5a6e9
modified viewer_whit.html
Nobuyasu Oshiro <dimolto@cr.ie.u-ryukyu.ac.jp>
parents:
94
diff
changeset
|
133 var DragHandler = { |
341766c5a6e9
modified viewer_whit.html
Nobuyasu Oshiro <dimolto@cr.ie.u-ryukyu.ac.jp>
parents:
94
diff
changeset
|
134 _oElem : null, |
341766c5a6e9
modified viewer_whit.html
Nobuyasu Oshiro <dimolto@cr.ie.u-ryukyu.ac.jp>
parents:
94
diff
changeset
|
135 attach : function(oElem) { |
341766c5a6e9
modified viewer_whit.html
Nobuyasu Oshiro <dimolto@cr.ie.u-ryukyu.ac.jp>
parents:
94
diff
changeset
|
136 oElem.onmousedown = DragHandler._dragBegin; |
341766c5a6e9
modified viewer_whit.html
Nobuyasu Oshiro <dimolto@cr.ie.u-ryukyu.ac.jp>
parents:
94
diff
changeset
|
137 return oElem; |
341766c5a6e9
modified viewer_whit.html
Nobuyasu Oshiro <dimolto@cr.ie.u-ryukyu.ac.jp>
parents:
94
diff
changeset
|
138 }, |
341766c5a6e9
modified viewer_whit.html
Nobuyasu Oshiro <dimolto@cr.ie.u-ryukyu.ac.jp>
parents:
94
diff
changeset
|
139 _dragBegin : function(e) { |
341766c5a6e9
modified viewer_whit.html
Nobuyasu Oshiro <dimolto@cr.ie.u-ryukyu.ac.jp>
parents:
94
diff
changeset
|
140 var oElem = DragHandler._oElem = this; |
341766c5a6e9
modified viewer_whit.html
Nobuyasu Oshiro <dimolto@cr.ie.u-ryukyu.ac.jp>
parents:
94
diff
changeset
|
141 if (isNaN(parseInt(oElem.style.left))) { oElem.style.left = '0px'; } |
341766c5a6e9
modified viewer_whit.html
Nobuyasu Oshiro <dimolto@cr.ie.u-ryukyu.ac.jp>
parents:
94
diff
changeset
|
142 if (isNaN(parseInt(oElem.style.top))) { oElem.style.top = '0px'; } |
341766c5a6e9
modified viewer_whit.html
Nobuyasu Oshiro <dimolto@cr.ie.u-ryukyu.ac.jp>
parents:
94
diff
changeset
|
143 var x = parseInt(oElem.style.left); |
341766c5a6e9
modified viewer_whit.html
Nobuyasu Oshiro <dimolto@cr.ie.u-ryukyu.ac.jp>
parents:
94
diff
changeset
|
144 var y = parseInt(oElem.style.top); |
341766c5a6e9
modified viewer_whit.html
Nobuyasu Oshiro <dimolto@cr.ie.u-ryukyu.ac.jp>
parents:
94
diff
changeset
|
145 e = e ? e : window.event; |
341766c5a6e9
modified viewer_whit.html
Nobuyasu Oshiro <dimolto@cr.ie.u-ryukyu.ac.jp>
parents:
94
diff
changeset
|
146 oElem.mouseX = e.clientX; |
341766c5a6e9
modified viewer_whit.html
Nobuyasu Oshiro <dimolto@cr.ie.u-ryukyu.ac.jp>
parents:
94
diff
changeset
|
147 oElem.mouseY = e.clientY; |
341766c5a6e9
modified viewer_whit.html
Nobuyasu Oshiro <dimolto@cr.ie.u-ryukyu.ac.jp>
parents:
94
diff
changeset
|
148 document.onmousemove = DragHandler._drag; |
341766c5a6e9
modified viewer_whit.html
Nobuyasu Oshiro <dimolto@cr.ie.u-ryukyu.ac.jp>
parents:
94
diff
changeset
|
149 document.onmouseup = DragHandler._dragEnd; |
341766c5a6e9
modified viewer_whit.html
Nobuyasu Oshiro <dimolto@cr.ie.u-ryukyu.ac.jp>
parents:
94
diff
changeset
|
150 return false; |
341766c5a6e9
modified viewer_whit.html
Nobuyasu Oshiro <dimolto@cr.ie.u-ryukyu.ac.jp>
parents:
94
diff
changeset
|
151 }, |
341766c5a6e9
modified viewer_whit.html
Nobuyasu Oshiro <dimolto@cr.ie.u-ryukyu.ac.jp>
parents:
94
diff
changeset
|
152 _drag : function(e) { |
341766c5a6e9
modified viewer_whit.html
Nobuyasu Oshiro <dimolto@cr.ie.u-ryukyu.ac.jp>
parents:
94
diff
changeset
|
153 var oElem = DragHandler._oElem; |
341766c5a6e9
modified viewer_whit.html
Nobuyasu Oshiro <dimolto@cr.ie.u-ryukyu.ac.jp>
parents:
94
diff
changeset
|
154 var x = parseInt(oElem.style.left); |
341766c5a6e9
modified viewer_whit.html
Nobuyasu Oshiro <dimolto@cr.ie.u-ryukyu.ac.jp>
parents:
94
diff
changeset
|
155 var y = parseInt(oElem.style.top); |
341766c5a6e9
modified viewer_whit.html
Nobuyasu Oshiro <dimolto@cr.ie.u-ryukyu.ac.jp>
parents:
94
diff
changeset
|
156 e = e ? e : window.event; |
341766c5a6e9
modified viewer_whit.html
Nobuyasu Oshiro <dimolto@cr.ie.u-ryukyu.ac.jp>
parents:
94
diff
changeset
|
157 oElem.style.left = x + (e.clientX - oElem.mouseX) + 'px'; |
341766c5a6e9
modified viewer_whit.html
Nobuyasu Oshiro <dimolto@cr.ie.u-ryukyu.ac.jp>
parents:
94
diff
changeset
|
158 oElem.style.top = y + (e.clientY - oElem.mouseY) + 'px'; |
341766c5a6e9
modified viewer_whit.html
Nobuyasu Oshiro <dimolto@cr.ie.u-ryukyu.ac.jp>
parents:
94
diff
changeset
|
159 oElem.mouseX = e.clientX; |
341766c5a6e9
modified viewer_whit.html
Nobuyasu Oshiro <dimolto@cr.ie.u-ryukyu.ac.jp>
parents:
94
diff
changeset
|
160 oElem.mouseY = e.clientY; |
341766c5a6e9
modified viewer_whit.html
Nobuyasu Oshiro <dimolto@cr.ie.u-ryukyu.ac.jp>
parents:
94
diff
changeset
|
161 return false; |
341766c5a6e9
modified viewer_whit.html
Nobuyasu Oshiro <dimolto@cr.ie.u-ryukyu.ac.jp>
parents:
94
diff
changeset
|
162 }, |
341766c5a6e9
modified viewer_whit.html
Nobuyasu Oshiro <dimolto@cr.ie.u-ryukyu.ac.jp>
parents:
94
diff
changeset
|
163 _dragEnd : function() { |
341766c5a6e9
modified viewer_whit.html
Nobuyasu Oshiro <dimolto@cr.ie.u-ryukyu.ac.jp>
parents:
94
diff
changeset
|
164 var oElem = DragHandler._oElem; |
341766c5a6e9
modified viewer_whit.html
Nobuyasu Oshiro <dimolto@cr.ie.u-ryukyu.ac.jp>
parents:
94
diff
changeset
|
165 var x = parseInt(oElem.style.left); |
341766c5a6e9
modified viewer_whit.html
Nobuyasu Oshiro <dimolto@cr.ie.u-ryukyu.ac.jp>
parents:
94
diff
changeset
|
166 var y = parseInt(oElem.style.top); |
341766c5a6e9
modified viewer_whit.html
Nobuyasu Oshiro <dimolto@cr.ie.u-ryukyu.ac.jp>
parents:
94
diff
changeset
|
167 document.onmousemove = null; |
341766c5a6e9
modified viewer_whit.html
Nobuyasu Oshiro <dimolto@cr.ie.u-ryukyu.ac.jp>
parents:
94
diff
changeset
|
168 document.onmouseup = null; |
341766c5a6e9
modified viewer_whit.html
Nobuyasu Oshiro <dimolto@cr.ie.u-ryukyu.ac.jp>
parents:
94
diff
changeset
|
169 DragHandler._oElem = null; |
341766c5a6e9
modified viewer_whit.html
Nobuyasu Oshiro <dimolto@cr.ie.u-ryukyu.ac.jp>
parents:
94
diff
changeset
|
170 } |
341766c5a6e9
modified viewer_whit.html
Nobuyasu Oshiro <dimolto@cr.ie.u-ryukyu.ac.jp>
parents:
94
diff
changeset
|
171 |
341766c5a6e9
modified viewer_whit.html
Nobuyasu Oshiro <dimolto@cr.ie.u-ryukyu.ac.jp>
parents:
94
diff
changeset
|
172 }; |
341766c5a6e9
modified viewer_whit.html
Nobuyasu Oshiro <dimolto@cr.ie.u-ryukyu.ac.jp>
parents:
94
diff
changeset
|
173 |
341766c5a6e9
modified viewer_whit.html
Nobuyasu Oshiro <dimolto@cr.ie.u-ryukyu.ac.jp>
parents:
94
diff
changeset
|
174 function addLoadEvent(func) { |
341766c5a6e9
modified viewer_whit.html
Nobuyasu Oshiro <dimolto@cr.ie.u-ryukyu.ac.jp>
parents:
94
diff
changeset
|
175 var oldonload = window.onload; |
341766c5a6e9
modified viewer_whit.html
Nobuyasu Oshiro <dimolto@cr.ie.u-ryukyu.ac.jp>
parents:
94
diff
changeset
|
176 if (typeof window.onload != 'function') { |
341766c5a6e9
modified viewer_whit.html
Nobuyasu Oshiro <dimolto@cr.ie.u-ryukyu.ac.jp>
parents:
94
diff
changeset
|
177 window.onload = func; |
341766c5a6e9
modified viewer_whit.html
Nobuyasu Oshiro <dimolto@cr.ie.u-ryukyu.ac.jp>
parents:
94
diff
changeset
|
178 } else { |
341766c5a6e9
modified viewer_whit.html
Nobuyasu Oshiro <dimolto@cr.ie.u-ryukyu.ac.jp>
parents:
94
diff
changeset
|
179 window.onload = function() { |
341766c5a6e9
modified viewer_whit.html
Nobuyasu Oshiro <dimolto@cr.ie.u-ryukyu.ac.jp>
parents:
94
diff
changeset
|
180 if (oldonload) { |
341766c5a6e9
modified viewer_whit.html
Nobuyasu Oshiro <dimolto@cr.ie.u-ryukyu.ac.jp>
parents:
94
diff
changeset
|
181 oldonload(); |
341766c5a6e9
modified viewer_whit.html
Nobuyasu Oshiro <dimolto@cr.ie.u-ryukyu.ac.jp>
parents:
94
diff
changeset
|
182 } |
341766c5a6e9
modified viewer_whit.html
Nobuyasu Oshiro <dimolto@cr.ie.u-ryukyu.ac.jp>
parents:
94
diff
changeset
|
183 func(); |
341766c5a6e9
modified viewer_whit.html
Nobuyasu Oshiro <dimolto@cr.ie.u-ryukyu.ac.jp>
parents:
94
diff
changeset
|
184 } |
341766c5a6e9
modified viewer_whit.html
Nobuyasu Oshiro <dimolto@cr.ie.u-ryukyu.ac.jp>
parents:
94
diff
changeset
|
185 } |
341766c5a6e9
modified viewer_whit.html
Nobuyasu Oshiro <dimolto@cr.ie.u-ryukyu.ac.jp>
parents:
94
diff
changeset
|
186 } |
341766c5a6e9
modified viewer_whit.html
Nobuyasu Oshiro <dimolto@cr.ie.u-ryukyu.ac.jp>
parents:
94
diff
changeset
|
187 |
341766c5a6e9
modified viewer_whit.html
Nobuyasu Oshiro <dimolto@cr.ie.u-ryukyu.ac.jp>
parents:
94
diff
changeset
|
188 addLoadEvent(function() { |
341766c5a6e9
modified viewer_whit.html
Nobuyasu Oshiro <dimolto@cr.ie.u-ryukyu.ac.jp>
parents:
94
diff
changeset
|
189 beginScript(); |
341766c5a6e9
modified viewer_whit.html
Nobuyasu Oshiro <dimolto@cr.ie.u-ryukyu.ac.jp>
parents:
94
diff
changeset
|
190 }); |
341766c5a6e9
modified viewer_whit.html
Nobuyasu Oshiro <dimolto@cr.ie.u-ryukyu.ac.jp>
parents:
94
diff
changeset
|
191 |
100
06e419562734
add jsPlumb code
Nobuyasu Oshiro <dimolto@cr.ie.u-ryukyu.ac.jp>
parents:
99
diff
changeset
|
192 function writeMiniDisplay(title,str) { |
06e419562734
add jsPlumb code
Nobuyasu Oshiro <dimolto@cr.ie.u-ryukyu.ac.jp>
parents:
99
diff
changeset
|
193 $('#miniDisplayBody')[0].innerHTML = str; |
06e419562734
add jsPlumb code
Nobuyasu Oshiro <dimolto@cr.ie.u-ryukyu.ac.jp>
parents:
99
diff
changeset
|
194 if(title) { |
06e419562734
add jsPlumb code
Nobuyasu Oshiro <dimolto@cr.ie.u-ryukyu.ac.jp>
parents:
99
diff
changeset
|
195 $('#miniDisplayTitle')[0].innerHTML = title; |
06e419562734
add jsPlumb code
Nobuyasu Oshiro <dimolto@cr.ie.u-ryukyu.ac.jp>
parents:
99
diff
changeset
|
196 } |
06e419562734
add jsPlumb code
Nobuyasu Oshiro <dimolto@cr.ie.u-ryukyu.ac.jp>
parents:
99
diff
changeset
|
197 } |
99 | 198 |
199 function writeJSONDataToMiniDisplay(jsonObj) { | |
200 var str = ""; | |
100
06e419562734
add jsPlumb code
Nobuyasu Oshiro <dimolto@cr.ie.u-ryukyu.ac.jp>
parents:
99
diff
changeset
|
201 for (var key in jsonObj.property) { |
06e419562734
add jsPlumb code
Nobuyasu Oshiro <dimolto@cr.ie.u-ryukyu.ac.jp>
parents:
99
diff
changeset
|
202 str = str + key + ": "+ jsonObj.property[key] + "<br>"; |
99 | 203 } |
100
06e419562734
add jsPlumb code
Nobuyasu Oshiro <dimolto@cr.ie.u-ryukyu.ac.jp>
parents:
99
diff
changeset
|
204 writeMiniDisplay(jsonObj.property.title, str); |
99 | 205 } |
206 | |
207 | |
208 function init() { | |
209 jsPlumb.importDefaults({ | |
100
06e419562734
add jsPlumb code
Nobuyasu Oshiro <dimolto@cr.ie.u-ryukyu.ac.jp>
parents:
99
diff
changeset
|
210 Connector : [ "Straight", { curviness:50 } ], |
99 | 211 PaintStyle : { strokeStyle:"gray", lineWidth:2 }, |
212 EndpointStyle : {}, | |
104
88c16240c78a
add jquery.jsPlumb-1.3.15-all-min.js
Nobuyasu Oshiro <dimolto@cr.ie.u-ryukyu.ac.jp>
parents:
103
diff
changeset
|
213 Anchors: ["BottomCenter","TopCenter"], |
99 | 214 }); |
215 } | |
216 | |
217 function showMiniDisplay(jsonInfo) { | |
218 $("#miniDisplay").css("visibility", "visible"); | |
219 writeJSONDataToMiniDisplay(jsonInfo) | |
220 } | |
221 | |
100
06e419562734
add jsPlumb code
Nobuyasu Oshiro <dimolto@cr.ie.u-ryukyu.ac.jp>
parents:
99
diff
changeset
|
222 var nodeNum = 0; |
104
88c16240c78a
add jquery.jsPlumb-1.3.15-all-min.js
Nobuyasu Oshiro <dimolto@cr.ie.u-ryukyu.ac.jp>
parents:
103
diff
changeset
|
223 |
88c16240c78a
add jquery.jsPlumb-1.3.15-all-min.js
Nobuyasu Oshiro <dimolto@cr.ie.u-ryukyu.ac.jp>
parents:
103
diff
changeset
|
224 function createNodeDiv(node) { |
88c16240c78a
add jquery.jsPlumb-1.3.15-all-min.js
Nobuyasu Oshiro <dimolto@cr.ie.u-ryukyu.ac.jp>
parents:
103
diff
changeset
|
225 node.view = $("<div class='graphNode'/>"); |
88c16240c78a
add jquery.jsPlumb-1.3.15-all-min.js
Nobuyasu Oshiro <dimolto@cr.ie.u-ryukyu.ac.jp>
parents:
103
diff
changeset
|
226 node.position = {x:nodeNum*50, y: nodeNum*50}; |
88c16240c78a
add jquery.jsPlumb-1.3.15-all-min.js
Nobuyasu Oshiro <dimolto@cr.ie.u-ryukyu.ac.jp>
parents:
103
diff
changeset
|
227 node.view.hover(); |
88c16240c78a
add jquery.jsPlumb-1.3.15-all-min.js
Nobuyasu Oshiro <dimolto@cr.ie.u-ryukyu.ac.jp>
parents:
103
diff
changeset
|
228 var div = $("<div class='graphNodeContent'/>")[0]; |
88c16240c78a
add jquery.jsPlumb-1.3.15-all-min.js
Nobuyasu Oshiro <dimolto@cr.ie.u-ryukyu.ac.jp>
parents:
103
diff
changeset
|
229 div.innerHTML = node.property.title; |
88c16240c78a
add jquery.jsPlumb-1.3.15-all-min.js
Nobuyasu Oshiro <dimolto@cr.ie.u-ryukyu.ac.jp>
parents:
103
diff
changeset
|
230 node.view[0].appendChild(div); |
88c16240c78a
add jquery.jsPlumb-1.3.15-all-min.js
Nobuyasu Oshiro <dimolto@cr.ie.u-ryukyu.ac.jp>
parents:
103
diff
changeset
|
231 nodeNum++; |
88c16240c78a
add jquery.jsPlumb-1.3.15-all-min.js
Nobuyasu Oshiro <dimolto@cr.ie.u-ryukyu.ac.jp>
parents:
103
diff
changeset
|
232 } |
88c16240c78a
add jquery.jsPlumb-1.3.15-all-min.js
Nobuyasu Oshiro <dimolto@cr.ie.u-ryukyu.ac.jp>
parents:
103
diff
changeset
|
233 |
100
06e419562734
add jsPlumb code
Nobuyasu Oshiro <dimolto@cr.ie.u-ryukyu.ac.jp>
parents:
99
diff
changeset
|
234 function updateNodeElement(node) { |
06e419562734
add jsPlumb code
Nobuyasu Oshiro <dimolto@cr.ie.u-ryukyu.ac.jp>
parents:
99
diff
changeset
|
235 var created = false; |
06e419562734
add jsPlumb code
Nobuyasu Oshiro <dimolto@cr.ie.u-ryukyu.ac.jp>
parents:
99
diff
changeset
|
236 if(!node.view) { |
06e419562734
add jsPlumb code
Nobuyasu Oshiro <dimolto@cr.ie.u-ryukyu.ac.jp>
parents:
99
diff
changeset
|
237 created = true; |
104
88c16240c78a
add jquery.jsPlumb-1.3.15-all-min.js
Nobuyasu Oshiro <dimolto@cr.ie.u-ryukyu.ac.jp>
parents:
103
diff
changeset
|
238 createNodeDiv(node); |
100
06e419562734
add jsPlumb code
Nobuyasu Oshiro <dimolto@cr.ie.u-ryukyu.ac.jp>
parents:
99
diff
changeset
|
239 } |
06e419562734
add jsPlumb code
Nobuyasu Oshiro <dimolto@cr.ie.u-ryukyu.ac.jp>
parents:
99
diff
changeset
|
240 var div = node.view; |
104
88c16240c78a
add jquery.jsPlumb-1.3.15-all-min.js
Nobuyasu Oshiro <dimolto@cr.ie.u-ryukyu.ac.jp>
parents:
103
diff
changeset
|
241 // div.text(node.property.title); |
100
06e419562734
add jsPlumb code
Nobuyasu Oshiro <dimolto@cr.ie.u-ryukyu.ac.jp>
parents:
99
diff
changeset
|
242 div.click(function(){showMiniDisplay(node)}); |
06e419562734
add jsPlumb code
Nobuyasu Oshiro <dimolto@cr.ie.u-ryukyu.ac.jp>
parents:
99
diff
changeset
|
243 DragHandler.attach($(node.view)[0]); |
06e419562734
add jsPlumb code
Nobuyasu Oshiro <dimolto@cr.ie.u-ryukyu.ac.jp>
parents:
99
diff
changeset
|
244 var kindBackground = {agree:"#aaf", rejected:"#fff"}; |
06e419562734
add jsPlumb code
Nobuyasu Oshiro <dimolto@cr.ie.u-ryukyu.ac.jp>
parents:
99
diff
changeset
|
245 var kindBorder = {agree:"#66a", rejected:"#a66"}; |
06e419562734
add jsPlumb code
Nobuyasu Oshiro <dimolto@cr.ie.u-ryukyu.ac.jp>
parents:
99
diff
changeset
|
246 div.css("background", kindBackground[node.kind]||"white"); |
06e419562734
add jsPlumb code
Nobuyasu Oshiro <dimolto@cr.ie.u-ryukyu.ac.jp>
parents:
99
diff
changeset
|
247 div.css("border-color", kindBorder[node.kind] ||"blue"); |
06e419562734
add jsPlumb code
Nobuyasu Oshiro <dimolto@cr.ie.u-ryukyu.ac.jp>
parents:
99
diff
changeset
|
248 div.css({ |
06e419562734
add jsPlumb code
Nobuyasu Oshiro <dimolto@cr.ie.u-ryukyu.ac.jp>
parents:
99
diff
changeset
|
249 left: node.position.x, |
06e419562734
add jsPlumb code
Nobuyasu Oshiro <dimolto@cr.ie.u-ryukyu.ac.jp>
parents:
99
diff
changeset
|
250 top: node.position.y |
06e419562734
add jsPlumb code
Nobuyasu Oshiro <dimolto@cr.ie.u-ryukyu.ac.jp>
parents:
99
diff
changeset
|
251 }); |
06e419562734
add jsPlumb code
Nobuyasu Oshiro <dimolto@cr.ie.u-ryukyu.ac.jp>
parents:
99
diff
changeset
|
252 return created; |
06e419562734
add jsPlumb code
Nobuyasu Oshiro <dimolto@cr.ie.u-ryukyu.ac.jp>
parents:
99
diff
changeset
|
253 } |
06e419562734
add jsPlumb code
Nobuyasu Oshiro <dimolto@cr.ie.u-ryukyu.ac.jp>
parents:
99
diff
changeset
|
254 |
06e419562734
add jsPlumb code
Nobuyasu Oshiro <dimolto@cr.ie.u-ryukyu.ac.jp>
parents:
99
diff
changeset
|
255 |
06e419562734
add jsPlumb code
Nobuyasu Oshiro <dimolto@cr.ie.u-ryukyu.ac.jp>
parents:
99
diff
changeset
|
256 function updateNode(node) { |
06e419562734
add jsPlumb code
Nobuyasu Oshiro <dimolto@cr.ie.u-ryukyu.ac.jp>
parents:
99
diff
changeset
|
257 if(updateNodeElement(node)) { |
06e419562734
add jsPlumb code
Nobuyasu Oshiro <dimolto@cr.ie.u-ryukyu.ac.jp>
parents:
99
diff
changeset
|
258 var fc = $('#graphRoot')[0].firstChild; |
06e419562734
add jsPlumb code
Nobuyasu Oshiro <dimolto@cr.ie.u-ryukyu.ac.jp>
parents:
99
diff
changeset
|
259 if(fc) { |
06e419562734
add jsPlumb code
Nobuyasu Oshiro <dimolto@cr.ie.u-ryukyu.ac.jp>
parents:
99
diff
changeset
|
260 $('#graphRoot')[0].insertBefore(node.view[0], fc); |
06e419562734
add jsPlumb code
Nobuyasu Oshiro <dimolto@cr.ie.u-ryukyu.ac.jp>
parents:
99
diff
changeset
|
261 } else { |
06e419562734
add jsPlumb code
Nobuyasu Oshiro <dimolto@cr.ie.u-ryukyu.ac.jp>
parents:
99
diff
changeset
|
262 $('#graphRoot').append(node.view); |
06e419562734
add jsPlumb code
Nobuyasu Oshiro <dimolto@cr.ie.u-ryukyu.ac.jp>
parents:
99
diff
changeset
|
263 } |
06e419562734
add jsPlumb code
Nobuyasu Oshiro <dimolto@cr.ie.u-ryukyu.ac.jp>
parents:
99
diff
changeset
|
264 } |
06e419562734
add jsPlumb code
Nobuyasu Oshiro <dimolto@cr.ie.u-ryukyu.ac.jp>
parents:
99
diff
changeset
|
265 nodeNum++; |
06e419562734
add jsPlumb code
Nobuyasu Oshiro <dimolto@cr.ie.u-ryukyu.ac.jp>
parents:
99
diff
changeset
|
266 |
06e419562734
add jsPlumb code
Nobuyasu Oshiro <dimolto@cr.ie.u-ryukyu.ac.jp>
parents:
99
diff
changeset
|
267 /* |
06e419562734
add jsPlumb code
Nobuyasu Oshiro <dimolto@cr.ie.u-ryukyu.ac.jp>
parents:
99
diff
changeset
|
268 node.view.css({ |
06e419562734
add jsPlumb code
Nobuyasu Oshiro <dimolto@cr.ie.u-ryukyu.ac.jp>
parents:
99
diff
changeset
|
269 left: node.position.x * ViewParam.intervalX - ViewParam.nodeWidth/2, |
06e419562734
add jsPlumb code
Nobuyasu Oshiro <dimolto@cr.ie.u-ryukyu.ac.jp>
parents:
99
diff
changeset
|
270 top: node.position.y * ViewParam.intervalY - ViewParam.nodeHeight/2 |
06e419562734
add jsPlumb code
Nobuyasu Oshiro <dimolto@cr.ie.u-ryukyu.ac.jp>
parents:
99
diff
changeset
|
271 }); |
06e419562734
add jsPlumb code
Nobuyasu Oshiro <dimolto@cr.ie.u-ryukyu.ac.jp>
parents:
99
diff
changeset
|
272 */ |
06e419562734
add jsPlumb code
Nobuyasu Oshiro <dimolto@cr.ie.u-ryukyu.ac.jp>
parents:
99
diff
changeset
|
273 } |
06e419562734
add jsPlumb code
Nobuyasu Oshiro <dimolto@cr.ie.u-ryukyu.ac.jp>
parents:
99
diff
changeset
|
274 |
06e419562734
add jsPlumb code
Nobuyasu Oshiro <dimolto@cr.ie.u-ryukyu.ac.jp>
parents:
99
diff
changeset
|
275 var ViewParam = { |
06e419562734
add jsPlumb code
Nobuyasu Oshiro <dimolto@cr.ie.u-ryukyu.ac.jp>
parents:
99
diff
changeset
|
276 offsetTop:100, |
06e419562734
add jsPlumb code
Nobuyasu Oshiro <dimolto@cr.ie.u-ryukyu.ac.jp>
parents:
99
diff
changeset
|
277 offsetBottom:100, |
06e419562734
add jsPlumb code
Nobuyasu Oshiro <dimolto@cr.ie.u-ryukyu.ac.jp>
parents:
99
diff
changeset
|
278 offsetLeft:100, |
06e419562734
add jsPlumb code
Nobuyasu Oshiro <dimolto@cr.ie.u-ryukyu.ac.jp>
parents:
99
diff
changeset
|
279 offsetRight:100, |
06e419562734
add jsPlumb code
Nobuyasu Oshiro <dimolto@cr.ie.u-ryukyu.ac.jp>
parents:
99
diff
changeset
|
280 nodeWidth:120, |
101
098e87253903
modfied jsPlumb
Nobuyasu Oshiro <dimolto@cr.ie.u-ryukyu.ac.jp>
parents:
100
diff
changeset
|
281 nodeHeight:60, |
100
06e419562734
add jsPlumb code
Nobuyasu Oshiro <dimolto@cr.ie.u-ryukyu.ac.jp>
parents:
99
diff
changeset
|
282 intervalX:140, |
06e419562734
add jsPlumb code
Nobuyasu Oshiro <dimolto@cr.ie.u-ryukyu.ac.jp>
parents:
99
diff
changeset
|
283 intervalY:120 |
06e419562734
add jsPlumb code
Nobuyasu Oshiro <dimolto@cr.ie.u-ryukyu.ac.jp>
parents:
99
diff
changeset
|
284 }; |
06e419562734
add jsPlumb code
Nobuyasu Oshiro <dimolto@cr.ie.u-ryukyu.ac.jp>
parents:
99
diff
changeset
|
285 |
99 | 286 function start() { |
287 init(); | |
100
06e419562734
add jsPlumb code
Nobuyasu Oshiro <dimolto@cr.ie.u-ryukyu.ac.jp>
parents:
99
diff
changeset
|
288 var rootNode = new Object(); |
06e419562734
add jsPlumb code
Nobuyasu Oshiro <dimolto@cr.ie.u-ryukyu.ac.jp>
parents:
99
diff
changeset
|
289 rootNode.property = sampleJSON1; |
102
8d8e6c2bfec2
modified viewer_white.html
Nobuyasu Oshiro <dimolto@cr.ie.u-ryukyu.ac.jp>
parents:
101
diff
changeset
|
290 // showMiniDisplay(rootNode); |
100
06e419562734
add jsPlumb code
Nobuyasu Oshiro <dimolto@cr.ie.u-ryukyu.ac.jp>
parents:
99
diff
changeset
|
291 updateNode(rootNode); |
99 | 292 $("#graphRoot").css({ |
100
06e419562734
add jsPlumb code
Nobuyasu Oshiro <dimolto@cr.ie.u-ryukyu.ac.jp>
parents:
99
diff
changeset
|
293 left: ViewParam.offsetLeft + ViewParam.nodeWidth/2 - ViewParam.intervalX, |
06e419562734
add jsPlumb code
Nobuyasu Oshiro <dimolto@cr.ie.u-ryukyu.ac.jp>
parents:
99
diff
changeset
|
294 top: ViewParam.offsetTop + ViewParam.nodeHeight/2 |
99 | 295 }); |
296 $("#graphMain").css({ | |
100
06e419562734
add jsPlumb code
Nobuyasu Oshiro <dimolto@cr.ie.u-ryukyu.ac.jp>
parents:
99
diff
changeset
|
297 width: ViewParam.intervalX * 1 + ViewParam.nodeWidth+ViewParam.offsetLeft + ViewParam.offsetRight, |
06e419562734
add jsPlumb code
Nobuyasu Oshiro <dimolto@cr.ie.u-ryukyu.ac.jp>
parents:
99
diff
changeset
|
298 height: ViewParam.intervalY * 1 + ViewParam.nodeHeight + ViewParam.offsetTop + ViewParam.offsetBottom, |
06e419562734
add jsPlumb code
Nobuyasu Oshiro <dimolto@cr.ie.u-ryukyu.ac.jp>
parents:
99
diff
changeset
|
299 top:50 |
99 | 300 }); |
301 | |
100
06e419562734
add jsPlumb code
Nobuyasu Oshiro <dimolto@cr.ie.u-ryukyu.ac.jp>
parents:
99
diff
changeset
|
302 /* test code */ |
06e419562734
add jsPlumb code
Nobuyasu Oshiro <dimolto@cr.ie.u-ryukyu.ac.jp>
parents:
99
diff
changeset
|
303 var n1 = {property:{title:"tokage"}}; |
06e419562734
add jsPlumb code
Nobuyasu Oshiro <dimolto@cr.ie.u-ryukyu.ac.jp>
parents:
99
diff
changeset
|
304 var n2 = {property:{title:"ttt"}}; |
06e419562734
add jsPlumb code
Nobuyasu Oshiro <dimolto@cr.ie.u-ryukyu.ac.jp>
parents:
99
diff
changeset
|
305 updateNode(n1); |
06e419562734
add jsPlumb code
Nobuyasu Oshiro <dimolto@cr.ie.u-ryukyu.ac.jp>
parents:
99
diff
changeset
|
306 updateNode(n2); |
101
098e87253903
modfied jsPlumb
Nobuyasu Oshiro <dimolto@cr.ie.u-ryukyu.ac.jp>
parents:
100
diff
changeset
|
307 |
098e87253903
modfied jsPlumb
Nobuyasu Oshiro <dimolto@cr.ie.u-ryukyu.ac.jp>
parents:
100
diff
changeset
|
308 var e1 = new Edge(rootNode, n1, "dependency"); |
098e87253903
modfied jsPlumb
Nobuyasu Oshiro <dimolto@cr.ie.u-ryukyu.ac.jp>
parents:
100
diff
changeset
|
309 var e2 = new Edge(n1, n2, "dependency"); |
098e87253903
modfied jsPlumb
Nobuyasu Oshiro <dimolto@cr.ie.u-ryukyu.ac.jp>
parents:
100
diff
changeset
|
310 edgeArray.push(e1); |
098e87253903
modfied jsPlumb
Nobuyasu Oshiro <dimolto@cr.ie.u-ryukyu.ac.jp>
parents:
100
diff
changeset
|
311 edgeArray.push(e2); |
098e87253903
modfied jsPlumb
Nobuyasu Oshiro <dimolto@cr.ie.u-ryukyu.ac.jp>
parents:
100
diff
changeset
|
312 paintEdge(); |
098e87253903
modfied jsPlumb
Nobuyasu Oshiro <dimolto@cr.ie.u-ryukyu.ac.jp>
parents:
100
diff
changeset
|
313 } |
098e87253903
modfied jsPlumb
Nobuyasu Oshiro <dimolto@cr.ie.u-ryukyu.ac.jp>
parents:
100
diff
changeset
|
314 |
098e87253903
modfied jsPlumb
Nobuyasu Oshiro <dimolto@cr.ie.u-ryukyu.ac.jp>
parents:
100
diff
changeset
|
315 var edgeArray = new Array(); |
098e87253903
modfied jsPlumb
Nobuyasu Oshiro <dimolto@cr.ie.u-ryukyu.ac.jp>
parents:
100
diff
changeset
|
316 function Edge(fromNode, toNode, relation) { |
098e87253903
modfied jsPlumb
Nobuyasu Oshiro <dimolto@cr.ie.u-ryukyu.ac.jp>
parents:
100
diff
changeset
|
317 var obj = {from:fromNode, to:toNode, rel:relation }; |
098e87253903
modfied jsPlumb
Nobuyasu Oshiro <dimolto@cr.ie.u-ryukyu.ac.jp>
parents:
100
diff
changeset
|
318 return obj; |
098e87253903
modfied jsPlumb
Nobuyasu Oshiro <dimolto@cr.ie.u-ryukyu.ac.jp>
parents:
100
diff
changeset
|
319 } |
098e87253903
modfied jsPlumb
Nobuyasu Oshiro <dimolto@cr.ie.u-ryukyu.ac.jp>
parents:
100
diff
changeset
|
320 |
104
88c16240c78a
add jquery.jsPlumb-1.3.15-all-min.js
Nobuyasu Oshiro <dimolto@cr.ie.u-ryukyu.ac.jp>
parents:
103
diff
changeset
|
321 var stateMachineConnector = { |
88c16240c78a
add jquery.jsPlumb-1.3.15-all-min.js
Nobuyasu Oshiro <dimolto@cr.ie.u-ryukyu.ac.jp>
parents:
103
diff
changeset
|
322 connector:"StateMachine", |
105
9bf5e984f288
modified label
Nobuyasu Oshiro <dimolto@cr.ie.u-ryukyu.ac.jp>
parents:
104
diff
changeset
|
323 // paintStyle:{lineWidth:3,strokeStyle:"#056"}, |
9bf5e984f288
modified label
Nobuyasu Oshiro <dimolto@cr.ie.u-ryukyu.ac.jp>
parents:
104
diff
changeset
|
324 paintStyle:{lineWidth:2,strokeStyle:"#aaf"}, |
104
88c16240c78a
add jquery.jsPlumb-1.3.15-all-min.js
Nobuyasu Oshiro <dimolto@cr.ie.u-ryukyu.ac.jp>
parents:
103
diff
changeset
|
325 hoverPaintStyle:{strokeStyle:"#dbe300"}, |
88c16240c78a
add jquery.jsPlumb-1.3.15-all-min.js
Nobuyasu Oshiro <dimolto@cr.ie.u-ryukyu.ac.jp>
parents:
103
diff
changeset
|
326 endpoint:"Blank", |
88c16240c78a
add jquery.jsPlumb-1.3.15-all-min.js
Nobuyasu Oshiro <dimolto@cr.ie.u-ryukyu.ac.jp>
parents:
103
diff
changeset
|
327 anchor:"Continuous", |
88c16240c78a
add jquery.jsPlumb-1.3.15-all-min.js
Nobuyasu Oshiro <dimolto@cr.ie.u-ryukyu.ac.jp>
parents:
103
diff
changeset
|
328 overlays:[ ["PlainArrow", {location:1, width:20, length:12} ]] |
88c16240c78a
add jquery.jsPlumb-1.3.15-all-min.js
Nobuyasu Oshiro <dimolto@cr.ie.u-ryukyu.ac.jp>
parents:
103
diff
changeset
|
329 }; |
101
098e87253903
modfied jsPlumb
Nobuyasu Oshiro <dimolto@cr.ie.u-ryukyu.ac.jp>
parents:
100
diff
changeset
|
330 function paintEdge() { |
104
88c16240c78a
add jquery.jsPlumb-1.3.15-all-min.js
Nobuyasu Oshiro <dimolto@cr.ie.u-ryukyu.ac.jp>
parents:
103
diff
changeset
|
331 |
101
098e87253903
modfied jsPlumb
Nobuyasu Oshiro <dimolto@cr.ie.u-ryukyu.ac.jp>
parents:
100
diff
changeset
|
332 var array = edgeArray; |
098e87253903
modfied jsPlumb
Nobuyasu Oshiro <dimolto@cr.ie.u-ryukyu.ac.jp>
parents:
100
diff
changeset
|
333 for (var i=0; i<array.length; i++) { |
098e87253903
modfied jsPlumb
Nobuyasu Oshiro <dimolto@cr.ie.u-ryukyu.ac.jp>
parents:
100
diff
changeset
|
334 var fromNode = array[i].from; |
098e87253903
modfied jsPlumb
Nobuyasu Oshiro <dimolto@cr.ie.u-ryukyu.ac.jp>
parents:
100
diff
changeset
|
335 var toNode = array[i].to; |
098e87253903
modfied jsPlumb
Nobuyasu Oshiro <dimolto@cr.ie.u-ryukyu.ac.jp>
parents:
100
diff
changeset
|
336 var rel = array[i].rel; |
104
88c16240c78a
add jquery.jsPlumb-1.3.15-all-min.js
Nobuyasu Oshiro <dimolto@cr.ie.u-ryukyu.ac.jp>
parents:
103
diff
changeset
|
337 var c = jsPlumb.connect({source:fromNode.view[0], target:toNode.view[0]}, stateMachineConnector); |
105
9bf5e984f288
modified label
Nobuyasu Oshiro <dimolto@cr.ie.u-ryukyu.ac.jp>
parents:
104
diff
changeset
|
338 c.setLabel({label:"<span style='color:black;'>"+rel+"</span>",cssStyle:"color:black"}); |
101
098e87253903
modfied jsPlumb
Nobuyasu Oshiro <dimolto@cr.ie.u-ryukyu.ac.jp>
parents:
100
diff
changeset
|
339 } |
098e87253903
modfied jsPlumb
Nobuyasu Oshiro <dimolto@cr.ie.u-ryukyu.ac.jp>
parents:
100
diff
changeset
|
340 jsPlumb.removeAllEndpoints(); |
098e87253903
modfied jsPlumb
Nobuyasu Oshiro <dimolto@cr.ie.u-ryukyu.ac.jp>
parents:
100
diff
changeset
|
341 jsPlumb.draggable($('.graphNode')); |
104
88c16240c78a
add jquery.jsPlumb-1.3.15-all-min.js
Nobuyasu Oshiro <dimolto@cr.ie.u-ryukyu.ac.jp>
parents:
103
diff
changeset
|
342 /* |
101
098e87253903
modfied jsPlumb
Nobuyasu Oshiro <dimolto@cr.ie.u-ryukyu.ac.jp>
parents:
100
diff
changeset
|
343 jsPlumb.repaintEverything(); |
104
88c16240c78a
add jquery.jsPlumb-1.3.15-all-min.js
Nobuyasu Oshiro <dimolto@cr.ie.u-ryukyu.ac.jp>
parents:
103
diff
changeset
|
344 */ |
99 | 345 } |
346 | |
347 /* sample data */ | |
348 sampleJSON1 = { | |
349 id:"5", | |
350 title:"dimolto", | |
351 kind:"agreed", | |
352 createdUser:"oshiro", | |
353 createdDate: new Date() | |
354 }; | |
355 | |
94
bf0cd5920429
modfied viewer_white.html
Nobuyasu Oshiro <dimolto@cr.ie.u-ryukyu.ac.jp>
parents:
diff
changeset
|
356 </script> |
bf0cd5920429
modfied viewer_white.html
Nobuyasu Oshiro <dimolto@cr.ie.u-ryukyu.ac.jp>
parents:
diff
changeset
|
357 |