[BUGFIX] Missing renames of addClass and removeClass
authorSteffen Ritter <info@rs-websystems.de>
Sun, 18 Dec 2011 18:11:11 +0000 (19:11 +0100)
committerOliver Hader <oliver@typo3.org>
Mon, 19 Dec 2011 17:21:47 +0000 (18:21 +0100)
With ExtJS4 the function names of addClass and removeClass have
been renamed to addCls and removeCls at all places to have only
one name for the same function throughout the Framework.

Not all occurences within Core have been overworked within the
ExtJS 4 Migration. This is tackled now.

Note: ext:form, ext:workspaces and ext:em are excluded as there
are special Tasks for these extensions.

Change-Id: If54040a01b061766ff867d1368e9b5fa48631b58
Fixes: #32673
Releases: 4.7
Reviewed-on: http://review.typo3.org/7370
Reviewed-by: Georg Ringer
Tested-by: Georg Ringer
Reviewed-by: Philipp Gampe
Tested-by: Philipp Gampe
Reviewed-by: Oliver Hader
Tested-by: Oliver Hader
t3lib/js/extjs/tree/tree.js
typo3/sysext/cms/layout/res/typo3.pageModule.js

index bbd2624..9396ed7 100644 (file)
@@ -86,7 +86,7 @@ Ext.define('TYPO3.Components.Tree.StandardTree', {
                var text = filterText.getValue();
                Ext.each(this.hiddenNodes, function(node) {
                        node.ui.show();
-                       node.ui.removeClass('bgColor6');
+                       node.ui.removeCls('bgColor6');
                });
                if (!text) {
                        this.filter.clear();
@@ -105,7 +105,7 @@ Ext.define('TYPO3.Components.Tree.StandardTree', {
                                        node.ui.hide();
                                        me.hiddenNodes.push(node);
                                } else {
-                                       node.ui.addClass('bgColor6');
+                                       node.ui.addCls('bgColor6');
                                }
                        }
                }, this);
@@ -222,9 +222,9 @@ TYPO3.Components.Tree.TcaCheckChangeHandler = function(checkedNode, checked) {
                return false;
        }
        if (checked) {
-               checkedNode.getUI().addClass('complete');
+               checkedNode.getUI().addCls('complete');
        } else {
-               checkedNode.getUI().removeClass('complete');
+               checkedNode.getUI().removeCls('complete');
        }
        var selected = [];
        this.root.cascade(function(node) {
index a1baaee..6296c22 100644 (file)
@@ -41,7 +41,7 @@ var typo3pageModule = {
         */
        showSpinner: function(){
                typo3pageModule.spinner = new Element('div');
-               Ext.get(typo3pageModule.spinner).addClass('loadingSpinner').fadeIn({ endOpacity: .75, duration: 1});
+               Ext.get(typo3pageModule.spinner).addCls('loadingSpinner').fadeIn({ endOpacity: .75, duration: 1});
 
                Ext.select('body').appendChild(typo3pageModule.spinner);
        },
@@ -58,7 +58,7 @@ var typo3pageModule = {
        enableContentHeader: function(e,t){
                var parent = Ext.get(t).findParent('div.contentElement',null,true);
                parent.child('div.ttContentHeader').show();
-               parent.addClass('active')
+               parent.addCls('active')
        },
 
        /**
@@ -69,7 +69,7 @@ var typo3pageModule = {
        disableContentHeader: function(e,t){
                var parent = Ext.get(t).findParent('div.contentElement',null,true);
                parent.child('div.ttContentHeader').hide();
-               parent.removeClass('active');
+               parent.removeCls('active');
 
        },
 
@@ -130,7 +130,7 @@ var typo3pageModule = {
         */
        highlightLanguageDropZones: function(languageId){
                Ext.select('div.dropZone.language_'+languageId).each(function(el){
-                       el.addClass('active');
+                       el.addCls('active');
                });
 
                Ext.select('table.typo3-page-ceFooter').each(
@@ -143,7 +143,7 @@ var typo3pageModule = {
         */
        unhighlightAllDropZones: function(){
                Ext.select('div.dropZone').each(function(el){
-                       el.removeClass('active');
+                       el.removeCls('active');
                });
                Ext.select('table.typo3-page-ceFooter').each(
                        function(el){   el.show(); }
@@ -158,22 +158,22 @@ var typo3pageModule = {
         * @param Ext.Element element
         */
        reduceDraggedElement: function(element){
-               element.select('table.typo3-page-ceHeader').addClass('displayNone');
-           element.select('span.exampleContent').addClass('displayNone');
-           element.select('div.contentElementDropZoneAfter').addClass('displayNone');
-           element.addClass('onDrag');
-
-           var footerTable = element.select('table.typo3-page-ceFooter');
-           if(footerTable != null){
-               footerTable.addClass('displayNone');
-           }
+               element.select('table.typo3-page-ceHeader').addCls('displayNone');
+               element.select('span.exampleContent').addCls('displayNone');
+               element.select('div.contentElementDropZoneAfter').addCls('displayNone');
+               element.addCls('onDrag');
+
+               var footerTable = element.select('table.typo3-page-ceFooter');
+               if(footerTable != null){
+                       footerTable.addCls('displayNone');
+               }
 
-           var colSubHeader = element.select('tr.colSubHeader td');
-           if(colSubHeader != null){
-               colSubHeader.addClass('displayNone');
-           }
+               var colSubHeader = element.select('tr.colSubHeader td');
+               if(colSubHeader != null){
+                       colSubHeader.addCls('displayNone');
+               }
 
-           element.setStyle('z-index',999);
+               element.setStyle('z-index',999);
        },
 
        /**
@@ -185,13 +185,13 @@ var typo3pageModule = {
        enrichDraggedElement: function(element){
                Ext.get(typo3pageModule.placeholder).remove();
 
-               element.select('table.typo3-page-ceHeader').removeClass('displayNone');
-           element.select('span.exampleContent').removeClass('displayNone');
-           element.select('div.contentElementDropZoneAfter').removeClass('displayNone');
+               element.select('table.typo3-page-ceHeader').removeCls('displayNone');
+           element.select('span.exampleContent').removeCls('displayNone');
+           element.select('div.contentElementDropZoneAfter').removeCls('displayNone');
            element.setStyle('z-index',null);
-           element.removeClass('onDrag');
+           element.removeCls('onDrag');
            var footerTable = element.select('table.typo3-page-ceFooter');
-           if(footerTable != null){ footerTable.removeClass('displayNone'); }
+           if(footerTable != null){ footerTable.removeCls('displayNone'); }
        },
 
 
@@ -334,7 +334,7 @@ var typo3pageModule = {
        enableDropZone: function(evtObj, targetElId) {
                if (targetElId != this.el.dom.parentNode.id) {
                        var dropEl = Ext.get(targetElId);
-                       dropEl.addClass('validDrop');
+                       dropEl.addCls('validDrop');
                }
        },
        /**
@@ -347,7 +347,7 @@ var typo3pageModule = {
                if (targetElId != this.el.dom.parentNode.id) {
 
                        var dropEl = Ext.get(targetElId);
-                       dropEl.removeClass('validDrop');
+                       dropEl.removeCls('validDrop');
                }
        }
 }
@@ -398,7 +398,7 @@ var typo3pageModule = {
         */
        showSpinner: function(){
                typo3pageModule.spinner = new Element('div');
-               Ext.get(typo3pageModule.spinner).addClass('loadingSpinner').fadeIn({ endOpacity: .75, duration: 1});
+               Ext.get(typo3pageModule.spinner).addCls('loadingSpinner').fadeIn({ endOpacity: .75, duration: 1});
 
                Ext.select('body').appendChild(typo3pageModule.spinner);
        },
@@ -415,7 +415,7 @@ var typo3pageModule = {
        enableContentHeader: function(e,t){
                var parent = Ext.get(t).findParent('div.contentElement',null,true);
                parent.child('div.ttContentHeader').show();
-               parent.addClass('active')
+               parent.addCls('active')
        },
 
        /**
@@ -426,7 +426,7 @@ var typo3pageModule = {
        disableContentHeader: function(e,t){
                var parent = Ext.get(t).findParent('div.contentElement',null,true);
                parent.child('div.ttContentHeader').hide();
-               parent.removeClass('active');
+               parent.removeCls('active');
 
        },
 
@@ -487,7 +487,7 @@ var typo3pageModule = {
         */
        highlightLanguageDropZones: function(languageId){
                Ext.select('div.dropZone.language_'+languageId).each(function(el){
-                       el.addClass('active');
+                       el.addCls('active');
                });
 
                Ext.select('table.typo3-page-ceFooter').each(
@@ -500,7 +500,7 @@ var typo3pageModule = {
         */
        unhighlightAllDropZones: function(){
                Ext.select('div.dropZone').each(function(el){
-                       el.removeClass('active');
+                       el.removeCls('active');
                });
                Ext.select('table.typo3-page-ceFooter').each(
                        function(el){   el.show(); }
@@ -515,19 +515,19 @@ var typo3pageModule = {
         * @param Ext.Element element
         */
        reduceDraggedElement: function(element){
-               element.select('table.typo3-page-ceHeader').addClass('displayNone');
-           element.select('span.exampleContent').addClass('displayNone');
-           element.select('div.contentElementDropZoneAfter').addClass('displayNone');
-           element.addClass('onDrag');
+               element.select('table.typo3-page-ceHeader').addCls('displayNone');
+           element.select('span.exampleContent').addCls('displayNone');
+           element.select('div.contentElementDropZoneAfter').addCls('displayNone');
+           element.addCls('onDrag');
 
            var footerTable = element.select('table.typo3-page-ceFooter');
            if(footerTable != null){
-               footerTable.addClass('displayNone');
+               footerTable.addCls('displayNone');
            }
 
            var colSubHeader = element.select('tr.colSubHeader td');
            if(colSubHeader != null){
-               colSubHeader.addClass('displayNone');
+               colSubHeader.addCls('displayNone');
            }
 
            element.setStyle('z-index',999);
@@ -542,13 +542,13 @@ var typo3pageModule = {
        enrichDraggedElement: function(element){
                Ext.get(typo3pageModule.placeholder).remove();
 
-               element.select('table.typo3-page-ceHeader').removeClass('displayNone');
-           element.select('span.exampleContent').removeClass('displayNone');
-           element.select('div.contentElementDropZoneAfter').removeClass('displayNone');
+               element.select('table.typo3-page-ceHeader').removeCls('displayNone');
+           element.select('span.exampleContent').removeCls('displayNone');
+           element.select('div.contentElementDropZoneAfter').removeCls('displayNone');
            element.setStyle('z-index',null);
-           element.removeClass('onDrag');
+           element.removeCls('onDrag');
            var footerTable = element.select('table.typo3-page-ceFooter');
-           if(footerTable != null){ footerTable.removeClass('displayNone'); }
+           if(footerTable != null){ footerTable.removeCls('displayNone'); }
        },
 
 
@@ -565,38 +565,38 @@ var typo3pageModule = {
         */
        b4StartDrag: function(x,y) {
                //disable the menubar highlighting during dragging
-           typo3pageModule.disableHighlighting();
+               typo3pageModule.disableHighlighting();
 
-           // Cache the drag element
-           if (!this.el) { this.el = Ext.get(this.getEl()); }
+               // Cache the drag element
+               if (!this.el) { this.el = Ext.get(this.getEl()); }
 
-           //Cache the original XY Coordinates of the element, we'll use this later.
-           this.originalXY = this.el.getXY();
+               //Cache the original XY Coordinates of the element, we'll use this later.
+               this.originalXY = this.el.getXY();
 
-           //move the draggable item to the mouse position
-           this.setDelta(0,0);
+               //move the draggable item to the mouse position
+               this.setDelta(0,0);
 
-           //highlight dropable targets
-       var parsedId = typo3pageModule._parseIdString('ttContent_',this.el.id);
-           typo3pageModule.highlightLanguageDropZones(parsedId.language);
+               //highlight dropable targets
+               var parsedId = typo3pageModule._parseIdString('ttContent_',this.el.id);
+               typo3pageModule.highlightLanguageDropZones(parsedId.language);
 
-           //calculate width and height before reducing
-           var heightBefore = this.el.getHeight();
-           var widthBefore  = this.el.getWidth();
+               //calculate width and height before reducing
+               var heightBefore = this.el.getHeight();
+               var widthBefore  = this.el.getWidth();
 
-           //make some layers of the draggable element invisible
-           typo3pageModule.reduceDraggedElement(this.el);
+               //make some layers of the draggable element invisible
+               typo3pageModule.reduceDraggedElement(this.el);
 
-           //caluclate height after reducing
-           var heightAfter = this.el.getHeight();
-           var widthAfter      = this.el.getWidth();
+               //caluclate height after reducing
+               var heightAfter = this.el.getHeight();
+               var widthAfter  = this.el.getWidth();
 
-           //create a placeholder for the dragged element
-           typo3pageModule.placeholder = new Element('div');
-           typo3pageModule.placeholder.setStyle({position: 'relative', height: heightBefore - heightAfter+ 'px', width: widthBefore - widthAfter+ 'px'});
+               //create a placeholder for the dragged element
+               typo3pageModule.placeholder = new Element('div');
+               typo3pageModule.placeholder.setStyle({position: 'relative', height: heightBefore - heightAfter+ 'px', width: widthBefore - widthAfter+ 'px'});
 
-           //insert placeholder before the dragged element
-           Ext.get(typo3pageModule.placeholder).insertAfter(this.el.prev());
+               //insert placeholder before the dragged element
+               Ext.get(typo3pageModule.placeholder).insertAfter(this.el.prev());
         },
         /**
          * Handler method for "endDrag" event.
@@ -604,81 +604,81 @@ var typo3pageModule = {
          * the element has been droppen on an invalid location.
          */
        moveToDropTargetAndEnrich: function() {
-           // Invoke the animation if the invalidDrop flag is set to true
+               // Invoke the animation if the invalidDrop flag is set to true
 
                 if (this.invalidDrop === true) {
-               var animCfgObj = {
-                               easing   : null,
-                               duration : 0,
-                       scope    : this,
-                               callback : function() {
-                           // Remove the position attribute
-                           this.el.dom.style.position = '';
-                           this.el.dom.style.left = 0;
-                           this.el.dom.style.top = 0;
-                       }
-                  };
-
-               // Apply the repair animation
-               this.el.moveTo(this.originalXY[0], this.originalXY[1],animCfgObj);
-               typo3pageModule.enrichDraggedElement(this.el);
-               delete this.invalidDrop;
-           }
-           typo3pageModule.unhighlightAllDropZones();
-           typo3pageModule.enableHighlighting();
+                       var animCfgObj = {
+                                       easing   : null,
+                                       duration : 0,
+                                       scope    : this,
+                                       callback : function() {
+                                               // Remove the position attribute
+                                               this.el.dom.style.position = '';
+                                               this.el.dom.style.left = 0;
+                                               this.el.dom.style.top = 0;
+                                       }
+                          };
+
+                       // Apply the repair animation
+                       this.el.moveTo(this.originalXY[0], this.originalXY[1],animCfgObj);
+                       typo3pageModule.enrichDraggedElement(this.el);
+                       delete this.invalidDrop;
+               }
+               typo3pageModule.unhighlightAllDropZones();
+               typo3pageModule.enableHighlighting();
        },
 
        /**
         * Event handler to process a valid drop.
         */
        handleElementDrop: function(evtObj, targetElId) {
-           // Wrap the drop target element with Ext.Element
-           var dropEl = Ext.get(targetElId);
-
-           // Perform the node move only if the drag element's
-           // parent is not the same as the drop target
-           if (this.el.dom.parentNode.id != targetElId) {
-               // Move the element
-               typo3pageModule.enrichDraggedElement(this.el);
-
-               var ttContentParsedId = typo3pageModule._parseIdString('ttContent_',this.el.id);
-               var rowParsedId = typo3pageModule._parseIdString('contentElementGroup_',dropEl.findParent('div.contentElementGroup').id);
-
-               if(dropEl.hasClass('contentElementDropZoneAfter')){
-                        var dropZoneAfterParsedId = typo3pageModule._parseIdString('contentElementDropZoneAfter_',dropEl.id);
-                        var idBehind = dropZoneAfterParsedId.id;
-                        this.el.insertAfter(dropEl.parent());
-               }
-               if(dropEl.hasClass('columnDropZone')){
-                               var idBehind  = pageId;
-                       this.el.insertAfter(dropEl);
-               }
-
-               var url = pageModuleMoveUrl.replace(/###MOVE_AFTER###/,idBehind).replace(/###MOVE_ITEM###/, ttContentParsedId.id ).replace(/###COL_POS###/,rowParsedId.id);
-
-               typo3pageModule.showSpinner();
-
-               Ext.Ajax.request({
-                  url: url,
-                  success: function(response, opts) {
-                               typo3pageModule.hideSpinner();
-                               window.location.reload();
-                       },
-                  failure: function(response, opts) { alert('server-side failure with status code ' + response.status); }
-               });
-
-               // Remove the drag invitation
-               this.onDragOut(evtObj, targetElId);
-
-               // Clear the styles
-               this.el.dom.style.position ='';
-               this.el.dom.style.top = '';
-               this.el.dom.style.left = '';
-           }
-           else {
-               // This was an invalid drop, initiate a repair
-               this.onInvalidDrop();
-           }
+               // Wrap the drop target element with Ext.Element
+               var dropEl = Ext.get(targetElId);
+
+               // Perform the node move only if the drag element's
+               // parent is not the same as the drop target
+               if (this.el.dom.parentNode.id != targetElId) {
+                       // Move the element
+                       typo3pageModule.enrichDraggedElement(this.el);
+
+                       var ttContentParsedId = typo3pageModule._parseIdString('ttContent_',this.el.id);
+                       var rowParsedId = typo3pageModule._parseIdString('contentElementGroup_',dropEl.findParent('div.contentElementGroup').id);
+
+                       if(dropEl.hasClass('contentElementDropZoneAfter')){
+                                var dropZoneAfterParsedId = typo3pageModule._parseIdString('contentElementDropZoneAfter_',dropEl.id);
+                                var idBehind = dropZoneAfterParsedId.id;
+                                this.el.insertAfter(dropEl.parent());
+                       }
+                       if(dropEl.hasClass('columnDropZone')){
+                               var idBehind  = pageId;
+                               this.el.insertAfter(dropEl);
+                       }
+
+                       var url = pageModuleMoveUrl.replace(/###MOVE_AFTER###/,idBehind).replace(/###MOVE_ITEM###/, ttContentParsedId.id ).replace(/###COL_POS###/,rowParsedId.id);
+
+                       typo3pageModule.showSpinner();
+
+                       Ext.Ajax.request({
+                          url: url,
+                          success: function(response, opts) {
+                                       typo3pageModule.hideSpinner();
+                                       window.location.reload();
+                               },
+                          failure: function(response, opts) { alert('server-side failure with status code ' + response.status); }
+                       });
+
+                       // Remove the drag invitation
+                       this.onDragOut(evtObj, targetElId);
+
+                       // Clear the styles
+                       this.el.dom.style.position ='';
+                       this.el.dom.style.top = '';
+                       this.el.dom.style.left = '';
+               }
+               else {
+                       // This was an invalid drop, initiate a repair
+                       this.onInvalidDrop();
+               }
        },
 
        /**
@@ -691,7 +691,7 @@ var typo3pageModule = {
        enableDropZone: function(evtObj, targetElId) {
                if (targetElId != this.el.dom.parentNode.id) {
                        var dropEl = Ext.get(targetElId);
-                       dropEl.addClass('validDrop');
+                       dropEl.addCls('validDrop');
                }
        },
        /**
@@ -704,7 +704,7 @@ var typo3pageModule = {
                if (targetElId != this.el.dom.parentNode.id) {
 
                        var dropEl = Ext.get(targetElId);
-                       dropEl.removeClass('validDrop');
+                       dropEl.removeCls('validDrop');
                }
        }
 }