[pve-devel] r5772 - in pve-manager/pve2/www/new: . window

svn-commits at proxmox.com svn-commits at proxmox.com
Wed Mar 30 07:38:56 CEST 2011


Author: dietmar
Date: 2011-03-30 07:38:56 +0200 (Wed, 30 Mar 2011)
New Revision: 5772

Modified:
   pve-manager/pve2/www/new/
   pve-manager/pve2/www/new/Workspace.js
   pve-manager/pve2/www/new/window/LoginWindow.js
Log:
cleanups



Property changes on: pve-manager/pve2/www/new
___________________________________________________________________
Added: svn:ignore
   + Makefile.in
pvemanagerlib.js
Makefile



Modified: pve-manager/pve2/www/new/Workspace.js
===================================================================
--- pve-manager/pve2/www/new/Workspace.js	2011-03-30 05:22:35 UTC (rev 5771)
+++ pve-manager/pve2/www/new/Workspace.js	2011-03-30 05:38:56 UTC (rev 5772)
@@ -1,10 +1,6 @@
-Ext.require([
-    'PVE.window.LoginWindow',
-    'PVE.Utils'
-]);
-
 Ext.define('PVE.Workspace', {
     extend: 'Ext.container.Viewport',
+    requires: ['PVE.window.LoginWindow', 'PVE.Utils'],
 
     // private
     defaultView: {

Modified: pve-manager/pve2/www/new/window/LoginWindow.js
===================================================================
--- pve-manager/pve2/www/new/window/LoginWindow.js	2011-03-30 05:22:35 UTC (rev 5771)
+++ pve-manager/pve2/www/new/window/LoginWindow.js	2011-03-30 05:38:56 UTC (rev 5772)
@@ -1,6 +1,10 @@
-Ext.define('PVE.window.LoginWindow', function() {
+Ext.define('PVE.window.LoginWindow', {
+    extend: 'Ext.window.Window',
+    requires: ['PVE.form.RealmComboBox'],
 
-    var onLogon = function(self) {
+    // private
+    onLogon: function() {
+	var self = this;
 
 	var form = self.getComponent(0).getForm();
 
@@ -24,91 +28,87 @@
 		}
 	    });
 	}
-    };
+    },
 
-    return {
-	extend: 'Ext.window.Window',
-	uses: ['PVE.form.RealmComboBox'],
+    initComponent: function() {
+	var self = this;
 
-	initComponent: function() {
-	    var self = this;
+	Ext.apply(self, {
+	    width: 400,
+	    height: 160,
+	    modal: true,
+	    border: false,
+	    draggable: true,
+	    closable: false,
+	    resizable: false,
+	    layout: 'fit',
+	    title: 'PVE Manager Login',
 
-	    Ext.apply(self, {
-		width: 400,
-		height: 160,
-		modal: true,
-		border: false,
-		draggable: true,
-		closable: false,
-		resizable: false,
-		layout: 'fit',
-		title: 'PVE Manager Login',
+	    items: [{
+		xtype: 'form',
+		frame: true,
+		url: '/api2/extjs/access/ticket',
 
-		items: [{
-		    xtype: 'form',
-		    frame: true,
-		    url: '/api2/extjs/access/ticket',
+		labelWidth: 70,
+		labelAlign  : 'right',
 
-		    labelWidth: 70,
-		    labelAlign  : 'right',
-
-		    defaults: {
-			anchor: '-5',
-			allowBlank: false
-		    },
-
-		    items: [
-			{ 
-			    xtype: 'textfield', 
-			    fieldLabel: 'User name', 
-			    name: 'username',
-			    blankText: "Enter your user name",
-			    listeners: {
-				render: function(f) {
-				    f.focus(true, 500);
-				},
-				specialkey: function(f, e) {
-				    if (e.getKey() === e.ENTER) {
-					var pf = self.query('textfield[name="password"]')[0];
-					if (pf.getValue()) {
-					    onLogon(self);
-					} else {
-					    pf.focus(false);
-					}
+		defaults: {
+		    anchor: '-5',
+		    allowBlank: false
+		},
+		
+		items: [
+		    { 
+			xtype: 'textfield', 
+			fieldLabel: 'User name', 
+			name: 'username',
+			blankText: "Enter your user name",
+			listeners: {
+			    render: function(f) {
+				f.focus(true, 500);
+			    },
+			    specialkey: function(f, e) {
+				if (e.getKey() === e.ENTER) {
+				    var pf = self.query('textfield[name="password"]')[0];
+				    if (pf.getValue()) {
+					self.onLogon();
+				    } else {
+					pf.focus(false);
 				    }
 				}
 			    }
-			},
-			{ 
-			    xtype: 'textfield', 
-			    inputType: 'password',
-			    fieldLabel: 'Password', 
-			    name: 'password',
-			    blankText:"Enter your password",
-			    listeners: {
-				specialkey: function(field, e) {
-				    if (e.getKey() === e.ENTER) {
-					onLogon(self);
-				    }
+			}
+		    },
+		    { 
+			xtype: 'textfield', 
+			inputType: 'password',
+			fieldLabel: 'Password', 
+			name: 'password',
+			blankText:"Enter your password",
+			listeners: {
+			    specialkey: function(field, e) {
+				if (e.getKey() === e.ENTER) {
+				    self.onLogon();
 				}
 			    }
-			},
-			{
-			    xtype: 'PVERealmComboBox',
-			    name: 'realm'
 			}
-		    ],
-		    buttons: [
-			{
-			    text: 'Login',
-			    handler: function(){
-				onLogon(self);
-			    }
+		    },
+		    {
+			xtype: 'PVERealmComboBox',
+			name: 'realm'
+		    }
+		],
+		buttons: [
+		    {
+			text: 'Login',
+			handler: function(){
+			    self.onLogon();
 			}
-		    ]
-		}]
-	    });
+		    }
+		]
+	    }]
+	});
 
-	    PVE.window.LoginWindow.superclass.initComponent.call(self);
-	}
-    }}());
+	PVE.window.LoginWindow.superclass.initComponent.call(self);
+    }
+});




More information about the pve-devel mailing list