From 59db14a21fef7e0dc8c09270190513e4155321c3 Mon Sep 17 00:00:00 2001 From: MoonshineSG Date: Fri, 22 Jan 2016 14:59:29 +0800 Subject: [PATCH] added function "Clear" --- octoprint_autoscroll/static/js/autoscroll.js | 9 +++++++++ setup.py | 2 +- 2 files changed, 10 insertions(+), 1 deletion(-) diff --git a/octoprint_autoscroll/static/js/autoscroll.js b/octoprint_autoscroll/static/js/autoscroll.js index 2bc46e0..cb45b29 100644 --- a/octoprint_autoscroll/static/js/autoscroll.js +++ b/octoprint_autoscroll/static/js/autoscroll.js @@ -24,6 +24,15 @@ $(function() { self.container = $("#terminal-output"); + //change function of "Scrool to end" to "Clear" + var ee = $(".terminal .pull-right a").first(); + ee.unbind(); + ee.text("Clear"); + ee.on("click", function() { + self.terminal.log([]); + self.terminal.scrollToEnd(); + return false; + }); $("#terminal-output").on("scroll", self.scrollhandle); } diff --git a/setup.py b/setup.py index 4f8730c..c85e837 100644 --- a/setup.py +++ b/setup.py @@ -14,7 +14,7 @@ plugin_name = "OctoPrint-Autoscroll" # The plugin's version. Can be overwritten within OctoPrint's internal data via __plugin_version__ in the plugin module -plugin_version = "0.0.1" +plugin_version = "0.0.2" # The plugin's description. Can be overwritten within OctoPrint's internal data via __plugin_description__ in the plugin # module