added script to auto-deploy demo; fixes for Edge

pull/111/merge
Ondřej Hruška 7 years ago
parent 85f707401d
commit ea3c815a39
  1. 14
      demo_deploy.sh
  2. 10
      html_orig/js/app.js
  3. 4
      html_orig/jssrc/appcommon.js
  4. 2
      html_orig/jssrc/term_input.js
  5. 4
      html_orig/jssrc/term_screen.js

@ -0,0 +1,14 @@
#!/bin/bash
./build_demo.sh
cp -r html_demo/* ../espterm.github.io/
cd ../espterm.github.io/
echo "Enter to deploy (^C to abort):"
read
git add --all
git commit -m "Deploy updates"
git push

@ -1275,7 +1275,7 @@ $.ready(function () {
$(h).on('click', hdl).on('keypress', cr(hdl)); $(h).on('click', hdl).on('keypress', cr(hdl));
}); });
qsa('form').forEach(function(x) { $('form').forEach(function(x) {
$(x).on('keypress', function(e) { $(x).on('keypress', function(e) {
if ((e.keyCode == 10 || e.keyCode == 13) && e.ctrlKey) { if ((e.keyCode == 10 || e.keyCode == 13) && e.ctrlKey) {
x.submit(); x.submit();
@ -1346,7 +1346,7 @@ $.ready(function () {
// remove tabindixes from h2 if wide // remove tabindixes from h2 if wide
if (window.innerWidth > 550) { if (window.innerWidth > 550) {
qsa('.Box h2').forEach(function (x) { $('.Box h2').forEach(function (x) {
x.removeAttribute('tabindex'); x.removeAttribute('tabindex');
}); });
@ -1910,7 +1910,7 @@ var Input = (function() {
_initKeys(); _initKeys();
// Button presses // Button presses
qsa('#action-buttons button').forEach(function(s) { $('#action-buttons button').forEach(function(s) {
s.addEventListener('click', function() { s.addEventListener('click', function() {
sendBtnMsg(+this.dataset['n']); sendBtnMsg(+this.dataset['n']);
}); });
@ -2319,12 +2319,12 @@ var Screen = (function () {
function _load_labels(str) { function _load_labels(str) {
var pieces = str.split('\x01'); var pieces = str.split('\x01');
qs('h1').textContent = pieces[0]; qs('h1').textContent = pieces[0];
qsa('#action-buttons button').forEach(function(x, i) { $('#action-buttons button').forEach(function(x, i) {
var s = pieces[i+1].trim(); var s = pieces[i+1].trim();
// if empty string, use the "dim" effect and put nbsp instead to stretch the btn vertically // if empty string, use the "dim" effect and put nbsp instead to stretch the btn vertically
x.innerHTML = s.length > 0 ? e(s) : " "; x.innerHTML = s.length > 0 ? e(s) : " ";
x.style.opacity = s.length > 0 ? 1 : 0.2; x.style.opacity = s.length > 0 ? 1 : 0.2;
}); })
} }
/** Audible beep for ASCII 7 */ /** Audible beep for ASCII 7 */

@ -25,7 +25,7 @@ $.ready(function () {
$(h).on('click', hdl).on('keypress', cr(hdl)); $(h).on('click', hdl).on('keypress', cr(hdl));
}); });
qsa('form').forEach(function(x) { $('form').forEach(function(x) {
$(x).on('keypress', function(e) { $(x).on('keypress', function(e) {
if ((e.keyCode == 10 || e.keyCode == 13) && e.ctrlKey) { if ((e.keyCode == 10 || e.keyCode == 13) && e.ctrlKey) {
x.submit(); x.submit();
@ -96,7 +96,7 @@ $.ready(function () {
// remove tabindixes from h2 if wide // remove tabindixes from h2 if wide
if (window.innerWidth > 550) { if (window.innerWidth > 550) {
qsa('.Box h2').forEach(function (x) { $('.Box h2').forEach(function (x) {
x.removeAttribute('tabindex'); x.removeAttribute('tabindex');
}); });

@ -169,7 +169,7 @@ var Input = (function() {
_initKeys(); _initKeys();
// Button presses // Button presses
qsa('#action-buttons button').forEach(function(s) { $('#action-buttons button').forEach(function(s) {
s.addEventListener('click', function() { s.addEventListener('click', function() {
sendBtnMsg(+this.dataset['n']); sendBtnMsg(+this.dataset['n']);
}); });

@ -316,12 +316,12 @@ var Screen = (function () {
function _load_labels(str) { function _load_labels(str) {
var pieces = str.split('\x01'); var pieces = str.split('\x01');
qs('h1').textContent = pieces[0]; qs('h1').textContent = pieces[0];
qsa('#action-buttons button').forEach(function(x, i) { $('#action-buttons button').forEach(function(x, i) {
var s = pieces[i+1].trim(); var s = pieces[i+1].trim();
// if empty string, use the "dim" effect and put nbsp instead to stretch the btn vertically // if empty string, use the "dim" effect and put nbsp instead to stretch the btn vertically
x.innerHTML = s.length > 0 ? e(s) : " "; x.innerHTML = s.length > 0 ? e(s) : " ";
x.style.opacity = s.length > 0 ? 1 : 0.2; x.style.opacity = s.length > 0 ? 1 : 0.2;
}); })
} }
/** Audible beep for ASCII 7 */ /** Audible beep for ASCII 7 */

Loading…
Cancel
Save