Commit 5bf9c7d0 authored by Thibaut Frain's avatar Thibaut Frain Committed by Jérome Perrin

publish static version

parent 1a96434f
......@@ -22,8 +22,13 @@
</script>
<template id="popup-edit-template">
<div id="node-edit-popup">
<form>
<div id="node-edit-popup" data-position-to="origin">
<div data-role="header" data-theme="a">
<h1>Node edition</h1>
<a href="#" data-rel="back" class="ui-btn ui-corner-all ui-shadow ui-btn-a ui-icon-delete ui-btn-icon-notext ui-btn-right">Close</a>
</div>
<br/>
<form class="ui-content">
<fieldset></fieldset>
<input type="button" value="Delete">
<input type="submit" value="Validate">
......
......@@ -17,7 +17,7 @@
* along with DREAM. If not, see <http://www.gnu.org/licenses/>.
* ==========================================================================*/
/*global RSVP, rJS, $, jsPlumb, Handlebars, initGadgetMixin,
loopEventListener, promiseEventListener, DOMParser, confirm*/
loopEventListener, promiseEventListener, DOMParser, confirm */
/*jslint unparam: true */
(function(RSVP, rJS, $, jsPlumb, Handlebars, initGadgetMixin, loopEventListener, promiseEventListener, DOMParser) {
"use strict";
......@@ -214,6 +214,11 @@
name: element.name,
element_id: element.element_id
};
Object.keys(element).forEach(function(k) {
if (k !== "_class" && k !== "name" && k !== "element_id") {
element_data[k] = element[k];
}
});
node_container[element.id] = element_data;
}
// function redraw(gadget) {
......@@ -390,7 +395,7 @@
property_list.unshift({
_class: "Dream.Property",
id: "name",
name: "name",
name: "Name",
type: "string"
});
property_list.unshift({
......@@ -425,7 +430,7 @@
});
}
function waitForNodeClick(gadget, node, config_dict) {
gadget.props.nodes_click_monitor.monitor(loopEventListener(node, "click", false, openNodeDialog.bind(null, gadget, node, config_dict)));
gadget.props.nodes_click_monitor.monitor(loopEventListener(node, "dblclick", false, openNodeDialog.bind(null, gadget, node, config_dict)));
}
function newElement(gadget, element, configuration) {
var element_type = element._class.replace(".", "-"), option = configuration[element_type], render_element = $(gadget.props.element).find("#main"), coordinate = element.coordinate, box, absolute_position, domElement;
......@@ -492,12 +497,12 @@
}
initGadgetMixin(gadget_klass);
gadget_klass.declareAcquiredMethod("getConfigurationDict", "getConfigurationDict").ready(function(g) {
g.props.node_container = {};
g.props.edge_container = {};
g.props.preference_container = {};
g.props.style_attr_list = [ "width", "height", "padding-top", "line-height" ];
}).declareMethod("render", function(data) {
this.props.data = JSON.parse(data);
this.props.node_container = this.props.data.nodes;
this.props.jsplumb_instance = jsPlumb.getInstance();
}).declareMethod("getData", function() {
return JSON.stringify({
......
......@@ -6,7 +6,7 @@
// Handlebars
/////////////////////////////////////////////////////////////////
// Precompile the templates while loading the first gadget instance
var gadget_klass = rJS(window), option_source = gadget_klass.__template_element.getElementById("option-template").innerHTML, option_template = Handlebars.compile(option_source), selected_option_source = gadget_klass.__template_element.getElementById("option-template").innerHTML, selected_option_template = Handlebars.compile(selected_option_source);
var gadget_klass = rJS(window), option_source = gadget_klass.__template_element.getElementById("option-template").innerHTML, option_template = Handlebars.compile(option_source), selected_option_source = gadget_klass.__template_element.getElementById("selected-option-template").innerHTML, selected_option_template = Handlebars.compile(selected_option_source);
gadget_klass.ready(function(g) {
return g.getElement().push(function(element) {
g.element = element;
......@@ -15,7 +15,7 @@
var select = this.element.getElementsByTagName("select")[0], i, template, field_json = options.field_json, tmp = "";
select.setAttribute("name", field_json.key);
for (i = 0; i < field_json.items.length; i += 1) {
if (field_json.items[i][1] === field_json.default[0]) {
if (field_json.items[i][1] === field_json.value) {
template = selected_option_template;
} else {
template = option_template;
......
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