PageSourceSearch

https://www.obeczbesicky.cz/wrs_frontend/js/wrsjs.js

js obeczbesicky.cz collected 2026-10-03 02:42:19 UTC 5,212 bytes, 191 lines download raw bytes

1/* minieshop methods */
2
3$(document).ready(function(){
4    $('.minieshop_table_item input[name*="item_"]').change(function(){
5        minieshop_calculate_summary();
6    });
7    //document.cookie = 'javascript=1;expires=Wed, 1 Jan 2020 12:00:00 UTC; path=/';
8});
9
10function display_minieshop_product(item_id){
11
12    $.post("/wrs_frontend/ajax_assets.php", { 'item_id': item_id, 'action': 'minieshop_item_detail' },
13    function(data) {
14        $('#minieshop_form_detail').html(data);
15        $('#minieshop_form_detail').show();
16        $('#minieshop_form_holder').hide();
17    });
18
19}
20
21function back_to_shop(){
22    $('#minieshop_form_detail').hide();
23    $('#minieshop_form_holder').show();
24}
25
26function minieshop_add_item(item_id){
27
28    var new_qty = $('#detail_item_'+item_id).val();
29    var current_qty = $('#item_'+item_id).val();
30
31    if(new_qty >= 0 && current_qty >= 0){
32        $('#item_'+item_id).val(parseInt(new_qty) + parseInt(current_qty));
33    }
34
35    minieshop_calculate_summary();
36
37    $('#minieshop_form_detail').hide();
38    $('#minieshop_form_holder').show();
39
40}
41
42function minieshop_calculate_summary(){
43    var item_name = new Array();
44    var total_price = 0;
45    $('.minieshop_table_item').each(function() {
46        $(':input', this).each(function() {
47            if($(this).val() > 0){
48                item_name = $(this).attr('name').split("item_");
49                total_price = total_price + (parseFloat(items_pricing[item_name[1]]) * parseInt($(this).val()));
50            }
51        });
52    });
53
54    $("#order_summary").html(CurrencyFormatted(total_price));
55}
56
57function minieshop_validate_form(form){
58
59    if(document.forms[form]['jmeno'].value == ''){
60        alert("Zadejte jméno.")
61        return false;
62    } else if(document.forms[form]['prijmeni'].value == '') {
63        alert("Zadejte příjmení.")
64        return false;
65    } else if(document.forms[form]['firma_telefon'].value == '') {
66        alert("Zadejte telefon.")
67        return false;
68    } else if(checkemail(document.forms[form]['firma_email'].value) === false) {
69        alert("Zadejte validní email.")
70        return false;
71    } else if(document.forms[form]['firma_ulice'].value == '') {
72        alert("Zadejte ulici.")
73        return false;
74    } else if(document.forms[form]['firma_mesto'].value == '') {
75        alert("Zadejte město.")
76        return false;
77    } else if(document.forms[form]['firma_psc'].value == '') {
78        alert("Zadejte PSČ.")
79        return false;
80    } else if(document.forms[form]['platba'].value == '0') {
81        alert("Vyberte způsob platby.")
82        return false;
83    } else {
84        var validItems = false;
85        //je vybrana alespon jedna polozka?
86        $('.minieshop_table_item').each(function() {
87        $(':input', this).each(function() {
88            if($(this).val() > 0){
89                validItems = true;
90            }
91        });
92
93    });
94    if(validItems){
95          minieshop_submit_form(form);
96               return true;
97    }else{
98    alert('Nevybráno množství žádného produktu');
99    return false;
100        }
101
102    }
103
104}
105
106function minieshop_submit_form(form){
107    var params = "";
108
109    $('#'+form).each(function() {
110        $(':input', this).each(function() {
111          params = params + "&" +$(this).attr("name")+"="+$(this).val();
112        });
113    });
114
115    /* hide and remove form */
116    $('#minieshop_form_holder').hide();
117    $('#minieshop_form_holder').html("");
118    $('#minieshop_form_confirm').show();
119
120    /* send form */
121    $.post("/wrs_frontend/minieshop_checkout.php", params, function(data){});
122
123}
124
125function set_deliver_form(form, obj){
126
127    if($("#"+obj).css('display') == "table"){
128        $("#"+obj).hide();
129
130        document.forms[form]['dodaci_jmeno'].value = "";
131        document.forms[form]['dodaci_prijmeni'].value = "";
132        document.forms[form]['dodaci_firma'].value = "";
133        document.forms[form]['dodaci_ulice'].value = "";
134        document.forms[form]['dodaci_mesto'].value = "";
135        document.forms[form]['dodaci_psc'].value = "";
136    } else {
137        $("#"+obj).show();
138    }
139
140
141}
142
143function checkemail(email){
144    var filter=/^([\w-]+(?:\.[\w-]+)*)@((?:[\w-]+\.)*\w[\w-]{0,66})\.([a-z]{2,6}(?:\.[a-z]{2})?)$/i
145    if (filter.test(email))
146        return true;
147    else{
148        return false;
149    }
150}
151
152function CurrencyFormatted(amount)
153{
154	var i = parseFloat(amount);
155	if(isNaN(i)) { i = 0.00; }
156	var minus = '';
157	if(i < 0) { minus = '-'; }
158	i = Math.abs(i);
159	i = parseInt((i + .005) * 100);
160	i = i / 100;
161	s = new String(i);
162	if(s.indexOf(',') < 0) { s += ',00'; }
163	if(s.indexOf(',') == (s.length - 2)) { s += '0'; }
164	s = minus + s;
165	return s;
166}
167
168/* minieshop methods end */
169
170/* kalendar methods */
171
172function availability_dates(date, id){
173
174    $.post("/wrs_frontend/ajax_assets.php", { 'date': date, 'id': id, 'action': 'kalendarobsazenost_events' },
175       function(data) {
176         $('#availability_times'+id).html(data);
177       });
178
179}
180
181function availability_udalosti_dates(date, id){
182
183    $.post("/wrs_frontend/ajax_assets.php", { 'date': date, 'id': id, 'action': 'kalendarudalost_events' },
184       function(data) {
185         $('#availability_udalosti_times'+id).html(data);
186       });
187
188}
189
190
191/* kalendar methods end */

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.