Changeset 5375


Ignore:
Timestamp:
06/19/09 13:34:26 (3 years ago)
Author:
szabgab
Message:

make the list into radio buttons, allow the url loading, separate urls for freenode and irc.perl.org

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/padre.perlide.org/irc.html

    r5362 r5375  
    3131   perlfr:       {title:"Perl in French",         host:"irc.perl.org",     channel:"perlfr"}, 
    3232   poe:          {title:"POE",                    host:"irc.perl.org",     channel:"poe"},    
    33    rt:           {title:"POE",                    host:"irc.perl.org",     channel:"rt"}, 
     33   rt:           {title:"RT",                     host:"irc.perl.org",     channel:"rt"}, 
    3434   perl_help:    {title:"Perl Help",              host:"irc.perl.org",     channel:"perl-help"}, 
    3535   wxperl:       {title:"Perl Help",              host:"irc.perl.org",     channel:"wxperl"}, 
     
    3737}; 
    3838 
    39 function on_click(name) { 
    40     var url = 'http://widget.mibbit.com/?autoConnect=true'; 
    41     url += '&server=' + channels[name].host; 
    42     url += '&chanel=#' + channels[name].channel; 
    43     url += '&nick=' + document.forms.n.nickname.value; 
    44     alert(url); 
    45 } 
    4639 
    4740function get_values() { 
     
    6255} 
    6356 
     57function on_click() { 
     58 
     59    var name; 
     60    for (var i = 0; i < document.forms.n.channel.length; i++) { 
     61    if (document.forms.n.channel[i].checked) { 
     62        name = document.forms.n.channel[i].value; 
     63    } 
     64    } 
     65     
     66    var url; 
     67    if (channels[name].host == 'irc.freenode.net') { 
     68    url =  'http://webchat.freenode.net/?'; 
     69    url += 'channels=' + channels[name].channel; 
     70    url += '&nick=' + document.forms.n.nickname.value; 
     71    } else { 
     72    url = 'http://widget.mibbit.com/?autoConnect=true'; 
     73    url += '&server=' + channels[name].host; 
     74    url += '&chanel=#' + channels[name].channel; 
     75    url += '&nick=' + document.forms.n.nickname.value; 
     76    } 
     77    //alert(url); 
     78    window.location = url; 
     79} 
     80 
    6481</script> 
    6582<p> 
     
    6784</p> 
    6885<form name="n"> 
    69 Nickname: <input name="nickname" value=""> 
    70 </form> 
     86Nickname: <input name="nickname" value=""> <input type="button" OnClick="javascript:on_click()" value="Connect"> 
     87 
    7188 
    7289 
     
    7996   show the localized channels first ? 
    8097    
    81    if all the necessary input is available don't even show this page just redirec to  
     98   if all the necessary input is available don't even show this page just redirect to  
    8299   the mibbit service 
    83100 
     
    96113 
    97114for (var i in channels) { 
    98     document.write('<tr><td><a href="#" onClick="javascript:on_click(\'' + i + '\')">' + channels[i].title + '</a></td></tr>'); 
     115    document.write('<tr><td><input type="radio" name="channel" value="' + i + '">' + channels[i].title + '</td></tr>'); 
    99116} 
    100117</script> 
    101118</table> 
     119</form> 
    102120 
    103121</body> 
Note: See TracChangeset for help on using the changeset viewer.