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