Changeset 14885 for misc/runpugs/data
- Timestamp:
- 12/13/06 11:12:45 (2 years ago)
- Location:
- misc/runpugs/data
- Files:
-
- 1 added
- 2 modified
-
runpugs.html (modified) (5 diffs)
-
runpugs2.html (modified) (2 diffs)
-
runpugs_async.html (added)
Legend:
- Unmodified
- Added
- Removed
-
misc/runpugs/data/runpugs.html
r14733 r14885 7 7 <link rel="stylesheet" type="text/css" href="/runpugs.css"> 8 8 <script language="JavaScript"> 9 var nchars=0; 10 function getnchars() { 11 return document.terminal.cmd.value.length 12 } 9 13 14 function getcursorpos() { 15 var obj=document.terminal.cmd; 16 if(document.selection) { 17 obj.focus(); 18 var rng=document.selection.createRange(); 19 rng.moveStart('character',-nchars); 20 return rng.text.length; 21 } else if(obj.selectionStart>=0) { // FireFox 22 var start = obj.selectionStart; 23 var end = obj.selectionEnd; 24 if (start<=end) { 25 return start; 26 } else { 27 return end; 28 } 29 } 30 } 31 32 function catchbackspace(myfield,e) 33 { 34 var keycode; 35 if (window.event) {keycode = window.event.keyCode; 36 } 37 else if (e) { 38 keycode = e.which; 39 } 40 else return true; 41 42 if (keycode == 13) 43 { 44 document.terminal.submit(); 45 return false; 46 } 47 if (keycode==38) { 48 return false; 49 } 50 if ((keycode==8)||(keycode==37)||(keycode==46)) { 51 if ((getnchars()>nchars) && (getcursorpos() > nchars)) { 52 return true; 53 } else { 54 return false; 55 } 56 } else { 57 return true; 58 } 59 } 60 61 // onkeypress="return catchbackspace(this,event)" onkeydown="return catchbackspace(this,event)" 10 62 function submitenter(myfield,e) 11 63 { … … 19 71 return false; 20 72 } 73 else { 74 if (keycode == 8) { 75 if (getnchars()>nchars) { 76 return true; 77 } else { 78 return false; 79 } 80 } else { 81 return true; 82 } 83 } 84 } 85 86 function select_enter() 87 { 88 /* _SKIPC_ 89 document.terminal.cmdline.value=document.terminal.hist.options[document.terminal.hist.selectedIndex].value; 90 document.terminal.hist.selectedIndex=0; 91 document.terminal.cmdline.focus(); 92 _SKIPC_ */ 93 /* _SKIPT_ 94 document.terminal.cmd.value+=document.terminal.hist.options[document.terminal.hist.selectedIndex].value; 95 document.terminal.hist.selectedIndex=0; 96 document.terminal.cmd.focus(); 97 document.terminal.cmd.scrollTop =document.terminal.cmd.scrollHeight; 98 _SKIPT_ */ 99 } 100 101 function select_enter_OFF(myfield,e) 102 { 103 var keycode; 104 if (window.event) keycode = window.event.keyCode; 105 else if (e) keycode = e.which; 106 else return true; 107 if (keycode == 13) 108 { 109 document.terminal.cmdline.value=document.terminal.hist.options[document.terminal.hist.selectedIndex].value; 110 return false; 111 } 21 112 else 22 113 return true; … … 27 118 <div id="mainwindow"> 28 119 <h1>Run Perl 6 now -- in your browser!</h1> 29 30 <form id="term" name="terminal" action="/cgi-bin/runpugs" method="POST"> 31 <input type="hidden" name="testing" value="_TESTING_"> 120 <form id="term" name="terminal" action="/cgi-perl/runpugs" method="POST"> 121 <input type="hidden" name="prompt" value="_PROMPTW_"> 32 122 <input type="hidden" name="sessionid" value=""> 123 <input type="hidden" name="ia" value="1"> 33 124 <input type="hidden" name="action" value="runpugs"> 34 <h2>Interactive Pugs Session</h2>35 <!-- _MOTD_ -->36 125 <input type="radio" id="rel" value="0" name="reldev" _REL_ ><label 37 126 for="rel">Release version</label> … … 39 128 for="dev">Development version</label> 40 129 <div id="termwindow"> 41 <textarea id="cmd" name="cmd" rows="23" cols="80" wrap="virtual" onKeyPress="return submitenter(this,event)"> 42 pugs> 130 <select name="history" id="hist" onChange="select_enter()"> 131 <option value="">--- Recent commands ---</option> 132 _HIST_ 133 </select> 134 <br> 135 <!-- _SKIPT_ 136 <textarea id="cmd" name="cmd" rows="20" cols="80" wrap="virtual" onkeypress="return catchbackspace(this,event)" onkeydown="return catchbackspace(this,event)"> 137 _ALL_ 43 138 </textarea> 139 _SKIPT_ --> 140 <!--_SKIPC_ 141 <textarea readonly id="output" name="output" rows="_NROWS_" cols="80" wrap="virtual"> 142 _REPLYW_ 143 </textarea> 144 <br> 145 <label for="cmdline"><span class="prompt"> 146 _NPROMPTW_ 147 </span> 148 <input type="text" size="74" id="cmdline" name="cmdline" value="" 149 onKeyPress="return submitenter(this,event)"> 150 </label> 151 _SKIPC_ --> 44 152 </div> 45 153 <input id="enter" type="submit" value="Submit"> … … 47 155 <script language="JavaScript"> 48 156 document.terminal.enter.style.display='none'; 49 document.terminal.cmd.focus(); 50 document.terminal.cmd.scrollTop =document.terminal.cmd.scrollHeight; 157 document.terminal.cmdline.focus() // _SKIPT_ 158 document.terminal.cmd.focus() // _SKIPC_ 159 document.terminal.output.scrollTop =document.terminal.output.scrollHeight; // _SKIPT_ 160 document.terminal.cmd.scrollTop =document.terminal.cmd.scrollHeight; // _SKIPC_ 161 //if (document.terminal.output.rows==1) { 162 //document.terminal.output.style.height="2ex"; 163 //} 164 nchars=document.terminal.cmd.value.length; 51 165 </script> 52 <p>This live web terminal runs the <a href="http://www.pugscode.org"> Pugs</a> interpreter for <a53 href="http://dev.perl.org/perl 6/">Perl 6</a>. Please <a166 <p>This live web terminal runs the <a href="http://www.pugscode.org">pugs</a> interpreter for <a 167 href="http://dev.perl.org/perl 6/">Perl 6</a>. Please <a 54 168 href="http://feather.perl6.nl/~andara/runpugs/">read the documentation</a>. 55 169 </p> -
misc/runpugs/data/runpugs2.html
r14743 r14885 125 125 </p> 126 126 --> 127 <form id="term" name="terminal" action="/cgi-bin/runpugs2" method="POST"> 127 <!-- _MOTD_ --> 128 <form id="term" name="terminal" action="/cgi-bin/runpugs" method="POST"> 128 129 <input type="hidden" name="prompt" value="_PROMPTW_"> 129 130 <input type="hidden" name="sessionid" value=""> … … 134 135 <input type="radio" id="dev" value="1" name="reldev" _DEV_ ><label 135 136 for="dev">Development version</label> 136 <!--137 <br><br>138 <span class="tabon">Interactive Pugs Session</span>139 <a class="taboff" href="/cgi-bin/runpugs2?ia=0">Run a Perl 6 Script</a>140 -->141 137 <div id="termwindow"> 142 138 <select name="history" id="hist" onChange="select_enter()">
