/** * */ (function() { 'use strict'; var signInApp = angular.module('signInApp', ['diceTechPro']); signInApp.controller('signInController', ['$scope', '$http', '$q', 'cookieFactory', function($scope, $http, $q, cookieFactory) { $scope.clearLoginError = clearLoginError; $scope.user = { email: undefined, password: undefined, doesWantToStaySignedIn: false }; $scope.passwordRegex = /^.*(?:\d.*[A-Za-z]|[A-Za-z].*\d).*$/; $scope.emailRegex = /^(?=.{1,100}$)[_A-Za-z0-9-\+]+(\.[_A-Za-z0-9-\+]+)*@[A-Za-z0-9-]+(\.[A-Za-z0-9-]+)*(\.[A-Za-z]{2,})$/; $scope.loginErrorMessage = true; $scope.newUser = { email: undefined, firstName: undefined, lastName: undefined, trustedType: 'google' }; $scope.loading = false; $scope.loadingStart = function() { $scope.loading = true; }; $scope.signIn = function($event) { $scope.signInForm.isSubmitAttempted = true; //$scope.loginErrorMessage = false; cookieFactory.setCookie('SEEKER_LOGIN', true, 365 * 24 * 60 * 60 * 1000, '/'); if ($scope.signInForm.$invalid) { $scope.loading = false; $event.preventDefault(); return false; } }; function clearLoginError() { var elem = angular.element('[data-automation-id=login-failure-help-message]'); if (elem) { if (elem.find('strong').length != 0) { $scope.loginErrorMessage = false; angular.element('.has-feedback').removeClass('has-error'); angular.element('.glyphicon').removeClass('icon-filled-delete-2'); elem.html(''); $scope.signInForm.isSubmitAttempted = false; } } } }]); }()); $(document).ready(function() { const url = document.URL; const newUrl = url.replace("?&", "&"); const utmUrl = url.replace("?utm", "&utm"); const tagUrl = url.replace("?tag", "&tag") if (url.indexOf("?&") > -1) { window.location = newUrl; } else if (url.indexOf("?utm") > -1) { window.location = utmUrl; } else if (url.indexOf("?tag") > -1) { window.location = tagUrl; } });