Index: typo3/sysext/rtehtmlarea/htmlarea/plugins/BlockElements/block-elements.js
===================================================================
--- typo3/sysext/rtehtmlarea/htmlarea/plugins/BlockElements/block-elements.js (révision 7838)
+++ typo3/sysext/rtehtmlarea/htmlarea/plugins/BlockElements/block-elements.js (copie de travail)
@@ -921,7 +921,45 @@
}
var statusBarSelection = this.editor.getPluginInstance("StatusBar") ? this.editor.getPluginInstance("StatusBar").getSelection() : null;
var parentElement = statusBarSelection ? statusBarSelection : this.editor.getParentElement();
- if (parentElement.nodeName.toLowerCase() === "body") return false;
+ if (parentElement.nodeName.toLowerCase() === "body") {
+ // The selection is not contained in any block
+ var dropDownConfiguration = this.getDropDownConfiguration("FormatBlock");
+ if ((typeof(dropDownConfiguration) !== "undefined") && this.isButtonInToolbar(dropDownConfiguration.id)) {
+ this.updateDropDown(dropDownConfiguration);
+ }
+ for (var buttonId in this.buttonList) {
+ if (this.buttonList.hasOwnProperty(buttonId) && this.isButtonInToolbar(buttonId)) {
+ switch (buttonId) {
+ case 'Outdent' :
+ this.editor._toolbarObjects[buttonId].state("enabled", false);
+ break;
+ case 'Indent' :
+ break;
+ case 'InsertParagraphBefore' :
+ case 'InsertParagraphAfter' :
+ this.editor._toolbarObjects[buttonId].state("enabled", false);
+ break;
+ case 'Blockquote' :
+ this.editor._toolbarObjects[buttonId].state("active", false);
+ break;
+ case 'JustifyLeft' :
+ case 'JustifyCenter' :
+ case 'JustifyRight' :
+ case 'JustifyFull' :
+ this.editor._toolbarObjects[buttonId].state("active", false);
+ this.editor._toolbarObjects[buttonId].state("enabled", false);
+ break;
+ case 'InsertOrderedList':
+ case 'InsertUnorderedList':
+ this.editor._toolbarObjects[buttonId].state("active", false);
+ break;
+ default :
+ break;
+ }
+ }
+ }
+ return false;
+ }
while (parentElement && !HTMLArea.isBlockElement(parentElement) || /^li$/i.test(parentElement.nodeName)) {
parentElement = parentElement.parentNode;
}
Index: typo3/sysext/rtehtmlarea/htmlarea/plugins/DefinitionList/definition-list.js
===================================================================
--- typo3/sysext/rtehtmlarea/htmlarea/plugins/DefinitionList/definition-list.js (révision 7838)
+++ typo3/sysext/rtehtmlarea/htmlarea/plugins/DefinitionList/definition-list.js (copie de travail)
@@ -314,7 +314,19 @@
}
var statusBarSelection = this.editor.getPluginInstance("StatusBar") ? this.editor.getPluginInstance("StatusBar").getSelection() : null;
var parentElement = statusBarSelection ? statusBarSelection : this.editor.getParentElement();
- if (parentElement.nodeName.toLowerCase() === "body") return false;
+ if (parentElement.nodeName.toLowerCase() === "body") {
+ // The selection is not contained in any block
+ for (var buttonId in this.buttonList) {
+ if (this.buttonList.hasOwnProperty(buttonId) && this.isButtonInToolbar(buttonId)) {
+ switch (buttonId) {
+ case 'Outdent':
+ this.base();
+ break;
+ }
+ }
+ }
+ return false;
+ }
while (parentElement && (!HTMLArea.isBlockElement(parentElement) || /^(li)$/i.test(parentElement.nodeName))) {
parentElement = parentElement.parentNode;
}
Index: typo3/sysext/rtehtmlarea/htmlarea/plugins/Language/language.js
===================================================================
--- typo3/sysext/rtehtmlarea/htmlarea/plugins/Language/language.js (révision 7838)
+++ typo3/sysext/rtehtmlarea/htmlarea/plugins/Language/language.js (copie de travail)
@@ -408,6 +408,9 @@
if (parent) {
var direction = (buttonId === "RightToLeft") ? "rtl" : "ltr";
this.editor._toolbarObjects[buttonId].state("active",(parent.dir == direction || parent.style.direction == direction));
+ this.editor._toolbarObjects[buttonId].state("enabled", !/^body$/i.test(parent.nodeName));
+ } else {
+ this.editor._toolbarObjects[buttonId].state("enabled", false);
}
break;
case "ShowLanguageMarks":