annotate public/viewer/viewer_white.html @ 107:42799d9c3753 draft

create parseJSONDate function
author Nobuyasu Oshiro <dimolto@cr.ie.u-ryukyu.ac.jp>
date Sun, 17 Mar 2013 19:53:59 +0900
parents 60a0ff0b3096
children bf0b1f71ac81
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" />
106
60a0ff0b3096 modified viewer_white.html
Nobuyasu Oshiro <dimolto@cr.ie.u-ryukyu.ac.jp>
parents: 105
diff changeset
2 <title>Graph Display</title>
94
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
106
60a0ff0b3096 modified viewer_white.html
Nobuyasu Oshiro <dimolto@cr.ie.u-ryukyu.ac.jp>
parents: 105
diff changeset
71 <div id="miniDisplay" style='position:fixed; left:0; top:70; width:250px; height:250px; border:solid 1px; border-radius:5px; opacity:0.5; z-index:10; visibility:hidden;'>
60a0ff0b3096 modified viewer_white.html
Nobuyasu Oshiro <dimolto@cr.ie.u-ryukyu.ac.jp>
parents: 105
diff changeset
72 <div style='position:absolute; left:0; top:0; width:100%; height:100%; background:black; opacity:0.5;'> </div>
60a0ff0b3096 modified viewer_white.html
Nobuyasu Oshiro <dimolto@cr.ie.u-ryukyu.ac.jp>
parents: 105
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>
60a0ff0b3096 modified viewer_white.html
Nobuyasu Oshiro <dimolto@cr.ie.u-ryukyu.ac.jp>
parents: 105
diff changeset
74 <div style='position:absolute; width:90%; height:90%;'>
60a0ff0b3096 modified viewer_white.html
Nobuyasu Oshiro <dimolto@cr.ie.u-ryukyu.ac.jp>
parents: 105
diff changeset
75 <div style='position:absolute; left:5%; top:5%; width:100%; height:100%; background:white;'>
60a0ff0b3096 modified viewer_white.html
Nobuyasu Oshiro <dimolto@cr.ie.u-ryukyu.ac.jp>
parents: 105
diff changeset
76 <div id="miniDisplayTitle" style='position:absolute; left:10px; top:5px; font-size:24px; width:100%; text-align:left;'>
60a0ff0b3096 modified viewer_white.html
Nobuyasu Oshiro <dimolto@cr.ie.u-ryukyu.ac.jp>
parents: 105
diff changeset
77 </div>
60a0ff0b3096 modified viewer_white.html
Nobuyasu Oshiro <dimolto@cr.ie.u-ryukyu.ac.jp>
parents: 105
diff changeset
78 <div id="miniDisplayBody" style='position:absolute; left:20px; top:40px;'>
60a0ff0b3096 modified viewer_white.html
Nobuyasu Oshiro <dimolto@cr.ie.u-ryukyu.ac.jp>
parents: 105
diff changeset
79 </div>
60a0ff0b3096 modified viewer_white.html
Nobuyasu Oshiro <dimolto@cr.ie.u-ryukyu.ac.jp>
parents: 105
diff changeset
80 </div>
60a0ff0b3096 modified viewer_white.html
Nobuyasu Oshiro <dimolto@cr.ie.u-ryukyu.ac.jp>
parents: 105
diff changeset
81 </div>
99
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
106
60a0ff0b3096 modified viewer_white.html
Nobuyasu Oshiro <dimolto@cr.ie.u-ryukyu.ac.jp>
parents: 105
diff changeset
84
99
b0fda0545bce add jsPlumb
Nobuyasu Oshiro <dimolto@cr.ie.u-ryukyu.ac.jp>
parents: 98
diff changeset
85 <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
86 <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
87 </div>
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
b0fda0545bce add jsPlumb
Nobuyasu Oshiro <dimolto@cr.ie.u-ryukyu.ac.jp>
parents: 98
diff changeset
90
94
bf0cd5920429 modfied viewer_white.html
Nobuyasu Oshiro <dimolto@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
91 <script type="text/javascript">
bf0cd5920429 modfied viewer_white.html
Nobuyasu Oshiro <dimolto@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
92 var LOAD_INTERVAL = 5;
bf0cd5920429 modfied viewer_white.html
Nobuyasu Oshiro <dimolto@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
93 var BASE_URL = "";
bf0cd5920429 modfied viewer_white.html
Nobuyasu Oshiro <dimolto@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
94 if(!Array.prototype.filter){
bf0cd5920429 modfied viewer_white.html
Nobuyasu Oshiro <dimolto@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
95 Array.prototype.filter=function(func){
bf0cd5920429 modfied viewer_white.html
Nobuyasu Oshiro <dimolto@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
96 var arr=[];
bf0cd5920429 modfied viewer_white.html
Nobuyasu Oshiro <dimolto@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
97 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
98 return arr;
bf0cd5920429 modfied viewer_white.html
Nobuyasu Oshiro <dimolto@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
99 }
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 var treeInfo;
bf0cd5920429 modfied viewer_white.html
Nobuyasu Oshiro <dimolto@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
103 var userList = [];
bf0cd5920429 modfied viewer_white.html
Nobuyasu Oshiro <dimolto@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
104 var root_id;
bf0cd5920429 modfied viewer_white.html
Nobuyasu Oshiro <dimolto@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
105 function loadConsensus(id) {
bf0cd5920429 modfied viewer_white.html
Nobuyasu Oshiro <dimolto@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
106 function onload(json) {
bf0cd5920429 modfied viewer_white.html
Nobuyasu Oshiro <dimolto@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
107 var title = json.hogehoge ? json.hogehoge : "title";
bf0cd5920429 modfied viewer_white.html
Nobuyasu Oshiro <dimolto@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
108 document.title = title;
bf0cd5920429 modfied viewer_white.html
Nobuyasu Oshiro <dimolto@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
109 $('#headertitle_main').text(title)
bf0cd5920429 modfied viewer_white.html
Nobuyasu Oshiro <dimolto@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
110 }
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 function loadUserList() {
bf0cd5920429 modfied viewer_white.html
Nobuyasu Oshiro <dimolto@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
114 $.ajax({
bf0cd5920429 modfied viewer_white.html
Nobuyasu Oshiro <dimolto@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
115 url:BASE_URL + "/users/all",
bf0cd5920429 modfied viewer_white.html
Nobuyasu Oshiro <dimolto@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
116 success:function(o) { userList = o.sort(); showUserList([]); },
bf0cd5920429 modfied viewer_white.html
Nobuyasu Oshiro <dimolto@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
117 type:"GET", cache:false,
bf0cd5920429 modfied viewer_white.html
Nobuyasu Oshiro <dimolto@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
118 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
119 });
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 $(function() {
bf0cd5920429 modfied viewer_white.html
Nobuyasu Oshiro <dimolto@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
123 userName = localStorage.userName;
100
06e419562734 add jsPlumb code
Nobuyasu Oshiro <dimolto@cr.ie.u-ryukyu.ac.jp>
parents: 99
diff changeset
124 if(userName) {start();}
102
8d8e6c2bfec2 modified viewer_white.html
Nobuyasu Oshiro <dimolto@cr.ie.u-ryukyu.ac.jp>
parents: 101
diff changeset
125 else { }
94
bf0cd5920429 modfied viewer_white.html
Nobuyasu Oshiro <dimolto@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
126 })
bf0cd5920429 modfied viewer_white.html
Nobuyasu Oshiro <dimolto@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
127
95
341766c5a6e9 modified viewer_whit.html
Nobuyasu Oshiro <dimolto@cr.ie.u-ryukyu.ac.jp>
parents: 94
diff changeset
128 function beginScript() {
97
5098c4967a3a modified miniDisplay
Nobuyasu Oshiro <dimolto@cr.ie.u-ryukyu.ac.jp>
parents: 96
diff changeset
129 DragHandler.attach($('#miniDisplay')[0]);
95
341766c5a6e9 modified viewer_whit.html
Nobuyasu Oshiro <dimolto@cr.ie.u-ryukyu.ac.jp>
parents: 94
diff changeset
130 }
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 var DragHandler = {
341766c5a6e9 modified viewer_whit.html
Nobuyasu Oshiro <dimolto@cr.ie.u-ryukyu.ac.jp>
parents: 94
diff changeset
133 _oElem : null,
341766c5a6e9 modified viewer_whit.html
Nobuyasu Oshiro <dimolto@cr.ie.u-ryukyu.ac.jp>
parents: 94
diff changeset
134 attach : function(oElem) {
341766c5a6e9 modified viewer_whit.html
Nobuyasu Oshiro <dimolto@cr.ie.u-ryukyu.ac.jp>
parents: 94
diff changeset
135 oElem.onmousedown = DragHandler._dragBegin;
341766c5a6e9 modified viewer_whit.html
Nobuyasu Oshiro <dimolto@cr.ie.u-ryukyu.ac.jp>
parents: 94
diff changeset
136 return oElem;
341766c5a6e9 modified viewer_whit.html
Nobuyasu Oshiro <dimolto@cr.ie.u-ryukyu.ac.jp>
parents: 94
diff changeset
137 },
341766c5a6e9 modified viewer_whit.html
Nobuyasu Oshiro <dimolto@cr.ie.u-ryukyu.ac.jp>
parents: 94
diff changeset
138 _dragBegin : function(e) {
341766c5a6e9 modified viewer_whit.html
Nobuyasu Oshiro <dimolto@cr.ie.u-ryukyu.ac.jp>
parents: 94
diff changeset
139 var oElem = DragHandler._oElem = this;
341766c5a6e9 modified viewer_whit.html
Nobuyasu Oshiro <dimolto@cr.ie.u-ryukyu.ac.jp>
parents: 94
diff changeset
140 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
141 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
142 var x = parseInt(oElem.style.left);
341766c5a6e9 modified viewer_whit.html
Nobuyasu Oshiro <dimolto@cr.ie.u-ryukyu.ac.jp>
parents: 94
diff changeset
143 var y = parseInt(oElem.style.top);
341766c5a6e9 modified viewer_whit.html
Nobuyasu Oshiro <dimolto@cr.ie.u-ryukyu.ac.jp>
parents: 94
diff changeset
144 e = e ? e : window.event;
341766c5a6e9 modified viewer_whit.html
Nobuyasu Oshiro <dimolto@cr.ie.u-ryukyu.ac.jp>
parents: 94
diff changeset
145 oElem.mouseX = e.clientX;
341766c5a6e9 modified viewer_whit.html
Nobuyasu Oshiro <dimolto@cr.ie.u-ryukyu.ac.jp>
parents: 94
diff changeset
146 oElem.mouseY = e.clientY;
341766c5a6e9 modified viewer_whit.html
Nobuyasu Oshiro <dimolto@cr.ie.u-ryukyu.ac.jp>
parents: 94
diff changeset
147 document.onmousemove = DragHandler._drag;
341766c5a6e9 modified viewer_whit.html
Nobuyasu Oshiro <dimolto@cr.ie.u-ryukyu.ac.jp>
parents: 94
diff changeset
148 document.onmouseup = DragHandler._dragEnd;
341766c5a6e9 modified viewer_whit.html
Nobuyasu Oshiro <dimolto@cr.ie.u-ryukyu.ac.jp>
parents: 94
diff changeset
149 return false;
341766c5a6e9 modified viewer_whit.html
Nobuyasu Oshiro <dimolto@cr.ie.u-ryukyu.ac.jp>
parents: 94
diff changeset
150 },
341766c5a6e9 modified viewer_whit.html
Nobuyasu Oshiro <dimolto@cr.ie.u-ryukyu.ac.jp>
parents: 94
diff changeset
151 _drag : function(e) {
341766c5a6e9 modified viewer_whit.html
Nobuyasu Oshiro <dimolto@cr.ie.u-ryukyu.ac.jp>
parents: 94
diff changeset
152 var oElem = DragHandler._oElem;
341766c5a6e9 modified viewer_whit.html
Nobuyasu Oshiro <dimolto@cr.ie.u-ryukyu.ac.jp>
parents: 94
diff changeset
153 var x = parseInt(oElem.style.left);
341766c5a6e9 modified viewer_whit.html
Nobuyasu Oshiro <dimolto@cr.ie.u-ryukyu.ac.jp>
parents: 94
diff changeset
154 var y = parseInt(oElem.style.top);
341766c5a6e9 modified viewer_whit.html
Nobuyasu Oshiro <dimolto@cr.ie.u-ryukyu.ac.jp>
parents: 94
diff changeset
155 e = e ? e : window.event;
341766c5a6e9 modified viewer_whit.html
Nobuyasu Oshiro <dimolto@cr.ie.u-ryukyu.ac.jp>
parents: 94
diff changeset
156 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
157 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
158 oElem.mouseX = e.clientX;
341766c5a6e9 modified viewer_whit.html
Nobuyasu Oshiro <dimolto@cr.ie.u-ryukyu.ac.jp>
parents: 94
diff changeset
159 oElem.mouseY = e.clientY;
341766c5a6e9 modified viewer_whit.html
Nobuyasu Oshiro <dimolto@cr.ie.u-ryukyu.ac.jp>
parents: 94
diff changeset
160 return false;
341766c5a6e9 modified viewer_whit.html
Nobuyasu Oshiro <dimolto@cr.ie.u-ryukyu.ac.jp>
parents: 94
diff changeset
161 },
341766c5a6e9 modified viewer_whit.html
Nobuyasu Oshiro <dimolto@cr.ie.u-ryukyu.ac.jp>
parents: 94
diff changeset
162 _dragEnd : function() {
341766c5a6e9 modified viewer_whit.html
Nobuyasu Oshiro <dimolto@cr.ie.u-ryukyu.ac.jp>
parents: 94
diff changeset
163 var oElem = DragHandler._oElem;
341766c5a6e9 modified viewer_whit.html
Nobuyasu Oshiro <dimolto@cr.ie.u-ryukyu.ac.jp>
parents: 94
diff changeset
164 var x = parseInt(oElem.style.left);
341766c5a6e9 modified viewer_whit.html
Nobuyasu Oshiro <dimolto@cr.ie.u-ryukyu.ac.jp>
parents: 94
diff changeset
165 var y = parseInt(oElem.style.top);
341766c5a6e9 modified viewer_whit.html
Nobuyasu Oshiro <dimolto@cr.ie.u-ryukyu.ac.jp>
parents: 94
diff changeset
166 document.onmousemove = null;
341766c5a6e9 modified viewer_whit.html
Nobuyasu Oshiro <dimolto@cr.ie.u-ryukyu.ac.jp>
parents: 94
diff changeset
167 document.onmouseup = null;
341766c5a6e9 modified viewer_whit.html
Nobuyasu Oshiro <dimolto@cr.ie.u-ryukyu.ac.jp>
parents: 94
diff changeset
168 DragHandler._oElem = null;
341766c5a6e9 modified viewer_whit.html
Nobuyasu Oshiro <dimolto@cr.ie.u-ryukyu.ac.jp>
parents: 94
diff changeset
169 }
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 function addLoadEvent(func) {
341766c5a6e9 modified viewer_whit.html
Nobuyasu Oshiro <dimolto@cr.ie.u-ryukyu.ac.jp>
parents: 94
diff changeset
174 var oldonload = window.onload;
341766c5a6e9 modified viewer_whit.html
Nobuyasu Oshiro <dimolto@cr.ie.u-ryukyu.ac.jp>
parents: 94
diff changeset
175 if (typeof window.onload != 'function') {
341766c5a6e9 modified viewer_whit.html
Nobuyasu Oshiro <dimolto@cr.ie.u-ryukyu.ac.jp>
parents: 94
diff changeset
176 window.onload = func;
341766c5a6e9 modified viewer_whit.html
Nobuyasu Oshiro <dimolto@cr.ie.u-ryukyu.ac.jp>
parents: 94
diff changeset
177 } else {
341766c5a6e9 modified viewer_whit.html
Nobuyasu Oshiro <dimolto@cr.ie.u-ryukyu.ac.jp>
parents: 94
diff changeset
178 window.onload = function() {
341766c5a6e9 modified viewer_whit.html
Nobuyasu Oshiro <dimolto@cr.ie.u-ryukyu.ac.jp>
parents: 94
diff changeset
179 if (oldonload) {
341766c5a6e9 modified viewer_whit.html
Nobuyasu Oshiro <dimolto@cr.ie.u-ryukyu.ac.jp>
parents: 94
diff changeset
180 oldonload();
341766c5a6e9 modified viewer_whit.html
Nobuyasu Oshiro <dimolto@cr.ie.u-ryukyu.ac.jp>
parents: 94
diff changeset
181 }
341766c5a6e9 modified viewer_whit.html
Nobuyasu Oshiro <dimolto@cr.ie.u-ryukyu.ac.jp>
parents: 94
diff changeset
182 func();
341766c5a6e9 modified viewer_whit.html
Nobuyasu Oshiro <dimolto@cr.ie.u-ryukyu.ac.jp>
parents: 94
diff changeset
183 }
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 addLoadEvent(function() {
341766c5a6e9 modified viewer_whit.html
Nobuyasu Oshiro <dimolto@cr.ie.u-ryukyu.ac.jp>
parents: 94
diff changeset
188 beginScript();
341766c5a6e9 modified viewer_whit.html
Nobuyasu Oshiro <dimolto@cr.ie.u-ryukyu.ac.jp>
parents: 94
diff changeset
189 });
341766c5a6e9 modified viewer_whit.html
Nobuyasu Oshiro <dimolto@cr.ie.u-ryukyu.ac.jp>
parents: 94
diff changeset
190
100
06e419562734 add jsPlumb code
Nobuyasu Oshiro <dimolto@cr.ie.u-ryukyu.ac.jp>
parents: 99
diff changeset
191 function writeMiniDisplay(title,str) {
06e419562734 add jsPlumb code
Nobuyasu Oshiro <dimolto@cr.ie.u-ryukyu.ac.jp>
parents: 99
diff changeset
192 $('#miniDisplayBody')[0].innerHTML = str;
06e419562734 add jsPlumb code
Nobuyasu Oshiro <dimolto@cr.ie.u-ryukyu.ac.jp>
parents: 99
diff changeset
193 if(title) {
06e419562734 add jsPlumb code
Nobuyasu Oshiro <dimolto@cr.ie.u-ryukyu.ac.jp>
parents: 99
diff changeset
194 $('#miniDisplayTitle')[0].innerHTML = title;
06e419562734 add jsPlumb code
Nobuyasu Oshiro <dimolto@cr.ie.u-ryukyu.ac.jp>
parents: 99
diff changeset
195 }
06e419562734 add jsPlumb code
Nobuyasu Oshiro <dimolto@cr.ie.u-ryukyu.ac.jp>
parents: 99
diff changeset
196 }
99
b0fda0545bce add jsPlumb
Nobuyasu Oshiro <dimolto@cr.ie.u-ryukyu.ac.jp>
parents: 98
diff changeset
197
b0fda0545bce add jsPlumb
Nobuyasu Oshiro <dimolto@cr.ie.u-ryukyu.ac.jp>
parents: 98
diff changeset
198 function writeJSONDataToMiniDisplay(jsonObj) {
b0fda0545bce add jsPlumb
Nobuyasu Oshiro <dimolto@cr.ie.u-ryukyu.ac.jp>
parents: 98
diff changeset
199 var str = "";
100
06e419562734 add jsPlumb code
Nobuyasu Oshiro <dimolto@cr.ie.u-ryukyu.ac.jp>
parents: 99
diff changeset
200 for (var key in jsonObj.property) {
06e419562734 add jsPlumb code
Nobuyasu Oshiro <dimolto@cr.ie.u-ryukyu.ac.jp>
parents: 99
diff changeset
201 str = str + key + ": "+ jsonObj.property[key] + "<br>";
99
b0fda0545bce add jsPlumb
Nobuyasu Oshiro <dimolto@cr.ie.u-ryukyu.ac.jp>
parents: 98
diff changeset
202 }
100
06e419562734 add jsPlumb code
Nobuyasu Oshiro <dimolto@cr.ie.u-ryukyu.ac.jp>
parents: 99
diff changeset
203 writeMiniDisplay(jsonObj.property.title, str);
99
b0fda0545bce add jsPlumb
Nobuyasu Oshiro <dimolto@cr.ie.u-ryukyu.ac.jp>
parents: 98
diff changeset
204 }
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 function init() {
b0fda0545bce add jsPlumb
Nobuyasu Oshiro <dimolto@cr.ie.u-ryukyu.ac.jp>
parents: 98
diff changeset
208 jsPlumb.importDefaults({
100
06e419562734 add jsPlumb code
Nobuyasu Oshiro <dimolto@cr.ie.u-ryukyu.ac.jp>
parents: 99
diff changeset
209 Connector : [ "Straight", { curviness:50 } ],
99
b0fda0545bce add jsPlumb
Nobuyasu Oshiro <dimolto@cr.ie.u-ryukyu.ac.jp>
parents: 98
diff changeset
210 PaintStyle : { strokeStyle:"gray", lineWidth:2 },
b0fda0545bce add jsPlumb
Nobuyasu Oshiro <dimolto@cr.ie.u-ryukyu.ac.jp>
parents: 98
diff changeset
211 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
212 Anchors: ["BottomCenter","TopCenter"],
99
b0fda0545bce add jsPlumb
Nobuyasu Oshiro <dimolto@cr.ie.u-ryukyu.ac.jp>
parents: 98
diff changeset
213 });
107
42799d9c3753 create parseJSONDate function
Nobuyasu Oshiro <dimolto@cr.ie.u-ryukyu.ac.jp>
parents: 106
diff changeset
214 $("#graphRoot").css({
42799d9c3753 create parseJSONDate function
Nobuyasu Oshiro <dimolto@cr.ie.u-ryukyu.ac.jp>
parents: 106
diff changeset
215 left: ViewParam.offsetLeft + ViewParam.nodeWidth/2 - ViewParam.intervalX,
42799d9c3753 create parseJSONDate function
Nobuyasu Oshiro <dimolto@cr.ie.u-ryukyu.ac.jp>
parents: 106
diff changeset
216 top: ViewParam.offsetTop + ViewParam.nodeHeight/2
42799d9c3753 create parseJSONDate function
Nobuyasu Oshiro <dimolto@cr.ie.u-ryukyu.ac.jp>
parents: 106
diff changeset
217 });
42799d9c3753 create parseJSONDate function
Nobuyasu Oshiro <dimolto@cr.ie.u-ryukyu.ac.jp>
parents: 106
diff changeset
218 $("#graphMain").css({
42799d9c3753 create parseJSONDate function
Nobuyasu Oshiro <dimolto@cr.ie.u-ryukyu.ac.jp>
parents: 106
diff changeset
219 width: ViewParam.intervalX * 1 + ViewParam.nodeWidth+ViewParam.offsetLeft + ViewParam.offsetRight,
42799d9c3753 create parseJSONDate function
Nobuyasu Oshiro <dimolto@cr.ie.u-ryukyu.ac.jp>
parents: 106
diff changeset
220 height: ViewParam.intervalY * 1 + ViewParam.nodeHeight + ViewParam.offsetTop + ViewParam.offsetBottom,
42799d9c3753 create parseJSONDate function
Nobuyasu Oshiro <dimolto@cr.ie.u-ryukyu.ac.jp>
parents: 106
diff changeset
221 top:50
42799d9c3753 create parseJSONDate function
Nobuyasu Oshiro <dimolto@cr.ie.u-ryukyu.ac.jp>
parents: 106
diff changeset
222 });
42799d9c3753 create parseJSONDate function
Nobuyasu Oshiro <dimolto@cr.ie.u-ryukyu.ac.jp>
parents: 106
diff changeset
223
99
b0fda0545bce add jsPlumb
Nobuyasu Oshiro <dimolto@cr.ie.u-ryukyu.ac.jp>
parents: 98
diff changeset
224 }
b0fda0545bce add jsPlumb
Nobuyasu Oshiro <dimolto@cr.ie.u-ryukyu.ac.jp>
parents: 98
diff changeset
225
b0fda0545bce add jsPlumb
Nobuyasu Oshiro <dimolto@cr.ie.u-ryukyu.ac.jp>
parents: 98
diff changeset
226 function showMiniDisplay(jsonInfo) {
b0fda0545bce add jsPlumb
Nobuyasu Oshiro <dimolto@cr.ie.u-ryukyu.ac.jp>
parents: 98
diff changeset
227 $("#miniDisplay").css("visibility", "visible");
b0fda0545bce add jsPlumb
Nobuyasu Oshiro <dimolto@cr.ie.u-ryukyu.ac.jp>
parents: 98
diff changeset
228 writeJSONDataToMiniDisplay(jsonInfo)
b0fda0545bce add jsPlumb
Nobuyasu Oshiro <dimolto@cr.ie.u-ryukyu.ac.jp>
parents: 98
diff changeset
229 }
b0fda0545bce add jsPlumb
Nobuyasu Oshiro <dimolto@cr.ie.u-ryukyu.ac.jp>
parents: 98
diff changeset
230
100
06e419562734 add jsPlumb code
Nobuyasu Oshiro <dimolto@cr.ie.u-ryukyu.ac.jp>
parents: 99
diff changeset
231 var nodeNum = 0;
106
60a0ff0b3096 modified viewer_white.html
Nobuyasu Oshiro <dimolto@cr.ie.u-ryukyu.ac.jp>
parents: 105
diff changeset
232 var OFFSET = 100;
104
88c16240c78a add jquery.jsPlumb-1.3.15-all-min.js
Nobuyasu Oshiro <dimolto@cr.ie.u-ryukyu.ac.jp>
parents: 103
diff changeset
233 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
234 node.view = $("<div class='graphNode'/>");
106
60a0ff0b3096 modified viewer_white.html
Nobuyasu Oshiro <dimolto@cr.ie.u-ryukyu.ac.jp>
parents: 105
diff changeset
235 var miniD = $('#miniDisplay')[0].style;
60a0ff0b3096 modified viewer_white.html
Nobuyasu Oshiro <dimolto@cr.ie.u-ryukyu.ac.jp>
parents: 105
diff changeset
236 var offsetLeft = parseInt(miniD.width.split('px')[0]);
60a0ff0b3096 modified viewer_white.html
Nobuyasu Oshiro <dimolto@cr.ie.u-ryukyu.ac.jp>
parents: 105
diff changeset
237 var offsetTop = parseInt(miniD.height.split('px')[0]);
60a0ff0b3096 modified viewer_white.html
Nobuyasu Oshiro <dimolto@cr.ie.u-ryukyu.ac.jp>
parents: 105
diff changeset
238 node.position = {x:nodeNum*OFFSET + offsetLeft, y: nodeNum*OFFSET + offsetTop/2};
104
88c16240c78a add jquery.jsPlumb-1.3.15-all-min.js
Nobuyasu Oshiro <dimolto@cr.ie.u-ryukyu.ac.jp>
parents: 103
diff changeset
239 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
240 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
241 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
242 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
243 nodeNum++;
106
60a0ff0b3096 modified viewer_white.html
Nobuyasu Oshiro <dimolto@cr.ie.u-ryukyu.ac.jp>
parents: 105
diff changeset
244 return node;
104
88c16240c78a add jquery.jsPlumb-1.3.15-all-min.js
Nobuyasu Oshiro <dimolto@cr.ie.u-ryukyu.ac.jp>
parents: 103
diff changeset
245 }
88c16240c78a add jquery.jsPlumb-1.3.15-all-min.js
Nobuyasu Oshiro <dimolto@cr.ie.u-ryukyu.ac.jp>
parents: 103
diff changeset
246
100
06e419562734 add jsPlumb code
Nobuyasu Oshiro <dimolto@cr.ie.u-ryukyu.ac.jp>
parents: 99
diff changeset
247 function updateNodeElement(node) {
06e419562734 add jsPlumb code
Nobuyasu Oshiro <dimolto@cr.ie.u-ryukyu.ac.jp>
parents: 99
diff changeset
248 var created = false;
06e419562734 add jsPlumb code
Nobuyasu Oshiro <dimolto@cr.ie.u-ryukyu.ac.jp>
parents: 99
diff changeset
249 if(!node.view) {
06e419562734 add jsPlumb code
Nobuyasu Oshiro <dimolto@cr.ie.u-ryukyu.ac.jp>
parents: 99
diff changeset
250 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
251 createNodeDiv(node);
100
06e419562734 add jsPlumb code
Nobuyasu Oshiro <dimolto@cr.ie.u-ryukyu.ac.jp>
parents: 99
diff changeset
252 }
06e419562734 add jsPlumb code
Nobuyasu Oshiro <dimolto@cr.ie.u-ryukyu.ac.jp>
parents: 99
diff changeset
253 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
254 // div.text(node.property.title);
100
06e419562734 add jsPlumb code
Nobuyasu Oshiro <dimolto@cr.ie.u-ryukyu.ac.jp>
parents: 99
diff changeset
255 div.click(function(){showMiniDisplay(node)});
06e419562734 add jsPlumb code
Nobuyasu Oshiro <dimolto@cr.ie.u-ryukyu.ac.jp>
parents: 99
diff changeset
256 DragHandler.attach($(node.view)[0]);
06e419562734 add jsPlumb code
Nobuyasu Oshiro <dimolto@cr.ie.u-ryukyu.ac.jp>
parents: 99
diff changeset
257 var kindBackground = {agree:"#aaf", rejected:"#fff"};
06e419562734 add jsPlumb code
Nobuyasu Oshiro <dimolto@cr.ie.u-ryukyu.ac.jp>
parents: 99
diff changeset
258 var kindBorder = {agree:"#66a", rejected:"#a66"};
06e419562734 add jsPlumb code
Nobuyasu Oshiro <dimolto@cr.ie.u-ryukyu.ac.jp>
parents: 99
diff changeset
259 div.css("background", kindBackground[node.kind]||"white");
06e419562734 add jsPlumb code
Nobuyasu Oshiro <dimolto@cr.ie.u-ryukyu.ac.jp>
parents: 99
diff changeset
260 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
261 div.css({
06e419562734 add jsPlumb code
Nobuyasu Oshiro <dimolto@cr.ie.u-ryukyu.ac.jp>
parents: 99
diff changeset
262 left: node.position.x,
106
60a0ff0b3096 modified viewer_white.html
Nobuyasu Oshiro <dimolto@cr.ie.u-ryukyu.ac.jp>
parents: 105
diff changeset
263 top: node.position.y
100
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 return created;
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
06e419562734 add jsPlumb code
Nobuyasu Oshiro <dimolto@cr.ie.u-ryukyu.ac.jp>
parents: 99
diff changeset
269 function updateNode(node) {
06e419562734 add jsPlumb code
Nobuyasu Oshiro <dimolto@cr.ie.u-ryukyu.ac.jp>
parents: 99
diff changeset
270 if(updateNodeElement(node)) {
06e419562734 add jsPlumb code
Nobuyasu Oshiro <dimolto@cr.ie.u-ryukyu.ac.jp>
parents: 99
diff changeset
271 var fc = $('#graphRoot')[0].firstChild;
06e419562734 add jsPlumb code
Nobuyasu Oshiro <dimolto@cr.ie.u-ryukyu.ac.jp>
parents: 99
diff changeset
272 if(fc) {
06e419562734 add jsPlumb code
Nobuyasu Oshiro <dimolto@cr.ie.u-ryukyu.ac.jp>
parents: 99
diff changeset
273 $('#graphRoot')[0].insertBefore(node.view[0], fc);
06e419562734 add jsPlumb code
Nobuyasu Oshiro <dimolto@cr.ie.u-ryukyu.ac.jp>
parents: 99
diff changeset
274 } else {
06e419562734 add jsPlumb code
Nobuyasu Oshiro <dimolto@cr.ie.u-ryukyu.ac.jp>
parents: 99
diff changeset
275 $('#graphRoot').append(node.view);
06e419562734 add jsPlumb code
Nobuyasu Oshiro <dimolto@cr.ie.u-ryukyu.ac.jp>
parents: 99
diff changeset
276 }
06e419562734 add jsPlumb code
Nobuyasu Oshiro <dimolto@cr.ie.u-ryukyu.ac.jp>
parents: 99
diff changeset
277 }
06e419562734 add jsPlumb code
Nobuyasu Oshiro <dimolto@cr.ie.u-ryukyu.ac.jp>
parents: 99
diff changeset
278 }
06e419562734 add jsPlumb code
Nobuyasu Oshiro <dimolto@cr.ie.u-ryukyu.ac.jp>
parents: 99
diff changeset
279
06e419562734 add jsPlumb code
Nobuyasu Oshiro <dimolto@cr.ie.u-ryukyu.ac.jp>
parents: 99
diff changeset
280 var ViewParam = {
06e419562734 add jsPlumb code
Nobuyasu Oshiro <dimolto@cr.ie.u-ryukyu.ac.jp>
parents: 99
diff changeset
281 offsetTop:100,
06e419562734 add jsPlumb code
Nobuyasu Oshiro <dimolto@cr.ie.u-ryukyu.ac.jp>
parents: 99
diff changeset
282 offsetBottom:100,
06e419562734 add jsPlumb code
Nobuyasu Oshiro <dimolto@cr.ie.u-ryukyu.ac.jp>
parents: 99
diff changeset
283 offsetLeft:100,
06e419562734 add jsPlumb code
Nobuyasu Oshiro <dimolto@cr.ie.u-ryukyu.ac.jp>
parents: 99
diff changeset
284 offsetRight:100,
06e419562734 add jsPlumb code
Nobuyasu Oshiro <dimolto@cr.ie.u-ryukyu.ac.jp>
parents: 99
diff changeset
285 nodeWidth:120,
101
098e87253903 modfied jsPlumb
Nobuyasu Oshiro <dimolto@cr.ie.u-ryukyu.ac.jp>
parents: 100
diff changeset
286 nodeHeight:60,
100
06e419562734 add jsPlumb code
Nobuyasu Oshiro <dimolto@cr.ie.u-ryukyu.ac.jp>
parents: 99
diff changeset
287 intervalX:140,
06e419562734 add jsPlumb code
Nobuyasu Oshiro <dimolto@cr.ie.u-ryukyu.ac.jp>
parents: 99
diff changeset
288 intervalY:120
06e419562734 add jsPlumb code
Nobuyasu Oshiro <dimolto@cr.ie.u-ryukyu.ac.jp>
parents: 99
diff changeset
289 };
06e419562734 add jsPlumb code
Nobuyasu Oshiro <dimolto@cr.ie.u-ryukyu.ac.jp>
parents: 99
diff changeset
290
99
b0fda0545bce add jsPlumb
Nobuyasu Oshiro <dimolto@cr.ie.u-ryukyu.ac.jp>
parents: 98
diff changeset
291 function start() {
b0fda0545bce add jsPlumb
Nobuyasu Oshiro <dimolto@cr.ie.u-ryukyu.ac.jp>
parents: 98
diff changeset
292 init();
100
06e419562734 add jsPlumb code
Nobuyasu Oshiro <dimolto@cr.ie.u-ryukyu.ac.jp>
parents: 99
diff changeset
293 var rootNode = new Object();
06e419562734 add jsPlumb code
Nobuyasu Oshiro <dimolto@cr.ie.u-ryukyu.ac.jp>
parents: 99
diff changeset
294 rootNode.property = sampleJSON1;
106
60a0ff0b3096 modified viewer_white.html
Nobuyasu Oshiro <dimolto@cr.ie.u-ryukyu.ac.jp>
parents: 105
diff changeset
295 showMiniDisplay(rootNode);
100
06e419562734 add jsPlumb code
Nobuyasu Oshiro <dimolto@cr.ie.u-ryukyu.ac.jp>
parents: 99
diff changeset
296 updateNode(rootNode);
06e419562734 add jsPlumb code
Nobuyasu Oshiro <dimolto@cr.ie.u-ryukyu.ac.jp>
parents: 99
diff changeset
297 /* test code */
106
60a0ff0b3096 modified viewer_white.html
Nobuyasu Oshiro <dimolto@cr.ie.u-ryukyu.ac.jp>
parents: 105
diff changeset
298 var n1 = {property:{title:"task2"}};
60a0ff0b3096 modified viewer_white.html
Nobuyasu Oshiro <dimolto@cr.ie.u-ryukyu.ac.jp>
parents: 105
diff changeset
299 var n2 = {property:{title:"task3"}};
100
06e419562734 add jsPlumb code
Nobuyasu Oshiro <dimolto@cr.ie.u-ryukyu.ac.jp>
parents: 99
diff changeset
300 updateNode(n1);
06e419562734 add jsPlumb code
Nobuyasu Oshiro <dimolto@cr.ie.u-ryukyu.ac.jp>
parents: 99
diff changeset
301 updateNode(n2);
101
098e87253903 modfied jsPlumb
Nobuyasu Oshiro <dimolto@cr.ie.u-ryukyu.ac.jp>
parents: 100
diff changeset
302
098e87253903 modfied jsPlumb
Nobuyasu Oshiro <dimolto@cr.ie.u-ryukyu.ac.jp>
parents: 100
diff changeset
303 var e1 = new Edge(rootNode, n1, "dependency");
098e87253903 modfied jsPlumb
Nobuyasu Oshiro <dimolto@cr.ie.u-ryukyu.ac.jp>
parents: 100
diff changeset
304 var e2 = new Edge(n1, n2, "dependency");
098e87253903 modfied jsPlumb
Nobuyasu Oshiro <dimolto@cr.ie.u-ryukyu.ac.jp>
parents: 100
diff changeset
305 edgeArray.push(e1);
098e87253903 modfied jsPlumb
Nobuyasu Oshiro <dimolto@cr.ie.u-ryukyu.ac.jp>
parents: 100
diff changeset
306 edgeArray.push(e2);
098e87253903 modfied jsPlumb
Nobuyasu Oshiro <dimolto@cr.ie.u-ryukyu.ac.jp>
parents: 100
diff changeset
307 paintEdge();
098e87253903 modfied jsPlumb
Nobuyasu Oshiro <dimolto@cr.ie.u-ryukyu.ac.jp>
parents: 100
diff changeset
308 }
098e87253903 modfied jsPlumb
Nobuyasu Oshiro <dimolto@cr.ie.u-ryukyu.ac.jp>
parents: 100
diff changeset
309
098e87253903 modfied jsPlumb
Nobuyasu Oshiro <dimolto@cr.ie.u-ryukyu.ac.jp>
parents: 100
diff changeset
310 var edgeArray = new Array();
098e87253903 modfied jsPlumb
Nobuyasu Oshiro <dimolto@cr.ie.u-ryukyu.ac.jp>
parents: 100
diff changeset
311 function Edge(fromNode, toNode, relation) {
098e87253903 modfied jsPlumb
Nobuyasu Oshiro <dimolto@cr.ie.u-ryukyu.ac.jp>
parents: 100
diff changeset
312 var obj = {from:fromNode, to:toNode, rel:relation };
098e87253903 modfied jsPlumb
Nobuyasu Oshiro <dimolto@cr.ie.u-ryukyu.ac.jp>
parents: 100
diff changeset
313 return obj;
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
104
88c16240c78a add jquery.jsPlumb-1.3.15-all-min.js
Nobuyasu Oshiro <dimolto@cr.ie.u-ryukyu.ac.jp>
parents: 103
diff changeset
316 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
317 connector:"StateMachine",
105
9bf5e984f288 modified label
Nobuyasu Oshiro <dimolto@cr.ie.u-ryukyu.ac.jp>
parents: 104
diff changeset
318 // paintStyle:{lineWidth:3,strokeStyle:"#056"},
9bf5e984f288 modified label
Nobuyasu Oshiro <dimolto@cr.ie.u-ryukyu.ac.jp>
parents: 104
diff changeset
319 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
320 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
321 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
322 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
323 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
324 };
107
42799d9c3753 create parseJSONDate function
Nobuyasu Oshiro <dimolto@cr.ie.u-ryukyu.ac.jp>
parents: 106
diff changeset
325
101
098e87253903 modfied jsPlumb
Nobuyasu Oshiro <dimolto@cr.ie.u-ryukyu.ac.jp>
parents: 100
diff changeset
326 function paintEdge() {
098e87253903 modfied jsPlumb
Nobuyasu Oshiro <dimolto@cr.ie.u-ryukyu.ac.jp>
parents: 100
diff changeset
327 var array = edgeArray;
098e87253903 modfied jsPlumb
Nobuyasu Oshiro <dimolto@cr.ie.u-ryukyu.ac.jp>
parents: 100
diff changeset
328 for (var i=0; i<array.length; i++) {
107
42799d9c3753 create parseJSONDate function
Nobuyasu Oshiro <dimolto@cr.ie.u-ryukyu.ac.jp>
parents: 106
diff changeset
329 connectGraph(array[i]);
101
098e87253903 modfied jsPlumb
Nobuyasu Oshiro <dimolto@cr.ie.u-ryukyu.ac.jp>
parents: 100
diff changeset
330 }
098e87253903 modfied jsPlumb
Nobuyasu Oshiro <dimolto@cr.ie.u-ryukyu.ac.jp>
parents: 100
diff changeset
331 jsPlumb.removeAllEndpoints();
098e87253903 modfied jsPlumb
Nobuyasu Oshiro <dimolto@cr.ie.u-ryukyu.ac.jp>
parents: 100
diff changeset
332 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
333 /*
101
098e87253903 modfied jsPlumb
Nobuyasu Oshiro <dimolto@cr.ie.u-ryukyu.ac.jp>
parents: 100
diff changeset
334 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
335 */
99
b0fda0545bce add jsPlumb
Nobuyasu Oshiro <dimolto@cr.ie.u-ryukyu.ac.jp>
parents: 98
diff changeset
336 }
b0fda0545bce add jsPlumb
Nobuyasu Oshiro <dimolto@cr.ie.u-ryukyu.ac.jp>
parents: 98
diff changeset
337
107
42799d9c3753 create parseJSONDate function
Nobuyasu Oshiro <dimolto@cr.ie.u-ryukyu.ac.jp>
parents: 106
diff changeset
338 function connectGraph(graphObj) {
42799d9c3753 create parseJSONDate function
Nobuyasu Oshiro <dimolto@cr.ie.u-ryukyu.ac.jp>
parents: 106
diff changeset
339 var fromNode = graphObj.from;
42799d9c3753 create parseJSONDate function
Nobuyasu Oshiro <dimolto@cr.ie.u-ryukyu.ac.jp>
parents: 106
diff changeset
340 var toNode = graphObj.to;
42799d9c3753 create parseJSONDate function
Nobuyasu Oshiro <dimolto@cr.ie.u-ryukyu.ac.jp>
parents: 106
diff changeset
341 var rel = graphObj.rel;
42799d9c3753 create parseJSONDate function
Nobuyasu Oshiro <dimolto@cr.ie.u-ryukyu.ac.jp>
parents: 106
diff changeset
342 var c = jsPlumb.connect({source:fromNode.view[0], target:toNode.view[0]}, stateMachineConnector);
42799d9c3753 create parseJSONDate function
Nobuyasu Oshiro <dimolto@cr.ie.u-ryukyu.ac.jp>
parents: 106
diff changeset
343 c.setLabel({label:"<span style='color:black;'>"+rel+"</span>",cssStyle:"color:black"});
42799d9c3753 create parseJSONDate function
Nobuyasu Oshiro <dimolto@cr.ie.u-ryukyu.ac.jp>
parents: 106
diff changeset
344 return c;
42799d9c3753 create parseJSONDate function
Nobuyasu Oshiro <dimolto@cr.ie.u-ryukyu.ac.jp>
parents: 106
diff changeset
345 }
42799d9c3753 create parseJSONDate function
Nobuyasu Oshiro <dimolto@cr.ie.u-ryukyu.ac.jp>
parents: 106
diff changeset
346
42799d9c3753 create parseJSONDate function
Nobuyasu Oshiro <dimolto@cr.ie.u-ryukyu.ac.jp>
parents: 106
diff changeset
347 function GraphData() {
42799d9c3753 create parseJSONDate function
Nobuyasu Oshiro <dimolto@cr.ie.u-ryukyu.ac.jp>
parents: 106
diff changeset
348 /*
42799d9c3753 create parseJSONDate function
Nobuyasu Oshiro <dimolto@cr.ie.u-ryukyu.ac.jp>
parents: 106
diff changeset
349 function graph() {
42799d9c3753 create parseJSONDate function
Nobuyasu Oshiro <dimolto@cr.ie.u-ryukyu.ac.jp>
parents: 106
diff changeset
350 var g = {};
42799d9c3753 create parseJSONDate function
Nobuyasu Oshiro <dimolto@cr.ie.u-ryukyu.ac.jp>
parents: 106
diff changeset
351 g.property = {};
42799d9c3753 create parseJSONDate function
Nobuyasu Oshiro <dimolto@cr.ie.u-ryukyu.ac.jp>
parents: 106
diff changeset
352 g.in = {};
42799d9c3753 create parseJSONDate function
Nobuyasu Oshiro <dimolto@cr.ie.u-ryukyu.ac.jp>
parents: 106
diff changeset
353 g.out = {};
42799d9c3753 create parseJSONDate function
Nobuyasu Oshiro <dimolto@cr.ie.u-ryukyu.ac.jp>
parents: 106
diff changeset
354 g.both = {};
42799d9c3753 create parseJSONDate function
Nobuyasu Oshiro <dimolto@cr.ie.u-ryukyu.ac.jp>
parents: 106
diff changeset
355 return g;
42799d9c3753 create parseJSONDate function
Nobuyasu Oshiro <dimolto@cr.ie.u-ryukyu.ac.jp>
parents: 106
diff changeset
356 }
42799d9c3753 create parseJSONDate function
Nobuyasu Oshiro <dimolto@cr.ie.u-ryukyu.ac.jp>
parents: 106
diff changeset
357 function edge() {
42799d9c3753 create parseJSONDate function
Nobuyasu Oshiro <dimolto@cr.ie.u-ryukyu.ac.jp>
parents: 106
diff changeset
358 var e = {};
42799d9c3753 create parseJSONDate function
Nobuyasu Oshiro <dimolto@cr.ie.u-ryukyu.ac.jp>
parents: 106
diff changeset
359 e.property = {};
42799d9c3753 create parseJSONDate function
Nobuyasu Oshiro <dimolto@cr.ie.u-ryukyu.ac.jp>
parents: 106
diff changeset
360 return e;
42799d9c3753 create parseJSONDate function
Nobuyasu Oshiro <dimolto@cr.ie.u-ryukyu.ac.jp>
parents: 106
diff changeset
361 }
42799d9c3753 create parseJSONDate function
Nobuyasu Oshiro <dimolto@cr.ie.u-ryukyu.ac.jp>
parents: 106
diff changeset
362 */
42799d9c3753 create parseJSONDate function
Nobuyasu Oshiro <dimolto@cr.ie.u-ryukyu.ac.jp>
parents: 106
diff changeset
363 var graphData = {};
42799d9c3753 create parseJSONDate function
Nobuyasu Oshiro <dimolto@cr.ie.u-ryukyu.ac.jp>
parents: 106
diff changeset
364 graphData.graphs = {};
42799d9c3753 create parseJSONDate function
Nobuyasu Oshiro <dimolto@cr.ie.u-ryukyu.ac.jp>
parents: 106
diff changeset
365 graphData.edges = {};
42799d9c3753 create parseJSONDate function
Nobuyasu Oshiro <dimolto@cr.ie.u-ryukyu.ac.jp>
parents: 106
diff changeset
366 return graphData;
42799d9c3753 create parseJSONDate function
Nobuyasu Oshiro <dimolto@cr.ie.u-ryukyu.ac.jp>
parents: 106
diff changeset
367 }
42799d9c3753 create parseJSONDate function
Nobuyasu Oshiro <dimolto@cr.ie.u-ryukyu.ac.jp>
parents: 106
diff changeset
368
42799d9c3753 create parseJSONDate function
Nobuyasu Oshiro <dimolto@cr.ie.u-ryukyu.ac.jp>
parents: 106
diff changeset
369
42799d9c3753 create parseJSONDate function
Nobuyasu Oshiro <dimolto@cr.ie.u-ryukyu.ac.jp>
parents: 106
diff changeset
370 function parseJSONGraphData(memory ,jsonObj) {
42799d9c3753 create parseJSONDate function
Nobuyasu Oshiro <dimolto@cr.ie.u-ryukyu.ac.jp>
parents: 106
diff changeset
371 var graphs = jsonObj.graphs;
42799d9c3753 create parseJSONDate function
Nobuyasu Oshiro <dimolto@cr.ie.u-ryukyu.ac.jp>
parents: 106
diff changeset
372 for (var i=0; i<graphs.length; i++) {
42799d9c3753 create parseJSONDate function
Nobuyasu Oshiro <dimolto@cr.ie.u-ryukyu.ac.jp>
parents: 106
diff changeset
373 var graph = graphs[i];
42799d9c3753 create parseJSONDate function
Nobuyasu Oshiro <dimolto@cr.ie.u-ryukyu.ac.jp>
parents: 106
diff changeset
374 memory.graphs[graph.id].property = graph;
42799d9c3753 create parseJSONDate function
Nobuyasu Oshiro <dimolto@cr.ie.u-ryukyu.ac.jp>
parents: 106
diff changeset
375 }
42799d9c3753 create parseJSONDate function
Nobuyasu Oshiro <dimolto@cr.ie.u-ryukyu.ac.jp>
parents: 106
diff changeset
376 var edges = jsonObj.edges;
42799d9c3753 create parseJSONDate function
Nobuyasu Oshiro <dimolto@cr.ie.u-ryukyu.ac.jp>
parents: 106
diff changeset
377 for (var i=0; i<edges.length; i++) {
42799d9c3753 create parseJSONDate function
Nobuyasu Oshiro <dimolto@cr.ie.u-ryukyu.ac.jp>
parents: 106
diff changeset
378 var edge = edges[i];
42799d9c3753 create parseJSONDate function
Nobuyasu Oshiro <dimolto@cr.ie.u-ryukyu.ac.jp>
parents: 106
diff changeset
379 var edgeId = edge.id;
42799d9c3753 create parseJSONDate function
Nobuyasu Oshiro <dimolto@cr.ie.u-ryukyu.ac.jp>
parents: 106
diff changeset
380 memory.edges[edgeId].property = edge;
42799d9c3753 create parseJSONDate function
Nobuyasu Oshiro <dimolto@cr.ie.u-ryukyu.ac.jp>
parents: 106
diff changeset
381 if (edge.kind == "both") {
42799d9c3753 create parseJSONDate function
Nobuyasu Oshiro <dimolto@cr.ie.u-ryukyu.ac.jp>
parents: 106
diff changeset
382 memory.graphs[edge.from].both.append(edgeId);
42799d9c3753 create parseJSONDate function
Nobuyasu Oshiro <dimolto@cr.ie.u-ryukyu.ac.jp>
parents: 106
diff changeset
383 memory.graphs[edge.to].both.append(edgeId);
42799d9c3753 create parseJSONDate function
Nobuyasu Oshiro <dimolto@cr.ie.u-ryukyu.ac.jp>
parents: 106
diff changeset
384 } else {
42799d9c3753 create parseJSONDate function
Nobuyasu Oshiro <dimolto@cr.ie.u-ryukyu.ac.jp>
parents: 106
diff changeset
385 memory.graphs[edge.from].out.append(edgeId);
42799d9c3753 create parseJSONDate function
Nobuyasu Oshiro <dimolto@cr.ie.u-ryukyu.ac.jp>
parents: 106
diff changeset
386 memory.graphs[edge.to].in.append(edgeId);
42799d9c3753 create parseJSONDate function
Nobuyasu Oshiro <dimolto@cr.ie.u-ryukyu.ac.jp>
parents: 106
diff changeset
387 }
42799d9c3753 create parseJSONDate function
Nobuyasu Oshiro <dimolto@cr.ie.u-ryukyu.ac.jp>
parents: 106
diff changeset
388 }
42799d9c3753 create parseJSONDate function
Nobuyasu Oshiro <dimolto@cr.ie.u-ryukyu.ac.jp>
parents: 106
diff changeset
389 }
42799d9c3753 create parseJSONDate function
Nobuyasu Oshiro <dimolto@cr.ie.u-ryukyu.ac.jp>
parents: 106
diff changeset
390
99
b0fda0545bce add jsPlumb
Nobuyasu Oshiro <dimolto@cr.ie.u-ryukyu.ac.jp>
parents: 98
diff changeset
391 /* sample data */
b0fda0545bce add jsPlumb
Nobuyasu Oshiro <dimolto@cr.ie.u-ryukyu.ac.jp>
parents: 98
diff changeset
392 sampleJSON1 = {
b0fda0545bce add jsPlumb
Nobuyasu Oshiro <dimolto@cr.ie.u-ryukyu.ac.jp>
parents: 98
diff changeset
393 id:"5",
106
60a0ff0b3096 modified viewer_white.html
Nobuyasu Oshiro <dimolto@cr.ie.u-ryukyu.ac.jp>
parents: 105
diff changeset
394 title:"task1",
99
b0fda0545bce add jsPlumb
Nobuyasu Oshiro <dimolto@cr.ie.u-ryukyu.ac.jp>
parents: 98
diff changeset
395 kind:"agreed",
b0fda0545bce add jsPlumb
Nobuyasu Oshiro <dimolto@cr.ie.u-ryukyu.ac.jp>
parents: 98
diff changeset
396 createdUser:"oshiro",
b0fda0545bce add jsPlumb
Nobuyasu Oshiro <dimolto@cr.ie.u-ryukyu.ac.jp>
parents: 98
diff changeset
397 createdDate: new Date()
b0fda0545bce add jsPlumb
Nobuyasu Oshiro <dimolto@cr.ie.u-ryukyu.ac.jp>
parents: 98
diff changeset
398 };
b0fda0545bce add jsPlumb
Nobuyasu Oshiro <dimolto@cr.ie.u-ryukyu.ac.jp>
parents: 98
diff changeset
399
107
42799d9c3753 create parseJSONDate function
Nobuyasu Oshiro <dimolto@cr.ie.u-ryukyu.ac.jp>
parents: 106
diff changeset
400 sampleJSONData = {
42799d9c3753 create parseJSONDate function
Nobuyasu Oshiro <dimolto@cr.ie.u-ryukyu.ac.jp>
parents: 106
diff changeset
401 graphs: [
42799d9c3753 create parseJSONDate function
Nobuyasu Oshiro <dimolto@cr.ie.u-ryukyu.ac.jp>
parents: 106
diff changeset
402 {
42799d9c3753 create parseJSONDate function
Nobuyasu Oshiro <dimolto@cr.ie.u-ryukyu.ac.jp>
parents: 106
diff changeset
403 id:"1",
42799d9c3753 create parseJSONDate function
Nobuyasu Oshiro <dimolto@cr.ie.u-ryukyu.ac.jp>
parents: 106
diff changeset
404 kind:"agree",
42799d9c3753 create parseJSONDate function
Nobuyasu Oshiro <dimolto@cr.ie.u-ryukyu.ac.jp>
parents: 106
diff changeset
405 createdUser:"osrhiro"
42799d9c3753 create parseJSONDate function
Nobuyasu Oshiro <dimolto@cr.ie.u-ryukyu.ac.jp>
parents: 106
diff changeset
406 },
42799d9c3753 create parseJSONDate function
Nobuyasu Oshiro <dimolto@cr.ie.u-ryukyu.ac.jp>
parents: 106
diff changeset
407 {
42799d9c3753 create parseJSONDate function
Nobuyasu Oshiro <dimolto@cr.ie.u-ryukyu.ac.jp>
parents: 106
diff changeset
408 id:"2",
42799d9c3753 create parseJSONDate function
Nobuyasu Oshiro <dimolto@cr.ie.u-ryukyu.ac.jp>
parents: 106
diff changeset
409 kind:"reject",
42799d9c3753 create parseJSONDate function
Nobuyasu Oshiro <dimolto@cr.ie.u-ryukyu.ac.jp>
parents: 106
diff changeset
410 createdUser:"kinjo"
42799d9c3753 create parseJSONDate function
Nobuyasu Oshiro <dimolto@cr.ie.u-ryukyu.ac.jp>
parents: 106
diff changeset
411 },
42799d9c3753 create parseJSONDate function
Nobuyasu Oshiro <dimolto@cr.ie.u-ryukyu.ac.jp>
parents: 106
diff changeset
412 {
42799d9c3753 create parseJSONDate function
Nobuyasu Oshiro <dimolto@cr.ie.u-ryukyu.ac.jp>
parents: 106
diff changeset
413 id:"3",
42799d9c3753 create parseJSONDate function
Nobuyasu Oshiro <dimolto@cr.ie.u-ryukyu.ac.jp>
parents: 106
diff changeset
414 kind:"agree",
42799d9c3753 create parseJSONDate function
Nobuyasu Oshiro <dimolto@cr.ie.u-ryukyu.ac.jp>
parents: 106
diff changeset
415 createdUser:"tamayose"
42799d9c3753 create parseJSONDate function
Nobuyasu Oshiro <dimolto@cr.ie.u-ryukyu.ac.jp>
parents: 106
diff changeset
416 }
42799d9c3753 create parseJSONDate function
Nobuyasu Oshiro <dimolto@cr.ie.u-ryukyu.ac.jp>
parents: 106
diff changeset
417 ],
42799d9c3753 create parseJSONDate function
Nobuyasu Oshiro <dimolto@cr.ie.u-ryukyu.ac.jp>
parents: 106
diff changeset
418 edges: [
42799d9c3753 create parseJSONDate function
Nobuyasu Oshiro <dimolto@cr.ie.u-ryukyu.ac.jp>
parents: 106
diff changeset
419 {
42799d9c3753 create parseJSONDate function
Nobuyasu Oshiro <dimolto@cr.ie.u-ryukyu.ac.jp>
parents: 106
diff changeset
420 id:"11",
42799d9c3753 create parseJSONDate function
Nobuyasu Oshiro <dimolto@cr.ie.u-ryukyu.ac.jp>
parents: 106
diff changeset
421 from:"1",
42799d9c3753 create parseJSONDate function
Nobuyasu Oshiro <dimolto@cr.ie.u-ryukyu.ac.jp>
parents: 106
diff changeset
422 to:"2",
42799d9c3753 create parseJSONDate function
Nobuyasu Oshiro <dimolto@cr.ie.u-ryukyu.ac.jp>
parents: 106
diff changeset
423 rel:"dependency",
42799d9c3753 create parseJSONDate function
Nobuyasu Oshiro <dimolto@cr.ie.u-ryukyu.ac.jp>
parents: 106
diff changeset
424 type:""
42799d9c3753 create parseJSONDate function
Nobuyasu Oshiro <dimolto@cr.ie.u-ryukyu.ac.jp>
parents: 106
diff changeset
425 },
42799d9c3753 create parseJSONDate function
Nobuyasu Oshiro <dimolto@cr.ie.u-ryukyu.ac.jp>
parents: 106
diff changeset
426 {
42799d9c3753 create parseJSONDate function
Nobuyasu Oshiro <dimolto@cr.ie.u-ryukyu.ac.jp>
parents: 106
diff changeset
427 id:"12",
42799d9c3753 create parseJSONDate function
Nobuyasu Oshiro <dimolto@cr.ie.u-ryukyu.ac.jp>
parents: 106
diff changeset
428 from:"2",
42799d9c3753 create parseJSONDate function
Nobuyasu Oshiro <dimolto@cr.ie.u-ryukyu.ac.jp>
parents: 106
diff changeset
429 to:"3",
42799d9c3753 create parseJSONDate function
Nobuyasu Oshiro <dimolto@cr.ie.u-ryukyu.ac.jp>
parents: 106
diff changeset
430 rel:"dependency",
42799d9c3753 create parseJSONDate function
Nobuyasu Oshiro <dimolto@cr.ie.u-ryukyu.ac.jp>
parents: 106
diff changeset
431 type:""
42799d9c3753 create parseJSONDate function
Nobuyasu Oshiro <dimolto@cr.ie.u-ryukyu.ac.jp>
parents: 106
diff changeset
432 },
42799d9c3753 create parseJSONDate function
Nobuyasu Oshiro <dimolto@cr.ie.u-ryukyu.ac.jp>
parents: 106
diff changeset
433 {
42799d9c3753 create parseJSONDate function
Nobuyasu Oshiro <dimolto@cr.ie.u-ryukyu.ac.jp>
parents: 106
diff changeset
434 id:"13",
42799d9c3753 create parseJSONDate function
Nobuyasu Oshiro <dimolto@cr.ie.u-ryukyu.ac.jp>
parents: 106
diff changeset
435 from:"3",
42799d9c3753 create parseJSONDate function
Nobuyasu Oshiro <dimolto@cr.ie.u-ryukyu.ac.jp>
parents: 106
diff changeset
436 to:"1",
42799d9c3753 create parseJSONDate function
Nobuyasu Oshiro <dimolto@cr.ie.u-ryukyu.ac.jp>
parents: 106
diff changeset
437 rel:"dependency",
42799d9c3753 create parseJSONDate function
Nobuyasu Oshiro <dimolto@cr.ie.u-ryukyu.ac.jp>
parents: 106
diff changeset
438 type:"both"
42799d9c3753 create parseJSONDate function
Nobuyasu Oshiro <dimolto@cr.ie.u-ryukyu.ac.jp>
parents: 106
diff changeset
439 }
42799d9c3753 create parseJSONDate function
Nobuyasu Oshiro <dimolto@cr.ie.u-ryukyu.ac.jp>
parents: 106
diff changeset
440 ]
42799d9c3753 create parseJSONDate function
Nobuyasu Oshiro <dimolto@cr.ie.u-ryukyu.ac.jp>
parents: 106
diff changeset
441 };
42799d9c3753 create parseJSONDate function
Nobuyasu Oshiro <dimolto@cr.ie.u-ryukyu.ac.jp>
parents: 106
diff changeset
442
94
bf0cd5920429 modfied viewer_white.html
Nobuyasu Oshiro <dimolto@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
443 </script>
bf0cd5920429 modfied viewer_white.html
Nobuyasu Oshiro <dimolto@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
444