diff --git a/octoprint_navbartemp/static/js/navbartemp.js b/octoprint_navbartemp/static/js/navbartemp.js index 5ef7b48..0eb8712 100644 --- a/octoprint_navbartemp/static/js/navbartemp.js +++ b/octoprint_navbartemp/static/js/navbartemp.js @@ -7,6 +7,17 @@ $(function() { self.raspiTemp = ko.observable(); self.isRaspi = ko.observable(false); + self.formatBarTemperature = function(toolName, actual, target) { + var output = toolName + ": " + _.sprintf("%.1f°C", actual); + + if (target) { + var sign = (target >= actual) ? " \u21D7 " : " \u21D8 "; + output += sign + _.sprintf("%.1f°C", target); + } + + return output; + }; + self.onBeforeBinding = function () { self.settings = self.global_settings.settings.plugins.navbartemp; }; @@ -33,14 +44,3 @@ $(function() { ["#navbar_plugin_navbartemp", "#settings_plugin_navbartemp"] ]); }); - -function formatBarTemperature(toolName, actual, target) { - var output = toolName + ": " + _.sprintf("%.1f°C", actual); - - if (target) { - var sign = (target >= actual) ? " \u21D7 " : " \u21D8 "; - output += sign + _.sprintf("%.1f°C", target); - } - - return output; -}; diff --git a/octoprint_navbartemp/templates/navbartemp_navbar.jinja2 b/octoprint_navbartemp/templates/navbartemp_navbar.jinja2 index 2cb25d9..c67673b 100644 --- a/octoprint_navbartemp/templates/navbartemp_navbar.jinja2 +++ b/octoprint_navbartemp/templates/navbartemp_navbar.jinja2 @@ -7,5 +7,5 @@ diff --git a/setup.py b/setup.py index d943ce3..0e40237 100644 --- a/setup.py +++ b/setup.py @@ -6,7 +6,7 @@ plugin_identifier = "navbartemp" plugin_package = "octoprint_%s" % plugin_identifier plugin_name = "OctoPrint-NavbarTemp" -plugin_version = "0.8" +plugin_version = "0.9" plugin_description = "Displays temperatures on navbar" plugin_author = "Jarek Szczepanski" plugin_author_email = "imrahil@imrahil.com"