[BUGFIX] Remove leftover usage of prototype in EXT:form 35/41735/4
authorAndreas Fernandez <a.fernandez@scripting-base.de>
Mon, 20 Jul 2015 13:00:40 +0000 (15:00 +0200)
committerWouter Wolters <typo3@wouterwolters.nl>
Mon, 20 Jul 2015 17:28:07 +0000 (19:28 +0200)
Prototype is used in EXT:form, which is based on ExtJS. Prototype
was removed earlier, resulting in JavaScript errors. The broken
function calls are replaced by ExtJS pendants.

Resolves: #68391
Related: #39721
Releases: master
Change-Id: If005caa86b63cf930fc49e2408214ef4d9574c4f
Reviewed-on: http://review.typo3.org/41735
Reviewed-by: Benjamin Mack <benni@typo3.org>
Tested-by: Christian Kuhn <lolli@schwarzbu.ch>
Reviewed-by: Wouter Wolters <typo3@wouterwolters.nl>
Tested-by: Wouter Wolters <typo3@wouterwolters.nl>
typo3/sysext/form/Resources/Public/JavaScript/Wizard/Elements/Predefined/CheckboxGroup.js
typo3/sysext/form/Resources/Public/JavaScript/Wizard/Elements/Predefined/RadioGroup.js
typo3/sysext/form/Resources/Public/JavaScript/Wizard/Viewport/Left.js
typo3/sysext/form/Resources/Public/JavaScript/Wizard/Viewport/Left/Elements.js
typo3/sysext/form/Resources/Public/JavaScript/Wizard/Viewport/Left/Elements/Basic.js
typo3/sysext/form/Resources/Public/JavaScript/Wizard/Viewport/Left/Elements/Content.js
typo3/sysext/form/Resources/Public/JavaScript/Wizard/Viewport/Left/Elements/Predefined.js
typo3/sysext/form/Resources/Public/JavaScript/Wizard/Viewport/Left/Form.js
typo3/sysext/form/Resources/Public/JavaScript/Wizard/Viewport/Left/Options.js

