-
Notifications
You must be signed in to change notification settings - Fork 2
/
viewtree.html
301 lines (265 loc) · 13.7 KB
/
viewtree.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
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
<!DOCTYPE html>
<!--
Palmyra
Copyright (c) 2019 New York University Abu Dhabi
License: MIT BSD-3
THIS SOFTWARE IS PROVIDED ''AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING,
BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED.
IN NO EVENT SHALL THE U.S. GOVERNMENT OR ANY DEPARTMENTS OR EMPLOYEES THEREOF BE LIABLE FOR ANY DIRECT, INDIRECT,
INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE,
EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.)
-->
<html lang="en">
<head>
<meta charset="utf-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<link rel="stylesheet" type="text/css" href="main.css">
<link rel="stylesheet" type="text/css" href="text_upload.css">
<title>Palmyra v3.0</title>
</head>
<body class="viewtree">
<div class="navbar">
<div class="container" style="display: flex; flex-direction: row; justify-content: flex-start; height: 65px">
<div class="logo" style="float: left">
<a href="index.html"><img src="fonts/logo.png" alt="palmyra" id='logo'/></a>
</div>
<div class="toolbar" style="display: flex;flex-direction: column;margin-left: 20px;height: 65px">
<div id="conlluFileNameDiv" class="file-name-tree-number">
<span id="conlluFileName"></span>
<span id="currentTreeNumber" class="tab parens"></span>
</div>
<div class="toolbar btn-options" align="left" style="display: flex;justify-content: flex-start;align-items: center;">
<div class="dropdown">
<button class="dropbtn">File</button>
<!-- <i class="fa fa-caret-down"></i> was used with the above button -->
<div class="dropdown-content">
<p id="save_remote" onClick="saveTreeRemote()">Save to Google Drive (ctrl + shift + s)</p>
<p id="save_as_option" onClick="saveAsPicker()">Save as to Google Drive</p>
<p id="rename_toggle" onClick="renameToggle()">Rename (ctrl + shift + r)</p>
<p onClick="downloadToggle()">Download (ctrl + shift + d)</p>
<p onClick="clearTree()">Quit</p>
</div>
</div>
<div class="dropdown">
<button class="dropbtn">Edit
<i class="fa fa-caret-down"></i>
</button>
<div class="dropdown-content">
<p onClick="editToggle()">Edit Morphology (ctrl + shift + m)</p>
<p onClick="tagsToggle()">Edit Tags (ctrl + shift + t)</p>
<p onClick="addNewTree()">Add New Tree</p>
<p onClick="deleteCurrentTree()">Delete Current Tree</p>
</div>
</div>
<div class="dropdown">
<button class="dropbtn">View
<i class="fa fa-caret-down"></i>
</button>
<div class="dropdown-content">
<p onClick="directionToggle()">Change Direction<p>
<p onClick="search(treesArray)">Listing (ctrl + shift + l)</p>
</div>
</div>
<div class="dropdown">
<button class="dropbtn">Go
<i class="fa fa-caret-down"></i>
</button>
<div class="dropdown-content">
<p onClick="firstTree()">First tree (ctrl + shift + ↑)<p>
<p onClick="prevTree()">Previous tree (ctrl + shift + ←)</p>
<p onClick="nextTree()">Next tree (ctrl + shift + →)</p>
<p onClick="lastTree()">Last tree (ctrl + shift + ↓)</p>
<p onClick="goToTreeToggle()">Search by tree number</p>
</div>
</div>
<div class="dropdown">
<button class="dropbtn">Help
<i class="fa fa-caret-down"></i>
</button>
<div class="dropdown-content">
<p><a href="about.html" target="_blank" style="color:black">About</a></p>
<!-- <p><a href="terms_of_use.html" target="_blank" style="color:black">Terms of use</a></p> -->
<p><a href="privacy_policy.html" target="_blank" style="color:black">Privacy Policy</a></p>
</div>
</div>
<!-- <div class="dropdown">
<button class="dropbtn">Help
<i class="fa fa-caret-down"></i>
</button>
<div class="dropdown-content">
</div>
</div> -->
</div>
</div>
<!-- <div class="btn btn-open" id="parseButton"> -->
</div>
<div class="container" style="width:100%">
<section id="upload3" class="upload" >
<p>Optional Config File:</p>
<select id="configFileSelector">
<option>Choose File</option>
<option>Upload your config file</option>
</select>
<input style="float:left; display:none" type="file" name="configFile" id="configFile"/>
</section>
</div>
<!-- upload a conll file from device -->
<div class="container" style="width:100%">
<section id="upload" class="upload">
<p>Select CoNLL-U File:</p>
<input style="float:left" type="file" id="inputFile" name="treefiles[]" /><br>
<input style="float:right; margin-right:45px" type="button" id="treebtn" value="Upload"
onClick="setupTreePage(LocalFileInputChecker)" />
<!-- <input style="float:right" type="button" id="treebtn" value="Upload" onClick="setJSONtreeData()" /> -->
</section>
</div>
<!-- upload from google drive -->
<div id="upload1" class="container" style="width:100%">
<section class="upload" style="padding-right: 3.5em;">
<p>MyDrive CoNLL-U files</p>
<input style="float: left" type="button" id="browse_btn" value="Browse MyDrive" />
<p id="picked_filename" style="float: left"></p>
<input style="float:right" type="button" id="treebtn1" value="Upload"
onClick="setupTreePage(RemoteFileInputChecker)" />
</section>
</div>
<!-- upload text -->
<div class="container" style="width:100%">
<section class="upload">
<form id="upload2">
<div id="upload-2-row-1">
<label id="label-treedata2" for="treedata2"> Or enter text</label>
<br>
<textarea id="treedata2" dir="auto" placeholder="Each line of text will become a seperate tree."></textarea>
</div>
<div id="upload-2-row-2">
<p id="parse-limit-note" style="display: none;">Parse limit is 100 words. The remaining sentences will not be parsed.</p>
<input type="button" id="treebtn2" value="Upload" onClick="setSentenceTreeData()" />
<label for="parser-select">or parse sentences</label>
<select name="parsers" id="select-parser">
<option value="">--Please select a parser--</option>
<option value="ar_catib">CATiB, Ar</option>
<option value="ar_ud">UD, Ar</option>
</select>
<input type="button" id="parse" value="Parse" onClick="parseFile()" />
</div>
</form>
<div class="modal_parent">
<section id="parse-modal" class="modal hidden">
<div style="display: flex;
flex-direction: column;
justify-content: center;
align-items: center;">
<img src="tree_svg.svg" alt="tree loading gif" style="width: 100%; height: 100%;"/>
<p style="text-align: center;">Parsing sentences, this will take a moment.</p>
</div>
<!-- <button id="parse-close-btn" class="btn"></button> -->
</section>
<div id="parse-overlay" class="parse-overlay-class hidden"></div>
<section id="get-parsed-modal" class="modal hidden">
<div>
<p>Sentences parsed! Click on the button below to see the parsed sentences.</p>
</div>
<button id="get-parsed-btn" class="btn"></button>
</section>
<div id="get-parsed-overlay" class="parse-overlay-class hidden"></div>
</div>
</section>
</div>
<div id="auth_logout_btns" class="toolbar" style="text-align: center;">
<input type="button" value="Authenticate with Google Drive" id="auth_btn"
onClick="authenticate()"/>
<input type="button" tabindex="-1" value="Logout" id="logout_btn" onClick="logout()" />
</div>
<section id="download-section" class="section-alignment">
<form id="download">
<p>File Name</p>
<input type="text" id="filename" />
</form>
<input type="button" id="dwnbtn" value="Download" onClick="downloadTree()" />
<button onClick="hideAllWindows()">Close</button>
</section>
<section id="rename-section" class="section-alignment">
<form id="rename">
<p>File Name</p>
<input type="text" id="filename_remote" />
</form>
<input type="button" id="rename_btn" value="Save" onClick="saveTreeRemote();hideAllWindows()" />
<button onClick="hideAllWindows()">Close</button>
</section>
<section id="gototree-section" class="section-alignment">
<form id="gototree">
<p>Please select tree number:</p>
<input type="number" id="treeNumberInput" min="1" max="1" style="width: 3em"
onkeypress="return goToKeyPress(event);">
</form><br>
<input type="button" id="goTreebtn" value="Go" onClick="goToTree()" />
<button onClick="hideAllWindows()">Close</button>
</section>
<section id='labels'>
<label class='labelsp'>Relation Labels</label>
</section>
<section id='postags'>
<label class='labelsp'>POS Tags</label>
</section>
<div id="listing" class="scroll" style="width:50%;height:400px;">
<section id="search" style="display:block; width: 90%;"></section>
</div>
<section id='morphology'>
<p class='labelsp'>Token:</p>
<div>
<input type="text" id="morphologyName"><br>
</div>
<div id='lemmaField'>
</div>
<div id='lexicalFeats'>
</div>
<p class='labelsp' id='labelspMorphoFeats'>Morphological Features:</p>
<div id='morphoFeats'>
</div>
<p>
<button onClick="saveMorphology()">OK</button>
<button onClick="cancelMorphology()">Cancel</button>
</p>
</section>
</div>
<div id="sents" class="standard">
<p id="fullSentence"></p>
<p id="print"></p>
<hr>
</div>
<script src="scripts/jquery-1.11.3.min.js"></script>
<script src="scripts/d3.v3.min.js"></script>
<!-- <script src="scripts/Blob.js"></script> -->
<script src="scripts/FileSaver.min.js"></script>
<script src="scripts/saveSvgAsPng.js"></script>
<script src="scripts/underscore-min.js"></script>
<script src="scripts/cycle.js"></script>
<script src="https://cdn.jsdelivr.net/npm/axios/dist/axios.min.js"></script>
<script src="configFileHandler.js"></script>
<script src="gapiLoader.js"></script>
<script src="authenticator.js"></script>
<script src="parsing.js"></script>
<script async defer src="https://apis.google.com/js/api.js"
onload="gapiLoaded('client', initializeGapiClient)"></script>
<script async defer src="https://apis.google.com/js/api.js"
onload="gapiLoaded('picker', initializeGapiPicker)"></script>
<script async defer src="https://accounts.google.com/gsi/client" onload="gisLoaded()"></script>
<script src="main.js"></script>
<script src="keyboardShortcuts.js"></script>
<script>
function goToKeyPress(e) {
// look for window.event in case event isn't passed in
e = e || window.event;
if (e.keyCode == 13) {
document.getElementById('goTreebtn').click();
return false;
}
return true;
}
</script>
</body>
</html>