Commit 5dde2b7a authored by Kazuhiko Shiozaki's avatar Kazuhiko Shiozaki

cleanup HTML and javascript.

parent 8c64377d
......@@ -69,11 +69,11 @@
</div>
</div>
<div class="twelve columns">
<div id="wip">
<h4>WIP</h4>
<div class="sixteen columns">
<div id="spreadsheet">
<h4>Spreadsheet</h4>
<div class="jQuerySheet"></div>
</div>
</div>
</div>
<!-- DEP -->
......@@ -93,8 +93,8 @@
<script type="text/javascript" src="lib/jquery.jsoneditor.js"></script>
<!-- jqs -->
<script type="text/javascript" src="lib/jquery.sheet-2.0.0/parser.js""></script>
<script type="text/javascript" src="lib/jquery.sheet-2.0.0/jquery.sheet.min.js""></script>
<script type="text/javascript" src="lib/jquery.sheet-2.0.0/parser.js"></script>
<script type="text/javascript" src="lib/jquery.sheet-2.0.0/jquery.sheet.min.js"></script>
<div id="dialog-form" title="Configure">
<form>
......
......@@ -135,11 +135,11 @@
$(this).dialog("close");
},
Validate: function () {
var new_id = $("#id").val();
if (new_id !== element_id && $('#' + new_id).length > 0) {
alert('This ID is already used.');
return;
};
var new_id = $("#id").val();
if (new_id !== element_id && $('#' + new_id).length > 0) {
alert('This ID is already used.');
return;
}
var data = {}, prefixed_property_id, property_element;
var updateDataPropertyList = function (property_list, data,
prefix) {
......
......@@ -294,7 +294,7 @@
});
dream_instance.setGeneralProperties(data.general);
dream_instance.initGeneralProperties(); // XXX
dream_instance.redraw()
dream_instance.redraw();
$("#json_output").val(JSON.stringify(dream_instance.getData(),
undefined, " "));
};
......@@ -304,7 +304,7 @@
_id: "dream_demo"
}, function (err, response) {
if (response !== undefined && response.data !== undefined) {
loadData(response.data);
loadData(response.data);
}
// once the data is read, we can subscribe to every changes
$.subscribe("Dream.Gui.onDataChange", function (event, data) {
......@@ -487,14 +487,14 @@
if (response !== undefined && response.data !== undefined) {
var config = $.extend({
buildSheet: $.sheet.makeTable.json(JSON.parse(response.data))
})
});
sheet.sheet(config);
}
})
});
sheet.bind('sheetCellEdited', function() {
// TODO
})
});
});
})(jQuery);
......@@ -285,19 +285,19 @@
}
var new_id = data['id'];
if (new_id && new_id !== element_id) {
priv.node_container[new_id] = priv.node_container[element_id];
priv.node_container[new_id]['id'] = new_id;
delete(priv.node_container[element_id]);
$.each(priv.edge_container, function (k, v) {
if (v[0] === element_id) {
v[0] = new_id;
}
if (v[1] === element_id) {
v[1] = new_id;
}
});
priv.preference_container['coordinates'][new_id] = priv.preference_container['coordinates'][element_id];
delete(priv.preference_container['coordinates'][element_id]);
priv.node_container[new_id] = priv.node_container[element_id];
priv.node_container[new_id]['id'] = new_id;
delete(priv.node_container[element_id]);
$.each(priv.edge_container, function (k, v) {
if (v[0] === element_id) {
v[0] = new_id;
}
if (v[1] === element_id) {
v[1] = new_id;
}
});
priv.preference_container['coordinates'][new_id] = priv.preference_container['coordinates'][element_id];
delete(priv.preference_container['coordinates'][element_id]);
}
priv.onDataChange();
};
......
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