Changeset 17890 for misc/runpugs

Show
Ignore:
Timestamp:
09/17/07 19:38:01 (14 months ago)
Author:
azawawi
Message:

[runpugs] show "Please wait" message now works on FF2,IE7,Opera
[runpugs] hidden iframe is loaded after document is ready (faster page load)

Location:
misc/runpugs/htdocs/runpugs
Files:
2 modified

Legend:

Unmodified
Added
Removed
  • misc/runpugs/htdocs/runpugs/index.html

    r17884 r17890  
    6060                    Because this is a web terminal, a number of restrictions apply.  
    6161                    Please <a href="http://feather.perl6.nl/%7Eandara/runpugs/">read the documentation</a> for more information. 
    62                     <br/> 
     62                    <div class="copyright">&copy; Copyright 2006 by Wim.Vanderbauwhede. Contact me @ gmail.com<br/> 
     63                        Enhanced web terminal by Ahmad.Zawawi. Contact me @ gmail.com 
     64                    </div> 
    6365                </div> 
    6466            </form> 
    6567        </div> 
    66         <span class="copyright">&copy; Copyright 2006 by Wim.Vanderbauwhede. Contact me @ gmail.com<br/> 
    67             Enhanced web terminal by Ahmad.Zawawi. Contact me @ gmail.com 
    68         </span> 
    6968        <hr/> 
    7069        <a href="http://validator.w3.org/check?uri=referer"> 
     
    7271                alt="Valid XHTML 1.0!" height="31" width="88" border="0" /> 
    7372        </a>         
     73        <div id="hidden_iframe"></div> 
     74        <!-- 
     75        //This is now inserted automatically by jQuery to start loading things after $(document).ready() 
    7476        <iframe src="/perl/runpugs.pl" id="scratch" name="scratch" style="visibility:hidden"  
    7577        width="700px" height="1px" onLoad="getreply()"></iframe> 
     78        --> 
    7679    </body> 
    7780</html> 
  • misc/runpugs/htdocs/runpugs/runpugs.js

    r17884 r17890  
    11var histlist=new Array(); 
    22var histentry=0; 
    3 var reply=""; 
    43var sessionid=0; 
    54var reldev=0; 
     
    2827} 
    2928 
    30 //show command 
     29//show last command on console 
    3130function showCmd() { 
    3231    var cmdEl = "#c" + (cmds.length - 1); 
     
    3635//update the console 
    3736function updateConsole() { 
    38     $("#tt").empty(); 
    3937    $.each(cmds,function(i,n) { 
     38        if(i == 0) { 
     39            //clear only on first usage... 
     40            $("#tt").empty(); 
     41        } 
    4042        var l = (n == "") ? "&nbsp;" : n; 
    4143        var tr = "<tr><td><pre id='c" + i +  
     
    5355//wait for when the document is ready 
    5456$(document).ready( function() { 
    55  
    5657    //display waiting msg and try to calculate width of  
    5758    //a single fixed character... 
     
    7273 
    7374    //repaint & start showing the cursor... 
    74     updateConsole(); 
    7575    showCursor(); 
    7676 
     
    9393    }); 
    9494 
     95    //start loading pugs session after page has loaded... 
     96    $("#hidden_iframe").append( 
     97        'im there!<iframe src="/perl/runpugs.pl" id="scratch" name="scratch" ' + 
     98        'style="visibility:hidden" width="700px" height="1px" ' + 
     99        'onLoad="getreply()"></iframe>'); 
    95100}); 
    96101 
    97102//insert character 'ch' at index 'pos' in string str  
    98 //and return it 
     103//and return the result 
    99104function insert(str,ch,pos) { 
    100105    var s = str.substring(0,pos); 
     
    103108} 
    104109 
     110//focus on last command very hard ;-) 
    105111function focusOnCmd(e) { 
    106112    $(e).focus(); 
     
    187193    } else if(keyCode == 46) { 
    188194        //del 
    189         if(curpos >= 0){// && curpos <= cmd.length+1) { 
     195        if(curpos >= 0){ 
    190196            var newCmd = ""; 
    191197            for(var i = 0; i < cmd.length; i++) { 
     
    195201            } 
    196202            cmd = newCmd; 
    197             //if(curpos > cmd.length) { 
    198               //  curpos = cmd.length+1; 
    199             //} 
    200203            showCmd(); 
    201204            moveCursor(); 
     
    243246function getreply () { 
    244247    scratchpad=frames['scratch'].document; 
    245     reply=scratchpad.getElementById("cmd").value; 
     248    var reply=scratchpad.getElementById("cmd").value; 
    246249    histentry=histlist.length; 
    247250    sessionid=scratchpad.terminal.sessionid.value;