lib/jschat/http/public/javascripts/app/ui/commands.js in jschat-0.3.1 vs lib/jschat/http/public/javascripts/app/ui/commands.js in jschat-0.3.2
- old
+ new
@@ -10,10 +10,11 @@
Display.add_message('<strong>JsChat Help</strong> — Type the following commands into the message field:', 'help')
help.push(['/clear', 'Clears messages']);
help.push(['/join #room_name', 'Joins a room']);
help.push(['/part #room_name', 'Leaves a room. Leave room_name blank for the current room']);
help.push(['/lastlog', 'Shows recent activity']);
+ help.push(['/search query', 'Searches the logs for this room']);
help.push(['/names', 'Refreshes the names list']);
help.push(['/name new_name', 'Changes your name']);
help.push(['/toggle images', 'Toggles showing of images and videos']);
help.push(['/quit', 'Quit']);
help.push(['/emotes', 'Shows available emotes']);
@@ -32,9 +33,20 @@
$('messages').innerHTML = '';
JsChat.Request.get('/lastlog', function(transport) {
this.displayMessages(transport.responseText);
$('names').innerHTML = '';
this.updateNames();
+ this.pausePollers = false;
+ }.bind(this));
+ },
+
+ '/search\\s+(.*)': function(query) {
+ query = query[1];
+ this.pausePollers = true;
+ $('messages').innerHTML = '';
+ JsChat.Request.get('/search?q=' + query, function(transport) {
+ Display.add_message('Search results:', 'server');
+ this.displayMessages(transport.responseText);
this.pausePollers = false;
}.bind(this));
},
'/(name|nick)\\s+(.*)': function(name) {