[TASK] Avoid use of Ext.isDefined 00/33700/2
authorStanislas Rolland <typo3@sjbr.ca>
Sat, 1 Nov 2014 17:05:38 +0000 (13:05 -0400)
committerStanislas Rolland <typo3@sjbr.ca>
Sat, 1 Nov 2014 17:14:33 +0000 (18:14 +0100)
Avoid useless overhead.

Releases: master
Resolves: #62609
Change-Id: I6b2f2805945d0e6a04b3617807f952cd30d8ede8
Reviewed-on: http://review.typo3.org/33700
Reviewed-by: Stanislas Rolland <typo3@sjbr.ca>
Tested-by: Stanislas Rolland <typo3@sjbr.ca>
15 files changed:
typo3/sysext/rtehtmlarea/Classes/RteHtmlAreaBase.php
typo3/sysext/rtehtmlarea/htmlarea/CSS/HTMLArea.CSS.Parser.js
typo3/sysext/rtehtmlarea/htmlarea/Configuration/HTMLArea.Config.js
typo3/sysext/rtehtmlarea/htmlarea/DOM/HTMLArea.DOM.Selection.js
typo3/sysext/rtehtmlarea/htmlarea/Editor/HTMLArea.Editor.js
typo3/sysext/rtehtmlarea/htmlarea/Editor/HTMLArea.Framework.js
typo3/sysext/rtehtmlarea/htmlarea/HTMLArea.js
typo3/sysext/rtehtmlarea/htmlarea/Util/HTMLArea.util.Color.js
typo3/sysext/rtehtmlarea/htmlarea/Util/Wrap.open.js
typo3/sysext/rtehtmlarea/htmlarea/plugins/BlockStyle/block-style.js
typo3/sysext/rtehtmlarea/htmlarea/plugins/Plugin.js
typo3/sysext/rtehtmlarea/htmlarea/plugins/SpellChecker/spell-checker.js
typo3/sysext/rtehtmlarea/htmlarea/plugins/TYPO3Link/typo3link.js
typo3/sysext/rtehtmlarea/htmlarea/plugins/TableOperations/table-operations.js
typo3/sysext/rtehtmlarea/htmlarea/plugins/TextStyle/text-style.js

