Skip to content

Commit

Permalink
improve home page
Browse files Browse the repository at this point in the history
  • Loading branch information
tve committed Nov 16, 2015
1 parent ce05e00 commit c3e1a8a
Show file tree
Hide file tree
Showing 2 changed files with 16 additions and 6 deletions.
9 changes: 9 additions & 0 deletions html/console.js
Expand Up @@ -22,12 +22,21 @@ function updateText(resp) {
var delay = 3000;
if (resp != null && resp.len > 0) {
console.log("updateText got", resp.len, "chars at", resp.start);
var isScrolledToBottom = el.scrollHeight - el.clientHeight <= el.scrollTop + 1;
//console.log("isScrolledToBottom="+isScrolledToBottom, "scrollHeight="+el.scrollHeight,
// "clientHeight="+el.clientHeight, "scrollTop="+el.scrollTop,
// "" + (el.scrollHeight - el.clientHeight) + "<=" + (el.scrollTop + 1));

// append the text
if (resp.start > el.textEnd) {
el.innerHTML = el.innerHTML.concat("\r\n<missing lines\r\n");
}
el.innerHTML = el.innerHTML.concat(resp.text);
el.textEnd = resp.start + resp.len;
delay = 500;

// scroll to bottom
if(isScrolledToBottom) el.scrollTop = el.scrollHeight - el.clientHeight;
}
return delay;
}
Expand Down
13 changes: 7 additions & 6 deletions html/home.html
Expand Up @@ -17,7 +17,7 @@ <h1>System overview</h1>
<div class="click-to-edit system-name">
<span class="edit-off"></span>
<input class="edit-on" maxlength=31 hidden></input>
<div class="popup">Hostname displayed in menu bar
<div class="popup">Click to edit!<br>Hostname displayed in menu bar
and used by DHCP and mDNS</div>
</div>
</td></tr>
Expand All @@ -36,11 +36,12 @@ <h1>Info</h1>
program microcontrollers over the serial port, in particular Arduinos, AVRs, and
NXP's LPC800 and other ARM processors. Typical avrdude command line to
program an Arduino:</p>
<div class="tt">/home/arduino/hardware/tools/avrdude&nbsp;\<br>
<div class="tt" style="font-size:100%;">
/home/arduino/hardware/tools/avrdude&nbsp;\<br>
&nbsp;&nbsp;-DV -patmega328p \<br>
&nbsp;&nbsp;-Pnet:esp-link.local:23 \<br>
&nbsp;&nbsp;-carduino -b115200 -U \<br>
&nbsp;&nbsp;-C /home/arduino/hardware/tools/avrdude.conf&nbsp;\<br>
&nbsp;&nbsp;-carduino -b115200 -U -C \<br>
&nbsp;&nbsp;/home/arduino/hardware/tools/avrdude.conf&nbsp;\<br>
&nbsp;&nbsp;flash:w:my_sketch.hex:i
</div>
<p>where <tt>-Pnet:esp-link.local:23</tt> tells avrdude to connect to port 23 of esp-link.
Expand Down Expand Up @@ -125,8 +126,8 @@ <h1>System details</h1>
<tr><td colspan=2 class="popup-target">Description:<br>
<div class="click-to-edit system-description">
<div class="edit-off"></div>
<textarea class="edit-on" rows=3 maxlength=127 hidden></textarea>
<div class="popup">A short description or memo for this esp-link
<textarea class="edit-on" rows=3 maxlength=127 hidden> </textarea>
<div class="popup">Click to edit!<br>A short description or memo for this esp-link
module, 128 chars max</div>
</div>
</td></tr>
Expand Down

0 comments on commit c3e1a8a

Please sign in to comment.