Cleanup: Fixed SVN eol-style properties of text files
authorOliver Hader <oliver.hader@typo3.org>
Sat, 22 Jan 2011 17:54:09 +0000 (17:54 +0000)
committerOliver Hader <oliver.hader@typo3.org>
Sat, 22 Jan 2011 17:54:09 +0000 (17:54 +0000)
git-svn-id: https://svn.typo3.org/TYPO3v4/Core/trunk@10261 709f56b5-9817-0410-a4d7-c38de5d9e867

typo3/sysext/em/res/js/em_ter.js
typo3/sysext/em/res/js/em_tools.js
typo3/sysext/em/res/js/ux/GridFilters.js
typo3/sysext/em/res/js/ux/fileuploadfield.js

index a79086a..4de0491 100644 (file)
-/***************************************************************\r
- *  Copyright notice\r
- *\r
- *  (c) 2010 Steffen Kamper <info@sk-typo3.de>\r
- *  All rights reserved\r
- *\r
- *  This script is part of the TYPO3 project. The TYPO3 project is\r
- *  free software; you can redistribute it and/or modify\r
- *  it under the terms of the GNU General Public License as published by\r
- *  the Free Software Foundation; either version 2 of the License, or\r
- *  (at your option) any later version.\r
- *\r
- *  The GNU General Public License can be found at\r
- *  http://www.gnu.org/copyleft/gpl.html.\r
- *\r
- *  This script is distributed in the hope that it will be useful,\r
- *  but WITHOUT ANY WARRANTY; without even the implied warranty of\r
- *  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the\r
- *  GNU General Public License for more details.\r
- *\r
- *  This copyright notice MUST APPEAR in all copies of the script!\r
- ***************************************************************/\r
-\r
-/**\r
- * ExtJS for the extension manager.\r
- *\r
- *\r
- * @author Steffen Kamper <info@sk-typo3.de>\r
- * @package TYPO3\r
- * @subpackage extension manager\r
- * @version $Id: $\r
- */\r
-Ext.ns('TYPO3.EM');\r
-\r
-TYPO3.EM.TerUpload = Ext.extend(Ext.form.FormPanel, {\r
-       border:false,\r
-       recordData: null,\r
-\r
-       initComponent:function() {\r
-\r
-\r
-\r
-               Ext.apply(this, {\r
-                       itemId: 'extUploadForm',\r
-                       height: 340,\r
-                       defaultType: 'textfield',\r
-\r
-                       defaults: {width: 350},\r
-                       items: [{\r
-                               xtype: 'hidden',\r
-                               name: 'extKey',\r
-                               value: this.recordData.extkey\r
-                       }, {\r
-                               fieldLabel: TYPO3.lang.repositoryUploadForm_username,\r
-                               name: 'fe_u'\r
-                       }, {\r
-                               fieldLabel: TYPO3.lang.repositoryUploadForm_password,\r
-                               inputType: 'password',\r
-                               name: 'fe_p'\r
-                       }, {\r
-                               fieldLabel: TYPO3.lang.repositoryUploadForm_changelog,\r
-                               xtype: 'textarea',\r
-                               height: 150,\r
-                               name: 'uploadcomment'\r
-                       }, {\r
-                               xtype: 'radiogroup',\r
-                               fieldLabel: TYPO3.lang.repositoryUploadForm_new_version,\r
-                               itemCls: 'x-check-group-alt',\r
-                               columns: 1,\r
-                               items: [\r
-                                       {\r
-                                               boxLabel: TYPO3.lang.repositoryUploadForm_new_bugfix.replace('%s', 'x.x.<strong><span class="typo3-red">x+1</span></strong>'),\r
-                                               name: 'newversion',\r
-                                               inputValue: 'new_dev',\r
-                                               checked: true\r
-                                       },\r
-                                       {\r
-                                               boxLabel: TYPO3.lang.repositoryUploadForm_new_sub_version.replace('%s', 'x.<strong><span class="typo3-red">x+1</span></strong>.0'),\r
-                                               name: 'newversion',\r
-                                               inputValue: 'new_sub'\r
-                                       },\r
-                                       {\r
-                                               boxLabel: TYPO3.lang.repositoryUploadForm_new_main_version.replace('%s', '<strong><span class="typo3-red">x+1</span></strong>.0.0'),\r
-                                               name: 'newversion',\r
-                                               inputValue: 'new_main'\r
-                                       }\r
-                               ]\r
-                       }, {\r
-                               xtype: 'button',\r
-                               text: TYPO3.lang.repositoryUploadForm_upload,\r
-                               scope: this,\r
-                               handler: function() {\r
-                                       this.form.submit({\r
-                                               waitMsg : TYPO3.lang.action_sending_data,\r
-                                               success: function(form, action) {\r
-                                                       var msg = action.result.response.resultMessages.join('<br /><br />');\r
-                                                       TYPO3.Flashmessage.display(TYPO3.Severity.information, TYPO3.lang.cmd_terupload,\r
-                                                                       String.format(TYPO3.lang.msg_terupload, action.result.params.extKey) + '<br /><br />' + msg, 15);\r
-                                                       Ext.StoreMgr.get('localstore').reload();\r
-                                               },\r
-                                               failure: function(form, action) {\r
-                                                       if (action.failureType === Ext.form.Action.CONNECT_FAILURE) {\r
-                                                               TYPO3.Flashmessage.display(TYPO3.Severity.error, TYPO3.lang.msg_error,\r
-                                                                               TYPO3.lang.msg_status + ': ' + action.result.response.status + ': '+\r
-                                                                               action.result.response.statusText, 5);\r
-                                                       }\r
-                                                       if (action.failureType === Ext.form.Action.SERVER_INVALID){\r
-                                                               // server responded with success = false\r
-                                                               TYPO3.Flashmessage.display(TYPO3.Severity.error, TYPO3.lang.msg_invalid, action.result.errormsg, 5);\r
-                                                       }\r
-                                               }\r
-                                       });\r
-                               }\r
-                       }],\r
-                       listeners: {\r
-\r
-                               activate: function(panel) {\r
-\r
-\r
-                               }\r
-                       },\r
-                       scope: this\r
-               });\r
-\r
-               TYPO3.EM.TerUpload.superclass.initComponent.apply(this, arguments);\r
-       },\r
-\r
-       onRender: function() {\r
-\r
-\r
-               TYPO3.EM.TerUpload.superclass.onRender.apply(this, arguments);\r
-\r
-               Ext.apply(this.getForm(),{\r
-                       api: {\r
-                               load: TYPO3.EM.ExtDirect.loadUploadExtToTer,\r
-                               submit: TYPO3.EM.ExtDirect.uploadExtToTer\r
-                       },\r
-                       paramsAsHash: false\r
-\r
-               });\r
-               this.form.load();\r
-       }\r
-\r
-\r
-});\r
-\r
+/***************************************************************
+ *  Copyright notice
+ *
+ *  (c) 2010 Steffen Kamper <info@sk-typo3.de>
+ *  All rights reserved
+ *
+ *  This script is part of the TYPO3 project. The TYPO3 project is
+ *  free software; you can redistribute it and/or modify
+ *  it under the terms of the GNU General Public License as published by
+ *  the Free Software Foundation; either version 2 of the License, or
+ *  (at your option) any later version.
+ *
+ *  The GNU General Public License can be found at
+ *  http://www.gnu.org/copyleft/gpl.html.
+ *
+ *  This script is distributed in the hope that it will be useful,
+ *  but WITHOUT ANY WARRANTY; without even the implied warranty of
+ *  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ *  GNU General Public License for more details.
+ *
+ *  This copyright notice MUST APPEAR in all copies of the script!
+ ***************************************************************/
+
+/**
+ * ExtJS for the extension manager.
+ *
+ *
+ * @author Steffen Kamper <info@sk-typo3.de>
+ * @package TYPO3
+ * @subpackage extension manager
+ * @version $Id: $
+ */
+Ext.ns('TYPO3.EM');
+
+TYPO3.EM.TerUpload = Ext.extend(Ext.form.FormPanel, {
+       border:false,
+       recordData: null,
+
+       initComponent:function() {
+
+
+
+               Ext.apply(this, {
+                       itemId: 'extUploadForm',
+                       height: 340,
+                       defaultType: 'textfield',
+
+                       defaults: {width: 350},
+                       items: [{
+                               xtype: 'hidden',
+                               name: 'extKey',
+                               value: this.recordData.extkey
+                       }, {
+                               fieldLabel: TYPO3.lang.repositoryUploadForm_username,
+                               name: 'fe_u'
+                       }, {
+                               fieldLabel: TYPO3.lang.repositoryUploadForm_password,
+                               inputType: 'password',
+                               name: 'fe_p'
+                       }, {
+                               fieldLabel: TYPO3.lang.repositoryUploadForm_changelog,
+                               xtype: 'textarea',
+                               height: 150,
+                               name: 'uploadcomment'
+                       }, {
+                               xtype: 'radiogroup',
+                               fieldLabel: TYPO3.lang.repositoryUploadForm_new_version,
+                               itemCls: 'x-check-group-alt',
+                               columns: 1,
+                               items: [
+                                       {
+                                               boxLabel: TYPO3.lang.repositoryUploadForm_new_bugfix.replace('%s', 'x.x.<strong><span class="typo3-red">x+1</span></strong>'),
+                                               name: 'newversion',
+                                               inputValue: 'new_dev',
+                                               checked: true
+                                       },
+                                       {
+                                               boxLabel: TYPO3.lang.repositoryUploadForm_new_sub_version.replace('%s', 'x.<strong><span class="typo3-red">x+1</span></strong>.0'),
+                                               name: 'newversion',
+                                               inputValue: 'new_sub'
+                                       },
+                                       {
+                                               boxLabel: TYPO3.lang.repositoryUploadForm_new_main_version.replace('%s', '<strong><span class="typo3-red">x+1</span></strong>.0.0'),
+                                               name: 'newversion',
+                                               inputValue: 'new_main'
+                                       }
+                               ]
+                       }, {
+                               xtype: 'button',
+                               text: TYPO3.lang.repositoryUploadForm_upload,
+                               scope: this,
+                               handler: function() {
+                                       this.form.submit({
+                                               waitMsg : TYPO3.lang.action_sending_data,
+                                               success: function(form, action) {
+                                                       var msg = action.result.response.resultMessages.join('<br /><br />');
+                                                       TYPO3.Flashmessage.display(TYPO3.Severity.information, TYPO3.lang.cmd_terupload,
+                                                                       String.format(TYPO3.lang.msg_terupload, action.result.params.extKey) + '<br /><br />' + msg, 15);
+                                                       Ext.StoreMgr.get('localstore').reload();
+                                               },
+                                               failure: function(form, action) {
+                                                       if (action.failureType === Ext.form.Action.CONNECT_FAILURE) {
+                                                               TYPO3.Flashmessage.display(TYPO3.Severity.error, TYPO3.lang.msg_error,
+                                                                               TYPO3.lang.msg_status + ': ' + action.result.response.status + ': '+
+                                                                               action.result.response.statusText, 5);
+                                                       }
+                                                       if (action.failureType === Ext.form.Action.SERVER_INVALID){
+                                                               // server responded with success = false
+                                                               TYPO3.Flashmessage.display(TYPO3.Severity.error, TYPO3.lang.msg_invalid, action.result.errormsg, 5);
+                                                       }
+                                               }
+                                       });
+                               }
+                       }],
+                       listeners: {
+
+                               activate: function(panel) {
+
+
+                               }
+                       },
+                       scope: this
+               });
+
+               TYPO3.EM.TerUpload.superclass.initComponent.apply(this, arguments);
+       },
+
+       onRender: function() {
+
+
+               TYPO3.EM.TerUpload.superclass.onRender.apply(this, arguments);
+
+               Ext.apply(this.getForm(),{
+                       api: {
+                               load: TYPO3.EM.ExtDirect.loadUploadExtToTer,
+                               submit: TYPO3.EM.ExtDirect.uploadExtToTer
+                       },
+                       paramsAsHash: false
+
+               });
+               this.form.load();
+       }
+
+
+});
+
 Ext.reg('terupload', TYPO3.EM.TerUpload);
