Skip to content

Commit

Permalink
bump. autojoin working through text commands fully. need to make IO h…
Browse files Browse the repository at this point in the history
…appen properly. Also need to make a UI for it in Chatterbox. #87
  • Loading branch information
Henry Rapley committed Nov 6, 2013
1 parent 8eeaf7e commit d95d529
Show file tree
Hide file tree
Showing 7 changed files with 125 additions and 88 deletions.
31 changes: 22 additions & 9 deletions dist/wsc.dAmn.js
Original file line number Diff line number Diff line change
Expand Up @@ -4,9 +4,9 @@
* @module wsc
*/
var wsc = {};
wsc.VERSION = '1.7.46';
wsc.VERSION = '1.7.47';
wsc.STATE = 'release candidate';
wsc.REVISION = '0.21.131';
wsc.REVISION = '0.21.132';
wsc.defaults = {};
wsc.defaults.theme = 'wsct_dark';
wsc.defaults.themes = [ 'wsct_dAmn', 'wsct_dark' ];
Expand Down Expand Up @@ -2613,7 +2613,7 @@ wsc.defaults.Extension = function( client ) {
*
* @method Autojoin
*/
//wsc.defaults.Extension.Autojoin(client);
wsc.defaults.Extension.Autojoin(client);

};
/**
Expand All @@ -2622,6 +2622,7 @@ wsc.defaults.Extension = function( client ) {
wsc.defaults.Extension.Autojoin = function( client ) {

var settings = client.autojoin;
/*
client.ui.nav.add_button( {
'icon': 'chat',
'label': '',
Expand All @@ -2635,14 +2636,15 @@ wsc.defaults.Extension.Autojoin = function( client ) {
}
}
});
*/

var init = function( ) {

client.bind('cmd.autojoin', cmd_autojoin);
client.ui.on('settings.open', settings.page);
//client.ui.on('settings.open', settings.page);

};

/*
settings.page = function( event, ui ) {
var page = event.settings.page('Autojoin');
Expand Down Expand Up @@ -2733,6 +2735,7 @@ wsc.defaults.Extension.Autojoin = function( client ) {
});
};
*/

var cmd_autojoin = function( cmd ) {

Expand All @@ -2753,9 +2756,9 @@ wsc.defaults.Extension.Autojoin = function( client ) {
if( client.autojoin.channel.indexOf( item ) == -1 ) {
mod = true;
client.autojoin.channel.push( item );
chan.server_message('Added ' + item + ' to your autojoin.');
//chan.server_message('Added ' + item + ' to your autojoin.');
} else {
chan.server_message('Already have ' + item + ' on your autojoin.');
//chan.server_message('Already have ' + item + ' on your autojoin.');
}
};
break;
Expand All @@ -2766,9 +2769,9 @@ wsc.defaults.Extension.Autojoin = function( client ) {
if( ci != -1 ) {
mod = true;
client.autojoin.channel.splice( ci, 1 );
chan.server_message('Removed ' + item + ' from your autojoin.');
//chan.server_message('Removed ' + item + ' from your autojoin.');
} else {
chan.server_message(item + ' is not on your autojoin list.');
//chan.server_message(item + ' is not on your autojoin list.');
}
};
break;
Expand All @@ -2786,6 +2789,16 @@ wsc.defaults.Extension.Autojoin = function( client ) {
client.autojoin.on = false;
}
break;
default:
console.log('> start autojoin');
console.log(client.autojoin);
for( var i in client.autojoin.channel ) {
if( !client.autojoin.channel.hasOwnProperty(i) )
continue;
client.join(client.autojoin.channel[i]);
}
return;
break;

}

Expand Down
83 changes: 41 additions & 42 deletions dist/wsc.dAmn.min.js

Large diffs are not rendered by default.

31 changes: 22 additions & 9 deletions dist/wsc.js
Original file line number Diff line number Diff line change
Expand Up @@ -4,9 +4,9 @@
* @module wsc
*/
var wsc = {};
wsc.VERSION = '1.7.46';
wsc.VERSION = '1.7.47';
wsc.STATE = 'release candidate';
wsc.REVISION = '0.21.131';
wsc.REVISION = '0.21.132';
wsc.defaults = {};
wsc.defaults.theme = 'wsct_dark';
wsc.defaults.themes = [ 'wsct_dAmn', 'wsct_dark' ];
Expand Down Expand Up @@ -2613,7 +2613,7 @@ wsc.defaults.Extension = function( client ) {
*
* @method Autojoin
*/
//wsc.defaults.Extension.Autojoin(client);
wsc.defaults.Extension.Autojoin(client);

};
/**
Expand All @@ -2622,6 +2622,7 @@ wsc.defaults.Extension = function( client ) {
wsc.defaults.Extension.Autojoin = function( client ) {

var settings = client.autojoin;
/*
client.ui.nav.add_button( {
'icon': 'chat',
'label': '',
Expand All @@ -2635,14 +2636,15 @@ wsc.defaults.Extension.Autojoin = function( client ) {
}
}
});
*/

var init = function( ) {

client.bind('cmd.autojoin', cmd_autojoin);
client.ui.on('settings.open', settings.page);
//client.ui.on('settings.open', settings.page);

};

/*
settings.page = function( event, ui ) {
var page = event.settings.page('Autojoin');
Expand Down Expand Up @@ -2733,6 +2735,7 @@ wsc.defaults.Extension.Autojoin = function( client ) {
});
};
*/

var cmd_autojoin = function( cmd ) {

Expand All @@ -2753,9 +2756,9 @@ wsc.defaults.Extension.Autojoin = function( client ) {
if( client.autojoin.channel.indexOf( item ) == -1 ) {
mod = true;
client.autojoin.channel.push( item );
chan.server_message('Added ' + item + ' to your autojoin.');
//chan.server_message('Added ' + item + ' to your autojoin.');
} else {
chan.server_message('Already have ' + item + ' on your autojoin.');
//chan.server_message('Already have ' + item + ' on your autojoin.');
}
};
break;
Expand All @@ -2766,9 +2769,9 @@ wsc.defaults.Extension.Autojoin = function( client ) {
if( ci != -1 ) {
mod = true;
client.autojoin.channel.splice( ci, 1 );
chan.server_message('Removed ' + item + ' from your autojoin.');
//chan.server_message('Removed ' + item + ' from your autojoin.');
} else {
chan.server_message(item + ' is not on your autojoin list.');
//chan.server_message(item + ' is not on your autojoin list.');
}
};
break;
Expand All @@ -2786,6 +2789,16 @@ wsc.defaults.Extension.Autojoin = function( client ) {
client.autojoin.on = false;
}
break;
default:
console.log('> start autojoin');
console.log(client.autojoin);
for( var i in client.autojoin.channel ) {
if( !client.autojoin.channel.hasOwnProperty(i) )
continue;
client.join(client.autojoin.channel[i]);
}
return;
break;

}

Expand Down
Loading

0 comments on commit d95d529

Please sign in to comment.