Commit 0bd2b7f2 authored by Jérome Perrin's avatar Jérome Perrin

GUI: update static version

parent 6f4e8f40
...@@ -70,14 +70,12 @@ ...@@ -70,14 +70,12 @@
_attachment: "body.json", _attachment: "body.json",
_data: JSON.stringify(data, null, 2), _data: JSON.stringify(data, null, 2),
_mimetype: "application/json" _mimetype: "application/json"
}).fail(function(reason) {
alert("Could not save simulation results.Please check the simulation parameters or try to delete some models.\n\nError was:" + reason);
return gadget.whoWantsToDisplayThisDocument(gadget.props.jio_key, "view");
}); });
}).push(function() { }).push(function() {
return gadget.whoWantsToDisplayThisDocument(gadget.props.jio_key, "view_result"); return gadget.whoWantsToDisplayThisDocument(gadget.props.jio_key, "view_result");
}, function(reason) {
// Very likely, we exceeded the quota of the local storage.
// Let's handle it with a more informative message.
alert("Could not save simulation results.Please check the simulation parameters or try to delete some models.\n\nError was:" + reason);
return gadget.whoWantsToDisplayThisDocument(gadget.props.jio_key, "view");
}).push(function(url) { }).push(function(url) {
return gadget.pleaseRedirectMyHash(url); return gadget.pleaseRedirectMyHash(url);
}); });
......
...@@ -12,7 +12,11 @@ ...@@ -12,7 +12,11 @@
// Prompt user to reload after manifest update. // Prompt user to reload after manifest update.
// from http://www.html5rocks.com/en/tutorials/appcache/beginner/#toc-updating-cache // from http://www.html5rocks.com/en/tutorials/appcache/beginner/#toc-updating-cache
window.addEventListener("load", function() { window.addEventListener("load", function() {
var updating = false;
if (window.applicationCache) { if (window.applicationCache) {
window.applicationCache.addEventListener("downloading", function() {
updating = true;
}, false);
window.applicationCache.addEventListener("updateready", function() { window.applicationCache.addEventListener("updateready", function() {
if (window.applicationCache.status === window.applicationCache.UPDATEREADY) { if (window.applicationCache.status === window.applicationCache.UPDATEREADY) {
// Browser downloaded a new app cache. // Browser downloaded a new app cache.
...@@ -24,8 +28,10 @@ ...@@ -24,8 +28,10 @@
} }
}, false); }, false);
window.applicationCache.addEventListener("error", function() { window.applicationCache.addEventListener("error", function() {
alert("Fatal error while updating, retrying"); if (updating) {
window.location.reload(); alert("Fatal error while updating, retrying");
window.location.reload();
}
}, false); }, false);
} }
}, false); }, false);
......
...@@ -9,7 +9,7 @@ ...@@ -9,7 +9,7 @@
// Precompile the templates while loading the first gadget instance // Precompile the templates while loading the first gadget instance
var gadget_klass = rJS(window), label_source = gadget_klass.__template_element.getElementById("expand-label-template").innerHTML, label_template = Handlebars.compile(label_source), option_source = gadget_klass.__template_element.getElementById("expand-option-template").innerHTML, option_template = Handlebars.compile(option_source), selected_option_source = gadget_klass.__template_element.getElementById("selected-expand-option-template").innerHTML, selected_option_template = Handlebars.compile(selected_option_source); var gadget_klass = rJS(window), label_source = gadget_klass.__template_element.getElementById("expand-label-template").innerHTML, label_template = Handlebars.compile(label_source), option_source = gadget_klass.__template_element.getElementById("expand-option-template").innerHTML, option_template = Handlebars.compile(option_source), selected_option_source = gadget_klass.__template_element.getElementById("selected-expand-option-template").innerHTML, selected_option_template = Handlebars.compile(selected_option_source);
function syncField(gadget) { function syncField(gadget) {
var i, properties_dict, sub_title, sub_type, in_type, default_value, previous_value, labels = [], lbls, inps = [], inputs, j, index, corresponding_input, sub_gadget_list = [], old_title, recent_occupied = [], recent_occupied_labels = [], prop_name = gadget.props.definition.property_def.title; var i, properties_dict, sub_title_name, sub_title, sub_type, in_type, default_value, previous_value, labels = [], lbls, inps = [], inputs, j, index, corresponding_input, sub_gadget_list = [], old_title, recent_occupied = [], recent_occupied_labels = [], prop_name = gadget.props.definition.property_def.title;
console.log("for prop_name syncField"); console.log("for prop_name syncField");
console.log(prop_name); console.log(prop_name);
// set the title of the field // set the title of the field
...@@ -32,7 +32,7 @@ ...@@ -32,7 +32,7 @@
} }
} }
// un-hide the title of the field // un-hide the title of the field
gadget.props.element.children[1].style.display = ""; // gadget.props.element.children[1].style.display = '';
// if the gadget has properties defined (is an object with properties) // if the gadget has properties defined (is an object with properties)
if (gadget.props.definition.property_def.properties) { if (gadget.props.definition.property_def.properties) {
properties_dict = gadget.props.definition.property_def.properties; properties_dict = gadget.props.definition.property_def.properties;
...@@ -94,6 +94,7 @@ ...@@ -94,6 +94,7 @@
previous_value = gadget.props.options.value[prop_name][sub_title]; previous_value = gadget.props.options.value[prop_name][sub_title];
} }
} }
sub_title_name = properties_dict[sub_title].name || sub_title;
for (j = 0; j <= inps.length - 1; j += 1) { for (j = 0; j <= inps.length - 1; j += 1) {
// check if the input is one of a sub-gadget // check if the input is one of a sub-gadget
// do not proceed if yes // do not proceed if yes
...@@ -116,7 +117,7 @@ ...@@ -116,7 +117,7 @@
inps[j].setAttribute("value", previous_value === undefined ? default_value : previous_value); inps[j].setAttribute("value", previous_value === undefined ? default_value : previous_value);
recent_occupied.push(inps[j]); recent_occupied.push(inps[j]);
// find the label for that input // find the label for that input
inps[j].parentNode.parentNode.previousSibling.previousSibling.innerHTML = sub_title; inps[j].parentNode.parentNode.previousSibling.previousSibling.innerHTML = sub_title_name;
inps[j].parentNode.parentNode.previousSibling.previousSibling.setAttribute("for", sub_title); inps[j].parentNode.parentNode.previousSibling.previousSibling.setAttribute("for", sub_title);
recent_occupied_labels.push(inps[j].parentNode.parentNode.previousSibling.previousSibling); recent_occupied_labels.push(inps[j].parentNode.parentNode.previousSibling.previousSibling);
// present them // present them
......
...@@ -71,6 +71,8 @@ ...@@ -71,6 +71,8 @@
if (gadget.props.key) { if (gadget.props.key) {
// style only recursive fieldsets // style only recursive fieldsets
gadget.props.fieldset_element.style["border-width"] = "1px"; gadget.props.fieldset_element.style["border-width"] = "1px";
gadget.props.fieldset_element.style["border-radius"] = "5px";
gadget.props.fieldset_element.style["padding"] = "1px";
} }
if (node_id) { if (node_id) {
addField("id", options.property_definition.properties.id || { addField("id", options.property_definition.properties.id || {
......
CACHE MANIFEST CACHE MANIFEST
# This manifest was generated by grunt-manifest HTML5 Cache Manifest Generator # This manifest was generated by grunt-manifest HTML5 Cache Manifest Generator
# Time: Fri Sep 04 2015 11:12:34 GMT+0200 (CEST) # Time: Tue Sep 08 2015 15:21:59 GMT+0200 (CEST)
CACHE: CACHE:
daff/index.html
dream/InputModule_viewAddDocumentDialog.html
dream/InputModule_viewInputList.html
dream/Input_viewAttachDocument.html
dream/Input_viewDebugJson.html
dream/Input_viewDocumentManagement.html
dream/Input_viewProductionLine.html
dream/Input_viewResultComparison.html
dream/Input_viewResultList.html
dream/Input_viewSimulation.html
dream/Input_viewSpreadsheet.html
dream/Output_viewBottleneckGraph.html
dream/Output_viewCalendar.html
dream/Output_viewDownloadFile.html
dream/Output_viewExitStatistics.html
dream/Output_viewGantt.html
dream/Output_viewGraph.html
dream/Output_viewSpreadsheet.html
dream/Output_viewSpreadsheetComparison.html
dream/index.html
expandable_field/index.html
fieldset/index.html
handsontable/index.html
handsontable/test.html
integer_field/index.html
jio_bridge/index.html
jsplumb/index.html
jsplumb/test.html
list_field/index.html
number_field/index.html
string_field/index.html
toolbox/index.html
lib/images/ajax-loader.gif
lib/images/animated-overlay.gif
lib/images/ui-bg_flat_0_aaaaaa_40x100.png
lib/images/ui-bg_flat_75_ffffff_40x100.png
lib/images/ui-bg_glass_55_fbf9ee_1x400.png
lib/images/ui-bg_glass_65_ffffff_1x400.png
lib/images/ui-bg_glass_75_dadada_1x400.png
lib/images/ui-bg_glass_75_e6e6e6_1x400.png
lib/images/ui-bg_glass_95_fef1ec_1x400.png
lib/images/ui-bg_highlight-soft_75_cccccc_1x100.png
lib/images/ui-icons_222222_256x240.png
lib/images/ui-icons_2e83ff_256x240.png
lib/images/ui-icons_454545_256x240.png
lib/images/ui-icons_888888_256x240.png
lib/images/ui-icons_cd0a0a_256x240.png
daff/daff.js daff/daff.js
dream/InputModule_viewAddDocumentDialog.js dream/InputModule_viewAddDocumentDialog.js
dream/InputModule_viewInputList.js dream/InputModule_viewInputList.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