Commit 5b6f57d3 authored by Jérome Perrin's avatar Jérome Perrin

rename divs to make them more configurable

parent 51b303fb
......@@ -42,7 +42,8 @@
<div class="twelve columns">
<div id="main"></div>
<div id="spreadsheet_input"></div>
<div id="wip_spreadsheet"></div>
<div id="shift_spreadsheet"></div>
</div>
</div>
......@@ -64,12 +65,12 @@
<div id="result_zone">
<div>Result List</div>
<ul id="result_list"></ul></div>
<div id="graph_zone">
<div id="graph_zone"> <!-- station_utilisation_graph -->
<div>Stations Utilization</div>
<div id="graph"></div>
</div>
<div id="spreadsheet_output"></div>
<div id="gantt_output"></div>
<div id="job_schedule_spreadsheet"></div>
<div id="job_gantt"></div>
<div id="debug">
<div class="six columns alpha">
......
......@@ -270,8 +270,9 @@
var result = JSON.parse($("#json_result").val())[idx]['result'];
$("#result_zone").show();
$("#graph_zone").show();
$("#spreadsheet_output").show();
$("#gantt_output").show();
// if
$("#job_schedule_spreadsheet").show();
$("#job_gantt").show();
// temporary hack
var now = new Date();
......@@ -445,7 +446,7 @@
$.plot("#graph", series, options);
if (spreadsheet_data.length > 1) {
var spreadsheet = $('#spreadsheet_output');
var spreadsheet = $('#job_schedule_spreadsheet');
spreadsheet.show();
spreadsheet.handsontable({
data: spreadsheet_data,
......@@ -460,7 +461,7 @@
} catch (e) {}
var gantt_output_height = 35 * (gantt_data.data.length + 1) + 1;
$('#gantt_output').height(gantt_output_height).show().dhx_gantt({
$('#job_gantt').height(gantt_output_height).show().dhx_gantt({
data: gantt_data,
scale_unit: 'day',
readonly: true,
......
......@@ -67,14 +67,15 @@
var loadData = function (data) {
dream_instance.clearAll();
$('#graph_zone').hide();
$('#spreadsheet_output').hide();
$("#gantt_output").hide();
$('#job_schedule_spreadsheet').hide();
$('#shift_spreadsheet').hide();
$("#job_gantt").hide();
try {
// spreadsheet
// spreadsheets
var spreadsheet_data = data.spreadsheet;
if (spreadsheet_data !== undefined) {
var spreadsheet = $('#spreadsheet_input');
var spreadsheet = $('#wip_spreadsheet');
spreadsheet.handsontable('populateFromArray', 0, 0, spreadsheet_data);
spreadsheet.find('.htCore').width(spreadsheet.width());
}
......@@ -159,8 +160,9 @@
} else {
$("#result_zone").hide();
$("#graph_zone").hide();
$("#spreadsheet_output").hide();
$("#gantt_output").hide();
$("#shift_spreadsheet").hide();
$("#job_schedule_spreadsheet").hide();
$("#job_gantt").hide();
$("#json_result").effect('shake', 50).val(data['error']);
}
});
......@@ -237,8 +239,9 @@
});
$("#result_zone").hide();
$("#graph_zone").hide();
$("#spreadsheet_output").hide();
$("#gantt_output").hide();
$("#job_schedule_spreadsheet").hide();
$("#shift_spreadsheet").hide();
$("#job_gantt").hide();
}
});
});
......
......@@ -112,7 +112,7 @@
};
priv.initSpreadSheet = function () {
var spreadsheet = $('#spreadsheet_input');
var wip_spreadsheet = $('#wip_spreadsheet');
var data = [
[
"Jobs",
......@@ -125,14 +125,32 @@
"Processing Times"
]
];
spreadsheet.handsontable({
wip_spreadsheet.handsontable({
data: data,
minSpareRows: 1,
afterChange: function () {
priv.onDataChange();
}
});
spreadsheet.find('.htCore').width(spreadsheet.width());
wip_spreadsheet.find('.htCore').width(wip_spreadsheet.width());
if (0) {
var shift_spreadsheet = $('#shift_spreadsheet');
var data = [
[
"Monday",
"Tuesday",
"...",
]
];
shift_spreadsheet.handsontable({
data: data,
minSpareRows: 1,
afterChange: function () {
priv.onDataChange();
}
});
shift_spreadsheet.find('.htCore').width(shift_spreadsheet.width());
}
};
priv.updateElementCoordinate = function (node_id, coordinate) {
......@@ -298,8 +316,9 @@
"preference": priv.preference_container,
"general": priv.general_container
};
var spreadsheet = $('#spreadsheet_input');
var spreadsheet = $('#wip_spreadsheet');
if (spreadsheet !== undefined) {
// XXX wip_spreadsheet ?
data['spreadsheet'] = spreadsheet.handsontable('getData');
}
return data;
......@@ -418,7 +437,6 @@
box.css("left", absolute_position[0]);
priv.updateNodeStyle(element.element_id);
// Initial DEMO code : make all the window divs draggable
priv.draggable();
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