PageSourceSearch

https://gradana.co.id/assets/js/controllers/frontend/hubungi-kami-frontend.js

js gradana.co.id collected 2026-10-07 21:53:06 UTC 4,815 bytes, 87 lines download raw bytes

1'use strict';
2
3/* Controllers */
4
5angular
6    .module('app')
7    .controller('HubungiKamiFrontendCtrl',
8        ['$scope', '$rootScope', 'ServerService', 'SettingsService', '$state', 'SweetAlert', 'vcRecaptchaService', '$location', '$http',
9            function ($scope, $rootScope, ServerService, SettingsService, $state, SweetAlert, vcRecaptchaService, $location, $http) {
10                $scope.emailData = {};
11                $scope.loading = false;
12                // $scope.recaptchaId;
13                // $scope.captchaKey = '6LceXUUUAAAAACMRZRDdf3DraHpNHIBMo199y0ZS'
14                // var currentUrl = $location.absUrl();
15                // var folder = "";
16
17                // if (currentUrl.includes('dev.gradana') === true || currentUrl.includes('137.59.126.204')) {
18                //     $scope.captchaKey = '6LceXUUUAAAAACMRZRDdf3DraHpNHIBMo199y0ZS'
19                // } else if (currentUrl.includes('gradana.co.id') == true || currentUrl.includes('gradana.com') == true || currentUrl.includes('116.206.196.96')) {
20                //     $scope.captchaKey = '6LcNYUUUAAAAAIaJ6PnIVFNLvgrxBz27nqdCW_DV'
21                // } else {
22                //     $scope.captchaKey = '6LceXUUUAAAAACMRZRDdf3DraHpNHIBMo199y0ZS'
23                // }
24
25                $scope.sendEmail = function () {
26                    if ($scope.emailData.name && $scope.emailData.email && $scope.emailData.message && $scope.emailData.phoneNumber) {
27                        // if ($scope.recaptchaId == null || $scope.recaptchaId == undefined) {
28                        //     SweetAlert.swal('Gagal', 'Captcha id kadaluarsa, harap refresh halaman untuk mengirim ulang pesan', 'error');
29                        //     return;
30                        // }
31                        // var captchaResponse = vcRecaptchaService.getResponse($scope.recaptchaId)
32
33                        // if (captchaResponse === "") { //if string is empty
34                        //     SweetAlert.swal('Gagal', 'Harap untuk menekan tombol captcha sebelum mengirim pesan', 'error');
35                        // } else {
36                        var emailContent = {
37                            'subjectEmail': 'Inquiry Form Gradana',
38                            'destinationEmail': '[email protected]',
39                            'message': 'Nama: ' + $scope.emailData.name + '\n' +
40                                'Email: ' + $scope.emailData.email + '\n' +
41                                'No. Telp: ' + $scope.emailData.phoneNumber + '\n' +
42                                'Pesan: ' + $scope.emailData.message
43                        }
44                        $scope.loading = true;
45                        // captchaResponse
46                        ServerService.SendEmail(emailContent, function (response) {
47                            if (response.status === 'Success') {
48                                SweetAlert.swal($scope.textContent['swal']['success']['title'], $scope.textContent['swal']['success']['text'], 'success');
49                                $scope.loading = false;
50                            } else {
51                                if (response.message) {
52                                    SweetAlert.swal($scope.textContent['swal']['error']['title'], response.message, 'error');
53                                    $scope.loading = false;
54                                } else {
55                                    SweetAlert.swal($scope.textContent['swal']['error']['title'], $scope.textContent['swal']['error']['text'], 'error');
56                                    $scope.loading = false;
57                                }
58                            }
59                        })
60                        // }
61                    }
62                }
63
64                $scope.setRecaptchaId = function (widgetId) {
65                    $scope.recaptchaId = widgetId;
66                };
67
68                function loadLanguageContent(language) {
69                    $http.get(`assets/i18n/cs-service/${language}.json`).then(function (response) {
70                        $scope.textContent = response.data;
71                    }, function (error) {
72                        console.error("Error loading language file:", error);
73                    });
74                }
75            
76                $scope.currentLanguage = localStorage.getItem("language") || "id";
77            
78                $scope.$watch(function () {
79                    return localStorage.getItem("language");
80                }, function (newValue) {
81                    if (newValue) {
82                        $scope.currentLanguage = newValue;
83                        loadLanguageContent(newValue);
84                        console.log("Current Language changed to:", $scope.currentLanguage);
85                    }
86                });
87            }]);

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.