<commit_before>React = require('react/addons');
Dispatcher = require('../lib/dispatcher.jsx');

module.exports = React.createClass({
	isMember: function(raid) {
		for ( var i=0; i<raid.members.length; i++ ) {
			if ( raid.members[i] == this.props.state.username ) {
				return true;
			}
		}
		return false;
	},
	isAlt: function(raid) {
		if ( raid.alts == null ) {
			return false;
		}
		for ( var i=0; i<raid.alts.length; i++ ) {
			if ( raid.alts[i] == this.props.state.username ) {
				return true;
			}
		}
		return false;
	},
	raids: function() {
		var myRaids = [];
		for ( var c in this.props.state.raids ) {
			for ( var u in this.props.state.raids[c] ) {
				var r = this.props.state.raids[c][u];
				if ( this.isMember(r) || this.isAlt(r) ) {
					myRaids.push({raid: r, channel: c});
				}
			}
		}
		return myRaids;
	},
	select: function(e) {
		var action;
		if ( e.target.value == "My Events" ) {
			action = {
				actionType: "mset", 
				what: [
					{ key: "raid", value: "" },
					{ key: "channel", value: "" }
				]
			}
		} else {
			var option = $(e.target).find('[value="'+e.target.value+'"]')[0];
			action = {
				actionType: "mset", 
				what: [
					{ key: "raid", value: option.dataset.uuid },
					{ key: "channel", value: option.dataset.channel }
				]
			}
		}
		Dispatcher.dispatch(action);
	},
	render: function() {
		var raids = this.raids();
		if ( raids.length < 1 ) {
			return(<span/>);
		}
		var raidlist = [<option key="none">My Events</option>];
		raids.forEach(function(entry) {
			raidlist.push(
				(<option
					value={entry.raid.uuid}
					key={entry.raid.uuid}
					data-channel={entry.channel}
					data-uuid={entry.raid.uuid}>
						{entry.raid.name}</option>)
			);
		})
		return (
			<li className="box">
				<select value={this.props.state.raid} onChange={this.select}>
					{raidlist}
				</select>
			</li>
		);
	}
});<commit_msg>Updated myRaids select to be Bootstrap-y<commit_after>React = require('react/addons');
Dispatcher = require('../lib/dispatcher.jsx');

module.exports = React.createClass({
	isMember: function(raid) {
		for ( var i=0; i<raid.members.length; i++ ) {
			if ( raid.members[i] == this.props.state.username ) {
				return true;
			}
		}
		return false;
	},
	isAlt: function(raid) {
		if ( raid.alts == null ) {
			return false;
		}
		for ( var i=0; i<raid.alts.length; i++ ) {
			if ( raid.alts[i] == this.props.state.username ) {
				return true;
			}
		}
		return false;
	},
	raids: function() {
		var myRaids = [];
		for ( var c in this.props.state.raids ) {
			for ( var u in this.props.state.raids[c] ) {
				var r = this.props.state.raids[c][u];
				if ( this.isMember(r) || this.isAlt(r) ) {
					myRaids.push({raid: r, channel: c});
				}
			}
		}
		return myRaids;
	},
	select: function(e) {
		var action;
		if ( e.target.value == "My Events" ) {
			action = {
				actionType: "mset", 
				what: [
					{ key: "raid", value: "" },
					{ key: "channel", value: "" }
				]
			}
		} else {
			var option = $(e.target).find('[value="'+e.target.value+'"]')[0];
			action = {
				actionType: "mset", 
				what: [
					{ key: "raid", value: option.dataset.uuid },
					{ key: "channel", value: option.dataset.channel }
				]
			}
		}
		Dispatcher.dispatch(action);
	},
	render: function() {
		var raids = this.raids();
		if ( raids.length < 1 ) {
			return(<span/>);
		}
		var raidlist = [<option key="none">My Events</option>];
		raids.forEach(function(entry) {
			raidlist.push(
				(<option
					value={entry.raid.uuid}
					key={entry.raid.uuid}
					data-channel={entry.channel}
					data-uuid={entry.raid.uuid}>
						{entry.raid.name}</option>)
			);
		})
		return (
			<div className="box col-xs-8 nopadding">
				<select className="form-control" value={this.props.state.raid} onChange={this.select}>
					{raidlist}
				</select>
			</div>
		);
	}
});
{'fraction_non_alphanumeric': 0.19343920853944285, 'fraction_numerical': 0.002343139807341838, 'mean_word_length': 2.6695319961795607, 'pattern_counts': {'":': 0, '<': 27, '<?xml version=': 0, '>': 21, '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': '1446176', 'n_tokens_mistral': 1758, 'n_tokens_neox': 1447, 'n_words': 270}