Skip to content

Commit

Permalink
begining of options code
Browse files Browse the repository at this point in the history
lots of clean-ups in interfaces
  • Loading branch information
dgl committed Apr 15, 2002
1 parent d48df73 commit 6885201
Show file tree
Hide file tree
Showing 11 changed files with 141 additions and 73 deletions.
42 changes: 13 additions & 29 deletions TODO
@@ -1,44 +1,28 @@
TODO
----

IRC Module:
- use 005 numeric if possible (mode can use PREFIX and CHANMODES)
:www.polarhome.com 005 a SAFELIST SILENCE KNOCK IRCOPS WATCH=128 MODES=6 MAXCHANNELS=10 MAXBANS=60 MAXEXEMPTS=60 NICKLEN=30 TOPICLEN=307 CHANTYPES=#& CHANMODES=be,k,l,N PREFIX=(aohv)*@%+ NETWORK=BetaONE :are available on this server

Commands:
= commands that will call to interface: help

Interfaces:
- add three buttons to top bar: close (close current window), options and help
-! options stuff.
- configurable things : timestamps - fonts and so on...
- selecting colour in interfaces?

- write help
-? why does mozilla not tab complete with >1 char
- join sync stuff - userlist updating on join/quit/part/nick/mode/kick and join
- use css cursor: default to remove | char
-? <FUCEKISX> www.dynamicdrive.com :)
-? <KingSpence> i wish it had colour nicks ;)
- <FUCEKISX> dg: I'll give you code for making the scrollbars look all flat and nice
- /names, /say
-? smilies
- mirc color scheme
-? config file format?
- topic bar

- right click context menus
- pop-out/userlist needs to work in mozilla too
- dblclick == query in userlist.
= better handling of stream disconnections (also config option to go to page)
= close windows
- selecting colour in interfaces?
- configurable things : timestamps - fonts and so on...

nph-irc.cgi:
- config fonts
- config timestamps
- config vhost
bugs:
-? why does mozilla not tab complete with >1 char
- join sync stuff - userlist updating on join/quit/part/nick/mode/kick and join
- pop-out needs to work in mozilla too

Abuse:
- ctcp kill/ban
- limiting the number of connections to a server? (^^^ sock/server)
- admin interface?

Might be done one day:
- use 005 numeric if possible (mode can use PREFIX and CHANMODES)
:www.polarhome.com 005 a SAFELIST SILENCE KNOCK IRCOPS WATCH=128 MODES=6 MAXCHANNELS=10 MAXBANS=60 MAXEXEMPTS=60 NICKLEN=30 TOPICLEN=307 CHANTYPES=#& CHANMODES=be,k,l,N PREFIX=(aohv)*@%+ NETWORK=BetaONE :are available on this server
- config file format?
-? right click context menus
- <KingSpence> i wish it had colour nicks ;)
1 change: 1 addition & 0 deletions formats/default
Expand Up @@ -5,6 +5,7 @@ access denied = {prefix-client} Access Denied: $0
access server denied = {prefix-client} Access to that server is blocked
access channel denied = {prefix-client} Access to that channel is blocked
command denied = {prefix-client} Access to that command is blocked
session timeout = {prefix-client} Timeout - Your session has been inactive too long

command notparams = {prefix-client} Not enough parameters for command
command error = {prefix-client} Error running command
Expand Down
31 changes: 21 additions & 10 deletions interfaces/ie.pm
Expand Up @@ -26,12 +26,11 @@ my %colours = (
'15' => '#C0C0C0');

