PageSourceSearch

https://www.ttgmice.com/wp-content/themes/Newspaper-child-3/script…&ver=822f3d59ae486bf6ce6ae49be7077286

js ttgmice.com collected 2026-10-02 17:46:56 UTC 7,622 bytes, 241 lines download raw bytes

1
2jQuery(document).ready(function($) {
3
4	//styling for header in home page
5	$( ".widget_text .block-title span:contains('MPU')" ).each(function(){
6		$( ".widget_text .block-title span:contains('MPU')" ).closest('.block-title').hide()
7
8	})
9
10	// alter thumbnail size of editorial pick in homepage and inserting the links
11	$('.two-fifth .td_module_6 .td-module-thumb').each(function(){
12		var getImageSrcEditpick = $('img',this).attr('src');
13		$(this).css('background-image', 'url(' + getImageSrcEditpick + ')');
14
15		var getLink = $('a',this).attr('href');
16		$(this).wrap('<a class="hi" href =\"' + getLink + '\"></a>');
17	});
18	
19	// alter thumbnail size of editorial opinion in homepage and inserting the links
20	$('.two-fifth .td_module_1 .td-module-thumb').each(function(){
21		var getImageSrcEditpick = $('img',this).attr('src');
22		$(this).css('background-image', 'url(' + getImageSrcEditpick + ')');
23
24		var getLink = $('a',this).attr('href');
25		$(this).wrap('<a class="hi" href =\"' + getLink + '\"></a>');
26
27	});
28
29	function adjustReviewSidebar() {
30		$('.td-main-sidebar .td_module_6 .td-module-thumb').each(function(){
31			var getImageSrcEditpick = $('img',this).attr('src');
32			$(this).css('background-image', 'url(' + getImageSrcEditpick + ')');
33
34			var getLink = $('a',this).attr('href');
35			$(this).wrap('<a class="hi" href =\"' + getLink + '\"></a>');
36
37		});
38	}
39
40	adjustReviewSidebar();
41
42	$(document).ajaxSuccess(function(event, xhr, settings) {
43		if (settings.data.indexOf('td_ajax_block') !== -1 && settings.data.indexOf('td_block_7') !== -1) {
44			adjustReviewSidebar();
45		}
46	});
47
48	// adding background for header
49	var getHeaderBg = $('.header-background img').attr('src');
50	$('.td-container.td-header-row.td-header-header').css('background-image', 'url(' + getHeaderBg + ')');
51
52	// flight index
53	$( '.city-index' ).hover( function() {	
54		var city = $( this ).attr( 'id' );
55		$( '.logo-box' ).hide();
56		$( '#index-chart' ).show();
57		$( '.ttg_asia_flight_widget-content div.city.graph-hidden:visible' ).hide();
58		$( '.ttg_asia_flight_widget-content div#' + city ).show();
59		
60	});
61
62	$( '#index-chart' ).hover( function() {}, function() {
63		var city = $( this ).attr( 'id' );
64		$( '.logo-box' ).show();
65		$( '#index-chart' ).hide();
66		$( '.ttg_asia_flight_widget-content div#' + city ).hide();
67	});
68
69	//styling background
70    $(".extra-fixed-menu a[href]").each(function() {
71	    if (this.href == window.location.href) {
72	        $(this).closest('li').addClass("active");
73	        }   
74	});
75
76	// shifting the ticker to above footer
77	$(".footer-ticker").appendTo(".td-main-content-wrap");
78
79	//assign all title to look the same
80	$(".td-page-title").addClass('block-title');
81
82	//display none if there's no height
83	$('.widget_text').each(function(){
84		if ($(this).height() === 0){
85			$(this).hide();
86		}
87
88	});
89	$('.ad_sidebar').each(function(){
90		if ($(this).height() === 0){
91		
92			$(this).closest('.td-a-rec').hide();
93		}
94	});
95
96	//validating forum fields on the front end.
97	$('#commentform').submit(function() {
98	    if($('#author').val() == ''){
99	        alert('Please fill in name');
100	        return false;
101	    }
102	    if($('#email').val() == ''){
103	        alert('Please fill in your email.');
104	        return false;
105	    }
106	    if($('#comment').val() == ''){
107	        alert('Please fill in your answer.');
108	        return false;
109	    }
110
111	    var emailStr = $('#email').val();
112
113	    if (emailStr !== "") {  // If something was entered
114		    if (!validate_email(email)) {
115		        $("label#email_error").show(); //error message
116		        $("input#sc_email").focus();   //focus on email field
117		        alert('Please fill in a proper email');
118		        return false;  
119		    }
120		} 
121
122		function validate_email(field,alerttxt)
123		{
124		    with (field)
125		    {
126		        apos=value.indexOf("@");
127		        dotpos=value.lastIndexOf(".");
128		        if (apos<1||dotpos-apos<2){
129		            return false;
130		        }
131		        else {
132		            return true;
133		        }
134		    }
135		}
136	});
137
138	//clone a tag link on image to wrap entire image widget
139	$latestIssueLink = $('.widget_sp_image').find('a').clone().text('');
140	console.log($latestIssueLink);
141	$('.widget_sp_image-description').contents().wrap($latestIssueLink);
142
143	//style block title last word to be gray
144	
145	 $('.block-title span').each(function(){
146
147 		var title= $(this).text();
148 		if (title.indexOf(' ')>= 0){
149 			var $this = $(this);
150 			console.log(this);
151 			$this.html($this.html().replace(/(\S+)\s*$/, '<span class="header-gray">$1</span>'));
152 		}
153	 }) 
154	 // hiding mpu titles
155	$( ".block-title span" ).append( '<div class="triangle"></div>');
156
157		//displaying google ads with width 100%
158	$(function () {
159		AdjustGoogleAd('div-gpt-ad-1348715504065-2');
160		AdjustGoogleAd('div-gpt-ad-1348715504065-0');
161		AdjustGoogleAd('div-gpt-ad-1348715504065-1');
162		AdjustGoogleAd('div-gpt-ad-1348715504065-2');
163		AdjustGoogleAd('div-gpt-ad-1348715504065-3');
164		AdjustGoogleAd('div-gpt-ad-1349069358912-0');
165		AdjustGoogleAd('div-gpt-ad-1349063799523-0');
166		AdjustGoogleAd('div-gpt-ad-1463121162945-0');
167		AdjustGoogleAd('div-gpt-ad-1463133178224-0');
168		AdjustGoogleAd('div-gpt-ad-1348715504065-1');
169//		AdjustMICEBillboard();		
170    });
171
172
173    function AdjustGoogleAd(bannerId) {
174       var banner = $('#' + bannerId);
175       var contents = $('#' + bannerId + ' iframe').contents();
176       contents.find('a').clone().attr('id', bannerId + '_a').appendTo('#' + bannerId);
177       var newLink = $('#' + bannerId + '_a');
178       newLink.siblings().remove();
179       newLink.find(".img_ad").removeAttr('height').removeAttr('width');
180    }
181	
182/* 	function AdjustMICEBillboard() {
183		if (window.innerWidth < 1000){
184			document.getElementById('google_ads_iframe_/9566806/TTGmiceBillboard_0__container__').style="border: 0pt none; display: inline-block; width: 100%; height: auto;"
185			document.getElementById('google_ads_iframe_/9566806/TTGmiceBillboard_0').height="100%";
186			document.getElementById('google_ads_iframe_/9566806/TTGmiceBillboard_0').width="100%";
187		}
188	} */
189
190// search for ttgplanner
191		//search box 
192		$( 'ul.checkbox input[type=checkbox]' ).change( function() {
193		var name = $( this ).attr( 'name' );
194		switch( name ) {
195			case "destinations":
196			case "event-support":
197			case "packages":
198				if( this.checked ) {
199					$( 'input[type=checkbox]:not([name=' + name + '])' ).prop( 'checked', false );
200					$( 'input[type=checkbox]:not([name=' + name + '])' ).prop( 'disabled', true );
201				} else {
202					$( 'input[type=checkbox]' ).prop( 'disabled', false );
203				}
204				break;
205			default:
206				if( this.checked ) {
207					$( 'input[type=checkbox][name=destinations]' ).prop( 'checked', false );
208					$( 'input[type=checkbox][name=destinations]' ).prop( 'disabled', true );
209					$( 'input[type=checkbox][name=event-support]' ).prop( 'checked', false );
210					$( 'input[type=checkbox][name=event-support]' ).prop( 'disabled', true );
211					$( 'input[type=checkbox][name=packages]' ).prop( 'checked', false );
212					$( 'input[type=checkbox][name=packages]' ).prop( 'disabled', true );
213				} else {
214					if( $('input[type=checkbox]:checked').length == 0 ) {
215						$( 'input[type=checkbox]' ).prop( 'disabled', false );
216					}
217				}
218				break;
219			}
220		});
221
222		$( 'i.home-search-input-button.td-icon-search' ).click( function() {
223			$( 'form[role=search]' ).submit();
224		});
225
226		$(document).keypress(function(e) {
227		    if(e.which == 13) {
228		    	$( 'form[role=search]' ).submit();
229		    }
230		});
231
232		$( 'form[role=search1]' ).submit( function() {
233			if( $('input[type=checkbox]:checked').length == 0 ) {
234				alert( 'Please select at least 1 category' );
235				return false;
236			}
237
238			return true;
239		});
240
241});

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.