svn: /web/doc-editor/trunk/js/ login.js login_override.js

[email protected] (Yannick Torres)
Newsgroups php.doc.web
Message-ID <[email protected]>
yannick                                  Mon, 21 Dec 2009 23:48:32 +0000

Revision: http://svn.php.net/viewvc?view=revision&revision=292462

Log:
Can't choose a blank language & make English language as default

Changed paths:
    U   web/doc-editor/trunk/js/login.js
    U   web/doc-editor/trunk/js/login_override.js

Modified: web/doc-editor/trunk/js/login.js
===================================================================
--- web/doc-editor/trunk/js/login.js	2009-12-21 23:30:50 UTC (rev 292461)
+++ web/doc-editor/trunk/js/login.js	2009-12-21 23:48:32 UTC (rev 292462)
@@ -11,7 +11,6 @@
         {
             // Load all available language
             this.storeLang = new Ext.data.Store({
-                autoLoad : true,
                 proxy    : new Ext.data.HttpProxy({
                     url : './do/getAvailableLanguage'
                 }),
@@ -34,8 +33,12 @@
                     ])
                 )
             });
-
-            this.drawForm();
+            this.storeLang.load({
+                scope: this,
+                callback: function() {
+                    this.drawForm();
+                }
+            });
         },

         drawForm : function()
@@ -119,21 +122,22 @@
                                 }
                             }
                         }, {
-                            xtype      : 'combo',
+                            xtype      : 'iconcombo',
                             width      : 235,
                             fieldLabel : 'Language module',
                             store      : this.storeLang,
-                            plugins       : new Ext.ux.plugins.IconCombo(),
+                            triggerAction : 'all',
+                            allowBlank    : false,
                             valueField    : 'code',
+                            displayField  : 'name',
+                            iconClsField  : 'iconCls',
+                            mode          : 'local',
+                            value         : 'en',
                             listWidth     : 235,
                             maxHeight     : 150,
                             editable      : true,
                             id            : 'login-form-lang',
-                            name          : 'langDisplay',
-                            displayField  : 'name',
-                            iconClsField  : 'iconCls',
-                            triggerAction : 'all',
-                            mode          : 'local'
+                            name          : 'langDisplay'
                         }]
                     }],
                     buttonAlign: 'left',

Modified: web/doc-editor/trunk/js/login_override.js
===================================================================
--- web/doc-editor/trunk/js/login_override.js	2009-12-21 23:30:50 UTC (rev 292461)
+++ web/doc-editor/trunk/js/login_override.js	2009-12-21 23:48:32 UTC (rev 292462)
@@ -2,54 +2,59 @@
 Ext.namespace('Ext.ux.plugins');

 /**
- * Ext.ux.plugins.IconCombo plugin for Ext.form.Combobox
- *
- * @author  Ing. Jozef Sakalos
- * @date    January 7, 2008
- *
- * @class Ext.ux.plugins.IconCombo
- * @extends Ext.util.Observable
- */
-Ext.ux.plugins.IconCombo = function(config){
-    Ext.apply(this, config);
-};
+  * Ext.ux.IconCombo Extension Class for Ext 2.x Library
+  *
+  * @author  Ing. Jozef Sakalos
+  * @version $Id: Ext.ux.IconCombo.js 617 2007-12-20 11:29:56Z jozo $
+  *
+  * @class Ext.ux.IconCombo
+  * @extends Ext.form.ComboBox
+  */

-// plugin code
-Ext.extend(Ext.ux.plugins.IconCombo, Ext.util.Observable, {
-    init: function(combo){
-        Ext.apply(combo, {
-            tpl: '<tpl for=".">' +
-            '<div class="x-combo-list-item ux-icon-combo-item ' +
-            '{' +
-            combo.iconClsField +
-            '}">' +
-            '{' +
-            combo.displayField +
-            '}' +
-            '</div></tpl>',
-
-            onRender: combo.onRender.createSequence(function(ct, position){
-                // adjust styles
-                this.wrap.applyStyles({
-                    position: 'relative'
-                });
-                this.el.addClass('ux-icon-combo-input');
-
-                // add div for icon
-                this.icon = Ext.DomHelper.append(this.el.up('div.x-form-field-wrap'), {
-                    tag: 'div',
-                    style: 'position:absolute'
-                });
-            }), // end of function onRender
-            setIconCls: function(){
-                var rec = this.store.query(this.valueField, this.getValue()).itemAt(0);
-                if (rec) {
-                    this.icon.className = 'ux-icon-combo-icon ' + rec.get(this.iconClsField);
-                }
-            }, // end of function setIconCls
-            setValue: combo.setValue.createSequence(function(value){
-                this.setIconCls();
-            })
+Ext.ux.IconCombo = Ext.extend(Ext.form.ComboBox, {
+    initComponent:function() {
+
+        Ext.apply(this, {
+            tpl:  '<tpl for=".">'
+                + '<div class="x-combo-list-item ux-icon-combo-item '
+                + '{' + this.iconClsField + '}">'
+                + '{' + this.displayField + '}'
+                + '</div></tpl>'
         });
-    } // end of function init
-}); // end of extend
+
+        // call parent initComponent
+        Ext.ux.IconCombo.superclass.initComponent.call(this);
+
+    }, // end of function initComponent
+
+    onRender:function(ct, position) {
+        // call parent onRender
+        Ext.ux.IconCombo.superclass.onRender.call(this, ct, position);
+
+        // adjust styles
+        this.wrap.applyStyles({position:'relative'});
+        this.el.addClass('ux-icon-combo-input');
+
+        // add div for icon
+        this.icon = Ext.DomHelper.append(this.el.up('div.x-form-field-wrap'), {
+            tag: 'div', style:'position:absolute'
+        });
+
+    }, // end of function onRender
+
+    setIconCls:function() {
+        var rec = this.store.query(this.valueField, this.getValue()).itemAt(0);
+        if(rec) {
+            this.icon.className = 'ux-icon-combo-icon ' + rec.get(this.iconClsField);
+        }
+    }, // end of function setIconCls
+
+    setValue: function(value) {
+        Ext.ux.IconCombo.superclass.setValue.call(this, value);
+        this.setIconCls();
+    } // end of function setValue
+});
+
+// register xtype
+Ext.reg('iconcombo', Ext.ux.IconCombo);
+
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.