Project

General

Profile

Feature #22418 ยป rtehtmlarea_feature_14059.patch

Administrator Admin, 2010-04-11 01:50

View differences:

ChangeLog (copie de travail)
* Added feature #14051: htmlArea RTE: Streamline the RTE loading process
* Added feature #14057: htmlArea RTE: Extjize the RTE ajax requests.
* Added feature #14058: htmlArea RTE: update some WebKit dom methods.
* Added feature #14059: htmlArea RTE: Cleanup use of editor focus method
2010-04-09 Michael Stucki <michael@typo3.org>
typo3/sysext/rtehtmlarea/htmlarea/htmlarea-gecko.js (copie de travail)
} else {
selection.removeAllRanges();
}
if (HTMLArea.is_opera) {
this._iframe.focus();
if (Ext.isOpera) {
this.focus();
}
};
......
* Select a node AND the contents inside the node
*/
HTMLArea.Editor.prototype.selectNode = function(node, endPoint) {
this.focusEditor();
this.focus();
var selection = this._getSelection();
var range = this._doc.createRange();
if (node.nodeType == 1 && node.nodeName.toLowerCase() == "body") {
......
* Select ONLY the contents inside the given node
*/
HTMLArea.Editor.prototype.selectNodeContents = function(node, endPoint) {
this.focusEditor();
this.focus();
var selection = this._getSelection();
var range = this._doc.createRange();
if (Ext.isWebKit) {
......
this.emptySelection(selection);
this.addRangeToSelection(selection, range);
};
HTMLArea.Editor.prototype.rangeIntersectsNode = function(range, node) {
var nodeRange = this._doc.createRange();
try {
......
return (range.compareBoundaryPoints(range.END_TO_START, nodeRange) == -1 && range.compareBoundaryPoints(range.START_TO_END, nodeRange) == 1) ||
(range.compareBoundaryPoints(range.END_TO_START, nodeRange) == 1 && range.compareBoundaryPoints(range.START_TO_END, nodeRange) == -1);
};
/*
* Get the selection type
*/
......
* Split the text node, if needed.
*/
HTMLArea.Editor.prototype.insertNodeAtSelection = function(toBeInserted) {
this.focusEditor();
this.focus();
var range = this._createRange(this._getSelection());
range.deleteContents();
var toBeSelected = (toBeInserted.nodeType === 11) ? toBeInserted.lastChild : toBeInserted;
......
* Delete the current selection, if any.
*/
HTMLArea.Editor.prototype.insertHTML = function(html) {
this.focusEditor();
this.focus();
var fragment = this._doc.createDocumentFragment();
var div = this._doc.createElement("div");
div.innerHTML = html;
......
*/
HTMLArea.Editor.prototype._checkInsertP = function() {
var editor = this;
this.focusEditor();
this.focus();
var i, left, right, rangeClone,
sel = this._getSelection(),
range = this._createRange(sel),
typo3/sysext/rtehtmlarea/htmlarea/htmlarea-ie.js (copie de travail)
var sel = this._getSelection();
}
if (sel.type.toLowerCase() == "none") {
this.focusEditor();
this.focus();
}
return sel.createRange();
};
......
* Select a node AND the contents inside the node
*/
HTMLArea.Editor.prototype.selectNode = function(node) {
this.focusEditor();
this.focus();
this.forceRedraw();
var range = this._doc.body.createTextRange();
range.moveToElementText(node);
......
* Select ONLY the contents inside the given node
*/
HTMLArea.Editor.prototype.selectNodeContents = function(node, endPoint) {
this.focusEditor();
this.focus();
this.forceRedraw();
var range = this._doc.body.createTextRange();
range.moveToElementText(node);
......
* Determine whether the node intersects the range
*/
HTMLArea.Editor.prototype.rangeIntersectsNode = function(range, node) {
this.focusEditor();
this.focus();
var nodeRange = this._doc.body.createTextRange();
nodeRange.moveToElementText(node);
return (range.compareEndPoints("EndToStart", nodeRange) == -1 && range.compareEndPoints("StartToEnd", nodeRange) == 1) ||
typo3/sysext/rtehtmlarea/htmlarea/htmlarea.js (copie de travail)
/*
* Focus the editor iframe window or the textarea.
***********************************************
* THIS FUNCTION IS DEPRECATED AS OF TYPO3 4.4 *
***********************************************
*/
HTMLArea.Editor.prototype.focusEditor = function() {
this.focus();
......
/*
* Check if any plugin has an opened window
***********************************************
* THIS FUNCTION IS DEPRECATED AS OF TYPO3 4.4 *
***********************************************
*/
HTMLArea.Editor.prototype.hasOpenedWindow = function () {
for (var plugin in this.plugins) {
typo3/sysext/rtehtmlarea/htmlarea/plugins/BlockElements/block-elements.js (copie de travail)
if (HTMLArea.is_ie) {
element = "<" + element + ">";
}
this.editor.focusEditor();
this.editor.focus();
if (HTMLArea.is_safari && !this.editor._doc.body.hasChildNodes()) {
this.editor._doc.body.appendChild((this.editor._doc.createElement("br")));
}
......
// Could be a button or its hotkey
var buttonId = this.translateHotKey(id);
buttonId = buttonId ? buttonId : id;
this.editor.focusEditor();
this.editor.focus();
var selection = editor._getSelection();
var range = editor._createRange(selection);
var statusBarSelection = this.editor.statusBar ? this.editor.statusBar.getSelection() : null;
typo3/sysext/rtehtmlarea/htmlarea/plugins/BlockStyle/block-style.js (copie de travail)
*/
onChange : function (editor, combo, record, index) {
var className = combo.getValue();
this.editor.focusEditor();
this.editor.focus();
var blocks = this.getSelectedBlocks();
for (var k = 0; k < blocks.length; ++k) {
var parent = blocks[k];
typo3/sysext/rtehtmlarea/htmlarea/plugins/CopyPaste/copy-paste.js (copie de travail)
// Could be a button or its hotkey
var buttonId = this.translateHotKey(id);
buttonId = buttonId ? buttonId : id;
this.editor.focusEditor();
this.editor.focus();
if (!this.applyToTable(buttonId, target)) {
// If we are not handling table cells
switch (buttonId) {
typo3/sysext/rtehtmlarea/htmlarea/plugins/DefaultInline/default-inline.js (copie de travail)
// Could be a button or its hotkey
var buttonId = this.translateHotKey(id);
buttonId = buttonId ? buttonId : id;
editor.focusEditor();
editor.focus();
try {
editor._doc.execCommand(buttonId, false, null);
}
typo3/sysext/rtehtmlarea/htmlarea/plugins/DefinitionList/definition-list.js (copie de travail)
// Could be a button or its hotkey
var buttonId = this.translateHotKey(id);
buttonId = buttonId ? buttonId : id;
this.editor.focusEditor();
this.editor.focus();
var selection = editor._getSelection();
var range = editor._createRange(selection);
var statusBarSelection = this.editor.statusBar ? this.editor.statusBar.getSelection() : null;
typo3/sysext/rtehtmlarea/htmlarea/plugins/TextStyle/text-style.js (copie de travail)
var classNames = null;
var fullNodeSelected = false;
this.editor.focusEditor();
this.editor.focus();
var selection = this.editor._getSelection();
var statusBarSelection = this.editor.statusBar ? this.editor.statusBar.getSelection() : null;
var range = this.editor._createRange(selection);
typo3/sysext/rtehtmlarea/htmlarea/plugins/TYPO3Link/typo3link.js (copie de travail)
*/
createLink : function(theLink,cur_target,cur_class,cur_title,additionalValues) {
var selection, range, anchorClass, imageNode = null, addIconAfterLink;
this.editor.focusEditor();
this.editor.focus();
this.restoreSelection();
var node = this.editor.getParentElement();
var el = HTMLArea.getElementObject(node, "a");
......
* This function is called from the TYPO3 link popup and from the context menu.
*/
unLink : function() {
this.editor.focusEditor();
this.editor.focus();
this.restoreSelection();
var node = this.editor.getParentElement();
var el = HTMLArea.getElementObject(node, "a");
    (1-1/1)