-
Notifications
You must be signed in to change notification settings - Fork 12
/
index.html
84 lines (71 loc) · 3.04 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
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
<title>Jchemhub Demo</title>
<!--
<script src="build/jchemhub-whitespace-only.js"></script>
<script src="build/jchemhub-simple.js"></script>
-->
<script src="build/jchemhub-advanced.js"></script>
<script src="jchemhub/io/json_test_rxn.js"></script>
<link rel="stylesheet"
href="third-party/closure/closure/goog/demos/css/demo.css">
<link rel="stylesheet"
href="third-party/closure/closure/goog/css/button.css" />
<link rel="stylesheet"
href="third-party/closure/closure/goog/css/dialog.css" />
<link rel="stylesheet"
href="third-party/closure/closure/goog/css/linkbutton.css" />
<link rel="stylesheet"
href="third-party/closure/closure/goog/css/menus.css" />
<link rel="stylesheet"
href="third-party/closure/closure/goog/css/tab.css" />
<link rel="stylesheet"
href="third-party/closure/closure/goog/css/tabbar.css" />
<link rel="stylesheet"
href="third-party/closure/closure/goog/css/toolbar.css" />
<link rel="stylesheet"
href="third-party/closure/closure/goog/css/colormenubutton.css" />
<link rel="stylesheet"
href="third-party/closure/closure/goog/css/palette.css" />
<link rel="stylesheet"
href="third-party/closure/closure/goog/css/colorpalette.css" />
<link rel="stylesheet"
href="third-party/closure/closure/goog/css/editortoolbar.css" />
<script>
function initPage(){
var buttons = [];
buttons.push(jchemhub.controller.ToolbarFactory.makeButton(
jchemhub.controller.plugins.ClearEditor.COMMAND, 'Clear Editor', 'Clear'));
buttons.push(jchemhub.controller.ToolbarFactory.makeButton(jchemhub.controller.plugins.Zoom.COMMAND.ZOOM_IN, 'zoom in', '+'));
buttons.push(jchemhub.controller.ToolbarFactory.makeButton(jchemhub.controller.plugins.Zoom.COMMAND.ZOOM_OUT, 'zoom out', '-'));
buttons.push(jchemhub.controller.ToolbarFactory.makeButton(jchemhub.controller.plugins.UndoRedo.COMMAND.UNDO, 'undo', 'undo'));
buttons.push(jchemhub.controller.ToolbarFactory.makeButton(jchemhub.controller.plugins.UndoRedo.COMMAND.REDO, 'redo', 'redo'));
var toolbar = jchemhub.controller.DefaultToolbar.makeToolbar(buttons, goog.dom.getElement('reactionEditorToolbar'));
var model = jchemhub.io.json.readReaction(reactionDrawing);
var editor = new jchemhub.controller.ReactionEditor(goog.dom.getElement('reactionEditorContainer'));
editor.registerPlugin(new jchemhub.controller.plugins.ClearEditor());
editor.registerPlugin(new jchemhub.controller.plugins.Zoom());
editor.registerPlugin(new jchemhub.controller.plugins.UndoRedo());
editor.registerPlugin(new jchemhub.controller.plugins.Highlight());
var toolbarController = new jchemhub.controller.ToolbarController(editor, toolbar);
editor.setModel(model);
};
</script>
</head>
<body onload="initPage();">
<table style="width: 100%">
<tr>
<td>
<div id="reactionEditorToolbar"></div>
</td>
</tr>
<tr>
<td>
<div id="reactionEditorContainer" style="height: 400px"></div>
</td>
</tr>
</table>
</body>
</html>