PageSourceSearch

https://www.publishingireland.com/wp-content/themes/publishing-ireland/assets/js/common.js?ver=1790944508

js publishingireland.com collected 2026-10-02 12:42:38 UTC 50,159 bytes, 1,836 lines download raw bytes

1(function($){
2
3	
4	// HELPERS
5	function setCookie(name,value,days) {
6
7	    var expires = "";
8	    if (days) {
9	        var date = new Date();
10	        date.setTime(date.getTime() + (days*24*60*60*1000));
11	        expires = "; expires=" + date.toUTCString();
12	    }
13
14	    //document.cookie = name + "=" + (value || "")  + expires + "; path=/";
15	    document.cookie = name + "=" + (value || "")  + expires + "; domain=." + cookieDomain + "; path=/";
16	    
17	}
18
19
20	function getCookie(name) {
21
22	    var nameEQ = name + "=";
23	    var ca = document.cookie.split(';');
24	    for(var i=0;i < ca.length;i++) {
25	        var c = ca[i];
26	        while (c.charAt(0)==' ') c = c.substring(1,c.length);
27	        if (c.indexOf(nameEQ) == 0) return c.substring(nameEQ.length,c.length);
28	    }
29
30	    return null;
31
32	}
33
34	function deleteCookie(name) {
35
36	    document.cookie = name + '=; Max-Age=0';
37
38	}
39
40
41	// SLIDER
42	function cmSlider(){
43
44		var deviceSize = 'lg';
45		if( $(window).width() <= '768' ){ deviceSize = 'sm'; }
46
47		$('.cm-slider').each( function( index, element ){
48			
49			if( deviceSize == 'sm' ){ $(this).find('.swiper-wrapper').height( '400px'); }
50
51			// APPLY BACKGROUND
52			$(this).find('.swiper-slide').each( function(){
53
54				if( deviceSize == 'sm' ){ $(this).height( '400px'); }
55
56				var bg = decodeURIComponent($(this).data(deviceSize));
57				$(this).css('background-image', 'url(' + bg + ')');  
58
59				if( deviceSize == 'lg' && $(this).hasClass('video-slide') ){
60
61
62					var vid = $(this).find('.video-container').data('video');
63					
64
65
66					if( $(this).hasClass('fill-width') ){
67
68						
69						var exHeight = $(window).width() / 1.77;
70						var exDiff = Math.round(exHeight) - $(this).height();
71						
72						// get window width, divide by 1.77 to get expected video height
73						// subtract height of container (this.height)
74						// margin top is the difference divided by 2
75
76						$(this).find('.video-container').append('<video src="' + vid + '" autoplay muted loop>');
77						$(this).find('.video-container video').css('margin-top', '-' + (exDiff/2)+ 'px');
78
79						/*var first = ($(window).width() / '16');
80						var second = (first * '9');
81						var third = ( first - second ) / '2';
82						$(this).find('video').css('margin-top', '-' + third + 'px');*/
83					} else {
84
85						$(this).find('.video-container').append('<video src="' + vid + '" autoplay muted loop>');
86
87					}
88				}
89				
90			});
91
92			// WHEN BACKGROUND IS LOADED INIT SLIDER
93	    	var $this = $(this).find('.swiper-container');
94		    $this.addClass("instance-" + index);
95
96		    if( $($this).find('.swiper-slide').length > 1){ 
97
98		    	var swiper = new Swiper(".instance-" + index, {
99
100		        	updateOnImagesReady: true, 
101		        	preventClicks: false,
102		        	preventClicksPropagation: false,
103					loop: $(this).data('loop'),
104					//allowTouchMove: false,
105					speed: $( this ).closest('.cm-slider').data('speed'),
106					direction: $( this ).closest('.cm-slider').data('direction'),
107					autoplay: {delay: $( this ).closest('.cm-slider').data('duration') },
108					effect: $( this ).closest('.cm-slider').data('effect'),
109					pagination: {el: '.swiper-pagination', clickable: true },
110		    	});
111
112		    } else {
113
114		    	$($this).find('.swiper-slide').addClass('swiper-slide-active');
115
116		    }
117
118	    	
119
120		});
121
122	}
123
124
125	function isOnScreen(elem) {
126		// if the element doesn't exist, abort
127		if( elem.length == 0 ) {
128			return;
129		}
130		var $window = jQuery(window)
131		var viewport_top = $window.scrollTop()
132		var viewport_height = $window.height()
133		var viewport_bottom = viewport_top + viewport_height
134		var $elem = jQuery(elem)
135		var top = $elem.offset().top
136		var height = $elem.height()
137		var bottom = top + height
138
139		return (top >= viewport_top && top < viewport_bottom) ||
140		(bottom > viewport_top && bottom <= viewport_bottom) ||
141		(height > viewport_height && top <= viewport_top && bottom >= viewport_bottom)
142	}
143
144
145	function filterEventsBy( type , value ){
146
147		$('.loading').show();
148
149		$.ajax({
150			type: "GET",
151			data: { action: 'filter-events-by', type: type , value: value },
152			url: themeDirectory + '/ajax.php',
153			success: function(data) {
154
155				$('.loading').hide();
156				//console.log( data );
157				$('.cm-events-container').html( data )
158				
159			}, error: function(){
160
161				$('.loading').hide();
162
163			},
164			dataType:"json",
165		});
166
167	}
168
169
170
171	function scrollTo( position , speed ){
172
173		$("html, body").animate({  scrollTop: position }, speed );
174
175	}
176
177
178	function matchHeights(){
179
180		$('.publication-archive .publication').matchHeight();
181		$('.articles .article').matchHeight();
182		$('.blog article').matchHeight();
183		$('.speaker').matchHeight();
184
185		
186		$('.my-account .main .overview ul').matchHeight();
187		//$('.my-account .main .profile ul').matchHeight();
188
189		/*if( $('.hero-carousel').length && $(window).width() > 992 ){
190			
191			$('.hero-carousel').each( function(){
192
193				//var _this = $(this);
194				var _height = $(this).closest('section.content').find('.features-container').height();
195				//console.log( $('.features-container').height() )
196				$(this).find('.item .inner').height( (_height - 5) + 'px');
197			});
198		}*/
199
200	}
201
202
203	function switchBackgrounds(){
204
205
206		if( $(window).width() <= '414'){
207
208			$('section.content').each( function(){
209
210				if( $(this).data('sm') != ''){ $(this).css('background-image', 'url(' + $(this).data('sm') + ')'); }	
211				
212			})
213		}
214	}
215
216	function setNewPassword( key , pass ){
217
218		$('.loading').show();
219
220		$.ajax({
221			type: "GET",
222			data: { action: 'set-new-password' , key: key , pass: pass },
223			url: themeDirectory + '/ajax.php',
224			dataType:"json",
225			success: function(data) {
226
227				window.location.href = accountPage;
228				
229			}, error: function(){
230
231				$('.loading').hide();
232				alert('Sorry, an error occurred');
233
234			},
235			
236		});
237
238	}
239
240	function checkPasswordStrength(n, m) {
241
242		var error = '';
243		var upperCase= new RegExp('[A-Z]');
244		var lowerCase= new RegExp('[a-z]');
245		var numbers = new RegExp('[0-9]');
246
247        if (n < 8) { error = 'Password should be at least 8 characters long';  } 
248        else if( ! (m.match(upperCase) && m.match(lowerCase) && m.match(numbers) ) ){ error = 'Password should contain uppercase, lowercase and at least one number'; }
249
250        return error;
251    }
252
253
254	function validateNewPassword(){
255
256		var key = $('#newpasswordform').data('key');
257		var pass = $('#newpasswordform .your-password').val();
258		var passConfirm = $('#newpasswordform .your-password-confirm').val();
259
260		var valid = 'true';
261		var error = checkPasswordStrength( pass.length , pass ) ;
262
263		if( ! error == ''){ 
264
265			$('#newpasswordform .error').html( error );
266	
267
268		} else if( pass != passConfirm ){
269
270			$('#newpasswordform .error').html('passwords do not match');
271
272		} else {
273
274			$('#newpasswordform .error').html('');
275			setNewPassword( key ,  pass );
276
277		}
278
279	}
280
281
282	function youtube_parser(url){
283	    var regExp = /^.*((youtu.be\/)|(v\/)|(\/u\/\w\/)|(embed\/)|(watch\?))\??v?=?([^#&?]*).*/;
284	    var match = url.match(regExp);
285	    return (match&&match[7].length==11)? match[7] : false;
286	}
287
288
289
290	function updateMembershipFormFields( type ){
291
292
293		$('.loading').show();
294
295		$.ajax({
296			type: "GET",
297			data: { action: 'update-membership-form--' + type },
298			url: themeDirectory + '/ajax.php',
299			dataType:"json",
300			success: function(data) {
301
302				$('.membership-form .extended').html( data );
303				$('.loading').hide();
304
305				
306			}, error: function(){
307
308				$('.loading').hide();
309				alert('error');
310
311			},
312			
313		});
314	}
315
316
317	function updateAccountView( view ){
318
319		$('.loading').show();
320		
321
322		$.ajax({
323			type: "GET",
324			data: { action: 'my-account-' + view },
325			url: themeDirectory + '/ajax.php',
326			dataType:"json",
327			success: function(data) {
328
329				if( view == 'logout'){
330
331					window.location.href = data;
332
333				} else {
334
335					$('.loading').hide();
336					$('.my-account .main').html( data );
337					setTimeout( function(){ matchHeights(); }, 300)
338				}
339
340				
341			}, error: function(){
342
343				$('.loading').hide();
344				alert('error');
345
346			},
347			
348		});
349
350	}
351
352	function myAccount__saveProfileInformation(){
353
354		$('.loading').show();
355
356		var pEmail = $('.profile-details .p-email').val();
357		var pPhone = $('.profile-details .p-phone').val();
358		var pWebsite = $('.profile-details .p-website').val();
359		var pAddress = $('.profile-details .p-address').val();
360		var pCounty = $('.profile-details .p-county').val();
361		var pEircode = $('.profile-details .p-eircode').val();
362		var pFacebook = $('.profile-details .p-facebook').val();
363		var pTwitter = $('.profile-details .p-twitter').val();
364		var pInstagram = $('.profile-details .p-instagram').val();
365		var pLinkedin = $('.profile-details .p-linkedin').val();
366		var pYoutube = $('.profile-details .p-youtube').val();
367		var pDescription = $('.profile-details .p-description').val();
368		var identifier = $('.profile-details').closest('.profile').data('for');
369
370
371		$.ajax({
372			type: "GET",
373			data: { 
374				action: 'save_profile_information',
375				identifier: identifier,
376				email: pEmail,
377				phone: pPhone,
378				website: pWebsite,
379				address: pAddress,
380				county: pCounty,
381				eircode: pEircode,
382				facebook: pFacebook,
383				twitter: pTwitter,
384				instagram: pInstagram,
385				linkedin: pLinkedin,
386				youtube: pYoutube,
387				description: pDescription
388			},
389			url: themeDirectory + '/ajax.php',
390			dataType:"json",
391			success: function(data) {
392
393				$('.loading').hide();
394
395				if( data == 'ok'){
396
397					$('<div class="success-message">Profile updated successfully</div>').insertBefore('.button-confirm-save-changes');
398					$('.button-confirm-save-changes').remove();
399
400				} else {
401
402					$('<div class="error-message">Sorry, an error occurred. Your changes may not have been saved.</div>').insertBefore('.button-confirm-save-changes');
403
404				}
405
406				
407			}, error: function(){
408
409				$('.loading').hide();
410				alert('error');
411
412			},
413			
414		});
415
416
417
418	}
419
420	function requestPasswordReset( val ){
421
422		$('.loading').show();
423
424		$.ajax({
425			type: "GET",
426			data: { action: 'request-password-reset', val: val },
427			url: themeDirectory + '/ajax.php',
428			dataType:"json",
429			success: function(data) {
430
431				$('.loading').hide();
432
433				var str = '';
434				str += '<div class="success">';
435				str += '<p>Thank you, please check your email for a password reset link.</p><div class="clear"></div>';
436				str += '<a href="' + accountPage + '"><span class="button-link back-to-login-button">Back to Login</span></a>';
437				str += '</div>';
438				$('.lostpassword-outer').html( str );
439
440			}, error: function(){
441
442				$('.loading').hide();
443				alert('Sorry, an error occurred');
444
445			},
446			
447		});
448
449
450
451	}
452
453
454	function applyArticleFilters( year , category , paged='1' ){
455
456		$('.loading').show();
457
458		$.ajax({
459			type: "GET",
460			data: { action: 'apply-article-filters', year: year , category: category , paged: paged },
461			url: themeDirectory + '/ajax.php',
462			dataType:"json",
463			success: function(data) {
464
465				$('.loading').hide();
466				$('.news-articles-outer-wrapper').html( data );
467				setTimeout( function(){ matchHeights(); }, 500);
468
469			}, error: function(){
470
471				$('.loading').hide();
472				alert('Sorry, an error occurred');
473
474			},
475			
476		});
477
478	}
479
480
481	function memberSubmitVacancy( parent ){
482
483		$('.loading').show();
484
485		var title = $(parent).find('.editing-title').val();
486		var description = $(parent).find('.editing-description').val();
487		var contact = $(parent).find('.editing-contact').val();
488		var location = $(parent).find('.editing-location').val();
489		var expiry = $(parent).find('.editing-expiry').val();
490		var jobType = $(parent).find('.editing-job-type option:selected').val();
491		var identifier = $(parent).closest('.vacancies').data('for');
492
493		
494
495		$.ajax({
496			type: "GET",
497			data: { action: 'member-submit-vacancy', title: title , description: description, contact: contact, location: location, expiry: expiry, job_type: jobType, identifier: identifier },
498			url: themeDirectory + '/ajax.php',
499			dataType:"json",
500			success: function(data) {
501
502				$('.loading').hide();
503				$(parent ).removeClass('editing').addClass('pending').html( title );
504
505			}, error: function(){
506
507				$('.loading').hide();
508				alert('Sorry, an error occurred');
509
510			},
511			
512		});
513
514
515	}
516
517
518	function memberSubmitPublication( parent, title ){
519
520		$('.loading').show();
521		var title = $(parent).find('.editing-title').val();
522		var formData = new FormData( $(parent).find('#publication-faux-form')[0] );
523		//$(parent).find('#publication-faux-form') 
524	
525		$.ajax({
526			type: "POST",
527			processData: false,
528			contentType: false,
529			data: formData,
530			url: themeDirectory + '/ajax.php',
531			success: function(data) {
532
533				$('.loading').hide();
534				$(parent ).removeClass('editing').addClass('pending').html( title );
535				
536
537			}, error: function(){
538
539				$('.loading').hide();
540				alert('Sorry, an error occurred');
541
542			},
543			dataType:"json",
544		});
545		
546	}
547
548
549
550	function processMembershipForm(){
551
552
553		var applicantTitle = $('.membership-form .applicant-title option:selected').val();
554		var applicantName = $('.membership-form .applicant-name').val();
555		var applicantSurname = $('.membership-form .applicant-surname').val();
556		var applicantEmail = $('.membership-form .applicant-email').val();
557		var applicantPhone = $('.membership-form .applicant-phone').val();
558		var applicantRole = $('.membership-form .applicant-role').val();
559
560		var businessName = $('.membership-form .business-name').val();
561		var businessWebsite = $('.membership-form .business-website').val();
562		var businessEmail = $('.membership-form .business-email').val();
563		var businessAddress = $('.membership-form .business-address').val();
564		var businessTown = $('.membership-form .business-town').val();
565		var businessCounty = $('.membership-form .business-county option:selected').val();
566		var businessEircode = $('.membership-form .business-eircode').val();
567
568		var businessFacebook = $('.membership-form .business-facebook').val();
569		var businessTwitter = $('.membership-form .business-twitter').val();
570		var businessInstagram = $('.membership-form .business-instagram').val();
571		var businessLinkedin = $('.membership-form .business-linkedin').val();
572		var businessTiktok = $('.membership-form .business-tiktok').val();
573		var businessYoutube = $('.membership-form .business-youtube').val();
574
575		var businessType = $('.membership-form .business-type option:selected').val();
576		var businessRegistrationNumber = $('.membership-form .business-registration-number').val();
577		var businessDateFounded = $('.membership-form .business-date-founded').val();
578		var businessPublicationYear = $('.membership-form .business-publication-year').val();
579		var businessStaff = $('.membership-form .business-staff').val();
580		var businessImprints = $('.membership-form .business-imprints').val();
581		var businessTurnover = $('.membership-form .business-turnover').val();
582		var businessTurnoverYear = $('.membership-form .business-turnover-year').val();
583
584		var businessPublicationsYear1 = $('.membership-form .business-publications-year-1').val();
585		var businessPublicationsYear2 = $('.membership-form .business-publications-year-2').val();
586		var businessPublicationsYear3 = $('.membership-form .business-publications-year-3').val();
587
588		var membershipType = $('.membership-form .membership-type.selected').data('value');
589		var businessOwnership = $('.membership-form .business-ownership').val();
590		var businessOperations = $('.membership-form .business-operations').val();
591		var businessLocations = $('.membership-form .business-locations').val();
592		var businessReferal = $('.membership-form .business-referal').val();
593
594		// NEW FIELDS, FOR NETWORK MEMBERSHIP
595		var businessBrief = $('.membership-form .business-brief').val();
596		var businessInterests = $('.membership-form .business-interests').val();
597		var businessSector = $('.membership-form .business-sector option:selected').val();
598
599		var businessReasons = $('.membership-form .business-reasons').val();
600		var businessDescription = $('.membership-form .business-description').val();
601
602
603		$.ajax({
604			type: "GET",
605			data: { 
606				action: 'membership-form', 
607				applicant_title: applicantTitle,
608				applicant_name: applicantName,
609				applicant_surname: applicantSurname,
610				applicant_email: applicantEmail,
611				applicant_phone: applicantPhone,
612				applicant_role: applicantRole,
613				business_name: businessName,
614				business_website: businessWebsite,
615				business_email: businessEmail,
616				business_address: businessAddress,
617				business_town: businessTown,
618				business_county: businessCounty,
619				business_eircode: businessEircode,
620				business_facebook: businessFacebook,
621				business_twitter: businessTwitter,
622				business_instagram: businessInstagram,
623				business_linkedin: businessLinkedin,
624				business_tiktok: businessTiktok,
625				business_youtube: businessYoutube,
626				business_type: businessType,
627				business_registration_number: businessRegistrationNumber,
628				business_date_founded: businessDateFounded,
629				business_publication_year: businessPublicationYear,
630				business_staff: businessStaff,
631				business_imprints: businessImprints,
632				business_turnover: businessTurnover,
633				business_turnover_year: businessTurnoverYear,
634				business_publications_year_1: businessPublicationsYear1,
635				business_publications_year_2: businessPublicationsYear2,
636				business_publications_year_3: businessPublicationsYear3,
637				membership_type: membershipType,
638				business_ownership: businessOwnership,
639				business_operations: businessOperations,
640				business_locations: businessLocations,
641				business_referal: businessReferal,
642				business_brief: businessBrief,
643				business_interests: businessInterests,
644				business_sector: businessSector,
645				business_reasons: businessReasons,
646				business_description: businessDescription
647			},
648			url: themeDirectory + '/ajax.php',
649			dataType:"json",
650			success: function(data) {
651
652				console.log(data );
653				$('.membership-form').html('Thank you, we have received your application and will be in contact soon.');
654				$('.loading').hide();
655				/*if( view == 'logout'){
656
657					window.location.href = data;
658
659				} else {
660
661					$('.loading').hide();
662					$('.my-account .main').html( data );
663					setTimeout( function(){ matchHeights(); }, 300)
664				}*/
665
666				
667			}, error: function(){
668
669				$('.loading').hide();
670				alert('Sorry, an error has occurred.');
671
672			},
673			
674		});
675	}
676
677	
678	$(document).on('scroll', function(e){
679
680		$('.cm-animate-up').not('.is-visible').each( function(){
681
682			if( isOnScreen( $(this) ) ) { $(this).addClass('is-visible'); }	
683
684		});
685
686
687	});
688
689
690
691	$(window).on('load', function(){
692
693		/*
694		|--------------------------------------------------------------------------
695		| WRAP SUBMENU IN DIV
696		|--------------------------------------------------------------------------
697		*/
698
699		$('section.header ul.sub-menu').wrap('<div class="sub-menu-wrapper">');
700
701	});
702
703
704
705
706	
707
708
709
710
711	$(document).ready(function(){
712
713
714		/*
715		|--------------------------------------------------------------------------
716		| ANIMATE INITIAL ELEMENTS
717		|--------------------------------------------------------------------------
718		*/
719
720		$('.cm-animate-up').not('.is-visible').each( function(){
721
722
723			if( isOnScreen( $(this) ) ) { $(this).addClass('is-visible'); }	
724
725		});
726
727
728
729		/*
730		|--------------------------------------------------------------------------
731		| PUSH MENU
732		|--------------------------------------------------------------------------
733		*/
734
735		$('.hamburger').on('click', function(){ 
736
737			$(this).toggleClass('is-active');
738			$('body').toggleClass('menu-active');
739			$('html').toggleClass('locked');
740		
741		});
742
743
744		// INSERT DROPDOWN ARROW
745		$('nav.push-menu ul.navigation li.menu-item-has-children').append('<span></span>');
746		
747		// EXPAND
748		$('nav.push-menu ul.navigation li.menu-item-has-children span').on('click', function(){
749			
750			$(this).siblings('ul.sub-menu').toggleClass('active');
751		})
752
753		
754		/*
755		|--------------------------------------------------------------------------
756		| BACK TO TOP
757		|--------------------------------------------------------------------------
758		*/	
759
760		//$('.back-to-top').on('click', function(){ scrollTo( '0' , 800 ); })
761		
762
763		$('#lostpasswordform .submit-button').on('click' , function(){
764
765			$('#lostpasswordform .error').removeClass('error');
766			var val = $('#lostpasswordform .your-email').val();
767
768			if( val == ''){ $('#lostpasswordform .your-email').addClass('error'); }
769			else{ requestPasswordReset( val ); }
770
771		});
772
773
774
775		$('.article-filters select').on('change', function(){
776
777			var year = $('.article-filters .by-year option:selected').val();
778			var category = $('.article-filters .by-category option:selected').val();
779			applyArticleFilters( year , category );
780		})
781
782		
783		/*
784		|--------------------------------------------------------------------------
785		| FEATURE BOX CLICK
786		|--------------------------------------------------------------------------
787		*/	
788
789		$('.feature-box').on('click', function(){
790
791			if( $(this).data('link') ){ window.location.href = $(this).data('link'); }
792		});
793
794
795		/*
796		|--------------------------------------------------------------------------
797		| SCROLL TO SECTION
798		|--------------------------------------------------------------------------
799		*/	
800
801		$('.scroll-to').on('click', function(e){
802
803			e.preventDefault();
804			var el = $(this).attr('href');
805			var top = $(el).offset().top;
806			
807			scrollTo( top , 800);
808		});
809
810
811		/*
812		|--------------------------------------------------------------------------
813		| SWITCH BACKGROUND IMAGES ON MOBILE
814		|--------------------------------------------------------------------------
815		*/	
816
817		switchBackgrounds();
818
819
820		/*
821		|--------------------------------------------------------------------------
822		| HALF PADDING FOR MOBILE
823		|--------------------------------------------------------------------------
824		*/
825
826		/*if( $(window).width() <= '414'){
827
828			$('.frontpage section.content').first().css('padding-top', '250px');
829
830		}*/
831
832		if( $(window).width() <= '414'){
833
834			$('section.content').each( function(){
835
836				var curTop = (parseInt($(this).css('padding-top')) / 2);
837				var curBottom = (parseInt($(this).css('padding-bottom')) / 2);
838
839				$(this).css('padding-top' , curTop + 'px');
840				$(this).css('padding-bottom' , curBottom + 'px');
841
842			});
843
844		}
845
846
847		//var copperDisclaimerAppended = false;
848
849		$('body').on('click' , '.cpfc button' , function(){
850
851			//if( copperDisclaimerAppended == false ){
852
853				var insert = '';
854				insert += '<p>Before submitting your query, please note that Publishing Ireland is not a publisher but a publisher association. ';
855				insert += 'Our team is not equipped to handle manuscripts, nor is it at liberty to collaborate with individual authors. ';
856				insert += 'We invite those looking to get published to look through our members directory available here and, should one of them prove a match for your vision, ';
857				insert += 'to consult that publisher’s submission policy. ';
858				insert += 'We at Publishing Ireland also do not sell books;
858 to purchase a book you have seen on our website, dont hesitate to contact the relevant publisher.</p>';
859
860				$( insert ).insertAfter( $('.fptl h6') );
861
862				//copperDisclaimerAppended = true;
863
864			//}
865			console.log('hiii');
866		})
867
868		/*setTimeout( function(){
869
870			if( $('.fptl').length ){
871
872				var insert = '';
873				insert += '<p>Before submitting your query, please note that Publishing Ireland is not a publisher but a publisher association. ';
874				insert += 'Our team is not equipped to handle manuscripts, nor is it at liberty to collaborate with individual authors. ';
875				insert += 'We invite those looking to get published to look through our members directory available here and, should one of them prove a match for your vision, ';
876				insert += 'to consult that publisher’s submission policy. ';
877				insert += 'We at Publishing Ireland also do not sell books; to purchase a book you have seen on our website, dont hesitate to contact the relevant publisher.</p>';
878
879				$( insert ).insertAfter( $('fptl h6') );
880			}
881
882		} , 3000 );*/
883
884
885		/*
886		|--------------------------------------------------------------------------
887		| MEMBERS / ADD PUBLICATION
888		|--------------------------------------------------------------------------
889		*/	
890
891
892		$('body').on('click', '.publications .add-new-publication', function(){
893
894			if( $('li.editing').length >= '1' ){ $('li.editing .editing-title').css('border','1px solid #9fc131'); return false; }
895
896			var publicationsForm = '';
897			publicationsForm += '<li class="editing">';
898			publicationsForm += '<div class="row">';
899			publicationsForm += '<div class="col-md-12"><input type="text" placeholder="Publication Title" class="editing-title required"></div>';
900
901			publicationsForm += '<div class="col-md-3"><input type="text" placeholder="Author" class="editing-author required"></div>';
902			publicationsForm += '<div class="col-md-3"><input type="text" placeholder="Release DD/MM/YYYY" class="editing-release-date required"></div>';
903
904			publicationsForm += '<div class="col-md-3"><select class="editing-category required">';
905			publicationsForm += '<option value="">Categories</option>';
906			$( publicationCategories ).each( function( x , y ){ publicationsForm += '<option value="' + y[1] + '">' + y[0] + '</option>'; })
907			publicationsForm += '</select></div>';
908
909			publicationsForm += '<div class="col-md-3"><select class="editing-format required">';
910			publicationsForm += '<option value="">Formats</option>';
911			$( publicationFormats ).each( function( x , y ){ publicationsForm += '<option value="' + y[1] + '">' + y[0] + '</option>'; })
912			publicationsForm += '</select></div>';
913			
914
915			publicationsForm += '<div class="col-md-8"><textarea placeholder="Description" class="editing-description required"></textarea></div>';
916			publicationsForm += '<div class="col-md-4"><div class="droppable" id="image-preview"></div></div>';
917
918			publicationsForm += '<div class="col-md-12"><div class="submit-button">Submit</div></div>';
919			publicationsForm += '</div>';
920
921			publicationsForm += '<form enctype="multipart/form-data" method="POST" id="publication-faux-form"><input type="file" name="faux_image" class="faux-image"><input type="submit"></form>';
922			publicationsForm += '</li>';
923
924			$('.publications ul.publications-overview').prepend( publicationsForm );
925		});
926
927
928		/*
929		|--------------------------------------------------------------------------
930		| MEMBERS / PUBLICATION IMAGE UPLOAD
931		|--------------------------------------------------------------------------
932		*/	
933
934		$('body').on('click', 'ul.publications-overview li.editing .droppable', function(){
935
936			$('ul.publications-overview li.editing .faux-image').click();
937
938		});
939
940		$('body').on('change', 'ul.publications-overview li.editing .faux-image', function(){
941
942			if( $(this).val() == ''){
943
944	       		// NO FILE SELECTED, REMOVE THUMBNAIL
945	       		$(this).closest('li.editing').find('.droppable').css('background-image','');
946
947	       	} else {
948
949	       		// VARS
950	       		var filename = $(this)[0].files[0].name;
951				var filesize = $(this)[0].files[0].size;
952				var file_extension = filename.split('.').pop(); 
953
954				var allowed_extensions = new Array("jpg","png");
955				var allowed_size = '1800000';
956
957				
958				// VALIDATE
959				if( ! ($.inArray( file_extension , allowed_extensions) != -1) ){
960
961					// INVALID FILE TYPE
962					alert('Only jpg and png are allowed');
963					$(this).val('');
964
965
966				} else if( filesize > '1800000'){
967
968					alert('File size cannot exceed 1mb');
969					$(this).val('');
970
971
972					
973				} else {
974
975					// set thumbnail
976					var file = $(this)[0].files[0];
977				    var reader = new FileReader();
978
979				    reader.onloadend = function(){ document.getElementById('image-preview').style.backgroundImage = "url(" + reader.result + ")"; }
980				    if(file){ reader.readAsDataURL(file); }
981					
982				}
983
984	       	
985	       	}
986
987		});
988
989
990
991		/*
992		|--------------------------------------------------------------------------
993		| MEMBERS / VALIDATE PUBLICATION
994		|--------------------------------------------------------------------------
995		*/	
996
997
998		$('body').on('click', 'ul.publications-overview li.editing .submit-button', function(){
999
1000			var parent = $(this).closest('li.editing');
1001			var valid = 'true';
1002
1003			// RESET ERRORS
1004			$( parent ).find('.error').removeClass('error');
1005
1006			// VALIDATE
1007			$( parent ).find('.required').each( function(){
1008
1009				if( $(this).is('select')){
1010
1011					if( $(this).find('option:selected').val() == ''){
1012
1013						$(this).closest('select').addClass('error');
1014						valid = 'false';
1015					}
1016
1017				} else if( $(this).val() == ''){
1018
1019					$(this).addClass('error');
1020					valid = 'false';
1021
1022				}
1023			});
1024
1025			if( valid == 'true'){ 
1026
1027				// APPEND FORM DATA 
1028				$('<input type="text" name="action" value="member-submit-publication">').appendTo('#publication-faux-form');
1029				$('<input type="text" name="identifier" value="' + $(parent).closest('.publications').data('for') + '">').appendTo('#publication-faux-form');
1030				$('<input type="text" name="f_title" value="' + $(parent).find('.editing-title').val() + '">').appendTo('#publication-faux-form');
1031				$('<input type="text" name="f_author" value="' + $(parent).find('.editing-author').val() + '">').appendTo('#publication-faux-form');
1032				$('<input type="text" name="f_release_date" value="' + $(parent).find('.editing-release-date').val() + '">').appendTo('#publication-faux-form');
1033				$('<input type="text" name="f_category" value="' + $(parent).find('.editing-category option:selected').val() + '">').appendTo('#publication-faux-form');
1034				$('<input type="text" name="f_format" value="' + $(parent).find('.editing-format option:selected').val() + '">').appendTo('#publication-faux-form');
1035				$('<textarea name="f_description">' + $(parent).find('.editing-description').val() + '</textarea>').appendTo('#publication-faux-form');
1036
1037				memberSubmitPublication( parent ); 
1038
1039			}
1040
1041
1042		});
1043
1044
1045
1046		/*
1047		|--------------------------------------------------------------------------
1048		| MEMBERS / ADD VACANCY
1049		|--------------------------------------------------------------------------
1050		*/	
1051
1052		$('body').on('click', '.vacancies .add-new-vacancy', function(){
1053
1054			if( $('li.editing').length >= '1' ){ $('li.editing .editing-title').css('border','1px solid #9fc131'); return false; }
1055
1056			var vacanciesForm = '';
1057			vacanciesForm += '<li class="editing">';
1058			vacanciesForm += '<div class="row">';
1059			vacanciesForm += '<div class="col-md-12"><input type="text" placeholder="Vacancy Title" class="editing-title required"></div>';
1060
1061			vacanciesForm += '<div class="col-md-3"><input type="text" placeholder="Application Email / Url" class="editing-contact required"></div>';
1062			vacanciesForm += '<div class="col-md-3"><input type="text" placeholder="Job Location" class="editing-location required"></div>';
1063			vacanciesForm += '<div class="col-md-3"><input type="text" placeholder="Expires DD/MM/YYYY" class="editing-expiry required"></div>';
1064			
1065			vacanciesForm += '<div class="col-md-3"><select class="editing-job-type required">';
1066			vacanciesForm += '<option value="">Job Type</option>';
1067			$( jobTypes ).each( function( x , y ){ vacanciesForm += '<option value="' + y[1] + '">' + y[0] + '</option>'; })
1068			vacanciesForm += '</select></div>';
1069
1070
1071			vacanciesForm += '<div class="col-md-12"><textarea placeholder="Job Description" class="editing-description required"></textarea></div>';
1072			vacanciesForm += '<div class="col-md-12"><div class="submit-button">Submit</div></div>';
1073			vacanciesForm += '</div>';
1074			vacanciesForm += '</li>';
1075
1076			$('.vacancies ul.vacancies-overview').prepend( vacanciesForm );
1077		});
1078
1079
1080		/*
1081		|--------------------------------------------------------------------------
1082		| MEMBERS / VALIDATE VACANCY
1083		|--------------------------------------------------------------------------
1084		*/	
1085
1086		$('body').on('click', 'ul.vacancies-overview li.editing .submit-button', function(){
1087
1088			var parent = $(this).closest('li.editing');
1089			var valid = 'true';
1090
1091			// RESET ERRORS
1092			$( parent ).find('.error').removeClass('error');
1093
1094			// VALIDATE
1095			$( parent ).find('.required').each( function(){
1096
1097				if( $(this).is('select')){
1098
1099					if( $(this).find('option:selected').val() == ''){
1100
1101						$(this).closest('select').addClass('error');
1102						valid = 'false';
1103					}
1104
1105				} else if( $(this).val() == ''){
1106
1107					$(this).addClass('error');
1108					valid = 'false';
1109
1110				}
1111			});
1112
1113			if( valid == 'true'){ memberSubmitVacancy( parent ); }
1114
1115			
1116		});
1117
1118
1119		/*
1120		|--------------------------------------------------------------------------
1121		| MEMBERS / COUNT WORDS
1122		|--------------------------------------------------------------------------
1123		*/	
1124
1125
1126		$('body').on('keyup focus' , '.profile-details.right .p-description', function(){
1127
1128			var count = ($(this).val().split(' ').length )
1129			$(this).closest('li').find('.word-counter').html( count + ' / 300');
1130			if( count > 3 ){ return false; }
1131
1132		});
1133		
1134
1135		/*
1136		|--------------------------------------------------------------------------
1137		| FANCYBOX
1138		|--------------------------------------------------------------------------
1139		*/
1140
1141		$('.fancybox').fancybox({
1142		  	beforeShow : function(){
1143		   		this.title =  $(this.element).data("caption");
1144		  	}
1145		});
1146
1147
1148		/*
1149		|--------------------------------------------------------------------------
1150		| PAYMENT FORM
1151		|--------------------------------------------------------------------------
1152		*/
1153
1154		$('.payment-form .button-link').on('click', function(e){
1155
1156			e.preventDefault();
1157
1158			var formValid = true;
1159			$('.payment-form .required').removeClass('error');
1160
1161
1162			$('.payment-form .required').each( function(){
1163
1164				if( $(this).val() == ''){ $(this).addClass('error'); formValid = false; }
1165			});
1166
1167			if( formValid == true ){ $('.payment-form').submit(); }
1168
1169
1170		})
1171		
1172
1173		/*
1174		|--------------------------------------------------------------------------
1175		| LOGIN WIDGET
1176		|--------------------------------------------------------------------------
1177		*/	
1178
1179		$('<div class="message"></div>').insertBefore($('form#loginform .login-submit'));
1180		
1181
1182		$('form#loginform').on('submit', function( e ){
1183
1184			e.preventDefault();
1185			$('.loading').show();
1186
1187			var formValid = 'true';
1188			var user = $(this).find('#user_login').val();
1189			var pass = $(this).find('#user_pass').val();
1190
1191			if( user == ''){ $('form#loginform .message').text('Please enter a username');  formValid = 'false'; $('.loading').hide(); }
1192			else if( pass == ''){ $('form#loginform .message').text('Please enter a password'); formValid = 'false'; $('.loading').hide(); }
1193
1194			if( formValid == 'true'){
1195
1196				$.ajax({
1197					type: "GET",
1198					data: { action: 'user-login', user: user , pass: pass },
1199					url: themeDirectory + '/ajax.php',
1200					dataType:"json",
1201					success: function(data) {
1202
1203						if( data == 'success'){
1204
1205							window.location.href = accountPage;
1206
1207
1208						} else {
1209
1210							$('form#loginform .message').text('Incorrect username or password');
1211							$('.loading').hide();
1212
1213						}
1214						
1215						
1216					}, error: function(){
1217
1218						//$('.loading').hide();
1219
1220					},
1221					
1222				});
1223			}
1224			
1225		});
1226
1227
1228
1229		/*
1230		|--------------------------------------------------------------------------
1231		| ACCOUNT SIDEBAR
1232		|--------------------------------------------------------------------------
1233		*/
1234
1235		$('.members-sidebar li').on('click' , function(){
1236
1237			if( $(this).hasClass('active') ){ return; }
1238
1239			$('.members-sidebar li').removeClass('active');
1240			$(this).addClass('active');
1241
1242			updateAccountView( $(this).data('action') );
1243
1244		});
1245
1246
1247		$('body').on('click', '.my-account .go-to', function(){
1248
1249			var myAction = $(this).data('action');
1250			updateAccountView( myAction );
1251
1252			$('.members-sidebar li').removeClass('active').each( function(){
1253
1254				if( $(this).data('action') == myAction){
1255					$(this).addClass('active');
1256				}
1257			});
1258
1259		});
1260
1261
1262
1263
1264		/*
1265		|--------------------------------------------------------------------------
1266		| ACCOUNT DASHBOARD
1267		|--------------------------------------------------------------------------
1268		*/
1269
1270
1271		if( $('section.my-account').length ){
1272
1273			$('.loading').show();
1274
1275			$.ajax({
1276				type: "GET",
1277				data: { action: 'my-account-dashboard' },
1278				url: themeDirectory + '/ajax.php',
1279				dataType:"json",
1280				success: function(data) {
1281
1282					$('.loading').hide();
1283					$('.my-account .main').html( data );
1284					
1285					
1286				}, error: function(){
1287
1288					$('.loading').hide();
1289					alert('error');
1290
1291				},
1292				
1293			});
1294
1295		}
1296
1297
1298		/*
1299		|--------------------------------------------------------------------------
1300		| ACCOUNT EDIT PROFILE
1301		|--------------------------------------------------------------------------
1302		*/
1303
1304		$('body').on('click', '.my-account .icon-edit' , function(){
1305
1306			$(this).closest('li').find('input').focus();
1307		});
1308
1309
1310		$('body').on('click', '.my-account .button-confirm-save-changes' , function(){
1311
1312			myAccount__saveProfileInformation();
1313
1314		});
1315		
1316
1317
1318
1319		/*
1320		|--------------------------------------------------------------------------
1321		| EVENT FILTERS
1322		|--------------------------------------------------------------------------
1323		*/	
1324
1325
1326		$('.faqs .faq .question').on('click', function(){
1327
1328			if( $(this).closest('.faq').hasClass('active') ){
1329
1330				$(this).closest('.faq').removeClass('active')
1331
1332			} else {
1333
1334				$('.faqs .faq').removeClass('active');
1335				$(this).closest('.faq').addClass('active');
1336
1337			}
1338
1339			
1340		});
1341
1342		/*
1343		|--------------------------------------------------------------------------
1344		| EVENT FILTERS
1345		|--------------------------------------------------------------------------
1346		*/	
1347
1348		$('.event-type-filters li').on('click', function(){
1349
1350			$('.event-type-filters li , .event-cat-filters li , .event-date-filters li ').removeClass('active');
1351			$('.event-cat-filters li.all , .event-date-filters li.all').addClass('active');
1352			$(this).addClass('active');
1353
1354			filterEventsBy( 'type' , $(this).data('type') );
1355
1356		});
1357
1358		$('.event-cat-filters li').on('click', function(){
1359
1360			$('.event-type-filters li , .event-cat-filters li , .event-date-filters li ').removeClass('active');
1361			$('.event-type-filters li.all , .event-date-filters li.all').addClass('active');
1362			$(this).addClass('active');
1363
1364			filterEventsBy( 'cat' , $(this).data('cat') );
1365
1366		});
1367
1368		$('.event-date-filters li').on('click', function(){
1369
1370			if( $(this).data('date') == 'all'){ window.location.reload(); }
1371			else {
1372
1373				$('.event-type-filters li , .event-cat-filters li , .event-date-filters li ').removeClass('active');
1374				$('.event-type-filters li.all , .event-cat-filters li.all').addClass('active');
1375				$(this).addClass('active');
1376
1377				filterEventsBy( 'date' , $(this).data('date') );
1378			}
1379			
1380
1381		})
1382
1383
1384		/*
1385		|--------------------------------------------------------------------------
1386		| PUBLISHER FILTERS
1387		|--------------------------------------------------------------------------
1388		*/	
1389
1390
1391		$('ul.publisher-filters li').on('click', function(){
1392
1393			$(this).toggleClass('active');
1394
1395
1396			var full = $('ul.publisher-filters li.publisher');
1397			var associate = $('ul.publisher-filters li.network-member');
1398
1399			if( ($(full).hasClass('active') && $(associate).hasClass('active')) || (! $(full).hasClass('active') && ! $(associate).hasClass('active'))  ){
1400
1401				$('.publishers .publisher').each( function(){ $(this).closest('.col-md-3').removeClass('hidden'); })
1402
1403
1404			} else if( $(full).hasClass('active') ){
1405
1406	
1407				$('.publishers .publisher').each( function(){
1408
1409					if( $(this).hasClass('full-member')){ $(this).closest('.col-md-3').removeClass('hidden'); }
1410					else{ $(this).closest('.col-md-3').addClass('hidden'); }
1411
1412				});
1413
1414			} else if( $(associate).hasClass('active') ){
1415
1416		
1417				$('.publishers .publisher').each( function(){
1418
1419					if( $(this).hasClass('network-member')){ $(this).closest('.col-md-3').removeClass('hidden'); }
1420					else{ $(this).closest('.col-md-3').addClass('hidden'); }
1421
1422				});
1423
1424			} else {
1425
1426				// show all
1427
1428			}
1429		});
1430
1431
1432		/*
1433		|--------------------------------------------------------------------------
1434		| PUBLISHER FILTERS AUTO FILTER
1435		|--------------------------------------------------------------------------
1436		*/	
1437
1438
1439		if( $('.publisher-filters').length  ){
1440
1441			var queryString = window.location.search;
1442			var urlParams = new URLSearchParams(queryString);
1443
1444
1445			if( urlParams.get('type') ){
1446
1447				if( urlParams.get('type') == 'network' ){
1448
1449					$('.publisher-filters .network-member').click();
1450
1451				} else {
1452
1453					$('.publisher-filters .publisher').click();
1454
1455				}
1456				
1457			}
1458			
1459		}
1460		
1461
1462
1463		/*
1464		|--------------------------------------------------------------------------
1465		| IFRAME HEIGHT
1466		|--------------------------------------------------------------------------
1467		*/
1468
1469
1470		if( $(window).width() < '414'){
1471
1472			setTimeout( function(){ $('.ticket-container iframe').height('500px').css('border','1px solid #CCC'); }, 2000)
1473			
1474		}
1475
1476
1477
1478		/*
1479		|--------------------------------------------------------------------------
1480		| ENTER NEW PASSWORD / PASSWORD RESET
1481		|--------------------------------------------------------------------------
1482		*/
1483
1484		$('#newpasswordform .submit-button').on('click', function(){
1485
1486			validateNewPassword();
1487
1488		});
1489
1490
1491		
1492		/*
1493		|--------------------------------------------------------------------------
1494		| ACCESSIBILITY TOOLS
1495		|--------------------------------------------------------------------------
1496		*/
1497
1498
1499		// OPEN PANEL
1500		$('.accessibility-tools .handle').on('click', function(){ 
1501
1502			$('.accessibility-tools').toggleClass('active') 
1503
1504		});
1505
1506
1507		// TOGGLE OPTIONS
1508		$('.accessibility-tools .inner ul li').on('click', function(){ 
1509
1510			//$(this).toggleClass('active')
1511			if( $(this).hasClass('increase-text') ){
1512
1513				if( $(this).hasClass('active')){
1514
1515					$(this).removeClass('active');
1516					$('body').removeClass('accessibility-text');
1517					setCookie( 'accessibilityText' , '0' , '7' );
1518
1519				} else {
1520
1521					$(this).addClass('active');
1522					$('body').addClass('accessibility-text');
1523					setCookie( 'accessibilityText' , '1' , '7' );
1524
1525				}
1526
1527			} else if( $(this).hasClass('increase-contrast') ){
1528
1529				if( $(this).hasClass('active')){
1530
1531					$(this).removeClass('active');
1532					$('body').removeClass('accessibility-contrast');
1533					setCookie( 'accessibilityContrast' , '0' , '7' );
1534					
1535				} else {
1536
1537					$(this).addClass('active');
1538					$('body').addClass('accessibility-contrast');
1539					setCookie( 'accessibilityContrast' , '1' , '7' );
1540
1541				}
1542
1543			} else if( $(this).hasClass('highlight-links') ){
1544
1545				if( $(this).hasClass('active')){
1546
1547					$(this).removeClass('active');
1548					$('body').removeClass('accessibility-links');
1549					setCookie( 'accessibilityLinks' , '0' , '7' );
1550					
1551				} else {
1552
1553					$(this).addClass('active');
1554					$('body').addClass('accessibility-links');
1555					setCookie( 'accessibilityLinks' , '1' , '7' );
1556
1557				}
1558
1559			}
1560
1561			setTimeout( function(){ matchHeights(); }, 500)
1562			
1563
1564		});
1565
1566
1567		// PRE-SELECTED OPTIONS
1568		if( getCookie( 'accessibilityText' ) == '1' ){
1569
1570			$('.accessibility-tools .inner ul li.increase-text').addClass('active');
1571			$('body').addClass('accessibility-text');
1572
1573		}
1574
1575		if( getCookie( 'accessibilityContrast' ) == '1' ){
1576
1577			$('.accessibility-tools .inner ul li.increase-contrast').addClass('active');
1578			$('body').addClass('accessibility-contrast');
1579		}
1580
1581		if( getCookie( 'accessibilityLinks' ) == '1' ){
1582
1583			$('.accessibility-tools .inner ul li.highlight-links').addClass('active');
1584			$('body').addClass('accessibility-links');
1585
1586		}
1587		
1588
1589
1590		/*
1591		|--------------------------------------------------------------------------
1592		| VALIDATE SEARCH FIELD
1593		|--------------------------------------------------------------------------
1594		*/
1595
1596		/*$('.search-form .search-button').on( 'click' , function( e ){
1597
1598			$('.search-form input[type=search]').removeClass('error');
1599			if( $('.search-form input[type=search]').val() == '' ){ e.preventDefault(); $('.search-form input[type=search]').addClass('error'); }
1600
1601		})*/
1602		
1603
1604		/*
1605		|--------------------------------------------------------------------------
1606		| MEMBERSHIP FORM
1607		|--------------------------------------------------------------------------
1608		*/
1609
1610		$('.membership-form .membership-type').on('click', function(){
1611
1612			
1613			if( ! $(this).hasClass('selected') ){
1614
1615				$('.membership-form .membership-type').removeClass('selected');
1616				$(this).addClass('selected');
1617
1618				if( $(this).data('value') == 'Publisher' ){ updateMembershipFormFields('publisher'); } 
1619				else { updateMembershipFormFields('network'); }
1620			}
1621
1622		});
1623
1624
1625		$('body').on('click', '.membership-form .disclaimer .checkbox' , function(){
1626
1627			$(this).toggleClass('checked');
1628		});
1629
1630
1631
1632		$('body').on('click' , '.membership-form .section .continue', function(){
1633
1634			// SHOW LOADER
1635			$('.loading').show();
1636			var formValid = 'true';
1637
1638			// REMOVE ERRORS
1639			$('.membership-form .error').removeClass('error');
1640
1641			// VALIDATE
1642			$('.membership-form .required').each( function(){
1643
1644				if( $(this).val() == ''){
1645
1646					$(this).addClass('error');
1647					formValid = 'false';
1648				}
1649
1650			});
1651
1652			if( ! $('.disclaimer-1 .checkbox').hasClass('checked') ){
1653
1654				$('.disclaimer-1 .checkbox').addClass('error');
1655				formValid = 'false';
1656
1657			}
1658
1659			if( ! $('.disclaimer-2 .checkbox').hasClass('checked') ){
1660
1661				$('.disclaimer-2 .checkbox').addClass('error');
1662				formValid = 'false';
1663				
1664			}
1665
1666			if( ! $('.membership-form .membership-type.selected').length ){
1667				$('.membership-type').closest('label').css('color','red')
1668			}
1669
1670
1671
1672			// continue
1673			if( formValid == 'true'){ 
1674
1675				processMembershipForm();
1676
1677			} else {
1678
1679				$('.loading').hide();
1680				scrollTo( ($('.membership-form .error').first().offset().top - 100 )  , 500);
1681
1682			}
1683			
1684		})
1685
1686
1687		/*
1688		|--------------------------------------------------------------------------
1689		| MEMBERsHIP FORM UPDATES 2025
1690		|--------------------------------------------------------------------------
1691		*/
1692
1693
1694
1695
1696		/*
1697		|--------------------------------------------------------------------------
1698		| INIT SWIPER
1699		|--------------------------------------------------------------------------
1700		*/
1701
1702		cmSlider();
1703
1704
1705		/*
1706		|--------------------------------------------------------------------------
1707		| MATCH HEIGHT
1708		|--------------------------------------------------------------------------
1709		*/
1710
1711		matchHeights();
1712
1713
1714
1715		/*
1716		|--------------------------------------------------------------------------
1717		| CAROUSEL
1718		|--------------------------------------------------------------------------
1719		*/
1720
1721		/*var productCarousel = $('.publications-carousel');
1722		productCarousel.owlCarousel({ 
1723			margin:0, 
1724			nav:true, 
1725			autoplay:false, 
1726			//center: true, 
1727			//autoplayTimeout:3000, 
1728			smartSpeed: 1000, 
1729			autoplayHoverPause:true, 
1730			items:2, 
1731			loop:true, 
1732			responsive: { 0:{ items: 1 }, 414:{ items: 2 }, 768:{ items: 3 }, 1024:{ items: 4 }, 1280:{ items: 5 } },
1733			navText: ["<i class='fa fa-angle-left' aria-hidden='true'></i>","<i class='fa fa-angle-right' aria-hidden='true'></i>"]
1734		});*/
1735
1736
1737		if ( $('.hero-carousel').length > 0 ) {
1738
1739			$('.hero-carousel').each( function( index, value ){
1740
1741				var slider = tns({
1742			        	container: this,   
1743			           	items: 1,
1744					    speed: 1500,
1745					    gutter:0,
1746					    controls: true,
1747					    slideBy: '1',
1748					    edgePadding: '0',
1749					    mouseDrag: true,
1750					    //autoplay: true,
1751					    autoplayTimeout: '5000',
1752					    rewind:true,
1753					    
1754			    });
1755			});
1756
1757		}
1758
1759
1760
1761		if ( $('.publications-carousel').length > 0 ) {
1762
1763			$('.publications-carousel').each( function( index, value ){
1764
1765				var slider = tns({
1766			        	container: this,   
1767			           	items: 5,
1768					    speed: 1500,
1769					    //gutter:20,
1770					    controls: true,
1771					    slideBy: '2',
1772					    //edgePadding: '10',
1773					    mouseDrag: true,
1774					    //autoplay: true,
1775					    autoplayTimeout: '5000',
1776					    rewind:true,
1777					    responsive: {
1778					      1024: { items: 5 },
1779					      992: { items: 3 },
1780					      768: { items: 2 },
1781					      415: { items: 2 },
1782					      0: {  items: 1 , slideBy: '1' }
1783					    }
1784			    });
1785			});
1786
1787		}
1788
1789		if ( $('.publishers-carousel').length > 0 ) {
1790
1791			$('.publishers-carousel').each( function( index, value ){
1792
1793				var slider = tns({
1794			        	container: this,   
1795			           	items: 4,
1796					    speed: 1500,
1797					    //gutter:20,
1798					    controls: true,
1799					    slideBy: '2',
1800					    //edgePadding: '10',
1801					    mouseDrag: true,
1802					    //autoplay: true,
1803					    autoplayTimeout: '5000',
1804					    rewind:true,
1805					    responsive: {
1806					      1024: { items: 4 },
1807					      992: { items: 3 },
1808					      768: { items: 2 },
1809					      415: { items: 2 },
1810					      0: {  items: 1 , slideBy: '1' }
1811					    }
1812			    });
1813			});
1814
1815		}
1816
1817		
1818
1819
1820
1821	});
1822
1823
1824
1825	$(window).on('resize', function(){
1826
1827		//
1828
1829
1830	})
1831
1832
1833})(jQuery);
1834
1835
1836

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.