Changeset 17890 for misc/runpugs
- Timestamp:
- 09/17/07 19:38:01 (14 months ago)
- Location:
- misc/runpugs/htdocs/runpugs
- Files:
-
- 2 modified
-
index.html (modified) (2 diffs)
-
runpugs.js (modified) (10 diffs)
Legend:
- Unmodified
- Added
- Removed
-
misc/runpugs/htdocs/runpugs/index.html
r17884 r17890 60 60 Because this is a web terminal, a number of restrictions apply. 61 61 Please <a href="http://feather.perl6.nl/%7Eandara/runpugs/">read the documentation</a> for more information. 62 <br/> 62 <div class="copyright">© Copyright 2006 by Wim.Vanderbauwhede. Contact me @ gmail.com<br/> 63 Enhanced web terminal by Ahmad.Zawawi. Contact me @ gmail.com 64 </div> 63 65 </div> 64 66 </form> 65 67 </div> 66 <span class="copyright">© Copyright 2006 by Wim.Vanderbauwhede. Contact me @ gmail.com<br/>67 Enhanced web terminal by Ahmad.Zawawi. Contact me @ gmail.com68 </span>69 68 <hr/> 70 69 <a href="http://validator.w3.org/check?uri=referer"> … … 72 71 alt="Valid XHTML 1.0!" height="31" width="88" border="0" /> 73 72 </a> 73 <div id="hidden_iframe"></div> 74 <!-- 75 //This is now inserted automatically by jQuery to start loading things after $(document).ready() 74 76 <iframe src="/perl/runpugs.pl" id="scratch" name="scratch" style="visibility:hidden" 75 77 width="700px" height="1px" onLoad="getreply()"></iframe> 78 --> 76 79 </body> 77 80 </html> -
misc/runpugs/htdocs/runpugs/runpugs.js
r17884 r17890 1 1 var histlist=new Array(); 2 2 var histentry=0; 3 var reply="";4 3 var sessionid=0; 5 4 var reldev=0; … … 28 27 } 29 28 30 //show command29 //show last command on console 31 30 function showCmd() { 32 31 var cmdEl = "#c" + (cmds.length - 1); … … 36 35 //update the console 37 36 function updateConsole() { 38 $("#tt").empty();39 37 $.each(cmds,function(i,n) { 38 if(i == 0) { 39 //clear only on first usage... 40 $("#tt").empty(); 41 } 40 42 var l = (n == "") ? " " : n; 41 43 var tr = "<tr><td><pre id='c" + i + … … 53 55 //wait for when the document is ready 54 56 $(document).ready( function() { 55 56 57 //display waiting msg and try to calculate width of 57 58 //a single fixed character... … … 72 73 73 74 //repaint & start showing the cursor... 74 updateConsole();75 75 showCursor(); 76 76 … … 93 93 }); 94 94 95 //start loading pugs session after page has loaded... 96 $("#hidden_iframe").append( 97 'im there!<iframe src="/perl/runpugs.pl" id="scratch" name="scratch" ' + 98 'style="visibility:hidden" width="700px" height="1px" ' + 99 'onLoad="getreply()"></iframe>'); 95 100 }); 96 101 97 102 //insert character 'ch' at index 'pos' in string str 98 //and return it103 //and return the result 99 104 function insert(str,ch,pos) { 100 105 var s = str.substring(0,pos); … … 103 108 } 104 109 110 //focus on last command very hard ;-) 105 111 function focusOnCmd(e) { 106 112 $(e).focus(); … … 187 193 } else if(keyCode == 46) { 188 194 //del 189 if(curpos >= 0){ // && curpos <= cmd.length+1) {195 if(curpos >= 0){ 190 196 var newCmd = ""; 191 197 for(var i = 0; i < cmd.length; i++) { … … 195 201 } 196 202 cmd = newCmd; 197 //if(curpos > cmd.length) {198 // curpos = cmd.length+1;199 //}200 203 showCmd(); 201 204 moveCursor(); … … 243 246 function getreply () { 244 247 scratchpad=frames['scratch'].document; 245 reply=scratchpad.getElementById("cmd").value;248 var reply=scratchpad.getElementById("cmd").value; 246 249 histentry=histlist.length; 247 250 sessionid=scratchpad.terminal.sessionid.value;
