renewPassword.js 932 B

1234567891011121314151617181920212223242526272829303132333435
  1. /**
  2. * SPDX-FileCopyrightText: 2017-2024 Nextcloud GmbH and Nextcloud contributors
  3. * SPDX-License-Identifier: AGPL-3.0-or-later
  4. */
  5. OCA = OCA || {};
  6. OCA.LDAP = _.extend(OC.LDAP || {}, {
  7. onRenewPassword: function () {
  8. $('#submit')
  9. .removeClass('icon-confirm-white')
  10. .addClass('icon-loading-small')
  11. .attr('value', t('core', 'Renewing …'));
  12. return true;
  13. },
  14. });
  15. window.addEventListener('DOMContentLoaded', function() {
  16. $('form[name=renewpassword]').submit(OCA.LDAP.onRenewPassword);
  17. if($('#newPassword').length) {
  18. $('#newPassword').showPassword().keyup();
  19. }
  20. $('#newPassword').strengthify({
  21. zxcvbn: OC.linkTo('core','vendor/zxcvbn/dist/zxcvbn.js'),
  22. titles: [
  23. t('core', 'Very weak password'),
  24. t('core', 'Weak password'),
  25. t('core', 'So-so password'),
  26. t('core', 'Good password'),
  27. t('core', 'Strong password')
  28. ],
  29. drawTitles: true,
  30. $addAfter: $('input[name="newPassword-clone"]'),
  31. });
  32. });