From 8fa2bb31afba3ecabe051419a6e4c13807c9195c Mon Sep 17 00:00:00 2001 From: de Miranda Henrique Date: Thu, 1 Mar 2018 14:36:53 -0600 Subject: [PATCH] handling undefined inputs, correcting autoshut down UI and spelling --- octoprint_enclosure/static/js/enclosure.js | 16 +++++++++------- .../templates/enclosure_settings.jinja2 | 6 +++--- .../templates/enclosure_tab.jinja2 | 2 +- 3 files changed, 13 insertions(+), 11 deletions(-) diff --git a/octoprint_enclosure/static/js/enclosure.js b/octoprint_enclosure/static/js/enclosure.js index 5022a66..98217f2 100644 --- a/octoprint_enclosure/static/js/enclosure.js +++ b/octoprint_enclosure/static/js/enclosure.js @@ -58,13 +58,15 @@ $(function () { self.isRegularOutput = function(index_id){ return_value = false; - self.settingsViewModel.settings.plugins.enclosure.rpi_outputs().forEach(function (output) { - if (output.index_id() == index_id && output.output_type() == "regular") { - return_value = true; - return false; - } - }); - return return_value; + if (typeof index_id != 'undefined'){ + self.settingsViewModel.settings.plugins.enclosure.rpi_outputs().forEach(function (output) { + if (output.index_id() == index_id && output.output_type() == "regular") { + return_value = true; + return false; + } + }); + } + return return_value; }; self.linkedTemperatureControl = function(sensor_index){ diff --git a/octoprint_enclosure/templates/enclosure_settings.jinja2 b/octoprint_enclosure/templates/enclosure_settings.jinja2 index 233c29c..732a9a2 100644 --- a/octoprint_enclosure/templates/enclosure_settings.jinja2 +++ b/octoprint_enclosure/templates/enclosure_settings.jinja2 @@ -96,7 +96,7 @@ {{ _('Link PWM to Temperature') }} Link PWM ouput to temperature. PWM output will be interpolated between the point from duty A, temperature A -> duty B, temperature B. - This output will automatomatically start when a print starts and will default to the default dutu cycle when print is complete. + This output will automatomatically start when a print starts and will default to the default duty cycle when print is complete. @@ -159,7 +159,7 @@ - +
@@ -604,7 +604,7 @@ When the event happen, you want control which OUTPUT?
- +
diff --git a/octoprint_enclosure/templates/enclosure_tab.jinja2 b/octoprint_enclosure/templates/enclosure_tab.jinja2 index d7a6294..ddabc9a 100644 --- a/octoprint_enclosure/templates/enclosure_tab.jinja2 +++ b/octoprint_enclosure/templates/enclosure_tab.jinja2 @@ -189,7 +189,7 @@ - +