Join GitHub today
GitHub is home to over 40 million developers working together to host and review code, manage projects, and build software together.Sign up
Dev/gcode layer button #1306
Thank you for your interest into contributing to OctoPrint, it's
Please make sure you have read the "guidelines for contributing" as
As a summary, please make sure you have ticked all points on this
Feel free to delete all this help text, then describe
What does this PR do and why is it necessary?
This pull request adds Layer Up/Down buttons to the Gcode viewer. It also fixes a bug by disabling key-bindings for layer up/down, which was requested in the same issue #1149
How was it tested? How can it be tested by the reviewer?
It was tested by connecting to 3-D printer and trying out all the possible cases like: 1) when g-code is not uploaded 2) when g-code is uploaded 3) when g-code is loaded and deleted
Any background context you want to provide?
The changes were automatically applied to the TouchUI plugin.
What are the relevant tickets if any?
Screenshots (if appropriate)
@foosel we fixed all the things you mentioned above. We replaced jquery, with ko click and enable functions. Also, when we renamed self.incrementLayer with self.changeLayer, it was throwing an error because a function named self.changeLayer was already defined. So, we renamed it to self.shiftLayer instead. The jinja template is also changed to enable the ko. functions. The text on the layer button is now replaced with the specific jinja formating to allow it to be transalted.