Added feature #9276: htmlArea RTE: allow wild cards in lists of allowed class names
authorStanislas Rolland <typo3@sjbr.ca>
Tue, 2 Sep 2008 21:34:35 +0000 (21:34 +0000)
committerStanislas Rolland <typo3@sjbr.ca>
Tue, 2 Sep 2008 21:34:35 +0000 (21:34 +0000)
git-svn-id: https://svn.typo3.org/TYPO3v4/Core/trunk@4053 709f56b5-9817-0410-a4d7-c38de5d9e867

ChangeLog
typo3/sysext/rtehtmlarea/ChangeLog
typo3/sysext/rtehtmlarea/doc/manual.sxw
typo3/sysext/rtehtmlarea/htmlarea/plugins/BlockStyle/block-style.js
typo3/sysext/rtehtmlarea/htmlarea/plugins/TextStyle/text-style.js

index fb58d62..c9e2f0a 100755 (executable)
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,7 @@
+2008-09-02  Stanislas Rolland  <typo3@sjbr.ca>
+
+       * Added feature #9276: htmlArea RTE: allow wild cards in lists of allowed class names
+
 2008-09-01  Stanislas Rolland  <typo3@sjbr.ca>
 
        * Fixed bug #9261: Indentation set with div section in htmlArea RTE is not rendered correctly in FE
index 07abb59..96bc93b 100644 (file)
@@ -1,3 +1,7 @@
+2008-09-02  Stanislas Rolland  <typo3@sjbr.ca>
+
+       * Added feature #9276: htmlArea RTE: allow wild cards in lists of allowed class names
+
 2008-09-01  Stanislas Rolland  <typo3@sjbr.ca>
 
        * Added feature #8668: Configurable labels for formatblock items in htmlArea RTE
index a0f9c70..4f3027c 100644 (file)
Binary files a/typo3/sysext/rtehtmlarea/doc/manual.sxw and b/typo3/sysext/rtehtmlarea/doc/manual.sxw differ
index 2dff196..ce7a954 100644 (file)
@@ -80,14 +80,16 @@ BlockStyle = HTMLArea.Plugin.extend({
                }
                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();
+                       if (this.tags.hasOwnProperty(tagName)) {
+                               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().replace(/\*/g, ".*");
+                                               }
                                        }
+                                       this.tags[tagName].allowedClasses = new RegExp( "^(" + allowedClasses.join("|") + ")$", "i");
                                }
-                               this.tags[tagName].allowedClasses = new RegExp( "^(" + allowedClasses.join("|") + ")$", "i");
                        }
                }
                this.showTagFreeClasses = this.pageTSconfiguration.showTagFreeClasses || this.editorConfiguration.showTagFreeClasses;
index fb9d1ad..7ecf8e4 100644 (file)
@@ -68,14 +68,16 @@ TextStyle = HTMLArea.Plugin.extend({
                }
                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();
+                       if (this.tags.hasOwnProperty(tagName)) {
+                               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().replace(/\*/g, ".*");
+                                               }
                                        }
+                                       this.tags[tagName].allowedClasses = new RegExp( "^(" + allowedClasses.join("|") + ")$", "i");
                                }
-                               this.tags[tagName].allowedClasses = new RegExp( "^(" + allowedClasses.join("|") + ")$", "i");
                        }
                }
                this.showTagFreeClasses = this.pageTSconfiguration.showTagFreeClasses || this.editorConfiguration.showTagFreeClasses;