PageSourceSearch

https://contemporaryfusionreviews.com/wp-content/plugins/newsletters-lite/js/wp-mailinglist.js?ver=cp_bd4da0e2

js contemporaryfusionreviews.com collected 2026-10-02 04:07:44 UTC 8,607 bytes, 258 lines download raw bytes

1var request_getlistfields = false;
2var request_subscribe = false;
3
4jQuery(document).ready(function(){
5	jQuery("input[id*=checkboxall]").click(function() {
6		var checked_status = this.checked;
7		jQuery("input[id*=checklist]").each(function() {
8			this.checked = checked_status;
9		});
10	});
11	
12	jQuery("input[id*=checkinvert]").click(function() {	
13		jQuery("input[id*=checklist]").each(function() {
14			var status = this.checked;
15			
16			if (status == true) {
17				this.checked = false;
18			} else {
19				this.checked = true;
20			}
21		});
22	});
23});
24
25(function($) {
26	
27	// Open and closing of postboxes
28	$('.newsletters .postbox .hndle').on('click', function() {
29		//$(this).parent().toggleClass('closed');
30	});
31	
32	// Hook into the "notice-my-class" class we added to the notice, so
33	// Only listen to YOUR notices being dismissed
34	$(document).on('click', '.notice-newsletters .notice-dismiss', function () {
35		// Read the "data-notice" information to track which notice
36		// is being dismissed and send it via AJAX
37		var type = $(this).closest('.notice-newsletters').data('notice');
38		
39		// Make an AJAX call
40		// Since WP 2.8 ajaxurl is always defined in the admin header and points to admin-ajax.php
41		$.ajax(newsletters_ajaxurl + 'action=newsletters_dismissed_notice', {
42			type: 'POST',
43			data: {
44				action: 'newsletters_dismissed_notice',
45				type: type,
46				security: newslettersmain.ajaxnonce.dismissed_notice
47			}
48		});
49	});
50
51
52	// Hook into the "notice-my-class" class we added to the notice, so
53	// Only listen to YOUR notices being dismissed
54	$(document).on('click', '.notice-newsletters .notice-dismiss_forever', function () {
55		// Read the "data-notice" information to track which notice
56		// is being dismissed and send it via AJAX
57		var type = $(this).closest('.notice-newsletters').data('notice');
58
59		// Make an AJAX call
60		// Since WP 2.8 ajaxurl is always defined in the admin header and points to admin-ajax.php
61		$.ajax(newsletters_ajaxurl + 'action=newsletters_dismiss_forever_notice', {
62			type: 'POST',
63			data: {
64				action: 'newsletters_dismiss_forever_notice',
65				type: type,
66				security: newslettersmain.ajaxnonce.dismissed_notice
67			}
68		});
69
70		$('.notice-newsletters .notice-dismiss').trigger('click');
71	});
72
73})(jQuery);
74
75function newsletters_get_country(link) {
76	
77	var subscriber_id = jQuery(link).data('subscriber-id');	
78	var get_country_link = jQuery('#newsletters_subscriber_' + subscriber_id + '_get_country');
79	var country_span = jQuery('#newsletters_subscriber_' + subscriber_id + '_country');
80	
81	get_country_link.html('<i class="fa fa-refresh fa-spin fa-fw"></i>');
82	
83	if (typeof get_country_request !== 'undefined') {
84		get_country_request.abort();
85	}
86	
87	get_country_request = jQuery.ajax({
88		url: newsletters_ajaxurl + 'action=newsletters_get_country&security=' + newsletters.ajaxnonce.get_country,
89		data: {
90			subscriber_id: subscriber_id, 
91			security: newsletters.ajaxnonce.get_country
92		},
93		dataType: "json",
94		type: 'POST',
95		success: function(response) {			
96			if (response.success == true) {
97				country_span.html(response.flag);
98				get_country_link.remove();
99			} else {
100				country_span.html('N/A');
101				get_country_link.html('<i class="fa fa-question fa-fw"></i>');
102			}
103		}, 
104		error: function(resposne) {
105			get_country_link.html('<i class="fa fa-question fa-fw"></i>');
106		}
107	});
108}
109
110function newsletters_focus(element) {
111	if (typeof jQuery(element) != "undefined" && jQuery(element).val() == "") {
112		setTimeout(function() {
113			jQuery(element).focus();
114		}, 500);
115	}
116}
117
118function newsletters_tinymce_content(contentid) {	
119	if (jQuery("#wp-" + contentid + "-wrap").hasClass("tmce-active")) {		
120		if (typeof(tinyMCE.activeEditor) == "object" && typeof(tinyMCE.activeEditor.getContent) == "function") {
121			tinyMCE.triggerSave();
122			return tinyMCE.activeEditor.getContent();
123		}
124	}
125	
126	return jQuery('#' + contentid).val();
127}
128
129function newsletters_tinymce_setcontent(content) {
130	jQuery('.wp-editor-wrap .switch-tmce').trigger('click');	
131	//if (typeof(tinyMCE.activeEditor) == "object" && tinyMCE.activeEditor.setContent != null && typeof(tinyMCE.activeEditor.setContent) == "function") {
132	//	tinyMCE.activeEditor.setContent(content);
133	//	tinyMCE.triggerSave();
134	//}
135	
136	jQuery('textarea#content').html(content);
137	return true;
138}
139
140function newsletters_change_filter(section, filter, value) {
141	var expires;
142	var date = new Date();
143    date.setTime(date.getTime() + (30 * 24 * 60 * 60 * 1000));
144    expires = date.toGMTString();
145    
146    document.cookie = "newsletters_filter_" + section + "=1; expires=" + expires + "; path=/";
147	document.cookie = "newsletters_filter_" + section + "_" + filter + "=" + value + "; expires=" + expires + "; path=/";
148}
149
150function hsl2rgb(hsl) {
151    var h = hsl[0], s = hsl[1], l = hsl[2];
152    var m1, m2, hue;
153    var r, g, b
154    h = (Math.round( 360*h )/1);
155    if (s == 0)
156        r = g = b = (l * 255);
157    else {
158        if (l <= 0.5)
159            m2 = l * (s + 1);
160        else
161            m2 = l + s - l * s;
162        m1 = l * 2 - m2;
163        hue = h / 360;
164        r = Math.round(HueToRgb(m1, m2, hue + 1/3));
165        g = Math.round(HueToRgb(m1, m2, hue));
166        b = Math.round(HueToRgb(m1, m2, hue - 1/3));
167    }
168    return {r: r, g: g, b: b};
169}
170
171function HueToRgb(m1, m2, hue) {
172    var v;
173    if (hue < 0)
174        hue += 1;
175    else if (hue > 1)
176        hue -= 1;
177
178    if (6 * hue < 1)
179        v = m1 + (m2 - m1) * hue * 6;
180    else if (2 * hue < 1)
181        v = m2;
182    else if (3 * hue < 2)
183        v = m1 + (m2 - m1) * (2/3 - hue) * 6;
184    else
185        v = m1;
186
187    return 255 * v;
188}
189
190function wpml_submitserial(form) {
191	jQuery('#newsletters_submitserial_button').prop('disabled', true);
192	jQuery('#wpml_submitserial_loading').show();
193	var formdata = jQuery(form).serialize();
194
195	jQuery.post(newsletters_ajaxurl + 'action=wpmlserialkey&security=' + newslettersmain.ajaxnonce.serialkey, formdata, function(response) {
196		jQuery('#wpmlsubmitserial').html(response);
197		jQuery.colorbox.resize();
198	});
199}
200
201function wpml_deleteserial() {
202	jQuery('#wpml_submitserial_loading').show();
203
204	jQuery.post(newsletters_ajaxurl + 'action=wpmlserialkey&delete=1&security=' + newslettersmain.ajaxnonce.serialkey, false, function(response) {
205		jQuery.colorbox.close(); parent.location.reload(1);
206	});
207}
208
209function jqCheckAll(checker, formid, name) {					
210	jQuery('input:checkbox[name="' + name + '[]"]').each(function() {
211		jQuery(this).prop("checked", checker.checked);
212	});
213}
214
215function wpml_scroll(selector) {
216	var targetOffset = (jQuery(selector).offset().top - 50);
217    jQuery('html,body').animate({scrollTop: targetOffset}, 500);
218}
219
220function newsletters_refreshfields(widgetid) {
221	if (request_getlistfields) { request_getlistfields.abort(); }
222	jQuery('#' + widgetid + '-loading').show();
223	jQuery('#' + widgetid + '-button').prop('disabled', true);
224	jQuery('#' + widgetid + ' .newsletters-fieldholder :input').attr('readonly', true);
225	var formvalues = jQuery('#' + widgetid + '-form').serialize();
226	
227	request_getlistfields = jQuery.post(newsletters_ajaxurl + "action=wpmlgetlistfields&widget_id=" + widgetid + '&security=' + newsletters.ajaxnonce.refreshfields, formvalues, function(response) {		
228		jQuery('#' + widgetid + '-loading').hide();
229		jQuery('#' + widgetid + '-button').prop('disabled', false);
230		jQuery('#' + widgetid + '-fields').html(response);
231		jQuery('#' + widgetid + ' .newsletters-fieldholder :input').attr('readonly', false);
232		
233		$postpage = jQuery('.newsletters-management, .entry-content, .post-entry, .entry, .page-entry, .page-content');
234		$divs = $postpage.find('#' + widgetid + '-form').find('.newsletters-fieldholder:not(.newsletters_submit, .hidden)');		
235		for (var i = 0; i < $divs.length; i += 2) {
236			$divs.slice(i, i + 2).wrapAll('<div class="row"></div>');
237		}
238		jQuery($divs).wrap('<div class="col-md-6"></div>');
239	});
240}
241
242function wpml_titletoslug(title) {
243	var title = title.toLowerCase();
244	var slug = title.replace(/[^0-9a-z]+/g, "");
245	jQuery('#Field_slug').val(slug);	
246}
247
248function wpml_tinymcetag(tag) {
249	if (typeof(tinyMCE) == "object" && typeof(tinyMCE.execCommand) == "function" && tinyMCE.activeEditor) {
250		if (window.tinyMCE && tag != "") {
251			window.tinyMCE.execCommand('mceInsertContent', false, tag);	
252		}
253	} else {
254		jQuery('textarea#content').text(jQuery('textarea#content').val() + '\n\n' + tag);
255	}
256	
257	wpml_scroll('#wp-content-editor-container');
258}

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.