Project

General

Profile

Bug #24289 » rtehtmlarea_bugfix_16675_trunk.patch

Administrator Admin, 2010-12-05 01:49

View differences:

typo3/sysext/rtehtmlarea/htmlarea/plugins/BlockElements/block-elements.js (copie de travail)
* Registering plugin "About" information
*/
var pluginInformation = {
version : "1.4",
developer : "Stanislas Rolland",
developerUrl : "http://www.sjbr.ca/",
copyrightOwner : "Stanislas Rolland",
sponsor : this.localize("Technische Universitat Ilmenau"),
sponsorUrl : "http://www.tu-ilmenau.de/",
license : "GPL"
version : '1.5',
developer : 'Stanislas Rolland',
developerUrl : 'http://www.sjbr.ca/',
copyrightOwner : 'Stanislas Rolland',
sponsor : this.localize('Technische Universitat Ilmenau'),
sponsorUrl : 'http://www.tu-ilmenau.de/',
license : 'GPL'
};
this.registerPluginInformation(pluginInformation);
......
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 == HTMLArea.DOM.TEXT_NODE) {
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 () {
(1-1/2)