-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathtest_loadgraph.html
62 lines (54 loc) · 2.17 KB
/
test_loadgraph.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
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<html>
<head>
<title>Boxgraph Test Page</title>
<script data-dojo-config="async: 1, dojoBlankHtmlUrl: '/blank.html',
baseUrl: 'ui',
parseOnLoad : true,
packages: [ {
name: 'boxgraph',
location: '../boxgraph'
} ]"
src="https://ajax.googleapis.com/ajax/libs/dojo/1.8.1/dojo/dojo.js">
</script>
<script>
// load our custom/Hello module and wait for the DOM to be ready
require([ "boxgraph/editor", "dijit/form/Button", "dojo/domReady!", "dojo/query", "dojo/ready", "dojo/on", "dijit/registry"], function(beditor, button, domready, query, ready, on, registry)
{
ready(function()
{
var ta = dojo.byId("textarea");
dojo.subscribe("boxgraph_connect", function(p1, p2)
{
ta.innerHTML += "connect event for '"+p1.name+"' and '"+p2.name+"'\n";
});
dojo.subscribe("boxgraph_disconnect", function(p1, p2)
{
ta.innerHTML += "disconnect event for '"+p1.name+"' and '"+p2.name+"'\n";
});
var editor = new beditor({ dataurl: "boxgraph/testdata2.json"}, query("#foo")[0]);
on(registry.byId('button'), "onClick", function()
{
// DEBUG
console.log("getting serialized data..");
var foo = editor.serialize();
console.log("serialize data is..");
console.dir({serialized: foo});
});
});
});
</script>
<script type="text/javascript">
</script>
</head>
<body>
<p>
<div id="foo" style="float:left;"></div>
<textarea id="textarea" cols="40" rows="20" style="float:right"></textarea>
<div dojoType="dijit.form.Button" id="button">Serialize</div>
</p>
<p style="clear:both">
BoxGraph on GitHub: <a href="https://github.com/psvensson/boxgraph">https://github.com/psvensson/boxgraph</a>
</p>
</body>
</html>