login.js 787 B

1234567891011121314151617181920212223242526272829303132333435
  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. $('#submit')
  15. .removeClass('icon-confirm')
  16. .addClass('icon-loading-small')
  17. .css('opacity', '1');
  18. return true;
  19. },
  20. rememberLogin: function(){
  21. if($(this).is(":checked")){
  22. if($("#user").val() && $("#password").val()) {
  23. $('#submit').trigger('click');
  24. }
  25. }
  26. }
  27. });
  28. $(document).ready(function() {
  29. $('form[name=login]').submit(OC.Login.onLogin);
  30. $('#remember_login').click(OC.Login.rememberLogin);
  31. });