PageSourceSearch

https://shop.zongoraszalon.hu/!common_packages/jquery/own/shop_common/exploded/page_reg.js?mod_time=1787049581

js zongoraszalon.hu collected 2026-10-08 03:18:31 UTC 13,728 bytes, 305 lines download raw bytes

1function shipping_same_action() {
2    $(document).ready(function(){
3        if ($("#shipping_same").prop("checked")==true) {
4            $("#newcust_other_mod").stop().slideUp();
5            $("#other_nev").val("");
6            $("#other_varos").val("");
7            $("#other_irany").val("");
8            $("#other_utca").val("");
9            $("#other_megye").val("");
10            $("#other_ado").val("");
11        } else {
12            $("#newcust_other_mod").stop().slideDown();
13            if ($("#div_out_other_address .addresses").length > 0) {
14                $("#div_out_other_address .addresses").trigger("change");
15            }
16        }
17    });
18}
19$(document).ready(function(){
20    $(".check_email").blur(function(){
21        var thisInput = $(this);
22
23        if (config_plus['already_registered_email'] == 1) {
24            $('.check_passwd').addClass('is-paused');
25        }
26
27        $("#div_out_email .page_design_fault_out").addClass("page_design_progress");
28        thisInput.addClass('in-progress');
29        $.ajax({
30            type: "GET",
31            async: true,
32            url: shop_url_main+"/shop_reg.php",
33            data: {
34                action:"check_email",
35                lang_master:actual_lang,
36                emai:$("#emai").val(),
37                emai_check:$("#emai_fault_check").val()
38            },
39            success: function(result){
40                result = JSON.parse(result);
41
42                $("#div_out_email .page_design_fault_out").removeClass("page_design_progress");
43                thisInput.removeClass('in-progress');
44                if (result['status'] != 'ok') {
45                    if (result['sub_type'] == 'already_registered_email') {
46                        setTimeout(function () {
47                            $(document).trigger('alreadyRegisteredEmail', {
48                                email: result['email'],
49                                input: thisInput,
50                                message: result['message']
51                            });
52                        }, 200);
53                    }
54                    if (config_plus['already_registered_email'] != 1 || result['sub_type'] != 'already_registered_email') {
55                        $("#div_out_email .page_design_fault_out").removeClass("page_design_ok");
56                        $("#div_out_email .page_design_fault_out").addClass("page_design_fault");
57                        $("#div_out_email .page_design_fault_text strong").html(result['message']);
58                        thisInput.addClass('is-invalid');
59                        thisInput.siblings('.invalid-feedback').html(result['message']);
60                        $('.check_passwd').removeClass('is-paused');
61                        if (result['status'] == "warning") {
62                            $("#div_out_email .page_design_fault_out").addClass("only-warning");
63                            thisInput.addClass('only-warning');
64                        } else {
65                            $("#div_out_email .page_design_fault_out").removeClass("only-warning");
66                            thisInput.removeClass('only-warning');
67                        }
68                    }
69                } else {
70                    $("#div_out_email .page_design_fault_out").addClass("page_design_ok");
71                    $("#div_out_email .page_design_fault_out").removeClass("page_design_fault only-warning");
72                    $("#div_out_email .page_design_fault_text strong").html("");
73                    thisInput.removeClass('is-invalid only-warning');
74                    thisInput.siblings('.invalid-feedback').html("");
75                }
76            }
77        });
78    });
79
80    $(".check_username").blur(function(){
81        var thisInput = $(this);
82
83        $("#div_out_username .page_design_fault_out").addClass("page_design_progress");
84        thisInput.addClass('in-progress');
85        $.ajax({
86            type: "GET",
87            async: true,
88            url: shop_url_main+"/shop_reg.php",
89            data: {
90                action:"check_username",
91                lang_master:actual_lang,
92                cust_username:$("#cust_username").val()
93            },
94            success: function(result){
95                $("#div_out_username .page_design_fault_out").removeClass("page_design_progress");
96                thisInput.removeClass('in-progress');
97                if (result!="") {
98                    $("#div_out_username .page_design_fault_out").removeClass("page_design_ok");
99                    $("#div_out_username .page_design_fault_out").addClass("page_design_fault");
100                    $("#div_out_username .page_design_fault_text strong").html(result);
101                    thisInput.addClass('is-invalid');
102                    thisInput.siblings('.invalid-feedback').html(result);
103                } else {
104                    $("#div_out_username .page_design_fault_out").addClass("page_design_ok");
105                    $("#div_out_username .page_design_fault_out").removeClass("page_design_fault");
106                    $("#div_out_username .page_design_fault_text strong").html("");
107                    thisInput.removeClass('is-invalid');
108                    thisInput.siblings('.invalid-feedback').html("");
109                }
110            }
111        });
112    });
113    
114    $(".check_city_county:not([readonly])").blur(function(){
115        var thisInput = $(this);
116        var temp_value = thisInput.val();
117        var temp_type = thisInput.attr("id").replace("_varos","").replace("_megye","");
118        var temp_data = thisInput.attr("id").replace(temp_type+"_","");
119        if (temp_data=="irany") temp_data="zip";
120        if (temp_data=="megye") temp_data="county";
121        if (temp_data=="varos") temp_data="city";
122
123        $.ajax({
124            type: "GET",
125            async: true,
126            url: shop_url_main+"/shop_reg.php",
127            dataType: 'json',
128            data: {
129                action:"check_"+temp_data,
130                value:temp_value,
131                zip:$("#"+temp_type+"_irany").val(),
132                country:$("#"+temp_type+"_orszag").val()
133            },
134            success: function(result) {
135                if (result.status=="no_data") {
136                    $("#div_out_"+temp_type+"_"+temp_data+" .page_design_fault_out").removeClass("page_design_fault");
137                    $("#div_out_"+temp_type+"_"+temp_data+" .page_design_fault_text strong").html("");
138                } else if (result.status=="not_found") {
139                    $("#div_out_"+temp_type+"_"+temp_data+" .page_design_fault_out").addClass("page_design_fault");
140                    $("#div_out_"+temp_type+"_"+temp_data+" .page_design_fault_text strong").html(lang_text["data_not_found"]);
141                } else if (result.status=="zip_error") {
142                    $("#div_out_"+temp_type+"_"+temp_data+" .page_design_fault_out").addClass("page_design_fault");
143                    $("#div_out_"+temp_type+"_"+temp_data+" .page_design_fault_text strong").html(lang_text["data_zip_error"]);
144                } else if (result.status=="ok") {
145                    $("#div_out_"+temp_type+"_"+temp_data+" .page_design_fault_out").removeClass("page_design_fault");
146                    $("#div_out_"+temp_type+"_"+temp_data+" .page_design_fault_text strong").html("");
147                }
148            }
149        });
150    });
151
152    $(".js-form-validation").on("focus",".form-control, .custom-control-input", function(){
153        var thisItem = $(this);
154        thisItem.removeClass('is-invalid');
155        /* radio group */
156        if ((thisItem).is(':radio')) {
157            let sibling_radios = thisItem.closest('.custom-radio').siblings('.custom-radio');
158            let parent_group = thisItem.closest('.custom-radio-group');
159            parent_group.removeClass('has-invalid-input');
160            sibling_radios.find('.custom-control-input').removeClass('is-invalid');
161        }
162        if ((thisItem).is(':checkbox')) {
163            let sibling_checkboxes = thisItem.closest('.custom-checkbox').siblings('.custom-checkbox');
164            sibling_checkboxes.find('.custom-control-input').removeClass('is-invalid');
165        }
166    });
167
168    $("#default_orszag").change(function(){
169        $("#div_out_default_county .page_design_name strong").html($("#default_orszag option:selected").attr("rel"));
170    });
171    $("#other_orszag").change(function(){
172        $("#div_out_other_county .page_design_name strong").html($("#other_orszag option:selected").attr("rel"));
173    });
174});
175
176function show_vat_element() {
177    $("#div_out_other_vat, #div_out_other_eu_vat, #div_out_default_vat, #div_out_default_eu_vat").show();
178
179    if ($("#shipping_same").prop("checked") && $("#div_out_other_vat").length > 0) {
180        $("#shipping_same").prop("checked", false);
181        shipping_same_action();
182    }
183
184    if (UNAS.customer.email != "" && UNAS.customer.without_registration == 0) {
185        UNAS.getCustomer(function (data) {
186            if (data['addresses'] !== undefined) {
187                const tax_number = data['addresses']['invoice']['tax_number'];
188                if (tax_number !== "" && !$.isArray(tax_number) && !address_changed) {
189                    $("input[name='szam_ado']").val(tax_number);
190                }
191            }
192        });
193    }
194    $(document).trigger('vat:toggle', [true]);
195}
196function clear_vat_input($container) {
197    $container.hide();
198    $container.find("input[name='szam_ado'], input[name='szam_ado_eu']").val("").removeClass('placeholder-hide');
199}
200
201function hide_vat_element() {
202    clear_vat_input($("#div_out_other_vat, #div_out_other_eu_vat, #div_out_default_vat, #div_out_default_eu_vat"));
203    $(document).trigger('vat:toggle', [false]);
204}
205
206function handle_vat_on_click(temp_val) {
207    temp_val = parseInt(temp_val);
208
209    if (UNAS.shop["only_private_customer_can_purchase"] && temp_val !== 0) {
210        hide_vat_element();
211        overlay_load("warning", UNAS.text.private_customer_warning);
212        $("#is-person").trigger("click");
213        return;
214    }
215
216    if (UNAS.shop["only_company_can_purchase"] && temp_val !== 1) {
217        show_vat_element();
218        overlay_load("warning", UNAS.text.company_customer_warning);
219        $("#is-company").trigger("click");
220        return;
221    }
222
223    let billing_id = $('input[name="szam_nev"]').attr('id');
224    if ($('label[for="'+billing_id+'"]').length) {
225        $('label[for="'+billing_id+'"]').text((temp_val === 1 ? UNAS.text.reg_title_company_name : UNAS.text.reg_title_name));
226    }
227    if ($('input[name="szam_nev"]').attr('placeholder') !== '') {
228        $('input[name="szam_nev"]').attr('placeholder',(temp_val === 1 ? UNAS.text.reg_title_company_name : UNAS.text.reg_title_name)) ;
229    }
230
231    //Ha magánszeméyl vagy egyéb, adószámmal nem rendelkező vásárló
232    if (temp_val===0 || temp_val===2) {
233        //Elrejtjük az adószám mezőket
234        hide_vat_element();
235    } else {
236        //Cég esetén megjelenítjük
237        show_vat_element();
238    }
239}
240
241$(document).ready(function () {
242    if ($("input[name='choose_company']").length>1) {
243        //Ha cég
244        if ($("input[name='choose_company']:checked").val()==1) {
245            //Megjelenítjük az adószám beviteli mezőket
246            show_vat_element();
247        } else {
248            //Nem cég
249            //Elrejtjük az adószám beviteli mezőket
250            hide_vat_element();
251        }
252    }
253
254    /* csak ver3 alatt kell az event listener, felette onclick van a rádión */
255    if (unas_design_ver < 3) {
256        $(document).on('click', "input[name='choose_company']", function () {
257            //Megnézzük kattintásra, cég / nem cég a felhasználó
258            handle_vat_on_click($(this).val());
259        });
260    }
261
262    //Csak magánszemély vásárolhat (ONLY-PRIVATE-CAN-BUY)
263    if (UNAS.shop["only_private_customer_can_purchase"]) {
264        $("#customer_type_1, #customer_type_2").on("click", function (event) {
265            event.preventDefault();
266
267            if ($(event.target).attr("id") === "customer_type_1") {
268                $(".tax-number").val("").hide();
269            }
270
271            overlay_load("warning", UNAS.text.private_customer_warning);
272            return false;
273        });
274
275        //Adatmódosítás / regisztráció gomb nyomásra felugró ablakod dobunk fel, ha céget jelölt ki a vásárló
276        $("#button_mod, #button_reg").on("click", function (event) {
277            if ($("#is-company").prop("checked") || $("#is-other-person-with-tax-number").prop("checked") || $("#customer_type_1").prop("checked") || $("#customer_type_2").prop("checked")) {
278                event.preventDefault();
279                overlay_load("warning", UNAS.text.private_customer_warning);
280                return false;
281            }
282        });
283    }
284
285    //Csak cég vásárolhat (ONLY-COMPANY-CAN-BUY)
286    if (UNAS.shop["only_company_can_purchase"]) {
287        $("#customer_type_0, #customer_type_2").on("click", function (event) {
288            event.preventDefault();
289
290            $(".tax-number").show();
291
292            overlay_load("warning", UNAS.text.company_customer_warning);
293            return false;
294        });
295
296        //Adatmódosítás / regisztráció gomb nyomásra felugró ablakod dobunk fel, ha magánszemélyt vagy adószűm nélküli egyéb személyt jelölt ki a vásárló
297        $("#button_mod, #button_reg").on("click", function (event) {
298            if ($("#is-person").prop("checked") || $("#is-other-person-with-tax-number").prop("checked") || $("#customer_type_0").prop("checked") || $("#customer_type_2").prop("checked")) {
299                event.preventDefault();
300                overlay_load("warning", UNAS.text.company_customer_warning);
301                return false;
302            }
303        });
304    }
305});

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.