diff --git a/octoprint_touchui/static/js/touchui.bootstrap.js b/octoprint_touchui/static/js/touchui.bootstrap.js index a52481ac..7ff82d4f 100644 --- a/octoprint_touchui/static/js/touchui.bootstrap.js +++ b/octoprint_touchui/static/js/touchui.bootstrap.js @@ -1 +1 @@ -!function(){var E=new TouchUI;E.domLoading(),$(function(){E.domReady(),OCTOPRINT_VIEWMODELS.push([E.koStartup,E.TOUCHUI_REQUIRED_VIEWMODELS,E.TOUCHUI_ELEMENTS,E.TOUCHUI_REQUIRED_VIEWMODELS])})}(); \ No newline at end of file +!function(){if(window.log&&window.log.error){var o=window.log.error;window.log.error=function(n,w){window.top.postMessage([w,""],"*"),o.apply(window.log,arguments)}}var n=new TouchUI;n.domLoading(),$(function(){n.domReady(),OCTOPRINT_VIEWMODELS.push([n.koStartup,n.TOUCHUI_REQUIRED_VIEWMODELS,n.TOUCHUI_ELEMENTS,n.TOUCHUI_REQUIRED_VIEWMODELS])})}(); \ No newline at end of file diff --git a/octoprint_touchui/static/js/touchui.bundled.js b/octoprint_touchui/static/js/touchui.bundled.js index 2c984ebc..947bd7ef 100644 --- a/octoprint_touchui/static/js/touchui.bundled.js +++ b/octoprint_touchui/static/js/touchui.bundled.js @@ -651,10 +651,6 @@ TouchUI.prototype.core.init = function() { // Send Touchscreen loading status if (window.top.postMessage) { window.top.postMessage("loading", "*"); - - $(window).on("error.touchui", function(event) { - window.top.postMessage([event.originalEvent.message, event.originalEvent.filename], "*"); - }); } // Attach id for TouchUI styling @@ -2151,7 +2147,6 @@ TouchUI.prototype.DOM.move.sidebar = { init: function() { var tabbar = this.DOM.create.tabbar; - $(this.DOM.move.sidebar.items + ':not(' + this.DOM.move.sidebar.doNotMove + ')').each(function(ind, elm) { var id = $(elm).attr('id'); diff --git a/octoprint_touchui/templates/touchui_load_css.jinja2 b/octoprint_touchui/templates/touchui_load_css.jinja2 index a568d243..c71f5681 100644 --- a/octoprint_touchui/templates/touchui_load_css.jinja2 +++ b/octoprint_touchui/templates/touchui_load_css.jinja2 @@ -1 +1 @@ - + \ No newline at end of file diff --git a/source/js/bootstrap.js b/source/js/bootstrap.js index 69e90d74..b9e544a3 100644 --- a/source/js/bootstrap.js +++ b/source/js/bootstrap.js @@ -1,5 +1,14 @@ !function() { + // Catch errors + if (window.log && window.log.error) { + var old = window.log.error; + window.log.error = function(plugin, msg) { + window.top.postMessage([msg, ''], "*"); + old.apply(window.log, arguments); + } + } + var Touch = new TouchUI(); Touch.domLoading(); diff --git a/source/js/core/_init.js b/source/js/core/_init.js index 89b4b4f8..06729dd2 100644 --- a/source/js/core/_init.js +++ b/source/js/core/_init.js @@ -9,10 +9,6 @@ TouchUI.prototype.core.init = function() { // Send Touchscreen loading status if (window.top.postMessage) { window.top.postMessage("loading", "*"); - - $(window).on("error.touchui", function(event) { - window.top.postMessage([event.originalEvent.message, event.originalEvent.filename], "*"); - }); } // Attach id for TouchUI styling diff --git a/source/js/dom/move/sidebar.js b/source/js/dom/move/sidebar.js index 0a793d8f..3e8084f5 100644 --- a/source/js/dom/move/sidebar.js +++ b/source/js/dom/move/sidebar.js @@ -17,7 +17,6 @@ TouchUI.prototype.DOM.move.sidebar = { init: function() { var tabbar = this.DOM.create.tabbar; - $(this.DOM.move.sidebar.items + ':not(' + this.DOM.move.sidebar.doNotMove + ')').each(function(ind, elm) { var id = $(elm).attr('id');