the onscreen android keyboard now works

pull/111/merge
Ondřej Hruška 7 years ago
parent f8c60b0668
commit 319427ba2e
  1. 94
      html_orig/_debug_replacements.php
  2. 31
      html_orig/index.php
  3. 3
      html_orig/js/app.js
  4. 3
      html_orig/jssrc/term.js
  5. 8
      html_orig/pages/term.php

@ -3,19 +3,19 @@
/** /**
* Those replacements are done by the development server to test it locally * Those replacements are done by the development server to test it locally
* without esphttpd. This is needed mainly for places where the replacements * without esphttpd. This is needed mainly for places where the replacements
* are given to JavaScript, to avoid syntax errors with %% * are given to JavaScript, to avoid syntax errors with
*/ */
return [ return [
'%term_title%' => 'ESPTerm local debug', 'term_title' => 'ESPTerm local debug',
'%btn1%' => '1', 'btn1' => '1',
'%btn2%' => '2', 'btn2' => '2',
'%btn3%' => '3', 'btn3' => '3',
'%btn4%' => '', 'btn4' => '',
'%btn5%' => '5', 'btn5' => '5',
'%labels_seq%' => 'TESPTerm local debug1235', 'labels_seq' => 'TESPTerm local debug1235',
'%screenData%' => '  HELLOx NRE3',//'\u000b\u0001\u001b\u0001\u0001\u0001\u0001\u0001\f\u0005\u0001\u0010\u0003HELLOx\u0002\u000b\u0001\u0001N\u0001RE\u00023\u0001', //, 'screenData' => '  HELLOx NRE3',//'\u000b\u0001\u001b\u0001\u0001\u0001\u0001\u0001\f\u0005\u0001\u0010\u0003HELLOx\u0002\u000b\u0001\u0001N\u0001RE\u00023\u0001', //,
/*'{ /*'{
"w": 26, "h": 10, "w": 26, "h": 10,
"x": 10, "y": 5, "x": 10, "y": 5,
@ -23,50 +23,52 @@ return [
"screen": "" "screen": ""
}',//"70 t259"*/ }',//"70 t259"*/
'%opmode%' => '2', 'parser_tout_ms' => 10,
'%sta_enable%' => '0',
'%ap_enable%' => '1',
'%tpw%' => '60', 'opmode' => '2',
'%ap_channel%' => '7', 'sta_enable' => '0',
'%ap_ssid%' => 'ESP-123456', 'ap_enable' => '1',
'%ap_password%' => 'Passw0rd!',
'%ap_hidden%' => '0',
'%sta_ssid%' => 'Chlivek', 'tpw' => '60',
'%sta_password%' => 'windows XP is The Best', 'ap_channel' => '7',
'%sta_active_ip%' => '1.2.3.4', 'ap_ssid' => 'ESP-123456',
'%sta_active_ssid%' => 'Chlivek', 'ap_password' => 'Passw0rd!',
'ap_hidden' => '0',
'%vers_fw%' => '1.2.3', 'sta_ssid' => 'Chlivek',
'%date%' => date('Y-m-d'), 'sta_password' => 'windows XP is The Best',
'%time%' => date('G:i'), 'sta_active_ip' => '1.2.3.4',
'%vers_httpd%' => '4.5.6', 'sta_active_ssid' => 'Chlivek',
'%vers_sdk%' => '1.52',
'%githubrepo%' => 'https://github.com/MightyPork/esp-vt100-firmware',
'%ap_dhcp_time%' => '120', 'vers_fw' => '1.2.3',
'%ap_dhcp_start%' => '192.168.4.100', 'date' => date('Y-m-d'),
'%ap_dhcp_end%' => '192.168.4.200', 'time' => date('G:i'),
'%ap_addr_ip%' => '192.168.4.1', 'vers_httpd' => '4.5.6',
'%ap_addr_mask%' => '255.255.255.0', 'vers_sdk' => '1.52',
'githubrepo' => 'https://github.com/MightyPork/esp-vt100-firmware',
'%sta_dhcp_enable%' => '1', 'ap_dhcp_time' => '120',
'%sta_addr_ip%' => '192.168.0.33', 'ap_dhcp_start' => '192.168.4.100',
'%sta_addr_mask%' => '255.255.255.0', 'ap_dhcp_end' => '192.168.4.200',
'%sta_addr_gw%' => '192.168.0.1', 'ap_addr_ip' => '192.168.4.1',
'ap_addr_mask' => '255.255.255.0',
'%sta_mac%' => 'ab:cd:ef:01:23:45', 'sta_dhcp_enable' => '1',
'%ap_mac%' => '01:23:45:ab:cd:ef', 'sta_addr_ip' => '192.168.0.33',
'sta_addr_mask' => '255.255.255.0',
'sta_addr_gw' => '192.168.0.1',
'%term_width%' => '26', 'sta_mac' => 'ab:cd:ef:01:23:45',
'%term_height%' => '10', 'ap_mac' => '01:23:45:ab:cd:ef',
'%default_bg%' => '0',
'%default_fg%' => '7',
'%uart_baud%' => 115200, 'term_width' => '26',
'%uart_stopbits%' => 1, 'term_height' => '10',
'%uart_parity%' => 2, 'default_bg' => '0',
'default_fg' => '7',
'%theme%' => 5, 'uart_baud' => 115200,
'uart_stopbits' => 1,
'uart_parity' => 2,
'theme' => 5,
]; ];

