Paste button

pull/111/merge
Ondřej Hruška 7 years ago
parent 3f198f8360
commit a78830f805
  1. 6
      html_orig/base.php
  2. 2
      html_orig/lang/en.php
  3. 2
      html_orig/pages/help.php
  4. 6
      html_orig/pages/term.php

@ -52,6 +52,12 @@ function e($s)
return htmlspecialchars($s, ENT_HTML5 | ENT_QUOTES); return htmlspecialchars($s, ENT_HTML5 | ENT_QUOTES);
} }
function je($s)
{
return htmlspecialchars(json_encode($s), ENT_HTML5);
}
function tr($key) function tr($key)
{ {
global $_messages; global $_messages;

@ -20,6 +20,8 @@ return [
'term_nav.wifi' => 'WiFi', 'term_nav.wifi' => 'WiFi',
'term_nav.help' => 'Help', 'term_nav.help' => 'Help',
'term_nav.about' => 'About', 'term_nav.about' => 'About',
'term_nav.paste' => 'Paste',
'term_nav.paste_prompt' => 'Paste text to send:',
'net.ap' => 'DHCP Server (AP)', 'net.ap' => 'DHCP Server (AP)',
'net.sta' => 'DHCP Client (Station)', 'net.sta' => 'DHCP Client (Station)',

@ -1,5 +1,5 @@
<div class="Box"> <div class="Box">
<a href="#" onclick="hpfold(1)">Expand all</a>&nbsp;|&nbsp;<a href="#" onclick="hpfold(0)">Collapse all</a> <a href="#" onclick="hpfold(1);return false">Expand all</a>&nbsp;|&nbsp;<a href="#" onclick="hpfold(0);return false">Collapse all</a>
</div> </div>
<?php require __DIR__ . "/help/troubleshooting.php"; ?> <?php require __DIR__ . "/help/troubleshooting.php"; ?>

@ -26,6 +26,7 @@
<nav id="term-nav"> <nav id="term-nav">
<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><!--
--><a href="#" onclick="termPaste();return false"><?= tr('term_nav.paste') ?></a><!--
--><a href="<?= url('cfg_term') ?>" class="x-term-conf-btn"><?= tr('term_nav.config') ?></a><!-- --><a href="<?= url('cfg_term') ?>" class="x-term-conf-btn"><?= tr('term_nav.config') ?></a><!--
--><a href="<?= url('cfg_wifi') ?>" class="x-term-conf-btn"><?= tr('term_nav.wifi') ?></a><!-- --><a href="<?= url('cfg_wifi') ?>" class="x-term-conf-btn"><?= tr('term_nav.wifi') ?></a><!--
--><a href="<?= url('help') ?>" class="x-term-conf-btn"><?= tr('term_nav.help') ?></a><!-- --><a href="<?= url('help') ?>" class="x-term-conf-btn"><?= tr('term_nav.help') ?></a><!--
@ -59,4 +60,9 @@
if (yes) i.focus(); if (yes) i.focus();
else i.blur(); else i.blur();
} }
function termPaste() {
var t = prompt(<?= je(tr('term_nav.paste_prompt')) ?>);
if (t !== null && t.length) Input.sendString(t);
}
</script> </script>

Loading…
Cancel
Save