Changeset 18095 for misc/runpugs
- Timestamp:
- 09/22/07 11:27:13 (14 months ago)
- Location:
- misc/runpugs/htdocs
- Files:
-
- 3 modified
-
runpugs.css (modified) (4 diffs)
-
runpugs/index.html (modified) (2 diffs)
-
runpugs/runpugs.js (modified) (4 diffs)
Legend:
- Unmodified
- Added
- Removed
-
misc/runpugs/htdocs/runpugs.css
r18081 r18095 1 1 body { 2 2 font:13px arial,helvetica,clean,sans-serif; 3 width: 100%;4 margin-left:10%;margin-right:0%; margin-top: 0px; 3 width:85%; 4 margin-left:10%;margin-right:0%; margin-top: 0px; 5 5 line-height: normal; 6 6 } … … 13 13 background-color: #204a87; 14 14 margin: 0px; 15 padding: 0px;15 padding: 2px; 16 16 text-align: center; 17 17 } 18 H2 { font-weight: bold; font-size: 11pt }18 H2 { font-weight: bold; font-size: 11pt; margin: 0px; padding: 0px;} 19 19 EM { font-weight: bold; font-style: normal; text-decoration:none;} 20 code { 21 font-family: 'Courier New', Monaco, Courier, monospace; 22 background-color: black; 23 color: white; 24 } 20 25 TT {color: #204a87; font-weight: bold; } 21 26 LABEL {font-weight: normal; } … … 116 121 } 117 122 pre { 123 background-color: black; 118 124 color: white; 119 background-color: transparent;120 125 margin: 0; 121 padding: 0;126 padding: 5px; 122 127 border: none; 123 display:inline;124 128 } 125 129 pre.wb_theme { … … 146 150 border: none; 147 151 display:inline; 148 }149 .note {150 font:13px arial,helvetica,clean,sans-serif;151 border-style: solid;152 border-width: 1px;153 border-color: #F0C000;154 background-color: #FFFFCE;155 152 } 156 153 span.cursorOn { -
misc/runpugs/htdocs/runpugs/index.html
r18081 r18095 26 26 <input name="ia" value="1" type="hidden"/> 27 27 <input name="action" value="runpugs" type="hidden"/> 28 <input id="rel" value="1" name="reldev" type="radio" checked="checked" on Click="set_version()"/>28 <input id="rel" value="1" name="reldev" type="radio" checked="checked" onclick="set_version()"/> 29 29 <label for="rel"><strong>Release version</strong></label> 30 <input id="dev" value="1" name="reldev" type="radio" on Click="set_version()"/>30 <input id="dev" value="1" name="reldev" type="radio" onclick="set_version()"/> 31 31 <label for="dev"><strong>Development version</strong></label> 32 32 </div> … … 41 41 </div> 42 42 <div id='status'></div> 43 <div class='note' style='padding: 5px;'> 44 This live web terminal runs the <a href="http://www.pugscode.org/">Pugs</a> 45 interpreter for <a href="http://dev.perl.org/perl6/">Perl 6</a>. 46 This is the development version, featuring asynchronous jQuery AJAX, 47 mod_perl and preloaded pugs sessions. 48 <h2>Instructions</h2> 49 <code>runpugs</code> presents the pugs interactive shell. <code>runpugs</code>-specific commands: 50 <dl> 51 <dt><code>help</code></dt><dd> displays the Pugs shell help (same as 52 <code>:h</code>)</dd> 53 <dt><code>clear</code></dt><dd>clears the web terminal (this command is not sent to the 54 pugs shell).</dd> 55 <dt><code>quit</code>, <code>bye</code></dt><dd>quit the Pugs session (same as 56 <code>:q</code>)</dd> 57 </dl> 58 <p>Please be considerate and do <em>quit</em> your 59 pugs session before you close the browser window. 60 </p> 61 <h2>Restrictions</h2> 62 Because this is a web terminal, a number of restrictions apply. 63 Please <a href="http://feather.perl6.nl/%7Eandara/runpugs/">read the documentation</a> for more information. 64 <br/><br/> 65 <div class="copyright">© Copyright 2006 by Wim.Vanderbauwhede. Contact me @ gmail.com<br/> 66 Enhanced web terminal by Ahmad.Zawawi. Contact me @ gmail.com 67 </div> 68 </div> 43 <!-- info text will get loaded in $.onReady() --> 44 <div id='info' style='padding: 3px;'></div> 69 45 </form> 70 46 </div> 71 <br/> 47 <div class="copyright">© Copyright 2006 by Wim.Vanderbauwhede. Contact me @ gmail.com<br/> 48 Enhanced web terminal by Ahmad.Zawawi. Contact me @ gmail.com 49 </div> 72 50 <a href="http://validator.w3.org/check?uri=referer"><img src="http://www.w3.org/Icons/valid-xhtml10" 73 51 alt="Valid XHTML 1.0!" height="31" width="88" border="0" /></a> 74 52 <a href="http://jigsaw.w3.org/css-validator/check/referer"><img src="http://jigsaw.w3.org/css-validator/images/vcss" 75 53 alt="Valid CSS!" height="31" width="88" border="0"/></a> 54 <!-- hidden iframe is now inserted $(document).ready() --> 76 55 <div id="hidden_iframe"></div> 77 <!--78 //This is now inserted automatically by jQuery to start loading things after $(document).ready()79 <iframe src="/perl/runpugs.pl" id="scratch" name="scratch" style="visibility:hidden"80 width="700px" height="1px" onLoad="getreply()"></iframe>81 -->82 56 </body> 83 57 </html> -
misc/runpugs/htdocs/runpugs/runpugs.js
r18081 r18095 13 13 var fixedCharWidth; 14 14 15 //for tutorials & school ;-) 16 var tutorialMode = 0; 17 var slide = 0; 18 var slides = new Array( 19 'default_info.html', 20 'tutorial/01_helloworld.html', 21 'tutorial/02_vars.html', 22 'tutorial/03_iteration_array.html', 23 'tutorial/04_iteration_hash.html', 24 'tutorial/05_iteration_many.html', 25 'tutorial/06_conditionals.html', 26 'tutorial/07_junctions.html', 27 'tutorial/08_junctions_array.html', 28 'tutorial/09_chained_comparison.html', 29 'tutorial/10_io.html', 30 'tutorial/11_io_iteration.html', 31 'tutorial/12_io_reading.html', 32 'tutorial/13_lists_reduction.html', 33 'tutorial/14_lists_hyper.html', 34 'tutorial/15_lists_cross.html', 35 'tutorial/16_grammar.html', 36 'tutorial/17_final.html' 37 ); 38 39 15 40 //show the cursor 16 41 function showCursor() { … … 95 120 }); 96 121 122 //load default text into element id 'info' 123 loadSlide(); 124 97 125 //start loading pugs session after page has loaded... 98 126 $("#hidden_iframe").append( … … 102 130 }); 103 131 132 //load a slide into #info with an slideup/slidedown effect 133 function loadSlide() { 134 if(debug) { 135 alert("slide url to be loaded = '" + slides[slide] + "'"); 136 } 137 $("#info").slideUp("fast"); 138 $.ajax({ 139 url: slides[slide], 140 async: true, 141 success: function(data) { 142 if(debug) { 143 alert("slide data received: " + data); 144 } 145 $("#info").html(data); 146 $("#info").slideDown("slow"); 147 } 148 }); 149 } 150 104 151 //insert character 'ch' at index 'pos' in string str 105 152 //and return the result … … 133 180 var tmpCmds=sessCmds.split(prompt); 134 181 var tmpCmd=tmpCmds[tmpCmds.length-1]; 135 if($.trim(tmpCmd) != "") { 182 var trimTmpCmd = $.trim(tmpCmd); 183 if(trimTmpCmd != "") { 136 184 histlist.push(tmpCmd); 137 185 } 138 186 187 //for tutorial, back, next support 188 if(trimTmpCmd == ":tutorial") { 189 tutorialMode = !tutorialMode; 190 slide = (tutorialMode) ? 1 : 0; 191 loadSlide(); 192 } 193 if(trimTmpCmd == ":back" || trimTmpCmd == ":next") { 194 if(tutorialMode) { 195 if(trimTmpCmd == ":back") { 196 slide--; 197 if(slide < 1) { 198 slide = 1; 199 } 200 loadSlide(slide); 201 } else { 202 //next command 203 slide++; 204 if(slide >= slides.length) { 205 slide--; 206 } 207 loadSlide(slide); 208 } 209 } 210 } 139 211 if(debug) { 140 212 alert("data to be sent: " + sessCmds);
