-
Notifications
You must be signed in to change notification settings - Fork 0
/
index.html
60 lines (54 loc) · 2.62 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
<!DOCTYPE html>
<html>
<head>
<meta http-equiv="Content-type" content="text/html; charset=utf-8" />
<meta http-equiv="X-UA-Compatible" content="IE=Edge" />
<script src="http://code.jquery.com/jquery-1.6.1.js" type="text/javascript"></script>
<script src="lib/jquery.jgrowl.js" type="text/javascript"></script>
<link rel="stylesheet" href="lib/css/jquery.jgrowl.css" type="text/css" media="screen" />
<script src="lib/yepnope.js" type="text/javascript"></script>
<script src="core/tiny.js" id="core" type="text/javascript"></script>
</head>
<body id="mainContext">
<script type="text/javascript">
$(document).ready(function () {
$('#mainContext').append(
'<div class="item" data-id="_1" data-manager="windows" data-class="document" data-library="simple.HelloWorld" data-param="1">Load "HelloWorld"</div>',
'<div class="item" data-id="_2" data-manager="windows" data-class="document" data-library="simple.GoodBay" data-param="2">Load "GoodBay (not saved)"</div>'
);
if (window.App) {
window.onerror = function (errorMsg, url, lineNumber) {
$.jGrowl('Error in file ' + url + ' at line ' + lineNumber + "\n" + 'message: ' + errorMsg, 'error', { sticky: true });
};
var core = new window.App({
id: 'core',
target: 'mainContext'
});
core.poll.bind('message', function (msg) {
switch (msg.header) {
case "afterRun":
core.target.find(".item").click(function () {
core.poll.trigger({ type: "request", header: "instance", body: $(this).data() });
});
core.poll.trigger({ type: "request", header: "instance", body: { manager: "single", id: "menu", library: "simple.Menu"} });
core.poll.bind('message', function (msg) {
$.jGrowl(msg.header, { life: 10000 });
});
$(document).ajaxStart(function (ajax) {
$.jGrowl(ajax.type, { life: 10000 });
}).ajaxStop(function (ajax) {
$.jGrowl(ajax.type, { life: 10000 });
}).ajaxError(function (ajax) {
$.jGrowl(ajax.type, { sticky: true });
});
break;
}
});
core.run().fail(function () {
alert('System error');
});
}
});
</script>
</body>
</html>