index e4e3c23..14ee29d 100644 (file)
@@ -849,7 +849,7 @@ class RteHtmlAreaBase extends \TYPO3\CMS\Backend\Rte\AbstractRte {
         */
        protected function getRteInitJsCode() {
                return '
-                       if (typeof(RTEarea) == "undefined") {
+                       if (typeof RTEarea === "undefined") {
                                RTEarea = new Object();
                                RTEarea[0] = new Object();
                                RTEarea[0].version = "' . $GLOBALS['TYPO3_CONF_VARS']['EXTCONF'][$this->ID]['version'] . '";
@@ -859,7 +859,7 @@ class RteHtmlAreaBase extends \TYPO3\CMS\Backend\Rte\AbstractRte {
                                RTEarea[0].editedContentCSS = "' . GeneralUtility::createVersionNumberedFilename($this->editedContentCSS) . '";
                                RTEarea[0].hostUrl = "' . $this->hostURL . '";
                                RTEarea.init = function() {
-                                       if (typeof(HTMLArea) == "undefined" || !Ext.isReady) {
+                                       if (typeof HTMLArea === "undefined" || !Ext.isReady) {
                                                window.setTimeout("RTEarea.init();", 10);
                                        } else {
                                                Ext.QuickTips.init();
@@ -867,7 +867,7 @@ class RteHtmlAreaBase extends \TYPO3\CMS\Backend\Rte\AbstractRte {
                                        }
                                };
                                RTEarea.initEditor = function(editorNumber) {
-                                       if (typeof(HTMLArea) == "undefined" || !HTMLArea.isReady) {
+                                       if (typeof HTMLArea === "undefined" || !HTMLArea.isReady) {
                                                RTEarea.initEditor.defer(40, null, [editorNumber]);
                                        } else {
                                                HTMLArea.initEditor(editorNumber);
@@ -889,11 +889,11 @@ class RteHtmlAreaBase extends \TYPO3\CMS\Backend\Rte\AbstractRte {
         */
        public function registerRTEinJS($RTEcounter, $table = '', $uid = '', $field = '', $textAreaId = '') {
                $configureRTEInJavascriptString = '
-                       if (typeof(configureEditorInstance) == "undefined") {
+                       if (typeof configureEditorInstance === "undefined") {
                                configureEditorInstance = new Object();
                        }
                        configureEditorInstance["' . $textAreaId . '"] = function() {
-                               if (typeof(RTEarea) == "undefined" || typeof(HTMLArea) == "undefined") {
+                               if (typeof RTEarea === "undefined" || typeof HTMLArea === "undefined") {
                                        window.setTimeout("configureEditorInstance[\'' . $textAreaId . '\']();", 40);
                                } else {
                        editornumber = "' . $textAreaId . '";
index b0ec459..3d752d0 100644 (file)
@@ -65,11 +65,11 @@ HTMLArea.CSS.Parser = Ext.extend(Ext.util.Observable, {
         * @return      void
         */
        initiateParsing: function () {
-               if (this.editor.config.classesUrl && (typeof(HTMLArea.classesLabels) === 'undefined')) {
+               if (this.editor.config.classesUrl && typeof HTMLArea.classesLabels === 'undefined') {
                        this.editor.ajax.getJavascriptFile(this.editor.config.classesUrl, function (options, success, response) {
                                if (success) {
                                        try {
-                                               if (typeof(HTMLArea.classesLabels) === 'undefined') {
+                                               if (typeof HTMLArea.classesLabels === 'undefined') {
                                                        eval(response.responseText);
                                                }
                                        } catch(e) {
@@ -284,7 +284,7 @@ HTMLArea.CSS.Parser = Ext.extend(Ext.util.Observable, {
                for (nodeName in this.tags) {
                        var allowedClasses = {};
                        // Get classes allowed for all tags
-                       if (nodeName !== 'all' && Ext.isDefined(this.parsedClasses['all'])) {
+                       if (nodeName !== 'all' && typeof this.parsedClasses['all'] !== 'undefined') {
                                if (this.tags && this.tags[nodeName] && this.tags[nodeName].allowedClasses) {
                                        var allowed = this.tags[nodeName].allowedClasses;
                                        for (cssClass in this.parsedClasses['all']) {
@@ -297,7 +297,7 @@ HTMLArea.CSS.Parser = Ext.extend(Ext.util.Observable, {
                                }
                        }
                        // Merge classes allowed for nodeName
-                       if (Ext.isDefined(this.parsedClasses[nodeName])) {
+                       if (typeof this.parsedClasses[nodeName] !== 'undefined') {
                                if (this.tags && this.tags[nodeName] && this.tags[nodeName].allowedClasses) {
                                        var allowed = this.tags[nodeName].allowedClasses;
                                        for (cssClass in this.parsedClasses[nodeName]) {
@@ -314,7 +314,7 @@ HTMLArea.CSS.Parser = Ext.extend(Ext.util.Observable, {
                        this.parsedClasses[nodeName] = allowedClasses;
                }
                // If showTagFreeClasses is set and there is no allowedClasses clause on a tag, merge classes allowed for all tags
-               if (this.showTagFreeClasses && Ext.isDefined(this.parsedClasses['all'])) {
+               if (this.showTagFreeClasses && typeof this.parsedClasses['all'] !== 'undefined') {
                        for (nodeName in this.parsedClasses) {
                                if (nodeName !== 'all' && !this.tags[nodeName]) {
                                        for (cssClass in this.parsedClasses['all']) {
index a3089fa..bbb65cd 100644 (file)
@@ -153,10 +153,10 @@ HTMLArea.Config = Ext.extend(HTMLArea.Config, {
         * Register a hotkey with the editor configuration.
         */
        registerHotKey: function (hotKeyConfiguration) {
-               if (Ext.isDefined(this.hotKeyList[hotKeyConfiguration.id])) {
+               if (typeof this.hotKeyList[hotKeyConfiguration.id] !== 'undefined') {
                        HTMLArea.appendToLog('', 'HTMLArea.Config', 'registerHotKey', 'A hotkey with the same key ' + hotKeyConfiguration.id + ' already exists and will be overidden.', 'warn');
                }
-               if (Ext.isDefined(hotKeyConfiguration.cmd) && !Ext.isEmpty(hotKeyConfiguration.cmd) && Ext.isDefined(this.buttonsConfig[hotKeyConfiguration.cmd])) {
+               if (typeof hotKeyConfiguration.cmd !== 'undefined' && !Ext.isEmpty(hotKeyConfiguration.cmd) && typeof this.buttonsConfig[hotKeyConfiguration.cmd] !== 'undefined') {
                        this.hotKeyList[hotKeyConfiguration.id] = hotKeyConfiguration;
                        return true;
                } else {
index a8def68..3b1bbf9 100644 (file)
@@ -260,7 +260,7 @@ HTMLArea.DOM.Selection = Ext.extend(HTMLArea.DOM.Selection, {
                                } else {
                                        range.selectNode(node);
                                }
-                               if (typeof(endPoint) !== 'undefined') {
+                               if (typeof endPoint !== 'undefined') {
                                        range.collapse(endPoint);
                                }
                                this.selectRange(range);
@@ -296,7 +296,7 @@ HTMLArea.DOM.Selection = Ext.extend(HTMLArea.DOM.Selection, {
                                        range.selectNodeContents(node);
                                }
                        }
-                       if (typeof(endPoint) !== 'undefined') {
+                       if (typeof endPoint !== 'undefined') {
                                range.collapse(endPoint);
                        }
                        this.selectRange(range);
index e378454..1a8e09d 100644 (file)
@@ -231,7 +231,7 @@ HTMLArea.Editor = Ext.extend(Ext.util.Observable, {
                // Focus on the first editor that is not hidden
                for (var editorId in RTEarea) {
                        var RTE = RTEarea[editorId];
-                       if (!Ext.isDefined(RTE.editor) || (RTE.editor.isNested && !HTMLArea.util.TYPO3.allElementsAreDisplayed(RTE.editor.nestedParentElements.sorted))) {
+                       if (typeof RTE.editor === 'undefined' || (RTE.editor.isNested && !HTMLArea.util.TYPO3.allElementsAreDisplayed(RTE.editor.nestedParentElements.sorted))) {
                                continue;
                        } else {
                                RTE.editor.focus();
@@ -388,7 +388,7 @@ HTMLArea.Editor = Ext.extend(Ext.util.Observable, {
        registerPlugin: function (pluginName) {
                var plugin = HTMLArea[pluginName],
                        isRegistered = false;
-               if (typeof(plugin) !== 'undefined' && Ext.isFunction(plugin)) {
+               if (typeof plugin !== 'undefined' && Ext.isFunction(plugin)) {
                        var pluginInstance = new plugin(this, pluginName);
                        if (pluginInstance) {
                                var pluginInformation = pluginInstance.getPluginInformation();
index 71a64be..d39600f 100644 (file)
@@ -53,7 +53,7 @@ HTMLArea.Framework = Ext.extend(Ext.Panel, {
                var form = this.textArea.dom.form;
                if (form) {
                        if (Ext.isFunction(form.onreset)) {
-                               if (typeof(form.htmlAreaPreviousOnReset) == 'undefined') {
+                               if (typeof form.htmlAreaPreviousOnReset === 'undefined') {
                                        form.htmlAreaPreviousOnReset = [];
                                }
                                form.htmlAreaPreviousOnReset.push(form.onreset);
@@ -260,7 +260,7 @@ HTMLArea.Framework = Ext.extend(Ext.Panel, {
                this.toolbar.update();
                // Invoke previous reset handlers, if any
                var htmlAreaPreviousOnReset = event.getTarget().dom.htmlAreaPreviousOnReset;
-               if (typeof(htmlAreaPreviousOnReset) != 'undefined') {
+               if (typeof htmlAreaPreviousOnReset !== 'undefined') {
                        for (var i = 0, n = htmlAreaPreviousOnReset.length; i < n; i++) {
                                htmlAreaPreviousOnReset[i]();
                        }
index 87129ae..ce8cb8b 100644 (file)
@@ -109,17 +109,17 @@ Ext.apply(HTMLArea, {
         */
        appendToLog: function (editorId, objectName, functionName, text, type) {
                var str = 'RTE[' + editorId + '][' + objectName + '::' + functionName + ']: ' + text;
-               if (typeof(type) === 'undefined') {
+               if (typeof type === 'undefined') {
                        var type = 'info';
                }
-               if (typeof(console) !== 'undefined' && typeof(console) === 'object') {
+               if (typeof console !== 'undefined' && typeof console === 'object') {
                        // If console is TYPO3.Backend.DebugConsole, write only error messages
                        if (Ext.isFunction(console.addTab)) {
                                if (type === 'error') {
                                        console[type](str);
                                }
                        // IE may not have any console
-                       } else if (typeof(console[type]) !== 'undefined') {
+                       } else if (typeof console[type] !== 'undefined') {
                                console[type](str);
                        }
                }
index c1bc5a8..42b6e02 100644 (file)
@@ -19,7 +19,7 @@ HTMLArea.util.Color = function () {
                 * Returns hexadecimal color representation from a number or a rgb-style color.
                 */
                colorToHex: function(v) {
-                       if (typeof(v) === 'undefined' || v == null) {
+                       if (typeof v === 'undefined' || v == null) {
                                return '';
                        }
                        function hex(d) {
index 52c6ed5..1a3d927 100644 (file)
@@ -1,2 +1,2 @@
 // Avoid re-initialization on AJax call when HTMLArea object was already initialized
-if (typeof(HTMLArea) == 'undefined') {
+if (typeof HTMLArea === 'undefined') {
index a85f281..48193c0 100644 (file)
@@ -233,9 +233,9 @@ HTMLArea.BlockStyle = Ext.extend(HTMLArea.Plugin, {
                this.initializeDropDown(dropDown);
                if (this.blockStyles.isReady) {
                        var allowedClasses = {};
-                       if (Ext.isDefined(this.cssArray[nodeName])) {
+                       if (typeof this.cssArray[nodeName] !== 'undefined') {
                                allowedClasses = this.cssArray[nodeName];
-                       } else if (this.showTagFreeClasses && Ext.isDefined(this.cssArray['all'])) {
+                       } else if (this.showTagFreeClasses && typeof this.cssArray['all'] !== 'undefined') {
                                allowedClasses = this.cssArray['all'];
                        }
                        for (var cssClass in allowedClasses) {
index ee61b0f..c02eaf3 100644 (file)
@@ -273,9 +273,9 @@ HTMLArea.Plugin = Ext.extend(HTMLArea.Plugin, {
         * @return      string          the buttonId or ""
         */
        translateHotKey : function(key) {
-               if (typeof(this.editorConfiguration.hotKeyList[key]) !== "undefined") {
+               if (typeof this.editorConfiguration.hotKeyList[key] !== 'undefined') {
                        var buttonId = this.editorConfiguration.hotKeyList[key].cmd;
-                       if (typeof(buttonId) !== "undefined") {
+                       if (typeof buttonId !== 'undefined') {
                                return buttonId;
                        } else {
                                return "";
@@ -292,7 +292,7 @@ HTMLArea.Plugin = Ext.extend(HTMLArea.Plugin, {
         * @return      object          the hotkey configuration object
         */
        getHotKeyConfiguration: function(key) {
-               if (Ext.isDefined(this.editorConfiguration.hotKeyList[key])) {
+               if (typeof this.editorConfiguration.hotKeyList[key] !== 'undefined') {
                        return this.editorConfiguration.hotKeyList[key];
                } else {
                        return null;
@@ -364,8 +364,8 @@ HTMLArea.Plugin = Ext.extend(HTMLArea.Plugin, {
         * @return      string          localized label with CSH markup
         */
        getHelpTip: function (fieldName, label, pluginName) {
-               if (Ext.isDefined(TYPO3.ContextHelp)) {
-                       var pluginName = Ext.isDefined(pluginName) ? pluginName : this.name;
+               if (typeof TYPO3.ContextHelp !== 'undefined') {
+                       var pluginName = typeof pluginName !== 'undefined' ? pluginName : this.name;
                        if (!Ext.isEmpty(fieldName)) {
                                fieldName = fieldName.replace(/-|\s/gi, '_');
                        }
@@ -536,7 +536,7 @@ HTMLArea.Plugin = Ext.extend(HTMLArea.Plugin, {
                        // Close the window if the editor changes mode
                this.dialog.mon(this.editor, 'HTMLAreaEventModeChange', this.close, this, {single: true });
                this.saveSelection();
-               if (typeof(this.dialogueWindowDimensions) !== 'undefined') {
+               if (typeof this.dialogueWindowDimensions !== 'undefined') {
                        this.dialog.setPosition(this.dialogueWindowDimensions.positionFromLeft, this.dialogueWindowDimensions.positionFromTop);
                }
                this.dialog.show();
index 464ac80..31ab908 100644 (file)
@@ -516,7 +516,7 @@ HTMLArea.SpellChecker = Ext.extend(HTMLArea.Plugin, {
                                span.htmlareaId = id++;
                                span.htmlareaOriginalWord = span.firstChild.data;
                                span.htmlareaFixed = false;
-                               if (typeof(this.allWords[span.htmlareaOriginalWord]) == 'undefined') {
+                               if (typeof this.allWords[span.htmlareaOriginalWord] === 'undefined') {
                                        this.allWords[span.htmlareaOriginalWord] = [];
                                }
                                this.allWords[span.htmlareaOriginalWord].push(span);
index 9450820..75b6d3e 100644 (file)
@@ -67,11 +67,11 @@ HTMLArea.TYPO3Link = Ext.extend(HTMLArea.Plugin, {
         */
        onGenerate: function () {
                        // Download the definition of special anchor classes if not yet done
-               if (this.classesAnchorUrl && (typeof(HTMLArea.classesAnchorSetup) === 'undefined')) {
+               if (this.classesAnchorUrl && typeof HTMLArea.classesAnchorSetup === 'undefined') {
                        this.getJavascriptFile(this.classesAnchorUrl, function (options, success, response) {
                                if (success) {
                                        try {
-                                               if (typeof(HTMLArea.classesAnchorSetup) === 'undefined') {
+                                               if (typeof HTMLArea.classesAnchorSetup === 'undefined') {
                                                        eval(response.responseText);
                                                }
                                        } catch(e) {
@@ -95,11 +95,11 @@ HTMLArea.TYPO3Link = Ext.extend(HTMLArea.Plugin, {
                var buttonId = this.translateHotKey(id);
                buttonId = buttonId ? buttonId : id;
                        // Download the definition of special anchor classes if not yet done
-               if (this.classesAnchorUrl && (typeof(HTMLArea.classesAnchorSetup) === 'undefined')) {
+               if (this.classesAnchorUrl && typeof HTMLArea.classesAnchorSetup === 'undefined') {
                        this.getJavascriptFile(this.classesAnchorUrl, function (options, success, response) {
                                if (success) {
                                        try {
-                                               if (typeof(HTMLArea.classesAnchorSetup) === 'undefined') {
+                                               if (typeof HTMLArea.classesAnchorSetup === 'undefined') {
                                                        eval(response.responseText);
                                                }
                                                this.onButtonPress(editor, id, target);
index a5772f9..b6e6743 100644 (file)
@@ -786,17 +786,17 @@ HTMLArea.TableOperations = Ext.extend(HTMLArea.Plugin, {
                                                        var rowSpan = cell.rowSpan || 1;
                                                        var colSpan = cell.colSpan || 1;
                                                        var firstAvailCol;
-                                                       if(typeof(matrix[rowIndex])=="undefined") { matrix[rowIndex] = []; }
+                                                       if (typeof matrix[rowIndex] === 'undefined') { matrix[rowIndex] = []; }
                                                        // Find first available column in the first row
                                                        for (var k=0; k<matrix[rowIndex].length+1; k++) {
-                                                               if (typeof(matrix[rowIndex][k])=="undefined") {
+                                                               if (typeof matrix[rowIndex][k] === 'undefined') {
                                                                        firstAvailCol = k;
                                                                        break;
                                                                }
                                                        }
                                                        lookup[cellId] = firstAvailCol;
                                                        for (var k=rowIndex; k<rowIndex+rowSpan; k++) {
-                                                               if (typeof(matrix[k])=="undefined") { matrix[k] = []; }
+                                                               if (typeof matrix[k] === 'undefined') { matrix[k] = []; }
                                                                var matrixrow = matrix[k];
                                                                for (var l=firstAvailCol; l<firstAvailCol+colSpan; l++) {
                                                                        matrixrow[l] = "x";
@@ -1159,11 +1159,11 @@ HTMLArea.TableOperations = Ext.extend(HTMLArea.Plugin, {
         */
        reStyleTable: function (table) {
                if (table) {
-                       if (this.classesUrl && (typeof(HTMLArea.classesAlternating) === 'undefined' || typeof(HTMLArea.classesCounting) === 'undefined')) {
+                       if (this.classesUrl && (typeof HTMLArea.classesAlternating === 'undefined' || typeof HTMLArea.classesCounting === 'undefined')) {
                                this.getJavascriptFile(this.classesUrl, function (options, success, response) {
                                        if (success) {
                                                try {
-                                                       if (typeof(HTMLArea.classesAlternating) === 'undefined' || typeof(HTMLArea.classesCounting) === 'undefined') {
+                                                       if (typeof HTMLArea.classesAlternating === 'undefined' || typeof HTMLArea.classesCounting === 'undefined') {
                                                                eval(response.responseText);
                                                        }
                                                        this.reStyleTable(table);
@@ -1211,11 +1211,11 @@ HTMLArea.TableOperations = Ext.extend(HTMLArea.Plugin, {
         */
        removeAlternatingClasses: function (table, removeClass) {
                if (table) {
-                       if (this.classesUrl && typeof(HTMLArea.classesAlternating) === 'undefined') {
+                       if (this.classesUrl && typeof HTMLArea.classesAlternating === 'undefined') {
                                this.getJavascriptFile(this.classesUrl, function (options, success, response) {
                                        if (success) {
                                                try {
-                                                       if (typeof(HTMLArea.classesAlternating) === 'undefined') {
+                                                       if (typeof HTMLArea.classesAlternating === 'undefined') {
                                                                eval(response.responseText);
                                                        }
                                                        this.removeAlternatingClasses(table, removeClass);
@@ -1331,11 +1331,11 @@ HTMLArea.TableOperations = Ext.extend(HTMLArea.Plugin, {
         */
        removeCountingClasses: function (table, removeClass) {
                if (table) {
-                       if (this.classesUrl && typeof(HTMLArea.classesCounting) === 'undefined') {
+                       if (this.classesUrl && typeof HTMLArea.classesCounting === 'undefined') {
                                this.getJavascriptFile(this.classesUrl, function (options, success, response) {
                                        if (success) {
                                                try {
-                                                       if (typeof(HTMLArea.classesCounting) === 'undefined') {
+                                                       if (typeof HTMLArea.classesCounting === 'undefined') {
                                                                eval(response.responseText);
                                                        }
                                                        this.removeCountingClasses(table, removeClass);
@@ -1714,15 +1714,15 @@ HTMLArea.TableOperations = Ext.extend(HTMLArea.Plugin, {
                        items: [{
                                fieldLabel: this.getHelpTip('caption', 'Caption:'),
                                itemId: 'f_caption',
-                               value: Ext.isDefined(caption) ? caption.innerHTML : '',
+                               value: typeof caption !== 'undefined' ? caption.innerHTML : '',
                                width: 300,
-                               helpTitle: Ext.isDefined(TYPO3.ContextHelp) ? '' : this.localize('Description of the nature of the table')
+                               helpTitle: typeof TYPO3.ContextHelp !== 'undefined' ? '' : this.localize('Description of the nature of the table')
                                },{
                                fieldLabel: this.getHelpTip('summary', 'Summary:'),
                                itemId: 'f_summary',
                                value: !Ext.isEmpty(table) ? table.summary : '',
                                width: 300,
-                               helpTitle: Ext.isDefined(TYPO3.ContextHelp) ? '' : this.localize('Summary of the table purpose and structure')
+                               helpTitle: typeof TYPO3.ContextHelp !== 'undefined' ? '' : this.localize('Summary of the table purpose and structure')
                        }]
                };
        },
@@ -1743,7 +1743,7 @@ HTMLArea.TableOperations = Ext.extend(HTMLArea.Plugin, {
                                value: (this.properties.numberOfRows && this.properties.numberOfRows.defaultValue) ? this.properties.numberOfRows.defaultValue : '2',
                                width: 30,
                                minValue: 1,
-                               helpTitle: Ext.isDefined(TYPO3.ContextHelp) ? '' : this.localize('Number of rows')
+                               helpTitle: typeof TYPO3.ContextHelp !== 'undefined' ? '' : this.localize('Number of rows')
                        });
                        itemsConfig.push({
                                fieldLabel: this.getHelpTip('numberOfColumns', 'Number of columns'),
@@ -1752,7 +1752,7 @@ HTMLArea.TableOperations = Ext.extend(HTMLArea.Plugin, {
                                value: (this.properties.numberOfColumns && this.properties.numberOfColumns.defaultValue) ? this.properties.numberOfColumns.defaultValue : '4',
                                width: 30,
                                minValue: 1,
-                               helpTitle: Ext.isDefined(TYPO3.ContextHelp) ? '' : this.localize('Number of columns')
+                               helpTitle: typeof TYPO3.ContextHelp !== 'undefined' ? '' : this.localize('Number of columns')
                        });
                }
                if (this.removedProperties.indexOf('headers') == -1) {
@@ -1789,7 +1789,7 @@ HTMLArea.TableOperations = Ext.extend(HTMLArea.Plugin, {
                                fieldLabel: this.getHelpTip('tableHeaders', 'Headers:'),
                                labelSeparator: '',
                                itemId: 'f_headers',
-                               helpTitle: Ext.isDefined(TYPO3.ContextHelp) ? '' : this.localize('Table headers'),
+                               helpTitle: typeof TYPO3.ContextHelp !== 'undefined' ? '' : this.localize('Table headers'),
                                store: store,
                                width: (this.properties['headers'] && this.properties['headers'].width) ? this.properties['headers'].width : 200,
                                value: selected
@@ -1863,7 +1863,7 @@ HTMLArea.TableOperations = Ext.extend(HTMLArea.Plugin, {
                        xtype: 'combo',
                        itemId: fieldName,
                        fieldLabel: this.getHelpTip(fieldTitle, fieldLabel),
-                       helpTitle: Ext.isDefined(TYPO3.ContextHelp) ? '' : this.localize(fieldTitle),
+                       helpTitle: typeof TYPO3.ContextHelp !== 'undefined' ? '' : this.localize(fieldTitle),
                        width: (this.properties['style'] && this.properties['style'].width) ? this.properties['style'].width : 300,
                        store: new Ext.data.ArrayStore({
                                autoDestroy:  true,
@@ -1933,7 +1933,7 @@ HTMLArea.TableOperations = Ext.extend(HTMLArea.Plugin, {
                                xtype: 'combo',
                                fieldLabel: this.getHelpTip('languageCombo', 'Language', 'Language'),
                                itemId: 'f_lang',
-                               helpTitle: Ext.isDefined(TYPO3.ContextHelp) ? '' : this.localize('Language'),
+                               helpTitle: typeof TYPO3.ContextHelp !== 'undefined' ? '' : this.localize('Language'),
                                store: languageStore,
                                width: (this.properties['language'] && this.properties['language'].width) ? this.properties['language'].width : 200,
                                value: selectedLanguage
@@ -1944,7 +1944,7 @@ HTMLArea.TableOperations = Ext.extend(HTMLArea.Plugin, {
                                xtype: 'combo',
                                fieldLabel: this.getHelpTip('directionCombo', 'Text direction', 'Language'),
                                itemId: 'f_dir',
-                               helpTitle: Ext.isDefined(TYPO3.ContextHelp) ? '' : this.localize('Text direction'),
+                               helpTitle: typeof TYPO3.ContextHelp !== 'undefined' ? '' : this.localize('Text direction'),
                                store: new Ext.data.ArrayStore({
                                        autoDestroy:  true,
                                        fields: [ { name: 'text'}, { name: 'value'}],
@@ -1986,14 +1986,14 @@ HTMLArea.TableOperations = Ext.extend(HTMLArea.Plugin, {
                                value: !Ext.isEmpty(table) ? table.cellSpacing : '',
                                width: 30,
                                minValue: 0,
-                               helpTitle: Ext.isDefined(TYPO3.ContextHelp) ? '' : this.localize('Space between adjacent cells')
+                               helpTitle: typeof TYPO3.ContextHelp !== 'undefined' ? '' : this.localize('Space between adjacent cells')
                                },{
                                fieldLabel: this.getHelpTip('cellPadding', 'Cell padding:'),
                                itemId: 'f_padding',
                                value: !Ext.isEmpty(table) ? table.cellPadding : '',
                                width: 30,
                                minValue: 0,
-                               helpTitle: Ext.isDefined(TYPO3.ContextHelp) ? '' : this.localize('Space between content and border in cell')
+                               helpTitle: typeof TYPO3.ContextHelp !== 'undefined' ? '' : this.localize('Space between content and border in cell')
                        }]
                };
        },
@@ -2038,13 +2038,13 @@ HTMLArea.TableOperations = Ext.extend(HTMLArea.Plugin, {
                                itemId: 'f_st_width',
                                value: element ? this.getLength(element.style.width) : ((this.properties.width && this.properties.width.defaultValue) ? this.properties.width.defaultValue : ''),
                                width: 30,
-                               helpTitle: Ext.isDefined(TYPO3.ContextHelp) ? '' : this.localize(widthTitle)
+                               helpTitle: typeof TYPO3.ContextHelp !== 'undefined' ? '' : this.localize(widthTitle)
                        });
                        itemsConfig.push(Ext.apply({
                                xtype: 'combo',
                                fieldLabel: this.getHelpTip('Width unit', 'Width unit'),
                                itemId: 'f_st_widthUnit',
-                               helpTitle: Ext.isDefined(TYPO3.ContextHelp) ? '' : this.localize('Width unit'),
+                               helpTitle: typeof TYPO3.ContextHelp !== 'undefined' ? '' : this.localize('Width unit'),
                                store: widthUnitStore,
                                width: (this.properties['widthUnit'] && this.properties['widthUnit'].width) ? this.properties['widthUnit'].width : 70,
                                value: element ? (/%/.test(element.style.width) ? '%' : (/px/.test(element.style.width) ? 'px' : 'em')) : ((this.properties.widthUnit && this.properties.widthUnit.defaultValue) ? this.properties.widthUnit.defaultValue : '%')
@@ -2067,13 +2067,13 @@ HTMLArea.TableOperations = Ext.extend(HTMLArea.Plugin, {
                                itemId: 'f_st_height',
                                value: element ? this.getLength(element.style.height) : ((this.properties.height && this.properties.height.defaultValue) ? this.properties.height.defaultValue : ''),
                                width: 30,
-                               helpTitle: Ext.isDefined(TYPO3.ContextHelp) ? '' : this.localize(heightTitle)
+                               helpTitle: typeof TYPO3.ContextHelp !== 'undefined' ? '' : this.localize(heightTitle)
                        });
                        itemsConfig.push(Ext.apply({
                                xtype: 'combo',
                                fieldLabel: this.getHelpTip('Height unit', 'Height unit'),
                                itemId: 'f_st_heightUnit',
-                               helpTitle: Ext.isDefined(TYPO3.ContextHelp) ? '' : this.localize('Height unit'),
+                               helpTitle: typeof TYPO3.ContextHelp !== 'undefined' ? '' : this.localize('Height unit'),
                                store: heightUnitStore,
                                width: (this.properties['heightUnit'] && this.properties['heightUnit'].width) ? this.properties['heightUnit'].width : 70,
                                value: element ? (/%/.test(element.style.height) ? '%' : (/px/.test(element.style.height) ? 'px' : 'em')) : ((this.properties.heightUnit && this.properties.heightUnit.defaultValue) ? this.properties.heightUnit.defaultValue : '%')
@@ -2095,7 +2095,7 @@ HTMLArea.TableOperations = Ext.extend(HTMLArea.Plugin, {
                                fieldLabel: this.getHelpTip('tableFloat', 'Float:'),
                                labelSeparator: '',
                                itemId: 'f_st_float',
-                               helpTitle: Ext.isDefined(TYPO3.ContextHelp) ? '' : this.localize('Specifies where the table should float'),
+                               helpTitle: typeof TYPO3.ContextHelp !== 'undefined' ? '' : this.localize('Specifies where the table should float'),
                                store: floatStore,
                                width: (this.properties['float'] && this.properties['float'].width) ? this.properties['float'].width : 120,
                                value: element ? (Ext.get(element).hasClass(this.floatLeft) ? 'left' : (Ext.get(element).hasClass(this.floatRight) ? 'right' : 'not set')) : this.floatDefault
@@ -2137,7 +2137,7 @@ HTMLArea.TableOperations = Ext.extend(HTMLArea.Plugin, {
                        xtype: 'combo',
                        fieldLabel: this.getHelpTip('textAlignment', 'Text alignment:'),
                        itemId: 'f_st_textAlign',
-                       helpTitle: Ext.isDefined(TYPO3.ContextHelp) ? '' : this.localize('Horizontal alignment of text within cell'),
+                       helpTitle: typeof TYPO3.ContextHelp !== 'undefined' ? '' : this.localize('Horizontal alignment of text within cell'),
                        store: new Ext.data.ArrayStore({
                                autoDestroy:  true,
                                fields: [ { name: 'text'}, { name: 'value'}],
@@ -2157,7 +2157,7 @@ HTMLArea.TableOperations = Ext.extend(HTMLArea.Plugin, {
                        xtype: 'combo',
                        fieldLabel: this.getHelpTip('verticalAlignment', 'Vertical alignment:'),
                        itemId: 'f_st_vertAlign',
-                       helpTitle: Ext.isDefined(TYPO3.ContextHelp) ? '' : this.localize('Vertical alignment of content within cell'),
+                       helpTitle: typeof TYPO3.ContextHelp !== 'undefined' ? '' : this.localize('Vertical alignment of content within cell'),
                        store: new Ext.data.ArrayStore({
                                autoDestroy:  true,
                                fields: [ { name: 'text'}, { name: 'value'}],
@@ -2216,7 +2216,7 @@ HTMLArea.TableOperations = Ext.extend(HTMLArea.Plugin, {
                        xtype: 'combo',
                        fieldLabel: this.getHelpTip('borderStyle', 'Border style:'),
                        itemId: 'f_st_borderStyle',
-                       helpTitle: Ext.isDefined(TYPO3.ContextHelp) ? '' : this.localize('Border style'),
+                       helpTitle: typeof TYPO3.ContextHelp !== 'undefined' ? '' : this.localize('Border style'),
                        store: borderStyleStore,
                        width: (this.properties.borderStyle && this.properties.borderStyle.width) ? this.properties.borderStyle.width : 150,
                        value: selectedBorderStyle,
@@ -2233,7 +2233,7 @@ HTMLArea.TableOperations = Ext.extend(HTMLArea.Plugin, {
                        value: element ? this.getLength(element.style.borderWidth) : ((this.properties.borderWidth && this.properties.borderWidth.defaultValue) ? this.properties.borderWidth.defaultValue : ''),
                        width: 30,
                        minValue: 0,
-                       helpTitle: Ext.isDefined(TYPO3.ContextHelp) ? '' : this.localize('Border width'),
+                       helpTitle: typeof TYPO3.ContextHelp !== 'undefined' ? '' : this.localize('Border width'),
                        disabled: (selectedBorderStyle === 'none')
                });
                        // Border color
@@ -2244,7 +2244,7 @@ HTMLArea.TableOperations = Ext.extend(HTMLArea.Plugin, {
                        colors: this.editorConfiguration.disableColorPicker ? [] : null,
                        colorsConfiguration: this.editorConfiguration.colors,
                        value: HTMLArea.util.Color.colorToHex(element && element.style.borderColor ? element.style.borderColor : ((this.properties.borderColor && this.properties.borderColor.defaultValue) ? this.properties.borderColor.defaultValue : '')).substr(1, 6),
-                       helpTitle: Ext.isDefined(TYPO3.ContextHelp) ? '' : this.localize('Border color'),
+                       helpTitle: typeof TYPO3.ContextHelp !== 'undefined' ? '' : this.localize('Border color'),
                        disabled: (selectedBorderStyle === 'none')
                });
                if (nodeName === 'table') {
@@ -2254,7 +2254,7 @@ HTMLArea.TableOperations = Ext.extend(HTMLArea.Plugin, {
                                fieldLabel: this.getHelpTip('collapsedBorders', 'Collapsed borders'),
                                labelSeparator: ':',
                                itemId: 'f_st_borderCollapse',
-                               helpTitle: Ext.isDefined(TYPO3.ContextHelp) ? '' : this.localize('Collapsed borders'),
+                               helpTitle: typeof TYPO3.ContextHelp !== 'undefined' ? '' : this.localize('Collapsed borders'),
                                store: new Ext.data.ArrayStore({
                                        autoDestroy:  true,
                                        fields: [ { name: 'text'}, { name: 'value'}],
@@ -2273,7 +2273,7 @@ HTMLArea.TableOperations = Ext.extend(HTMLArea.Plugin, {
                                xtype: 'combo',
                                fieldLabel: this.getHelpTip('frames', 'Frames:'),
                                itemId: 'f_frames',
-                               helpTitle: Ext.isDefined(TYPO3.ContextHelp) ? '' : this.localize('Specifies which sides should have a border'),
+                               helpTitle: typeof TYPO3.ContextHelp !== 'undefined' ? '' : this.localize('Specifies which sides should have a border'),
                                store: new Ext.data.ArrayStore({
                                        autoDestroy:  true,
                                        fields: [ { name: 'text'}, { name: 'value'}],
@@ -2298,7 +2298,7 @@ HTMLArea.TableOperations = Ext.extend(HTMLArea.Plugin, {
                                xtype: 'combo',
                                fieldLabel: this.getHelpTip('rules', 'Rules:'),
                                itemId: 'f_rules',
-                               helpTitle: Ext.isDefined(TYPO3.ContextHelp) ? '' : this.localize('Specifies where rules should be displayed'),
+                               helpTitle: typeof TYPO3.ContextHelp !== 'undefined' ? '' : this.localize('Specifies where rules should be displayed'),
                                store: new Ext.data.ArrayStore({
                                        autoDestroy:  true,
                                        fields: [ { name: 'text'}, { name: 'value'}],
@@ -2385,7 +2385,7 @@ HTMLArea.TableOperations = Ext.extend(HTMLArea.Plugin, {
                        itemId: 'f_st_backgroundImage',
                        value: element && element.style.backgroundImage.match(/url\(\s*(.*?)\s*\)/) ? RegExp.$1 : '',
                        width: (this.properties.backgroundImage && this.properties.backgroundImage.width) ? this.properties.backgroundImage.width : 300,
-                       helpTitle: Ext.isDefined(TYPO3.ContextHelp) ? '' : this.localize('URL of the background image'),
+                       helpTitle: typeof TYPO3.ContextHelp !== 'undefined' ? '' : this.localize('URL of the background image'),
                        helpIcon: true
                });
                return {
@@ -2445,7 +2445,7 @@ HTMLArea.TableOperations = Ext.extend(HTMLArea.Plugin, {
                        xtype: 'combo',
                        fieldLabel: column ? this.getHelpTip('columnCellsType', 'Type of cells of the column') : this.getHelpTip('cellType', 'Type of cell'),
                        itemId: 'f_cell_type',
-                       helpTitle: Ext.isDefined(TYPO3.ContextHelp) ? '' : this.localize(column ? 'Specifies the type of cells' : 'Specifies the type of cell'),
+                       helpTitle: typeof TYPO3.ContextHelp !== 'undefined' ? '' : this.localize(column ? 'Specifies the type of cells' : 'Specifies the type of cell'),
                        store: new Ext.data.ArrayStore({
                                autoDestroy:  true,
                                fields: [ { name: 'text'}, { name: 'value'}],
@@ -2466,7 +2466,7 @@ HTMLArea.TableOperations = Ext.extend(HTMLArea.Plugin, {
                                fieldLabel: this.getHelpTip('cellAbbreviation', 'Abbreviation'),
                                labelSeparator: ':',
                                itemId: 'f_cell_abbr',
-                               helpTitle: Ext.isDefined(TYPO3.ContextHelp) ? '' : this.localize('Header abbreviation'),
+                               helpTitle: typeof TYPO3.ContextHelp !== 'undefined' ? '' : this.localize('Header abbreviation'),
                                width: 300,
                                value: element.abbr,
                                hideMode: 'visibility',
@@ -2516,7 +2516,7 @@ HTMLArea.TableOperations = Ext.extend(HTMLArea.Plugin, {
                        xtype: 'combo',
                        fieldLabel: this.getHelpTip('rowGroup', 'Row group:'),
                        itemId: 'f_rowgroup',
-                       helpTitle: Ext.isDefined(TYPO3.ContextHelp) ? '' : this.localize('Table section'),
+                       helpTitle: typeof TYPO3.ContextHelp !== 'undefined' ? '' : this.localize('Table section'),
                        store: new Ext.data.ArrayStore({
                                autoDestroy:  true,
                                fields: [ { name: 'text'}, { name: 'value'}],
@@ -2542,7 +2542,7 @@ HTMLArea.TableOperations = Ext.extend(HTMLArea.Plugin, {
                        fieldLabel: this.localize('Make cells header cells'),
                        labelSeparator: ':',
                        itemId: 'f_convertCells',
-                       helpTitle: Ext.isDefined(TYPO3.ContextHelp) ? '' : this.localize('Make cells header cells'),
+                       helpTitle: typeof TYPO3.ContextHelp !== 'undefined' ? '' : this.localize('Make cells header cells'),
                        value: false,
                        hideMode: 'visibility',
                        hidden: true,
index 5ec74e4..01cf163 100644 (file)
@@ -306,9 +306,9 @@ HTMLArea.TextStyle = Ext.extend(HTMLArea.Plugin, {
                if (this.textStyles.isReady) {
                        var allowedClasses = {};
                        if (this.REInlineTags.test(nodeName)) {
-                               if (Ext.isDefined(this.cssArray[nodeName])) {
+                               if (typeof this.cssArray[nodeName] !== 'undefined') {
                                        allowedClasses = this.cssArray[nodeName];
-                               } else if (this.showTagFreeClasses && Ext.isDefined(this.cssArray['all'])) {
+                               } else if (this.showTagFreeClasses && typeof this.cssArray['all'] !== 'undefined') {
                                        allowedClasses = this.cssArray['all'];
                                }
                        }