PageSourceSearch

https://www.westholmepublishing.com/wp-content/themes/westholme2019/js/main_functions.js?ver=7.0.6

js westholmepublishing.com collected 2026-10-02 11:15:38 UTC 3,094 bytes, 76 lines download raw bytes

1jQuery(function($) {	
2
3//format select function
4$(".format-select-btn").on('click', function(e) {
5	$(".format-select-btn.selected").removeClass("selected");
6	$(".e-audio-btn.eBook.selected").removeClass("selected");
7	$(this).addClass("selected");
8	e.preventDefault();
9});
10$(".e-audio-btn.eBook").on('click', function(e) {
11	$(".e-audio-btn.eBook.selected").removeClass("selected");
12	$(".format-select-btn.selected").removeClass("selected");
13	$(this).addClass("selected");
14	e.preventDefault();
15});
16
17//add to cart button
18$("#add-to-cart-btn").on('click', function(e) {
19	
20	
21	if($('.selected').hasClass('eBook')){
22		var isbn = $(".eBook.selected").attr("data-isbn");
23	
24		isbn_val = isbn.replace(/\D[^\.]/g, "");
25		isbn = isbn_val.slice(0,3)+"-"+isbn_val.slice(3,4)+"-"+isbn_val.slice(4,9)+"-"+isbn_val.slice(9,12)+"-"+isbn_val.slice(12);
26	  
27	    window.location.href = "https://cdcshoppingcart.uchicago.edu/Cart2/Cart?ISBN="+isbn+"&PRESS=westholme&EF=acsmepub";
28	}else{
29		
30			var isbn = $(".format-select-btn.selected").attr("data-isbn");
31	
32			isbn_val = isbn.replace(/\D[^\.]/g, "");
33			isbn = isbn_val.slice(0,3)+"-"+isbn_val.slice(3,4)+"-"+isbn_val.slice(4,9)+"-"+isbn_val.slice(9,12)+"-"+isbn_val.slice(12);
34			window.location.href = "https://cdcshoppingcart.uchicago.edu/Cart2/Cart?ISBN="+isbn+"&PRESS=westholme";		
35		
36	}
37	e.preventDefault();
38});
39
40$('.menu-trigger').on('click', function(e)	{
41	$("#"+$(this).attr("id")+"-menu").toggle();
42	e.stopPropagation();
43	e.preventDefault(); 
44});
45
46//book club sign up
47function isValidEmailAddress(emailAddress) {
48    var pattern = /^([a-z\d!#$%&'*+\-\/=?^_`{|}~\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF]+(\.[a-z\d!#$%&'*+\-\/=?^_`{|}~\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF]+)*|"((([ \t]*\r\n)?[ \t]+)?([\x01-\x08\x0b\x0c\x0e-\x1f\x7f\x21\x23-\x5b\x5d-\x7e\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF]|\\[\x01-\x09\x0b\x0c\x0d-\x7f\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF]))*(([ \t]*\r\n)?[ \t]+)?")@(([a-z\d\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF]|[a-z\d\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF][a-z\d\-._~\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF]*[a-z\d\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])\.)+([a-z\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF]|[a-z\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF][a-z\d\-._~\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF]*[a-z\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])\.?$/i;
49    return pattern.test(emailAddress);
50};
51
52$('#bookclub-submit').on('click', function(e)	{
53	$(".error_txt").hide();
54	
55	var email_input = $('#bookclub-email').val();
56	if (email_input == "" || !isValidEmailAddress(email_input)){
57		$(".email_error_txt").show();
58		$('#bookclub-email').focus();
59		return false;
60	}
61	
62	var templateUrl = urlobject.templateUrl;
63	var dataString = 'email_input=' + email_input;
64	
65	$.ajax({
66		type: "POST",
67		url: templateUrl+"/php/send_bookclub_form.php",
68		data: dataString,
69		success: function(data) {
70			$(".form-replace").html('<h2 class="mb-3">Thank you for joining the Westholme Publishing Book Club.</h2><p>You will receive your 25% off discount code via email shortly.</p>').removeClass("col-6");
71		}
72	});
73	e.preventDefault(); 
74});	
75
76});

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.