Commit d181977c authored by Jérome Perrin's avatar Jérome Perrin

graph_editor: make it a iframe gadget

This is compatible with both ERP5JS and erp5_xhml_style
parent 807701f2
...@@ -225,7 +225,13 @@ ...@@ -225,7 +225,13 @@
</item> </item>
<item> <item>
<key> <string>js_sandbox</string> </key> <key> <string>js_sandbox</string> </key>
<value> <string></string> </value> <value> <string>iframe</string> </value>
</item>
<item>
<key> <string>renderjs_extra</string> </key>
<value>
<list/>
</value>
</item> </item>
<item> <item>
<key> <string>required</string> </key> <key> <string>required</string> </key>
...@@ -235,6 +241,14 @@ ...@@ -235,6 +241,14 @@
<key> <string>title</string> </key> <key> <string>title</string> </key>
<value> <string>Graph</string> </value> <value> <string>Graph</string> </value>
</item> </item>
<item>
<key> <string>validator_field_id</string> </key>
<value> <string></string> </value>
</item>
<item>
<key> <string>validator_form_id</string> </key>
<value> <string></string> </value>
</item>
</dictionary> </dictionary>
</value> </value>
</item> </item>
......
...@@ -5,23 +5,17 @@ ...@@ -5,23 +5,17 @@
<link rel="stylesheet" href="../lib/jquery-ui.css"> <link rel="stylesheet" href="../lib/jquery-ui.css">
<link rel="stylesheet" href="jsplumb.css"> <link rel="stylesheet" href="jsplumb.css">
<title>JSPlumb gadget</title> <title>JSPlumb gadget</title>
<!--
FIXME: renderjs fails if we include renderjs.js twice (this one has a different URL from ERP5's one) <script src="../../rsvp.js" type="text/javascript"></script>
<script src="renderjs.js" type="text/javascript"></script> <script src="../../renderjs.js" type="text/javascript"></script>
<script src="rsvp.js" type="text/javascript"></script>
--> <script src="../lib/jquery.js" type="text/javascript"></script>
<!--
FIXME: Including jQuery twice cause the jsplumb to be loaded twice.
For now we assume that it has already been loaded at this point.
<script src="../lib/jquery.js" type="text/javascript"></script>
-->
<script src="../lib/jquery-ui.js" type="text/javascript"></script> <script src="../lib/jquery-ui.js" type="text/javascript"></script>
<script src="../lib/jquery.jsplumb.js" type="text/javascript"></script> <script src="../lib/jquery.jsplumb.js" type="text/javascript"></script>
<script src="../lib/handlebars.min.js" type="text/javascript"></script> <script src="../lib/handlebars.min.js" type="text/javascript"></script>
<script src="../lib/springy.js" type="text/javascript"></script> <script src="../lib/springy.js" type="text/javascript"></script>
<script src="../dream/mixin_promise.js" type="text/javascript"></script> <script src="../dream/mixin_promise.js" type="text/javascript"></script>
<script src="jsplumb.js" type="text/javascript"></script>
<script id="node-template" type="text/x-handlebars-template"> <script id="node-template" type="text/x-handlebars-template">
<div class="window {{class}}" <div class="window {{class}}"
...@@ -47,6 +41,8 @@ ...@@ -47,6 +41,8 @@
</form> </form>
</div> </div>
</script> </script>
<script src="jsplumb.js" type="text/javascript"></script>
</head> </head>
<body> <body>
<div class="graph_container"></div> <div class="graph_container"></div>
......
...@@ -31,9 +31,9 @@ ...@@ -31,9 +31,9 @@
*/ */
var gadget_klass = rJS(window); var gadget_klass = rJS(window);
var domParser = new DOMParser(); var domParser = new DOMParser();
var node_template_source = gadget_klass.__template_element.getElementById("node-template").innerHTML; var node_template_source = document.getElementById("node-template").innerHTML;
var node_template = Handlebars.compile(node_template_source); var node_template = Handlebars.compile(node_template_source);
var popup_edit_template = gadget_klass.__template_element.getElementById("popup-edit-template").innerHTML; var popup_edit_template = document.getElementById("popup-edit-template").innerHTML;
function layoutGraph(graph_data) { function layoutGraph(graph_data) {
// Promise returning the graph once springy calculated the layout. // Promise returning the graph once springy calculated the layout.
......
...@@ -231,7 +231,13 @@ ...@@ -231,7 +231,13 @@
</item> </item>
<item> <item>
<key> <string>js_sandbox</string> </key> <key> <string>js_sandbox</string> </key>
<value> <string></string> </value> <value> <string>iframe</string> </value>
</item>
<item>
<key> <string>renderjs_extra</string> </key>
<value>
<list/>
</value>
</item> </item>
<item> <item>
<key> <string>required</string> </key> <key> <string>required</string> </key>
...@@ -241,6 +247,14 @@ ...@@ -241,6 +247,14 @@
<key> <string>title</string> </key> <key> <string>title</string> </key>
<value> <string>Graph</string> </value> <value> <string>Graph</string> </value>
</item> </item>
<item>
<key> <string>validator_field_id</string> </key>
<value> <string></string> </value>
</item>
<item>
<key> <string>validator_form_id</string> </key>
<value> <string></string> </value>
</item>
</dictionary> </dictionary>
</value> </value>
</item> </item>
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment