Index: typo3/sysext/rtehtmlarea/htmlarea/plugins/BlockStyle/block-style.js
===================================================================
--- typo3/sysext/rtehtmlarea/htmlarea/plugins/BlockStyle/block-style.js	(revision 3471)
+++ typo3/sysext/rtehtmlarea/htmlarea/plugins/BlockStyle/block-style.js	(working copy)
@@ -1,7 +1,7 @@
 /***************************************************************
 *  Copyright notice
 *
-* (c) 2007-2008 Stanislas Rolland <stanislas.rolland(arobas)fructifor.ca>
+* (c) 2007-2008 Stanislas Rolland <typo3(arobas)sjbr.ca>
 *  All rights reserved
 *
 *  This script is part of the TYPO3 project. The TYPO3 project is
@@ -78,6 +78,18 @@
 				}
 			}
 		}
+		var allowedClasses;
+		for (var tagName in this.tags) {
+			if (this.tags[tagName].allowedClasses) {
+				allowedClasses = this.tags[tagName].allowedClasses.trim().split(",");
+				for (var cssClass in allowedClasses) {
+					if (allowedClasses.hasOwnProperty(cssClass)) {
+						allowedClasses[cssClass] = allowedClasses[cssClass].trim();
+					}
+				}
+				this.tags[tagName].allowedClasses = new RegExp( "^(" + allowedClasses.join("|") + ")$", "i");
+			}
+		}
 		this.showTagFreeClasses = this.pageTSconfiguration.showTagFreeClasses || this.editorConfiguration.showTagFreeClasses;
 		this.prefixLabelWithClassName = this.pageTSconfiguration.prefixLabelWithClassName;
 		this.postfixLabelWithClassName = this.pageTSconfiguration.postfixLabelWithClassName;
@@ -86,11 +98,11 @@
 		 * Registering plugin "About" information
 		 */
 		var pluginInformation = {
-			version		: "1.2",
+			version		: "1.3",
 			developer	: "Stanislas Rolland",
-			developerUrl	: "http://www.fructifor.ca/",
+			developerUrl	: "http://www.sjbr.ca/",
 			copyrightOwner	: "Stanislas Rolland",
-			sponsor		: "Fructifor Inc. " + this.localize("Technische Universitat Ilmenau"),
+			sponsor		: this.localize("Technische Universitat Ilmenau"),
 			sponsorUrl	: "http://www.tu-ilmenau.de/",
 			license		: "GPL"
 		};
@@ -154,14 +166,12 @@
 			}
 		} else {
 			var nodeName = node.nodeName.toLowerCase();
-			if (this.tags && this.tags[nodeName]) {
-				var allowedClasses = this.tags[nodeName].allowedClasses;
-				if (allowedClasses && allowedClasses.indexOf(className) !== -1) {
+			if (this.tags && this.tags[nodeName] && this.tags[nodeName].allowedClasses) {
+				if (this.tags[nodeName].allowedClasses.test(className)) {
 					HTMLArea._addClass(node, className);
 				}
-			} else if (this.tags && this.tags.all) {
-				var allowedClasses = this.tags.all.allowedClasses;
-				if (allowedClasses && allowedClasses.indexOf(className) !== -1) {
+			} else if (this.tags && this.tags.all && this.tags.all.allowedClasses) {
+				if (this.tags.all.allowedClasses.test(className)) {
 					HTMLArea._addClass(node, className);
 				}
 			} else {
@@ -189,7 +199,7 @@
 				/* finished walking through selection */
 			}
 		} else {
-			blocks.push(this.editor.getParentElement());
+			blocks.push(this.editor._statusBarTree.selected ? this.editor._statusBarTree.selected : this.editor.getParentElement());
 		}
 		return blocks;
 	},
@@ -253,7 +263,7 @@
 		
 		var classNames = new Array();
 		var tagName = null;
-		var parent = this.editor.getParentElement();
+		var parent = this.editor._statusBarTree.selected ? this.editor._statusBarTree.selected : this.editor.getParentElement();
 		while (parent && !HTMLArea.isBlockElement(parent) && parent.nodeName.toLowerCase() != "img") {
 			parent = parent.parentNode;
 		}
@@ -327,34 +337,36 @@
 		this.initializeDropDown(dropDown);
 			// Get classes allowed for all tags
 		if (typeof(this.cssArray.all) !== "undefined") {
-			if (this.tags && this.tags[tagName]) {
+			var cssArrayAll = this.cssArray.all;
+			if (this.tags && this.tags[tagName] && this.tags[tagName].allowedClasses) {
 				var allowedClasses = this.tags[tagName].allowedClasses;
-				for (var cssClass in this.cssArray.all) {
-					if (allowedClasses.indexOf(cssClass) !== -1) {
-						cssArray[cssClass] = this.cssArray.all[cssClass];
+				for (var cssClass in cssArrayAll) {
+					if (cssArrayAll.hasOwnProperty(cssClass) && allowedClasses.test(cssClass)) {
+						cssArray[cssClass] = cssArrayAll[cssClass];
 					}
 				}
 			} else {
-				for (var cssClass in this.cssArray.all) {
-					if (this.cssArray.all.hasOwnProperty(cssClass)) {
-						cssArray[cssClass] = this.cssArray.all[cssClass];
+				for (var cssClass in cssArrayAll) {
+					if (cssArrayAll.hasOwnProperty(cssClass)) {
+						cssArray[cssClass] = cssArrayAll[cssClass];
 					}
 				}
 			}
 		}
 			// Merge classes allowed for tagName and sort the array
 		if (typeof(this.cssArray[tagName]) !== "undefined") {
-			if (this.tags && this.tags[tagName]) {
+			var cssArrayTagName = this.cssArray[tagName];
+			if (this.tags && this.tags[tagName] && this.tags[tagName].allowedClasses) {
 				var allowedClasses = this.tags[tagName].allowedClasses;
-				for (var cssClass in this.cssArray[tagName]) {
-					if (allowedClasses.indexOf(cssClass) !== -1) {
-						cssArray[cssClass] = this.cssArray[tagName][cssClass];
+				for (var cssClass in cssArrayTagName) {
+					if (cssArrayTagName.hasOwnProperty(cssClass) && allowedClasses.test(cssClass)) {
+						cssArray[cssClass] = cssArrayTagName[cssClass];
 					}
 				}
 			} else {
-				for (var cssClass in this.cssArray[tagName]) {
-					if (this.cssArray[tagName].hasOwnProperty(cssClass)) {
-						cssArray[cssClass] = this.cssArray[tagName][cssClass];
+				for (var cssClass in cssArrayTagName) {
+					if (cssArrayTagName.hasOwnProperty(cssClass)) {
+						cssArray[cssClass] = cssArrayTagName[cssClass];
 					}
 				}
 			}
@@ -540,10 +552,10 @@
 					tagName = "all";
 				}
 				className = cssElement[1];
-				if (!HTMLArea.reservedClassNames.test(className)) {
+				if (className && !HTMLArea.reservedClassNames.test(className)) {
 					if (((tagName != "all") && (!this.tags || !this.tags[tagName]))
 						|| ((tagName == "all") && (!this.tags || !this.tags[tagName]) && this.showTagFreeClasses)
-						|| (this.tags && this.tags[tagName] && this.tags[tagName].allowedClasses.indexOf(className) != -1)) {
+						|| (this.tags && this.tags[tagName] && this.tags[tagName].allowedClasses && this.tags[tagName].allowedClasses.test(className))) {
 							if (!newCssArray[tagName]) {
 								newCssArray[tagName] = new Object();
 							}
Index: typo3/sysext/rtehtmlarea/htmlarea/plugins/InlineElements/inline-elements.js
===================================================================
--- typo3/sysext/rtehtmlarea/htmlarea/plugins/InlineElements/inline-elements.js	(revision 3471)
+++ typo3/sysext/rtehtmlarea/htmlarea/plugins/InlineElements/inline-elements.js	(working copy)
@@ -1,7 +1,7 @@
 /***************************************************************
 *  Copyright notice
 *
-*  (c) 2007-2008 Stanislas Rolland <stanislas.rolland(arobas)fructifor.ca>
+*  (c) 2007-2008 Stanislas Rolland <typo3(arobas)sjbr.ca>
 *  All rights reserved
 *
 *  This script is part of the TYPO3 project. The TYPO3 project is
@@ -55,9 +55,9 @@
 		 * Registering plugin "About" information
 		 */
 		var pluginInformation = {
-			version		: "1.0",
+			version		: "1.1",
 			developer	: "Stanislas Rolland",
-			developerUrl	: "http://www.fructifor.ca/",
+			developerUrl	: "http://www.sjbr.ca/",
 			copyrightOwner	: "Stanislas Rolland",
 			sponsor		: this.localize("Technische Universitat Ilmenau"),
 			sponsorUrl	: "http://www.tu-ilmenau.de/",
@@ -396,7 +396,7 @@
 		
 		if (this.tags && this.tags[tagName] && this.tags[tagName].allowedClasses) {
 			if (newElement.className && /\S/.test(newElement.className)) {
-				var allowedClasses = new RegExp( "^(" + this.tags[tagName].allowedClasses.trim().split(",").join("|") + ")$");
+				var allowedClasses = this.tags[tagName].allowedClasses;
 				classNames = newElement.className.trim().split(" ");
 				for (var i = 0; i < classNames.length; ++i) {
 					if (!allowedClasses.test(classNames[i])) {
Index: typo3/sysext/rtehtmlarea/htmlarea/plugins/TableOperations/table-operations.js
===================================================================
--- typo3/sysext/rtehtmlarea/htmlarea/plugins/TableOperations/table-operations.js	(revision 3471)
+++ typo3/sysext/rtehtmlarea/htmlarea/plugins/TableOperations/table-operations.js	(working copy)
@@ -75,7 +75,7 @@
 		 * Registering plugin "About" information
 		 */
 		var pluginInformation = {
-			version		: "4.1",
+			version		: "4.2",
 			developer	: "Mihai Bazon & Stanislas Rolland",
 			developerUrl	: "http://www.sjbr.ca/",
 			copyrightOwner	: "Mihai Bazon & Stanislas Rolland",
@@ -1227,7 +1227,7 @@
 		
 		if (this.tags && this.tags[nodeName] && this.tags[nodeName].allowedClasses) {
 			if (newCell.className && /\S/.test(newCell.className)) {
-				var allowedClasses = new RegExp( "^(" + this.tags[nodeName].allowedClasses.trim().split(",").join("|") + ")$");
+				var allowedClasses = this.tags[nodeName].allowedClasses;
 				var classNames = newCell.className.trim().split(" ");
 				for (var i = classNames.length; --i >= 0;) {
 					if (!allowedClasses.test(classNames[i])) {
Index: typo3/sysext/rtehtmlarea/htmlarea/plugins/TextStyle/text-style.js
===================================================================
--- typo3/sysext/rtehtmlarea/htmlarea/plugins/TextStyle/text-style.js	(revision 3471)
+++ typo3/sysext/rtehtmlarea/htmlarea/plugins/TextStyle/text-style.js	(working copy)
@@ -1,7 +1,7 @@
 /***************************************************************
 *  Copyright notice
 *
-*  (c) 2007-2008 Stanislas Rolland <stanislas.rolland(arobas)fructifor.ca>
+*  (c) 2007-2008 Stanislas Rolland <typo3(arobas)sjbr.ca>
 *  All rights reserved
 *
 *  This script is part of the TYPO3 project. The TYPO3 project is
@@ -66,6 +66,18 @@
 				}
 			}
 		}
+		var allowedClasses;
+		for (var tagName in this.tags) {
+			if (this.tags[tagName].allowedClasses) {
+				allowedClasses = this.tags[tagName].allowedClasses.trim().split(",");
+				for (var cssClass in allowedClasses) {
+					if (allowedClasses.hasOwnProperty(cssClass)) {
+						allowedClasses[cssClass] = allowedClasses[cssClass].trim();
+					}
+				}
+				this.tags[tagName].allowedClasses = new RegExp( "^(" + allowedClasses.join("|") + ")$", "i");
+			}
+		}
 		this.showTagFreeClasses = this.pageTSconfiguration.showTagFreeClasses || this.editorConfiguration.showTagFreeClasses;
 		this.prefixLabelWithClassName = this.pageTSconfiguration.prefixLabelWithClassName;
 		this.postfixLabelWithClassName = this.pageTSconfiguration.postfixLabelWithClassName;
@@ -79,9 +91,9 @@
 		 * Registering plugin "About" information
 		 */
 		var pluginInformation = {
-			version		: "1.0",
+			version		: "1.1",
 			developer	: "Stanislas Rolland",
-			developerUrl	: "http://www.fructifor.ca/",
+			developerUrl	: "http://www.sjbr.ca/",
 			copyrightOwner	: "Stanislas Rolland",
 			sponsor		: this.localize("Technische Universitat Ilmenau"),
 			sponsorUrl	: "http://www.tu-ilmenau.de/",
@@ -397,10 +409,10 @@
 					tagName = 'all';
 				}
 				className = cssElement[1];
-				if (!HTMLArea.reservedClassNames.test(className)) {
+				if (className && !HTMLArea.reservedClassNames.test(className)) {
 					if (((tagName != "all") && (!this.tags || !this.tags[tagName]))
 						|| ((tagName == "all") && (!this.tags || !this.tags[tagName]) && this.showTagFreeClasses)
-						|| (this.tags && this.tags[tagName] && this.tags[tagName].allowedClasses.indexOf(className) != -1)) {
+						|| (this.tags && this.tags[tagName] && this.tags[tagName].allowedClasses && this.tags[tagName].allowedClasses.test(className))) {
 							if (!newCssArray[tagName]) {
 								newCssArray[tagName] = new Object();
 							}
@@ -533,34 +545,36 @@
 		if (this.REInlineTags.test(tagName)) {
 				// Get classes allowed for all tags
 			if (typeof(this.cssArray["all"]) !== "undefined") {
-				if (this.tags && this.tags[tagName]) {
+				var cssArrayAll = this.cssArray.all;
+				if (this.tags && this.tags[tagName] && this.tags[tagName].allowedClasses) {
 					var allowedClasses = this.tags[tagName].allowedClasses;
-					for (cssClass in this.cssArray["all"]) {
-						if (allowedClasses.indexOf(cssClass) !== -1) {
-							cssArray[cssClass] = this.cssArray["all"][cssClass];
+					for (var cssClass in cssArrayAll) {
+						if (cssArrayAll.hasOwnProperty(cssClass) && allowedClasses.test(cssClass)) {
+							cssArray[cssClass] = cssArrayAll[cssClass];
 						}
 					}
 				} else {
-					for (cssClass in this.cssArray["all"]) {
-						if (this.cssArray["all"].hasOwnProperty(cssClass)) {
-							cssArray[cssClass] = this.cssArray["all"][cssClass];
+					for (var cssClass in cssArrayAll) {
+						if (cssArrayAll.hasOwnProperty(cssClass)) {
+							cssArray[cssClass] = cssArrayAll[cssClass];
 						}
 					}
 				}
 			}
 				// Merge classes allowed for tagName and sort the array
 			if (typeof(this.cssArray[tagName]) !== "undefined") {
-				if (this.tags && this.tags[tagName]) {
+				var cssArrayTagName = this.cssArray[tagName];
+				if (this.tags && this.tags[tagName] && this.tags[tagName].allowedClasses) {
 					var allowedClasses = this.tags[tagName].allowedClasses;
-					for (var cssClass in this.cssArray[tagName]) {
-						if (allowedClasses.indexOf(cssClass) !== -1) {
-							cssArray[cssClass] = this.cssArray[tagName][cssClass];
+					for (var cssClass in cssArrayTagName) {
+						if (cssArrayTagName.hasOwnProperty(cssClass) && allowedClasses.test(cssClass)) {
+							cssArray[cssClass] = cssArrayTagName[cssClass];
 						}
 					}
 				} else {
-					for (var cssClass in this.cssArray[tagName]) {
-						if (this.cssArray[tagName].hasOwnProperty(cssClass)) {
-							cssArray[cssClass] = this.cssArray[tagName][cssClass];
+					for (var cssClass in cssArrayTagName) {
+						if (cssArrayTagName.hasOwnProperty(cssClass)) {
+							cssArray[cssClass] = cssArrayTagName[cssClass];
 						}
 					}
 				}
