-
Notifications
You must be signed in to change notification settings - Fork 0
/
index.php
62 lines (56 loc) · 1.9 KB
/
index.php
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
<!doctype html>
<html>
<head>
<title>Photos to Share? Drop them here!</title>
<script src="/jquery-1.7.1.min.js"></script>
<script src="/site.js"></script>
<link href="/site.css" rel='stylesheet' type='text/css' />
</head>
<body>
<!-- Show the front page view by default until the user has started uploading -->
<div id="frontpage-view">
<h1>Photos to share?</h1>
<div id="droptarget">Drop them here!</div>
<div id="nodroptarget">Upload them here: <input type="file" id="files" name="files[]" multiple /></div>
<div id="progressDiv">
Uploading <span id="doneFiles">0</span> of <span id="totalFiles">0</span> images...
<br />
<progress id="progressBytes" value="0" max="100"></progress>
</div>
<div id="explain">
We'll upload them to our server and give you a beautiful online album. <strong>Easy peasy</strong>!
</div>
</div>
<!-- The album view -->
<div id="album-view">
<div id="leftnav">
<div id="picscroll">
<ul id="piclist"></ul>
</div>
</div>
<div id="maindisplay"></div>
</div>
<script>
<?
// enable the HTML5 URLs to actually load the proper album / picture / etc
// Technically, we could just do this in JS and CDN this static HTML,
// but it seems...cruel to ask the browser to go fetch this back from us?
if($_GET['album']){
require_once("api/lib.inc");
$album = $_GET['album'];
if(!preg_match("/^[a-z0-9]+$/",$album)){ nok("Invalid Album Chars"); }
if(!file_exists("album/$album")){ nok("Album Does Not Exist"); }
print("album = \"".$album."\";\n");
if($_GET['curImage']){
$curImage = $_GET['curImage'];
if(!preg_match("/^[a-zA-Z_ 0-9\.\-]+$/",$curImage)){ nok("Invalid curImage Chars"); }
if(!file_exists("album/$album/$curImage")){ nok("Image Does Not Exist"); }
print("curImage = \"".$curImage."\";\n");
}
// TODO: preload albumObj instead of making client ask for it?
print("albumViewInit();\n");
}
?>
</script>
</body>
</html>