This repository has been archived by the owner on Jul 1, 2020. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 0
/
index.html
313 lines (278 loc) · 15.7 KB
/
index.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
302
303
304
305
306
307
308
309
310
311
312
313
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="utf-8">
<meta http-equiv="X-UA-Compatible" content="IE=edge">
<meta name="viewport" content="width=device-width, initial-scale=1">
<!-- The above 3 meta tags *must* come first in the head; any other head content must come *after* these tags -->
<meta name="description" content="">
<meta name="author" content="">
<link rel="icon" href="">
<title>BFDB Reader (js)</title>
<!-- Bootstrap core CSS -->
<link href="css/bootstrap.min.css" rel="stylesheet">
<!-- IE10 viewport hack for Surface/desktop Windows 8 bug -->
<link href="css/ie10-viewport-bug-workaround.css" rel="stylesheet">
<!-- Custom styles for this template -->
<link href="home.css" rel="stylesheet">
<!-- HTML5 shim and Respond.js for IE8 support of HTML5 elements and media queries -->
<!--[if lt IE 9]>
<script src="https://oss.maxcdn.com/html5shiv/3.7.3/html5shiv.min.js"></script>
<script src="https://oss.maxcdn.com/respond/1.4.2/respond.min.js"></script>
<![endif]-->
<script type="text/javascript" src="js/bacc-page.js"></script>
<script type="text/javascript" src="db-reader.js"></script>
<script src="marked.js"></script>
</head>
<body>
<script type="text/javascript">
printHeader("Projects");
</script>
<div class="container">
<div class="content">
<div class="boxed-content-main">
<!-- Source for FileReader example: http://stackoverflow.com/questions/3582671/how-to-open-a-local-disk-file-with-javascript -->
<h1 style="text-align: left;">BFDBReader-js</h1>
<!-- status message area -->
<pre id="status">Status: Waiting for file(s) to be chosen. <br>Choose your files using the 'Automatic' or 'Manual' tabs in the File Loader area.</pre>
<div class="panel-group" id="accordion">
<div class="panel panel-default clickable-readme-tab">
<div class="panel-heading">
<h4 class="panel-title">
<a data-toggle="collapse" data-parent="#accordion" href="#collapse0">
0. Description and Instructions (Please read all of this before continuing)</a>
</h4>
</div>
<div id="collapse0" class="panel-collapse collapse">
<div class="panel-body">
<div class="boxed-content-sub2" id="readme-contents">
Readme info is here.
</div>
</div>
</div>
</div>
<div class="panel panel-default">
<div class="panel-heading">
<h4 class="panel-title">
<a data-toggle="collapse" data-parent="#accordion" href="#collapse1">
1. File Loader</a>
</h4>
</div>
<div id="collapse1" class="panel-collapse collapse">
<div class="panel-body">
<!-- file input area -->
<div class="boxed-content-sub">
<ul class="nav nav-tabs">
<li class="active"><a data-toggle="tab" href="#auto-input">Automatic</a></li>
<li><a data-toggle="tab" href="#manual-input">Manual</a></li>
<li><a data-toggle="tab" href="#server-input">Server</a></li>
</ul>
<div class="tab-content" style="overflow-x: scroll; margin-top: 0px">
<div id="auto-input" class="tab-pane fade in active">
<div class="boxed-content-sub2">
Server:
<select id="server-name">
<option>Global</option>
<option>Japan</option>
<option>Europe</option>
<option>Sample</option>
</select>
<button id="server-url-button" onclick="loadURLNames()">Load URLs</button>
<button id="url-file-load-button" onclick="loadFilesFromURLs()" disabled="disable" style="display: none">Load Files</button>
<br>
Info JSON: <a id="server-info-url" target="_blank"></a><br>
SP/feskills JSON: <a id="server-skill-url" target="_blank"></a><br>
Loading these files will take some time due to their size, so please be patient and do not exit the page while they're loading. Refer to the status messages above for the current progress.
<br>
<button id="status-refresh" style="margin-bottom: 10px; margin-top: 10px; display: none;" onclick="updateFileLoadStatus()">Refresh Status</button>
</div>
</div>
<div id="manual-input" class="tab-pane fade">
<div class="boxed-content-sub2">
Info JSON: <input type="file" id="file-input" />
SP/feskills JSON: <input type="file" id="sp-input" />
<a href="https://github.com/Deathmax/bravefrontier_data/" target="_blank">Don't have any files? Choose an info.json and feskills.json here.</a>
</div>
</div>
<div id="server-input" class="tab-pane fade">
<div class="boxed-content-sub2">
Do you know the URL of a site hosting a version of my <a href="https://github.com/BluuArc/BFDBReader-node" target="_blank">BFDBReader-node project</a>? Enter it below for quicker loading.<br>
<input type="text" id="url-box" title="e.g. http://someserver.com">
<button id="url-use-button" style="display: inline;" onclick="parseJSON()">Use This Server</button><br>
Order By:
<form>
<input type="radio" name="order" value="unit_id" id="unit_id" checked>Unit ID<br>
<input type="radio" name="order" value="guide_id" id="guide_id">Guide ID<br>
</form>
</div>
</div>
</div>
<button id="parse-button" disabled="disable" style="margin-bottom: 10px; margin-top: 10px; display: none;">Parse File(s)</button>
<br>
</div>
<!--file content area-->
<div class="boxed-content-sub" id="file-content-area">
<h3>File Contents:</h3>
<ul class="nav nav-tabs">
<li class="active"><a data-toggle="tab" href="#info-tab">Info JSON</a></li>
<li><a data-toggle="tab" href="#feskills-tab">SP JSON</a></li>
</ul>
<div class="tab-content">
<div id="info-tab" class="tab-pane fade in active">
<textarea readonly rows="10" cols="100" id="file-content-status">Info input from file will be output here.</textarea>
<textarea readonly rows="10" cols="100" id="file-content" style="display: none;">Info input from file will be output here.</textarea>
</div>
<div id="feskills-tab" class="tab-pane fade">
<textarea readonly rows="10" cols="100" id="sp-content-status">SP input from file will be output here.</textarea>
<textarea readonly rows="10" cols="100" id="sp-content" style="display: none;">SP input from file will be output here.</textarea>
</div>
</div>
</div>
</div>
</div>
</div>
<div class="panel panel-default">
<div class="panel-heading">
<h4 class="panel-title">
<a data-toggle="collapse" data-parent="#accordion" href="#collapse2">
2. Unit Search and Unit Info</a>
</h4>
</div>
<div id="collapse2" class="panel-collapse collapse">
<div class="panel-body">
<!-- Unit Search area -->
<div class="boxed-content-sub" id="unit-search-area">
<input type="text" id="search-box" title="Search for units here, and the dropdown on the right will update with results. To reset the dropdown, clear the contents of this text box and press the search button." disabled="disable">
<button id="search-button" style="display: inline;" onclick="searchList()" disabled="disable">Search</button>
<select id="unit-names">
<option>Please pick a JSON file to use.</option>
</select>
<button id="print-button" disabled="disable">Print Info</button> <p style="display: inline;"> </p><p id="search-info-text" style="display: inline;"></p>
<p id="search-key"></p>
</div>
<!--Unit info output area-->
<div class="boxed-content-sub" id="unit-info-area">
<h3>Unit Info:</h3>
<ul class="nav nav-tabs">
<li class="active"><a data-toggle="tab" href="#formatted-md-tab">Formatted</a></li>
<li><a data-toggle="tab" href="#markdown">Markdown</a></li>
<li><a data-toggle="tab" href="#html">HTML</a></li>
<li><a data-toggle="tab" href="#json">JSON</a></li>
<li><a data-toggle="tab" href="#unit-art">Unit Art</a></li>
<li><a data-toggle="tab" href="#unit-spark">Sparkable Units</a></li>
<li><a data-toggle="tab" href="#unit-links">Related Links</a></li>
</ul>
<div class="tab-content">
<div id="formatted-md-tab" class="tab-pane fade in active" style="overflow-x: scroll;">
<div class="boxed-content-sub2">
<div id="formatted-md" style="padding: 10px">
Formatted unit info will be output here.
</div>
</div>
Markdown converted to HTML with <a href="https://github.com/chjj/marked/" target="_blank">marked</a>.
</div>
<div id="markdown" class="tab-pane fade">
<textarea readonly rows="10" cols="100" id="unit-info">Unit info will be output here.</textarea>
</div>
<div id="html" class="tab-pane fade">
<textarea readonly rows="10" cols="100" id="unit-info-html">Unit info will be output here.</textarea>
</div>
<div id="json" class="tab-pane fade">
<textarea readonly rows="10" cols="100" id="unit-info-raw">Raw JSON data of unit info will be output here.</textarea>
</div>
<div id="unit-spark" class="tab-pane fade">
Search for units that can spark with this unit's:
<button id="bb-button" style="display: inline;">BB</button>
<button id="sbb-button" style="display: inline;">SBB</button>
<button id="ubb-button" style="display: inline;">UBB</button>
<div class="boxed-content-sub2">
<p id="burst-results"></p>
</div>
</div>
<div id="unit-art" class="tab-pane fade">
<div class="boxed-content-sub2">
<img src="http://i.imgur.com/6vQObKW.png" alt="unit-full-img" id="unit-full-img" style="display: block; margin: auto; text-align: center; max-height: 100%; max-width: 100%;">
<p style="text-align: center;" id="unit-full-img-text">No unit loaded.<br>All Brave Frontier images are owned by Gumi.</p>
</div>
</div>
<div id="unit-links" class="tab-pane fade">
<div class="boxed-content-sub2">
<a href="https://markdowntohtml.com/#converter" target="_blank">Markdown to HTML Converter</a><br>
<a href="https://jsonformatter.curiousconcept.com/" target="_blank">JSON formatter</a> <br>
<a href="http://www.w3schools.com/html/tryit.asp?filename=tryhtml_intro" target="_blank">Share the info you find with this page</a> <a href="http://www.w3schools.com/code/tryit.asp?filename=FBHA0YO6P5TH" target="_blank">(example of a saved unit)</a><br>
<a href="https://www.reddit.com/r/bravefrontier/comments/4sm6ro/how_to_perfect_spark_identical_units_compilation/" target="_blank">Guide on sparking units with the same move speed (Global Only)</a>
</div>
</div>
</div>
</div>
</div>
</div>
</div>
</div>
</div>
<br>
</div>
</div>
</div><!-- /.container -->
<textarea id="temp" style="display: none;"></textarea>
<script type="text/javascript">
//print search key
document.getElementById("temp").innerHTML = "| Key: | `v` | `^` | `v^` |\n|:---:|:---:|:---:|:---:|\n | | Results are below this option | Results are above this option | Results are above and below this option |\n\nYou can reset the list by searching with an empty search box.";
document.getElementById("search-key").innerHTML = marked(document.getElementById("temp").innerHTML);
//print readme contents
loadFile("https://bluuarc.github.io/BFDBReader-js/README.md", "temp");
window.onload = function(){ document.getElementById("readme-contents").innerHTML = marked(document.getElementById("temp").innerHTML)};
//manual file input listeners
document.getElementById('file-input').addEventListener('change', readInfoFile, false);
document.getElementById('sp-input').addEventListener('change', readSkillsFile, false);
//unit input
//uncomment line below to enable auto-search
//document.getElementById("search-box").addEventListener('keyup',searchList);
document.getElementById("search-box").addEventListener('keyup', function(){
document.getElementById("search-button").disabled = false;
});
//search when 'Enter' key is pressed
//source: http://stackoverflow.com/questions/155188/trigger-a-button-click-with-javascript-on-the-enter-key-in-a-text-box
document.getElementById("search-box")
.addEventListener("keyup", function(event) {
event.preventDefault();
if (event.keyCode == 13) {
document.getElementById("search-button").click();
}
});
//search for sparkable units when button is pressed
document.getElementById("bb-button").addEventListener('click', function(){
getSparkList('bb');
document.getElementById('burst-results').innerHTML = marked(document.getElementById('temp').innerHTML);
});
document.getElementById("sbb-button").addEventListener('click', function(){
getSparkList('sbb');
document.getElementById('burst-results').innerHTML = marked(document.getElementById('temp').innerHTML);
});
document.getElementById("ubb-button").addEventListener('click', function(){
getSparkList('ubb');
document.getElementById('burst-results').innerHTML = marked(document.getElementById('temp').innerHTML);
});
//print unit data when print button is pressed
document.getElementById("print-button").addEventListener('click', function(){
printUnitClick();
document.getElementById("formatted-md").innerHTML = marked(document.getElementById("unit-info").innerHTML);
document.getElementById("formatted-md").innerHTML += marked("Data parsed using [BFDBReader-js](https://bluuarc.github.io/BFDBReader-js/).\n");
document.getElementById("unit-info-html").innerHTML = document.getElementById("formatted-md").innerHTML;
});
//hide parse button after being pressed
document.getElementById("parse-button").addEventListener('click', function(){
parseJSON();
document.getElementById("status-refresh").style = document.getElementById("parse-button").style = "margin-bottom: 10px; margin-top: 10px; display: none;";
//setIdCookie();
//getIdLoadText();
saveIDLength();
});
//try urls for unit art
document.getElementById("unit-full-img").addEventListener('error', loadUnitArt);
</script>
<script>
printFooter();
</script>
</body>
</html>