Commit 614256b8 authored by Thibaut Frain's avatar Thibaut Frain Committed by Jérome Perrin

Refactored jsPlumb gadget (works with one instance of jsPlumb per gadget)

parent c7ccdf82
......@@ -66,7 +66,9 @@ module.exports = function (grunt) {
},
files: {
"<%= global_config.dest %>/dream/index.css":
"<%= global_config.src %>/dream/index.less"
"<%= global_config.src %>/dream/index.less",
"<%= global_config.dest %>/jsplumb/jsplumb.css":
"<%= global_config.src %>/jsplumb/jsplumb.css"
}
}
},
......
/*global window, rJS, RSVP, initDocumentPageMixin */
/*jslint nomen: true */
/*global console, rJS, RSVP, initDocumentPageMixin */
(function (window, rJS, RSVP, initDocumentPageMixin) {
"use strict";
var gadget_klass = rJS(window);
initDocumentPageMixin(gadget_klass);
gadget_klass
.ready(function (g) {
g.props = {};
})
.ready(function (g) {
return g.getElement()
.push(function (element) {
g.props.element = element;
});
})
.declareAcquiredMethod("aq_getAttachment", "jio_getAttachment")
.declareMethod("render", function (options) {
var jio_key = options.id, gadget = this;
gadget.props.jio_key = jio_key;
return new RSVP.Queue()
.push(function () {
/*jslint nomen: true*/
return RSVP.all([
gadget.aq_getAttachment({
_id: jio_key,
_attachment: "body.json"
}),
gadget.getDeclaredGadget("productionline")
]);
}).push(function (result_list) {
}), gadget.getDeclaredGadget("productionline") ]);
})
.push(function (result_list) {
console.log(result_list);
console.log(result_list[0]);
console.log(result_list[1]);
console.log(result_list.length);
window.r = result_list[1];
return result_list[1].render(result_list[0]);
});
})
.declareMethod("startService", function () {
return this.getDeclaredGadget("productionline")
.push(function (productionline) {
......
......@@ -2,13 +2,14 @@
<html>
<head>
<meta charset="utf-8">
<!--link rel="stylesheet" href="<%= curl.jqueryuicss.relative_dest %>"-->
<!--script src="curl.jquery.relative_dest %>"></script-->
<!--script src="curl.jqueryuijs.relative_dest %>"></script-->
<script src="../<%= copy.rsvp.relative_dest %>" type="text/javascript"></script>
<script src="../<%= copy.renderjs.relative_dest %>" type="text/javascript"></script>
<script src="../<%= curl.jsplumbjs.relative_dest %>" type="text/javascript"></script>
<link rel="stylesheet" href="../<%= curl.jqueryuicss.relative_dest %>">
<link rel="stylesheet" href="jsplumb.css">
<script src="../<%= curl.jquery.relative_dest %>"></script>
<script src="../<%= curl.jqueryuijs.relative_dest %>"></script>
<script src="../<%= copy.rsvp.relative_dest %>"></script>
<script src="../<%= copy.renderjs.relative_dest %>"></script>
<script src="../<%= curl.jsplumbjs.relative_dest %>"></script>
<script src="jsplumb.js"></script>
</head>
......
This diff is collapsed.
This diff is collapsed.
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