[!!!][TASK] Remove ExtJS Quicktips where possible 59/41559/5
authorFrank Nägler <typo3@naegler.net>
Fri, 17 Jul 2015 10:56:36 +0000 (12:56 +0200)
committerWouter Wolters <typo3@wouterwolters.nl>
Fri, 17 Jul 2015 13:32:45 +0000 (15:32 +0200)
This patch removes the usage of Quicktips where possible and remove the
enableExtJSQuickTips function of PageRenderer.

RTE and workspaces still make use of Quicktips, this will be cleaned up
with another patch.

Resolves: #68276
Releases: master
Change-Id: I9834f9d1d40333971f55312e6b9de7f2402619b8
Reviewed-on: http://review.typo3.org/41559
Reviewed-by: Georg Ringer <georg.ringer@gmail.com>
Tested-by: Georg Ringer <georg.ringer@gmail.com>
Reviewed-by: Wouter Wolters <typo3@wouterwolters.nl>
Tested-by: Wouter Wolters <typo3@wouterwolters.nl>
13 files changed:
typo3/sysext/backend/Classes/Controller/BackendController.php
typo3/sysext/backend/Classes/Controller/BackendLayoutWizardController.php
typo3/sysext/backend/Classes/Form/FormEngine.php
typo3/sysext/backend/Resources/Public/JavaScript/grideditor.js
typo3/sysext/core/Classes/Page/PageRenderer.php
typo3/sysext/core/Documentation/Changelog/master/Breaking-68276-RemoveExtJSQuicktipsIfPossible.rst [new file with mode: 0644]
typo3/sysext/form/Resources/Public/JavaScript/Wizard/Initialize.js
typo3/sysext/frontend/Classes/Page/PageGenerator.php
typo3/sysext/rtehtmlarea/Classes/Form/Element/RichTextElement.php
typo3/sysext/rtehtmlarea/Resources/Public/JavaScript/Plugins/ContextMenu.js
typo3/sysext/t3editor/Resources/Private/tsref.xml
typo3/sysext/workspaces/Classes/Controller/PreviewController.php
typo3/sysext/workspaces/Classes/Controller/ReviewController.php