\ No newline at end of file
index 2fe40f0..c7da49f 100644 (file)
@@ -1,85 +1,85 @@
-/***************************************************************\r
- *  Copyright notice\r
- *\r
- *  (c) 2010 Steffen Kamper <info@sk-typo3.de>\r
- *  All rights reserved\r
- *\r
- *  This script is part of the TYPO3 project. The TYPO3 project is\r
- *  free software; you can redistribute it and/or modify\r
- *  it under the terms of the GNU General Public License as published by\r
- *  the Free Software Foundation; either version 2 of the License, or\r
- *  (at your option) any later version.\r
- *\r
- *  The GNU General Public License can be found at\r
- *  http://www.gnu.org/copyleft/gpl.html.\r
- *\r
- *  This script is distributed in the hope that it will be useful,\r
- *  but WITHOUT ANY WARRANTY; without even the implied warranty of\r
- *  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the\r
- *  GNU General Public License for more details.\r
- *\r
- *  This copyright notice MUST APPEAR in all copies of the script!\r
- ***************************************************************/\r
-\r
-/**\r
- * ExtJS for the extension manager.\r
- *\r
- *\r
- * @author Steffen Kamper <info@sk-typo3.de>\r
- * @package TYPO3\r
- * @subpackage extension manager\r
- * @version $Id: $\r
- */\r
-Ext.ns('TYPO3.EM');\r
-\r
-TYPO3.EM.Tools = function() {\r
-       return {\r
-               displayLocalExtension: function(extKey, reload) {\r
-                       localStore = Ext.StoreMgr.get('localstore');\r
-                               // select local extension list\r
-                       Ext.getCmp('em-main').setActiveTab(0);\r
-                       if (reload === true) {\r
-                               localStore.showAction = extKey;\r
-                               localStore.load();\r
-                       } else {\r
-                               // find row and expand\r
-                               /*var row = localStore.find('extkey', extKey);\r
-                                var grid = Ext.getCmp('em-local-extensions');\r
-\r
-                                grid.expander.expandRow(row);\r
-                                grid.getView().focusRow(row);\r
-                                grid.getSelectionModel().selectRow(row);*/\r
-                       }\r
-               },\r
-\r
-               uploadExtension: function() {\r
-                       if (Ext.isObject(TYPO3.EM.ExtensionUploadWindowInstance)) {\r
-                               TYPO3.EM.ExtensionUploadWindowInstance.show();\r
-                       } else {\r
-                               TYPO3.EM.ExtensionUploadWindowInstance = new TYPO3.EM.ExtensionUploadWindow().show();\r
-                       }\r
-               },\r
-\r
-               renderExtensionTitle: function(record) {\r
-                       var description = record.data.description;\r
-                       var value = record.data.title;\r
-                       if (value == '') {\r
-                               value = '[no title]';\r
-                       }\r
-                       if (record.data.reviewstate < 0) {\r
-                               description += '<br><br><strong>' + TYPO3.lang.insecureExtension + '</strong>';\r
-                       }\r
-                       return record.data.icon + ' ' + value + ' (v' + record.data.version + ')';\r
-               },\r
-\r
-               closeImportWindow: function() {\r
-                       TYPO3.EM.ImportWindow.close();\r
-               },\r
-\r
-               refreshMenu: function() {\r
-                       if (top.TYPO3ModuleMenu) {\r
-                               top.TYPO3ModuleMenu.refreshMenu();\r
-                       }\r
-               }\r
-       }\r
+/***************************************************************
+ *  Copyright notice
+ *
+ *  (c) 2010 Steffen Kamper <info@sk-typo3.de>
+ *  All rights reserved
+ *
+ *  This script is part of the TYPO3 project. The TYPO3 project is
+ *  free software; you can redistribute it and/or modify
+ *  it under the terms of the GNU General Public License as published by
+ *  the Free Software Foundation; either version 2 of the License, or
+ *  (at your option) any later version.
+ *
+ *  The GNU General Public License can be found at
+ *  http://www.gnu.org/copyleft/gpl.html.
+ *
+ *  This script is distributed in the hope that it will be useful,
+ *  but WITHOUT ANY WARRANTY; without even the implied warranty of
+ *  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ *  GNU General Public License for more details.
+ *
+ *  This copyright notice MUST APPEAR in all copies of the script!
+ ***************************************************************/
+
+/**
+ * ExtJS for the extension manager.
+ *
+ *
+ * @author Steffen Kamper <info@sk-typo3.de>
+ * @package TYPO3
+ * @subpackage extension manager
+ * @version $Id: $
+ */
+Ext.ns('TYPO3.EM');
+
+TYPO3.EM.Tools = function() {
+       return {
+               displayLocalExtension: function(extKey, reload) {
+                       localStore = Ext.StoreMgr.get('localstore');
+                               // select local extension list
+                       Ext.getCmp('em-main').setActiveTab(0);
+                       if (reload === true) {
+                               localStore.showAction = extKey;
+                               localStore.load();
+                       } else {
+                               // find row and expand
+                               /*var row = localStore.find('extkey', extKey);
+                                var grid = Ext.getCmp('em-local-extensions');
+
+                                grid.expander.expandRow(row);
+                                grid.getView().focusRow(row);
+                                grid.getSelectionModel().selectRow(row);*/
+                       }
+               },
+
+               uploadExtension: function() {
+                       if (Ext.isObject(TYPO3.EM.ExtensionUploadWindowInstance)) {
+                               TYPO3.EM.ExtensionUploadWindowInstance.show();
+                       } else {
+                               TYPO3.EM.ExtensionUploadWindowInstance = new TYPO3.EM.ExtensionUploadWindow().show();
+                       }
+               },
+
+               renderExtensionTitle: function(record) {
+                       var description = record.data.description;
+                       var value = record.data.title;
+                       if (value == '') {
+                               value = '[no title]';
+                       }
+                       if (record.data.reviewstate < 0) {
+                               description += '<br><br><strong>' + TYPO3.lang.insecureExtension + '</strong>';
+                       }
+                       return record.data.icon + ' ' + value + ' (v' + record.data.version + ')';
+               },
+
+               closeImportWindow: function() {
+                       TYPO3.EM.ImportWindow.close();
+               },
+
+               refreshMenu: function() {
+                       if (top.TYPO3ModuleMenu) {
+                               top.TYPO3ModuleMenu.refreshMenu();
+                       }
+               }
+       }
 }();
\ No newline at end of file
index dc2c96f..35d3c68 100644 (file)
-/**\r
- * Ext.ux.grid.GridFilters v0.2.7\r
- **/\r
-\r
-Ext.namespace("Ext.ux.grid");\r
-Ext.ux.grid.GridFilters = function(config){\r
-       this.filters = new Ext.util.MixedCollection();\r
-       this.filters.getKey = function(o){return o ? o.dataIndex : null};\r
-\r
-       for(var i=0, len=config.filters.length; i<len; i++)\r
-               this.addFilter(config.filters[i]);\r
-\r
-       this.deferredUpdate = new Ext.util.DelayedTask(this.reload, this);\r
-\r
-       delete config.filters;\r
-       Ext.apply(this, config);\r
-};\r
-Ext.extend(Ext.ux.grid.GridFilters, Ext.util.Observable, {\r
-       /**\r
-        * @cfg {Integer} updateBuffer\r
-        * Number of milisecond to defer store updates since the last filter change.\r
-        */\r
-       updateBuffer: 500,\r
-       /**\r
-        * @cfg {String} paramPrefix\r
-        * The url parameter prefix for the filters.\r
-        */\r
-       paramPrefix: 'filter',\r
-       /**\r
-        * @cfg {String} fitlerCls\r
-        * The css class to be applied to column headers that active filters. Defaults to 'ux-filterd-column'\r
-        */\r
-       filterCls: 'ux-filtered-column',\r
-       /**\r
-        * @cfg {Boolean} local\r
-        * True to use Ext.data.Store filter functions instead of server side filtering.\r
-        */\r
-       local: false,\r
-       /**\r
-        * @cfg {Boolean} autoReload\r
-        * True to automagicly reload the datasource when a filter change happens.\r
-        */\r
-       autoReload: true,\r
-       /**\r
-        * @cfg {String} stateId\r
-        * Name of the Ext.data.Store value to be used to store state information.\r
-        */\r
-       stateId: undefined,\r
-       /**\r
-        * @cfg {Boolean} showMenu\r
-        * True to show the filter menus\r
-        */\r
-       showMenu: true,\r
-\r
-       menuFilterText: 'Filters',\r
-\r
-       init: function(grid){\r
-               if(grid instanceof Ext.grid.GridPanel){\r
-                       this.grid  = grid;\r
-\r
-                       this.store = this.grid.getStore();\r
-                       if(this.local){\r
-                               this.store.on('load', function(store){\r
-                                       store.filterBy(this.getRecordFilter());\r
-                               }, this);\r
-                       } else {\r
-                         this.store.on('beforeload', this.onBeforeLoad, this);\r
-                       }\r
-\r
-                       this.grid.filters = this;\r
-\r
-                       this.grid.addEvents({"filterupdate": true});\r
-\r
-                       grid.on("render", this.onRender, this);\r
-\r
-                       grid.on("beforestaterestore", this.applyState, this);\r
-                       grid.on("beforestatesave", this.saveState, this);\r
-\r
-               } else if(grid instanceof Ext.PagingToolbar){\r
-                 this.toolbar = grid;\r
-               }\r
-       },\r
-\r
-       /** private **/\r
-       applyState: function(grid, state){\r
-               this.suspendStateStore = true;\r
-               this.clearFilters();\r
-               if(state.filters)\r
-                       for(var key in state.filters){\r
-                               var filter = this.filters.get(key);\r
-                               if(filter){\r
-                                       filter.setValue(state.filters[key]);\r
-                                       filter.setActive(true);\r
-                               }\r
-                       }\r
-\r
-               this.deferredUpdate.cancel();\r
-               if(this.local)\r
-                       this.reload();\r
-\r
-               this.suspendStateStore = false;\r
-       },\r
-\r
-       /** private **/\r
-       saveState: function(grid, state){\r
-               var filters = {};\r
-               this.filters.each(function(filter){\r
-                       if(filter.active)\r
-                               filters[filter.dataIndex] = filter.getValue();\r
-               });\r
-               return state.filters = filters;\r
-       },\r
-\r
-       /** private **/\r
-       onRender: function(){\r
-               var hmenu;\r
-\r
-               if(this.showMenu){\r
-                       hmenu = this.grid.getView().hmenu;\r
-\r
-                       this.sep  = hmenu.addSeparator();\r
-                       this.menu = hmenu.add(new Ext.menu.CheckItem({\r
-                                       text: this.menuFilterText,\r
-                                       menu: new Ext.menu.Menu()\r
-                               }));\r
-                       this.menu.on('checkchange', this.onCheckChange, this);\r
-                       this.menu.on('beforecheckchange', this.onBeforeCheck, this);\r
-\r
-                       hmenu.on('beforeshow', this.onMenu, this);\r
-               }\r
-\r
-               this.grid.getView().on("refresh", this.onRefresh, this);\r
-               this.updateColumnHeadings(this.grid.getView());\r
-       },\r
-\r
-       /** private **/\r
-       onMenu: function(filterMenu){\r
-               var filter = this.getMenuFilter();\r
-               if(filter){\r
-                       this.menu.menu = filter.menu;\r
-                       this.menu.setChecked(filter.active, false);\r
-               }\r
-\r
-               this.menu.setVisible(filter !== undefined);\r
-               this.sep.setVisible(filter !== undefined);\r
-       },\r
-\r
-       /** private **/\r
-       onCheckChange: function(item, value){\r
-               this.getMenuFilter().setActive(value);\r
-       },\r
-\r
-       /** private **/\r
-       onBeforeCheck: function(check, value){\r
-               return !value || this.getMenuFilter().isActivatable();\r
-       },\r
-\r
-       /** private **/\r
-       onStateChange: function(event, filter){\r
-    if(event == "serialize") return;\r
-\r
-               if(filter == this.getMenuFilter())\r
-                       this.menu.setChecked(filter.active, false);\r
-\r
-               if(this.autoReload || this.local)\r
-                       this.deferredUpdate.delay(this.updateBuffer);\r
-\r
-               var view = this.grid.getView();\r
-               this.updateColumnHeadings(view);\r
-\r
-               this.grid.saveState();\r
-\r
-               this.grid.fireEvent('filterupdate', this, filter);\r
-       },\r
-\r
-       /** private **/\r
-       onBeforeLoad: function(store, options){\r
-    options.params = options.params || {};\r
-               this.cleanParams(options.params);\r
-               var params = this.buildQuery(this.getFilterData());\r
-               Ext.apply(options.params, params);\r
-       },\r
-\r
-       /** private **/\r
-       onRefresh: function(view){\r
-               this.updateColumnHeadings(view);\r
-       },\r
-\r
-       /** private **/\r
-       getMenuFilter: function(){\r
-               var view = this.grid.getView();\r
-               if(!view || view.hdCtxIndex === undefined)\r
-                       return null;\r
-\r
-               return this.filters.get(\r
-                       view.cm.config[view.hdCtxIndex].dataIndex);\r
-       },\r
-\r
-       /** private **/\r
-       updateColumnHeadings: function(view){\r
-               if(!view || !view.mainHd) return;\r
-\r
-               var hds = view.mainHd.select('td').removeClass(this.filterCls);\r
-               for(var i=0, len=view.cm.config.length; i<len; i++){\r
-                       var filter = this.getFilter(view.cm.config[i].dataIndex);\r
-                       if(filter && filter.active)\r
-                               hds.item(i).addClass(this.filterCls);\r
-               }\r
-       },\r
-\r
-       /** private **/\r
-       reload: function(){\r
-               if(this.local){\r
-                       this.grid.store.clearFilter(true);\r
-                       this.grid.store.filterBy(this.getRecordFilter());\r
-               } else {\r
-                       this.deferredUpdate.cancel();\r
-                       var store = this.grid.store;\r
-                       if(this.toolbar){\r
-                               var start = this.toolbar.paramNames.start;\r
-                               if(store.lastOptions && store.lastOptions.params && store.lastOptions.params[start])\r
-                                       store.lastOptions.params[start] = 0;\r
-                       }\r
-                       store.reload();\r
-               }\r
-       },\r
-\r
-       /**\r
-        * Method factory that generates a record validator for the filters active at the time\r
-        * of invokation.\r
-        *\r
-        * @private\r
-        */\r
-       getRecordFilter: function(){\r
-               var f = [];\r
-               this.filters.each(function(filter){\r
-                       if(filter.active) f.push(filter);\r
-               });\r
-               var len = f.length, me = this;\r
-               return function(record){\r
-                       for(var i=0; i<len; i++) {\r
-                               if(!f[i].validateRecord(record)) {\r
-                                       return false;\r
-                               }\r
-                       }\r
-\r
-                       return true;\r
-               };\r
-       },\r
-\r
-       /**\r
-        * Adds a filter to the collection.\r
-        *\r
-        * @param {Object/Ext.ux.grid.filter.Filter} config A filter configuration or a filter object.\r
-        *\r
-        * @return {Ext.ux.grid.filter.Filter} The existing or newly created filter object.\r
-        */\r
-       addFilter: function(config){\r
-               var filter = config.menu ? config :\r
-                               new (this.getFilterClass(config.type))(config);\r
-               this.filters.add(filter);\r
-\r
-               Ext.util.Observable.capture(filter, this.onStateChange, this);\r
-               return filter;\r
-       },\r
-\r
-       /**\r
-        * Returns a filter for the given dataIndex, if on exists.\r
-        *\r
-        * @param {String} dataIndex The dataIndex of the desired filter object.\r
-        *\r
-        * @return {Ext.ux.grid.filter.Filter}\r
-        */\r
-       getFilter: function(dataIndex){\r
-               return this.filters.get(dataIndex);\r
-       },\r
-\r
-       /**\r
-        * Turns all filters off. This does not clear the configuration information.\r
-        */\r
-       clearFilters: function(){\r
-               this.filters.each(function(filter){\r
-                       filter.setActive(false);\r
-               });\r
-       },\r
-\r
-       /** private **/\r
-       getFilterData: function(){\r
-               var filters = [],\r
-                       fields  = this.grid.getStore().fields;\r
-\r
-               this.filters.each(function(f){\r
-                       if(f.active){\r
-                               var d = [].concat(f.serialize());\r
-                               for(var i=0, len=d.length; i<len; i++)\r
-                                       filters.push({\r
-                                               field: f.dataIndex,\r
-                                               data: d[i]\r
-                                       });\r
-                       }\r
-               });\r
-\r
-               return filters;\r
-       },\r
-\r
-       /**\r
-        * Function to take structured filter data and 'flatten' it into query parameteres. The default function\r
-        * will produce a query string of the form:\r
-        *              filters[0][field]=dataIndex&filters[0][data][param1]=param&filters[0][data][param2]=param...\r
-        *\r
-        * @param {Array} filters A collection of objects representing active filters and their configuration.\r
-        *        Each element will take the form of {field: dataIndex, data: filterConf}. dataIndex is not assured\r
-        *    to be unique as any one filter may be a composite of more basic filters for the same dataIndex.\r
-        *\r
-        * @return {Object} Query keys and values\r
-        */\r
-       buildQuery: function(filters){\r
-               var p = {};\r
-               for(var i=0, len=filters.length; i<len; i++){\r
-                       var f    = filters[i];\r
-                       var root = [this.paramPrefix, '[', i, ']'].join('');\r
-                       p[root + '[field]'] = f.field;\r
-\r
-                       var dataPrefix = root + '[data]';\r
-                       for(var key in f.data)\r
-                               p[[dataPrefix, '[', key, ']'].join('')] = f.data[key];\r
-               }\r
-\r
-               return p;\r
-       },\r
-\r
-       /**\r
-        * Removes filter related query parameters from the provided object.\r
-        *\r
-        * @param {Object} p Query parameters that may contain filter related fields.\r
-        */\r
-       cleanParams: function(p){\r
-               var regex = new RegExp("^" + this.paramPrefix + "\[[0-9]+\]");\r
-               for(var key in p)\r
-                       if(regex.test(key))\r
-                               delete p[key];\r
-       },\r
-\r
-       /**\r
-        * Function for locating filter classes, overwrite this with your favorite\r
-        * loader to provide dynamic filter loading.\r
-        *\r
-        * @param {String} type The type of filter to load.\r
-        *\r
-        * @return {Class}\r
-        */\r
-       getFilterClass: function(type){\r
-               return Ext.ux.grid.filter[type.substr(0, 1).toUpperCase() + type.substr(1) + 'Filter'];\r
-       }\r
+/**
+ * Ext.ux.grid.GridFilters v0.2.7
+ **/
+
+Ext.namespace("Ext.ux.grid");
+Ext.ux.grid.GridFilters = function(config){
+       this.filters = new Ext.util.MixedCollection();
+       this.filters.getKey = function(o){return o ? o.dataIndex : null};
+
+       for(var i=0, len=config.filters.length; i<len; i++)
+               this.addFilter(config.filters[i]);
+
+       this.deferredUpdate = new Ext.util.DelayedTask(this.reload, this);
+
+       delete config.filters;
+       Ext.apply(this, config);
+};
+Ext.extend(Ext.ux.grid.GridFilters, Ext.util.Observable, {
+       /**
+        * @cfg {Integer} updateBuffer
+        * Number of milisecond to defer store updates since the last filter change.
+        */
+       updateBuffer: 500,
+       /**
+        * @cfg {String} paramPrefix
+        * The url parameter prefix for the filters.
+        */
+       paramPrefix: 'filter',
+       /**
+        * @cfg {String} fitlerCls
+        * The css class to be applied to column headers that active filters. Defaults to 'ux-filterd-column'
+        */
+       filterCls: 'ux-filtered-column',
+       /**
+        * @cfg {Boolean} local
+        * True to use Ext.data.Store filter functions instead of server side filtering.
+        */
+       local: false,
+       /**
+        * @cfg {Boolean} autoReload
+        * True to automagicly reload the datasource when a filter change happens.
+        */
+       autoReload: true,
+       /**
+        * @cfg {String} stateId
+        * Name of the Ext.data.Store value to be used to store state information.
+        */
+       stateId: undefined,
+       /**
+        * @cfg {Boolean} showMenu
+        * True to show the filter menus
+        */
+       showMenu: true,
+
+       menuFilterText: 'Filters',
+
+       init: function(grid){
+               if(grid instanceof Ext.grid.GridPanel){
+                       this.grid  = grid;
+
+                       this.store = this.grid.getStore();
+                       if(this.local){
+                               this.store.on('load', function(store){
+                                       store.filterBy(this.getRecordFilter());
+                               }, this);
+                       } else {
+                         this.store.on('beforeload', this.onBeforeLoad, this);
+                       }
+
+                       this.grid.filters = this;
+
+                       this.grid.addEvents({"filterupdate": true});
+
+                       grid.on("render", this.onRender, this);
+
+                       grid.on("beforestaterestore", this.applyState, this);
+                       grid.on("beforestatesave", this.saveState, this);
+
+               } else if(grid instanceof Ext.PagingToolbar){
+                 this.toolbar = grid;
+               }
+       },
+
+       /** private **/
+       applyState: function(grid, state){
+               this.suspendStateStore = true;
+               this.clearFilters();
+               if(state.filters)
+                       for(var key in state.filters){
+                               var filter = this.filters.get(key);
+                               if(filter){
+                                       filter.setValue(state.filters[key]);
+                                       filter.setActive(true);
+                               }
+                       }
+
+               this.deferredUpdate.cancel();
+               if(this.local)
+                       this.reload();
+
+               this.suspendStateStore = false;
+       },
+
+       /** private **/
+       saveState: function(grid, state){
+               var filters = {};
+               this.filters.each(function(filter){
+                       if(filter.active)
+                               filters[filter.dataIndex] = filter.getValue();
+               });
+               return state.filters = filters;
+       },
+
+       /** private **/
+       onRender: function(){
+               var hmenu;
+
+               if(this.showMenu){
+                       hmenu = this.grid.getView().hmenu;
+
+                       this.sep  = hmenu.addSeparator();
+                       this.menu = hmenu.add(new Ext.menu.CheckItem({
+                                       text: this.menuFilterText,
+                                       menu: new Ext.menu.Menu()
+                               }));
+                       this.menu.on('checkchange', this.onCheckChange, this);
+                       this.menu.on('beforecheckchange', this.onBeforeCheck, this);
+
+                       hmenu.on('beforeshow', this.onMenu, this);
+               }
+
+               this.grid.getView().on("refresh", this.onRefresh, this);
+               this.updateColumnHeadings(this.grid.getView());
+       },
+
+       /** private **/
+       onMenu: function(filterMenu){
+               var filter = this.getMenuFilter();
+               if(filter){
+                       this.menu.menu = filter.menu;
+                       this.menu.setChecked(filter.active, false);
+               }
+
+               this.menu.setVisible(filter !== undefined);
+               this.sep.setVisible(filter !== undefined);
+       },
+
+       /** private **/
+       onCheckChange: function(item, value){
+               this.getMenuFilter().setActive(value);
+       },
+
+       /** private **/
+       onBeforeCheck: function(check, value){
+               return !value || this.getMenuFilter().isActivatable();
+       },
+
+       /** private **/
+       onStateChange: function(event, filter){
+    if(event == "serialize") return;
+
+               if(filter == this.getMenuFilter())
+                       this.menu.setChecked(filter.active, false);
+
+               if(this.autoReload || this.local)
+                       this.deferredUpdate.delay(this.updateBuffer);
+
+               var view = this.grid.getView();
+               this.updateColumnHeadings(view);
+
+               this.grid.saveState();
+
+               this.grid.fireEvent('filterupdate', this, filter);
+       },
+
+       /** private **/
+       onBeforeLoad: function(store, options){
+    options.params = options.params || {};
+               this.cleanParams(options.params);
+               var params = this.buildQuery(this.getFilterData());
+               Ext.apply(options.params, params);
+       },
+
+       /** private **/
+       onRefresh: function(view){
+               this.updateColumnHeadings(view);
+       },
+
+       /** private **/
+       getMenuFilter: function(){
+               var view = this.grid.getView();
+               if(!view || view.hdCtxIndex === undefined)
+                       return null;
+
+               return this.filters.get(
+                       view.cm.config[view.hdCtxIndex].dataIndex);
+       },
+
+       /** private **/
+       updateColumnHeadings: function(view){
+               if(!view || !view.mainHd) return;
+
+               var hds = view.mainHd.select('td').removeClass(this.filterCls);
+               for(var i=0, len=view.cm.config.length; i<len; i++){
+                       var filter = this.getFilter(view.cm.config[i].dataIndex);
+                       if(filter && filter.active)
+                               hds.item(i).addClass(this.filterCls);
+               }
+       },
+
+       /** private **/
+       reload: function(){
+               if(this.local){
+                       this.grid.store.clearFilter(true);
+                       this.grid.store.filterBy(this.getRecordFilter());
+               } else {
+                       this.deferredUpdate.cancel();
+                       var store = this.grid.store;
+                       if(this.toolbar){
+                               var start = this.toolbar.paramNames.start;
+                               if(store.lastOptions && store.lastOptions.params && store.lastOptions.params[start])
+                                       store.lastOptions.params[start] = 0;
+                       }
+                       store.reload();
+               }
+       },
+
+       /**
+        * Method factory that generates a record validator for the filters active at the time
+        * of invokation.
+        *
+        * @private
+        */
+       getRecordFilter: function(){
+               var f = [];
+               this.filters.each(function(filter){
+                       if(filter.active) f.push(filter);
+               });
+               var len = f.length, me = this;
+               return function(record){
+                       for(var i=0; i<len; i++) {
+                               if(!f[i].validateRecord(record)) {
+                                       return false;
+                               }
+                       }
+
+                       return true;
+               };
+       },
+
+       /**
+        * Adds a filter to the collection.
+        *
+        * @param {Object/Ext.ux.grid.filter.Filter} config A filter configuration or a filter object.
+        *
+        * @return {Ext.ux.grid.filter.Filter} The existing or newly created filter object.
+        */
+       addFilter: function(config){
+               var filter = config.menu ? config :
+                               new (this.getFilterClass(config.type))(config);
+               this.filters.add(filter);
+
+               Ext.util.Observable.capture(filter, this.onStateChange, this);
+               return filter;
+       },
+
+       /**
+        * Returns a filter for the given dataIndex, if on exists.
+        *
+        * @param {String} dataIndex The dataIndex of the desired filter object.
+        *
+        * @return {Ext.ux.grid.filter.Filter}
+        */
+       getFilter: function(dataIndex){
+               return this.filters.get(dataIndex);
+       },
+
+       /**
+        * Turns all filters off. This does not clear the configuration information.
+        */
+       clearFilters: function(){
+               this.filters.each(function(filter){
+                       filter.setActive(false);
+               });
+       },
+
+       /** private **/
+       getFilterData: function(){
+               var filters = [],
+                       fields  = this.grid.getStore().fields;
+
+               this.filters.each(function(f){
+                       if(f.active){
+                               var d = [].concat(f.serialize());
+                               for(var i=0, len=d.length; i<len; i++)
+                                       filters.push({
+                                               field: f.dataIndex,
+                                               data: d[i]
+                                       });
+                       }
+               });
+
+               return filters;
+       },
+
+       /**
+        * Function to take structured filter data and 'flatten' it into query parameteres. The default function
+        * will produce a query string of the form:
+        *              filters[0][field]=dataIndex&filters[0][data][param1]=param&filters[0][data][param2]=param...
+        *
+        * @param {Array} filters A collection of objects representing active filters and their configuration.
+        *        Each element will take the form of {field: dataIndex, data: filterConf}. dataIndex is not assured
+        *    to be unique as any one filter may be a composite of more basic filters for the same dataIndex.
+        *
+        * @return {Object} Query keys and values
+        */
+       buildQuery: function(filters){
+               var p = {};
+               for(var i=0, len=filters.length; i<len; i++){
+                       var f    = filters[i];
+                       var root = [this.paramPrefix, '[', i, ']'].join('');
+                       p[root + '[field]'] = f.field;
+
+                       var dataPrefix = root + '[data]';
+                       for(var key in f.data)
+                               p[[dataPrefix, '[', key, ']'].join('')] = f.data[key];
+               }
+
+               return p;
+       },
+
+       /**
+        * Removes filter related query parameters from the provided object.
+        *
+        * @param {Object} p Query parameters that may contain filter related fields.
+        */
+       cleanParams: function(p){
+               var regex = new RegExp("^" + this.paramPrefix + "\[[0-9]+\]");
+               for(var key in p)
+                       if(regex.test(key))
+                               delete p[key];
+       },
+
+       /**
+        * Function for locating filter classes, overwrite this with your favorite
+        * loader to provide dynamic filter loading.
+        *
+        * @param {String} type The type of filter to load.
+        *
+        * @return {Class}
+        */
+       getFilterClass: function(type){
+               return Ext.ux.grid.filter[type.substr(0, 1).toUpperCase() + type.substr(1) + 'Filter'];
+       }
 });
\ No newline at end of file
index 4f4c63b..6b31cd3 100644 (file)
-/*!\r
- * Ext JS Library 3.1.1\r
- * Copyright(c) 2006-2010 Ext JS, LLC\r
- * licensing@extjs.com\r
- * http://www.extjs.com/license\r
- */\r
-Ext.ns('Ext.ux.form');\r
-\r
-/**\r
- * @class Ext.ux.form.FileUploadField\r
- * @extends Ext.form.TextField\r
- * Creates a file upload field.\r
- * @xtype fileuploadfield\r
- */\r
-Ext.ux.form.FileUploadField = Ext.extend(Ext.form.TextField,  {\r
-    /**\r
-     * @cfg {String} buttonText The button text to display on the upload button (defaults to\r
-     * 'Browse...').  Note that if you supply a value for {@link #buttonCfg}, the buttonCfg.text\r
-     * value will be used instead if available.\r
-     */\r
-    buttonText: 'Browse...',\r
-    /**\r
-     * @cfg {Boolean} buttonOnly True to display the file upload field as a button with no visible\r
-     * text field (defaults to false).  If true, all inherited TextField members will still be available.\r
-     */\r
-    buttonOnly: false,\r
-    /**\r
-     * @cfg {Number} buttonOffset The number of pixels of space reserved between the button and the text field\r
-     * (defaults to 3).  Note that this only applies if {@link #buttonOnly} = false.\r
-     */\r
-    buttonOffset: 3,\r
-    /**\r
-     * @cfg {Object} buttonCfg A standard {@link Ext.Button} config object.\r
-     */\r
-\r
-    // private\r
-    readOnly: true,\r
-\r
-    /**\r
-     * @hide\r
-     * @method autoSize\r
-     */\r
-    autoSize: Ext.emptyFn,\r
-\r
-    // private\r
-    initComponent: function(){\r
-        Ext.ux.form.FileUploadField.superclass.initComponent.call(this);\r
-\r
-        this.addEvents(\r
-            /**\r
-             * @event fileselected\r
-             * Fires when the underlying file input field's value has changed from the user\r
-             * selecting a new file from the system file selection dialog.\r
-             * @param {Ext.ux.form.FileUploadField} this\r
-             * @param {String} value The file value returned by the underlying file input field\r
-             */\r
-            'fileselected'\r
-        );\r
-    },\r
-\r
-    // private\r
-    onRender : function(ct, position){\r
-        Ext.ux.form.FileUploadField.superclass.onRender.call(this, ct, position);\r
-\r
-        this.wrap = this.el.wrap({cls:'x-form-field-wrap x-form-file-wrap'});\r
-        this.el.addClass('x-form-file-text');\r
-        this.el.dom.removeAttribute('name');\r
-        this.createFileInput();\r
-\r
-        var btnCfg = Ext.applyIf(this.buttonCfg || {}, {\r
-            text: this.buttonText\r
-        });\r
-        this.button = new Ext.Button(Ext.apply(btnCfg, {\r
-            renderTo: this.wrap,\r
-            cls: 'x-form-file-btn' + (btnCfg.iconCls ? ' x-btn-icon' : '')\r
-        }));\r
-\r
-        if(this.buttonOnly){\r
-            this.el.hide();\r
-            this.wrap.setWidth(this.button.getEl().getWidth());\r
-        }\r
-\r
-        this.bindListeners();\r
-        this.resizeEl = this.positionEl = this.wrap;\r
-    },\r
-    \r
-    bindListeners: function(){\r
-        this.fileInput.on({\r
-            scope: this,\r
-            mouseenter: function() {\r
-                this.button.addClass(['x-btn-over','x-btn-focus'])\r
-            },\r
-            mouseleave: function(){\r
-                this.button.removeClass(['x-btn-over','x-btn-focus','x-btn-click'])\r
-            },\r
-            mousedown: function(){\r
-                this.button.addClass('x-btn-click')\r
-            },\r
-            mouseup: function(){\r
-                this.button.removeClass(['x-btn-over','x-btn-focus','x-btn-click'])\r
-            },\r
-            change: function(){\r
-                var v = this.fileInput.dom.value;\r
-                this.setValue(v);\r
-                this.fireEvent('fileselected', this, v);    \r
-            }\r
-        }); \r
-    },\r
-    \r
-    createFileInput : function() {\r
-        this.fileInput = this.wrap.createChild({\r
-            id: this.getFileInputId(),\r
-            name: this.name||this.getId(),\r
-            cls: 'x-form-file',\r
-            tag: 'input',\r
-            type: 'file',\r
-            size: 1\r
-        });\r
-    },\r
-    \r
-    reset : function(){\r
-        this.fileInput.remove();\r
-        this.createFileInput();\r
-        this.bindListeners();\r
-        Ext.ux.form.FileUploadField.superclass.reset.call(this);\r
-    },\r
-\r
-    // private\r
-    getFileInputId: function(){\r
-        return this.id + '-file';\r
-    },\r
-\r
-    // private\r
-    onResize : function(w, h){\r
-        Ext.ux.form.FileUploadField.superclass.onResize.call(this, w, h);\r
-\r
-        this.wrap.setWidth(w);\r
-\r
-        if(!this.buttonOnly){\r
-            var w = this.wrap.getWidth() - this.button.getEl().getWidth() - this.buttonOffset;\r
-            this.el.setWidth(w);\r
-        }\r
-    },\r
-\r
-    // private\r
-    onDestroy: function(){\r
-        Ext.ux.form.FileUploadField.superclass.onDestroy.call(this);\r
-        Ext.destroy(this.fileInput, this.button, this.wrap);\r
-    },\r
-    \r
-    onDisable: function(){\r
-        Ext.ux.form.FileUploadField.superclass.onDisable.call(this);\r
-        this.doDisable(true);\r
-    },\r
-    \r
-    onEnable: function(){\r
-        Ext.ux.form.FileUploadField.superclass.onEnable.call(this);\r
-        this.doDisable(false);\r
-\r
-    },\r
-    \r
-    // private\r
-    doDisable: function(disabled){\r
-        this.fileInput.dom.disabled = disabled;\r
-        this.button.setDisabled(disabled);\r
-    },\r
-\r
-\r
-    // private\r
-    preFocus : Ext.emptyFn,\r
-\r
-    // private\r
-    alignErrorIcon : function(){\r
-        this.errorIcon.alignTo(this.wrap, 'tl-tr', [2, 0]);\r
-    }\r
-\r
-});\r
-\r
-Ext.reg('fileuploadfield', Ext.ux.form.FileUploadField);\r
-\r
-// backwards compat\r
-Ext.form.FileUploadField = Ext.ux.form.FileUploadField;\r
+/*!
+ * Ext JS Library 3.1.1
+ * Copyright(c) 2006-2010 Ext JS, LLC
+ * licensing@extjs.com
+ * http://www.extjs.com/license
+ */
+Ext.ns('Ext.ux.form');
+
+/**
+ * @class Ext.ux.form.FileUploadField
+ * @extends Ext.form.TextField
+ * Creates a file upload field.
+ * @xtype fileuploadfield
+ */
+Ext.ux.form.FileUploadField = Ext.extend(Ext.form.TextField,  {
+    /**
+     * @cfg {String} buttonText The button text to display on the upload button (defaults to
+     * 'Browse...').  Note that if you supply a value for {@link #buttonCfg}, the buttonCfg.text
+     * value will be used instead if available.
+     */
+    buttonText: 'Browse...',
+    /**
+     * @cfg {Boolean} buttonOnly True to display the file upload field as a button with no visible
+     * text field (defaults to false).  If true, all inherited TextField members will still be available.
+     */
+    buttonOnly: false,
+    /**
+     * @cfg {Number} buttonOffset The number of pixels of space reserved between the button and the text field
+     * (defaults to 3).  Note that this only applies if {@link #buttonOnly} = false.
+     */
+    buttonOffset: 3,
+    /**
+     * @cfg {Object} buttonCfg A standard {@link Ext.Button} config object.
+     */
+
+    // private
+    readOnly: true,
+
+    /**
+     * @hide
+     * @method autoSize
+     */
+    autoSize: Ext.emptyFn,
+
+    // private
+    initComponent: function(){
+        Ext.ux.form.FileUploadField.superclass.initComponent.call(this);
+
+        this.addEvents(
+            /**
+             * @event fileselected
+             * Fires when the underlying file input field's value has changed from the user
+             * selecting a new file from the system file selection dialog.
+             * @param {Ext.ux.form.FileUploadField} this
+             * @param {String} value The file value returned by the underlying file input field
+             */
+            'fileselected'
+        );
+    },
+
+    // private
+    onRender : function(ct, position){
+        Ext.ux.form.FileUploadField.superclass.onRender.call(this, ct, position);
+
+        this.wrap = this.el.wrap({cls:'x-form-field-wrap x-form-file-wrap'});
+        this.el.addClass('x-form-file-text');
+        this.el.dom.removeAttribute('name');
+        this.createFileInput();
+
+        var btnCfg = Ext.applyIf(this.buttonCfg || {}, {
+            text: this.buttonText
+        });
+        this.button = new Ext.Button(Ext.apply(btnCfg, {
+            renderTo: this.wrap,
+            cls: 'x-form-file-btn' + (btnCfg.iconCls ? ' x-btn-icon' : '')
+        }));
+
+        if(this.buttonOnly){
+            this.el.hide();
+            this.wrap.setWidth(this.button.getEl().getWidth());
+        }
+
+        this.bindListeners();
+        this.resizeEl = this.positionEl = this.wrap;
+    },
+    
+    bindListeners: function(){
+        this.fileInput.on({
+            scope: this,
+            mouseenter: function() {
+                this.button.addClass(['x-btn-over','x-btn-focus'])
+            },
+            mouseleave: function(){
+                this.button.removeClass(['x-btn-over','x-btn-focus','x-btn-click'])
+            },
+            mousedown: function(){
+                this.button.addClass('x-btn-click')
+            },
+            mouseup: function(){
+                this.button.removeClass(['x-btn-over','x-btn-focus','x-btn-click'])
+            },
+            change: function(){
+                var v = this.fileInput.dom.value;
+                this.setValue(v);
+                this.fireEvent('fileselected', this, v);    
+            }
+        }); 
+    },
+    
+    createFileInput : function() {
+        this.fileInput = this.wrap.createChild({
+            id: this.getFileInputId(),
+            name: this.name||this.getId(),
+            cls: 'x-form-file',
+            tag: 'input',
+            type: 'file',
+            size: 1
+        });
+    },
+    
+    reset : function(){
+        this.fileInput.remove();
+        this.createFileInput();
+        this.bindListeners();
+        Ext.ux.form.FileUploadField.superclass.reset.call(this);
+    },
+
+    // private
+    getFileInputId: function(){
+        return this.id + '-file';
+    },
+
+    // private
+    onResize : function(w, h){
+        Ext.ux.form.FileUploadField.superclass.onResize.call(this, w, h);
+
+        this.wrap.setWidth(w);
+
+        if(!this.buttonOnly){
+            var w = this.wrap.getWidth() - this.button.getEl().getWidth() - this.buttonOffset;
+            this.el.setWidth(w);
+        }
+    },
+
+    // private
+    onDestroy: function(){
+        Ext.ux.form.FileUploadField.superclass.onDestroy.call(this);
+        Ext.destroy(this.fileInput, this.button, this.wrap);
+    },
+    
+    onDisable: function(){
+        Ext.ux.form.FileUploadField.superclass.onDisable.call(this);
+        this.doDisable(true);
+    },
+    
+    onEnable: function(){
+        Ext.ux.form.FileUploadField.superclass.onEnable.call(this);
+        this.doDisable(false);
+
+    },
+    
+    // private
+    doDisable: function(disabled){
+        this.fileInput.dom.disabled = disabled;
+        this.button.setDisabled(disabled);
+    },
+
+
+    // private
+    preFocus : Ext.emptyFn,
+
+    // private
+    alignErrorIcon : function(){
+        this.errorIcon.alignTo(this.wrap, 'tl-tr', [2, 0]);
+    }
+
+});
+
+Ext.reg('fileuploadfield', Ext.ux.form.FileUploadField);
+
+// backwards compat
+Ext.form.FileUploadField = Ext.ux.form.FileUploadField;