refactor js. getFormTokenValue() -> getFormTokenNumberValue().

pull/650/head
William Kim 2013-08-14 14:25:38 -04:00 committed by Justin Richer
parent 895e257432
commit 11f47e85a9
1 changed files with 10 additions and 7 deletions

View File

@ -366,9 +366,12 @@ var ClientFormView = Backbone.View.extend({
}
},
getFormTokenValue:function(value) {
if (value == "") return null;
else return value;
getFormTokenNumberValue:function(value) {
if (value == "") {
return null;
} else {
return parseInt(value);
}
},
// returns "null" if given the value "default" as a string, otherwise returns input value. useful for parsing the JOSE algorithm dropdowns
@ -405,7 +408,7 @@ var ClientFormView = Backbone.View.extend({
'refresh_token': 'refresh_token'
},
// maps from a form-friendly name to the real reponse type parameter name
// maps from a form-friendly name to the real response type parameter name
responseMap:{
'code': 'code',
'token': 'token',
@ -450,12 +453,12 @@ var ClientFormView = Backbone.View.extend({
var accessTokenValiditySeconds = null;
if (!$('disableAccessTokenTimeout').is(':checked')) {
accessTokenValiditySeconds = parseInt(this.getFormTokenValue($('#accessTokenValiditySeconds input[type=text]').val()));
accessTokenValiditySeconds = this.getFormTokenNumberValue($('#accessTokenValiditySeconds input[type=text]').val());
}
var idTokenValiditySeconds = null;
if (!$('disableIDTokenTimeout').is(':checked')) {
idTokenValiditySeconds = parseInt(this.getFormTokenValue($('#idTokenValiditySeconds input[type=text]').val()));
idTokenValiditySeconds = this.getFormTokenNumberValue($('#idTokenValiditySeconds input[type=text]').val());
}
var refreshTokenValiditySeconds = null;
@ -470,7 +473,7 @@ var ClientFormView = Backbone.View.extend({
}
if (!$('disableRefreshTokenTimeout').is(':checked')) {
refreshTokenValiditySeconds = parseInt(this.getFormTokenValue($('#refreshTokenValiditySeconds input[type=text]').val()));
refreshTokenValiditySeconds = this.getFormTokenNumberValue($('#refreshTokenValiditySeconds input[type=text]').val());
}
}