-
Notifications
You must be signed in to change notification settings - Fork 4
/
demo-compiled.html
75 lines (62 loc) · 1.77 KB
/
demo-compiled.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
<!DOCTYPE html>
<html>
<head>
<title>BetaCreator</title>
<link href="css/betacreator.css" rel="stylesheet" type="text/css" />
<script type="text/javascript" src="js/bin/betacreator.js"></script>
<script type="text/javascript">
var betaCreator = null;
function init() {
var outp = document.getElementById('outp');
BetaCreator(document.getElementById('srcImg'), function() {
betaCreator = this;
},{
zoom: 'contain',
height: 300,
width: 20,
onChange: function() {
outp.value = "Last changed at: " + new Date();
}
});
}
function saveData() {
if (!betaCreator)
return;
if (window.localStorage)
localStorage.bcData = betaCreator.getData();
else
alert(betaCreator.getData());
}
function loadData() {
if (!betaCreator)
return;
if (window.localStorage && localStorage.bcData)
betaCreator.loadData(localStorage.bcData);
else
alert("No data stored locally. You must save first.");
}
function getImage() {
if (!betaCreator)
return;
var imageSize = document.getElementById('imageSize').value,
outpImg = document.getElementById('outpImg'),
includeSrc = document.getElementById('includeSrc').checked;
outpImg.style.display = 'block';
outpImg.src = betaCreator.getImage(includeSrc, 'png', parseInt(imageSize, 10) || 0);
}
</script>
</head>
<body onLoad="init()">
<img id="srcImg" src="http://www.valleyoutdoors.com/Hikes/images/halfdome.jpg" />
<br />
<button onClick="saveData()">Save</button>
<button onClick="loadData()">Load</button>
<button onClick="getImage()">Get Image</button>
<input id="imageSize" value="600" />
<label><input id="includeSrc" type="checkbox" />Include source image</label>
<br />
<textarea id="outp" cols="60"></textarea>
<br />
<img id="outpImg" style="display: none; max-width: 100%; border: black dotted 1px;" />
</body>
</html>