From bfb19668eb1f895933bde0d5db0dca121ee9c203 Mon Sep 17 00:00:00 2001 From: Quincy Larson Date: Wed, 19 Aug 2015 17:48:24 -0700 Subject: [PATCH] remove remaining angular directives --- public/js/main_0.0.3.js | 137 ---------------------------------------- 1 file changed, 137 deletions(-) diff --git a/public/js/main_0.0.3.js b/public/js/main_0.0.3.js index afd74925ab..3b4b37cee2 100644 --- a/public/js/main_0.0.3.js +++ b/public/js/main_0.0.3.js @@ -265,8 +265,6 @@ $(document).ready(function() { }); }; - - $(window).resize(function(){ reBindModals(); }); @@ -389,138 +387,3 @@ $(document).ready(function() { function defCheck(a){ if(a !== 'undefined'){return(true);}else{return(false);} } - -var profileValidation = angular.module('profileValidation', - ['ui.bootstrap']); -profileValidation.controller('profileValidationController', ['$scope', '$http', - function($scope, $http) { - $http.get('/account/api').success(function(data) { - $scope.user = data.user; - $scope.user.username = $scope.user.username ? $scope.user.username.toLowerCase() : undefined; - $scope.storedUsername = data.user.username; - $scope.storedEmail = data.user.email; - $scope.user.email = $scope.user.email ? $scope.user.email.toLowerCase() : undefined; - $scope.user.twitterHandle = $scope.user.twitterHandle ? $scope.user.twitterHandle.toLowerCase() : undefined; - $scope.asyncComplete = true; - }); - } -]); - -profileValidation.controller('pairedWithController', ['$scope', - function($scope) { - $scope.existingUser = null; - } -]); - -profileValidation.controller('emailSignUpController', ['$scope', - function($scope) { - - } -]); - -profileValidation.controller('emailSignInController', ['$scope', - function($scope) { - - } -]); - -profileValidation.controller('URLSubmitController', ['$scope', - function($scope) { - - } -]); - -profileValidation.controller('nonprofitFormController', ['$scope', - function($scope) { - - } -]); - -profileValidation.controller('doneWithFirst100HoursFormController', ['$scope', - function($scope) { - - } -]); - -profileValidation.controller('submitStoryController', ['$scope', - function($scope) { - - } -]); - -profileValidation.directive('uniqueUsername', ['$http', function($http) { - return { - restrict: 'A', - require: 'ngModel', - link: function (scope, element, attrs, ngModel) { - element.bind("keyup", function (event) { - ngModel.$setValidity('unique', true); - var username = element.val(); - if (username) { - var config = { params: { username: username } }; - $http - .get('/api/users/exists', config) - .success(function (result) { - if (username === scope.storedUsername) { - ngModel.$setValidity('unique', true); - } else if (result.exists) { - ngModel.$setValidity('unique', false); - } - }); - } - }); - } - }; -}]); - -profileValidation.directive('existingUsername', - ['$http', function($http) { - return { - restrict: 'A', - require: 'ngModel', - link: function (scope, element, attrs, ngModel) { - element.bind('keyup', function (event) { - if (element.val().length > 0) { - ngModel.$setValidity('exists', false); - } else { - element.removeClass('ng-dirty'); - ngModel.$setPristine(); - } - var username = element.val(); - if (username) { - var config = { params: { username: username } }; - $http - .get('/api/users/exists', config) - .success(function(result) { - ngModel.$setValidity('exists', result.exists); - }); - } - }); - } - }; - }]); - -profileValidation.directive('uniqueEmail', ['$http', function($http) { - return { - restrict: 'A', - require: 'ngModel', - link: function getUnique (scope, element, attrs, ngModel) { - element.bind("keyup", function (event) { - ngModel.$setValidity('unique', true); - var email = element.val(); - if (email) { - var config = { params: { email: email } }; - $http - .get('/api/users/exists', config) - .success(function(result) { - if (email === scope.storedEmail) { - ngModel.$setValidity('unique', true); - } else if (result.exists) { - ngModel.$setValidity('unique', false); - } - }); - }; - }); - } - } -}]);