Guest User

Untitled

a guest
Jun 21st, 2018
91
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.32 KB | None | 0 0
  1. 'use strict';
  2.  
  3. function setURLS() {
  4. var queryString = '';
  5. if (config.clientID) {
  6. queryString += 'clientId=' + config.clientID;
  7. }
  8. if (config.extraParams.custom_state) {
  9. queryString += '&state=' + config.extraParams.custom_state;
  10. }
  11.  
  12. var _href = $('#resetPassword').attr('href');
  13. $('#resetPassword').attr('href', _href + '?' + queryString);
  14.  
  15. _href = $('#registerAccount').attr('href');
  16. $('#registerAccount').attr('href', _href + '?' + queryString);
  17. }
  18.  
  19. function setYear() {
  20. $('#endYear').text(new Date().getFullYear());
  21. }
  22.  
  23. // Hides any element with the class "hide-on-mobile" when the screen is < "mobileWidth" wide.
  24. function hideOnMobile(mobileWidth) {
  25. if ($(this).width() < mobileWidth) {
  26. $('.hide-on-mobile').hide();
  27. } else {
  28. $('.hide-on-mobile').show();
  29. }
  30. }
  31.  
  32. function getStoredUser() {
  33. try {
  34. var user = localStorage.getItem('user');
  35. if (user) {
  36. $('#email').val(user);
  37. $('#password').focus();
  38. $('#rememberCheckbox')[0].checked = true;
  39. }
  40. } catch (ex) {
  41. console.log('localStorage.getItem error', ex.code, ex.message);
  42. }
  43. }
  44.  
  45. $(document).ready(function () {
  46. var mobileWidth = 640;
  47. setYear();
  48. setURLS();
  49. getStoredUser();
  50. // Bind the handler to the window resize event, then call it once to start things off
  51. $(window).on('resize', hideOnMobile);
  52. hideOnMobile();
  53. });
Add Comment
Please, Sign In to add comment