Project

General

Profile

Bug #18495 ยป rtehtmlarea_bugfix_7934.patch

Administrator Admin, 2008-03-25 04:44

View differences:

typo3/sysext/rtehtmlarea/htmlarea/plugins/BlockStyle/block-style.js (working copy)
/***************************************************************
* 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
......
}
}
}
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;
......
* 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"
};
......
}
} 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 {
......
/* 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;
},
......
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;
}
......
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];
}
}
}
......
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();
}
typo3/sysext/rtehtmlarea/htmlarea/plugins/InlineElements/inline-elements.js (working copy)
/***************************************************************
* 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
......
* 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/",
......
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])) {
typo3/sysext/rtehtmlarea/htmlarea/plugins/TableOperations/table-operations.js (working copy)
* 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",
......
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])) {
typo3/sysext/rtehtmlarea/htmlarea/plugins/TextStyle/text-style.js (working copy)
/***************************************************************
* 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
......
}
}
}
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;
......
* 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/",
......
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();
}
......
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];
}
}
}
    (1-1/1)