PageSourceSearch

https://www.prdaily.com/wp-content/plugins/ragan-ezine-ajax-subscribe/js/submit.js?ver=1.34

js prdaily.com collected 2026-09-24 07:13:27 UTC 8,468 bytes, 233 lines download raw bytes

1function ezinesubmit(obj) {
2	var containerClass = 'ezineSignupContainer';
3	if (!jQuery(obj).prop('disabled')) {
4		// disbale submit button
5		jQuery(obj).prop('disabled', true);
6	} else {
7		// already disabled. Return
8		return false;
9	}
10
11	console.log('ezinesubmit CALLED');
12	// this subscribe box
13	var containerObj = jQuery(obj).closest('.' + containerClass);
14	// remove old message
15	jQuery(containerObj).find('.ezineSubscribeMsg').remove();
16	var emailvalue = jQuery(containerObj).find('input[name=yourEmail]').first().val();
17	var termsaccept = jQuery(containerObj).find('input[name=acceptTOU]').first().prop('checked');
18	if (emailvalue.indexOf('@') > 1 && termsaccept == 1) {
19		var ajaxURL = HOME_URL + 'wp-admin/admin-ajax.php';
20		var data = {
21			"action": "ezine_subscribe",
22			"acceptTOU": termsaccept,
23			"MID": '7276524',
24			"Email Address": emailvalue,
25			"Email Type": 'HTML',
26			"HTML Emails": 'Yes',
27			"SubAction": 'sub_add_update',
28			"Ragan Promotional Emails": 'TRUE',
29			// redirect for status retrieval
30			"thx": EZINE_PLUGIN_URL + 'response.php?status=success',
31			"err": EZINE_PLUGIN_URL + 'response.php?status=error'
32//			"usub": 'https://web.ragan.com/enewsstand/unsubscribesurvey.html'
33		};
34		
35//		console.log("Plugin URL: " + EZINE_PLUGIN_URL);
36		if (CURRENT_SITE === 'ragan.com' || CURRENT_SITE === 'www.ragan.com') {
37//			console.log("is ragan");
38			data['Campaign'] = 'www.ragan.com';
39			data['Ragan Daily Headlines'] = 'TRUE';
40		} else if (CURRENT_SITE === 'prdaily.com' || CURRENT_SITE === 'www.prdaily.com' || CURRENT_SITE === 'next.prdaily.com') {
41//			console.log("is prdaily");
42			data['Campaign'] = 'www.prdaily.com';
43			data['Public Relations Daily'] = 'TRUE';
44		} else if (CURRENT_SITE === 'healthcarecommunication.com' || CURRENT_SITE === 'www.healthcarecommunication.com' || CURRENT_SITE === 'next.healthcarecommunication.com') {
45//			console.log("is HCC");
46			data['Campaign'] = 'HC site';
47			data['Health Care Newsfeed'] = 'TRUE';
48		} else if (CURRENT_SITE === 'firstdraft.biz' || CURRENT_SITE === 'www.firstdraft.biz' || CURRENT_SITE === 'next.firstdraft.biz') {
49//			console.log("is First Draft");
50			data['Campaign'] = 'First Draft';
51			data['First Draft Newsfeed'] = 'TRUE';
52		} else {
53//			console.log("no site match:" + CURRENT_SITE);
54			return false;
55		}
56		
57		jQuery.post(ajaxURL, data, function (data, status) {
58			var alertType;
59			if (status === 'success') {
60				if (data.status === 'success') {
61					// replace form with success message.
62					//
63					// Do this for all subscription boxes on the current page
64					jQuery('.' + containerClass).html('<p class="ezineSubscribeMsg alert alert-success">' + data.msg + '</p>');
65				} else {
66					var msg;
67					if (typeof data.msg !== 'undefined') {
68						msg = data.msg;
69					} else {
70						msg = 'An unexpected error ocurred.';
71					}
72
73					// append message to current subscription box
74					jQuery(containerObj).append('<p class="ezineSubscribeMsg alert alert-danger">' + data.msg + '</p>');
75				}
76			} else {
77				jQuery(containerObj).append('<p class="ezineSubscribeMsg alert alert-danger">An unexpected error ocurred. Please try again</p>');
78			}
79
80			// re-enable submit button
81			jQuery(obj).prop('disabled', false);
82		}, 'json');
83	} else {
84		jQuery(containerObj).find('.ezineSubscribeMsg').remove();
85		if (termsaccept != 1) {
86			jQuery(containerObj).append('<p class="ezineSubscribeMsg alert alert-danger">Please accept terms of use.</p>');
87		} else {
88			jQuery(containerObj).append('<p class="ezineSubscribeMsg alert alert-danger">Please enter a valid email.</p>');
89		}
90
91// re-enable submit button
92		jQuery(obj).prop('disabled', false);
93	}
94
95	return false;
96}
97
98
99function ezinesubmitCrisisCD(obj) {
100	var containerClass = 'ezineSignupContainerCrisisCD';
101	console.log('ezinesubmitCrisisCD CALLED');
102	// this subscribe box
103	var containerObj = jQuery(obj).closest('.' + containerClass);
104	// remove old message
105	jQuery(containerObj).find('.ezineSubscribeMsg').remove();
106	var emailvalue = jQuery(containerObj).find('input[name=yourEmail]').first().val();
107	var Countryvalue = jQuery(containerObj).find('select[name=strCntryCode]').first().val();
108	console.log('Country: ' + Countryvalue);
109	var termsaccept = 1;
110	if (emailvalue.indexOf('@') > 1 && termsaccept == 1) {
111		var ajaxURL = HOME_URL + 'wp-admin/admin-ajax.php';
112		var data = {
113			"action": "ezine_subscribe_crisiscd",
114			"MID": '7276524',
115			"Email Address": emailvalue,
116			"Country": Countryvalue,
117			"Email Type": 'HTML',
118			"HTML Emails": 'Yes',
119			"SubAction": 'sub_add_update',
120			"Crisis Communications Daily": 'TRUE',
121			// redirect for status retrieval
122			"thx": EZINE_PLUGIN_URL + 'response.php?status=success',
123			"err": EZINE_PLUGIN_URL + 'response.php?status=error'
124//			"usub": 'https://web.ragan.com/enewsstand/unsubscribesurvey.html'
125		};
126		
127		console.log("Plugin URL: " + EZINE_PLUGIN_URL);
128		if (CURRENT_SITE === 'ragan.com' || CURRENT_SITE === 'www.ragan.com') {
129			console.log("is ragan");
130			data['Campaign'] = 'www.ragan.com';
131			data['Ragan Daily Headlines'] = 'TRUE';
132		} else if (CURRENT_SITE === 'prdaily.com' || CURRENT_SITE === 'www.prdaily.com' || CURRENT_SITE === 'next.prdaily.com') {
133//			console.log("is prdaily");
134			data['Campaign'] = 'www.prdaily.com';
135			data['Public Relations Daily'] = 'TRUE';
136		} else if (CURRENT_SITE === 'healthcarecommunication.com' || CURRENT_SITE === 'www.healthcarecommunication.com' || CURRENT_SITE === 'next.healthcarecommunication.com') {
137//			console.log("is HCC");
138			data['Campaign'] = 'HC site';
139			data['Health Care Newsfeed'] = 'TRUE';
140		} else if (CURRENT_SITE === 'firstdraft.biz' || CURRENT_SITE === 'www.firstdraft.biz' || CURRENT_SITE === 'next.firstdraft.biz') {
141//			console.log("is First Draft");
142			data['Campaign'] = 'First Draft';
143			data['First Draft Newsfeed'] = 'TRUE';
144		} else {
145//			console.log("no site match:" + CURRENT_SITE);
146			return false;
147		}
148		
149		jQuery.post(ajaxURL, data, function (data, status) {
150			console.log("Data posting" + ' ' + status);
151			console.log(data);
152			var alertType;
153			if (status === 'success') {
154				if (data.status === 'success') {
155					// replace form with success message.
156					//
157					// Do this for all subscription boxes on the current page
158					jQuery('.' + containerClass).html('<p class="ezineSubscribeMsg alert alert-success">' + data.msg + '</p>');
159				} else {
160					var msg;
161					if (typeof data.msg !== 'undefined') {
162						msg = data.msg;
163					} else {
164						msg = 'An unexpected error ocurred.';
165					}
166
167					// append message to current subscription box
168					jQuery(containerObj).append('<p class="ezineSubscribeMsg alert alert-danger">' + data.msg + '</p>');
169				}
170			} else {
171				jQuery(containerObj).append('<p class="ezineSubscribeMsg alert alert-danger">An unexpected error ocurred. Please try again</p>');
172			}
173
174			// re-enable submit button
175			jQuery(obj).prop('disabled', false);
176		}, 'json');
177	} else {
178		jQuery(containerObj).find('.ezineSubscribeMsg').remove();
179		if (termsaccept != 1) {
180			jQuery(containerObj).append('<p class="ezineSubscribeMsg alert alert-danger">Please accept terms of use.</p>');
181		} else {
182			jQuery(containerObj).append('<p class="ezineSubscribeMsg alert alert-danger">Please enter a valid email.</p>');
183		}
184
185// re-enable submit button
186		jQuery(obj).prop('disabled', false);
187	}
188
189	return false;
190}
191
192
193
194jQuery(function () {
195	jQuery('.ezineSignupContainer').find('button[type=submit], input[type=submit]').each(function () {
196		jQuery(this).on('click', function (e) {
197			e.preventDefault();
198			ezinesubmit(this);
199			return false;
200		});
201	});
202});
203
204
205jQuery(function () {
206	jQuery('.ezineSignupContainerCrisisCD').find('button[type=submit], input[type=submit]').each(function () {
207		jQuery(this).on('click', function (e) {
208			e.preventDefault();
209			ezinesubmitCrisisCD(this);
210			return false;
211		});
212	});
213
214	topics = jQuery('.topics_line').html();
215	if (topics == null){
216    	topics = 'not_defined';
217	}
218	topics = topics.toLowerCase();
219
220	pagetitle = jQuery('h1.pagetitle.allcaps').html();
221	if (pagetitle == null){
222    	pagetitle = 'not_defined';
223	}
224	pagetitle = pagetitle.toLowerCase();
225
226	if (topics.indexOf('crisis communications') > -1 || topics.indexOf('covid-19') > -1 || pagetitle.indexOf('crisis communications') > -1 || pagetitle.indexOf('covid-19') > -1) {
227		//console.log("crisis detected!!!");
228		//jQuery( "section.rdhad" ).replaceWith( jQuery("section.crisiscommsdaily") );
229		//jQuery("div.crisiscommsdaily_form").attr("style", "display:block;");
230	}
231});
232
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.