forked from raffazizzi/coreBuilder
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathindex.html
More file actions
134 lines (110 loc) · 4.55 KB
/
index.html
File metadata and controls
134 lines (110 loc) · 4.55 KB
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
<!DOCTYPE html>
<html>
<head>
<meta charset='utf-8'>
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>Core Builder 0.2</title>
<script src="dist/bower.js"></script>
<script src="dist/ace/ace.js"></script>
<link rel="stylesheet" type="text/css" href="css/main.css">
</head>
<body>
<div class="container" id="coreBuilder">
<div class="row" id="header">
<h1>CoreBuilder v 0.2</h1>
<div id="sources" class="panel">
<select class="sel-sources" multiple="multiple">
<option value="KAtx4_III_2">KAtx4_III_2</option>
<option value="Ltx2_III_2">Ltx2_III_2</option>
<option value="Ktx6_III_2">Ktx6_III_2</option>
<option value="D_ptx2_III_2">D_ptx2_III_2</option>
</select>
<span class="btn btn-primary btn-file" id="uploadCore">
Upload Core <input type="file">
</span>
<button type="button" class="btn btn-primary" id="downloadCore">
Download Core
</button>
<ul class="nav nav-tabs pull-right" id="tabs">
<li class="active"><a href="#cur_entry" data-toggle="tab">Current Entry</a></li>
<li><a href="#full" data-toggle="tab">Full Core</a></li>
</ul>
</div>
</div>
<div class="row" id="main">
<div class="col-md-7 well">
<!--<div class="alert alert-info"><span class="glyphicon glyphicon-arrow-up"></span> Pick a source to start selecting elements.</div>-->
<div class="row" id="editors"> </div>
</div>
<div class="col-md-5 panel tab-content" id="corexml">
<div class="tab-pane active" id="cur_entry">
</div>
<div class="tab-pane" id="full"></div>
</div>
</div>
<!-- BACKBONE TEMPLATES -->
<script type="text/template" id="editor-tpl">
<div class="edit">
<div>
<div class="container-fluid">
<div class="row">
<div class="col-md-6 src-title"><%=source%></div>
<div class="col-md-6 text-right">
<button type="button" class="btn btn-default btn-md" data-toggle="button">
<span class="glyphicon glyphicon-pencil"></span> Edit
</button>
<button type="button" class="btn btn-default btn-md">
<span class="glyphicon glyphicon-cloud-upload"></span> Save to server
</button>
</div>
</div>
</div>
<div id="ed_<%=source%>" class="editor"></div>
<span class="label label-info">Selected Elements</span>
</div>
<div><button class="btn btn-xs btn-default pull-right add-empty">Add this source to the core as "empty"</button></div>
</div>
</script>
<script type="text/template" id="selection-tpl">
<%=ident%>[@xml:id='<%=xmlid%>'] <button class="btn btn-xs btn-danger sel-remove">×</button>
</script>
<script type="text/template" id="core-tpl">
<pre class="sh_xml"><code class="language-markup"><%=xml_string%></code></pre>
<div class="pull-right">
<button type="button" id="entry_cancel" class="btn btn-danger">
<span class="glyphicon glyphicon-trash"></span> Cancel
</button>
<button type="button" class="btn btn-default dropdown-toggle" data-toggle="dropdown">
Group Selections <span class="caret"></span>
</button>
<ul class="dropdown-menu" role="menu" id="entry_group">
<% _.each(sources, function(s) { %> <li><a href="#" data-source="<%= s %>"><%= s %></a></li> <% }); %>
</ul>
<button type="button" id="entry_add" class="btn btn-success">
<span class="glyphicon glyphicon-plus"></span> Add
</button>
</div>
</script>
<script type="text/template" id="entry-tpl"><button type="button" class="close">×</button><code class="language-markup"><%=escaped_xml%></code></script>
<script src="dist/coreBuilder.js"></script>
<script type="text/javascript">
// Get documents (eventually move this under a utils namespace)
url = "rest_tmp/texts.json";
// url = "getScenes.xql";
$.get(url, function (data) {
resources = data.collection.resource;
sel = $("#sources select")
for (i=0; i<resources.length; i++) {
res = resources[i].name.slice(0, -4)
opt = $("<option/>");
opt.attr("value", res);
opt.text(res);
sel.append(opt);
}
// Start CoreBuilder UI
new coreBuilder.App({"data_url":"data"})
// new coreBuilder.App({"data_url":"/freidi-tools/rest/documents/texts"})
}, 'json')
</script>
</body>
</html>