1"use strict"; 2 3(function (app) { 4 app.directive("enquireForm", config); 5 6 function config() { 7 return { 8 restrict: "E", 9 templateUrl: "/App/tax-calculator/views/directive/enquire-form.html?v=1.1", 10 scope: { 11 input: "=", 12 result: "=", 13 reset: "&" 14 }, 15 controller: function controller($scope, $http) { 16 $scope.formatNumber = formatNumber; 17 $scope.displayFrequency = displayFrequency; 18 $scope.submittCorrect = false; 19 $scope.enquiry = { 20 comment: "Please contact me about FIFO" 21 }; 22 23 $scope.event = { 24 sendCalculation: sendCalculation, 25 openPrivateStatement: openPrivateStatement, 26 closeLightBox: closeLightBox, 27 agreeLightBox: agreeLightBox 28 }; 29 30 function openPrivateStatement(id) { 31 document.getElementById(id).style.display = 'block'; 32 console.log('open'); 33 } 34 35 function closeLightBox(id) { 36 document.getElementById(id).style.display = 'none'; 37 console.log('close'); 38 } 39 40 function agreeLightBox(id) { 41 document.getElementById(id).style.display = 'none'; 42 $scope["var"].inputModel.hasReadPolicy = true; 43 /*document.getElementById('<%= Declaration.ClientID %>').checked = true;*/ 44 console.log('agree'); 45 } 46 47 function formatNumber(value, format) { 48 return numeral(value).format(format); 49 } 50 51 function displayFrequency() { 52 var frequency = ""; 53 54 switch ($scope.input.payFrequency) { 55 case "Weekly": 56 frequency = "week"; 57 break; 58 case "Fortnightly": 59 frequency = "fortnight"; 60 break; 61 case "Monthly": 62 frequency = "month"; 63 break; 64 default: 65 frequency = ""; 66 break; 67 } 68 69 return frequency; 70 } 71 72 function sendCalculation() { 73 var viewModel = { 74 customerInput: $scope.input, 75 calculationResult: $scope.result, 76 enquiry: $scope.enquiry 77 }; 78 $scope.isLoading = true; 79 80 $http.post("/Api/Calculator/SendCalculation2", $scope.model).then(function (response) { 81 $scope.isLoading = false; 82 83 $scope.reset(); 84 $scope.input.annualFlight = 0; 85 $scope.input.annualGross = 0; 86 $scope.input.payFrequency = ""; 87 88 $scope.$apply(); 89 $scope.submittCorrect = true; 90 }, function (response) { 91 $scope.isLoading = false; 92 93 console.log(response); 94 95 safebox.alert({ 96 header: "Submit Failed", 97 body: response.data, 98 callback: function callback() { 99 $scope.reset(); 100 101 $scope.$apply(); 102 } 103 }); 104 }); 105 } 106 } 107 }; 108 } 109})(angular.module("calculator")); 110
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.