forked from toehio/s3album
-
Notifications
You must be signed in to change notification settings - Fork 0
/
publish.html
398 lines (369 loc) · 15 KB
/
publish.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
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
<!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">
<title>S3 Album Publisher</title>
<script><!-- DEFAULTS -->
DEFAULT_FORCE_PATH_STYLE = undefined;
DEFAULT_ENDPOINT = undefined;
DEFAULT_DST_PREFIX = undefined;
DEFAULT_SRC_PREFIXES = undefined;
DEFAULT_BUCKET = undefined;
DEFAULT_SSL_ENABLED = undefined;
DEFAULT_PHOTO_WIDTH = 1600;
DEFAULT_THUMB_HEIGHT = 150;
</script>
<link href="https://cdnjs.cloudflare.com/ajax/libs/twitter-bootstrap/3.3.5/css/bootstrap.min.css" rel="stylesheet">
<link href="https://cdnjs.cloudflare.com/ajax/libs/bootstrap-table/1.9.1/bootstrap-table.min.css" rel="stylesheet">
<link href="https://cdnjs.cloudflare.com/ajax/libs/fancybox/2.1.5/jquery.fancybox.min.css" rel="stylesheet">
<style>
.detected-config {
display: none;
width: 250px;
}
/*
* Sidebar
*/
/* Hide for mobile, show later */
.sidebar {
display: none;
}
@media (min-width: 768px) {
.sidebar {
position: fixed;
top: 0px;
bottom: 0;
left: 0;
z-index: 1000;
display: block;
padding: 20px;
overflow-x: hidden;
overflow-y: auto; /* Scrollable contents if viewport is shorter than content. */
background-color: #f5f5f5;
border-right: 1px solid #eee;
}
}
/* Sidebar navigation */
.nav-sidebar {
margin-right: -21px; /* 20px padding + 1px border */
margin-bottom: 20px;
margin-left: -20px;
}
.nav-sidebar > li > a {
padding-right: 20px;
padding-left: 20px;
}
.nav-sidebar > .active > a,
.nav-sidebar > .active > a:hover,
.nav-sidebar > .active > a:focus {
color: #fff;
background-color: #428bca;
}
/*
* Main content
*/
.main {
padding: 20px;
}
@media (min-width: 768px) {
.main {
padding-right: 40px;
padding-left: 40px;
}
}
.main .page-header {
margin-top: 0;
}
/*
* Modals
*/
.modal.modal-wide .modal-dialog {
width: 99%;
height: 99%
}
.modal-wide .modal-body {
overflow-y: auto;
}
</style>
<!-- HTML5 shim and Respond.js for IE8 support of HTML5 elements and media queries -->
<!-- WARNING: Respond.js doesn't work if you view the page via file:// -->
<!--[if lt IE 9]>
<script src="https://oss.maxcdn.com/html5shiv/3.7.2/html5shiv.min.js"></script>
<script src="https://oss.maxcdn.com/respond/1.4.2/respond.min.js"></script>
<![endif]-->
</head>
<body>
<div class="container-fluid">
<div class="row">
<div class="col-sm-3 col-md-2 sidebar">
<ul>
<button type="button" class="btn btn-default" data-toggle="modal" data-target="#settingsModal">
<span class="glyphicon glyphicon-cog" aria-hidden="true"></span>
Settings
</button>
</ul>
<ul>
<button type="button" class="btn btn-default" data-toggle="modal" data-target="#newAlbumModal">
<span class="glyphicon glyphicon-book" aria-hidden="true"></span>
New album
</button>
</ul>
<ul class="nav nav-sidebar" id="albumList">
</ul>
</div>
<div class="col-sm-9 col-sm-offset-3 col-md-10 col-md-offset-2 main" style="display: none;">
<h1 class="page-header">
<span id="pageTitle">Create a new album or select one from the right</span>
<button id="addPhotos" type="button" class="btn btn-default" data-toggle="modal" data-target="#fileBrowserModal">
<span class="glyphicon glyphicon-picture" aria-hidden="true"></span>
Add photos
</button>
</h1>
<div class="input-group pull-left">
<span class="input-group-addon" id="basic-addon3">Public URL:</span>
<input type="text" class="form-control" id="albumPublicUrl" value="someurl" size="50" readonly>
</div>
<div class="row">
</div>
<div class="row" id="albumThumbs">
</div>
</div>
</div>
</div>
<div class="modal fade" id="fileBrowserModal" tabindex="-1" role="dialog">
<div class="modal-dialog" role="document">
<div class="modal-content">
<div class="modal-header">
<button type="button" class="close" data-dismiss="modal" aria-label="Done"><span aria-hidden="true">×</span></button>
<h4 class="modal-title" id="fileBrowserModalLabel">S3 Bucket Browser</h4>
</div>
<div class="modal-body">
<ol id="filesBreadcrumbs" class="breadcrumb">
</ol>
<table id="filesTable" class="table" data-toggle="table">
<thead>
<tr>
<th data-field="actions" data-formatter="actionColumnFormatter" data-events="actionColumnEvent"></th>
<th data-field="Name" data-formatter="nameColumnFormatter">Name</th>
<th data-field="Size">Size</th>
<th data-field="LastModified">Date</th>
</tr>
</thead>
<tbody>
</tbody>
</table>
</div>
<div class="modal-footer">
<button type="button" class="btn btn-default" data-dismiss="modal">Done</button>
</div>
</div>
</div>
</div>
<div class="modal fade" id="newAlbumModal" tabindex="-1" role="dialog">
<div class="modal-dialog" role="document">
<div class="modal-content">
<div class="modal-header">
<button type="button" class="close" data-dismiss="modal" aria-label="Done"><span aria-hidden="true">×</span></button>
<h4 class="modal-title" id="newAlbumModalLabel">New Album</h4>
</div>
<form>
<div class="modal-body">
<input type="text" class="form-control" placeholder="Album name...">
</div>
<div class="modal-footer">
<button type="submit" class="btn btn-primary">Create album</button>
<button type="button" class="btn btn-default" data-dismiss="modal">Cancel</button>
</form>
</div>
</div>
</div>
</div>
<div class="modal modal-wide fade" id="settingsModal" tabindex="-1" role="dialog">
<div class="modal-dialog" role="document">
<div class="modal-content">
<div class="modal-header">
<button type="button" class="close" data-dismiss="modal"><span aria-hidden="true">×</span></button>
<h4 class="modal-title">Settings</h4>
</div>
<form class="form-horizontal" role="form">
<div class="modal-body">
<div class="panel panel-default">
<div class="panel-heading"><b>S3 Credentials</b></div>
<div class="panel-body">
<div class="form-group row">
<label class="control-label col-sm-2" for="accessKeyId">Access Key ID:</label>
<div class="col-sm-10">
<input type="text" class="form-control" name="accessKeyId" id="accessKeyId" placeholder="accessKeyId">
<span class="help-block detected-config">Automatically detected</span>
</div>
</div>
<div class="form-group row">
<label class="control-label col-sm-2" for="secretAccessKey">Secret Access Key:</label>
<div class="col-sm-10">
<input type="text" class="form-control" name="secretAccessKey" id="secretAccessKey" placeholder="secretAccessKey">
<div class="form-control-feedback detected-config">
<span class="glyphicon glyphicon-eye-open" aria-hidden="true"></span>
Automatically detected
</div>
</div>
</div>
</div>
</div>
<div class="panel panel-default">
<div class="panel-heading"><b>Source Bucket</b> <small>Where do you keep your photos?</small></div>
<div class="panel-body">
<div class="form-group row">
<label class="control-label col-sm-2" for="srcBucketName">Bucket name:</label>
<div class="col-sm-10">
<input type="text" class="form-control" name="srcBucketName" id="srcBucketName" placeholder="srcBucketName">
<div class="form-control-feedback detected-config">
<span class="glyphicon glyphicon-eye-open" aria-hidden="true"></span>
Automatically detected
</div>
</div>
</div>
<div class="form-group row">
<label class="control-label col-sm-2" for="srcPrefixes">Path to original photos:</label>
<div class="col-sm-10">
<input type="text" class="form-control" name="srcPrefixes" id="srcPrefixes" placeholder="Specify the location of your original photos in the bucket (separate multiple paths with commas ',')">
<div class="form-control-feedback detected-config">
<span class="glyphicon glyphicon-eye-open" aria-hidden="true"></span>
Automatically detected
</div>
</div>
</div>
</div>
</div>
<div class="panel panel-default">
<div class="panel-heading"><b>Public Bucket</b> <small>Where are the albums stored (and publicly visible)?</small></div>
<div class="panel-body">
<div class="form-group row">
<label class="control-label col-sm-2" for="dstBucketName">Bucket name:</label>
<div class="col-sm-10">
<div class="input-group">
<div class="checkbox input-group-addon">
<label>
<input type="checkbox" id="useSameBucket" value="" checked>
same bucket as source
</label>
</div>
<input type="text" class="form-control" name="dstBucketName" id="dstBucketName" placeholder="dstBucketName" disabled>
<div class="form-control-feedback detected-config">
<span class="glyphicon glyphicon-eye-open" aria-hidden="true"></span>
Automatically detected
</div>
</div>
</div>
</div>
<div class="form-group row">
<label class="control-label col-sm-2" for="dstPrefix">Path to published albums:</label>
<div class="col-sm-10">
<input type="text" class="form-control" name="dstPrefix" id="dstPrefix" placeholder="The location in the bucket of the published albums, for example: albums/">
<div class="form-control-feedback detected-config">
<span class="glyphicon glyphicon-eye-open" aria-hidden="true"></span>
Automatically detected
</div>
</div>
</div>
</div>
</div>
<div class="panel panel-default">
<div class="panel-heading">
<div class="btn-group pull-right">
<button type="button" class="btn btn-warning" id="clearPersistedSettings">
Clear all persisted settings
</button>
</div>
<h5>
<b>Persist Settings</b>
<small>For how long do you want to save these settings in your browser?</small>
</h5>
</div>
<div class="panel-body">
<div class="radio">
<label>
<input type="radio" name="persistSettings" value="local">
Always remember these settings (until you clear your browser history and data)
</label>
</div>
<div class="radio">
<label>
<input type="radio" name="persistSettings" value="session" checked>
Forget these settings when I close my browser
</label>
</div>
<div class="radio">
<label>
<input type="radio" name="persistSettings" value="dont">
Forget these settings when I close this app
</label>
</div>
</div>
</div>
<div class="panel panel-default">
<div class="panel-heading"><b>Advanced Settings</b> <small>Where are the albums stored (and publicly visible)?</small></div>
<div class="panel-body">
<div class="form-group row">
<label class="control-label col-sm-2" for="endpoint">S3 endpoint:</label>
<div class="col-sm-10">
<input type="text" class="form-control" name="endpoint" id="endpoint" placeholder="s3.amazonaws.com">
<div class="form-control-feedback detected-config">
<span class="glyphicon glyphicon-eye-open" aria-hidden="true"></span>
Automatically detected
</div>
</div>
</div>
<div class="form-group row">
<label class="control-label col-sm-2" for="sslEnabled">SSL enabled:</label>
<div class="col-sm-10">
<input type="checkbox" name="sslEnabled" id="sslEnabled" value="" checked>
<span class="help-block detected-config">(Automatically detected)</span>
</div>
</div>
<div class="form-group row">
<label class="control-label col-sm-2" for="forcePathStyle">Force path style:</label>
<div class="col-sm-10">
<input type="checkbox" name="forcePathStyle" id="forcePathStyle" value="">
<span class="help-block detected-config">(Automatically detected)</span>
</div>
</div>
</div>
</div>
</div>
<div class="modal-footer">
<button type="submit" class="btn btn-primary">Save</button>
<button type="button" class="btn btn-default" data-dismiss="modal">Cancel</button>
</form>
</div>
</div>
</div>
</div>
<div class="modal fade" id="errorModal" tabindex="-1" role="dialog">
<div class="modal-dialog" role="document">
<div class="modal-content">
<div class="modal-header">
<button type="button" class="close" data-dismiss="modal" aria-label="Done"><span aria-hidden="true">×</span></button>
<h4 class="modal-title" id="errorModalLabel">Error</h4>
</div>
<form>
<div class="modal-body">
<div class="alert alert-danger" role="alert">
</div>
</div>
<div class="modal-footer">
<button type="button" class="btn btn-default" data-dismiss="modal">OK</button>
</form>
</div>
</div>
</div>
</div>
<script src="https://ajax.googleapis.com/ajax/libs/jquery/1.11.3/jquery.min.js"></script>
<script src="https://sdk.amazonaws.com/js/aws-sdk-2.1.12.min.js"></script>
<script src="https://cdnjs.cloudflare.com/ajax/libs/twitter-bootstrap/3.3.5/js/bootstrap.min.js"></script>
<script src="https://cdnjs.cloudflare.com/ajax/libs/bootstrap-table/1.9.1/bootstrap-table.min.js"></script>
<script src="https://cdnjs.cloudflare.com/ajax/libs/fancybox/2.1.5/jquery.fancybox.min.js"></script>
<script src="publish.js"></script>
</body>
</html>