PageSourceSearch

https://www.dancecontextwebzine.com/scripts/TAorder.js

js dancecontextwebzine.com collected 2026-10-02 20:26:27 UTC 3,354 bytes, 120 lines download raw bytes

1
2	$(function() {
3
4		/* -- tlacitka na predplatne -- */	
5
6		function selectSbs(event) {
7			var target = $(event.target);
8			if(target.is(':radio')) return;
9			var sbsId = target.closest(".sbs").data("sbsId");
10			$("#IDSubscriptionType"+sbsId).click();
11			scrollToAnchor("#souhrn");
12		}
13
14		function showSbsSelection() {
15			var inputs = $("input[name=IDSubscriptionType]").length ? $("input[name=IDSubscriptionType]") : $("input[name=IDArticle]");
16			inputs.each(function(i, el) {
17				if($(el).is(":checked")) {
18					let btn = $(el).closest(".sbs").find(".btn");
19					btn.toggleClass("btn2", false);
20					btn.html(btn.data("vybrano") || "Vybráno");
21				}
22				else {
23					let btn = $(el).closest(".sbs").find(".btn");
24					btn.toggleClass("btn2", true);
25					btn.html(btn.data("vybrat") || "Vybrat");
26				}
27			});
28		}
29
30		$(".sbs").on("click", selectSbs);
31		$("input[name=IDSubscriptionType]").on("change", showSbsSelection);
32		showSbsSelection();
33
34
35
36		/* -- souhrn objednavky -- */		
37		function checkTotalPrice() {
38
39			let data = {
40				"do-checkTotalPrice": true,
41				"discountCode": $("[name=discountCode]").val(),
42				"IDSubscriptionType": $("[name=IDSubscriptionType]:checked").val(),
43				"IDArticle": $("[name=IDArticle]:checked").val(),
44			};
45
46			$.getJSON(window.location.href, data, function (data) {
47
48				if(!data) {
49					$(".TASummary").hide();
50				}
51				else {
52
53					$(".TASummary").show();
54					
55					/* vyplnime zakladni pocty */
56					var title = $("[name=IDSubscriptionType]:checked").length ? $("[name=IDSubscriptionType]:checked").data("title") : $("[name=IDArticle]:checked").data("title");
57					$("#TASummary_ProductTitle").html(title);
58					$("#TASummary_ProductPrice").html(data['ProductPrice']);
59					$("#TASummary_TotalPrice").html(data['TotalPrice']);
60
61					/* ted postovne */
62					if(!data['DeliveryPrice']) {
63						$("#TASummary_DeliveryPrice").closest(".TASummary").hide();
64						$("[name=Zasilkovna]").closest("fieldset").slideUp();
65						$("[name=Zasilkovna]").attr('disabled', true);
66					}
67					else {
68						$("[name=Zasilkovna]").closest("fieldset").slideDown();
69						$("#TASummary_DeliveryPrice").html(data['DeliveryPrice']);
70						$("[name=Zasilkovna]").attr('disabled', false);
71					}
72
73					/* ted slevovy kod */
74					$(".helpDiscount").html('');
75					if(!data['Discount']) {
76						$("#TASummary_Discount").closest(".TASummary").hide();
77						if($("[name=discountCode]").val()) {
78							$(".helpDiscount").html(data['DiscountError']);
79						}
80					}
81					else {
82						$("#TASummary_Discount").html("-"+data['Discount']);
83					}
84
85				}
86
87			});
88
89		}
90
91		$("[name=IDSubscriptionType]").on("change", checkTotalPrice);
92
93		$("#checkCodeButton").on("click", checkTotalPrice);
94		$("[name=discountCode]").on("blur", checkTotalPrice);
95		$("[name=discountCode]").on("keypress", function(e){
96		    if ( e.which == 13 ) {
97		    	e.preventDefault();
98		    	checkTotalPrice();
99		    }
100		});
101
102		checkTotalPrice();
103
104
105
106		/* -- nakupuji na firmu -- */		
107        $("#fillCompany").on("change", checkInvoiceChecked);
108
109        function checkInvoiceChecked() {
110            if($("#fillCompany").is(':checked')) {
111                $(".invoiceHide").slideDown();
112            }
113            else {
114                $(".invoiceHide").slideUp();
115                $(".invoiceHide input").val("");
116            }
117        }
118
119        checkInvoiceChecked();
120	});

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.