Changeset 18081 for misc/runpugs
- Timestamp:
- 09/21/07 22:04:23 (14 months ago)
- Location:
- misc/runpugs/htdocs
- Files:
-
- 4 modified
-
runpugs.css (modified) (3 diffs)
-
runpugs/index.html (modified) (2 diffs)
-
runpugs/runpugs-min.js (modified) (1 diff)
-
runpugs/runpugs.js (modified) (2 diffs)
Legend:
- Unmodified
- Added
- Removed
-
misc/runpugs/htdocs/runpugs.css
r18075 r18081 2 2 font:13px arial,helvetica,clean,sans-serif; 3 3 width:100%; 4 margin-left:10%;margin-right: 10%; margin-top: 0px;4 margin-left:10%;margin-right:0%; margin-top: 0px; 5 5 line-height: normal; 6 6 } … … 12 12 color: white; 13 13 background-color: #204a87; 14 margin: 5px;15 padding: 5px;14 margin: 0px; 15 padding: 0px; 16 16 text-align: center; 17 17 } … … 22 22 FIELDSET {border: solid white 0px} 23 23 LEGEND {font-weight:normal; text-align: left; } 24 SELECT {font:1 3px arial,helvetica,clean,sans-serif;}24 SELECT {font:12px arial,helvetica,clean,sans-serif;} 25 25 .copyright {font:13px arial,helvetica,clean,sans-serif;} 26 26 .tabon { -
misc/runpugs/htdocs/runpugs/index.html
r17899 r18081 15 15 Run Perl 6 now -- in your browser! 16 16 </h1> 17 <strong>Color schema:</strong> 18 <select id="theme"> 19 <option value="wb_theme" selected="selected">White & black</option> 20 <option value="gb_theme">Green</option> 21 <option value="ab_theme">Amber</option> 22 </select> 23 <input name="prompt" value=" " type="hidden"/> 24 <input name="sessionid" value="" type="hidden"/> 25 <input name="ia" value="1" type="hidden"/> 26 <input name="action" value="runpugs" type="hidden"/> 27 <input id="rel" value="1" name="reldev" type="radio" checked="checked" onClick="set_version()"/> 28 <label for="rel"><strong>Release version</strong></label> 29 <input id="dev" value="1" name="reldev" type="radio" onClick="set_version()"/> 30 <label for="dev"><strong>Development version</strong></label> 17 <div id="toolbar"> 18 <strong>Text color:</strong> 19 <select id="theme"> 20 <option value="wb_theme" selected="selected"> White </option> 21 <option value="gb_theme"> Green </option> 22 <option value="ab_theme"> Amber </option> 23 </select> 24 <input name="prompt" value=" " type="hidden"/> 25 <input name="sessionid" value="" type="hidden"/> 26 <input name="ia" value="1" type="hidden"/> 27 <input name="action" value="runpugs" type="hidden"/> 28 <input id="rel" value="1" name="reldev" type="radio" checked="checked" onClick="set_version()"/> 29 <label for="rel"><strong>Release version</strong></label> 30 <input id="dev" value="1" name="reldev" type="radio" onClick="set_version()"/> 31 <label for="dev"><strong>Development version</strong></label> 32 </div> 31 33 <div id="termwindow"> 32 34 <textarea id="cmd" name="cmd" rows="3" cols="80">Please wait while Pugs … … 67 69 </form> 68 70 </div> 69 < hr/>70 <a href="http://validator.w3.org/check?uri=referer"> 71 <img src="http://www.w3.org/Icons/valid-xhtml10"72 alt="Valid XHTML 1.0!" height="31" width="88" border="0" />73 </a>71 <br/> 72 <a href="http://validator.w3.org/check?uri=referer"><img src="http://www.w3.org/Icons/valid-xhtml10" 73 alt="Valid XHTML 1.0!" height="31" width="88" border="0" /></a> 74 <a href="http://jigsaw.w3.org/css-validator/check/referer"><img src="http://jigsaw.w3.org/css-validator/images/vcss" 75 alt="Valid CSS!" height="31" width="88" border="0"/></a> 74 76 <div id="hidden_iframe"></div> 75 77 <!-- -
misc/runpugs/htdocs/runpugs/runpugs-min.js
r18048 r18081 1 var debug=0;var histlist=new Array();var histentry=0;var sessionid=0;var reldev=0;var curpos=0;var cmd="";var prompt="pugs> ";var cmds=new Array();var theme="wb_theme";var fixedCharWidth;function showCursor(){var A=cmds.length;var B=(A==0)?"#d0":"#d"+(A-1);$(B).toggleClass("cursorOff");$(B).toggleClass("cursorOn");setTimeout("showCursor()",1000)}function moveCursor(){var B=-(cmd.length-curpos)*fixedCharWidth;var A="#d"+(cmds.length-1);$(A).css("left",B+"px")}function showCmd(){var A="#c"+(cmds.length-1);$(A).text(prompt+cmd)}function updateConsole(){$.each(cmds,function(C,E){if(C==0){$("#tt").empty()}var B=(E=="")?" ":E;var D="<tr><td><pre id='c"+C+"' class='"+theme+"'>"+B+"</pre>";if(C==cmds.length-1){D+="<span id='d"+C+"' class='cursorOff'> </span>"}$("#tt").append(D+"</td></tr>")});var A=$("#termwin")[0].scrollHeight;$("#termwin").animate({scrollTop:A},"fast")}$(document).ready(function(){var A="Please wait while Pugs starts up...";$("#tt").empty();$("#tt").append("<tr><td><pre id='c0' class='wb_theme'>"+A+"</pre><span id='d0' class='cursorOff'> </span></td></tr>");fixedCharWidth=($("#c0")[0])?$("#c0")[0].offsetWidth/A.length:8;$("#theme").change(function(){$("pre").toggleClass(theme);theme=$("#theme").val();$("pre").toggleClass(theme)});$("#logo").slideDown(2000);showCursor();$(document).keydown(function(B){return onKeyDown(B)});$(document).keypress(function(B){return onKeyPress(B)});$(window).unload(function(){$.ajax({url:"/perl/runpugs.pl?sessionid="+sessionid+"&reldev=1&ia=1&cmd=%3Aq",async:true})});$("#hidden_iframe").append("<iframe src=\"/perl/runpugs.pl\" id=\"scratch\" name=\"scratch\" style=\"visibility:hidden\" width=\"700px\" height=\"1px\" onLoad=\"getreply()\"></iframe>")});function insert(D,C,E){var B=D.substring(0,E);var A=D.substring(E,D.length);return B+C+A}function focusOnCmd(B){$(B).focus();var A=$("#termwin")[0].scrollHeight;$("#termwin").animate({scrollTop:A},"fast")}function onKeyDown(D){if(D.ctrlKey||D.altKey||D.shiftKey){return true}var E=D.keyCode;focusOnCmd("#status");if(E==13){var B=document.terminal.cmd.value+cmd;var G=B.split(prompt);var F=G[G.length-1];if($.trim(F)!=""){histlist.push(F)}if(debug){alert("data to be sent: "+B)}frames["scratch"].document.getElementById("cmd").value=B;frames["scratch"].document.terminal.submit();cmd="";return false}else{if(E==8){if(curpos>0){curpos-=1;var A="";for(var C=0;C<cmd.length;C++){if(C!=curpos){A+=cmd.charAt(C)}}cmd=A;showCmd();debugKeys()}return false}else{if(E==38){hist_next();return false}else{if(E==40){hist_prev();return false}else{if(E==37){if(curpos>0){curpos--;moveCursor()}return false}else{if(E==39){if(curpos<cmd.length){curpos++;moveCursor()}return false}else{if(E==36){curpos=0;moveCursor();return false}else{if(E==35){curpos=cmd.length;moveCursor();return false}else{if(E==46){if(curpos>=0){var A="";for(var C=0;C<cmd.length;C++){if(C!=curpos){A+=cmd.charAt(C)}}cmd=A;showCmd();moveCursor();debugKeys()}return false}}}}}}}}}return true}function toAscii(C){var D="abcdefghijklmnopqrstuvwxyz";var B=" !\"#$%&'()*+'-./0123456789:;<=>?@"+D.toUpperCase()+"[\\]^_`"+D+"{|}~";var E=B.indexOf(C);var A=(E>-1)?(32+E):0;return A}function onKeyPress(B){if(B.ctrlKey||B.altKey){return }var C=B.keyCode;focusOnCmd("#status");if($.browser.msie||$.browser.opera||$.browser.safari){var A=String.fromCharCode(C);if(A>=" "){if(($.browser.opera&&(C<35||C>40))||$.browser.msie||$.browser.safari){cmd=insert(cmd,A,curpos);showCmd();curpos++;debugKeys(A)}}return false}else{if($.browser.mozilla&&C==0){var A=String.fromCharCode(B.charCode?B.charCode:B.keyCode);if(A>=" "){cmd=insert(cmd,A,curpos);showCmd();curpos++;debugKeys(A)}return false}}return true}function debugKeys(C){if(debug){var A="";for(var B=0;B<cmd.length;B++){var D=toAscii(cmd.charAt(B));A+=D+","}$("#status").text(((C)?("key = '"+C):"")+"', cmd = '"+cmd+"', cmd.length="+cmd.length+", ascii=("+A+")")}}function getreply(){scratchpad=frames["scratch"].document;var B=scratchpad.getElementById("cmd").value;histentry=histlist.length;sessionid=scratchpad.terminal.sessionid.value;document.terminal.cmd.value=B;if(scratchpad.terminal.prompt){var C=scratchpad.terminal.prompt.value;if(C&&C.length=="pugs> ".length){prompt=C}}var A=B.replace(/&/g,"&").replace(/ /g," ").replace(/</g,"<").replace(/>/g,">").replace(/"/g,""");cmds=A.split(/\r\n|\n|\r/g);if(debug){alert("reply (unescaped): "+B)}updateConsole();cmd="";curpos=0;showCmd()}function hist_next(){if(histentry>=1){histentry--;cmd=histlist[histentry];curpos=cmd.length;showCmd();moveCursor()}return false}function hist_prev(){if(histentry<histlist.length-1){histentry++;cmd=histlist[histentry];curpos=cmd.length;showCmd();moveCursor()}}function set_version(){var A=document.terminal.reldev[0].checked;if(A==true){frames["scratch"].document.terminal.reldev[0].checked=true;frames["scratch"].document.terminal.reldev[1].checked=false}else{frames["scratch"].document.terminal.reldev[0].checked=false;frames["scratch"].document.terminal.reldev[1].checked=true}frames["scratch"].document.terminal.submit(); focusOnCmd("#tt")}1 var debug=0;var histlist=new Array();var histentry=0;var sessionid=0;var reldev=0;var curpos=0;var cmd="";var prompt="pugs> ";var cmds=new Array();var theme="wb_theme";var fixedCharWidth;function showCursor(){var A=cmds.length;var B=(A==0)?"#d0":"#d"+(A-1);$(B).toggleClass("cursorOff");$(B).toggleClass("cursorOn");setTimeout("showCursor()",1000)}function moveCursor(){var B=-(cmd.length-curpos)*fixedCharWidth;var A="#d"+(cmds.length-1);$(A).css("left",B+"px")}function showCmd(){var A="#c"+(cmds.length-1);$(A).text(prompt+cmd)}function updateConsole(){$.each(cmds,function(C,E){if(C==0){$("#tt").empty()}var B=(E=="")?" ":E;var D="<tr><td><pre id='c"+C+"' class='"+theme+"'>"+B+"</pre>";if(C==cmds.length-1){D+="<span id='d"+C+"' class='cursorOff'> </span>"}$("#tt").append(D+"</td></tr>")});var A=$("#termwin")[0].scrollHeight;$("#termwin").animate({scrollTop:A},"fast")}$(document).ready(function(){var A="Please wait while Pugs starts up...";$("#tt").empty();$("#tt").append("<tr><td><pre id='c0' class='wb_theme'>"+A+"</pre><span id='d0' class='cursorOff'> </span></td></tr>");fixedCharWidth=($("#c0")[0])?$("#c0")[0].offsetWidth/A.length:8;$("#theme").change(function(){$("pre").toggleClass(theme);theme=$("#theme").val();$("pre").toggleClass(theme)});$("#logo").slideDown(2000);showCursor();$(document).keydown(function(B){return onKeyDown(B)});$(document).keypress(function(B){return onKeyPress(B)});$(window).unload(function(){$.ajax({url:"/perl/runpugs.pl?sessionid="+sessionid+"&reldev=1&ia=1&cmd=%3Aq",async:true})});$("#hidden_iframe").append("<iframe src=\"/perl/runpugs.pl\" id=\"scratch\" name=\"scratch\" style=\"visibility:hidden\" width=\"700px\" height=\"1px\" onLoad=\"getreply()\"></iframe>")});function insert(D,C,E){var B=D.substring(0,E);var A=D.substring(E,D.length);return B+C+A}function focusOnCmd(B){$(B).focus();var A=$("#termwin")[0].scrollHeight;$("#termwin").animate({scrollTop:A},"fast")}function onKeyDown(D){if(D.ctrlKey||D.altKey||D.shiftKey){return true}var E=D.keyCode;focusOnCmd("#status");if(E==13){var B=document.terminal.cmd.value+cmd;var G=B.split(prompt);var F=G[G.length-1];if($.trim(F)!=""){histlist.push(F)}if(debug){alert("data to be sent: "+B)}frames["scratch"].document.getElementById("cmd").value=B;frames["scratch"].document.terminal.submit();cmd="";return false}else{if(E==8){if(curpos>0){curpos-=1;var A="";for(var C=0;C<cmd.length;C++){if(C!=curpos){A+=cmd.charAt(C)}}cmd=A;showCmd();debugKeys()}return false}else{if(E==38){hist_next();return false}else{if(E==40){hist_prev();return false}else{if(E==37){if(curpos>0){curpos--;moveCursor()}return false}else{if(E==39){if(curpos<cmd.length){curpos++;moveCursor()}return false}else{if(E==36){curpos=0;moveCursor();return false}else{if(E==35){curpos=cmd.length;moveCursor();return false}else{if(E==46){if(curpos>=0){var A="";for(var C=0;C<cmd.length;C++){if(C!=curpos){A+=cmd.charAt(C)}}cmd=A;showCmd();moveCursor();debugKeys()}return false}}}}}}}}}return true}function toAscii(C){var D="abcdefghijklmnopqrstuvwxyz";var B=" !\"#$%&'()*+'-./0123456789:;<=>?@"+D.toUpperCase()+"[\\]^_`"+D+"{|}~";var E=B.indexOf(C);var A=(E>-1)?(32+E):0;return A}function onKeyPress(B){if(B.ctrlKey||B.altKey){return }var C=B.keyCode;focusOnCmd("#status");if($.browser.msie||$.browser.opera||$.browser.safari){var A=String.fromCharCode(C);if(A>=" "){if(($.browser.opera&&(C<35||C>40))||$.browser.msie||$.browser.safari){cmd=insert(cmd,A,curpos);showCmd();curpos++;debugKeys(A)}}return false}else{if($.browser.mozilla&&C==0){var A=String.fromCharCode(B.charCode?B.charCode:B.keyCode);if(A>=" "){cmd=insert(cmd,A,curpos);showCmd();curpos++;debugKeys(A)}return false}}return true}function debugKeys(C){if(debug){var A="";for(var B=0;B<cmd.length;B++){var D=toAscii(cmd.charAt(B));A+=D+","}$("#status").text(((C)?("key = '"+C):"")+"', cmd = '"+cmd+"', cmd.length="+cmd.length+", ascii=("+A+")")}}function getreply(){scratchpad=frames["scratch"].document;var B=scratchpad.getElementById("cmd").value;histentry=histlist.length;sessionid=scratchpad.terminal.sessionid.value;document.terminal.cmd.value=B;if(scratchpad.terminal.prompt){var C=scratchpad.terminal.prompt.value;if(C&&C.length=="pugs> ".length){prompt=C}}var A=B.replace(/&/g,"&").replace(/ /g," ").replace(/</g,"<").replace(/>/g,">").replace(/"/g,""");cmds=A.split(/\r\n|\n|\r/g);if(debug){alert("reply (unescaped): "+B)}updateConsole();cmd="";curpos=0;showCmd()}function hist_next(){if(histentry>=1){histentry--;cmd=histlist[histentry];curpos=cmd.length;showCmd();moveCursor()}return false}function hist_prev(){if(histentry<histlist.length-1){histentry++;cmd=histlist[histentry];curpos=cmd.length;showCmd();moveCursor()}}function set_version(){var A=document.terminal.reldev[0].checked;if(A==true){frames["scratch"].document.terminal.reldev[0].checked=true;frames["scratch"].document.terminal.reldev[1].checked=false}else{frames["scratch"].document.terminal.reldev[0].checked=false;frames["scratch"].document.terminal.reldev[1].checked=true}frames["scratch"].document.terminal.submit();$("#rel").blur();$("#dev").blur();focusOnCmd("#tt")} -
misc/runpugs/htdocs/runpugs/runpugs.js
r17912 r18081 296 296 sessionid=scratchpad.terminal.sessionid.value; 297 297 document.terminal.cmd.value=reply; 298 299 //$("#toolbar").slideDown(2000); 298 300 299 301 if(scratchpad.terminal.prompt) { … … 360 362 frames['scratch'].document.terminal.submit(); 361 363 364 $("#rel").blur(); 365 $("#dev").blur(); 362 366 focusOnCmd("#tt"); 363 367 }
