Add IDs and classes to terminal panels and buttons

Some plugins (like https://github.com/costas-basdekis/MarlinGcodeDocumentation and 
https://github.com/MoonshineSG/OctoPrint-Autoscroll) add or alter panels and buttons
under the terminal.

This allows to name the elements that terminal exposes so that we can target them
accurately, as otherwise there are unintended consequences, eg see
https://github.com/costas-basdekis/MarlinGcodeDocumentation/issues/11
This commit is contained in:
Costas Basdekis authored and GitHub committed 2021-01-17 10:16:33 +00:00
1 parent e23d3b88f9
commit 4ce6f7f13b
1 file changed
+6 -6
+6 -6
View File
@@ -7,16 +7,16 @@
<a class="btn add-on" id="terminal-send" data-bind="click: sendCommand, enable: isOperational() && loginState.isUser()">{{ _('Send') }}</a>
</div>
</div>
<small class="pull-left" data-bind="visible: fancyFunctionality()">
<button class="btn btn-mini" data-bind="click: toggleAutoscroll, css: {active: autoscrollEnabled}">{{ _('Autoscroll') }}</button>
<small id="terminal-autoscroll-panel" class="pull-left" data-bind="visible: fancyFunctionality()">
<button class="btn btn-mini terminal-autoscroll" data-bind="click: toggleAutoscroll, css: {active: autoscrollEnabled}">{{ _('Autoscroll') }}</button>
<span data-bind="text: lineCount, visible: enableFancyFunctionality"></span>
<span data-bind="visible: !autoscrollEnabled() && enableFancyFunctionality()" style="display: none">(<a href="javascript:void(0)" data-bind="click: scrollToEnd">{{ _("Scroll to end") }}</a>)</span>
</small>
<small class="pull-right">
<a href="javascript:void(0)" data-bind="click: copyAll"><i class="fas fa-copy" title="{{ _('Copy all')|edq }}"></i> {{ _('Copy all') }}</a><br>
<a href="javascript:void(0)" data-bind="click: clearAllLogs"><i class="far fa-trash-alt" title="{{ _('Clear log window')|edq }}"></i> {{ _('Clear all') }}</a>
<small id="terminal-actions-panel" class="pull-right">
<a href="javascript:void(0)" data-bind="click: copyAll"><i class="fas fa-copy terminal-copy-all" title="{{ _('Copy all')|edq }}"></i> {{ _('Copy all') }}</a><br>
<a href="javascript:void(0)" data-bind="click: clearAllLogs"><i class="far fa-trash-alt terminal-clear-logs" title="{{ _('Clear log window')|edq }}"></i> {{ _('Clear all') }}</a>
</small>
<small class="pull-left text-warning" data-bind="visible: !fancyFunctionality()" style="display: none">
<small id="terminal-limited-functionality-panel" class="pull-left text-warning" data-bind="visible: !fancyFunctionality()" style="display: none">
{{ _('For performance reasons only a limited amount of terminal functionality is enabled right now.') }}
</small>
</div>