Bug #24289 » rtehtmlarea_bugfix_16675_typo3_4-4.patch
typo3/sysext/rtehtmlarea/htmlarea/plugins/BlockElements/block-elements.js (copie de travail) | ||
---|---|---|
this.insertList(buttonId, parentElement);
|
||
break;
|
||
case "InsertHorizontalRule":
|
||
this.editor.execCommand('InsertHorizontalRule');
|
||
this.insertHorizontalRule();
|
||
break;
|
||
case "none" :
|
||
if (this.isAllowedBlockElement(parentElement.nodeName)) {
|
||
... | ... | |
}
|
||
},
|
||
/*
|
||
* Insert horizontal line
|
||
*/
|
||
insertHorizontalRule: function() {
|
||
this.editor.execCommand('InsertHorizontalRule');
|
||
// Apply enterParagraphs rule
|
||
if (!Ext.isIE && !Ext.isOpera && !this.editor.config.disableEnterParagraphs) {
|
||
var range = this.editor._createRange(this.editor._getSelection());
|
||
var startContainer = range.startContainer;
|
||
if (/^body$/i.test(startContainer.nodeName)) {
|
||
startContainer.normalize();
|
||
var ruler = startContainer.childNodes[range.startOffset-1];
|
||
if (ruler.nextSibling) {
|
||
if (ruler.nextSibling.nodeType == 3) {
|
||
if (/\S/.test(ruler.nextSibling.textContent)) {
|
||
var paragraph = this.editor.document.createElement('p');
|
||
paragraph = startContainer.appendChild(paragraph);
|
||
paragraph = startContainer.insertBefore(paragraph, ruler.nextSibling);
|
||
paragraph.appendChild(ruler.nextSibling);
|
||
} else {
|
||
HTMLArea.removeFromParent(ruler.nextSibling);
|
||
var paragraph = ruler.nextSibling;
|
||
}
|
||
} else {
|
||
var paragraph = ruler.nextSibling;
|
||
}
|
||
// Cannot set the cursor on the hr element
|
||
if (/^hr$/i.test(paragraph.nodeName)) {
|
||
var inBetweenParagraph = this.editor.document.createElement('p');
|
||
inBetweenParagraph.innerHTML = '<br />';
|
||
paragraph = startContainer.insertBefore(inBetweenParagraph, paragraph);
|
||
}
|
||
} else {
|
||
var paragraph = this.editor.document.createElement('p');
|
||
if (Ext.isWebKit) {
|
||
paragraph.innerHTML = '<br />';
|
||
}
|
||
paragraph = startContainer.appendChild(paragraph);
|
||
}
|
||
this.editor.selectNodeContents(paragraph, true);
|
||
}
|
||
}
|
||
},
|
||
/*
|
||
* This function gets called when the plugin is generated
|
||
*/
|
||
onGenerate: function () {
|
- « Previous
- 1
- 2
- Next »