Project

General

Profile

Feature #18518 » bug_0007963.diff

Administrator Admin, 2008-11-12 16:07

View differences:

typo3/sysext/rtehtmlarea/htmlarea/plugins/BlockStyle/block-style.js (working copy)
// for ie not relevant. returns allways one element
cssElements = selectorText.split(",");
for (var k = 0; k < cssElements.length; k++) {
cssElement = cssElements[k].split(".");
tagName = cssElement[0].toLowerCase().trim();
if (!tagName) {
tagName = "all";
}
className = cssElement[1];
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 && this.tags[tagName].allowedClasses.test(className))) {
if (!newCssArray[tagName]) {
newCssArray[tagName] = new Object();
}
if (className) {
cssName = className;
if (HTMLArea.classesLabels && HTMLArea.classesLabels[className]) {
cssName = this.prefixLabelWithClassName ? (className + " - " + HTMLArea.classesLabels[className]) : HTMLArea.classesLabels[className];
cssName = this.postfixLabelWithClassName ? (cssName + " - " + className) : cssName;
// Match ALL classes (<element name (optional)>.<class name>) in selector rule
var s = cssElements[k];
var pattern = /(\S*)\.(\S+)/;
var index;
while ((index = s.search(pattern)) > -1) {
var match = pattern.exec(s.substring(index));
s = s.substring(index+match[0].length);
tagName = (match[1] && (match[1] != '*')) ? match[1].toLowerCase().trim() : "all";
className = match[2];
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 && this.tags[tagName].allowedClasses.test(className))) {
if (!newCssArray[tagName]) {
newCssArray[tagName] = new Object();
}
} else {
className = "none";
cssName = this.localize("Element style");
}
newCssArray[tagName][className] = cssName;
if (className) {
cssName = className;
if (HTMLArea.classesLabels && HTMLArea.classesLabels[className]) {
cssName = this.prefixLabelWithClassName ? (className + " - " + HTMLArea.classesLabels[className]) : HTMLArea.classesLabels[className];
cssName = this.postfixLabelWithClassName ? (cssName + " - " + className) : cssName;
}
} else {
className = "none";
cssName = this.localize("Element style");
}
newCssArray[tagName][className] = cssName;
}
}
}
}
(1-1/2)