-
Notifications
You must be signed in to change notification settings - Fork 0
/
index.html
234 lines (220 loc) · 12.2 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
<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8" />
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8" />
<title>Binary File Editor</title>
<meta name="viewport" content="width=device-width, initial-scale=1.0, minimum-scale=1.0, maximum-scale=1.0">
<!-- Global site tag (gtag.js) - Google Analytics -->
<script async src="https://www.googletagmanager.com/gtag/js?id=UA-145770357-1"></script>
<script>
window.dataLayer = window.dataLayer || [];
function gtag(){dataLayer.push(arguments);}
gtag('js', new Date());
gtag('config', 'UA-145770357-1');
</script>
<link rel="stylesheet" href="css/main.css" />
<link rel="stylesheet" href="https://stackpath.bootstrapcdn.com/bootstrap/4.3.1/css/bootstrap.min.css" integrity="sha384-ggOyR0iXCbMQv3Xipma34MD+dH/1fQ784/j6cY/iJTQUOhcWr7x9JvoRxT2MZw1T" crossorigin="anonymous">
<script type="text/javascript" src="https://cdnjs.cloudflare.com/ajax/libs/angular.js/1.7.8/angular.js"></script>
<script type="text/javascript" src="https://cdnjs.cloudflare.com/ajax/libs/underscore.js/1.9.1/underscore-min.js"></script>
<script src="https://code.jquery.com/jquery-3.3.1.slim.min.js" integrity="sha384-q8i/X+965DzO0rT7abK41JStQIAqVgRVzpbzo5smXKp4YfRvH+8abtTE1Pi6jizo" crossorigin="anonymous"></script>
<script src="https://cdnjs.cloudflare.com/ajax/libs/popper.js/1.14.7/umd/popper.min.js" integrity="sha384-UO2eT0CpHqdSJQ6hJty5KVphtPhzWj9WO1clHTMGa3JDZwrnQq4sF86dIHNDz0W1" crossorigin="anonymous"></script>
<script src="https://stackpath.bootstrapcdn.com/bootstrap/4.3.1/js/bootstrap.min.js" integrity="sha384-JjSmVgyd0p3pXB1rRibZUAYoIIy6OrQ6VrjIEaFf/nJGzIxFDsf4x0xIM+B07jRM" crossorigin="anonymous"></script>
<script type="text/javascript" src="js/DataStream.js"></script>
<script type="text/javascript" src="js/search.js"></script>
<script type="text/javascript" src="js/app.js"></script>
</head>
<body ng-app="myApp" ng-controller="MainController as mc">
<div class="modal fade" id="busy" tabindex="-1" role="dialog" aria-labelledby="busyModal" aria-hidden="true" data-backdrop="static" data-keyboard="false">
<div class="modal-dialog modal-dialog-centered" role="document">
<div class="modal-content">
<div class="modal-body">
<div class="progress">
<div class="progress-bar progress-bar-striped progress-bar-animated" role="progressbar" aria-valuenow="{{mc.progress}}" aria-valuemin="0" aria-valuemax="100" style="width: {{mc.progress}}%"></div>
</div>
</div>
</div>
</div>
</div>
<div style="height: 100vh; display: flex;flex-direction: column;">
<div class="header" style="padding: 8px;">
<div class="btn btn-sm btn-primary" style="position: relative;">
<div class="text-center" file-drop ng-model="mc.binaryFile" process-file="mc.clearItems()">
<input class="file-upload" type="file" id="binaryFile" onclick="this.value=null;" file-upload ng-model="mc.binaryFile" process-file="mc.clearItems()" />
binary
</div>
</div>
<div class="dropdown show" style="display: inline;" ng-if="mc.binaryFile">
<a class="btn btn-sm btn-primary dropdown-toggle" href="#" role="button" id="jsonDropdown" data-toggle="dropdown" aria-haspopup="true" aria-expanded="false">
Mode '{{mc.searchMode ? 'Search' : 'JSON'}}'
</a>
<div class="dropdown-menu" aria-labelledby="jsonDropdown">
<a class="dropdown-item" ng-click="mc.searchMode=false;">JSON</a>
<a class="dropdown-item" ng-click="mc.searchMode=true;">Search</a>
</div>
</div>
<div class="btn btn-sm btn-outline-primary" style="position: relative;" ng-if="!mc.searchMode && mc.binaryFile">
<div class="text-center" file-drop ng-model="mc.descriptionFile">
<input class="file-upload" type="file" id="descriptionFile" onclick="this.value=null;" file-upload ng-model="mc.descriptionFile" />
JSON
</div>
</div>
<div class="btn-group btn-group-sm" role="group" ng-if="mc.searchMode && mc.binaryFile">
<div class="btn btn-sm btn-outline-primary" ng-click="mc.process('gif')">GIF</div>
<div class="btn btn-sm btn-outline-primary" ng-click="mc.process('png')">PNG</div>
<div class="btn btn-sm btn-outline-primary" ng-click="mc.process('jpg')">JPG</div>
<div class="btn btn-sm btn-outline-primary" ng-click="mc.process('bmp')">BMP</div>
<div class="btn btn-sm btn-outline-primary" ng-click="mc.process('wav')">WAV</div>
<div class="btn btn-sm btn-outline-primary" ng-click="mc.process('mp3')">MP3</div>
</div>
<div class="dropdown show" style="display: inline;" ng-if="mc.items.length > 0">
<a class="btn btn-sm btn-secondary dropdown-toggle" href="#" role="button" id="dropdownMenuLink" data-toggle="dropdown" aria-haspopup="true" aria-expanded="false">
Sort by '{{mc.sortBy}}'
</a>
<div class="dropdown-menu" aria-labelledby="dropdownMenuLink">
<a class="dropdown-item" ng-click="mc.sort('offset')">Offset</a>
<a class="dropdown-item" ng-click="mc.sort('mime')">Mime type</a>
<a class="dropdown-item" ng-click="mc.sort('length')">Length</a>
</div>
</div>
</div>
<!---->
<div class="main" style="overflow: auto; flex: 1 1 100%;">
<div style="display: flex; flex-wrap: wrap;">
<div class="col-lg-4 col-md-6 col-xl-3" ng-repeat="item in mc.items.slice((mc.page-1)*60, (mc.page-1)*60 + 60) | orderBy:mc.sortBy" ng-if="item.mime">
<div class="card mb-4 shadow-sm" file-drop ng-model="item.newFile" process-file="mc.processFile(item)" max-file-size="item.length" class-over="drop-in-progress">
<div class="card-header d-flex justify-content-between flex-wrap" style="font-size: x-small;">
<div class="col-6"><b>Type:</b> {{item.mime}}</div>
<div class="col-6"><b>Offset:</b> {{item.offset}}</div>
<div class="col-6" title="{{item.length}} Bytes"><b>Length:</b> {{item.length | ffs}}</div>
<div class="col-6" ng-if="item.width"><b>Dimensions:</b> {{item.width}}x{{item.height}}</div>
<div class="col-6" ng-if="item.duration"><b>Duration:</b> {{item.duration | hms}}</div>
<div class="col-6" ng-if="item.desc"><b>Desc:</b> {{item.desc}}</div>
</div>
<div class="card-body" style="background-color: #d3d3d370">
<div class="d-flex justify-content-around align-items-center align-content-center" ng-if="mc.isSupportedImage(item.mime)">
<img class="image-max-100" ng-src="{{item.dataUrl}}" />
<img class="image-max-100" ng-if="item.newDataUrl" ng-src="{{item.newDataUrl}}" />
</div>
<div class="d-flex justify-content-around align-items-center align-content-center" ng-if="mc.isSupportedAudio(item.mime)">
<my-audio>
<audio class="player" ng-src="{{item.dataUrl}}" type="{{item.mime}}">
</audio>
<div class="btn-group controls">
<button type="button" class="btn btn-sm btn-outline-secondary play" style="line-height: 0;">
<svg xmlns="http://www.w3.org/2000/svg" version="1.1" class="svg-play" width="16px" height="16px" viewBox="0 0 100 100">
<polygon points="10,10 90,45 10,90"/>
</svg>
</button>
<button type="button" class="btn btn-sm btn-outline-secondary pause" style="line-height: 0;">
<svg xmlns="http://www.w3.org/2000/svg" version="1.1" class="svg-pause" width="16px" height="16px" viewBox="0 0 100 100">
<polygon points="10,10 35,10 35,90 10,90"/>
<polygon points="65,10 90,10 90,90 65,90"/>
</svg>
</button>
<button type="button" class="btn btn-sm btn-outline-secondary stop" style="line-height: 0;">
<svg xmlns="http://www.w3.org/2000/svg" version="1.1" class="svg-stop" width="16px" height="16px" viewBox="0 0 100 100">
<polygon points="10,10 90,10 90,90 10,90"/>
</svg>
</button>
</div>
</my-audio>
<my-audio ng-if="item.newDataUrl">
<audio class="player" ng-src="{{item.newDataUrl}}" type="{{item.mime}}">
</audio>
<div class="btn-group controls">
<button type="button" class="btn btn-sm btn-outline-secondary play" style="line-height: 0;">
<svg xmlns="http://www.w3.org/2000/svg" version="1.1" class="svg-play" width="16px" height="16px" viewBox="0 0 100 100">
<polygon points="10,10 90,45 10,90"/>
</svg>
</button>
<button type="button" class="btn btn-sm btn-outline-secondary pause" style="line-height: 0;">
<svg xmlns="http://www.w3.org/2000/svg" version="1.1" class="svg-pause" width="16px" height="16px" viewBox="0 0 100 100">
<polygon points="10,10 35,10 35,90 10,90"/>
<polygon points="65,10 90,10 90,90 65,90"/>
</svg>
</button>
<button type="button" class="btn btn-sm btn-outline-secondary stop" style="line-height: 0;">
<svg xmlns="http://www.w3.org/2000/svg" version="1.1" class="svg-stop" width="16px" height="16px" viewBox="0 0 100 100">
<polygon points="10,10 90,10 90,90 10,90"/>
</svg>
</button>
</div>
</my-audio>
</div>
<div class="w-100" ng-if="item.mime == 'text/plain'">
<input class="form-control-sm w-100" ng-model="item.newText" max-length-in-bytes="item.length" />
</div>
</div>
<div class="card-footer d-flex justify-content-between align-items-center">
<div class="btn-group">
<a class="btn btn-sm btn-outline-secondary download" role="button" href="{{item.dataUrl}}" download="{{item.offset}}.{{item.extension}}" title="Download">
<svg xmlns="http://www.w3.org/2000/svg" version="1.1" class="svg-download" width="16px" height="16px" viewBox="0 0 100 100">
<polygon points="10,10 90,10 90,20 10,20"></polygon>
<polygon points="40,30 60,30 60,40 90,40 50,90 10,40 40,40"/>
</svg>
</a>
<div role="button" class="btn btn-sm btn-outline-secondary upload" title="Upload">
<svg xmlns="http://www.w3.org/2000/svg" version="1.1" class="svg-upload" width="16px" height="16px" viewBox="0 0 100 100">
<polygon points="50,10 90,60 60,60 60,70 40,70 40,60 10,60"/>
<polygon points="10,80 90,80 90,90 10,90"></polygon>
</svg>
<input class="file-upload" type="file" id="file-{{item.offset}}"
onclick="this.value=null;"
file-upload
ng-model="item.newFile"
process-file="mc.processFile(item)"
max-file-size="item.length"
/>
</div>
</div>
</div>
</div>
</div>
</div>
</div>
<!---->
<div class="footer d-flex justify-content-between align-items-center align-content-center" style="padding: 8px">
<nav ng-if="mc.pages()>1">
<ul class="pagination pagination-sm justify-content-center mb-0">
<li class="page-item" ng-class="{disabled: mc.page<=1}">
<a class="page-link" href="#" aria-label="First" ng-click="mc.goToPage(1);">
<span aria-hidden="true">«</span>
<span class="sr-only">First</span>
</a>
</li>
<li class="page-item" ng-class="{disabled: mc.page<=1}">
<a class="page-link" href="#" aria-label="Previous" ng-click="mc.goToPage(mc.page-1);">
<span aria-hidden="true">‹</span>
<span class="sr-only">Previous</span>
</a>
</li>
<li class="page-item">
<input class="form-control form-control-sm" style="border-radius: 0" type="number" ng-model="mc.page" min="1" max="{{mc.pages()==0?1:mc.pages()}}">
</li>
<li class="page-item" ng-class="{disabled: mc.page>=mc.pages()}">
<a class="page-link" href="#" aria-label="Next" ng-click="mc.goToPage(mc.page+1);">
<span aria-hidden="true">›</span>
<span class="sr-only">Next</span>
</a>
</li>
<li class="page-item" ng-class="{disabled: mc.page>=mc.pages()}">
<a class="page-link" href="#" aria-label="Next" ng-click="mc.goToPage(mc.pages());">
<span aria-hidden="true">»</span>
<span class="sr-only">Last</span>
</a>
</li>
</ul>
</nav>
<div>
<div class="d-flex justify-content-between align-items-center align-content-center">
<div ng-if="mc.searchMode">
<button type="button" class="btn btn-sm btn-outline-secondary extract" ng-click="mc.createDescriptionFile()">JSON</button>
</div>
<button type="button" class="btn btn-sm btn-outline-secondary create" ng-click="mc.create()" ng-disabled="!mc.binaryFile">Create</button>
</div>
</div>
</div>
</div>
</body>
</html>