Index: typo3/sysext/rtehtmlarea/htmlarea/plugins/BlockStyle/block-style.js
===================================================================
--- typo3/sysext/rtehtmlarea/htmlarea/plugins/BlockStyle/block-style.js (révision 9283)
+++ typo3/sysext/rtehtmlarea/htmlarea/plugins/BlockStyle/block-style.js (copie de travail)
@@ -42,10 +42,7 @@
this.cssArray = {};
this.classesUrl = this.editorConfiguration.classesUrl;
this.pageTSconfiguration = this.editorConfiguration.buttons.blockstyle;
- this.tags = this.pageTSconfiguration.tags;
- if (!this.tags) {
- this.tags = new Object();
- }
+ this.tags = (this.pageTSconfiguration && this.pageTSconfiguration.tags) ? this.pageTSconfiguration.tags : {};
if (typeof(this.editorConfiguration.classesTag) !== "undefined") {
if (this.editorConfiguration.classesTag.div) {
if (!this.tags.div) {
@@ -86,9 +83,9 @@
}
}
}
- this.showTagFreeClasses = this.pageTSconfiguration.showTagFreeClasses || this.editorConfiguration.showTagFreeClasses;
- this.prefixLabelWithClassName = this.pageTSconfiguration.prefixLabelWithClassName;
- this.postfixLabelWithClassName = this.pageTSconfiguration.postfixLabelWithClassName;
+ this.showTagFreeClasses = (this.pageTSconfiguration ? this.pageTSconfiguration.showTagFreeClasses : false) || this.editorConfiguration.showTagFreeClasses;
+ this.prefixLabelWithClassName = this.pageTSconfiguration ? this.pageTSconfiguration.prefixLabelWithClassName : false;
+ this.postfixLabelWithClassName = this.pageTSconfiguration ? this.pageTSconfiguration.postfixLabelWithClassName : false;
/*
* Registering plugin "About" information
*/
@@ -106,7 +103,7 @@
* Registering the drop-down list
*/
var dropDownId = 'BlockStyle';
- var fieldLabel = this.pageTSconfiguration.fieldLabel;
+ var fieldLabel = this.pageTSconfiguration ? this.pageTSconfiguration.fieldLabel : '';
if (Ext.isEmpty(fieldLabel) && this.isButtonInToolbar('I[Block style label]')) {
fieldLabel = this.localize('Block style label');
}
@@ -119,15 +116,17 @@
storeFields: [ { name: 'text'}, { name: 'value'}, { name: 'style'} ],
tpl: '{text}
'
};
- if (this.pageTSconfiguration.width) {
- dropDownConfiguration.width = parseInt(this.pageTSconfiguration.width, 10);
+ if (this.pageTSconfiguration) {
+ if (this.pageTSconfiguration.width) {
+ dropDownConfiguration.width = parseInt(this.pageTSconfiguration.width, 10);
+ }
+ if (this.pageTSconfiguration.listWidth) {
+ dropDownConfiguration.listWidth = parseInt(this.pageTSconfiguration.listWidth, 10);
+ }
+ if (this.pageTSconfiguration.maxHeight) {
+ dropDownConfiguration.maxHeight = parseInt(this.pageTSconfiguration.maxHeight, 10);
+ }
}
- if (this.pageTSconfiguration.listWidth) {
- dropDownConfiguration.listWidth = parseInt(this.pageTSconfiguration.listWidth, 10);
- }
- if (this.pageTSconfiguration.maxHeight) {
- dropDownConfiguration.maxHeight = parseInt(this.pageTSconfiguration.maxHeight, 10);
- }
this.registerDropDown(dropDownConfiguration);
return true;
},