Index: typo3/sysext/rtehtmlarea/extensions/TYPO3Image/class.tx_rtehtmlarea_typo3image.php =================================================================== --- typo3/sysext/rtehtmlarea/extensions/TYPO3Image/class.tx_rtehtmlarea_typo3image.php (révision 7222) +++ typo3/sysext/rtehtmlarea/extensions/TYPO3Image/class.tx_rtehtmlarea_typo3image.php (copie de travail) @@ -2,7 +2,7 @@ /*************************************************************** * Copyright notice * -* (c) 2008-2009 Stanislas Rolland +* (c) 2008-2010 Stanislas Rolland * All rights reserved * * This script is part of the Typo3 project. The Typo3 project is @@ -24,7 +24,7 @@ /** * TYPO3 Image plugin for htmlArea RTE * - * @author Stanislas Rolland + * @author Stanislas Rolland * * TYPO3 SVN ID: $Id$ * Index: typo3/sysext/rtehtmlarea/htmlarea/htmlarea.js =================================================================== --- typo3/sysext/rtehtmlarea/htmlarea/htmlarea.js (révision 7222) +++ typo3/sysext/rtehtmlarea/htmlarea/htmlarea.js (copie de travail) @@ -1267,7 +1267,7 @@ this.mon(documentElement, (Ext.isIE || Ext.isWebKit) ? 'keydown' : 'keypress', this.onAnyKey, this); this.mon(documentElement, 'mouseup', this.onMouse, this); this.mon(documentElement, 'click', this.onMouse, this); - this.mon(documentElement, 'drag', this.onMouse, this); + this.mon(documentElement, Ext.isWebKit ? 'dragend' : 'drop', this.onDrop, this); }, /* * Handler for other key events @@ -1315,6 +1315,15 @@ return true; }, /* + * Handlers for drag and drop operations + */ + onDrop: function (event) { + if (Ext.isWebKit) { + this.getEditor().cleanAppleStyleSpans.defer(50, this.getEditor(), [this.getEditor().document.body]); + } + this.getToolbar().updateLater.delay(100); + }, + /* * Handler for UP, DOWN, LEFT and RIGHT keys */ onArrow: function () { @@ -2364,7 +2373,7 @@ this.addEvents( /* * @event editorready - * Fires when initializatio of the editor is complete + * Fires when initialization of the editor is complete */ 'editorready', /* @@ -4294,6 +4303,9 @@ }, /** + *********************************************** + * THIS FUNCTION IS DEPRECATED AS OF TYPO3 4.4 * + *********************************************** * Open a dialog window or bring focus to it if is already opened * * @param string buttonId: buttonId requesting the opening of the dialog @@ -4331,6 +4343,69 @@ ); } }, + /* + * Open a window with container iframe + * + * @param string buttonId: the id of the button + * @param string title: the window title (will be localized here) + * @param object dimensions: the opening dimensions od the window + * @param string url: the url to load ino the iframe + * + * @ return void + */ + openContainerWindow: function (buttonId, title, dimensions, url) { + this.dialog = new Ext.Window({ + id: this.editor.editorId + buttonId, + title: this.localize(title), + cls: 'htmlarea-window', + width: dimensions.width, + height: dimensions.height, + border: false, + // As of ExtJS 3.1, JS error with IE when the window is resizable + //resizable: !Ext.isIE, + iconCls: buttonId, + listeners: { + afterrender: { + fn: this.onContainerResize + }, + resize: { + fn: this.onContainerResize + }, + close: { + fn: this.onClose, + scope: this + } + }, + items: { + // The content iframe + xtype: 'box', + itemId: 'content-iframe', + autoEl: { + tag: 'iframe', + cls: 'content-iframe', + src: url + } + } + }); + this.show(); + }, + /* + * Handler invoked when the container window is rendered or resized in order to resize the content iframe to maximum size + */ + onContainerResize: function (panel) { + var iframe = panel.getComponent('content-iframe'); + if (iframe.rendered) { + iframe.getEl().setSize(panel.getInnerWidth(), panel.getInnerHeight()); + } + }, + /* + * Get the opening diment=sions of the window + * + * @param object dimensions: default opening width and height set by the plugin + * @param string buttonId: the id of the button that is triggering the opening of the window + * + * @return object opening width and height of the window + */ getWindowDimensions: function (dimensions, buttonId) { // Apply default dimensions var dialogueWindowDimensions = { @@ -4358,18 +4433,19 @@ } return dialogueWindowDimensions; }, - /** + *********************************************** + * THIS FUNCTION IS DEPRECATED AS OF TYPO3 4.4 * + *********************************************** * Make url from the name of a popup of the plugin * * @param string popupName: name, without extension, of the html file to be loaded into the dialog window * * @return string the url */ - makeUrlFromPopupName : function(popupName) { + makeUrlFromPopupName: function(popupName) { return (popupName ? this.editor.popupURL("plugin://" + this.name + "/" + popupName) : this.editor.popupURL("blank.html")); }, - /** * Make url from module path * @@ -4378,10 +4454,9 @@ * * @return string the url */ - makeUrlFromModulePath : function(modulePath, parameters) { - return this.editor.popupURL(modulePath + "?" + this.editorConfiguration.RTEtsConfigParams + "&editorNo=" + this.editorNumber + "&sys_language_content=" + this.editorConfiguration.sys_language_content + "&contentTypo3Language=" + this.editorConfiguration.typo3ContentLanguage + "&contentTypo3Charset=" + encodeURIComponent(this.editorConfiguration.typo3ContentCharset) + (parameters?parameters:'')); + makeUrlFromModulePath: function(modulePath, parameters) { + return this.editor.popupURL(modulePath + "?" + this.editorConfiguration.RTEtsConfigParams + "&editorNo=" + this.editor.editorId + "&sys_language_content=" + this.editorConfiguration.sys_language_content + "&contentTypo3Language=" + this.editorConfiguration.typo3ContentLanguage + "&contentTypo3Charset=" + encodeURIComponent(this.editorConfiguration.typo3ContentCharset) + (parameters?parameters:'')); }, - /** * Append an entry at the end of the troubleshooting log * @@ -4390,7 +4465,7 @@ * * @return void */ - appendToLog : function (functionName, text) { + appendToLog: function (functionName, text) { HTMLArea._appendToLog("[" + this.name + "::" + functionName + "]: " + text); }, /* @@ -4507,9 +4582,9 @@ /** * HTMLArea.Dialog class - * - * Every dialog should be an instance of this class - * + ********************************************* + * THIS OBJECT IS DEPRECATED AS OF TYPO3 4.4 * + ********************************************* */ HTMLArea.Dialog = HTMLArea.Base.extend({ Index: typo3/sysext/rtehtmlarea/htmlarea/plugins/DefaultClean/default-clean.js =================================================================== --- typo3/sysext/rtehtmlarea/htmlarea/plugins/DefaultClean/default-clean.js (révision 7222) +++ typo3/sysext/rtehtmlarea/htmlarea/plugins/DefaultClean/default-clean.js (copie de travail) @@ -29,46 +29,40 @@ * TYPO3 SVN ID: $Id$ */ DefaultClean = HTMLArea.Plugin.extend({ - - constructor : function(editor, pluginName) { + constructor: function(editor, pluginName) { this.base(editor, pluginName); }, - /* * This function gets called by the class constructor */ - configurePlugin : function(editor) { - + configurePlugin: function(editor) { this.pageTSConfiguration = this.editorConfiguration.buttons.cleanword; - /* * Registering plugin "About" information */ var pluginInformation = { - version : "1.2", - developer : "Stanislas Rolland", - developerUrl : "http://www.sjbr.ca/", - copyrightOwner : "Stanislas Rolland", - sponsor : "SJBR", - sponsorUrl : "http://www.sjbr.ca/", - license : "GPL" + version : '2.0', + developer : 'Stanislas Rolland', + developerUrl : 'http://www.sjbr.ca/', + copyrightOwner : 'Stanislas Rolland', + sponsor : 'SJBR', + sponsorUrl : 'http://www.sjbr.ca/', + license : 'GPL' }; this.registerPluginInformation(pluginInformation); - /* * Registering the (hidden) button */ - var buttonId = "CleanWord"; + var buttonId = 'CleanWord'; var buttonConfiguration = { id : buttonId, - tooltip : this.localize(buttonId + "-Tooltip"), - action : "onButtonPress", + tooltip : this.localize(buttonId + '-Tooltip'), + action : 'onButtonPress', hide : true, hideInContextMenu: true }; this.registerButton(buttonConfiguration); }, - /* * This function gets called when the button was pressed. * @@ -77,11 +71,10 @@ * * @return boolean false if action is completed */ - onButtonPress : function (editor, id, target) { + onButtonPress: function (editor, id, target) { // Could be a button or its hotkey var buttonId = this.translateHotKey(id); buttonId = buttonId ? buttonId : id; - this.clean(); return false; }, @@ -89,22 +82,25 @@ * This function gets called when the editor is generated */ onGenerate: function () { - var documentElement = Ext.get(Ext.isIE ? this.editor.document.body : this.editor.document.documentElement); - this.editor.iframe.mon(documentElement, 'paste', this.wordCleanHandler, this); - this.editor.iframe.mon(documentElement, 'dragdrop', this.wordCleanHandler, this); - this.editor.iframe.mon(documentElement, 'drop', this.wordCleanHandler, this); + this.editor.iframe.mon(Ext.get(Ext.isIE ? this.editor.document.body : this.editor.document.documentElement), 'paste', this.wordCleanHandler, this); }, - - clean : function () { + /* + * This function cleans all nodes in the node tree below the input node + * + * @param object node: the root of the node tree to clean + * + * @return void + */ + clean: function () { function clearClass(node) { var newc = node.className.replace(/(^|\s)mso.*?(\s|$)/ig,' '); if(newc != node.className) { node.className = newc; if(!/\S/.test(node.className)) { if (!HTMLArea.is_opera) { - node.removeAttribute("class"); + node.removeAttribute('class'); if (HTMLArea.is_ie) { - node.removeAttribute("className"); + node.removeAttribute('className'); } } else { node.className = ''; @@ -114,13 +110,13 @@ } function clearStyle(node) { if (HTMLArea.is_ie) var style = node.style.cssText; - else var style = node.getAttribute("style"); + else var style = node.getAttribute('style'); if (style) { var declarations = style.split(/\s*;\s*/); for (var i = declarations.length; --i >= 0;) { if(/^mso|^tab-stops/i.test(declarations[i]) || /^margin\s*:\s*0..\s+0..\s+0../i.test(declarations[i])) declarations.splice(i,1); } - node.setAttribute("style", declarations.join("; ")); + node.setAttribute('style', declarations.join('; ')); } } function stripTag(el) { @@ -175,11 +171,6 @@ * Handler for paste, dragdrop and drop events */ wordCleanHandler: function (event) { - // If we dropped an image dragged from the TYPO3 Image plugin, let's close the dialog window - if (typeof(HTMLArea.Dialog) != "undefined" && HTMLArea.Dialog.TYPO3Image) { - HTMLArea.Dialog.TYPO3Image.close(); - } else { - this.clean.defer(250, this); - } + this.clean.defer(250, this); } }); Index: typo3/sysext/rtehtmlarea/htmlarea/plugins/TYPO3HtmlParser/typo3html-parser.js =================================================================== --- typo3/sysext/rtehtmlarea/htmlarea/plugins/TYPO3HtmlParser/typo3html-parser.js (révision 7222) +++ typo3/sysext/rtehtmlarea/htmlarea/plugins/TYPO3HtmlParser/typo3html-parser.js (copie de travail) @@ -29,47 +29,41 @@ * TYPO3 SVN ID: $Id$ */ TYPO3HtmlParser = HTMLArea.Plugin.extend({ - - constructor : function(editor, pluginName) { + constructor: function(editor, pluginName) { this.base(editor, pluginName); }, - /* * This function gets called by the class constructor */ - configurePlugin : function(editor) { - + configurePlugin: function(editor) { this.pageTSConfiguration = this.editorConfiguration.buttons.cleanword; this.parseHtmlModulePath = this.pageTSConfiguration.pathParseHtmlModule; - /* * Registering plugin "About" information */ var pluginInformation = { - version : "1.8", - developer : "Stanislas Rolland", - developerUrl : "http://www.sjbr.ca/", - copyrightOwner : "Stanislas Rolland", - sponsor : "SJBR", - sponsorUrl : "http://www.sjbr.ca/", - license : "GPL" + version : '1.8', + developer : 'Stanislas Rolland', + developerUrl : 'http://www.sjbr.ca/', + copyrightOwner : 'Stanislas Rolland', + sponsor : 'SJBR', + sponsorUrl : 'http://www.sjbr.ca/', + license : 'GPL' }; this.registerPluginInformation(pluginInformation); - /* * Registering the (hidden) button */ - var buttonId = "CleanWord"; + var buttonId = 'CleanWord'; var buttonConfiguration = { id : buttonId, - tooltip : this.localize(buttonId + "-Tooltip"), - action : "onButtonPress", + tooltip : this.localize(buttonId + '-Tooltip'), + action : 'onButtonPress', hide : true, hideInContextMenu: true }; this.registerButton(buttonConfiguration); }, - /* * This function gets called when the button was pressed. * @@ -78,7 +72,7 @@ * * @return boolean false if action is completed */ - onButtonPress : function (editor, id, target) { + onButtonPress: function (editor, id) { // Could be a button or its hotkey var buttonId = this.translateHotKey(id); buttonId = buttonId ? buttonId : id; @@ -89,12 +83,8 @@ * This function gets called when the editor is generated */ onGenerate: function () { - var documentElement = Ext.get(Ext.isIE ? this.editor.document.body : this.editor.document.documentElement); - this.editor.iframe.mon(documentElement, 'paste', this.wordCleanHandler, this); - this.editor.iframe.mon(documentElement, 'dragdrop', this.wordCleanHandler, this); - this.editor.iframe.mon(documentElement, 'drop', this.wordCleanHandler, this); + this.editor.iframe.mon(Ext.get(Ext.isIE ? this.editor.document.body : this.editor.document.documentElement), 'paste', this.wordCleanHandler, this); }, - clean: function() { var editor = this.editor; if (Ext.isWebKit) { @@ -119,11 +109,6 @@ * Handler for paste, dragdrop and drop events */ wordCleanHandler: function (event) { - // If we dropped an image dragged from the TYPO3 Image plugin, let's close the dialog window - if (typeof(HTMLArea.Dialog) != "undefined" && HTMLArea.Dialog.TYPO3Image) { - HTMLArea.Dialog.TYPO3Image.close(); - } else { - this.clean.defer(250, this); - } + this.clean.defer(250, this); } }); Index: typo3/sysext/rtehtmlarea/htmlarea/plugins/TYPO3Image/typo3image.js =================================================================== --- typo3/sysext/rtehtmlarea/htmlarea/plugins/TYPO3Image/typo3image.js (révision 7222) +++ typo3/sysext/rtehtmlarea/htmlarea/plugins/TYPO3Image/typo3image.js (copie de travail) @@ -1,7 +1,7 @@ /*************************************************************** * Copyright notice * -* (c) 2005-2009 Stanislas Rolland +* (c) 2005-2010 Stanislas Rolland * All rights reserved * * This script is part of the TYPO3 project. The TYPO3 project is @@ -30,88 +30,94 @@ * TYPO3 SVN ID: $Id$ */ TYPO3Image = HTMLArea.Plugin.extend({ - - constructor : function(editor, pluginName) { + constructor: function(editor, pluginName) { this.base(editor, pluginName); }, - /* * This function gets called by the class constructor */ - configurePlugin : function(editor) { - + configurePlugin: function(editor) { this.pageTSConfiguration = this.editorConfiguration.buttons.image; this.imageModulePath = this.pageTSConfiguration.pathImageModule; - /* * Registering plugin "About" information */ var pluginInformation = { - version : "1.0", - developer : "Stanislas Rolland", - developerUrl : "http://www.fructifor.ca/", - copyrightOwner : "Stanislas Rolland", - sponsor : "Fructifor Inc.", - sponsorUrl : "http://www.fructifor.ca/", - license : "GPL" + version : '2.0', + developer : 'Stanislas Rolland', + developerUrl : 'http://www.sjbr.ca/', + copyrightOwner : 'Stanislas Rolland', + sponsor : 'SJBR', + sponsorUrl : 'http://www.sjbr.ca/', + license : 'GPL' }; this.registerPluginInformation(pluginInformation); - /* * Registering the button */ - var buttonId = "InsertImage"; + var buttonId = 'InsertImage'; var buttonConfiguration = { id : buttonId, - tooltip : this.localize(buttonId + "-Tooltip"), - action : "onButtonPress", + tooltip : this.localize(buttonId + '-Tooltip'), + action : 'onButtonPress', hotKey : (this.pageTSConfiguration ? this.pageTSConfiguration.hotKey : null), dialog : true }; this.registerButton(buttonConfiguration); - return true; }, - /* * This function gets called when the button was pressed * * @param object editor: the editor instance * @param string id: the button id or the key - * @param object target: the target element of the contextmenu event, when invoked from the context menu * * @return boolean false if action is completed */ - onButtonPress : function(editor, id, target) { + onButtonPress: function(editor, id) { // Could be a button or its hotkey var buttonId = this.translateHotKey(id); buttonId = buttonId ? buttonId : id; - var additionalParameter; - if (typeof(target) !== "undefined") { - this.image = target; - } else { - this.image = this.editor.getParentElement(); - } + this.image = this.editor.getParentElement(); if (this.image && !/^img$/i.test(this.image.nodeName)) { this.image = null; } if (this.image) { - additionalParameter = "&act=image"; + additionalParameter = '&act=image'; } - - this.dialog = this.openDialog("InsertImage", this.makeUrlFromModulePath(this.imageModulePath, additionalParameter), null, null, {width:550, height:350}, "yes"); + this.openContainerWindow( + buttonId, + buttonId + '-Tooltip', + this.getWindowDimensions( + { + width: 610, + height: 390 + }, + buttonId + ), + this.makeUrlFromModulePath(this.imageModulePath, additionalParameter) + ); + this.dialog.mon(Ext.get(Ext.isIE ? this.editor.document.body : this.editor.document.documentElement), 'drop', this.onDrop, this, {single: true}); return false; }, - /* * Insert the image - * This function is called from the typo3-image-popup + * This function is called from the TYPO3 image script */ - insertImage : function(image) { - this.editor.focusEditor(); + insertImage: function(image) { + this.editor.focus(); + this.restoreSelection(); this.editor.insertHTML(image); - this.dialog.close(); + this.close(); + }, + /* + * Handlers for drag and drop operations + */ + onDrop: function (event) { + if (Ext.isWebKit) { + this.editor.iframe.onDrop(); + } + this.close(); } }); - Index: typo3/sysext/rtehtmlarea/htmlarea/plugins/TYPO3Link/typo3link.js =================================================================== --- typo3/sysext/rtehtmlarea/htmlarea/plugins/TYPO3Link/typo3link.js (révision 7222) +++ typo3/sysext/rtehtmlarea/htmlarea/plugins/TYPO3Link/typo3link.js (copie de travail) @@ -30,34 +30,29 @@ * TYPO3 SVN ID: $Id$ */ TYPO3Link = HTMLArea.Plugin.extend({ - - constructor : function(editor, pluginName) { + constructor: function(editor, pluginName) { this.base(editor, pluginName); }, - /* * This function gets called by the class constructor */ - configurePlugin : function(editor) { - + configurePlugin: function(editor) { this.pageTSConfiguration = this.editorConfiguration.buttons.link; this.modulePath = this.pageTSConfiguration.pathLinkModule; this.classesAnchorUrl = this.pageTSConfiguration.classesAnchorUrl; - /* * Registering plugin "About" information */ var pluginInformation = { - version : "1.2", - developer : "Stanislas Rolland", - developerUrl : "http://www.sjbr.ca/", - copyrightOwner : "Stanislas Rolland", - sponsor : "SJBR", - sponsorUrl : "http://www.sjbr.ca/", - license : "GPL" + version : '2.0', + developer : 'Stanislas Rolland', + developerUrl : 'http://www.sjbr.ca/', + copyrightOwner : 'Stanislas Rolland', + sponsor : 'SJBR', + sponsorUrl : 'http://www.sjbr.ca/', + license : 'GPL' }; this.registerPluginInformation(pluginInformation); - /* * Registering the buttons */ @@ -68,7 +63,7 @@ var buttonConfiguration = { id : buttonId, tooltip : this.localize(buttonId.toLowerCase()), - action : "onButtonPress", + action : 'onButtonPress', hotKey : (this.pageTSConfiguration ? this.pageTSConfiguration.hotKey : null), context : button[1], selection : button[2], @@ -76,18 +71,15 @@ }; this.registerButton(buttonConfiguration); } - return true; - }, - + }, /* * The list of buttons added by this plugin */ - buttonList : [ - ["CreateLink", "a,img", false, true], - ["UnLink", "a", false, false] + buttonList: [ + ['CreateLink', 'a,img', false, true], + ['UnLink', 'a', false, false] ], - /* * This function gets called when the button was pressed * @@ -97,7 +89,7 @@ * * @return boolean false if action is completed */ - onButtonPress : function(editor, id, target) { + onButtonPress: function(editor, id, target) { // Could be a button or its hotkey var buttonId = this.translateHotKey(id); buttonId = buttonId ? buttonId : id; @@ -141,10 +133,20 @@ } } } - this.dialog = this.openDialog("CreateLink", this.makeUrlFromModulePath(this.modulePath, additionalParameter), null, null, {width:550, height:350}, "yes"); + this.openContainerWindow( + buttonId, + buttonId.toLowerCase(), + this.getWindowDimensions( + { + width: 550, + height: 350 + }, + buttonId + ), + this.makeUrlFromModulePath(this.modulePath, additionalParameter) + ); return false; }, - /* * Add a link to the selection. * This function is called from the TYPO3 link popup. @@ -160,6 +162,7 @@ createLink : function(theLink,cur_target,cur_class,cur_title,additionalValues) { var selection, range, anchorClass, imageNode = null, addIconAfterLink; this.editor.focusEditor(); + this.restoreSelection(); var node = this.editor.getParentElement(); var el = HTMLArea.getElementObject(node, "a"); if (el != null && /^a$/i.test(el.nodeName)) node = el; @@ -209,7 +212,7 @@ // We may have created multiple links in as many blocks this.setLinkAttributes(node, range, cur_target, cur_class, cur_title, imageNode, addIconAfterLink, additionalValues); } - this.dialog.close(); + this.close(); }, /* @@ -218,6 +221,7 @@ */ unLink : function() { this.editor.focusEditor(); + this.restoreSelection(); var node = this.editor.getParentElement(); var el = HTMLArea.getElementObject(node, "a"); if (el != null && /^a$/i.test(el.nodeName)) node = el; @@ -235,7 +239,7 @@ this.editor._doc.execCommand("Unlink", false, ""); } if (this.dialog) { - this.dialog.close(); + this.close(); } }, @@ -381,4 +385,3 @@ } } }); - Index: typo3/sysext/rtehtmlarea/htmlarea/plugins/UserElements/user-elements.js =================================================================== --- typo3/sysext/rtehtmlarea/htmlarea/plugins/UserElements/user-elements.js (révision 7222) +++ typo3/sysext/rtehtmlarea/htmlarea/plugins/UserElements/user-elements.js (copie de travail) @@ -1,7 +1,7 @@ /*************************************************************** * Copyright notice * -* (c) 2005-2009 Stanislas Rolland +* (c) 2005-2010 Stanislas Rolland * All rights reserved * * This script is part of the TYPO3 project. The TYPO3 project is @@ -29,49 +29,42 @@ * TYPO3 SVN ID: $Id$ */ UserElements = HTMLArea.Plugin.extend({ - - constructor : function(editor, pluginName) { + constructor: function(editor, pluginName) { this.base(editor, pluginName); }, - /* * This function gets called by the class constructor */ - configurePlugin : function(editor) { - + configurePlugin: function(editor) { this.pageTSConfiguration = this.editorConfiguration.buttons.user; this.userModulePath = this.pageTSConfiguration.pathUserModule; - /* * Registering plugin "About" information */ var pluginInformation = { - version : "1.6", - developer : "Stanislas Rolland", - developerUrl : "http://www.fructifor.ca/", - copyrightOwner : "Stanislas Rolland", - sponsor : "Fructifor Inc.", - sponsorUrl : "http://www.fructifor.ca/", - license : "GPL" + version : '2.0', + developer : 'Stanislas Rolland', + developerUrl : 'http://www.sjbr.ca/', + copyrightOwner : 'Stanislas Rolland', + sponsor : 'SJBR', + sponsorUrl : 'http://www.sjbr.ca/', + license : 'GPL' }; this.registerPluginInformation(pluginInformation); - /* * Registering the button */ - var buttonId = "UserElements"; + var buttonId = 'UserElements'; var buttonConfiguration = { id : buttonId, - tooltip : this.localize("Insert custom element"), - action : "onButtonPress", + tooltip : this.localize('Insert custom element'), + action : 'onButtonPress', hotKey : (this.pageTSConfiguration ? this.pageTSConfiguration.hotKey : null), dialog : true }; this.registerButton(buttonConfiguration); - return true; }, - /* * This function gets called when the button was pressed * @@ -80,9 +73,22 @@ * * @return boolean false if action is completed */ - onButtonPress : function(editor, id) { - this.dialog = this.openDialog("UserElements", this.makeUrlFromModulePath(this.userModulePath), null, null, {width:550, height:350}, "yes"); + onButtonPress: function(editor, id) { + // Could be a button or its hotkey + var buttonId = this.translateHotKey(id); + buttonId = buttonId ? buttonId : id; + this.openContainerWindow( + buttonId, + 'Insert custom element', + this.getWindowDimensions( + { + width: 550, + height: 350 + }, + buttonId + ), + this.makeUrlFromModulePath(this.userModulePath) + ); return false; } }); - Index: typo3/sysext/rtehtmlarea/htmlarea/skins/default/htmlarea.css =================================================================== --- typo3/sysext/rtehtmlarea/htmlarea/skins/default/htmlarea.css (révision 7222) +++ typo3/sysext/rtehtmlarea/htmlarea/skins/default/htmlarea.css (copie de travail) @@ -260,6 +260,9 @@ color: #000; border: 1px solid #A2AAB8; } +.htmlarea-window iframe.content-iframe { + background-color: #E4E0DB; +} .htmlarea-window .show-color { margin-top: 10px; margin-left: 5px; Index: typo3/sysext/rtehtmlarea/mod3/class.tx_rtehtmlarea_browse_links.php =================================================================== --- typo3/sysext/rtehtmlarea/mod3/class.tx_rtehtmlarea_browse_links.php (révision 7222) +++ typo3/sysext/rtehtmlarea/mod3/class.tx_rtehtmlarea_browse_links.php (copie de travail) @@ -3,7 +3,7 @@ * Copyright notice * * (c) 1999-2009 Kasper Skaarhoj (kasperYYYY@typo3.com) -* (c) 2005-2009 Stanislas Rolland +* (c) 2005-2010 Stanislas Rolland * All rights reserved * * This script is part of the TYPO3 project. The TYPO3 project is @@ -457,7 +457,6 @@ $bodyTagAdditions = $hookObject->addBodyTagAdditions($bodyTagAdditions); } } - $bodyTagAdditions['onLoad'] = 'initDialog();' . $bodyTagAdditions['onLoad']; return t3lib_div::implodeAttributes($bodyTagAdditions, TRUE); } @@ -471,16 +470,8 @@ // BEGIN accumulation of header JavaScript: $JScode = ''; $JScode.= ' - var dialog = window.opener.HTMLArea.Dialog.TYPO3Link; - var plugin = dialog.plugin; - var HTMLArea = window.opener.HTMLArea; - - function initDialog() { - window.dialog = window.opener.HTMLArea.Dialog.TYPO3Link; - window.plugin = dialog.plugin; - window.HTMLArea = window.opener.HTMLArea; - dialog.captureEvents("skipUnload"); - } + var plugin = window.parent.RTEarea["' . $this->editorNo . '"].editor.getPlugin("TYPO3Link"); + var HTMLArea = window.parent.HTMLArea; var add_href="'.($this->curUrlArray['href']?'&curUrl[href]='.rawurlencode($this->curUrlArray['href']):'').'"; var add_target="'.($this->setTarget?'&curUrl[target]='.rawurlencode($this->setTarget):'').'"; var add_class="'.($this->setClass?'&curUrl[class]='.rawurlencode($this->setClass):'').'"; Index: typo3/sysext/rtehtmlarea/mod3/class.tx_rtehtmlarea_dam_browse_links.php =================================================================== --- typo3/sysext/rtehtmlarea/mod3/class.tx_rtehtmlarea_dam_browse_links.php (révision 7222) +++ typo3/sysext/rtehtmlarea/mod3/class.tx_rtehtmlarea_dam_browse_links.php (copie de travail) @@ -290,7 +290,6 @@ // Creating backend template object: $this->doc = t3lib_div::makeInstance('template'); - $this->doc->bodyTagAdditions = 'onLoad="initDialog();"'; $this->doc->backPath = $BACK_PATH; } @@ -315,13 +314,8 @@ // BEGIN accumulation of header JavaScript: $JScode = ''; $JScode.= ' - var dialog = window.opener.HTMLArea.Dialog.TYPO3Link; - var plugin = dialog.plugin; - var HTMLArea = window.opener.HTMLArea; - function initDialog() { - dialog.captureEvents("skipUnload"); - } - + var plugin = window.parent.RTEarea["' . $this->editorNo . '"].editor.getPlugin("TYPO3Link"); + var HTMLArea = window.parent.HTMLArea; // This JavaScript is primarily for RTE/Link. jumpToUrl is used in the other cases as well... var add_href="'.($this->curUrlArray['href']?'&curUrl[href]='.rawurlencode($this->curUrlArray['href']):'').'"; var add_target="'.($this->setTarget?'&curUrl[target]='.rawurlencode($this->setTarget):'').'"; Index: typo3/sysext/rtehtmlarea/mod4/class.tx_rtehtmlarea_dam_browse_media.php =================================================================== --- typo3/sysext/rtehtmlarea/mod4/class.tx_rtehtmlarea_dam_browse_media.php (révision 7222) +++ typo3/sysext/rtehtmlarea/mod4/class.tx_rtehtmlarea_dam_browse_media.php (copie de travail) @@ -3,7 +3,7 @@ * Copyright notice * * (c) 1999-2009 Kasper Skaarhoj (kasper@typo3.com) -* (c) 2004-2009 Stanislas Rolland +* (c) 2004-2010 Stanislas Rolland * All rights reserved * * This script is part of the TYPO3 project. The TYPO3 project is @@ -29,7 +29,6 @@ * Displays image selector for the RTE * * @author Kasper Skaarhoj - * @author Stanislas Rolland * * $Id$ * */ @@ -247,7 +246,6 @@ // Creating backend template object: $this->doc = t3lib_div::makeInstance('template'); - $this->doc->bodyTagAdditions = 'onLoad="initDialog();"'; $this->doc->backPath = $BACK_PATH; } @@ -332,8 +330,7 @@ -