sub new {
my($class,$event, $timer, $config) = @_;
my($class,$event, $timer, $config, $icookies) = @_;
my $self = bless {}, $class;
my $tmp='';
for(keys %$config) {
next unless s/^interface //;
$tmp .= "$_: " . $config->{"interface $_"} . ', ';
for(keys %$icookies) {
$tmp .= "$_: " . _escapejs($icookies->{$_}) . ', ';
}
$tmp =~ s/, $//;
_out('parent.options = { ' . $tmp . '};');
Expand Down Expand Up @@ -142,6 +141,7 @@ sub line {
sub error {
my($self,$message) = @_;
$self->line({ target => 'Status'}, $message);
_func_out('disconnected');
}

sub add {
Expand Down Expand Up @@ -215,7 +215,14 @@ sub help {

sub uhelp {
print <<EOF;
THIS IS HELP - IT NEEDS DOING.
<html><head>
<title>CGI:IRC Help</title>
</head>
<body>
Work in progress.
</body>
</html>
EOF
}

Expand Down Expand Up @@ -274,6 +281,8 @@ function statushtml(status) {
return '<div class="userlist-op">@</div>';
}else if(status == "+") {
return '<div class="userlist-voice">+</div>';
}else if(status == "%") {
return '<div class="userlist-halfop">%</div>';
}else{
return '';
}
Expand All @@ -298,7 +307,7 @@ document.onselectstart = function() { return false; }
</div>
<form name="mform" onsubmit="return fsubmit(this)">
<form name="mform" onsubmit="return fsubmit(this)" class="userlist-form">
<input type="hidden" name="user">
<select name="action" class="userlist-select">
<option value="query">Query</option>
Expand Down Expand Up @@ -577,6 +586,7 @@ function channeladdusers(channel, users) {
for(var i = 0;i < users.length;i++) {
channeladduser(channel, users[i]);
}
userlist();
}
function channeladduser(channel, user) {
Expand All @@ -591,7 +601,6 @@ function channeladduser(channel, user) {
if(o == '@') Witems[channel].users[user].op = 1;
if(o == '%') Witems[channel].users[user].halfop = 1;
if(o == '+') Witems[channel].users[user].voice = 1;
userlist();
}
function channelsdeluser(channels, user) {
Expand Down Expand Up @@ -875,15 +884,17 @@ function do_quit() {
</head>
<body onload="wlistredraw()" onkeydown="formfocus()" onbeforeunload="do_quit()" onunload="do_quit()" class="wlist-body">
<noscript>Scripting is required for this interface</noscript>
<table class="wlist-table">
<tr><td width="1">
<iframe src="$config->{script_nph}?$string" width="1" height="1" style="display:none;" onreadystatechange="if(this.readyState=='complete')disconnected()"></iframe>
<table class="wlist-table">
<tr><td id="windowlist" class="wlist-container">
</td>
<td id="windowlist" class="wlist-container">
</td><td class="wlist-buttons">
<img src="$config->{image_path}/helpup.gif" onclick="sendcmd('/help');" class="wlist-button" onmousedown="this.src=imghelpdn.src" onmouseup="this.src=imghelpup.src;" onmouseout="this.src=imghelpup.src;">
<img src="$config->{image_path}/optionsup.gif" onclick="alert('Not yet done');" class="wlist-button" onmousedown="this.src=imgoptionsdn.src" onmouseup="this.src=imgoptionsup.src;" onmouseout="this.src=imgoptionsup.src;">
<img src="$config->{image_path}/closeup.gif" onclick="sendcmd('/winclose');" class="wlist-button" onmousedown="this.src=imgclosedn.src" onmouseup="this.src=imgcloseup.src;" onmouseout="this.src=imgcloseup.src;">
<img src="$config->{image_path}/closeup.gif" onclick="if(currentwindow != 'Status'){sendcmd('/winclose')}else if(confirm('Are you sure you want to quit?')){do_quit()}" class="wlist-button" onmousedown="this.src=imgclosedn.src" onmouseup="this.src=imgcloseup.src;" onmouseout="this.src=imgcloseup.src;">
</td></tr></table>
<form name="hsubmit" method="post" action="$config->{script_form}" target="hiddenframe">
Expand Down
30 changes: 19 additions & 11 deletions interfaces/make-js-interfaces.pl
Expand Up @@ -29,12 +29,11 @@
'15' => '#C0C0C0');

sub new {
my($class,$event, $timer, $config) = @_;
my($class,$event, $timer, $config, $icookies) = @_;
my $self = bless {}, $class;
my $tmp='';
for(keys %$config) {
next unless s/^interface //;
$tmp .= "$_: " . $config->{"interface $_"} . ', ';
for(keys %$icookies) {
$tmp .= "$_: " . _escapejs($icookies->{$_}) . ', ';
}
$tmp =~ s/, $//;
_out('parent.options = { ' . $tmp . '};');
Expand Down Expand Up @@ -140,13 +139,14 @@ sub line {
}
_func_out('witemaddtext', $target, $html . '<br>', $info->{activity} || 0);
`;
print " _out('<!-- padding -->');\n" if $browser eq 'mozilla';
print " print \"<!-- padding for mozilla -->\\n\";\n" if $browser eq 'mozilla';
print q`
}

sub error {
my($self,$message) = @_;
$self->line({ target => 'Status'}, $message);
_func_out('disconnected');
}

sub add {
Expand Down Expand Up @@ -220,7 +220,11 @@ sub help {

sub uhelp {
print <<EOF;
THIS IS HELP - IT NEEDS DOING.
`;
open(HELP, "../docs/help.html") or die($!);
print <HELP>;
close(HELP);
print q`
EOF
}

Expand Down Expand Up @@ -279,6 +283,8 @@ sub fuserlist {
return '<div class="userlist-op">@</div>';
}else if(status == "+") {
return '<div class="userlist-voice">+</div>';
}else if(status == "%") {
return '<div class="userlist-halfop">%</div>';
}else{
return '';
}
Expand Down Expand Up @@ -307,7 +313,7 @@ sub fuserlist {

</div>

<form name="mform" onsubmit="return fsubmit(this)">
<form name="mform" onsubmit="return fsubmit(this)" class="userlist-form">
<input type="hidden" name="user">
<select name="action" class="userlist-select">
<option value="query">Query</option>
Expand Down Expand Up @@ -615,6 +621,7 @@ sub fwindowlist {
for(var i = 0;i < users.length;i++) {
channeladduser(channel, users[i]);
}
userlist();
}

function channeladduser(channel, user) {
Expand All @@ -629,7 +636,6 @@ sub fwindowlist {
if(o == '@') Witems[channel].users[user].op = 1;
if(o == '%') Witems[channel].users[user].halfop = 1;
if(o == '+') Witems[channel].users[user].voice = 1;
userlist();
}

function channelsdeluser(channels, user) {
Expand Down Expand Up @@ -926,6 +932,8 @@ sub fwindowlist {
</head>
<body onload="wlistredraw()" onkeydown="formfocus()" onbeforeunload="do_quit()" onunload="do_quit()" class="wlist-body">
<noscript>Scripting is required for this interface</noscript>
<table class="wlist-table">
<tr><td width="1">
`;
if($browser eq 'ie'){
print q`
Expand All @@ -937,12 +945,12 @@ sub fwindowlist {
`;
}
print q`
<table class="wlist-table">
<tr><td id="windowlist" class="wlist-container">
</td>
<td id="windowlist" class="wlist-container">
</td><td class="wlist-buttons">
<img src="$config->{image_path}/helpup.gif" onclick="sendcmd('/help');" class="wlist-button" onmousedown="this.src=imghelpdn.src" onmouseup="this.src=imghelpup.src;" onmouseout="this.src=imghelpup.src;">
<img src="$config->{image_path}/optionsup.gif" onclick="alert('Not yet done');" class="wlist-button" onmousedown="this.src=imgoptionsdn.src" onmouseup="this.src=imgoptionsup.src;" onmouseout="this.src=imgoptionsup.src;">
<img src="$config->{image_path}/closeup.gif" onclick="sendcmd('/winclose');" class="wlist-button" onmousedown="this.src=imgclosedn.src" onmouseup="this.src=imgcloseup.src;" onmouseout="this.src=imgcloseup.src;">
<img src="$config->{image_path}/closeup.gif" onclick="if(currentwindow != 'Status'){sendcmd('/winclose')}else if(confirm('Are you sure you want to quit?')){do_quit()}" class="wlist-button" onmousedown="this.src=imgclosedn.src" onmouseup="this.src=imgcloseup.src;" onmouseout="this.src=imgcloseup.src;">
</td></tr></table>

<form name="hsubmit" method="post" action="$config->{script_form}" target="hiddenframe">
Expand Down
33 changes: 22 additions & 11 deletions interfaces/mozilla.pm
Expand Up @@ -26,12 +26,11 @@ my %colours = (
'15' => '#C0C0C0');

sub new {
my($class,$event, $timer, $config) = @_;
my($class,$event, $timer, $config, $icookies) = @_;
my $self = bless {}, $class;
my $tmp='';
for(keys %$config) {
next unless s/^interface //;
$tmp .= "$_: " . $config->{"interface $_"} . ', ';
for(keys %$icookies) {
$tmp .= "$_: " . _escapejs($icookies->{$_}) . ', ';
}
$tmp =~ s/, $//;
_out('parent.options = { ' . $tmp . '};');
Expand Down Expand Up @@ -136,13 +135,14 @@ sub line {
}
}
_func_out('witemaddtext', $target, $html . '<br>', $info->{activity} || 0);
_out('<!-- padding -->');
print "<!-- padding for mozilla -->\n";

}

sub error {
my($self,$message) = @_;
$self->line({ target => 'Status'}, $message);
_func_out('disconnected');
}

sub add {
Expand Down Expand Up @@ -216,7 +216,14 @@ sub help {

sub uhelp {
print <<EOF;
THIS IS HELP - IT NEEDS DOING.
<html><head>
<title>CGI:IRC Help</title>
</head>
<body>
Work in progress.
</body>
</html>
EOF
}

Expand Down Expand Up @@ -275,6 +282,8 @@ function statushtml(status) {
return '<div class="userlist-op">@</div>';
}else if(status == "+") {
return '<div class="userlist-voice">+</div>';
}else if(status == "%") {
return '<div class="userlist-halfop">%</div>';
}else{
return '';
}
Expand All @@ -297,7 +306,7 @@ function statushtml(status) {
</div>
<form name="mform" onsubmit="return fsubmit(this)">
<form name="mform" onsubmit="return fsubmit(this)" class="userlist-form">
<input type="hidden" name="user">
<select name="action" class="userlist-select">
<option value="query">Query</option>
Expand Down Expand Up @@ -557,6 +566,7 @@ function channeladdusers(channel, users) {
for(var i = 0;i < users.length;i++) {
channeladduser(channel, users[i]);
}
userlist();
}
function channeladduser(channel, user) {
Expand All @@ -571,7 +581,6 @@ function channeladduser(channel, user) {
if(o == '@') Witems[channel].users[user].op = 1;
if(o == '%') Witems[channel].users[user].halfop = 1;
if(o == '+') Witems[channel].users[user].voice = 1;
userlist();
}
function channelsdeluser(channels, user) {
Expand Down Expand Up @@ -855,15 +864,17 @@ function do_quit() {
</head>
<body onload="wlistredraw()" onkeydown="formfocus()" onbeforeunload="do_quit()" onunload="do_quit()" class="wlist-body">
<noscript>Scripting is required for this interface</noscript>
<table class="wlist-table">
<tr><td width="1">
<iframe src="$config->{script_nph}?$string" width="1" height="1"></iframe>
<table class="wlist-table">
<tr><td id="windowlist" class="wlist-container">
</td>
<td id="windowlist" class="wlist-container">
</td><td class="wlist-buttons">
<img src="$config->{image_path}/helpup.gif" onclick="sendcmd('/help');" class="wlist-button" onmousedown="this.src=imghelpdn.src" onmouseup="this.src=imghelpup.src;" onmouseout="this.src=imghelpup.src;">
<img src="$config->{image_path}/optionsup.gif" onclick="alert('Not yet done');" class="wlist-button" onmousedown="this.src=imgoptionsdn.src" onmouseup="this.src=imgoptionsup.src;" onmouseout="this.src=imgoptionsup.src;">
<img src="$config->{image_path}/closeup.gif" onclick="sendcmd('/winclose');" class="wlist-button" onmousedown="this.src=imgclosedn.src" onmouseup="this.src=imgcloseup.src;" onmouseout="this.src=imgcloseup.src;">
<img src="$config->{image_path}/closeup.gif" onclick="if(currentwindow != 'Status'){sendcmd('/winclose')}else if(confirm('Are you sure you want to quit?')){do_quit()}" class="wlist-button" onmousedown="this.src=imgclosedn.src" onmouseup="this.src=imgcloseup.src;" onmouseout="this.src=imgcloseup.src;">
</td></tr></table>
<form name="hsubmit" method="post" action="$config->{script_form}" target="hiddenframe">
Expand Down
6 changes: 3 additions & 3 deletions interfaces/nonjs.pm
Expand Up @@ -14,12 +14,12 @@ use default;
@ISA = qw/default/;

sub new {
my($class,$event,$timer, $config) = @_;
my($class,$event,$timer, $config, $icookies) = @_;
my $self = bless {}, $class;
$timer->addforever(code => \&todo, data => $self, interval => 10);
$self->{':_timestamp'} = 0;
$self->{':_timestamp'}++ if exists $config->{'interface timestamp'} &&
$config->{'interface timestamp'};
$self->{':_timestamp'}++ if exists $icookies->{timestamp} &&
$icookies->{timestamp};
return $self;
}

Expand Down

0 comments on commit 6885201

Please sign in to comment.