document.write('
Data hosted with ♥ by Pastebin.com - Download Raw - See Original
  1. <html>
  2. <head>
  3. <title>Seriality Serial Console</title>
  4. <link type="text/css" href="css/ui-lightness/jquery-ui-1.8.custom.css" rel="stylesheet" /> 
  5. <link href="css/rgb.css" type="text/css" rel="stylesheet"/>
  6.  
  7. <script type="text/javascript" src="http://ajax.googleapis.com/ajax/libs/jquery/1.4/jquery.min.js"></script>
  8. <script src="http://ajax.googleapis.com/ajax/libs/jqueryui/1.8/jquery-ui.min.js" type="text/javascript"></script>
  9. <script type="text/javascript" src="js/json2.js"></script>
  10. <script type="text/javascript">
  11.     var serial;
  12.      
  13.     function loop () {
  14.         var line = "";
  15.                 while (serial.available()) {
  16.                     line = serial.readLine() + "\\n";
  17.                     $("#console").val(  $("#console").val() + line);
  18.                 }
  19.     }
  20.    
  21.     function sendData() {
  22.         serial.write($(this).text() + "\\n");
  23.         console.log("Serial available: " + serial.available() );
  24.     }
  25.        
  26.     $(function(){
  27.             serial = (document.getElementById("seriality")).Seriality();
  28.             serial.begin(serial.ports[0], 9600);
  29.            
  30.             $("#send").bind("click", function () {sendData();});
  31.             $("#input").bind("keyup", function(event) {
  32.                 if (event.keyCode == \'13\') {
  33.                     sendData();
  34.                 }
  35.             });
  36.       setInterval(loop, 150);          
  37.     });
  38.  
  39. </script>
  40. </head>
  41. <body>
  42.   <object type="application/Seriality" id="seriality" width="0" height="0"></object>
  43. <div class="consoleapp">
  44.  
  45. <p class="ui-state-default ui-corner-all ui-helper-clearfix" style="padding:4px;">
  46. <span class="ui-icon ui-icon-pencil" style="float:left; margin:-2px 5px 0 0;"></span>
  47. Serial console for seriality
  48. </p>
  49.  
  50.  
  51. <input id="input" size="50" /> <button id="send">Send</button>
  52. <br>
  53. <textarea id="console" rows="15" cols="50" ></textarea>
  54.  
  55.  
  56.  
  57. </div>
  58.  
  59. <div class="consoleapp-description" style="clear:left;">
  60.  
  61. <p>Watch what comes out. Enter what goes in.
  62. </p>
  63.  
  64. </div>
  65. </body>
  66. </html>
');