PageSourceSearch

https://sicklecellatlanticcanada.ca/wp-content/themes/charity-is-hope/js/theme.init.js

js sicklecellatlanticcanada.ca collected 2026-10-06 16:34:16 UTC 7,239 bytes, 233 lines download raw bytes

1/* global jQuery:false */
2/* global CHARITY_IS_HOPE_STORAGE:false */
3
4
5// Theme-specific first load actions
6//==============================================
7function charity_is_hope_theme_ready_actions() {
8	"use strict";
9	// Put here your init code with theme-specific actions
10	// It will be called before core actions
11    // Checkbox with "I agree..."
12    if (jQuery('input[type="checkbox"][name="i_agree_privacy_policy"]:not(.inited),input[type="checkbox"][name="gdpr_terms"]:not(.inited),input[type="checkbox"][name="wpgdprc"]:not(.inited)').length > 0) {
13        jQuery('input[type="checkbox"][name="i_agree_privacy_policy"]:not(.inited),input[type="checkbox"][name="gdpr_terms"]:not(.inited),input[type="checkbox"][name="wpgdprc"]:not(.inited)')
14            .addClass('inited')
15            .on('change', function(e) {
16                if (jQuery(this).get(0).checked)
17                    jQuery(this).parents('form').find('button,input[type="submit"]').removeAttr('disabled');
18                else
19                    jQuery(this).parents('form').find('button,input[type="submit"]').attr('disabled', 'disabled');
20            }).trigger('change');
21    }
22}
23
24
25// Theme-specific scroll actions
26//==============================================
27function charity_is_hope_theme_scroll_actions() {
28	"use strict";
29	// Put here your theme-specific code with scroll actions
30	// It will be called when page is scrolled (before core actions)
31}
32
33
34// Theme-specific resize actions
35//==============================================
36function charity_is_hope_theme_resize_actions() {
37	"use strict";
38	// Put here your theme-specific code with resize actions
39	// It will be called when window is resized (before core actions)
40}
41
42
43// Theme-specific shortcodes init
44//=====================================================
45function charity_is_hope_theme_sc_init(cont) {
46	"use strict";
47	// Put here your theme-specific code to init shortcodes
48	// It will be called before core init shortcodes
49	// @param cont - jQuery-container with shortcodes (init only inside this container)
50}
51
52
53// Theme-specific post-formats init
54//=====================================================
55function charity_is_hope_theme_init_post_formats() {
56	"use strict";
57	// Put here your theme-specific code to init post-formats
58	// It will be called before core init post_formats when page is loaded or after 'Load more' or 'Infinite scroll' actions
59
60	// Tribe Events buttons decoration (add 'sc_button' class)
61	jQuery('a.tribe-events-read-more,.tribe-events-button,.tribe-events-nav-previous a,.tribe-events-nav-next a,.tribe-events-widget-link a,.tribe-events-viewmore a')
62		.addClass('sc_button sc_button_style_filled');
63
64	// All other buttons decoration (add 'hover' class)
65	if (CHARITY_IS_HOPE_STORAGE['button_hover'] && CHARITY_IS_HOPE_STORAGE['button_hover']!='default') {
66		jQuery('button:not(.search_submit):not([class*="sc_button_hover_"]),\
67				.sc_button:not(.sc_button_style_border):not([class*="sc_button_hover_"]),\
68				.woocommerce .button:not([class*="sc_button_hover_"]),.woocommerce-page .button:not([class*="sc_button_hover_"]),\
69				#buddypress a.button:not([class*="sc_button_hover_"])'
70				).addClass('sc_button_hover_'+CHARITY_IS_HOPE_STORAGE['button_hover']);
71		if (CHARITY_IS_HOPE_STORAGE['button_hover']!='arrow')
72			jQuery('input[type="submit"]:not([class*="sc_button_hover_"]),\
73					input[type="button"]:not([class*="sc_button_hover_"]),\
74					.isotope_filters_button,\
75					.scroll_to_top:not([class*="sc_button_hover_"]),\
76					.sc_slider_prev:not([class*="sc_button_hover_"]),.sc_slider_next:not([class*="sc_button_hover_"]),\
77					.tagcloud > a:not([class*="sc_button_hover_"])'
78					).addClass('sc_button_hover_'+CHARITY_IS_HOPE_STORAGE['button_hover']);
79	}
80
81	// All text fields decoration (except Calculated Fields Forms)
82	//if (CHARITY_IS_HOPE_STORAGE['input_hover'])
83	//	jQuery('form:not([class*="cp_cff_"]):not([class*="sc_input_hover_"])').addClass('sc_input_hover_'+CHARITY_IS_HOPE_STORAGE['input_hover']);
84
85	// Mark field as 'filled' on keypress
86	jQuery('[class*="sc_input_hover_"] input, [class*="sc_input_hover_"] textarea').each(function() {
87		if (jQuery(this).val()!='')
88			jQuery(this).addClass('filled');
89		else
90			jQuery(this).removeClass('filled');
91	});
92	jQuery('[class*="sc_input_hover_"] input, [class*="sc_input_hover_"] textarea').on('blur', function() {
93		if (jQuery(this).val()!='')
94			jQuery(this).addClass('filled');
95		else
96			jQuery(this).removeClass('filled');
97	});
98}
99
100
101// Theme-specific GoogleMap styles
102//=====================================================
103function charity_is_hope_theme_googlemap_styles($styles) {
104	"use strict";
105	// Put here your theme-specific code to add GoogleMap styles
106	// It will be called before GoogleMap init when page is loaded
107	$styles['greyscale'] = [
108    	{ "stylers": [
109        	{ "saturation": -100 }
110            ]
111        }
112	];
113	$styles['inverse'] = [
114		{ "stylers": [
115			{ "invert_lightness": true },
116			{ "visibility": "on" }
117			]
118		}
119	];
120	$styles['simple'] = [
121    	{ stylers: [
122        	{ hue: "#00ffe6" },
123            { saturation: -20 }
124			]
125		},
126		{ featureType: "road",
127          elementType: "geometry",
128          stylers: [
129			{ lightness: 100 },
130           	{ visibility: "simplified" }
131            ]
132		},
133		{ featureType: "road",
134          elementType: "labels",
135          stylers: [
136          	{ visibility: "off" }
137            ]
138		}
139	];
140	$styles['apple'] = [
141		{ "featureType": "landscape.man_made",
142		  "elementType": "geometry",
143		  "stylers": [
144			{"color":"#f7f1df"}
145			]
146		},
147		{ "featureType": "landscape.natural",
148		  "elementType": "geometry",
149		  "stylers": [
150		  	{"color":"#d0e3b4"}
151			]
152		},
153		{ "featureType": "landscape.natural.terrain",
154		  "elementType": "geometry",
155		  "stylers": [
156		  	{"visibility":"off"}
157			]
158		},
159		{ "featureType": "poi",
160		  "elementType": "labels",
161		  "stylers": [
162		  	{"visibility":"off"}
163			]
164		},
165		{ "featureType": "poi.business",
166		  "elementType": "all",
167		  "stylers": [
168		  	{"visibility":"off"}
169			]
170		},
171		{ "featureType": "poi.medical",
172		  "elementType": "geometry",
173		  "stylers": [
174		  	{"color":"#fbd3da"}
175			]
176		},
177		{ "featureType": "poi.park",
178		  "elementType": "geometry",
179		  "stylers": [
180		  	{"color":"#bde6ab"}
181			]
182		},
183		{ "featureType": "road",
184		  "elementType": "geometry.stroke",
185		  "stylers": [
186		  	{"visibility":"off"}
187			]
188		},
189		{ "featureType": "road",
190		  "elementType": "labels",
191		  "stylers": [
192		  	{"visibility":"off"}
193			]
194		},
195		{ "featureType": "road.highway",
196		  "elementType": "geometry.fill",
197		  "stylers": [
198		  	{"color":"#ffe15f"}
199			]
200		},
201		{ "featureType": "road.highway",
202		  "elementType":"geometry.stroke",
203		  "stylers": [
204		  	{"color":"#efd151"}
205		  	]
206		},
207		{ "featureType": "road.arterial",
208		  "elementType": "geometry.fill",
209		  "stylers": [
210		  	{"color":"#ffffff"}
211			]
212		},
213		{ "featureType": "road.local",
214		  "elementType": "geometry.fill",
215		  "stylers": [
216		  	{"color":"black"}
217			]
218		},
219		{ "featureType": "transit.station.airport",
220		  "elementType": "geometry.fill",
221		  "stylers": [
222		  	{"color":"#cfb2db"}
223			]
224		},
225		{ "featureType": "water",
226		  "elementType": "geometry",
227		  "stylers": [
228		  	{"color":"#a2daf2"}
229			]
230		}
231	];
232	return $styles;
233}

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.