-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
git-svn-id: http://svn.pugscode.org/pugs@17143 c213334d-75ef-0310-aa23-eaa082d1ae64
- Loading branch information
zoffix
committed
Jul 26, 2007
1 parent
d821575
commit a96e6ab
Showing
1 changed file
with
182 additions
and
182 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,182 +1,182 @@ | ||
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN"> | ||
<html lang="en"> | ||
<head> | ||
<meta http-equiv="Content-Type" content="text/html; charset=utf-8"> | ||
|
||
<title>Run Perl 6 Now -- in your browser!</title> | ||
<link rel="stylesheet" type="text/css" href="/runpugs.css"> | ||
<script language="JavaScript"> | ||
var nchars=0; | ||
function getnchars() { | ||
return document.terminal.cmd.value.length | ||
} | ||
|
||
function getcursorpos() { | ||
var obj=document.terminal.cmd; | ||
if(document.selection) { | ||
obj.focus(); | ||
var rng=document.selection.createRange(); | ||
rng.moveStart('character',-nchars); | ||
return rng.text.length; | ||
} else if(obj.selectionStart>=0) { // FireFox | ||
var start = obj.selectionStart; | ||
var end = obj.selectionEnd; | ||
if (start<=end) { | ||
return start; | ||
} else { | ||
return end; | ||
} | ||
} | ||
} | ||
|
||
function catchbackspace(myfield,e) | ||
{ | ||
var keycode; | ||
if (window.event) {keycode = window.event.keyCode; | ||
} | ||
else if (e) { | ||
keycode = e.which; | ||
} | ||
else return true; | ||
|
||
if (keycode == 13) | ||
{ | ||
document.terminal.submit(); | ||
return false; | ||
} | ||
if (keycode==38) { | ||
return false; | ||
} | ||
if ((keycode==8)||(keycode==37)||(keycode==46)) { | ||
if ((getnchars()>nchars) && (getcursorpos() > nchars)) { | ||
return true; | ||
} else { | ||
return false; | ||
} | ||
} else { | ||
return true; | ||
} | ||
} | ||
|
||
// onkeypress="return catchbackspace(this,event)" onkeydown="return catchbackspace(this,event)" | ||
function submitenter(myfield,e) | ||
{ | ||
var keycode; | ||
if (window.event) keycode = window.event.keyCode; | ||
else if (e) keycode = e.which; | ||
else return true; | ||
if (keycode == 13) | ||
{ | ||
document.terminal.submit(); | ||
return false; | ||
} | ||
else { | ||
if (keycode == 8) { | ||
if (getnchars()>nchars) { | ||
return true; | ||
} else { | ||
return false; | ||
} | ||
} else { | ||
return true; | ||
} | ||
} | ||
} | ||
|
||
function select_enter() | ||
{ | ||
/* _SKIPC_ | ||
document.terminal.cmdline.value=document.terminal.hist.options[document.terminal.hist.selectedIndex].value; | ||
document.terminal.hist.selectedIndex=0; | ||
document.terminal.cmdline.focus(); | ||
_SKIPC_ */ | ||
/* _SKIPT_ | ||
document.terminal.cmd.value+=document.terminal.hist.options[document.terminal.hist.selectedIndex].value; | ||
document.terminal.hist.selectedIndex=0; | ||
document.terminal.cmd.focus(); | ||
document.terminal.cmd.scrollTop =document.terminal.cmd.scrollHeight; | ||
_SKIPT_ */ | ||
} | ||
|
||
function select_enter_OFF(myfield,e) | ||
{ | ||
var keycode; | ||
if (window.event) keycode = window.event.keyCode; | ||
else if (e) keycode = e.which; | ||
else return true; | ||
if (keycode == 13) | ||
{ | ||
//document.terminal.submit(); | ||
document.terminal.cmdline.value=document.terminal.hist.options[document.terminal.hist.selectedIndex].value; | ||
return false; | ||
} | ||
else | ||
return true; | ||
} | ||
</script> | ||
</head> | ||
<body> | ||
<div id="mainwindow"> | ||
<h1>Run Perl 6 now -- in your browser!</h1> | ||
<!-- | ||
<p>This live web terminal runs the <a href="http://www.pugscode.org">pugs</a> interpreter for <a | ||
href="http://dev.perl.org/perl 6/">Perl 6</a>. Please <a | ||
href="http://feather.perl6.nl/~andara/runpugs/">read the documentation</a>. | ||
</p> | ||
--> | ||
<!-- _MOTD_ --> | ||
<form id="term" name="terminal" action="/cgi-bin/runpugs" method="POST"> | ||
<input type="hidden" name="prompt" value="_PROMPTW_"> | ||
<input type="hidden" name="sessionid" value=""> | ||
<input type="hidden" name="ia" value="1"> | ||
<input type="hidden" name="action" value="runpugs"> | ||
<input type="radio" id="rel" value="0" name="reldev" _REL_ ><label | ||
for="rel">Release version</label> | ||
<input type="radio" id="dev" value="1" name="reldev" _DEV_ ><label | ||
for="dev">Development version</label> | ||
<div id="termwindow"> | ||
<select name="history" id="hist" onChange="select_enter()"> | ||
<option value="">--- Recent commands ---</option> | ||
_HIST_ | ||
</select> | ||
<!--onKeyPress="return submitenter(this,event)"--> | ||
<br> | ||
<!-- _SKIPT_ | ||
<textarea id="cmd" name="cmd" rows="20" cols="80" wrap="virtual" onkeypress="return catchbackspace(this,event)" onkeydown="return catchbackspace(this,event)"> | ||
_ALL_ | ||
</textarea> | ||
_SKIPT_ --> | ||
<!--_SKIPC_ | ||
<textarea readonly id="output" name="output" rows="_NROWS_" cols="80" wrap="virtual"> | ||
_REPLYW_ | ||
</textarea> | ||
<br> | ||
<label for="cmdline"><span class="prompt"> | ||
_NPROMPTW_ | ||
</span> | ||
<input type="text" size="74" id="cmdline" name="cmdline" value="" | ||
onKeyPress="return submitenter(this,event)"> | ||
</label> | ||
_SKIPC_ --> | ||
</div> | ||
<input id="enter" type="submit" value="Submit"> | ||
</form> | ||
<script language="JavaScript"> | ||
document.terminal.enter.style.display='none'; | ||
document.terminal.cmdline.focus() // _SKIPT_ | ||
document.terminal.cmd.focus() // _SKIPC_ | ||
document.terminal.output.scrollTop =document.terminal.output.scrollHeight; // _SKIPT_ | ||
document.terminal.cmd.scrollTop =document.terminal.cmd.scrollHeight; // _SKIPC_ | ||
//if (document.terminal.output.rows==1) { | ||
//document.terminal.output.style.height="2ex"; | ||
//} | ||
nchars=document.terminal.cmd.value.length; | ||
</script> | ||
<p>This live web terminal runs the <a href="http://www.pugscode.org">pugs</a> interpreter for <a | ||
href="http://dev.perl.org/perl 6/">Perl 6</a>. Please <a | ||
href="http://feather.perl6.nl/~andara/runpugs/">read the documentation</a>. | ||
</p> | ||
<p class="copyright">© Copyright 2006 by Wim Vanderbauwhede</p> | ||
</div> | ||
</body> | ||
</html> | ||
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN"> | ||
<html lang="en"> | ||
<head> | ||
<meta http-equiv="Content-Type" content="text/html; charset=utf-8"> | ||
|
||
<title>Run Perl 6 Now -- in your browser!</title> | ||
<link rel="stylesheet" type="text/css" href="/runpugs.css"> | ||
<script language="JavaScript"> | ||
var nchars=0; | ||
function getnchars() { | ||
return document.terminal.cmd.value.length | ||
} | ||
|
||
function getcursorpos() { | ||
var obj=document.terminal.cmd; | ||
if(document.selection) { | ||
obj.focus(); | ||
var rng=document.selection.createRange(); | ||
rng.moveStart('character',-nchars); | ||
return rng.text.length; | ||
} else if(obj.selectionStart>=0) { // FireFox | ||
var start = obj.selectionStart; | ||
var end = obj.selectionEnd; | ||
if (start<=end) { | ||
return start; | ||
} else { | ||
return end; | ||
} | ||
} | ||
} | ||
|
||
function catchbackspace(myfield,e) | ||
{ | ||
var keycode; | ||
if (window.event) {keycode = window.event.keyCode; | ||
} | ||
else if (e) { | ||
keycode = e.which; | ||
} | ||
else return true; | ||
|
||
if (keycode == 13) | ||
{ | ||
document.terminal.submit(); | ||
return false; | ||
} | ||
if (keycode==38) { | ||
return false; | ||
} | ||
if ((keycode==8)||(keycode==37)||(keycode==46)) { | ||
if ((getnchars()>nchars) && (getcursorpos() > nchars)) { | ||
return true; | ||
} else { | ||
return false; | ||
} | ||
} else { | ||
return true; | ||
} | ||
} | ||
|
||
// onkeypress="return catchbackspace(this,event)" onkeydown="return catchbackspace(this,event)" | ||
function submitenter(myfield,e) | ||
{ | ||
var keycode; | ||
if (window.event) keycode = window.event.keyCode; | ||
else if (e) keycode = e.which; | ||
else return true; | ||
if (keycode == 13) | ||
{ | ||
document.terminal.submit(); | ||
return false; | ||
} | ||
else { | ||
if (keycode == 8) { | ||
if (getnchars()>nchars) { | ||
return true; | ||
} else { | ||
return false; | ||
} | ||
} else { | ||
return true; | ||
} | ||
} | ||
} | ||
|
||
function select_enter() | ||
{ | ||
/* _SKIPC_ | ||
document.terminal.cmdline.value=document.terminal.hist.options[document.terminal.hist.selectedIndex].value; | ||
document.terminal.hist.selectedIndex=0; | ||
document.terminal.cmdline.focus(); | ||
_SKIPC_ */ | ||
/* _SKIPT_ | ||
document.terminal.cmd.value+=document.terminal.hist.options[document.terminal.hist.selectedIndex].value; | ||
document.terminal.hist.selectedIndex=0; | ||
document.terminal.cmd.focus(); | ||
document.terminal.cmd.scrollTop =document.terminal.cmd.scrollHeight; | ||
_SKIPT_ */ | ||
} | ||
|
||
function select_enter_OFF(myfield,e) | ||
{ | ||
var keycode; | ||
if (window.event) keycode = window.event.keyCode; | ||
else if (e) keycode = e.which; | ||
else return true; | ||
if (keycode == 13) | ||
{ | ||
//document.terminal.submit(); | ||
document.terminal.cmdline.value=document.terminal.hist.options[document.terminal.hist.selectedIndex].value; | ||
return false; | ||
} | ||
else | ||
return true; | ||
} | ||
</script> | ||
</head> | ||
<body> | ||
<div id="mainwindow"> | ||
<h1>Run Perl 6 now -- in your browser!</h1> | ||
<!-- | ||
<p>This live web terminal runs the <a href="http://www.pugscode.org">pugs</a> interpreter for <a | ||
href="http://dev.perl.org/perl 6/">Perl 6</a>. Please <a | ||
href="http://feather.perl6.nl/~andara/runpugs/">read the documentation</a>. | ||
</p> | ||
--> | ||
<!-- _MOTD_ --> | ||
<form id="term" name="terminal" action="/cgi-bin/runpugs" method="POST"> | ||
<input type="hidden" name="prompt" value="_PROMPTW_"> | ||
<input type="hidden" name="sessionid" value=""> | ||
<input type="hidden" name="ia" value="1"> | ||
<input type="hidden" name="action" value="runpugs"> | ||
<input type="radio" id="rel" value="0" name="reldev" _REL_ ><label | ||
for="rel">Release version</label> | ||
<input type="radio" id="dev" value="1" name="reldev" _DEV_ ><label | ||
for="dev">Development version</label> | ||
<div id="termwindow"> | ||
<select name="history" id="hist" onChange="select_enter()"> | ||
<option value="">--- Recent commands ---</option> | ||
_HIST_ | ||
</select> | ||
<!--onKeyPress="return submitenter(this,event)"--> | ||
<br> | ||
<!-- _SKIPT_ | ||
<textarea id="cmd" name="cmd" rows="20" cols="80" wrap="virtual" onkeypress="return catchbackspace(this,event)" onkeydown="return catchbackspace(this,event)"> | ||
_ALL_ | ||
</textarea> | ||
_SKIPT_ --> | ||
<!--_SKIPC_ | ||
<textarea readonly id="output" name="output" rows="_NROWS_" cols="80" wrap="virtual"> | ||
_REPLYW_ | ||
</textarea> | ||
<br> | ||
<label for="cmdline"><span class="prompt"> | ||
_NPROMPTW_ | ||
</span> | ||
<input type="text" size="74" id="cmdline" name="cmdline" value="" | ||
onKeyPress="return submitenter(this,event)"> | ||
</label> | ||
_SKIPC_ --> | ||
</div> | ||
<input id="enter" type="submit" value="Submit"> | ||
</form> | ||
<script language="JavaScript"> | ||
document.terminal.enter.style.display='none'; | ||
document.terminal.cmdline.focus() // _SKIPT_ | ||
document.terminal.cmd.focus() // _SKIPC_ | ||
document.terminal.output.scrollTop =document.terminal.output.scrollHeight; // _SKIPT_ | ||
document.terminal.cmd.scrollTop =document.terminal.cmd.scrollHeight; // _SKIPC_ | ||
//if (document.terminal.output.rows==1) { | ||
//document.terminal.output.style.height="2ex"; | ||
//} | ||
nchars=document.terminal.cmd.value.length; | ||
</script> | ||
<p>This live web terminal runs the <a href="http://www.pugscode.org">pugs</a> interpreter for <a | ||
href="http://dev.perl.org/perl6/">Perl 6</a>. Please <a | ||
href="http://feather.perl6.nl/~andara/runpugs/">read the documentation</a>. | ||
</p> | ||
<p class="copyright">© Copyright 2006 by Wim Vanderbauwhede</p> | ||
</div> | ||
</body> | ||
</html> |