w.i.p. Terminal Themes added, improved terminal color picker, new compression in front-end

This commit is contained in:
2017-07-31 00:39:46 +02:00
parent 76167b8014
commit d711909812
19 changed files with 1372 additions and 777 deletions
+22 -6
View File
@@ -2,6 +2,7 @@
// Workaround for badly loaded page
setTimeout(function() {
if (typeof termInit == 'undefined' || typeof $ == 'undefined') {
console.error("Page load failed, refreshing…");
location.reload(true);
}
}, 2000);
@@ -10,7 +11,7 @@
<h1>%term_title%</h1>
<div id="termwrap">
<div id="screen"></div>
<div id="screen" class="theme-%theme%"></div>
<div id="buttons">
<button data-n="1" class="btn-blue">%btn1%</button><!--
@@ -21,17 +22,32 @@
</div>
</div>
<input id="softkb-input" autocomplete="off" autocorrect="off" autocapitalize="off" spellcheck="false">
<nav id="botnav">
<a href="<?= url('cfg_wifi') ?>"><?= tr('menu.settings') ?></a><!--
--><a href="<?= url('help') ?>">Help</a><!--
--><a href="<?= url('about') ?>">About</a>
<a href="#" onclick="toggleSoftKb(true); return false" class="icn-keyboard mq-tablet-max"></a><!--
--><a href="<?= url('cfg_wifi') ?>"><?= tr('menu.settings') ?></a><!--
--><a href="<?= url('help') ?>">Help</a><!--
--><a href="<?= url('about') ?>">About</a>
</nav>
<script>
// TODO cleanup
try {
termInit(%screenData%);
termInit("%screenData%");
// auto-clear the input box
$('#softkb-input').on('input', function(e) {
setTimeout(function(){$('#softkb-input').val('');}, 1);
});
} catch(e) {
console.error("Fail, reloading...");
console.error(e);
console.error("Fail, reloading…");
location.reload(true);
}
function toggleSoftKb(yes) {
qs('#softkb-input')[yes ? 'focus' : 'blur']();
qs('.icn-keyboard').blur();
}
</script>