|
@@ -139,13 +139,7 @@
|
|
{ // clear
|
|
{ // clear
|
|
cmd: 'clear',
|
|
cmd: 'clear',
|
|
fn: function(args){
|
|
fn: function(args){
|
|
- $cl.html('');
|
|
|
|
- tabs[selectedTab].body = document.createDocumentFragment();
|
|
|
|
- socket.emit('echo',{
|
|
|
|
- room: tabs[selectedTab].name,
|
|
|
|
- message: 'messages cleared',
|
|
|
|
- from: 0
|
|
|
|
- });
|
|
|
|
|
|
+ tabs[selectedTab].clear();
|
|
}
|
|
}
|
|
},
|
|
},
|
|
{ // close
|
|
{ // close
|
|
@@ -219,6 +213,30 @@
|
|
fn: function(data){
|
|
fn: function(data){
|
|
event('reconnected');
|
|
event('reconnected');
|
|
$o.chat.auth();
|
|
$o.chat.auth();
|
|
|
|
+ socket.emit('echo',{
|
|
|
|
+ room: tabs[selectedTab].name,
|
|
|
|
+ from: 0,
|
|
|
|
+ message: 'reconnected'
|
|
|
|
+ });
|
|
|
|
+ }
|
|
|
|
+ },
|
|
|
|
+ { // connect
|
|
|
|
+ on: 'connect',
|
|
|
|
+ fn: function(data){
|
|
|
|
+ event('connected');
|
|
|
|
+ $o.chat.auth();
|
|
|
|
+ socket.emit('echo',{
|
|
|
|
+ room: tabs[selectedTab].name,
|
|
|
|
+ from: 0,
|
|
|
|
+ message: 'connected'
|
|
|
|
+ });
|
|
|
|
+ }
|
|
|
|
+ },
|
|
|
|
+ { // disconnect
|
|
|
|
+ on: 'disconnect',
|
|
|
|
+ fn: function(data){
|
|
|
|
+ event('disconnected');
|
|
|
|
+ tabs[selectedTab].send('* disconnected');
|
|
}
|
|
}
|
|
},
|
|
},
|
|
{ // message
|
|
{ // message
|
|
@@ -497,6 +515,23 @@
|
|
},
|
|
},
|
|
select: function(){
|
|
select: function(){
|
|
$o.ui.tabs.select(id);
|
|
$o.ui.tabs.select(id);
|
|
|
|
+ },
|
|
|
|
+ send: function(msg){
|
|
|
|
+ $o.chat.send(msg,tabs[id].name);
|
|
|
|
+ },
|
|
|
|
+ names: function(){
|
|
|
|
+ socket.emit('names',{
|
|
|
|
+ name: tabs[id].name
|
|
|
|
+ });
|
|
|
|
+ },
|
|
|
|
+ clear: function(){
|
|
|
|
+ $cl.html('');
|
|
|
|
+ tabs[id].body = document.createDocumentFragment();
|
|
|
|
+ socket.emit('echo',{
|
|
|
|
+ room: tabs[id].name,
|
|
|
|
+ message: 'messages cleared',
|
|
|
|
+ from: 0
|
|
|
|
+ });
|
|
}
|
|
}
|
|
});
|
|
});
|
|
$tl.append($o.ui.tabs.obj(id));
|
|
$tl.append($o.ui.tabs.obj(id));
|
|
@@ -893,15 +928,6 @@
|
|
setTimeout(scrollup,10);
|
|
setTimeout(scrollup,10);
|
|
}
|
|
}
|
|
})();
|
|
})();
|
|
- //DEBUG
|
|
|
|
- /* for(var i=0;i<20;i++){
|
|
|
|
- tabs.push({
|
|
|
|
- name: '#Tab'+i,
|
|
|
|
- title: 'Tab '+i,
|
|
|
|
- topic: 'Topic for tab '+i
|
|
|
|
- });
|
|
|
|
- } */
|
|
|
|
- //END DEBUG
|
|
|
|
event('Date '+new Date,'ready');
|
|
event('Date '+new Date,'ready');
|
|
$h.addClass('hovered');
|
|
$h.addClass('hovered');
|
|
setTimeout(function(){
|
|
setTimeout(function(){
|