PageSourceSearch

https://mayoraindah.org/assets/frontend/js/script.js

js mayoraindah.org collected 2026-10-08 02:42:38 UTC 10,631 bytes, 372 lines download raw bytes

1$(window).resize(function () {
2    var header = $('header').height();
3    $("body").css("padding-top", header);
4});
5
6
7var myLanguage = {
8    errorTitle: 'Form submission failed!',
9    requiredField: 'Field ini belum terisi',
10    requiredFields: 'You have not answered all required fields',
11    badTime: 'You have not given a correct time',
12    badEmail: 'Format email yang anda masukkan salah',
13    badTelephone: 'Format telepon yang ada masukkan salah',
14    badSecurityAnswer: 'You have not given a correct answer to the security question',
15    badDate: 'Format tanggal yang anda masukkan salah',
16    lengthBadStart: 'The input value must be between ',
17    lengthBadEnd: ' karakter',
18    lengthTooLongStart: 'The input value is longer than ',
19    lengthTooShortStart: 'Field minimal ',
20    notConfirmed: 'Konfirmasi yang anda masukkan salah',
21    badDomain: 'Incorrect domain value',
22    badUrl: 'The input value is not a correct URL',
23    badCustomVal: 'The input value is incorrect',
24    andSpaces: ' and spaces ',
25    badInt: 'Field harus diisi angka',
26    badSecurityNumber: 'Your social security number was incorrect',
27    badStrength: 'The password isn\'t strong enough',
28    badNumberOfSelectedOptionsStart: 'You have to choose at least ',
29    badNumberOfSelectedOptionsEnd: ' answers',
30    badAlphaNumeric: 'The input value can only contain alphanumeric characters ',
31    badAlphaNumericExtra: ' and ',
32    wrongFileSize: 'The file you are trying to upload is too large (max %s)',
33    wrongFileType: 'Only files of type %s is allowed',
34    groupCheckedRangeStart: 'Please choose between ',
35    groupCheckedTooFewStart: 'Please choose at least ',
36    groupCheckedTooManyStart: 'Please choose a maximum of ',
37    groupCheckedEnd: ' item(s)',
38    badCreditCard: 'The credit card number is not correct',
39    badCVV: 'The CVV number was not correct',
40    wrongFileDim : 'Incorrect image dimensions,',
41    imageTooTall : 'the image can not be taller than',
42    imageTooWide : 'the image can not be wider than',
43    imageTooSmall : 'the image was too small',
44    min : 'min',
45    max : 'max',
46    imageRatioNotAccepted : 'Image ratio is not be accepted',
47    badreCaptcha: 'Please confirm that you are not a bot',
48    passwordComplexityStart: 'Password must contain at least ',
49    passwordComplexitySeparator: ', ',
50    passwordComplexityUppercaseInfo: ' uppercase letter(s)',
51    passwordComplexityLowercaseInfo: ' lowercase letter(s)',
52    passwordComplexitySpecialCharsInfo: ' special character(s)',
53    passwordComplexityNumericCharsInfo: ' numeric character(s)',
54    passwordComplexityEnd: '.'
55};
56
57$(document).ready(function () {
58
59    // set padding
60    var header = $('header').height();
61    $("body").css("padding-top", header);
62
63    $('#main-menu').slicknav({
64        label: '',
65        prependTo: '#menu-wrap'
66    });
67
68    if ($('#main-banner').length) {
69        var homeSlider = $('#main-banner ul').lightSlider({
70            item: 1,
71            // loop: true,
72            speed: 800,
73            controls: false,
74            pager: false,
75            auto: true,
76            pause: 3000
77        });
78
79        $('#banner-nav #nav-prev').click(function () {
80            homeSlider.goToPrevSlide();
81        });
82        $('#banner-nav #nav-next').click(function () {
83            homeSlider.goToNextSlide();
84        });
85    }
86
87    if ($('#news-banner').length) {
88        var newsSlider = $('#news-banner ul').lightSlider({
89            item: 1,
90            // loop: true,
91            speed: 800,
92            controls: false,
93            pager: false,
94            auto: true,
95            pause: 3000,
96            adaptiveHeight: true,
97        });
98    }
99    if ($('.brand-slider').length) {
100        $('.brand-slider').slick({
101            dots: false,
102            infinite: false,
103            speed: 300,
104            slidesToShow: 5,
105            slidesToScroll: 1,
106            responsive: [
107                {
108                    breakpoint: 800,
109                    settings: {
110                        slidesToShow: 3,
111                    }
112                },
113                {
114                    breakpoint: 480,
115                    settings: {
116                        slidesToShow: 2,
117                    }
118                }
119            ]
120        });
121    }
122
123    if ($('.highlight-slider').length) {
124        $('.highlight-slider').slick({
125            dots: false,
126            infinite: false,
127            speed: 300,
128            slidesToShow: 3,
129            slidesToScroll: 1,
130            responsive: [
131                {
132                    breakpoint: 800,
133                    settings: {
134                        slidesToShow: 3,
135                    }
136                },
137                {
138                    breakpoint: 480,
139                    settings: {
140                        slidesToShow: 2,
141                    }
142                }
143            ]
144        });
145    }
146
147
148
149    if ($('.history-slider').length) {
150        $('.history-slider').slick({
151            dots: false,
152            infinite: false,
153            speed: 700,
154            slidesToShow: 1,
155            slidesToScroll: 1,
156        });
157    }
158
159
160
161
162    if ($('.iklan-slider').length) {
163        $('.iklan-slider').lightSlider({
164            item:3,
165            slideMove:1,
166            controls: false,
167            pager: false,
168            enableDrag: true,
169            onSliderLoad: function(el) {
170                el.lightGallery({
171                    selector: '.iklan-slider .lslide'
172                });
173            }
174        });
175    }
176
177    if ($('.matchHeight').length) {
178        $('.matchHeight').matchHeight();
179    }
180
181    if ($('.datepicker').length) {
182        $('.datepicker').datepicker({
183            format: 'dd/mm/yyyy'
184        });
185    }
186
187    if($('.customDatePicker').length){
188        $.each($('.customDatePicker'), function(index, item){
189            var maxDate = $(item).data('maxdate');
190            var minDate = $(item).data('mindate');
191
192            if(!maxDate) maxDate = '';
193            if(!minDate) minDate = '';
194
195            $(item).datepicker({
196                format: 'dd/mm/yyyy',
197                autoclose: true,
198                startDate: minDate,
199                endDate: maxDate,
200            });
201        });
202    }
203
204    $.validate({
205        form : '[data-validate="true"]',
206        modules: 'date, file, html5, security, logic',
207        language : myLanguage,
208        addValidClassOnAll: false,
209        errorElementClass: false,
210        disabledFormFilter : 'form.toggle-disabled',
211    });
212
213    $(".content-menu li .content-menu-collapse").click(function (e) {
214        e.preventDefault();
215        e.stopPropagation();
216
217        var parent = $(this).parent();
218        var target =  $(this).attr('href');
219
220        if (!$(parent).hasClass('active')) {
221            $(parent).find(target).slideDown();
222            $(parent).addClass('active');
223        } else{
224            $(parent).find(target).slideUp();
225            $(parent).removeClass('active');
226        }
227    });
228
229    // $(".content-menu li").hover(function () {
230    //     if (!$(this).hasClass('active')) {
231    //         $(this).find('ul').slideDown();
232    //     }
233    //
234    // },function (){
235    //     if (!$(this).hasClass('active')) {
236    //         $(this).find('ul').slideUp();
237    //     }
238    //
239    // });
240
241    $(".product-slider .item").hover(function () {
242        $(this).find('.content').slideDown();
243        $(this).addClass('active');
244    },function (){
245        $(this).find('.content').slideUp();
246        $(this).removeClass('active');
247    });
248
249    $(".product-slider-click .item").on('click', function(){
250       $(this).find('.content').slideToggle();
251       $(this).toggleClass('active');
252    });
253
254    getStockMarket();
255});
256
257
258
259function getUrlParameter(sParam) {
260    var sPageURL = decodeURIComponent(window.location.search.substring(1)),
261        sURLVariables = sPageURL.split('&'),
262        sParameterName,
263        i;
264
265    for (i = 0; i < sURLVariables.length; i++) {
266        sParameterName = sURLVariables[i].split('=');
267
268        if (sParameterName[0] === sParam) {
269            return sParameterName[1] === undefined ? true : sParameterName[1];
270        }
271    }
272}
273
274
275function formatCurrency(n, sep, decimals) {
276    sep = sep || "."; // Default to period as decimal separator
277    decimals = decimals || 2; // Default to 2 decimals
278
279    return n.toLocaleString().split(sep)[0]
280        + sep
281        + n.toFixed(decimals).split(sep)[1];
282}
283
284
285
286function getStockMarket() {
287
288
289    $.ajax({
290        url: 'https://www.alphavantage.co/query?function=TIME_SERIES_DAILY_ADJUSTED&symbol=MYOR.JK&outputsize=compact&apikey=2NE73EOX51R7N7DP',
291        type: 'GET',
292        dataType: 'JSON',
293        beforeSend: function() {
294
295        },
296        success: function(response){
297
298            var lastRefreshed = response['Meta Data']['3. Last Refreshed'];
299            var stockData = response['Time Series (Daily)'][lastRefreshed];
300            var stockOpen = parseFloat(stockData['1. open']);
301            var stockHigh = parseFloat(stockData['2. high']);
302            var stockLow = parseFloat(stockData['3. low']);
303            var stockAdjustedClose = parseFloat(stockData['5. adjusted close']);
304
305            populateStockSection(lastRefreshed, stockOpen, stockAdjustedClose);
306        },
307        error: function(error){
308
309        }
310    });
311
312
313}
314
315
316function populateStockSection(refreshedDate, stockOpen, stockAdjustedClose) {
317
318    $('#stock-date').html(refreshedDate);
319    $('#stock-price').html(formatCurrency(parseFloat(stockOpen)));
320
321    var stockDiff = parseFloat(parseFloat(stockAdjustedClose)-parseFloat(stockOpen));
322
323    var stockDiffInPercent = ((stockAdjustedClose-stockOpen)/stockAdjustedClose)*100;
324
325    $('#stock-diff').html(formatCurrency(stockDiff));
326    $('#percent-diff').html(stockDiffInPercent+'%');
327
328
329    if (stockAdjustedClose > stockOpen){
330        $('#home-saham #icon').addClass('down');
331    }else if (stockAdjustedClose == stockOpen){
332        $('#home-saham #icon').removeClass('down');
333        $('#home-saham #icon').removeClass('fa-arrow-up');
334        $('#home-saham #icon').addClass('fa-minus');
335    }else {
336        $('#home-saham #icon').removeClass('down');
337    }
338}
339
340
341
342function dateFormat(string) {
343
344    var d = new Date(string);
345
346    var day = d.getDate();
347
348    var month = d.getMonth();
349
350    var year = d.getFullYear();
351
352    return day+' '+getMonth(month)+' '+year;
353}
354
355function getMonth(idx) {
356    var month = [
357        'Januari',
358        'Februari',
359        'Maret',
360        'April',
361        'Mei',
362        'Juni',
363        'July',
364        'Agustus',
365        'September',
366        'Oktober',
367        'November',
368        'December',
369    ];
370
371    return month[idx];
372}

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.