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