-
Notifications
You must be signed in to change notification settings - Fork 3
/
index_new2.php
245 lines (208 loc) · 9.26 KB
/
index_new2.php
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
<?php
include 'header.php';
?>
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="utf-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<meta name="description" content="">
<meta name="author" content="">
<link rel="shortcut icon" href="assets/ico/favicon.png">
<title>Fixed Top Navbar Example for Bootstrap</title>
<!-- Bootstrap core CSS -->
<link href="dist/css/bootstrap.css" rel="stylesheet">
<!-- Custom styles for this template -->
<link href="navbar-fixed-top.css" rel="stylesheet">
<link href="./jQuery-contextMenu-master/src/jquery.contextMenu.css" rel="stylesheet" type="text/css" />
<link href="./jQuery-contextMenu-master/prettify/prettify.sunburst.css" rel="stylesheet" type="text/css" />
<link rel="stylesheet" href="http://code.jquery.com/ui/1.10.3/themes/smoothness/jquery-ui.css" />
<link href="style_new.css" rel="stylesheet" type="text/css">
<!-- HTML5 shim and Respond.js IE8 support of HTML5 elements and media queries -->
<!--[if lt IE 9]>
<script src="assets/js/html5shiv.js"></script>
<script src="assets/js/respond.min.js"></script>
<![endif]-->
</head>
<body>
<!-- Fixed navbar -->
<div class="navbar navbar-default navbar-fixed-top">
<div class="container">
<div class="navbar-header">
<button type="button" class="navbar-toggle" data-toggle="collapse" data-target=".navbar-collapse">
<span class="icon-bar"></span>
<span class="icon-bar"></span>
<span class="icon-bar"></span>
</button>
<a class="navbar-brand" href="#">Arg Trust</a>
</div>
<div class="navbar-collapse collapse">
<ul class="nav navbar-nav">
<li class="active"><a href="index_new.php">Begin</a></li>
<li><a href="review1Scenario.php?sessionID=<?php echo $sessionID;?>×tep=<?php echo $timestep;?>">Read Scenario</a></li>
<li><a href="review2Trust.php?sessionID=<?php echo $sessionID;?>×tep=<?php echo $timestep;?>">Review Trust Network</a></li>
<li><a href="review3Beliefs.php?sessionID=<?php echo $sessionID;?>×tep=<?php echo $timestep;?>">Review Beliefs</a></li>
<li><a href="review4Rules.php?sessionID=<?php echo $sessionID;?>×tep=<?php echo $timestep;?>">Review Rules</a></li>
<li><a href="review5TrustBeliefs.php?sessionID=<?php echo $sessionID;?>×tep=<?php echo $timestep;?>">Trust + Beliefs</a></li>
<li><a href="review6Graph.php?sessionID=<?php echo $sessionID;?>×tep=<?php echo $timestep;?>">Complete Graph</a></li>
</ul>
</div><!--/.nav-collapse -->
</div>
</div>
<div class="container">
<!-- Main component for a primary marketing message or call to action -->
<div class="jumbotron">
<h1>Welcome to ArgTrust!</h1>
<form action="upload.php" method="post" enctype="multipart/form-data">
<p>Enter UserID: <input type="text" value="" size="" /> </p>
<p>Upload File: <input type="file" name="file" id="file"> </p>
<p><input class="btn btn-lg btn-primary" type="submit" name="submit" value="Get Started »"></p>
</form>
</div>
</div> <!-- /container -->
<div id="graphContainer" class="container">
<div class="graph">
<div id="canviz"></div>
</div>
<div id="rightNav">
<?php
include 'right_nav.php';
?>
</div>
<div id="debug_output" style="display:none"></div>
</div>
<!-- Google Analytics -->
<script>
var _gaq = _gaq || [];
_gaq.push(['_setAccount', 'UA-43820596-1']);
_gaq.push(['_trackPageview']);
(function() {
var ga = document.createElement('script'); ga.type = 'text/javascript'; ga.async = true;
ga.src = ('https:' == document.location.protocol ? 'https://ssl' : 'http://www') + '.google-analytics.com/ga.js';
var s = document.getElementsByTagName('script')[0]; s.parentNode.insertBefore(ga, s);
})();
<?php
if (isset($_COOKIE["userID"])){
?>
_gaq.push(['_trackEvent', 'PageLoad', '<?php echo $sessionID; ?>', <?php echo $timestep; ?>]);
<?php
}
?>
</script>
<!-- Bootstrap core JavaScript
================================================== -->
<!-- Placed at the end of the document so the pages load faster -->
<script src="assets/js/jquery.js"></script>
<script src="dist/js/bootstrap.min.js"></script>
<script src="./jQuery-contextMenu-master/src/jquery.ui.position.js"></script>
<script src="./jQuery-contextMenu-master/src/jquery.contextMenu.js"></script>
<script src="./jQuery-contextMenu-master/prettify/prettify.js"></script>
<script src="./jQuery-contextMenu-master/screen.js"></script>
<script src="http://code.jquery.com/ui/1.10.3/jquery-ui.js"></script>
<script type="text/javascript" src="./prototype/prototype.js"></script>
<script type="text/javascript" src="./path/path.js"></script>
<script type="text/javascript" src="canviz.js"></script>
<script type="text/javascript" src="scripts_common.js"></script>
<script>
var mySessionID = "<?php echo $sessionID;?>";
var myTimestep = "<?php echo $timestep;?>";
var val = "<?php echo $graphDetail;?>";
var myCanviz;
var graphScale = .5;
document.observe('dom:loaded', function() {
myCanviz = new Canviz('canviz');
myCanviz.setScale(graphScale);
if(mySessionID.length > 0){
myCanviz.load("graphs2/<?php echo $sessionID; ?>.gv");
myCanviz.resize();
}
});
function updategraph(graphType, graphID, graphDetail){
_gaq.push(['_trackEvent', 'UpdateGraph', graphType, '<?php echo $sessionID; ?>', <?php echo $timestep; ?>]);
_gaq.push(['_trackEvent', 'UpdateGraph_'+graphType, graphDetail, '<?php echo $sessionID; ?>', <?php echo $timestep; ?>]);
url = "index.php?sessionID=<?php echo $sessionID; ?>×tep=<?php echo $timestep; ?>";
if((graphType == 'agent') && (graphDetail==2))
window.location.href=url+"&agentID="+graphID+"&graphDetail="+graphDetail;
else if((graphType == 'agent') && (graphDetail==1))
window.location.href=url+"&agentID="+graphID+"&graphDetail="+graphDetail;
else if(graphType == 'agent')
window.location.href=url+"&agentID="+graphID+"&graphDetail="+graphDetail;
else if((graphType == 'belief') && (graphDetail==2))
window.location.href=url+"&beliefID="+graphID+"&graphDetail="+graphDetail;
else if(graphType == 'belief')
window.location.href=url+"&beliefID="+graphID+"&graphDetail="+graphDetail;
else if(graphType == 'rule')
window.location.href=url+"&ruleID="+graphID+"&graphDetail="+graphDetail;
else if((graphType == 'argument') && (graphDetail==2))
window.location.href=url+"&argumentID="+graphID+"&graphDetail="+graphDetail;
else if((graphType == 'argument') && (graphDetail==1))
window.location.href=url+"&argumentID="+graphID+"&graphDetail="+graphDetail;
else if((graphType == 'argument') && (graphDetail==0))
window.location.href=url+"&argumentID="+graphID+"&graphDetail="+graphDetail;
else if(graphType == 'argument')
window.location.href=url+"&argumentID="+graphID+"&graphDetail="+graphDetail;
else if((graphType == 'conclusion') && (graphDetail==3))
window.location.href=url+"&conclusionID="+graphID+"&graphDetail="+graphDetail;
else
window.location.href=url+"&graphDetail="+graphDetail;
};
function get_graphType() {
var agent = "<?php echo $agentID;?>";
var belief = "<?php echo $beliefID;?>";
var rule = "<?php echo $ruleID;?>";
var argument = "<?php echo $argumentID;?>";
var graphType = '';
if(argument != '') {
graphType = 'argument';
return [graphType, argument];
}
else if (agent != '') {
graphType = 'agent';
return [graphType, agent];
}
else if(belief != '') {
graphType = 'belief';
return [graphType, belief];
}
else if(rule != '') {
graphType = 'rule';
return [graphType, rule];
}
else
return [graphType, ''];
};
function change_scale(inc) {
graphScale+=inc;
myCanviz.setScale(graphScale);
myCanviz.draw()
};
function resize() {
var maxWidth = document.getElementById('graphContainer').width - document.getElementById('tabContainer').innerWidth;
change_scale((1-document.getElementById('canviz_canvas_1').width/maxWidth)/2);
}
jQuery.noConflict();
jQuery(function() {
var valMap = ['high-level', 'mid-level', 'low-level', 'expert'];
jQuery( "#slider" ).slider({
value: Number(val),
min: 0,
max: valMap.length - 1,
step: 1,
slide: function(event, ui) {
//var detail = valMap[ui.value];
//jQuery('#detail').val(detail);
var graph = get_graphType();
var graphType = graph[0];
var graphID = graph[1];
updategraph(graphType, graphID, ui.value);
}
});
jQuery('#detail').val(valMap[jQuery("#slider").slider("value")]);
});
function get_id(label, name) {
jQuery("a[title='"+label+"']").attr('id', name);
};
</script>
<script type="text/javascript" src="menu.js"></script>
</body>
</html>