Changeset 17830 for misc/runpugs
- Timestamp:
- 09/14/07 12:25:35 (15 months ago)
- Location:
- misc/runpugs
- Files:
-
- 1 added
- 3 modified
-
htdocs/runpugs/index.html (modified) (1 diff)
-
htdocs/runpugs/jquery-1.2.min.js (added)
-
htdocs/runpugs/runpugs.js (modified) (6 diffs)
-
perl/runpugs.pl (modified) (2 diffs)
Legend:
- Unmodified
- Added
- Removed
-
misc/runpugs/htdocs/runpugs/index.html
r17145 r17830 3 3 <meta http-equiv="Content-Type" content="text/html; charset=utf-8"><title>Run Perl 6 Now -- in your browser!</title> 4 4 <link rel="stylesheet" type="text/css" href="../runpugs.css"> 5 <script language="javascript" src="jquery-1.2.min.js"></script> 5 6 <script language="JavaScript" src="runpugs.js"></script> 6 7 </head> -
misc/runpugs/htdocs/runpugs/runpugs.js
r15027 r17830 1 1 var nchars=0; 2 var histlist ;2 var histlist=new Array(); 3 3 var histentry=0; 4 4 var reply=""; … … 63 63 64 64 function process_events (keycode) { 65 // document.terminal.mon.value=keycode;66 65 if (keycode == 13) { 67 66 var cmd=document.terminal.cmd.value; 68 //cmd.replace(/^.*pugs\>\ /, ""); 69 //cmds=cmd.split('pugs> '); 70 //cmd=cmds[cmds.length-1]; 71 frames['scratch'].document.getElementById("cmd").value=cmd; 67 //cmd.replace(/^.*pugs\>\ /, ""); 68 var cmds=cmd.split('pugs> '); 69 var lastCmd=cmds[cmds.length-1]; 70 if($.trim(lastCmd) != "") { 71 histlist.push(lastCmd); 72 } 73 frames['scratch'].document.getElementById("cmd").value=cmd; 72 74 frames['scratch'].document.terminal.submit(); 73 75 return false; … … 96 98 97 99 function getreply () { 98 //getElementById("scratch")99 100 scratchpad=frames['scratch'].document;//.contentDocument; 100 101 reply=scratchpad.getElementById("cmd").value; 101 histlist=scratchpad.terminal.history.options;102 102 histentry=histlist.length; 103 103 sessionid=scratchpad.terminal.sessionid.value; 104 //reldev=scratchpad.terminal.reldev.value;105 //histlist.reverse;106 104 document.terminal.cmd.value=reply; 107 105 document.terminal.cmd.focus() … … 111 109 112 110 function hist_next () { 113 if (histentry> 1) {111 if (histentry>=1) { 114 112 histentry-=1; 115 document.terminal.cmd.value=reply+histlist[histentry] .value;113 document.terminal.cmd.value=reply+histlist[histentry]; 116 114 document.terminal.cmd.scrollTop =document.terminal.cmd.scrollHeight; 117 115 } … … 122 120 if (histentry<histlist.length-1) { 123 121 histentry+=1; 124 document.terminal.cmd.value=reply+histlist[histentry] .value;122 document.terminal.cmd.value=reply+histlist[histentry]; 125 123 document.terminal.cmd.scrollTop =document.terminal.cmd.scrollHeight; 126 124 } … … 154 152 || (!document.all && evt.target==null) ) ) // Firefox sets the target of the passed event to null. 155 153 { // The window has been closed. Submit a logout request to the server. 156 var expireSessionUrl='/perl/runpugs 3.pl?sessionid='+sessionid+'&reldev=1&ia=1&cmd=%3Aq';154 var expireSessionUrl='/perl/runpugs.pl?sessionid='+sessionid+'&reldev=1&ia=1&cmd=%3Aq'; 157 155 var objXMLCloser = null; 158 156 if ( !document.all && !XMLHttpRequest ) return; -
misc/runpugs/perl/runpugs.pl
r16055 r17830 160 160 ($replyw=~/^\s*$/) && ($nrows=1); 161 161 if ($nrows>20) {$nrows=20;} 162 my $historylist="\n";163 for my $entry (@history) {164 my $entryw=HTML::Entities::encode_entities($entry);165 $historylist.='<option value="'.$entryw.'">'.$entryw.'</option>'."\n";166 }167 162 if($replyw!~/Leaving\ pugs\.$/) { 168 163 $replyw.=$nprompt; … … 171 166 open(HTML,"<../data/runpugs.html"); 172 167 while(<HTML>) { 173 /_HIST_/ && do {174 $html.=$historylist;175 next;176 };177 168 s/_DEV_/$devc/; 178 169 s/_REL_/$relc/;
