<commit_before>/** File: candy.js
 * Candy join room over command
 * 
 * Authors:
 *  - <NAME> <<EMAIL>>
 * 
 * Copyright:
 *  - (c) 2012 Amiado Group AG. All rights reserved.
 */

var CandyShop = (function(self) { return self; }(CandyShop || {}));

CandyShop.Join = (function(self, Candy, $) {
	/** Object: about
	 * About Game API
	 *
	 * Contains:
	 *   (String) name - Candy Plugin Join
	 *   (Float) version - andy Plugin Available Rooms version
	 */
	self.about = {
		name: 'Candy Plugin Join',
		version: '1.0.1'
	};
	
	/** Function: init
	 * Initializes the join plugin with the default settings.
	 */
	self.init = function(){
		$(Candy.View.Pane).bind('candy:view.message.beforeSend', function(e, args) {
			// (strip colors)
			// if it matches '/join', join room and don't send anything
			if (args.message.replace(/\|c:\d+\|/, '').substring(0, 5).toLowerCase() == '/join') {
				self.joinRoom(args.message.replace(/\|c:\d+\|/, '').substring(6).toLowerCase());
				args.message = '';
			}
		});
	};
	
	/** Function: joinRoom
	 * Join a room
	 * 
	 * Parameters:
	 *   (String) args<commit_msg>Fix event name to candy:view.message.before-send.<commit_after>/** File: candy.js
 * Candy join room over command
 * 
 * Authors:
 *  - <NAME> <<EMAIL>>
 * 
 * Copyright:
 *  - (c) 2012 Amiado Group AG. All rights reserved.
 */

var CandyShop = (function(self) { return self; }(CandyShop || {}));

CandyShop.Join = (function(self, Candy, $) {
	/** Object: about
	 * About Game API
	 *
	 * Contains:
	 *   (String) name - Candy Plugin Join
	 *   (Float) version - andy Plugin Available Rooms version
	 */
	self.about = {
		name: 'Candy Plugin Join',
		version: '1.0.2'
	};
	
	/** Function: init
	 * Initializes the join plugin with the default settings.
	 */
	self.init = function(){
		$(Candy).bind('candy:view.message.before-send', function(e, args) {
			// (strip colors)
			// if it matches '/join', join room and don't send anything
			if (args.message.replace(/\|c:\d+\|/, '').substring(0, 5).toLowerCase() == '/join') {
				self.joinRoom(args.message.replace(/\|c:\d+\|/, '').substring(6).toLowerCase());
				args.message = '';
			}
		});
	};
	
	/** Function: joinRoom
	 * Join a room
	 * 
	 * Parameters:
	 *   (String) args
{'fraction_non_alphanumeric': 0.18702460850111857, 'fraction_numerical': 0.008948545861297539, 'mean_word_length': 2.950530035335689, 'pattern_counts': {'":': 0, '<': 9, '<?xml version=': 0, '>': 9, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '292104', 'n_tokens_mistral': 840, 'n_tokens_neox': 751, 'n_words': 197}