index 5c66fe3..34bf85c 100644 (file)
@@ -114,7 +114,6 @@ class BackendController {
                $this->pageRenderer->loadExtJS();
                // included for the module menu JavaScript, please note that this is subject to change
                $this->pageRenderer->loadJquery();
-               $this->pageRenderer->enableExtJSQuickTips();
                $this->pageRenderer->addJsInlineCode('consoleOverrideWithDebugPanel', '//already done', FALSE);
                $this->pageRenderer->addExtDirectCode();
                // Add default BE javascript
index 9abf896..ece63ce 100644 (file)
@@ -83,6 +83,7 @@ class BackendLayoutWizardController {
                $pageRenderer = GeneralUtility::makeInstance(PageRenderer::class);
                $pageRenderer->loadExtJS();
                $pageRenderer->addJsFile(ExtensionManagementUtility::extRelPath('backend') . 'Resources/Public/JavaScript/grideditor.js');
+               $pageRenderer->loadRequireJsModule('TYPO3/CMS/Backend/Tooltip');
                $pageRenderer->addInlineSetting('ContextHelp', 'moduleUrl', BackendUtility::getModuleUrl('help_cshmanual'));
                $pageRenderer->addJsInlineCode('storeData', '
                        function storeData(data) {
@@ -177,7 +178,6 @@ class BackendLayoutWizardController {
                                }
                        }
                }
-               $pageRenderer->enableExtJSQuickTips();
                $pageRenderer->addExtOnReadyCode('
                        t3Grid = new TYPO3.Backend.t3Grid({
                                data: ' . json_encode($rows, JSON_HEX_QUOT | JSON_HEX_TAG | JSON_HEX_AMP | JSON_HEX_APOS) . ',
index 08204e5..30aa048 100644 (file)
@@ -1254,8 +1254,6 @@ class FormEngine {
                        $pageRenderer->loadPrototype();
                        $pageRenderer->loadJquery();
                        $pageRenderer->loadExtJS();
-                       // rtehtmlarea needs extjs quick tips (?)
-                       $pageRenderer->enableExtJSQuickTips();
                        $beUserAuth = $this->getBackendUserAuthentication();
                        // Make textareas resizable and flexible ("autogrow" in height)
                        $textareaSettings = array(
index b447f00..79c8c3d 100644 (file)
@@ -357,10 +357,14 @@ TYPO3.Backend.t3Grid = Ext.extend(Ext.Component, {
                                tabIndex: 1,
                                listeners: {
                                        render: function(c) {
-                                               Ext.QuickTips.register({
-                                                       target: c,
-                                                       text: TYPO3.l10n.localize('nameHelp')
+                                               c.getEl().set({
+                                                       'data-toggle': 'tooltip',
+                                                       'data-placement': 'bottom',
+                                                       'data-title': TYPO3.l10n.localize('nameHelp')
                                                });
+                                       },
+                                       afterrender: function(cmp) {
+                                               TYPO3.Tooltip.initialize('[data-toggle="tooltip"]');
                                        }
                                }
                        });
@@ -373,10 +377,14 @@ TYPO3.Backend.t3Grid = Ext.extend(Ext.Component, {
                                tabIndex: 2,
                                listeners: {
                                        render: function(c) {
-                                               Ext.QuickTips.register({
-                                                       target: c,
-                                                       text: TYPO3.l10n.localize('columnHelp')
+                                               c.getEl().set({
+                                                       'data-toggle': 'tooltip',
+                                                       'data-placement': 'bottom',
+                                                       'data-title': TYPO3.l10n.localize('columnHelp')
                                                });
+                                       },
+                                       afterrender: function(cmp) {
+                                               TYPO3.Tooltip.initialize('[data-toggle="tooltip"]');
                                        }
                                }
                        });
index de307b9..526a840 100644 (file)
@@ -386,11 +386,6 @@ class PageRenderer implements \TYPO3\CMS\Core\SingletonInterface {
        protected $extJScss = TRUE;
 
        /**
-        * @var bool
-        */
-       protected $enableExtJSQuickTips = FALSE;
-
-       /**
         * @var array
         */
        protected $inlineLanguageLabels = array();
@@ -1686,16 +1681,6 @@ class PageRenderer implements \TYPO3\CMS\Core\SingletonInterface {
        }
 
        /**
-        * Enables ExtJs QuickTips
-        * Need extJs loaded
-        *
-        * @return void
-        */
-       public function enableExtJSQuickTips() {
-               $this->enableExtJSQuickTips = TRUE;
-       }
-
-       /**
         * Call this function to load debug version of ExtJS. Use this for development only
         *
         * @return void
@@ -2137,7 +2122,6 @@ class PageRenderer implements \TYPO3\CMS\Core\SingletonInterface {
                                Ext.SSL_SECURE_URL = "' . htmlspecialchars(GeneralUtility::locationHeaderUrl(($this->backPath . 'gfx/clear.gif'))) . '";' . LF
                                . $inlineSettings
                                . 'Ext.onReady(function() {'
-                                       . ($this->enableExtJSQuickTips ? 'Ext.QuickTips.init();' . LF : '')
                                        . $code
                                . ' });'
                                . $this->inlineJavascriptWrap[1];
diff --git a/typo3/sysext/core/Documentation/Changelog/master/Breaking-68276-RemoveExtJSQuicktipsIfPossible.rst b/typo3/sysext/core/Documentation/Changelog/master/Breaking-68276-RemoveExtJSQuicktipsIfPossible.rst
new file mode 100644 (file)
index 0000000..40860ed
--- /dev/null
@@ -0,0 +1,35 @@
+=====================================================
+Breaking: #68276 - Remove ExtJS Quicktips if possible
+=====================================================
+
+Description
+===========
+
+The method ``PageRenderer::enableExtJSQuickTips()``, which was used to enable ExtJS quicktips, has been removed.
+In some places like RTE or workspaces the Quicktips still in use, but will be removed as soon as possible.
+
+
+Impact
+======
+
+All calls to the PHP method will throw a fatal error.
+
+
+Affected Installations
+======================
+
+Instances which make use of ``PageRenderer::enableExtJSQuickTips()``.
+
+
+Migration
+=========
+
+No migration, use bootstrap tooltips, which work out of the box as alternative.
+Simple add ``data-toggle="tooltip"`` and ``data-title="youe tooltip"`` to any element you want.
+
+Example
+-------
+
+.. code-block:: html
+
+       <a href="#" data-toggle="tooltip" data-title="My very nice title">My Link</a>
index a0a379f..421fcc6 100644 (file)
  * @return void
  */
 Ext.onReady(function() {
-               // Initialize QuickTips (Can be used anywhere)
-       Ext.QuickTips.init();
                // Instantiate new viewport
        var viewport = new TYPO3.Form.Wizard.Viewport({});
                // When the window is resized, the viewport has to be resized as well
        Ext.EventManager.onWindowResize(viewport.doLayout, viewport);
-});
\ No newline at end of file
+});
index 30bfb73..43d544f 100644 (file)
@@ -597,9 +597,6 @@ class PageGenerator {
                                if ($tsfe->pSetup['javascriptLibs.']['ExtJs.']['debug']) {
                                        $pageRenderer->enableExtJsDebug();
                                }
-                               if ($tsfe->pSetup['javascriptLibs.']['ExtJs.']['quickTips']) {
-                                       $pageRenderer->enableExtJSQuickTips();
-                               }
                        }
                }
                // JavaScript library files
index effe47e..2dd2cc0 100644 (file)
@@ -664,7 +664,6 @@ class RichTextElement extends AbstractFormElement {
                                                        RTEarea.init();
                                                }, 10);
                                        } else {
-                                               Ext.QuickTips.init();
                                                HTMLArea.init();
                                        }
                                };
index f37f3f6..f6296d8 100644 (file)
@@ -282,9 +282,6 @@ define('TYPO3/CMS/Rtehtmlarea/Plugins/ContextMenu',
                 * Handler invoked when the editor is about to be destroyed
                 */
                onBeforeDestroy: function (event) {
-                       this.menu.items.each(function (menuItem) {
-                               Ext.QuickTips.unregister(menuItem);
-                       });
                        this.menu.removeAll(true);
                        this.menu.destroy();
                }
index 92b7c49..4b0b37c 100644 (file)
@@ -5929,9 +5929,6 @@ javascriptLibs {
      # include default theme
    ExtJs.theme = 1
 
-     # initialize QuickTips
-   ExtJs.quickTips = 1
-
      # includes ExtJS debug file (uncompressed)
    ExtJs.debug = 1
 }
index 89a5a01..f2eec66 100644 (file)
@@ -46,7 +46,6 @@ class PreviewController extends AbstractController {
                $resourcePath = ExtensionManagementUtility::extRelPath('workspaces') . 'Resources/Public/Css/preview.css';
                $GLOBALS['TBE_STYLES']['extJS']['theme'] = $resourcePath;
                $this->pageRenderer->loadExtJS();
-               $this->pageRenderer->enableExtJSQuickTips();
                // Load  JavaScript:
                $this->pageRenderer->addExtDirectCode(array(
                        'TYPO3.Workspaces',
index b7bff3c..b120e44 100644 (file)
@@ -140,7 +140,6 @@ class ReviewController extends AbstractController {
                        $defaultFlashMessageQueue->enqueue($flashMessage);
                }
                $this->pageRenderer->loadExtJS();
-               $this->pageRenderer->enableExtJSQuickTips();
                $states = $GLOBALS['BE_USER']->uc['moduleData']['Workspaces']['States'];
                $this->pageRenderer->addInlineSetting('Workspaces', 'States', $states);
                // Load  JavaScript: