Sfoglia il codice sorgente

/me and timestamp fixes

Nathaniel van Diepen 11 anni fa
parent
commit
092221fa28
1 ha cambiato i file con 19 aggiunte e 1 eliminazioni
  1. 19 1
      app/www/js/omnomirc.js

+ 19 - 1
app/www/js/omnomirc.js

@@ -66,6 +66,20 @@
 					});
 				}
 			},
+			{
+				cmd: 'me',
+				fn: function(args){
+					var i,ret='';
+					for(i=1;i<args.length;i++){
+						ret += args[i];
+					}
+					socket.emit('message',{
+						from: 0,
+						message: properties.nick+' '+ret,
+						room: tabs[selectedTab].name
+					});
+				}
+			},
 			{
 				cmd: 'nick',
 				fn: function(args){
@@ -260,6 +274,9 @@
 			if(exists(settings[name])){
 				settings[name] = value;
 				$.localStorage('settings',JSON.stringify(settings));
+				switch(name){
+					case 'timestamp':$o.abbrDate('abbr.date');break;
+				}
 				return true;
 			}else{
 				return false;
@@ -349,9 +366,10 @@
 			$($tl.children().get(id)).addClass('clicked');
 			$('#title').text(tabs[id].title);
 			$('#topic').text(tabs[id].topic);
-			$cl.html($(tabs[id].body).clone()).scrollTop($cl[0].scrollHeight);
+			$cl.html($(tabs[id].body).clone());
 			$o.abbrDate('abbr.date');
 			$o.renderUsers();
+			$cl.scrollTop($cl[0].scrollHeight);
 		},
 		tabIdForName: function(name){
 			for(var i in tabs){