// Bad Words - Quick add JS
// Simple add bad words to the filter list by selecting them and click the link
// By Robin Kuiper - http://www.robinkuiper.eu
// Version 1.0.1

/* attempt to find a text selection */
function getSelected() {
	var userSelection;
	if(window.getSelection) { userSelection = window.getSelection(); }
	else if(document.getSelection) { userSelection = document.getSelection(); }
	else {
		var selection = document.selection && document.selection.createRange();
		if(selection.text) { userSelection = selection.text; }
	}
	if(userSelection == '')
		alert('Select Word.');
	else{
		var bweaConfirm = confirm('Are you sure you want to put "' + userSelection + '" inside the bad word filter?');
		if(bweaConfirm == 1){
			var uri = document.location.href.replace(/#/g,'');
			document.location=uri+'&badword='+userSelection;
		}
	}
}
 
