login.js 1001 B

1234567891011121314151617181920212223242526272829303132333435363738394041
  1. /**
  2. * Copyright (c) 2015
  3. * Vincent Petry <pvince81@owncloud.com>
  4. * Jan-Christoph Borchardt, http://jancborchardt.net
  5. * This file is licensed under the Affero General Public License version 3 or later.
  6. * See the COPYING-README file.
  7. */
  8. /**
  9. * @namespace
  10. * @memberOf OC
  11. */
  12. OC.Login = _.extend(OC.Login || {}, {
  13. onLogin: function () {
  14. // Only if password reset form is not active
  15. if($('form[name=login][action]').length === 0) {
  16. $('#submit-wrapper .submit-icon')
  17. .removeClass('icon-confirm-white')
  18. .addClass('icon-loading-small-dark');
  19. $('#submit')
  20. .attr('value', t('core', 'Logging in …'));
  21. $('.login-additional').fadeOut();
  22. return true;
  23. }
  24. return false;
  25. },
  26. rememberLogin: function(){
  27. if($(this).is(":checked")){
  28. if($("#user").val() && $("#password").val()) {
  29. $('#submit').trigger('click');
  30. }
  31. }
  32. }
  33. });
  34. $(document).ready(function() {
  35. $('form[name=login]').submit(OC.Login.onLogin);
  36. $('#remember_login').click(OC.Login.rememberLogin);
  37. });