From 0dc444c4a746b2e65c78ba3dec01e4159bbae45e Mon Sep 17 00:00:00 2001 From: legac <renaud.legac@free.fr> Date: Fri, 1 Nov 2013 15:01:29 +0100 Subject: [PATCH] ExtJS 4.2: replace all xtype and ptype by alias. --- static/plugin_dbui/src/base.js | 5 +---- static/plugin_dbui/src/basepanelwithselector.js | 2 +- static/plugin_dbui/src/buttondownload.js | 2 +- static/plugin_dbui/src/combobox.js | 2 +- static/plugin_dbui/src/fielddict.js | 10 +++++----- static/plugin_dbui/src/fieldeditor.js | 2 +- static/plugin_dbui/src/fieldlist.js | 2 +- static/plugin_dbui/src/form.js | 2 +- static/plugin_dbui/src/grid.js | 2 +- static/plugin_dbui/src/gridfilter.js | 2 +- static/plugin_dbui/src/gridwithfilter.js | 2 +- static/plugin_dbui/src/jsonstore.js | 2 +- static/plugin_dbui/src/linkedcombobox.js | 2 +- static/plugin_dbui/src/panelwithurlselector.js | 2 +- static/plugin_dbui/src/pformtooltip.js | 15 ++------------- static/plugin_dbui/src/pgridexpertmenu.js | 11 +---------- static/plugin_dbui/src/pgridmathjax.js | 12 +----------- static/plugin_dbui/src/pgridpaging.js | 17 ++--------------- static/plugin_dbui/src/pgridroweditorbase.js | 15 ++------------- .../src/pgridroweditorconfirmdelete.js | 15 ++------------- .../src/pgridroweditorcontextmenu.js | 15 ++------------- .../plugin_dbui/src/pgridroweditordblclick.js | 15 ++------------- static/plugin_dbui/src/pgridroweditortoolbar.js | 15 ++------------- static/plugin_dbui/src/ppanelmathjax.js | 15 ++------------- static/plugin_dbui/src/pregexp.js | 14 +------------- static/plugin_dbui/src/pviewportlogin.js | 14 ++------------ static/plugin_dbui/src/viewport.js | 2 +- 27 files changed, 40 insertions(+), 174 deletions(-) diff --git a/static/plugin_dbui/src/base.js b/static/plugin_dbui/src/base.js index c47901b2..e90a4a66 100644 --- a/static/plugin_dbui/src/base.js +++ b/static/plugin_dbui/src/base.js @@ -193,7 +193,4 @@ Ext.define('App', { } return false; } -}); - -// Define name spaces for the remaining class. -Ext.ns("App.data", "App.form", "App.grid", "App.panel"); +}); \ No newline at end of file diff --git a/static/plugin_dbui/src/basepanelwithselector.js b/static/plugin_dbui/src/basepanelwithselector.js index b5849a95..06554445 100644 --- a/static/plugin_dbui/src/basepanelwithselector.js +++ b/static/plugin_dbui/src/basepanelwithselector.js @@ -22,7 +22,7 @@ Ext.define('App.BasePanelWithSelector', { extend: 'Ext.Panel', - xtype: 'xpanelwithselector', + alias: 'widget.xpanelwithselector', /** * @cfg {Object} diff --git a/static/plugin_dbui/src/buttondownload.js b/static/plugin_dbui/src/buttondownload.js index d140f7e3..da43a7e5 100644 --- a/static/plugin_dbui/src/buttondownload.js +++ b/static/plugin_dbui/src/buttondownload.js @@ -5,7 +5,7 @@ Ext.define('App.ButtonDownload', { extend: 'Ext.Button', - xtype: 'xbuttondownload', + alias: 'widget.xbuttondownload', /** * @cfg{String} diff --git a/static/plugin_dbui/src/combobox.js b/static/plugin_dbui/src/combobox.js index 778ddd4d..f1484d6d 100644 --- a/static/plugin_dbui/src/combobox.js +++ b/static/plugin_dbui/src/combobox.js @@ -5,7 +5,7 @@ Ext.define('App.form.ComboBox', { extend: 'Ext.form.ComboBox', - xtype: 'xcombobox', + alias: 'widget.xcombobox', // Predefined setting mode: 'remote', diff --git a/static/plugin_dbui/src/fielddict.js b/static/plugin_dbui/src/fielddict.js index e51b1427..b572663b 100644 --- a/static/plugin_dbui/src/fielddict.js +++ b/static/plugin_dbui/src/fielddict.js @@ -1,11 +1,13 @@ /** * Extend the default type for Ext.grid.column in order to render JSON object. - * The new type can be access using xtype = jsoncolumn in the column model. + * + * @since 0.4.15.0 * */ Ext.define('Ext.grid.JsonColumn', { - extend: 'Ext.grid.Column', + extend: 'Ext.grid.column.Column', + alias: 'widget.jsoncolumn', constructor: function (cfg) { @@ -16,8 +18,6 @@ Ext.define('Ext.grid.JsonColumn', { } }); -Ext.grid.Column.types.jsoncolumn = Ext.grid.JsonColumn; - /** * The DictField widget is an Ext.grid.PropertyGrid which is associated * to a JSON database field. It can be embedded in Ext.form.FormPanel. @@ -35,7 +35,7 @@ Ext.grid.Column.types.jsoncolumn = Ext.grid.JsonColumn; Ext.define('App.form.DictField', { extend: 'Ext.form.Field', - xtype: 'xdictfield', + alias: 'widget.xdictfield', /** * @cfg {Boolean} diff --git a/static/plugin_dbui/src/fieldeditor.js b/static/plugin_dbui/src/fieldeditor.js index c40468e0..19fe3553 100644 --- a/static/plugin_dbui/src/fieldeditor.js +++ b/static/plugin_dbui/src/fieldeditor.js @@ -10,7 +10,7 @@ Ext.define('App.form.AceEditorField', { extend: 'Ext.form.Field', - xtype: 'xaceeditorfield', + alias: 'widget.xaceeditorfield', /** * @cfg {Number} diff --git a/static/plugin_dbui/src/fieldlist.js b/static/plugin_dbui/src/fieldlist.js index 27551edc..cbddd064 100644 --- a/static/plugin_dbui/src/fieldlist.js +++ b/static/plugin_dbui/src/fieldlist.js @@ -11,7 +11,7 @@ Ext.define('App.form.ListField', { extend: 'Ext.form.Field', - xtype: 'xlistfield', + alias: 'widget.xlistfield', /** * @cfg {boolean} diff --git a/static/plugin_dbui/src/form.js b/static/plugin_dbui/src/form.js index f83ab2b4..a3a3f030 100644 --- a/static/plugin_dbui/src/form.js +++ b/static/plugin_dbui/src/form.js @@ -12,7 +12,7 @@ Ext.define('App.form.FormPanel', { extend: 'Ext.form.FormPanel', - xtype: 'xform', + alias: 'widget.xform', /** * @property {Ext.Button} diff --git a/static/plugin_dbui/src/grid.js b/static/plugin_dbui/src/grid.js index 845b5b18..d70f1579 100644 --- a/static/plugin_dbui/src/grid.js +++ b/static/plugin_dbui/src/grid.js @@ -7,7 +7,7 @@ Ext.define('App.grid.Grid', { extend: 'Ext.grid.GridPanel', - xtype: 'xgrid', + alias: 'widget.xgrid', /** * @property {Number} diff --git a/static/plugin_dbui/src/gridfilter.js b/static/plugin_dbui/src/gridfilter.js index 45a1b612..86d6017d 100644 --- a/static/plugin_dbui/src/gridfilter.js +++ b/static/plugin_dbui/src/gridfilter.js @@ -7,7 +7,7 @@ Ext.define('App.grid.GridFilter', { extend: 'Ext.form.FieldSet', - xtype: 'xgridfilter', + alias: 'widget.xgridfilter', // Private object containing where clause related to the filter resquest filterConditions: {}, diff --git a/static/plugin_dbui/src/gridwithfilter.js b/static/plugin_dbui/src/gridwithfilter.js index 1334837c..def90c27 100644 --- a/static/plugin_dbui/src/gridwithfilter.js +++ b/static/plugin_dbui/src/gridwithfilter.js @@ -5,7 +5,7 @@ Ext.define('App.grid.GridWithFilter', { extend: 'App.BasePanelWithSelector', - xtype: 'xgridwithfilter', + alias: 'widget.xgridwithfilter', // private method require by the Ext JS component model initComponent: function () { diff --git a/static/plugin_dbui/src/jsonstore.js b/static/plugin_dbui/src/jsonstore.js index 985cf69b..6a62c0fc 100644 --- a/static/plugin_dbui/src/jsonstore.js +++ b/static/plugin_dbui/src/jsonstore.js @@ -15,7 +15,7 @@ Ext.define('App.data.DirectStore', { extend: 'Ext.data.DirectStore', - xtype: 'xdirectstore', + alias: 'widget.xdirectstore', /** * @property {Boolean} encode JsonWiter property, by default false diff --git a/static/plugin_dbui/src/linkedcombobox.js b/static/plugin_dbui/src/linkedcombobox.js index fd5462ba..53122da0 100644 --- a/static/plugin_dbui/src/linkedcombobox.js +++ b/static/plugin_dbui/src/linkedcombobox.js @@ -19,7 +19,7 @@ Ext.define('App.form.LinkedComboBox', { extend: 'Ext.form.ComboBox', - xtype: 'xlinkedcombobox', + alias: 'widget.xlinkedcombobox', /** * @cfg {String} diff --git a/static/plugin_dbui/src/panelwithurlselector.js b/static/plugin_dbui/src/panelwithurlselector.js index 83db3a11..bef462eb 100644 --- a/static/plugin_dbui/src/panelwithurlselector.js +++ b/static/plugin_dbui/src/panelwithurlselector.js @@ -20,7 +20,7 @@ Ext.define('App.PanelWithUrlSelector', { extend: 'App.BasePanelWithSelector', - xtype: 'xpanelwithurlselector', + alias: 'widget.xpanelwithurlselector', /** * @cfg {String} diff --git a/static/plugin_dbui/src/pformtooltip.js b/static/plugin_dbui/src/pformtooltip.js index a64d6ed4..bf10fc2a 100644 --- a/static/plugin_dbui/src/pformtooltip.js +++ b/static/plugin_dbui/src/pformtooltip.js @@ -6,15 +6,11 @@ * * **Note**: It used the dedicated Field configuration option: *tipText*. * - * @ptype pFormToolTip - * */ Ext.define('App.form.ToolTip', { extend: 'Object', - - // Private parameter identifying the type of plugin - ptype: 'pFormToolTip', + alias: 'plugin.pFormToolTip', /** * The plugin initialization @@ -47,11 +43,4 @@ Ext.define('App.form.ToolTip', { } }); } -}, - -function() { - // Note: require to register the plugin in Ext JS 3.4.1.1 - // to be removed in Ext JS 4 and use the alias: 'plugin.ptype' instead. - Ext.preg('pFormToolTip', App.form.ToolTip); -}); - +}); \ No newline at end of file diff --git a/static/plugin_dbui/src/pgridexpertmenu.js b/static/plugin_dbui/src/pgridexpertmenu.js index f1c10469..adfc6b7c 100644 --- a/static/plugin_dbui/src/pgridexpertmenu.js +++ b/static/plugin_dbui/src/pgridexpertmenu.js @@ -1,14 +1,11 @@ /** * The grid expert menu plugin for toolbar * - * @ptype pGridExpertMenu */ Ext.define('App.grid.ExpertMenu', { extend: 'Object', - - // Private property identifying the type of plugin - ptype: 'pGridExpertMenu', + alias: 'plugin.pGridExpertMenu', // Private properties for internationalisation textExport: 'Export to CSV file', @@ -54,10 +51,4 @@ Ext.define('App.grid.ExpertMenu', { var grid = this; grid.reset(); } -}, - -function() { - // Note: require to register the plugin in Ext JS 3.4.1.1 - // to be removed in Ext JS 4 and use the alias: 'plugin.ptype' instead. - Ext.preg('pGridExpertMenu', App.grid.ExpertMenu); }); \ No newline at end of file diff --git a/static/plugin_dbui/src/pgridmathjax.js b/static/plugin_dbui/src/pgridmathjax.js index 84153ec9..73329148 100644 --- a/static/plugin_dbui/src/pgridmathjax.js +++ b/static/plugin_dbui/src/pgridmathjax.js @@ -3,15 +3,11 @@ * The processing is performed by MathJax. * The MathJax library is loaded by the framework * - * @ptype pGridMathJax - * */ Ext.define('App.grid.MathJax', { extend: 'Object', - - // Private property identifying the type of plugin - ptype: 'pGridMathJax', + alias: 'plugin.pGridMathJax', /** * The plugin initialization @@ -54,10 +50,4 @@ Ext.define('App.grid.MathJax', { MathJax.Hub.Queue(["Typeset", MathJax.Hub, domEl]); } -}, - -function() { - // Note: require to register the plugin in Ext JS 3.4.1.1 - // to be removed in Ext JS 4 and use the alias: 'plugin.ptype' instead. - Ext.preg('pGridMathJax', App.grid.MathJax); }); \ No newline at end of file diff --git a/static/plugin_dbui/src/pgridpaging.js b/static/plugin_dbui/src/pgridpaging.js index 3bec6a1d..a919514e 100644 --- a/static/plugin_dbui/src/pgridpaging.js +++ b/static/plugin_dbui/src/pgridpaging.js @@ -6,17 +6,11 @@ * **Note**: the number of row load in the grid at the first time * is defined by the grid when loading the store. * - * @class App.grid.Paging - * @extend Object - * @ptype pGridPaging - * */ Ext.define('App.grid.Paging', { extend: 'Object', - - // Private property identifying the type of plugin - ptype: 'pGridPaging', + alias: 'plugin.pGridPaging', // Private property for internationalisation textSlider: 'Rows per page', @@ -199,11 +193,4 @@ Ext.define('App.grid.Paging', { slider.setMaxValue(grid.store.getTotalCount()); slider.setValue(grid.store.getCount()); } -}, - -function() { - // Note: require to register the plugin in Ext JS 3.4.1.1 - // to be removed in Ext JS 4 and use the alias: 'plugin.ptype' instead. - Ext.preg('pGridPaging', App.grid.Paging); -}); - +}); \ No newline at end of file diff --git a/static/plugin_dbui/src/pgridroweditorbase.js b/static/plugin_dbui/src/pgridroweditorbase.js index 5a4adb93..72b4aee2 100644 --- a/static/plugin_dbui/src/pgridroweditorbase.js +++ b/static/plugin_dbui/src/pgridroweditorbase.js @@ -6,15 +6,11 @@ * * **Note**: This plugin limits the number of selected row to one. * - * @ptype pGridRowEditor - * */ Ext.define('App.grid.RowEditor', { extend: 'Ext.Window', - - // Private attribute identifying the type of plugin - ptype: 'pGridRowEditor', + alias: 'plugin.pGridRowEditor', // Private shortcuts formPanel: null, @@ -286,11 +282,4 @@ Ext.define('App.grid.RowEditor', { this.formPanel.currentIndex = index; } } -}, - -function() { - // Note: require to register the plugin in Ext JS 3.4.1.1 - // to be removed in Ext JS 4 and use the alias: 'plugin.ptype' instead. - Ext.preg('pGridRowEditor', App.grid.RowEditor); -}); - +}); \ No newline at end of file diff --git a/static/plugin_dbui/src/pgridroweditorconfirmdelete.js b/static/plugin_dbui/src/pgridroweditorconfirmdelete.js index 79d6a566..9ecd11e6 100644 --- a/static/plugin_dbui/src/pgridroweditorconfirmdelete.js +++ b/static/plugin_dbui/src/pgridroweditorconfirmdelete.js @@ -1,15 +1,11 @@ /** * Extend the grid App.grid.RowEditor plugin by adding confirmation on delete. * - * @ptype pGridRowEditorConfirmDelete - * */ Ext.define('App.grid.RowEditorConfirmDelete', { extend: 'App.grid.RowEditor', - - // Private attribute identifying the type of plugin - ptype: 'pGridRowEditorConfirmDelete', + alias: 'plugin.pGridRowEditorConfirmDelete', // Private property for internationalization confirmMsg: 'Do you really want to delete this item?', @@ -33,11 +29,4 @@ Ext.define('App.grid.RowEditorConfirmDelete', { } }, this); } -}, - -function() { - // Note: require to register the plugin in Ext JS 3.4.1.1 - // to be removed in Ext JS 4 and use the alias: 'plugin.ptype' instead. - Ext.preg('pGridRowEditorConfirmDelete', App.grid.RowEditorConfirmDelete); -}); - +}); \ No newline at end of file diff --git a/static/plugin_dbui/src/pgridroweditorcontextmenu.js b/static/plugin_dbui/src/pgridroweditorcontextmenu.js index 861a6f68..69336416 100644 --- a/static/plugin_dbui/src/pgridroweditorcontextmenu.js +++ b/static/plugin_dbui/src/pgridroweditorcontextmenu.js @@ -4,17 +4,13 @@ * Display the context menu when the user right click on a row. * The content of the menu allows to manipulate the App.grid.RowEditor. * - * @ptype pGridRowEditorContextMenu - * * @uses App.grid.RowEditor * */ Ext.define('App.grid.RowEditorContextMenu', { extend: 'Object', - - // Private attribute identifying the type of plugin - ptype: 'pGridRowEditorContextMenu', + alias: 'plugin.pGridRowEditorContextMenu', // private properties for internationalization textAdd: 'Add', @@ -140,11 +136,4 @@ Ext.define('App.grid.RowEditorContextMenu', { grid.selModel.selectRow(rowIndex); this.menu.showAt(event.getXY()); } -}, - -function() { - // Note: require to register the plugin in Ext JS 3.4.1.1 - // to be removed in Ext JS 4 and use the alias: 'plugin.ptype' instead. - Ext.preg('pGridRowEditorContextMenu', App.grid.RowEditorContextMenu); -}); - +}); \ No newline at end of file diff --git a/static/plugin_dbui/src/pgridroweditordblclick.js b/static/plugin_dbui/src/pgridroweditordblclick.js index cb09254d..c3c33f1c 100644 --- a/static/plugin_dbui/src/pgridroweditordblclick.js +++ b/static/plugin_dbui/src/pgridroweditordblclick.js @@ -2,16 +2,12 @@ * The grid plugin instantiating RowEditor double click. * Launch the update action when the user double click on a row. * - * @ptype pGridRowEditorDblClick - * * @uses App.grid.RowEditor */ Ext.define('App.grid.RowEditorDblClick', { extend: 'Object', - - // Private attribute identifying the type of plugin - ptype: 'pGridRowEditorDblClick', + alias: 'plugin.pGridRowEditorDblClick', /** * Plugin initialization @@ -42,11 +38,4 @@ Ext.define('App.grid.RowEditorDblClick', { grid.un('rowdblclick', grid.rowEditor.onEditRow, grid.rowEditor); } -}, - -function() { - // Note: require to register the plugin in Ext JS 3.4.1.1 - // to be removed in Ext JS 4 and use the alias: 'plugin.ptype' instead. - Ext.preg('pGridRowEditorDblClick', App.grid.RowEditorDblClick); -}); - +}); \ No newline at end of file diff --git a/static/plugin_dbui/src/pgridroweditortoolbar.js b/static/plugin_dbui/src/pgridroweditortoolbar.js index 751b2c66..6c9c862b 100644 --- a/static/plugin_dbui/src/pgridroweditortoolbar.js +++ b/static/plugin_dbui/src/pgridroweditortoolbar.js @@ -2,17 +2,13 @@ * The grid plugin instantiating a toolbar with buttons to manipulate * the App.grid.RowEditor. * - * @ptype pGridRowEditorToolbar - * * @uses App.grid.RowEditor * */ Ext.define('App.grid.RowEditorToolbar', { extend: 'Object', - - // Private parameter identifying the type of plugin - ptype: 'pGridRowEditorToolbar', + alias: 'plugin.pGridRowEditorToolbar', /** * Plugin initialization @@ -59,11 +55,4 @@ Ext.define('App.grid.RowEditorToolbar', { scope: grid.rowEditor }, '-']); } -}, - -function() { - // Note: require to register the plugin in Ext JS 3.4.1.1 - // to be removed in Ext JS 4 and use the alias: 'plugin.ptype' instead. - Ext.preg('pGridRowEditorToolbar', App.grid.RowEditorToolbar); -}); - +}); \ No newline at end of file diff --git a/static/plugin_dbui/src/ppanelmathjax.js b/static/plugin_dbui/src/ppanelmathjax.js index 4fe1408c..2c8330a5 100644 --- a/static/plugin_dbui/src/ppanelmathjax.js +++ b/static/plugin_dbui/src/ppanelmathjax.js @@ -2,15 +2,11 @@ * Plugin to render mathematics formula embedded in HTML content. * The processing is performed by the [MathJax](http://www.mathjax.org/) library. * - * @ptype pPanelMathJax - * */ Ext.define('App.panel.MathJax', { extend: 'Object', - - // Private property identifying the type of plugin - ptype: 'pPanelMathJax', + alias: 'plugin.pPanelMathJax', /** * The plugin initialization @@ -50,11 +46,4 @@ Ext.define('App.panel.MathJax', { MathJax.Hub.PreProcess(); MathJax.Hub.Process(); } -}, - -function() { - // Note: require to register the plugin in Ext JS 3.4.1.1 - // to be removed in Ext JS 4 and use the alias: 'plugin.ptype' instead. - Ext.preg('pPanelMathJax', App.panel.MathJax); -}); - +}); \ No newline at end of file diff --git a/static/plugin_dbui/src/pregexp.js b/static/plugin_dbui/src/pregexp.js index 29af3390..32e317aa 100644 --- a/static/plugin_dbui/src/pregexp.js +++ b/static/plugin_dbui/src/pregexp.js @@ -3,17 +3,11 @@ * by a regular expression object. * It can be used by any component using the property *regex*. * - * @class App.PRegExp - * @extend Object - * @ptype pRegEx - * */ Ext.define('App.PRegExp', { extend: 'Object', - - // Private property identifying the type of plugin - ptype: 'pRegExp', + alias: 'plugin.pRegExp', /** * The plugin initialization @@ -29,11 +23,5 @@ Ext.define('App.PRegExp', { component.regex = new RegExp(component.regex); } } -}, - -function() { - // Note: require to register the plugin in Ext JS 3.4.1.1 - // to be removed in Ext JS 4 and use the alias: 'plugin.ptype' instead. - Ext.preg('pRegExp', App.PRegExp); }); diff --git a/static/plugin_dbui/src/pviewportlogin.js b/static/plugin_dbui/src/pviewportlogin.js index 0e16ba73..b82f2e2d 100644 --- a/static/plugin_dbui/src/pviewportlogin.js +++ b/static/plugin_dbui/src/pviewportlogin.js @@ -7,17 +7,13 @@ * Change password → /application/default/user/change_password * Logout → /application/default/user/logout * - * @ptype pViewportLogin - * * @uses App.Viewport * */ Ext.define('App.ViewportLogin', { extend: 'Object', - - // Private attribute identifying the type of plugin - ptype: 'pViewportLogin', + alias: 'plugin.pViewportLogin', // Private properties for internationalization textChangePwd: "Change password...", @@ -94,10 +90,4 @@ Ext.define('App.ViewportLogin', { window.location = url + button.href; } -}, - -function() { - // Note: require to register the plugin in Ext JS 3.4.1.1 - // to be removed in Ext JS 4 and use the alias: 'plugin.ptype' instead. - Ext.preg('pViewportLogin', App.ViewportLogin); -}); +}); \ No newline at end of file diff --git a/static/plugin_dbui/src/viewport.js b/static/plugin_dbui/src/viewport.js index a0233693..d1d70a23 100644 --- a/static/plugin_dbui/src/viewport.js +++ b/static/plugin_dbui/src/viewport.js @@ -17,7 +17,7 @@ Ext.define('App.Viewport', { extend: 'Ext.Viewport', - xtype: 'xviewport', + alias: 'widget.xviewport', /** * @property {Ext.tree.TreeNode.tex[]} -- GitLab