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

[email protected] (Yannick Torres)
Newsgroups php.doc.web
Message-ID <[email protected]>
yannick                                  Wed, 29 Dec 2010 20:36:04 +0000

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

Log:
Rename login button into 'Anonymous login' in some case

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

Modified: web/doc-editor/trunk/js/login.js
===================================================================
--- web/doc-editor/trunk/js/login.js	2010-12-29 20:11:14 UTC (rev 306834)
+++ web/doc-editor/trunk/js/login.js	2010-12-29 20:36:04 UTC (rev 306835)
@@ -7,8 +7,7 @@

         storeLang    : '',
         storeProject : '',
-
-		email : Ext.util.Cookies.get("email"),
+        email : Ext.util.Cookies.get("email"),

         init : function()
         {
@@ -91,7 +90,7 @@
                         render : function(c)
                         {
                             var t = new Ext.util.DelayedTask(function() {
-
+
                                 Ext.getCmp('login-form-vcsLogin').focus();
                             });

@@ -168,6 +167,22 @@
                                     if (e.getKey() == e.ENTER) {
                                         Ext.getCmp('login-form-vcsPasswd').focus();
                                     }
+                                },
+                                keyup: function(f,e)
+                                {
+                                    var v = this.getValue(),
+                                        currentLoginText = Ext.getCmp('login-btn').getText();
+
+                                    if( v == 'anonymous' || v == '' ) {
+                                        if( currentLoginText != 'Anonymous login' ) {
+                                            Ext.getCmp('login-btn').setText('Anonymous login');
+                                        }
+                                    } else {
+                                        if( currentLoginText == 'Anonymous login' ) {
+                                            Ext.getCmp('login-btn').setText('Login');
+                                        }
+                                    }
+
                                 }
                             }
                         }, {
@@ -188,8 +203,8 @@
                             fieldLabel      : 'Email',
                             name            : 'email',
                             id              : 'login-form-email',
-							vtype           : 'email',
-							value           : this.email,
+                            vtype           : 'email',
+                            value           : this.email,
                             enableKeyEvents : true,
                             listeners       : {
                                 keypress : function(field, e)
@@ -251,7 +266,7 @@
                             }
                         }
                     }, '->', {
-                        text      : 'Login',
+                        text      :  ( Ext.util.Cookies.get("loginApp") && Ext.util.Cookies.get("loginApp") != 'anonymous' ) ? 'Login' : 'Anonymous login',
                         id        : 'login-btn',
                         disabled  : false,
                         listeners : {
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.