/
demo1.html
98 lines (78 loc) · 3.15 KB
/
demo1.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
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="utf-8">
<title>PaintWeb</title>
<link rel="author" type="text/html" href="http://www.robodesign.ro"
title="Marius and Mihai Şucan, ROBO Design">
<style type="text/css"><!--
#PaintWebTarget { position: relative }
--></style>
<!-- $URL: http://code.google.com/p/paintweb $
$Date: 2009-07-01 19:23:47 +0300 $ -->
</head>
<body>
<p>Welcome to PaintWeb!</p>
<p>This is a demo page.</p>
<p><a title="Freshalicious"
href="http://www.robodesign.ro/marius/my-projects/images/freshalicious"><img
id="editableImage" src="freshalicious.jpg" alt="Freshalicious"></a></p>
<p><button id="buttonEditImage">Edit image!</button></p>
<div id="PaintWebTarget"></div>
<p>Do you have any feedback to provide? Please <a
href="http://moodle.org/mod/forum/discuss.php?d=126528">post it over at
Moodle</a>!</p>
<!--[if IE]>
<p>Please note that this application does not work in Internet Explorer
- any other modern browser should work fine. Try <a
href="http://www.google.com/chrome">Chrome</a>, <a
href="http://www.mozilla.com">Firefox</a>, <a
href="http://www.apple.com/safari">Safari</a>, <a
href="http://www.opera.com">Opera</a> or <a
href="http://www.konqueror.org">Konqueror</a>)</p>
<![endif]-->
<script type="text/javascript" src="../src/includes/debug.js"></script>
<script type="text/javascript" src="../build/paintweb.js"></script>
<script type="text/javascript"><!--
(function () {
// Function called when the user clicks the "Edit image" button.
function pwStart () {
document.body.insertBefore(loadp, btn.parentNode);
timeStart = (new Date()).getTime();
pw.init(pwInit);
};
// Function called when the PaintWeb application fires the "initApp" event.
function pwInit (ev) {
var initTime = (new Date()).getTime() - timeStart;
document.body.removeChild(loadp);
if (ev.state === PaintWeb.INIT_ERROR) {
alert('Demo: PaintWeb initialization failed.');
return;
} else if (ev.state === PaintWeb.INIT_DONE && window.console && console.log) {
console.log('Demo: Yay, PaintWeb loaded in ' + initTime + ' ms! ' +
pw.toString());
} else {
alert('Demo: Unrecognized PaintWeb initialization state ' + ev.state);
return;
}
img.style.display = 'none';
btn.style.display = 'none';
};
var img = document.getElementById('editableImage'),
btn = document.getElementById('buttonEditImage'),
target = document.getElementById('PaintWebTarget'),
loadp = document.createElement('p'),
timeStart = null,
// Create a PaintWeb instance.
pw = new PaintWeb();
pw.config.guiPlaceholder = target;
pw.config.imagePreload = img;
pw.config.baseFolder = '../build/';
pw.config.configFile = 'config-example.json';
loadp.appendChild(document.createTextNode('Loading, please wait...'));
btn.addEventListener('click', pwStart, false);
})();
--></script>
</body>
<!-- vim:set spell spl=en fo=tcroqwanl1 tw=80 ts=2 sw=2 sts=2 sta et ai cin fenc=utf-8 ff=unix: -->
</html>