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
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
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
b0fda0545bce add jsPlumb
Nobuyasu Oshiro <dimolto@cr.ie.u-ryukyu.ac.jp>
parents: 98
diff changeset
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
b0fda0545bce add jsPlumb
Nobuyasu Oshiro <dimolto@cr.ie.u-ryukyu.ac.jp>
parents: 98
diff changeset
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
b0fda0545bce add jsPlumb
Nobuyasu Oshiro <dimolto@cr.ie.u-ryukyu.ac.jp>
parents: 98
diff changeset
49 border:2px solid silver;
b0fda0545bce add jsPlumb
Nobuyasu Oshiro <dimolto@cr.ie.u-ryukyu.ac.jp>
parents: 98
diff changeset
50 overflow:hidden;
b0fda0545bce add jsPlumb
Nobuyasu Oshiro <dimolto@cr.ie.u-ryukyu.ac.jp>
parents: 98
diff changeset
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
b0fda0545bce add jsPlumb
Nobuyasu Oshiro <dimolto@cr.ie.u-ryukyu.ac.jp>
parents: 98
diff changeset
67 <div class='header'>
b0fda0545bce add jsPlumb
Nobuyasu Oshiro <dimolto@cr.ie.u-ryukyu.ac.jp>
parents: 98
diff changeset
68 <nobr id='header_title' style='margin-left:40px;'><a href='index.html'>Home</a></nobr>
b0fda0545bce add jsPlumb
Nobuyasu Oshiro <dimolto@cr.ie.u-ryukyu.ac.jp>
parents: 98
diff changeset
69 </div>
b0fda0545bce add jsPlumb
Nobuyasu Oshiro <dimolto@cr.ie.u-ryukyu.ac.jp>
parents: 98
diff changeset
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
b0fda0545bce add jsPlumb
Nobuyasu Oshiro <dimolto@cr.ie.u-ryukyu.ac.jp>
parents: 98
diff changeset
72 <div style='position:absolute; left:0; top:0; width:100%; height:100%; background:black; opacity:0.5;'> </div>
b0fda0545bce add jsPlumb
Nobuyasu Oshiro <dimolto@cr.ie.u-ryukyu.ac.jp>
parents: 98
diff changeset
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>
b0fda0545bce add jsPlumb
Nobuyasu Oshiro <dimolto@cr.ie.u-ryukyu.ac.jp>
parents: 98
diff changeset
74 <div style='position:absolute; width:90%; height:90%;'>
b0fda0545bce add jsPlumb
Nobuyasu Oshiro <dimolto@cr.ie.u-ryukyu.ac.jp>
parents: 98
diff changeset
75 <div style='position:absolute; left:5%; top:5%; width:100%; height:100%; background:white;'>
b0fda0545bce add jsPlumb
Nobuyasu Oshiro <dimolto@cr.ie.u-ryukyu.ac.jp>
parents: 98
diff changeset
76 <div id="miniDisplayTitle" style='position:absolute; left:10px; top:5px; font-size:24px; width:100%; text-align:left;'>
b0fda0545bce add jsPlumb
Nobuyasu Oshiro <dimolto@cr.ie.u-ryukyu.ac.jp>
parents: 98
diff changeset
77 </div>
b0fda0545bce add jsPlumb
Nobuyasu Oshiro <dimolto@cr.ie.u-ryukyu.ac.jp>
parents: 98
diff changeset
78 <div id="miniDisplayBody" style='position:absolute; left:20px; top:40px;'>
b0fda0545bce add jsPlumb
Nobuyasu Oshiro <dimolto@cr.ie.u-ryukyu.ac.jp>
parents: 98
diff changeset
79 body
b0fda0545bce add jsPlumb
Nobuyasu Oshiro <dimolto@cr.ie.u-ryukyu.ac.jp>
parents: 98
diff changeset
80 </div>
b0fda0545bce add jsPlumb
Nobuyasu Oshiro <dimolto@cr.ie.u-ryukyu.ac.jp>
parents: 98
diff changeset
81 </form>
b0fda0545bce add jsPlumb
Nobuyasu Oshiro <dimolto@cr.ie.u-ryukyu.ac.jp>
parents: 98
diff changeset
82 </div>
b0fda0545bce add jsPlumb
Nobuyasu Oshiro <dimolto@cr.ie.u-ryukyu.ac.jp>
parents: 98
diff changeset
83 </div>
b0fda0545bce add jsPlumb
Nobuyasu Oshiro <dimolto@cr.ie.u-ryukyu.ac.jp>
parents: 98
diff changeset
84 </div>
b0fda0545bce add jsPlumb
Nobuyasu Oshiro <dimolto@cr.ie.u-ryukyu.ac.jp>
parents: 98
diff changeset
85
b0fda0545bce add jsPlumb
Nobuyasu Oshiro <dimolto@cr.ie.u-ryukyu.ac.jp>
parents: 98
diff changeset
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
b0fda0545bce add jsPlumb
Nobuyasu Oshiro <dimolto@cr.ie.u-ryukyu.ac.jp>
parents: 98
diff changeset
88 </div>
b0fda0545bce add jsPlumb
Nobuyasu Oshiro <dimolto@cr.ie.u-ryukyu.ac.jp>
parents: 98
diff changeset
89 </div>
b0fda0545bce add jsPlumb
Nobuyasu Oshiro <dimolto@cr.ie.u-ryukyu.ac.jp>
parents: 98
diff changeset
90
b0fda0545bce add jsPlumb
Nobuyasu Oshiro <dimolto@cr.ie.u-ryukyu.ac.jp>
parents: 98
diff changeset
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
b0fda0545bce add jsPlumb
Nobuyasu Oshiro <dimolto@cr.ie.u-ryukyu.ac.jp>
parents: 98
diff changeset
198
b0fda0545bce add jsPlumb
Nobuyasu Oshiro <dimolto@cr.ie.u-ryukyu.ac.jp>
parents: 98
diff changeset
199 function writeJSONDataToMiniDisplay(jsonObj) {
b0fda0545bce add jsPlumb
Nobuyasu Oshiro <dimolto@cr.ie.u-ryukyu.ac.jp>
parents: 98
diff changeset
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
b0fda0545bce add jsPlumb
Nobuyasu Oshiro <dimolto@cr.ie.u-ryukyu.ac.jp>
parents: 98
diff changeset
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
b0fda0545bce add jsPlumb
Nobuyasu Oshiro <dimolto@cr.ie.u-ryukyu.ac.jp>
parents: 98
diff changeset
205 }
b0fda0545bce add jsPlumb
Nobuyasu Oshiro <dimolto@cr.ie.u-ryukyu.ac.jp>
parents: 98
diff changeset
206
b0fda0545bce add jsPlumb
Nobuyasu Oshiro <dimolto@cr.ie.u-ryukyu.ac.jp>
parents: 98
diff changeset
207
b0fda0545bce add jsPlumb
Nobuyasu Oshiro <dimolto@cr.ie.u-ryukyu.ac.jp>
parents: 98
diff changeset
208 function init() {
b0fda0545bce add jsPlumb
Nobuyasu Oshiro <dimolto@cr.ie.u-ryukyu.ac.jp>
parents: 98
diff changeset
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
b0fda0545bce add jsPlumb
Nobuyasu Oshiro <dimolto@cr.ie.u-ryukyu.ac.jp>
parents: 98
diff changeset
211 PaintStyle : { strokeStyle:"gray", lineWidth:2 },
b0fda0545bce add jsPlumb
Nobuyasu Oshiro <dimolto@cr.ie.u-ryukyu.ac.jp>
parents: 98
diff changeset
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
b0fda0545bce add jsPlumb
Nobuyasu Oshiro <dimolto@cr.ie.u-ryukyu.ac.jp>
parents: 98
diff changeset
214 });
b0fda0545bce add jsPlumb
Nobuyasu Oshiro <dimolto@cr.ie.u-ryukyu.ac.jp>
parents: 98
diff changeset
215 }
b0fda0545bce add jsPlumb
Nobuyasu Oshiro <dimolto@cr.ie.u-ryukyu.ac.jp>
parents: 98
diff changeset
216
b0fda0545bce add jsPlumb
Nobuyasu Oshiro <dimolto@cr.ie.u-ryukyu.ac.jp>
parents: 98
diff changeset
217 function showMiniDisplay(jsonInfo) {
b0fda0545bce add jsPlumb
Nobuyasu Oshiro <dimolto@cr.ie.u-ryukyu.ac.jp>
parents: 98
diff changeset
218 $("#miniDisplay").css("visibility", "visible");
b0fda0545bce add jsPlumb
Nobuyasu Oshiro <dimolto@cr.ie.u-ryukyu.ac.jp>
parents: 98
diff changeset
219 writeJSONDataToMiniDisplay(jsonInfo)
b0fda0545bce add jsPlumb
Nobuyasu Oshiro <dimolto@cr.ie.u-ryukyu.ac.jp>
parents: 98
diff changeset
220 }
b0fda0545bce add jsPlumb
Nobuyasu Oshiro <dimolto@cr.ie.u-ryukyu.ac.jp>
parents: 98
diff changeset
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
b0fda0545bce add jsPlumb
Nobuyasu Oshiro <dimolto@cr.ie.u-ryukyu.ac.jp>
parents: 98
diff changeset
286 function start() {
b0fda0545bce add jsPlumb
Nobuyasu Oshiro <dimolto@cr.ie.u-ryukyu.ac.jp>
parents: 98
diff changeset
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
b0fda0545bce add jsPlumb
Nobuyasu Oshiro <dimolto@cr.ie.u-ryukyu.ac.jp>
parents: 98
diff changeset
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
b0fda0545bce add jsPlumb
Nobuyasu Oshiro <dimolto@cr.ie.u-ryukyu.ac.jp>
parents: 98
diff changeset
295 });
b0fda0545bce add jsPlumb
Nobuyasu Oshiro <dimolto@cr.ie.u-ryukyu.ac.jp>
parents: 98
diff changeset
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
b0fda0545bce add jsPlumb
Nobuyasu Oshiro <dimolto@cr.ie.u-ryukyu.ac.jp>
parents: 98
diff changeset
300 });
b0fda0545bce add jsPlumb
Nobuyasu Oshiro <dimolto@cr.ie.u-ryukyu.ac.jp>
parents: 98
diff changeset
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
b0fda0545bce add jsPlumb
Nobuyasu Oshiro <dimolto@cr.ie.u-ryukyu.ac.jp>
parents: 98
diff changeset
345 }
b0fda0545bce add jsPlumb
Nobuyasu Oshiro <dimolto@cr.ie.u-ryukyu.ac.jp>
parents: 98
diff changeset
346
b0fda0545bce add jsPlumb
Nobuyasu Oshiro <dimolto@cr.ie.u-ryukyu.ac.jp>
parents: 98
diff changeset
347 /* sample data */
b0fda0545bce add jsPlumb
Nobuyasu Oshiro <dimolto@cr.ie.u-ryukyu.ac.jp>
parents: 98
diff changeset
348 sampleJSON1 = {
b0fda0545bce add jsPlumb
Nobuyasu Oshiro <dimolto@cr.ie.u-ryukyu.ac.jp>
parents: 98
diff changeset
349 id:"5",
b0fda0545bce add jsPlumb
Nobuyasu Oshiro <dimolto@cr.ie.u-ryukyu.ac.jp>
parents: 98
diff changeset
350 title:"dimolto",
b0fda0545bce add jsPlumb
Nobuyasu Oshiro <dimolto@cr.ie.u-ryukyu.ac.jp>
parents: 98
diff changeset
351 kind:"agreed",
b0fda0545bce add jsPlumb
Nobuyasu Oshiro <dimolto@cr.ie.u-ryukyu.ac.jp>
parents: 98
diff changeset
352 createdUser:"oshiro",
b0fda0545bce add jsPlumb
Nobuyasu Oshiro <dimolto@cr.ie.u-ryukyu.ac.jp>
parents: 98
diff changeset
353 createdDate: new Date()
b0fda0545bce add jsPlumb
Nobuyasu Oshiro <dimolto@cr.ie.u-ryukyu.ac.jp>
parents: 98
diff changeset
354 };
b0fda0545bce add jsPlumb
Nobuyasu Oshiro <dimolto@cr.ie.u-ryukyu.ac.jp>
parents: 98
diff changeset
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