mirror of
https://github.com/codex-storage/deluge.git
synced 2025-02-05 08:03:40 +00:00
WebUI: Increase focus delay for password field cursor
This commit is contained in:
parent
5572f61022
commit
d783b8ead7
@ -7033,7 +7033,7 @@ Ext.each(Deluge.Keys.Grid, function(key) {
|
||||
});
|
||||
/*!
|
||||
* Deluge.LoginWindow.js
|
||||
*
|
||||
*
|
||||
* Copyright (c) Damien Churchill 2009-2010 <damoxc@gmail.com>
|
||||
*
|
||||
* This program is free software; you can redistribute it and/or modify
|
||||
@ -7064,7 +7064,7 @@ Ext.each(Deluge.Keys.Grid, function(key) {
|
||||
*/
|
||||
|
||||
Deluge.LoginWindow = Ext.extend(Ext.Window, {
|
||||
|
||||
|
||||
firstShow: true,
|
||||
bodyStyle: 'padding: 10px 5px;',
|
||||
buttonAlign: 'center',
|
||||
@ -7078,17 +7078,17 @@ Deluge.LoginWindow = Ext.extend(Ext.Window, {
|
||||
title: _('Login'),
|
||||
width: 300,
|
||||
height: 120,
|
||||
|
||||
|
||||
initComponent: function() {
|
||||
Deluge.LoginWindow.superclass.initComponent.call(this);
|
||||
this.on('show', this.onShow, this);
|
||||
|
||||
|
||||
this.addButton({
|
||||
text: _('Login'),
|
||||
handler: this.onLogin,
|
||||
scope: this
|
||||
});
|
||||
|
||||
|
||||
this.form = this.add({
|
||||
xtype: 'form',
|
||||
baseCls: 'x-plain',
|
||||
@ -7107,7 +7107,7 @@ Deluge.LoginWindow = Ext.extend(Ext.Window, {
|
||||
});
|
||||
this.passwordField.on('specialkey', this.onSpecialKey, this);
|
||||
},
|
||||
|
||||
|
||||
logout: function() {
|
||||
deluge.events.fire('logout');
|
||||
deluge.client.auth.delete_session({
|
||||
@ -7117,17 +7117,17 @@ Deluge.LoginWindow = Ext.extend(Ext.Window, {
|
||||
scope: this
|
||||
});
|
||||
},
|
||||
|
||||
|
||||
show: function(skipCheck) {
|
||||
if (this.firstShow) {
|
||||
deluge.client.on('error', this.onClientError, this);
|
||||
this.firstShow = false;
|
||||
}
|
||||
|
||||
|
||||
if (skipCheck) {
|
||||
return Deluge.LoginWindow.superclass.show.call(this);
|
||||
}
|
||||
|
||||
|
||||
deluge.client.auth.check_session({
|
||||
success: function(result) {
|
||||
if (result) {
|
||||
@ -7142,11 +7142,11 @@ Deluge.LoginWindow = Ext.extend(Ext.Window, {
|
||||
scope: this
|
||||
});
|
||||
},
|
||||
|
||||
|
||||
onSpecialKey: function(field, e) {
|
||||
if (e.getKey() == 13) this.onLogin();
|
||||
},
|
||||
|
||||
|
||||
onLogin: function() {
|
||||
var passwordField = this.passwordField;
|
||||
deluge.client.auth.login(passwordField.getValue(), {
|
||||
@ -7172,16 +7172,16 @@ Deluge.LoginWindow = Ext.extend(Ext.Window, {
|
||||
scope: this
|
||||
});
|
||||
},
|
||||
|
||||
|
||||
onClientError: function(errorObj, response, requestOptions) {
|
||||
if (errorObj.error.code == 1) {
|
||||
deluge.events.fire('logout');
|
||||
this.show(true);
|
||||
}
|
||||
},
|
||||
|
||||
|
||||
onShow: function() {
|
||||
this.passwordField.focus(true, 100);
|
||||
this.passwordField.focus(true, 300);
|
||||
}
|
||||
});
|
||||
/*!
|
||||
|
@ -1408,7 +1408,7 @@ Ext.ns("Deluge");Deluge.FilterPanel=Ext.extend(Ext.Panel,{autoScroll:true,border
|
||||
Deluge.Keys={Grid:["queue","name","total_size","state","progress","num_seeds","total_seeds","num_peers","total_peers","download_payload_rate","upload_payload_rate","eta","ratio","distributed_copies","is_auto_managed","time_added","tracker_host","save_path","total_done","total_uploaded","max_download_speed","max_upload_speed","seeds_peers_ratio"],Status:["total_done","total_payload_download","total_uploaded","total_payload_upload","next_announce","tracker_status","num_pieces","piece_length","is_auto_managed","active_time","seeding_time","seed_rank"],Files:["files","file_progress","file_priorities"],Peers:["peers"],Details:["name","save_path","total_size","num_files","message","tracker","comment"],Options:["max_download_speed","max_upload_speed","max_connections","max_upload_slots","is_auto_managed","stop_at_ratio","stop_ratio","remove_at_ratio","private","prioritize_first_last","move_completed","move_completed_path"]};Ext.each(Deluge.Keys.Grid,function(a){Deluge.Keys.Status.push(a)});
|
||||
/*
|
||||
* Deluge.LoginWindow.js
|
||||
*
|
||||
*
|
||||
* Copyright (c) Damien Churchill 2009-2010 <damoxc@gmail.com>
|
||||
*
|
||||
* This program is free software; you can redistribute it and/or modify
|
||||
@ -1437,7 +1437,7 @@ Deluge.Keys={Grid:["queue","name","total_size","state","progress","num_seeds","t
|
||||
* this exception statement from your version. If you delete this exception
|
||||
* statement from all source files in the program, then also delete it here.
|
||||
*/
|
||||
Deluge.LoginWindow=Ext.extend(Ext.Window,{firstShow:true,bodyStyle:"padding: 10px 5px;",buttonAlign:"center",closable:false,closeAction:"hide",iconCls:"x-deluge-login-window-icon",layout:"fit",modal:true,plain:true,resizable:false,title:_("Login"),width:300,height:120,initComponent:function(){Deluge.LoginWindow.superclass.initComponent.call(this);this.on("show",this.onShow,this);this.addButton({text:_("Login"),handler:this.onLogin,scope:this});this.form=this.add({xtype:"form",baseCls:"x-plain",labelWidth:55,width:300,defaults:{width:200},defaultType:"textfield"});this.passwordField=this.form.add({xtype:"textfield",fieldLabel:_("Password"),id:"_password",name:"password",inputType:"password"});this.passwordField.on("specialkey",this.onSpecialKey,this)},logout:function(){deluge.events.fire("logout");deluge.client.auth.delete_session({success:function(a){this.show(true)},scope:this})},show:function(a){if(this.firstShow){deluge.client.on("error",this.onClientError,this);this.firstShow=false}if(a){return Deluge.LoginWindow.superclass.show.call(this)}deluge.client.auth.check_session({success:function(b){if(b){deluge.events.fire("login")}else{this.show(true)}},failure:function(b){this.show(true)},scope:this})},onSpecialKey:function(b,a){if(a.getKey()==13){this.onLogin()}},onLogin:function(){var a=this.passwordField;deluge.client.auth.login(a.getValue(),{success:function(b){if(b){deluge.events.fire("login");this.hide();a.setRawValue("")}else{Ext.MessageBox.show({title:_("Login Failed"),msg:_("You entered an incorrect password"),buttons:Ext.MessageBox.OK,modal:false,fn:function(){a.focus(true,10)},icon:Ext.MessageBox.WARNING,iconCls:"x-deluge-icon-warning"})}},scope:this})},onClientError:function(c,b,a){if(c.error.code==1){deluge.events.fire("logout");this.show(true)}},onShow:function(){this.passwordField.focus(true,100)}});
|
||||
Deluge.LoginWindow=Ext.extend(Ext.Window,{firstShow:true,bodyStyle:"padding: 10px 5px;",buttonAlign:"center",closable:false,closeAction:"hide",iconCls:"x-deluge-login-window-icon",layout:"fit",modal:true,plain:true,resizable:false,title:_("Login"),width:300,height:120,initComponent:function(){Deluge.LoginWindow.superclass.initComponent.call(this);this.on("show",this.onShow,this);this.addButton({text:_("Login"),handler:this.onLogin,scope:this});this.form=this.add({xtype:"form",baseCls:"x-plain",labelWidth:55,width:300,defaults:{width:200},defaultType:"textfield"});this.passwordField=this.form.add({xtype:"textfield",fieldLabel:_("Password"),id:"_password",name:"password",inputType:"password"});this.passwordField.on("specialkey",this.onSpecialKey,this)},logout:function(){deluge.events.fire("logout");deluge.client.auth.delete_session({success:function(a){this.show(true)},scope:this})},show:function(a){if(this.firstShow){deluge.client.on("error",this.onClientError,this);this.firstShow=false}if(a){return Deluge.LoginWindow.superclass.show.call(this)}deluge.client.auth.check_session({success:function(b){if(b){deluge.events.fire("login")}else{this.show(true)}},failure:function(b){this.show(true)},scope:this})},onSpecialKey:function(b,a){if(a.getKey()==13){this.onLogin()}},onLogin:function(){var a=this.passwordField;deluge.client.auth.login(a.getValue(),{success:function(b){if(b){deluge.events.fire("login");this.hide();a.setRawValue("")}else{Ext.MessageBox.show({title:_("Login Failed"),msg:_("You entered an incorrect password"),buttons:Ext.MessageBox.OK,modal:false,fn:function(){a.focus(true,10)},icon:Ext.MessageBox.WARNING,iconCls:"x-deluge-icon-warning"})}},scope:this})},onClientError:function(c,b,a){if(c.error.code==1){deluge.events.fire("logout");this.show(true)}},onShow:function(){this.passwordField.focus(true,300)}});
|
||||
/*
|
||||
* Deluge.Menus.js
|
||||
*
|
||||
|
@ -1,6 +1,6 @@
|
||||
/*!
|
||||
* Deluge.LoginWindow.js
|
||||
*
|
||||
*
|
||||
* Copyright (c) Damien Churchill 2009-2010 <damoxc@gmail.com>
|
||||
*
|
||||
* This program is free software; you can redistribute it and/or modify
|
||||
@ -31,7 +31,7 @@
|
||||
*/
|
||||
|
||||
Deluge.LoginWindow = Ext.extend(Ext.Window, {
|
||||
|
||||
|
||||
firstShow: true,
|
||||
bodyStyle: 'padding: 10px 5px;',
|
||||
buttonAlign: 'center',
|
||||
@ -45,17 +45,17 @@ Deluge.LoginWindow = Ext.extend(Ext.Window, {
|
||||
title: _('Login'),
|
||||
width: 300,
|
||||
height: 120,
|
||||
|
||||
|
||||
initComponent: function() {
|
||||
Deluge.LoginWindow.superclass.initComponent.call(this);
|
||||
this.on('show', this.onShow, this);
|
||||
|
||||
|
||||
this.addButton({
|
||||
text: _('Login'),
|
||||
handler: this.onLogin,
|
||||
scope: this
|
||||
});
|
||||
|
||||
|
||||
this.form = this.add({
|
||||
xtype: 'form',
|
||||
baseCls: 'x-plain',
|
||||
@ -74,7 +74,7 @@ Deluge.LoginWindow = Ext.extend(Ext.Window, {
|
||||
});
|
||||
this.passwordField.on('specialkey', this.onSpecialKey, this);
|
||||
},
|
||||
|
||||
|
||||
logout: function() {
|
||||
deluge.events.fire('logout');
|
||||
deluge.client.auth.delete_session({
|
||||
@ -84,17 +84,17 @@ Deluge.LoginWindow = Ext.extend(Ext.Window, {
|
||||
scope: this
|
||||
});
|
||||
},
|
||||
|
||||
|
||||
show: function(skipCheck) {
|
||||
if (this.firstShow) {
|
||||
deluge.client.on('error', this.onClientError, this);
|
||||
this.firstShow = false;
|
||||
}
|
||||
|
||||
|
||||
if (skipCheck) {
|
||||
return Deluge.LoginWindow.superclass.show.call(this);
|
||||
}
|
||||
|
||||
|
||||
deluge.client.auth.check_session({
|
||||
success: function(result) {
|
||||
if (result) {
|
||||
@ -109,11 +109,11 @@ Deluge.LoginWindow = Ext.extend(Ext.Window, {
|
||||
scope: this
|
||||
});
|
||||
},
|
||||
|
||||
|
||||
onSpecialKey: function(field, e) {
|
||||
if (e.getKey() == 13) this.onLogin();
|
||||
},
|
||||
|
||||
|
||||
onLogin: function() {
|
||||
var passwordField = this.passwordField;
|
||||
deluge.client.auth.login(passwordField.getValue(), {
|
||||
@ -139,15 +139,15 @@ Deluge.LoginWindow = Ext.extend(Ext.Window, {
|
||||
scope: this
|
||||
});
|
||||
},
|
||||
|
||||
|
||||
onClientError: function(errorObj, response, requestOptions) {
|
||||
if (errorObj.error.code == 1) {
|
||||
deluge.events.fire('logout');
|
||||
this.show(true);
|
||||
}
|
||||
},
|
||||
|
||||
|
||||
onShow: function() {
|
||||
this.passwordField.focus(true, 100);
|
||||
this.passwordField.focus(true, 300);
|
||||
}
|
||||
});
|
||||
|
Loading…
x
Reference in New Issue
Block a user