mirror of
https://github.com/the-djmaze/snappymail.git
synced 2026-07-11 00:14:50 +03:00
CommonJS (research/2)
This commit is contained in:
parent
56607de87c
commit
586abbb802
115 changed files with 16201 additions and 9943 deletions
|
|
@ -1,344 +1,366 @@
|
|||
/* RainLoop Webmail (c) RainLoop Team | Licensed under CC BY-NC-SA 3.0 */
|
||||
|
||||
/**
|
||||
* @constructor
|
||||
* @extends KnoinAbstractViewModel
|
||||
*/
|
||||
function LoginViewModel()
|
||||
{
|
||||
KnoinAbstractViewModel.call(this, 'Center', 'Login');
|
||||
(function (module) {
|
||||
|
||||
var oData = RL.data();
|
||||
'use strict';
|
||||
|
||||
this.email = ko.observable('');
|
||||
this.password = ko.observable('');
|
||||
this.signMe = ko.observable(false);
|
||||
var
|
||||
window = require('../External/window.js'),
|
||||
$ = require('../External/jquery.js'),
|
||||
_ = require('../External/underscore.js'),
|
||||
ko = require('../External/ko.js'),
|
||||
|
||||
Utils = require('../Common/Utils.js'),
|
||||
Enums = require('../Common/Enums.js'),
|
||||
LinkBuilder = require('../Common/LinkBuilder.js'),
|
||||
|
||||
this.additionalCode = ko.observable('');
|
||||
this.additionalCode.error = ko.observable(false);
|
||||
this.additionalCode.focused = ko.observable(false);
|
||||
this.additionalCode.visibility = ko.observable(false);
|
||||
this.additionalCodeSignMe = ko.observable(false);
|
||||
Remote = require('../Storages/WebMailAjaxRemoteStorage.js'),
|
||||
|
||||
this.logoImg = Utils.trim(RL.settingsGet('LoginLogo'));
|
||||
this.loginDescription = Utils.trim(RL.settingsGet('LoginDescription'));
|
||||
this.logoCss = Utils.trim(RL.settingsGet('LoginCss'));
|
||||
kn = require('../Knoin/Knoin.js'),
|
||||
KnoinAbstractViewModel = require('../Knoin/KnoinAbstractViewModel.js')
|
||||
;
|
||||
|
||||
this.emailError = ko.observable(false);
|
||||
this.passwordError = ko.observable(false);
|
||||
/**
|
||||
* @constructor
|
||||
* @extends KnoinAbstractViewModel
|
||||
*/
|
||||
function LoginViewModel()
|
||||
{
|
||||
KnoinAbstractViewModel.call(this, 'Center', 'Login');
|
||||
|
||||
this.emailFocus = ko.observable(false);
|
||||
this.submitFocus = ko.observable(false);
|
||||
var oData = RL.data();
|
||||
|
||||
this.email.subscribe(function () {
|
||||
this.emailError(false);
|
||||
this.additionalCode('');
|
||||
this.additionalCode.visibility(false);
|
||||
}, this);
|
||||
this.email = ko.observable('');
|
||||
this.password = ko.observable('');
|
||||
this.signMe = ko.observable(false);
|
||||
|
||||
this.password.subscribe(function () {
|
||||
this.passwordError(false);
|
||||
}, this);
|
||||
this.additionalCode = ko.observable('');
|
||||
this.additionalCode.error = ko.observable(false);
|
||||
this.additionalCode.focused = ko.observable(false);
|
||||
this.additionalCode.visibility = ko.observable(false);
|
||||
this.additionalCodeSignMe = ko.observable(false);
|
||||
|
||||
this.additionalCode.subscribe(function () {
|
||||
this.additionalCode.error(false);
|
||||
}, this);
|
||||
this.logoImg = Utils.trim(RL.settingsGet('LoginLogo'));
|
||||
this.loginDescription = Utils.trim(RL.settingsGet('LoginDescription'));
|
||||
this.logoCss = Utils.trim(RL.settingsGet('LoginCss'));
|
||||
|
||||
this.additionalCode.visibility.subscribe(function () {
|
||||
this.additionalCode.error(false);
|
||||
}, this);
|
||||
this.emailError = ko.observable(false);
|
||||
this.passwordError = ko.observable(false);
|
||||
|
||||
this.submitRequest = ko.observable(false);
|
||||
this.submitError = ko.observable('');
|
||||
this.emailFocus = ko.observable(false);
|
||||
this.submitFocus = ko.observable(false);
|
||||
|
||||
this.allowLanguagesOnLogin = oData.allowLanguagesOnLogin;
|
||||
this.email.subscribe(function () {
|
||||
this.emailError(false);
|
||||
this.additionalCode('');
|
||||
this.additionalCode.visibility(false);
|
||||
}, this);
|
||||
|
||||
this.langRequest = ko.observable(false);
|
||||
this.mainLanguage = oData.mainLanguage;
|
||||
this.bSendLanguage = false;
|
||||
this.password.subscribe(function () {
|
||||
this.passwordError(false);
|
||||
}, this);
|
||||
|
||||
this.mainLanguageFullName = ko.computed(function () {
|
||||
return Utils.convertLangName(this.mainLanguage());
|
||||
}, this);
|
||||
this.additionalCode.subscribe(function () {
|
||||
this.additionalCode.error(false);
|
||||
}, this);
|
||||
|
||||
this.signMeType = ko.observable(Enums.LoginSignMeType.Unused);
|
||||
this.additionalCode.visibility.subscribe(function () {
|
||||
this.additionalCode.error(false);
|
||||
}, this);
|
||||
|
||||
this.signMeType.subscribe(function (iValue) {
|
||||
this.signMe(Enums.LoginSignMeType.DefaultOn === iValue);
|
||||
}, this);
|
||||
this.submitRequest = ko.observable(false);
|
||||
this.submitError = ko.observable('');
|
||||
|
||||
this.signMeVisibility = ko.computed(function () {
|
||||
return Enums.LoginSignMeType.Unused !== this.signMeType();
|
||||
}, this);
|
||||
this.allowLanguagesOnLogin = oData.allowLanguagesOnLogin;
|
||||
|
||||
this.submitCommand = Utils.createCommand(this, function () {
|
||||
this.langRequest = ko.observable(false);
|
||||
this.mainLanguage = oData.mainLanguage;
|
||||
this.bSendLanguage = false;
|
||||
|
||||
Utils.triggerAutocompleteInputChange();
|
||||
this.mainLanguageFullName = ko.computed(function () {
|
||||
return Utils.convertLangName(this.mainLanguage());
|
||||
}, this);
|
||||
|
||||
this.emailError('' === Utils.trim(this.email()));
|
||||
this.passwordError('' === Utils.trim(this.password()));
|
||||
this.signMeType = ko.observable(Enums.LoginSignMeType.Unused);
|
||||
|
||||
if (this.additionalCode.visibility())
|
||||
{
|
||||
this.additionalCode.error('' === Utils.trim(this.additionalCode()));
|
||||
}
|
||||
this.signMeType.subscribe(function (iValue) {
|
||||
this.signMe(Enums.LoginSignMeType.DefaultOn === iValue);
|
||||
}, this);
|
||||
|
||||
if (this.emailError() || this.passwordError() || this.additionalCode.error())
|
||||
{
|
||||
return false;
|
||||
}
|
||||
this.signMeVisibility = ko.computed(function () {
|
||||
return Enums.LoginSignMeType.Unused !== this.signMeType();
|
||||
}, this);
|
||||
|
||||
this.submitRequest(true);
|
||||
this.submitCommand = Utils.createCommand(this, function () {
|
||||
|
||||
var
|
||||
sPassword = this.password(),
|
||||
Utils.triggerAutocompleteInputChange();
|
||||
|
||||
fLoginRequest = _.bind(function (sPassword) {
|
||||
this.emailError('' === Utils.trim(this.email()));
|
||||
this.passwordError('' === Utils.trim(this.password()));
|
||||
|
||||
RL.remote().login(_.bind(function (sResult, oData) {
|
||||
if (this.additionalCode.visibility())
|
||||
{
|
||||
this.additionalCode.error('' === Utils.trim(this.additionalCode()));
|
||||
}
|
||||
|
||||
if (Enums.StorageResultType.Success === sResult && oData && 'Login' === oData.Action)
|
||||
{
|
||||
if (oData.Result)
|
||||
if (this.emailError() || this.passwordError() || this.additionalCode.error())
|
||||
{
|
||||
return false;
|
||||
}
|
||||
|
||||
this.submitRequest(true);
|
||||
|
||||
var
|
||||
sPassword = this.password(),
|
||||
|
||||
fLoginRequest = _.bind(function (sPassword) {
|
||||
|
||||
Remote.login(_.bind(function (sResult, oData) {
|
||||
|
||||
if (Enums.StorageResultType.Success === sResult && oData && 'Login' === oData.Action)
|
||||
{
|
||||
if (oData.TwoFactorAuth)
|
||||
if (oData.Result)
|
||||
{
|
||||
this.additionalCode('');
|
||||
this.additionalCode.visibility(true);
|
||||
this.additionalCode.focused(true);
|
||||
if (oData.TwoFactorAuth)
|
||||
{
|
||||
this.additionalCode('');
|
||||
this.additionalCode.visibility(true);
|
||||
this.additionalCode.focused(true);
|
||||
|
||||
this.submitRequest(false);
|
||||
}
|
||||
else
|
||||
{
|
||||
RL.loginAndLogoutReload();
|
||||
}
|
||||
}
|
||||
else if (oData.ErrorCode)
|
||||
{
|
||||
this.submitRequest(false);
|
||||
this.submitError(Utils.getNotification(oData.ErrorCode));
|
||||
|
||||
if ('' === this.submitError())
|
||||
{
|
||||
this.submitError(Utils.getNotification(Enums.Notification.UnknownError));
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
RL.loginAndLogoutReload();
|
||||
}
|
||||
}
|
||||
else if (oData.ErrorCode)
|
||||
{
|
||||
this.submitRequest(false);
|
||||
this.submitError(Utils.getNotification(oData.ErrorCode));
|
||||
|
||||
if ('' === this.submitError())
|
||||
{
|
||||
this.submitError(Utils.getNotification(Enums.Notification.UnknownError));
|
||||
this.submitRequest(false);
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
this.submitRequest(false);
|
||||
this.submitError(Utils.getNotification(Enums.Notification.UnknownError));
|
||||
}
|
||||
|
||||
}, this), this.email(), '', sPassword, !!this.signMe(),
|
||||
this.bSendLanguage ? this.mainLanguage() : '',
|
||||
this.additionalCode.visibility() ? this.additionalCode() : '',
|
||||
this.additionalCode.visibility() ? !!this.additionalCodeSignMe() : false
|
||||
);
|
||||
|
||||
}, this)
|
||||
;
|
||||
|
||||
if (!!RL.settingsGet('UseRsaEncryption') && Utils.rsaEncode.supported)
|
||||
{
|
||||
Remote.getPublicKey(_.bind(function (sResult, oData) {
|
||||
|
||||
var bRequest = false;
|
||||
if (Enums.StorageResultType.Success === sResult && oData && oData.Result &&
|
||||
Utils.isArray(oData.Result) && oData.Result[0] && oData.Result[1] && oData.Result[2])
|
||||
{
|
||||
var sEncryptedPassword = Utils.rsaEncode(sPassword, oData.Result[0], oData.Result[1], oData.Result[2]);
|
||||
if (sEncryptedPassword)
|
||||
{
|
||||
fLoginRequest(sEncryptedPassword);
|
||||
bRequest = true;
|
||||
}
|
||||
}
|
||||
else
|
||||
|
||||
if (!bRequest)
|
||||
{
|
||||
this.submitRequest(false);
|
||||
this.submitError(Utils.getNotification(Enums.Notification.UnknownError));
|
||||
}
|
||||
|
||||
}, this), this.email(), '', sPassword, !!this.signMe(),
|
||||
this.bSendLanguage ? this.mainLanguage() : '',
|
||||
this.additionalCode.visibility() ? this.additionalCode() : '',
|
||||
this.additionalCode.visibility() ? !!this.additionalCodeSignMe() : false
|
||||
);
|
||||
|
||||
}, this)
|
||||
;
|
||||
|
||||
if (!!RL.settingsGet('UseRsaEncryption') && Utils.rsaEncode.supported)
|
||||
{
|
||||
RL.remote().getPublicKey(_.bind(function (sResult, oData) {
|
||||
|
||||
var bRequest = false;
|
||||
if (Enums.StorageResultType.Success === sResult && oData && oData.Result &&
|
||||
Utils.isArray(oData.Result) && oData.Result[0] && oData.Result[1] && oData.Result[2])
|
||||
{
|
||||
var sEncryptedPassword = Utils.rsaEncode(sPassword, oData.Result[0], oData.Result[1], oData.Result[2]);
|
||||
if (sEncryptedPassword)
|
||||
{
|
||||
fLoginRequest(sEncryptedPassword);
|
||||
bRequest = true;
|
||||
}
|
||||
}
|
||||
|
||||
if (!bRequest)
|
||||
{
|
||||
this.submitRequest(false);
|
||||
this.submitError(Utils.getNotification(Enums.Notification.UnknownError));
|
||||
}
|
||||
|
||||
}, this));
|
||||
}
|
||||
else
|
||||
{
|
||||
fLoginRequest(sPassword);
|
||||
}
|
||||
|
||||
return true;
|
||||
|
||||
}, function () {
|
||||
return !this.submitRequest();
|
||||
});
|
||||
|
||||
this.facebookLoginEnabled = ko.observable(false);
|
||||
|
||||
this.facebookCommand = Utils.createCommand(this, function () {
|
||||
|
||||
window.open(RL.link().socialFacebook(), 'Facebook', 'left=200,top=100,width=650,height=335,menubar=no,status=no,resizable=yes,scrollbars=yes');
|
||||
return true;
|
||||
|
||||
}, function () {
|
||||
return !this.submitRequest() && this.facebookLoginEnabled();
|
||||
});
|
||||
|
||||
this.googleLoginEnabled = ko.observable(false);
|
||||
|
||||
this.googleCommand = Utils.createCommand(this, function () {
|
||||
|
||||
window.open(RL.link().socialGoogle(), 'Google', 'left=200,top=100,width=650,height=335,menubar=no,status=no,resizable=yes,scrollbars=yes');
|
||||
return true;
|
||||
|
||||
}, function () {
|
||||
return !this.submitRequest() && this.googleLoginEnabled();
|
||||
});
|
||||
|
||||
this.twitterLoginEnabled = ko.observable(false);
|
||||
|
||||
this.twitterCommand = Utils.createCommand(this, function () {
|
||||
|
||||
window.open(RL.link().socialTwitter(), 'Twitter', 'left=200,top=100,width=650,height=335,menubar=no,status=no,resizable=yes,scrollbars=yes');
|
||||
return true;
|
||||
|
||||
}, function () {
|
||||
return !this.submitRequest() && this.twitterLoginEnabled();
|
||||
});
|
||||
|
||||
this.socialLoginEnabled = ko.computed(function () {
|
||||
|
||||
var
|
||||
bF = this.facebookLoginEnabled(),
|
||||
bG = this.googleLoginEnabled(),
|
||||
bT = this.twitterLoginEnabled()
|
||||
;
|
||||
|
||||
return bF || bG || bT;
|
||||
}, this);
|
||||
|
||||
Knoin.constructorEnd(this);
|
||||
}
|
||||
|
||||
Utils.extendAsViewModel('LoginViewModel', LoginViewModel);
|
||||
|
||||
LoginViewModel.prototype.onShow = function ()
|
||||
{
|
||||
kn.routeOff();
|
||||
|
||||
_.delay(_.bind(function () {
|
||||
if ('' !== this.email() && '' !== this.password())
|
||||
{
|
||||
this.submitFocus(true);
|
||||
}
|
||||
else
|
||||
{
|
||||
this.emailFocus(true);
|
||||
}
|
||||
|
||||
if (RL.settingsGet('UserLanguage'))
|
||||
{
|
||||
$.cookie('rllang', RL.data().language(), {'expires': 30});
|
||||
}
|
||||
|
||||
}, this), 100);
|
||||
};
|
||||
|
||||
LoginViewModel.prototype.onHide = function ()
|
||||
{
|
||||
this.submitFocus(false);
|
||||
this.emailFocus(false);
|
||||
};
|
||||
|
||||
LoginViewModel.prototype.onBuild = function ()
|
||||
{
|
||||
var
|
||||
self = this,
|
||||
sJsHash = RL.settingsGet('JsHash'),
|
||||
fSocial = function (iErrorCode) {
|
||||
iErrorCode = Utils.pInt(iErrorCode);
|
||||
if (0 === iErrorCode)
|
||||
{
|
||||
self.submitRequest(true);
|
||||
RL.loginAndLogoutReload();
|
||||
}, this));
|
||||
}
|
||||
else
|
||||
{
|
||||
self.submitError(Utils.getNotification(iErrorCode));
|
||||
fLoginRequest(sPassword);
|
||||
}
|
||||
}
|
||||
;
|
||||
|
||||
this.facebookLoginEnabled(!!RL.settingsGet('AllowFacebookSocial'));
|
||||
this.twitterLoginEnabled(!!RL.settingsGet('AllowTwitterSocial'));
|
||||
this.googleLoginEnabled(!!RL.settingsGet('AllowGoogleSocial'));
|
||||
return true;
|
||||
|
||||
switch ((RL.settingsGet('SignMe') || 'unused').toLowerCase())
|
||||
{
|
||||
case Enums.LoginSignMeTypeAsString.DefaultOff:
|
||||
this.signMeType(Enums.LoginSignMeType.DefaultOff);
|
||||
break;
|
||||
case Enums.LoginSignMeTypeAsString.DefaultOn:
|
||||
this.signMeType(Enums.LoginSignMeType.DefaultOn);
|
||||
break;
|
||||
default:
|
||||
case Enums.LoginSignMeTypeAsString.Unused:
|
||||
this.signMeType(Enums.LoginSignMeType.Unused);
|
||||
break;
|
||||
}
|
||||
|
||||
this.email(RL.data().devEmail);
|
||||
this.password(RL.data().devPassword);
|
||||
|
||||
if (this.googleLoginEnabled())
|
||||
{
|
||||
window['rl_' + sJsHash + '_google_login_service'] = fSocial;
|
||||
}
|
||||
|
||||
if (this.facebookLoginEnabled())
|
||||
{
|
||||
window['rl_' + sJsHash + '_facebook_login_service'] = fSocial;
|
||||
}
|
||||
|
||||
if (this.twitterLoginEnabled())
|
||||
{
|
||||
window['rl_' + sJsHash + '_twitter_login_service'] = fSocial;
|
||||
}
|
||||
|
||||
_.delay(function () {
|
||||
RL.data().language.subscribe(function (sValue) {
|
||||
self.langRequest(true);
|
||||
$.ajax({
|
||||
'url': RL.link().langLink(sValue),
|
||||
'dataType': 'script',
|
||||
'cache': true
|
||||
}).done(function() {
|
||||
self.bSendLanguage = true;
|
||||
Utils.i18nReload();
|
||||
$.cookie('rllang', RL.data().language(), {'expires': 30});
|
||||
}).always(function() {
|
||||
self.langRequest(false);
|
||||
});
|
||||
}, function () {
|
||||
return !this.submitRequest();
|
||||
});
|
||||
}, 50);
|
||||
|
||||
Utils.triggerAutocompleteInputChange(true);
|
||||
this.facebookLoginEnabled = ko.observable(false);
|
||||
|
||||
};
|
||||
this.facebookCommand = Utils.createCommand(this, function () {
|
||||
|
||||
LoginViewModel.prototype.submitForm = function ()
|
||||
{
|
||||
this.submitCommand();
|
||||
};
|
||||
window.open(LinkBuilder.socialFacebook(), 'Facebook', 'left=200,top=100,width=650,height=335,menubar=no,status=no,resizable=yes,scrollbars=yes');
|
||||
return true;
|
||||
|
||||
LoginViewModel.prototype.selectLanguage = function ()
|
||||
{
|
||||
kn.showScreenPopup(PopupsLanguagesViewModel);
|
||||
};
|
||||
}, function () {
|
||||
return !this.submitRequest() && this.facebookLoginEnabled();
|
||||
});
|
||||
|
||||
this.googleLoginEnabled = ko.observable(false);
|
||||
|
||||
this.googleCommand = Utils.createCommand(this, function () {
|
||||
|
||||
window.open(LinkBuilder.socialGoogle(), 'Google', 'left=200,top=100,width=650,height=335,menubar=no,status=no,resizable=yes,scrollbars=yes');
|
||||
return true;
|
||||
|
||||
}, function () {
|
||||
return !this.submitRequest() && this.googleLoginEnabled();
|
||||
});
|
||||
|
||||
this.twitterLoginEnabled = ko.observable(false);
|
||||
|
||||
this.twitterCommand = Utils.createCommand(this, function () {
|
||||
|
||||
window.open(LinkBuilder.socialTwitter(), 'Twitter', 'left=200,top=100,width=650,height=335,menubar=no,status=no,resizable=yes,scrollbars=yes');
|
||||
return true;
|
||||
|
||||
}, function () {
|
||||
return !this.submitRequest() && this.twitterLoginEnabled();
|
||||
});
|
||||
|
||||
this.socialLoginEnabled = ko.computed(function () {
|
||||
|
||||
var
|
||||
bF = this.facebookLoginEnabled(),
|
||||
bG = this.googleLoginEnabled(),
|
||||
bT = this.twitterLoginEnabled()
|
||||
;
|
||||
|
||||
return bF || bG || bT;
|
||||
}, this);
|
||||
|
||||
kn.constructorEnd(this);
|
||||
}
|
||||
|
||||
kn.extendAsViewModel('LoginViewModel', LoginViewModel);
|
||||
|
||||
LoginViewModel.prototype.onShow = function ()
|
||||
{
|
||||
kn.routeOff();
|
||||
|
||||
_.delay(_.bind(function () {
|
||||
if ('' !== this.email() && '' !== this.password())
|
||||
{
|
||||
this.submitFocus(true);
|
||||
}
|
||||
else
|
||||
{
|
||||
this.emailFocus(true);
|
||||
}
|
||||
|
||||
if (RL.settingsGet('UserLanguage'))
|
||||
{
|
||||
$.cookie('rllang', RL.data().language(), {'expires': 30});
|
||||
}
|
||||
|
||||
}, this), 100);
|
||||
};
|
||||
|
||||
LoginViewModel.prototype.onHide = function ()
|
||||
{
|
||||
this.submitFocus(false);
|
||||
this.emailFocus(false);
|
||||
};
|
||||
|
||||
LoginViewModel.prototype.onBuild = function ()
|
||||
{
|
||||
var
|
||||
self = this,
|
||||
sJsHash = RL.settingsGet('JsHash'),
|
||||
fSocial = function (iErrorCode) {
|
||||
iErrorCode = Utils.pInt(iErrorCode);
|
||||
if (0 === iErrorCode)
|
||||
{
|
||||
self.submitRequest(true);
|
||||
RL.loginAndLogoutReload();
|
||||
}
|
||||
else
|
||||
{
|
||||
self.submitError(Utils.getNotification(iErrorCode));
|
||||
}
|
||||
}
|
||||
;
|
||||
|
||||
this.facebookLoginEnabled(!!RL.settingsGet('AllowFacebookSocial'));
|
||||
this.twitterLoginEnabled(!!RL.settingsGet('AllowTwitterSocial'));
|
||||
this.googleLoginEnabled(!!RL.settingsGet('AllowGoogleSocial'));
|
||||
|
||||
switch ((RL.settingsGet('SignMe') || 'unused').toLowerCase())
|
||||
{
|
||||
case Enums.LoginSignMeTypeAsString.DefaultOff:
|
||||
this.signMeType(Enums.LoginSignMeType.DefaultOff);
|
||||
break;
|
||||
case Enums.LoginSignMeTypeAsString.DefaultOn:
|
||||
this.signMeType(Enums.LoginSignMeType.DefaultOn);
|
||||
break;
|
||||
default:
|
||||
case Enums.LoginSignMeTypeAsString.Unused:
|
||||
this.signMeType(Enums.LoginSignMeType.Unused);
|
||||
break;
|
||||
}
|
||||
|
||||
this.email(RL.data().devEmail);
|
||||
this.password(RL.data().devPassword);
|
||||
|
||||
if (this.googleLoginEnabled())
|
||||
{
|
||||
window['rl_' + sJsHash + '_google_login_service'] = fSocial;
|
||||
}
|
||||
|
||||
if (this.facebookLoginEnabled())
|
||||
{
|
||||
window['rl_' + sJsHash + '_facebook_login_service'] = fSocial;
|
||||
}
|
||||
|
||||
if (this.twitterLoginEnabled())
|
||||
{
|
||||
window['rl_' + sJsHash + '_twitter_login_service'] = fSocial;
|
||||
}
|
||||
|
||||
_.delay(function () {
|
||||
RL.data().language.subscribe(function (sValue) {
|
||||
self.langRequest(true);
|
||||
$.ajax({
|
||||
'url': LinkBuilder.langLink(sValue),
|
||||
'dataType': 'script',
|
||||
'cache': true
|
||||
}).done(function() {
|
||||
self.bSendLanguage = true;
|
||||
Utils.i18nReload();
|
||||
$.cookie('rllang', RL.data().language(), {'expires': 30});
|
||||
}).always(function() {
|
||||
self.langRequest(false);
|
||||
});
|
||||
});
|
||||
}, 50);
|
||||
|
||||
Utils.triggerAutocompleteInputChange(true);
|
||||
};
|
||||
|
||||
LoginViewModel.prototype.submitForm = function ()
|
||||
{
|
||||
this.submitCommand();
|
||||
};
|
||||
|
||||
LoginViewModel.prototype.selectLanguage = function ()
|
||||
{
|
||||
kn.showScreenPopup(PopupsLanguagesViewModel);
|
||||
};
|
||||
|
||||
module.exports = new LoginViewModel();
|
||||
|
||||
}(module));
|
||||
Loading…
Add table
Add a link
Reference in a new issue