@ -7,12 +7,39 @@ if (!isset($_GET['page'])) $_GET['page'] = 'term';
$_GET['PAGE_TITLE'] = $_pages[$_GET['page']]->title . ' :: ' . APP_NAME; $_GET['PAGE_TITLE'] = $_pages[$_GET['page']]->title . ' :: ' . APP_NAME;
$_GET['BODYCLASS'] = $_pages[$_GET['page']]->bodyclass; $_GET['BODYCLASS'] = $_pages[$_GET['page']]->bodyclass;
if (!function_exists('tplSubs')) {
function tplSubs($str, $reps)
{
return preg_replace_callback('/%(j:|js:|h:|html:)?([a-z0-9-_.]+)%/i', function ($m) use ($reps) {
$key = $m[2];
if (array_key_exists($key, $reps)) {
$val = $reps[$key];
} else {
$val = '';
}
switch ($m[1]) {
case 'j:':
case 'js:':
$v = json_encode($val);
return substr($v, 1, strlen($v) - 2);
case 'h:':
case 'html:':
return htmlspecialchars($val);
default:
return $val;
}
}, $str);
}
}
require __DIR__ . '/pages/_head.php'; require __DIR__ . '/pages/_head.php';
$_pf = __DIR__ . '/pages/'.$_GET['page'].'.php'; $_pf = __DIR__ . '/pages/'.$_GET['page'].'.php';
if (file_exists($_pf)) { if (file_exists($_pf)) {
$f = file_get_contents($_pf); $f = file_get_contents($_pf);
$reps = DEBUG ? require(__DIR__ . '/_debug_replacements.php') : [];
$str = str_replace(array_keys($reps), array_values($reps), $f); if (DEBUG)
$str = tplSubs($f, require(__DIR__ . '/_debug_replacements.php'));
else $str = $f;
// special symbols // special symbols
$str = str_replace('\,', ' ', $str); $str = str_replace('\,', ' ', $str);

@ -1549,7 +1549,8 @@ var Input = (function() {
return { return {
init: init, init: init,
onTap: sendPosMsg onTap: sendPosMsg,
sendString: sendStrMsg,
}; };
})(); })();

@ -357,7 +357,8 @@ var Input = (function() {
return { return {
init: init, init: init,
onTap: sendPosMsg onTap: sendPosMsg,
sendString: sendStrMsg,
}; };
})(); })();

@ -22,7 +22,7 @@
</div> </div>
</div> </div>
<textarea id="softkb-input" autocomplete="off" autocorrect="off" autocapitalize="off" spellcheck="false"></textarea> <input id="softkb-input" autocomplete="off" autocorrect="off" autocapitalize="off" spellcheck="false">
<nav id="botnav"> <nav id="botnav">
<a href="#" onclick="toggleSoftKb(true); return false" class="icn-keyboard mq-tablet-max"></a><!-- <a href="#" onclick="toggleSoftKb(true); return false" class="icn-keyboard mq-tablet-max"></a><!--
@ -39,7 +39,11 @@
// auto-clear the input box // auto-clear the input box
$('#softkb-input').on('input', function(e) { $('#softkb-input').on('input', function(e) {
setTimeout(function(){$('#softkb-input').val('');}, 1); setTimeout(function(){
var str = $('#softkb-input').val();
$('#softkb-input').val('');
Input.sendString(str);
}, 1);
}); });
} catch(e) { } catch(e) {
console.error(e); console.error(e);

Loading…
Cancel
Save