| 
						
						
							
								
							
						
						
					 | 
					 | 
					@ -12,25 +12,25 @@ window.TermUpl = function (conn, input) { | 
				
			
			
		
	
		
		
			
				
					
					 | 
					 | 
					 | 
					  // sending a super-ling string through the socket is not a good idea
 | 
					 | 
					 | 
					 | 
					  // sending a super-ling string through the socket is not a good idea
 | 
				
			
			
		
	
		
		
			
				
					
					 | 
					 | 
					 | 
					  const MAX_LINE_LEN = 128 | 
					 | 
					 | 
					 | 
					  const MAX_LINE_LEN = 128 | 
				
			
			
		
	
		
		
			
				
					
					 | 
					 | 
					 | 
					
 | 
					 | 
					 | 
					 | 
					
 | 
				
			
			
		
	
		
		
			
				
					
					 | 
					 | 
					 | 
					  function fuOpen () { | 
					 | 
					 | 
					 | 
					  function openUploadDialog () { | 
				
			
			
				
				
			
		
	
		
		
			
				
					
					 | 
					 | 
					 | 
					    fuStatus('Ready...') | 
					 | 
					 | 
					 | 
					    updateStatus('Ready...') | 
				
			
			
				
				
			
		
	
		
		
			
				
					
					 | 
					 | 
					 | 
					    Modal.show('#fu_modal', onClose) | 
					 | 
					 | 
					 | 
					    Modal.show('#fu_modal', onDialogClose) | 
				
			
			
				
				
			
		
	
		
		
	
		
		
	
		
		
	
		
		
			
				
					
					 | 
					 | 
					 | 
					    $('#fu_form').toggleClass('busy', false) | 
					 | 
					 | 
					 | 
					    $('#fu_form').toggleClass('busy', false) | 
				
			
			
		
	
		
		
			
				
					
					 | 
					 | 
					 | 
					    input.blockKeys(true) | 
					 | 
					 | 
					 | 
					    input.blockKeys(true) | 
				
			
			
		
	
		
		
			
				
					
					 | 
					 | 
					 | 
					  } | 
					 | 
					 | 
					 | 
					  } | 
				
			
			
		
	
		
		
			
				
					
					 | 
					 | 
					 | 
					
 | 
					 | 
					 | 
					 | 
					
 | 
				
			
			
		
	
		
		
			
				
					
					 | 
					 | 
					 | 
					  function onClose () { | 
					 | 
					 | 
					 | 
					  function onDialogClose () { | 
				
			
			
				
				
			
		
	
		
		
	
		
		
			
				
					
					 | 
					 | 
					 | 
					    console.log('Upload modal closed.') | 
					 | 
					 | 
					 | 
					    console.log('Upload modal closed.') | 
				
			
			
		
	
		
		
			
				
					
					 | 
					 | 
					 | 
					    clearTimeout(fuTout) | 
					 | 
					 | 
					 | 
					    clearTimeout(fuTout) | 
				
			
			
		
	
		
		
			
				
					
					 | 
					 | 
					 | 
					    line_i = 0 | 
					 | 
					 | 
					 | 
					    line_i = 0 | 
				
			
			
		
	
		
		
			
				
					
					 | 
					 | 
					 | 
					    input.blockKeys(false) | 
					 | 
					 | 
					 | 
					    input.blockKeys(false) | 
				
			
			
		
	
		
		
			
				
					
					 | 
					 | 
					 | 
					  } | 
					 | 
					 | 
					 | 
					  } | 
				
			
			
		
	
		
		
			
				
					
					 | 
					 | 
					 | 
					
 | 
					 | 
					 | 
					 | 
					
 | 
				
			
			
		
	
		
		
			
				
					
					 | 
					 | 
					 | 
					  function fuStatus (msg) { | 
					 | 
					 | 
					 | 
					  function updateStatus (msg) { | 
				
			
			
				
				
			
		
	
		
		
	
		
		
			
				
					
					 | 
					 | 
					 | 
					    qs('#fu_prog').textContent = msg | 
					 | 
					 | 
					 | 
					    qs('#fu_prog').textContent = msg | 
				
			
			
		
	
		
		
			
				
					
					 | 
					 | 
					 | 
					  } | 
					 | 
					 | 
					 | 
					  } | 
				
			
			
		
	
		
		
			
				
					
					 | 
					 | 
					 | 
					
 | 
					 | 
					 | 
					 | 
					
 | 
				
			
			
		
	
		
		
			
				
					
					 | 
					 | 
					 | 
					  function fuSend () { | 
					 | 
					 | 
					 | 
					  function startUpload () { | 
				
			
			
				
				
			
		
	
		
		
	
		
		
			
				
					
					 | 
					 | 
					 | 
					    let v = qs('#fu_text').value | 
					 | 
					 | 
					 | 
					    let v = qs('#fu_text').value | 
				
			
			
		
	
		
		
			
				
					
					 | 
					 | 
					 | 
					    if (!v.length) { | 
					 | 
					 | 
					 | 
					    if (!v.length) { | 
				
			
			
		
	
		
		
			
				
					
					 | 
					 | 
					 | 
					      fuClose() | 
					 | 
					 | 
					 | 
					      fuClose() | 
				
			
			
		
	
	
		
		
			
				
					| 
						
						
						
							
								
							
						
					 | 
					 | 
					@ -55,11 +55,11 @@ window.TermUpl = function (conn, input) { | 
				
			
			
		
	
		
		
			
				
					
					 | 
					 | 
					 | 
					    }[qs('#fu_crlf').value] | 
					 | 
					 | 
					 | 
					    }[qs('#fu_crlf').value] | 
				
			
			
		
	
		
		
			
				
					
					 | 
					 | 
					 | 
					
 | 
					 | 
					 | 
					 | 
					
 | 
				
			
			
		
	
		
		
			
				
					
					 | 
					 | 
					 | 
					    $('#fu_form').toggleClass('busy', true) | 
					 | 
					 | 
					 | 
					    $('#fu_form').toggleClass('busy', true) | 
				
			
			
		
	
		
		
			
				
					
					 | 
					 | 
					 | 
					    fuStatus('Starting...') | 
					 | 
					 | 
					 | 
					    updateStatus('Starting...') | 
				
			
			
				
				
			
		
	
		
		
			
				
					
					 | 
					 | 
					 | 
					    fuSendLine() | 
					 | 
					 | 
					 | 
					    uploadLine() | 
				
			
			
				
				
			
		
	
		
		
	
		
		
	
		
		
			
				
					
					 | 
					 | 
					 | 
					  } | 
					 | 
					 | 
					 | 
					  } | 
				
			
			
		
	
		
		
			
				
					
					 | 
					 | 
					 | 
					
 | 
					 | 
					 | 
					 | 
					
 | 
				
			
			
		
	
		
		
			
				
					
					 | 
					 | 
					 | 
					  function fuSendLine () { | 
					 | 
					 | 
					 | 
					  function uploadLine () { | 
				
			
			
				
				
			
		
	
		
		
	
		
		
			
				
					
					 | 
					 | 
					 | 
					    if (!$('#fu_modal').hasClass('visible')) { | 
					 | 
					 | 
					 | 
					    if (!$('#fu_modal').hasClass('visible')) { | 
				
			
			
		
	
		
		
			
				
					
					 | 
					 | 
					 | 
					      // Modal is closed, cancel
 | 
					 | 
					 | 
					 | 
					      // Modal is closed, cancel
 | 
				
			
			
		
	
		
		
			
				
					
					 | 
					 | 
					 | 
					      return | 
					 | 
					 | 
					 | 
					      return | 
				
			
			
		
	
	
		
		
			
				
					| 
						
						
						
							
								
							
						
					 | 
					 | 
					@ -67,7 +67,7 @@ window.TermUpl = function (conn, input) { | 
				
			
			
		
	
		
		
			
				
					
					 | 
					 | 
					 | 
					
 | 
					 | 
					 | 
					 | 
					
 | 
				
			
			
		
	
		
		
			
				
					
					 | 
					 | 
					 | 
					    if (!conn.canSend()) { | 
					 | 
					 | 
					 | 
					    if (!conn.canSend()) { | 
				
			
			
		
	
		
		
			
				
					
					 | 
					 | 
					 | 
					      // postpone
 | 
					 | 
					 | 
					 | 
					      // postpone
 | 
				
			
			
		
	
		
		
			
				
					
					 | 
					 | 
					 | 
					      fuTout = setTimeout(fuSendLine, 1) | 
					 | 
					 | 
					 | 
					      fuTout = setTimeout(uploadLine, 1) | 
				
			
			
				
				
			
		
	
		
		
	
		
		
			
				
					
					 | 
					 | 
					 | 
					      return | 
					 | 
					 | 
					 | 
					      return | 
				
			
			
		
	
		
		
			
				
					
					 | 
					 | 
					 | 
					    } | 
					 | 
					 | 
					 | 
					    } | 
				
			
			
		
	
		
		
			
				
					
					 | 
					 | 
					 | 
					
 | 
					 | 
					 | 
					 | 
					
 | 
				
			
			
		
	
	
		
		
			
				
					| 
						
						
						
							
								
							
						
					 | 
					 | 
					@ -85,16 +85,16 @@ window.TermUpl = function (conn, input) { | 
				
			
			
		
	
		
		
			
				
					
					 | 
					 | 
					 | 
					    } | 
					 | 
					 | 
					 | 
					    } | 
				
			
			
		
	
		
		
			
				
					
					 | 
					 | 
					 | 
					
 | 
					 | 
					 | 
					 | 
					
 | 
				
			
			
		
	
		
		
			
				
					
					 | 
					 | 
					 | 
					    if (!input.sendString(chunk)) { | 
					 | 
					 | 
					 | 
					    if (!input.sendString(chunk)) { | 
				
			
			
		
	
		
		
			
				
					
					 | 
					 | 
					 | 
					      fuStatus('FAILED!') | 
					 | 
					 | 
					 | 
					      updateStatus('FAILED!') | 
				
			
			
				
				
			
		
	
		
		
	
		
		
			
				
					
					 | 
					 | 
					 | 
					      return | 
					 | 
					 | 
					 | 
					      return | 
				
			
			
		
	
		
		
			
				
					
					 | 
					 | 
					 | 
					    } | 
					 | 
					 | 
					 | 
					    } | 
				
			
			
		
	
		
		
			
				
					
					 | 
					 | 
					 | 
					
 | 
					 | 
					 | 
					 | 
					
 | 
				
			
			
		
	
		
		
			
				
					
					 | 
					 | 
					 | 
					    let all = lines.length | 
					 | 
					 | 
					 | 
					    let all = lines.length | 
				
			
			
		
	
		
		
			
				
					
					 | 
					 | 
					 | 
					
 | 
					 | 
					 | 
					 | 
					
 | 
				
			
			
		
	
		
		
			
				
					
					 | 
					 | 
					 | 
					    fuStatus(line_i + ' / ' + all + ' (' + (Math.round((line_i / all) * 1000) / 10) + '%)') | 
					 | 
					 | 
					 | 
					    updateStatus(line_i + ' / ' + all + ' (' + (Math.round((line_i / all) * 1000) / 10) + '%)') | 
				
			
			
				
				
			
		
	
		
		
	
		
		
			
				
					
					 | 
					 | 
					 | 
					
 | 
					 | 
					 | 
					 | 
					
 | 
				
			
			
		
	
		
		
			
				
					
					 | 
					 | 
					 | 
					    if (lines.length > line_i || inline_pos > 0) { | 
					 | 
					 | 
					 | 
					    if (lines.length > line_i || inline_pos > 0) { | 
				
			
			
		
	
		
		
			
				
					
					 | 
					 | 
					 | 
					      fuTout = setTimeout(fuSendLine, send_delay_ms) | 
					 | 
					 | 
					 | 
					      fuTout = setTimeout(uploadLine, send_delay_ms) | 
				
			
			
				
				
			
		
	
		
		
	
		
		
			
				
					
					 | 
					 | 
					 | 
					    } else { | 
					 | 
					 | 
					 | 
					    } else { | 
				
			
			
		
	
		
		
			
				
					
					 | 
					 | 
					 | 
					      closeWhenReady() | 
					 | 
					 | 
					 | 
					      closeWhenReady() | 
				
			
			
		
	
		
		
			
				
					
					 | 
					 | 
					 | 
					    } | 
					 | 
					 | 
					 | 
					    } | 
				
			
			
		
	
	
		
		
			
				
					| 
						
						
						
							
								
							
						
					 | 
					 | 
					@ -103,10 +103,10 @@ window.TermUpl = function (conn, input) { | 
				
			
			
		
	
		
		
			
				
					
					 | 
					 | 
					 | 
					  function closeWhenReady () { | 
					 | 
					 | 
					 | 
					  function closeWhenReady () { | 
				
			
			
		
	
		
		
			
				
					
					 | 
					 | 
					 | 
					    if (!conn.canSend()) { | 
					 | 
					 | 
					 | 
					    if (!conn.canSend()) { | 
				
			
			
		
	
		
		
			
				
					
					 | 
					 | 
					 | 
					      // stuck in XOFF still, wait to process...
 | 
					 | 
					 | 
					 | 
					      // stuck in XOFF still, wait to process...
 | 
				
			
			
		
	
		
		
			
				
					
					 | 
					 | 
					 | 
					      fuStatus('Waiting for Tx buffer...') | 
					 | 
					 | 
					 | 
					      updateStatus('Waiting for Tx buffer...') | 
				
			
			
				
				
			
		
	
		
		
	
		
		
			
				
					
					 | 
					 | 
					 | 
					      setTimeout(closeWhenReady, 100) | 
					 | 
					 | 
					 | 
					      setTimeout(closeWhenReady, 100) | 
				
			
			
		
	
		
		
			
				
					
					 | 
					 | 
					 | 
					    } else { | 
					 | 
					 | 
					 | 
					    } else { | 
				
			
			
		
	
		
		
			
				
					
					 | 
					 | 
					 | 
					      fuStatus('Done.') | 
					 | 
					 | 
					 | 
					      updateStatus('Done.') | 
				
			
			
				
				
			
		
	
		
		
	
		
		
			
				
					
					 | 
					 | 
					 | 
					      // delay to show it
 | 
					 | 
					 | 
					 | 
					      // delay to show it
 | 
				
			
			
		
	
		
		
			
				
					
					 | 
					 | 
					 | 
					      setTimeout(function () { | 
					 | 
					 | 
					 | 
					      setTimeout(function () { | 
				
			
			
		
	
		
		
			
				
					
					 | 
					 | 
					 | 
					        fuClose() | 
					 | 
					 | 
					 | 
					        fuClose() | 
				
			
			
		
	
	
		
		
			
				
					| 
						
							
								
							
						
						
							
								
							
						
						
					 | 
					 | 
					@ -138,9 +138,21 @@ window.TermUpl = function (conn, input) { | 
				
			
			
		
	
		
		
			
				
					
					 | 
					 | 
					 | 
					        console.log('Loading file...') | 
					 | 
					 | 
					 | 
					        console.log('Loading file...') | 
				
			
			
		
	
		
		
			
				
					
					 | 
					 | 
					 | 
					        reader.readAsText(file) | 
					 | 
					 | 
					 | 
					        reader.readAsText(file) | 
				
			
			
		
	
		
		
			
				
					
					 | 
					 | 
					 | 
					      }, false) | 
					 | 
					 | 
					 | 
					      }, false) | 
				
			
			
		
	
		
		
			
				
					
					 | 
					 | 
					 | 
					    }, | 
					 | 
					 | 
					 | 
					
 | 
				
			
			
				
				
			
		
	
		
		
			
				
					
					 | 
					 | 
					 | 
					    close: fuClose, | 
					 | 
					 | 
					 | 
					      qs('#term-fu-open').addEventListener('click', function () { | 
				
			
			
				
				
			
		
	
		
		
			
				
					
					 | 
					 | 
					 | 
					    start: fuSend, | 
					 | 
					 | 
					 | 
					        openUploadDialog() | 
				
			
			
				
				
			
		
	
		
		
			
				
					
					 | 
					 | 
					 | 
					    open: fuOpen | 
					 | 
					 | 
					 | 
					        return false | 
				
			
			
				
				
			
		
	
		
		
	
		
		
	
		
		
	
		
		
	
		
		
			
				
					
					 | 
					 | 
					 | 
					 | 
					 | 
					 | 
					 | 
					      }) | 
				
			
			
		
	
		
		
			
				
					
					 | 
					 | 
					 | 
					 | 
					 | 
					 | 
					 | 
					
 | 
				
			
			
		
	
		
		
			
				
					
					 | 
					 | 
					 | 
					 | 
					 | 
					 | 
					 | 
					      qs('#term-fu-start').addEventListener('click', function () { | 
				
			
			
		
	
		
		
			
				
					
					 | 
					 | 
					 | 
					 | 
					 | 
					 | 
					 | 
					        startUpload() | 
				
			
			
		
	
		
		
			
				
					
					 | 
					 | 
					 | 
					 | 
					 | 
					 | 
					 | 
					        return false | 
				
			
			
		
	
		
		
			
				
					
					 | 
					 | 
					 | 
					 | 
					 | 
					 | 
					 | 
					      }) | 
				
			
			
		
	
		
		
			
				
					
					 | 
					 | 
					 | 
					 | 
					 | 
					 | 
					 | 
					
 | 
				
			
			
		
	
		
		
			
				
					
					 | 
					 | 
					 | 
					 | 
					 | 
					 | 
					 | 
					      qs('#term-fu-close').addEventListener('click', function () { | 
				
			
			
		
	
		
		
			
				
					
					 | 
					 | 
					 | 
					 | 
					 | 
					 | 
					 | 
					        fuClose() | 
				
			
			
		
	
		
		
			
				
					
					 | 
					 | 
					 | 
					 | 
					 | 
					 | 
					 | 
					        return false | 
				
			
			
		
	
		
		
			
				
					
					 | 
					 | 
					 | 
					 | 
					 | 
					 | 
					 | 
					      }) | 
				
			
			
		
	
		
		
			
				
					
					 | 
					 | 
					 | 
					 | 
					 | 
					 | 
					 | 
					    } | 
				
			
			
		
	
		
		
			
				
					
					 | 
					 | 
					 | 
					  } | 
					 | 
					 | 
					 | 
					  } | 
				
			
			
		
	
		
		
			
				
					
					 | 
					 | 
					 | 
					} | 
					 | 
					 | 
					 | 
					} | 
				
			
			
		
	
	
		
		
			
				
					| 
						
						
						
					 | 
					 | 
					
  |