index 2143936..eb00a20 100644 (file)
@@ -105,12 +105,12 @@ TYPO3.Form.Wizard.Elements.Predefined.CheckboxGroup = Ext.extend(TYPO3.Form.Wiza
         */
        rebuild: function(component) {
                this.containerComponent.removeAll();
-               if (this.configuration.options.size() > 0) {
+               if (this.configuration.options.length > 0) {
                        var dummy = this.containerComponent.findById('dummy');
                        if (dummy) {
                                this.containerComponent.remove(dummy, true);
                        }
-                       this.configuration.options.each(function(option, index, length) {
+                       Ext.each(this.configuration.options, function(option, index, length) {
                                var checkbox = this.containerComponent.add({
                                        xtype: 'typo3-form-wizard-elements-basic-checkbox',
                                        isEditable: false,
index 66c5621..feb4fd0 100644 (file)
@@ -105,12 +105,12 @@ TYPO3.Form.Wizard.Elements.Predefined.RadioGroup = Ext.extend(TYPO3.Form.Wizard.
         */
        rebuild: function(component) {
                this.containerComponent.removeAll();
-               if (this.configuration.options.size() > 0) {
+               if (this.configuration.options.length > 0) {
                        var dummy = this.containerComponent.findById('dummy');
                        if (dummy) {
                                this.containerComponent.remove(dummy, true);
                        }
-                       this.configuration.options.each(function(option, index, length) {
+                       Ext.each(this.configuration.options, function(option, index, length) {
                                var radio = this.containerComponent.add({
                                        xtype: 'typo3-form-wizard-elements-basic-radio',
                                        isEditable: false,
index fad28d9..586d7de 100644 (file)
@@ -78,7 +78,7 @@ TYPO3.Form.Wizard.Viewport.Left = Ext.extend(Ext.TabPanel, {
                var allowedTabs = TYPO3.Form.Wizard.Settings.defaults.showTabs.split(/[, ]+/);
                var tabs = [];
 
-               allowedTabs.each(function(option, index, length) {
+               Ext.each(allowedTabs, function(option, index, length) {
                        var tabXtype = 'typo3-form-wizard-viewport-left-' + option;
                        if (Ext.ComponentMgr.isRegistered(tabXtype)) {
                                tabs.push({
index e1aa8aa..72a06a0 100644 (file)
@@ -46,7 +46,7 @@ TYPO3.Form.Wizard.Viewport.Left.Elements = Ext.extend(Ext.Panel, {
                var allowedAccordions = TYPO3.Form.Wizard.Settings.defaults.tabs.elements.showAccordions.split(/[, ]+/);
                var accordions = [];
 
-               allowedAccordions.each(function(option, index, length) {
+               Ext.each(allowedAccordions, function(option, index, length) {
                        var accordionXtype = 'typo3-form-wizard-viewport-left-elements-' + option;
                        if (Ext.ComponentMgr.isRegistered(accordionXtype)) {
                                accordions.push({
index cb1d31c..4f2e0fd 100644 (file)
@@ -38,7 +38,7 @@ TYPO3.Form.Wizard.Viewport.Left.Elements.Basic = Ext.extend(TYPO3.Form.Wizard.Vi
                var allowedButtons = TYPO3.Form.Wizard.Settings.defaults.tabs.elements.accordions.basic.showButtons.split(/[, ]+/);
                var buttons = [];
 
-               allowedButtons.each(function(option, index, length) {
+               Ext.each(allowedButtons, function(option, index, length) {
                        switch (option) {
                                case 'button':
                                        buttons.push({
index 44d8b14..bfcb0c3 100644 (file)
@@ -38,7 +38,7 @@ TYPO3.Form.Wizard.Viewport.Left.Elements.Content = Ext.extend(TYPO3.Form.Wizard.
                var allowedButtons = TYPO3.Form.Wizard.Settings.defaults.tabs.elements.accordions.content.showButtons.split(/[, ]+/);
                var buttons = [];
 
-               allowedButtons.each(function(option, index, length) {
+               Ext.each(allowedButtons, function(option, index, length) {
                        switch (option) {
                                case 'header':
                                        buttons.push({
index a2659c0..d1596e9 100644 (file)
@@ -38,7 +38,7 @@ TYPO3.Form.Wizard.Viewport.Left.Elements.Predefined = Ext.extend(TYPO3.Form.Wiza
                var allowedButtons = TYPO3.Form.Wizard.Settings.defaults.tabs.elements.accordions.predefined.showButtons.split(/[, ]+/);
                var buttons = [];
 
-               allowedButtons.each(function(option, index, length) {
+               Ext.each(allowedButtons, function(option, index, length) {
                        switch (option) {
                                case 'email':
                                        buttons.push({
index 5b884b5..89264b9 100644 (file)
@@ -108,7 +108,7 @@ TYPO3.Form.Wizard.Viewport.Left.Form = Ext.extend(Ext.Panel, {
 
                this.accordion.removeAll();
                if (form) {
-                       allowedAccordions.each(function(option, index, length) {
+                       Ext.each(allowedAccordions, function(option, index, length) {
                                switch (option) {
                                        case 'behaviour':
                                                this.accordion.add({
@@ -181,10 +181,11 @@ TYPO3.Form.Wizard.Viewport.Left.Form = Ext.extend(Ext.Panel, {
                        }
                }, this);
                if (this.tabEl) {
-                       if (tabIsValid && Ext.get(this.tabEl).hasClass('validation-error')) {
-                               this.tabEl.removeClassName('validation-error');
-                       } else if (!tabIsValid && !Ext.get(this.tabEl).hasClass('validation-error')) {
-                               this.tabEl.addClassName('validation-error');
+                       var tabEl = Ext.get(this.tabEl);
+                       if (tabIsValid && tabEl.hasClass('validation-error')) {
+                               tabEl.removeClass('validation-error');
+                       } else if (!tabIsValid && !tabEl.hasClass('validation-error')) {
+                               tabEl.addClass('validation-error');
                        }
                }
        }
index b5965ef..6e51602 100644 (file)
@@ -120,7 +120,7 @@ TYPO3.Form.Wizard.Viewport.Left.Options = Ext.extend(Ext.Panel, {
                                xtype: 'typo3-form-wizard-viewport-left-options-dummy'
                        });
                }
-               this.tabEl.removeClassName('validation-error');
+               Ext.get(this.tabEl).removeClass('validation-error');
                Ext.iterate(this.validAccordions, function(key, value) {
                        this.validAccordions[key] = true;
                }, this);
@@ -157,10 +157,11 @@ TYPO3.Form.Wizard.Viewport.Left.Options = Ext.extend(Ext.Panel, {
                var tabIsValid = this.tabIsValid();
 
                if (this.tabEl) {
-                       if (tabIsValid && Ext.get(this.tabEl).hasClass('validation-error')) {
-                               this.tabEl.removeClassName('validation-error');
-                       } else if (!tabIsValid && !Ext.get(this.tabEl).hasClass('validation-error')) {
-                               this.tabEl.addClassName('validation-error');
+                       var tabEl = Ext.get(this.tabEl);
+                       if (tabIsValid && tabEl.hasClass('validation-error')) {
+                               tabEl.removeClass('validation-error');
+                       } else if (!tabIsValid && !tabEl.hasClass('validation-error')) {
+                               tabEl.addClass('validation-error');
                        }
                }
        }