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

update static version

parent c8fcc8b3
/*global jQuery, rJS, window, JSON, daff */
(function(window, $, rJS, JSON, daff) {
"use strict";
rJS(window).declareMethod("render", function(content) {
var flags, highlighter, diff2html, table_diff, table_diff_html, data_diff = [], data = JSON.parse(content), table1 = new daff.TableView(data[0]), table2 = new daff.TableView(data[1]), alignment = daff.compareTables(table1, table2).align();
table_diff = new daff.TableView(data_diff);
flags = new daff.CompareFlags();
highlighter = new daff.TableDiff(alignment, flags);
highlighter.hilite(table_diff);
diff2html = new daff.DiffRender();
diff2html.render(table_diff);
table_diff_html = diff2html.html();
return this.getElement().push(function(element) {
$(element).html(table_diff_html);
});
});
})(window, jQuery, rJS, JSON, daff);
\ No newline at end of file
<!doctype html>
<html>
<head>
<meta charset="utf-8">
<script src="../lib/jquery.js"></script>
<script src="../lib/rsvp.min.js"></script>
<script src="../lib/renderjs.min.js"></script>
<script src="../lib/daff.js"></script>
<script src="daff.js"></script>
</head>
<body>
<div class="table-diff"></div>
</body>
</html>
<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8">
<meta name="viewport" content="width=device-width, initial-scale=1">
<title>Compare Spreadsheet</title>
<script src="../lib/rsvp.min.js" type="text/javascript"></script>
<script src="../lib/renderjs.min.js" type="text/javascript"></script>
<script src="../lib/jquery.js" type="text/javascript"></script>
<script src="../lib/jquerymobile.js" type="text/javascript"></script>
<script src="mixin_gadget.js" type="text/javascript"></script>
<script src="mixin_promise.js" type="text/javascript"></script>
<script src="Output_viewSpreadsheetComparison.js" type="text/javascript"></script>
</head>
<body>
<div data-gadget-url="../daff/index.html"
data-gadget-scope="tablediff"></div>
<a class="set_reference_schedule_button ui-btn ui-btn-b ui-btn-inline
ui-icon-refresh ui-btn-icon-right">Set current schedule as reference</a>
</body>
</html>
/*global rJS, RSVP, initGadgetMixin, promiseEventListener, $, setTimeout */
(function(window, rJS, RSVP, initGadgetMixin, promiseEventListener, $) {
"use strict";
var gadget_klass = rJS(window);
initGadgetMixin(gadget_klass);
gadget_klass.declareAcquiredMethod("aq_getAttachment", "jio_getAttachment").declareAcquiredMethod("aq_putAttachment", "jio_putAttachment").declareMethod("render", function(options) {
var jio_key = options.id, gadget = this;
gadget.props.jio_key = jio_key;
return new RSVP.Queue().push(function() {
return RSVP.all([ gadget.aq_getAttachment({
_id: jio_key,
_attachment: "body.json"
}), gadget.getDeclaredGadget("tablediff") ]);
}).push(function(result_list) {
var reference_spreadsheet = JSON.parse(result_list[0]).input.reference_spreadsheet || [], new_spreadsheet = JSON.parse(result_list[0]).result.result_list[options.result][options.action_definition.configuration.output_id];
gadget.props.new_spreadsheet = new_spreadsheet;
return result_list[1].render(JSON.stringify([ reference_spreadsheet, new_spreadsheet ]));
});
}).declareMethod("startService", function() {
var gadget = this;
return new RSVP.Queue().push(function() {
return promiseEventListener(gadget.props.element.querySelector(".set_reference_schedule_button"), "click", false);
}).push(function() {
return gadget.aq_getAttachment({
_id: gadget.props.jio_key,
_attachment: "body.json"
});
}).push(function(data) {
var object_data = JSON.parse(data);
// XXX option for that
object_data.input.reference_spreadsheet = gadget.props.new_spreadsheet;
return gadget.aq_putAttachment({
_id: gadget.props.jio_key,
_attachment: "body.json",
_data: JSON.stringify(object_data)
}).push(function() {
// XXX quick way to get a popup message
$.mobile.loading("show", {
text: "Current schedule set as reference",
textVisible: true,
textonly: true
});
setTimeout(function() {
$.mobile.loading("hide");
}, 1e3);
});
});
});
})(window, rJS, RSVP, initGadgetMixin, promiseEventListener, $);
\ No newline at end of file
CACHE MANIFEST
# This manifest was generated by grunt-manifest HTML5 Cache Manifest Generator
# Time: Tue Jun 23 2015 11:38:13 GMT+0200 (CEST)
# Time: Fri Jul 17 2015 18:40:35 GMT+0200 (CEST)
CACHE:
daff/daff.js
dream/InputModule_viewAddDocumentDialog.js
dream/InputModule_viewInputList.js
dream/Input_viewAttachDocument.js
......@@ -20,6 +21,7 @@ dream/Output_viewExitStatistics.js
dream/Output_viewGantt.js
dream/Output_viewGraph.js
dream/Output_viewSpreadsheet.js
dream/Output_viewSpreadsheetComparison.js
dream/index.js
dream/mixin_gadget.js
dream/mixin_promise.js
......@@ -33,6 +35,7 @@ jsplumb/jsplumb.js
jsplumb/test.js
lib/URI.js
lib/codemirror-compressed.js
lib/daff.js
lib/dhtmlxgantt.js
lib/dhtmlxscheduler.js
lib/handlebars.min.js
......
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