Changeset 18081 for misc/runpugs

Show
Ignore:
Timestamp:
09/21/07 22:04:23 (14 months ago)
Author:
azawawi
Message:

[runpugs] fixed input focus bug that causes typing problems and form re-submission on space
[runpugs] added w3c valid css icon/code
[runpugs] fixed ui problems across IE7,FF2,Opera9.2+

Location:
misc/runpugs/htdocs
Files:
4 modified

Legend:

Unmodified
Added
Removed
  • misc/runpugs/htdocs/runpugs.css

    r18075 r18081  
    22        font:13px arial,helvetica,clean,sans-serif; 
    33        width:100%; 
    4         margin-left:10%;margin-right:10%; margin-top: 0px;  
     4        margin-left:10%;margin-right:0%; margin-top: 0px;  
    55        line-height: normal;  
    66} 
     
    1212    color: white; 
    1313    background-color: #204a87; 
    14         margin: 5px; 
    15     padding: 5px; 
     14        margin: 0px; 
     15    padding: 0px; 
    1616        text-align: center; 
    1717} 
     
    2222FIELDSET {border: solid white 0px} 
    2323LEGEND {font-weight:normal; text-align: left; } 
    24 SELECT {font:13px arial,helvetica,clean,sans-serif;} 
     24SELECT {font:12px arial,helvetica,clean,sans-serif;} 
    2525.copyright {font:13px arial,helvetica,clean,sans-serif;} 
    2626.tabon { 
  • misc/runpugs/htdocs/runpugs/index.html

    r17899 r18081  
    1515                Run Perl 6 now -- in your browser! 
    1616            </h1> 
    17                 <strong>Color schema:</strong> 
    18                 <select id="theme"> 
    19                     <option value="wb_theme" selected="selected">White &amp; 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>&nbsp;&nbsp; 
    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">&nbsp;White&nbsp;</option> 
     21                        <option value="gb_theme">&nbsp;Green&nbsp;</option> 
     22                        <option value="ab_theme">&nbsp;Amber&nbsp;</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>&nbsp;&nbsp; 
     30                    <input id="dev" value="1" name="reldev" type="radio" onClick="set_version()"/> 
     31                    <label for="dev"><strong>Development version</strong></label> 
     32                </div> 
    3133                <div id="termwindow"> 
    3234                    <textarea id="cmd" name="cmd" rows="3" cols="80">Please wait while Pugs  
     
    6769            </form> 
    6870        </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> 
    7476        <div id="hidden_iframe"></div> 
    7577        <!-- 
  • 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=="")?"&nbsp;":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'>&nbsp;</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'>&nbsp;</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,"&amp;").replace(/ /g,"&nbsp;").replace(/</g,"&lt;").replace(/>/g,"&gt;").replace(/"/g,"&quot;");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")} 
     1var 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=="")?"&nbsp;":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'>&nbsp;</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'>&nbsp;</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,"&amp;").replace(/ /g,"&nbsp;").replace(/</g,"&lt;").replace(/>/g,"&gt;").replace(/"/g,"&quot;");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  
    296296    sessionid=scratchpad.terminal.sessionid.value; 
    297297    document.terminal.cmd.value=reply; 
     298 
     299    //$("#toolbar").slideDown(2000); 
    298300     
    299301    if(scratchpad.terminal.prompt) { 
     
    360362    frames['scratch'].document.terminal.submit(); 
    361363 
     364    $("#rel").blur(); 
     365    $("#dev").blur(); 
    362366    focusOnCmd("#tt"); 
    363367}