1(function (angle, $) { 2 angle 3 .require('ui.bootstrap') 4 ; 5 6 angle.directive('newsletterButton', ['$http', '$uibModal', 'acton', 'SubmitHandler', 'vcRecaptchaService', 7 function ($http, $uibModal, acton, SubmitHandler, recaptcha) { 8 return { 9 restrict: 'E', 10 scope: { 11 actonUrl: '@' 12 }, 13 link: function ($scope, $element, attrs) { 14 15 $element.on('click', openNewsletterModal); 16 17 $scope.state = { 18 subscribe_newsletter: '1' 19 }; 20 21 // recaptcha code 22 $scope.verified = false; 23 24 $scope.setResponse = function (response) { 25 // send the `response` to your server for verification. 26 if(response) 27 $scope.verified = true; 28 }; 29 30 $scope.cbExpiration = function() { 31 // reset the 'response' object that is on scope 32 $scope.verified = false; 33 }; 34 35 $scope.sendNewsletter = function () { 36 if(!$scope.verified) return; 37 38 SubmitHandler.handle($scope.state, 'newsletter'); 39 40 window.setTimeout(function() { 41 42 $scope.state.contact_consent = null; 43 $scope.state.name = ''; 44 $scope.state.surname = ''; 45 $scope.state.email = ''; 46 $scope.verified = false; 47 48 }, 500); 49 50 }; 51 52 53 function openNewsletterModal() { 54 var modal = $uibModal.open({ 55 scope: $scope, 56 templateUrl: 'frotcom-newsletter-modal.tpl.html' 57 }); 58 } 59 } 60 } 61 } 62 ]); 63 64}(angle, jQuery));
Line numbers count LF bytes from the start of the resource, as the search results do. Vendor segments are library code the classifier recognised; they are stored but not indexed. Bytes are shown as Latin1 characters, one per byte.