Browse Source

Account Module - prettier settings added and js files reformatted

pull/4706/head
Ahmet Çotur 6 years ago
parent
commit
f2032ff7a4
  1. 4
      modules/account/.prettierrc
  2. 10
      modules/account/src/Volo.Abp.Account.Web/Pages/Account/LoggedOut.js
  3. 73
      modules/account/src/Volo.Abp.Account.Web/Pages/Account/Manage.js

4
modules/account/.prettierrc

@ -0,0 +1,4 @@
{
"singleQuote": true,
"useTabs": true
}

10
modules/account/src/Volo.Abp.Account.Web/Pages/Account/LoggedOut.js

@ -1,5 +1,7 @@
document.addEventListener("DOMContentLoaded", function (event) { document.addEventListener('DOMContentLoaded', function (event) {
setTimeout(function () { setTimeout(function () {
window.location = document.getElementById("redirectButton").getAttribute("href"); window.location = document
}, 3000) .getElementById('redirectButton')
.getAttribute('href');
}, 3000);
}); });

73
modules/account/src/Volo.Abp.Account.Web/Pages/Account/Manage.js

@ -1,50 +1,47 @@
(function ($) { (function ($) {
var l = abp.localization.getResource('AbpAccount');
var l = abp.localization.getResource('AbpAccount'); var _profileService = volo.abp.identity.profile;
var _profileService = volo.abp.identity.profile; $('#ChangePasswordForm').submit(function (e) {
e.preventDefault();
$("#ChangePasswordForm").submit(function (e) { if (!$('#ChangePasswordForm').valid()) {
e.preventDefault(); return false;
}
if (!$("#ChangePasswordForm").valid()) { var input = $('#ChangePasswordForm').serializeFormToObject()
return false; .changePasswordInfoModel;
}
var input = $("#ChangePasswordForm").serializeFormToObject().changePasswordInfoModel; if (
input.newPassword != input.newPasswordConfirm ||
input.currentPassword == ''
) {
abp.message.error(l('NewPasswordConfirmFailed'));
return;
}
if (input.newPassword != input.newPasswordConfirm || input.currentPassword == '') { if (input.currentPassword == '') {
abp.message.error(l("NewPasswordConfirmFailed")); return;
return; }
}
if (input.currentPassword == '') { _profileService.changePassword(input).then(function (result) {
return; abp.message.success(l('PasswordChanged'));
} });
});
_profileService.changePassword( $('#PersonalSettingsForm').submit(function (e) {
input e.preventDefault();
).then(function (result) {
abp.message.success(l("PasswordChanged"));
});
}); if (!$('#PersonalSettingsForm').valid()) {
return false;
}
$("#PersonalSettingsForm").submit(function (e) { var input = $('#PersonalSettingsForm').serializeFormToObject()
e.preventDefault(); .personalSettingsInfoModel;
if (!$("#PersonalSettingsForm").valid()) { _profileService.update(input).then(function (result) {
return false; abp.notify.success(l('PersonalSettingsSaved'));
} });
});
var input = $("#PersonalSettingsForm").serializeFormToObject().personalSettingsInfoModel; })(jQuery);
_profileService.update(
input
).then(function (result) {
abp.notify.success(l("PersonalSettingsSaved"));
});
});
})(jQuery);

Loading…
Cancel
Save