-
Notifications
You must be signed in to change notification settings - Fork 3
/
Copy pathencultured.html
266 lines (199 loc) · 8.76 KB
/
encultured.html
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
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
<!DOCTYPE html>
<html>
<head lang="en">
<base href="/" />
<meta charset="UTF-8">
<script src="js/libs/angular.min1-5.js"></script>
<script src="js/libs/ui-bootstrap-tpls-2.0.1.min.js"></script>
<script src="js/libs/moment.min.js"></script>
<link rel="stylesheet" type="text/css" href="css/bootstrap.min.css"/>
<link rel="stylesheet" type="text/css" href="css/vis.min.css"/>
<link rel="stylesheet" type="text/css" href="css/main.css">
<!--
nzigs has someple code
<link rel="stylesheet" type="text/css" href="css/main.css"/>
<script src="js/libs/angular-sanitize.js"></script>
<script src="js/libs/firebase.js"></script>
<script src="js/libs/angularfire.min.js"></script>
-->
<script>
angular.module("sampleApp",['ui.bootstrap','ngStorage']).config(function($locationProvider) {
// enable html5Mode for pushstate ('#'-less URLs)
$locationProvider.html5Mode(true);
$locationProvider.hashPrefix('!');
});
</script>
<style>
#storyChart {
width: 100%;
height: 550px;
border: 1px solid lightgray;
}
</style>
<script src="js/enculturedCtl.js"></script>
<script src="js/enculturedSvc.js"></script>
<script src="js/libs/ngStorage.min.js"></script>
<script src="js/libs/vis.min.js"></script>
<title>Encultured</title>
</head>
<body style="padding: 8px;padding-top: 80px" >
<div ng-app="sampleApp" ng-controller="enculturedCtrl" class="container-fluid">
<nav class="navbar navbar-default navbar-fixed-top" role="navigation">
<div class="container-fluid">
<div class="col-md-7 col-sm-7">
<span>
<a class="navbar-brand" href="#" ng-click="showVersion()">
Encultured
</a>
</span>
</div>
<div class="col-md-2 col-sm-2">
</div>
<div class="col-md-3 col-sm-3">
</div>
</div>
</nav>
<div class="row">
Old!
<div class="col-md-2">
<select class="form-control" ng-model="input.environment"
ng-options = "e for e in environments">
</select>
</div>
<div class="col-md-2">
<select class="form-control" ng-model="input.genre"
ng-options = "g for g in genres">
</select>
</div>
<div class="col-md-7">
<input type="text" class="form-control" placeholder="Enter start text"
ng-model="input.seedText"/>
</div>
<div class="col-md-1">
<button class="btn-link btn" ng-click="startStory(input.seedText)">Start</button>
</div>
</div>
<br/>
<div class="row">
<div class="col-md-4">
<div class="list-group">
<!-- This is the historical stuff-->
<!--
<div ng-show="nodes.length > 1" class="list-group-item" ng-repeat="node in nodes">
<div ng-hide="$index == nodes.length-1">
<p>{{node.aiText}}</p>
<span ng-repeat="choice in node.aiChoices">
{{choice}}
</span>
</div>
</div>
-->
<div ng-show = "currentNode">
<div class="list-group-item">
<p>{{currentNode.aiText}}</p>
<div ng-repeat="choice in currentNode.aiChoices"
class="clickable" ng-click="selectChoice(currentNode,$index)">
{{choice}}
</div>
</div>
</div>
<!-- This is the current one-->
<div ng-show = "false &&nodes.length">
<!--
<strong>Step: {{nodes.length}}</strong>
-->
<div class="list-group-item">
<p>{{nodes[nodes.length-1].aiText}}</p>
<div ng-repeat="choice in currentNode.aiChoices"
class="clickable" ng-click="selectChoice(currentNode,$index)">
{{choice}}
</div>
</div>
</div>
</div>
</div>
<div class="col-md-8">
<uib-tabset ng-show="nodes.length">
<uib-tab heading="Current story">
<table class="table table-bordered">
<tr><th>AI Text</th><th>Id</th><th>Choice</th><th></th></tr>
<tr ng-repeat="node in story">
<td>{{node.aiText}}</td>
<td>{{node.id}}</td>
<td>{{node.aiChoices[node.userChoiceIndex]}}</td>
<td><div class="clickable" ng-click="newStory(node)">New story</div> </td>
</tr>
</table>
</uib-tab>
<uib-tab heading="Graph" select="fitGraph()">
<div class="row">
<div class="col-md-7">
<div id="storyChart"></div>
</div>
<div class="col-md-5">
<uib-tabset>
<uib-tab heading="Selected node">
<pre>{{selectedNodeFromChart.aiNode | json}}</pre>
<br/>
</uib-tab>
<uib-tab heading="Story from this node">
<table class="table table-bordered">
<tr><th>AI Text</th><th>Id</th><th>Choice</th></tr>
<tr ng-repeat="node in storyFromThisNode">
<td>{{node.aiText}}</td>
<td>{{node.id}}</td>
<td>{{node.aiChoices[node.userChoiceIndex]}}</td>
</tr>
</table>
</uib-tab>
</uib-tabset>
<div ng-show="selectedNodeFromChart"
class="clickable"
ng-click="newStory(selectedNodeFromChart.aiNode)">New story starting at this node</div>
</div>
</div>
</uib-tab>
<uib-tab heading="All stories">
<div class="row">
<div class="col-md-3">
<div class="list-group">
<div class="list-group-item"
ng-click="showStory(storyNode)"
ng-repeat="storyNode in allStories">
{{storyNode.id}}
</div>
</div>
</div>
<div class="col-md-9">
<table class="table table-bordered">
<tr><th>AI Text</th><th>Id</th><th>Choice</th><th></th></tr>
<tr ng-repeat="node in oneStory">
<td>{{node.aiText}}</td>
<td>{{node.id}}</td>
<td>{{node.aiChoices[node.userChoiceIndex]}}</td>
<td><div class="clickable" ng-click="newStory(node)">New story</div> </td>
</tr>
</table>
</div>
</div>
</uib-tab>
<uib-tab heading="Table of all nodes">
<table class="table table-bordered">
<tr><th>AI Text</th><th>Id</th><th>Parent</th><th>Choice</th></tr>
<tr ng-repeat="node in nodes">
<td>{{node.aiText}}</td>
<td>{{node.id}}</td>
<td>{{node.parentId}}</td>
<td>{{node.aiChoices[node.userChoiceIndex]}}</td>
</tr>
</table>
</uib-tab>
<uib-tab heading="Json">
<pre>{{nodes | json}}</pre>
</uib-tab>
</uib-tabset>
</div>
</div>
</div>
</body>
</html>