PageSourceSearch

https://e-hotel.hk/wp-content/plugins/tm-content-builder/framework…ntend-builder-global-functions.js?ver=1.3.0

js e-hotel.hk collected 2026-10-08 00:50:30 UTC 4,366 bytes, 127 lines download raw bytes

1(function($){
2	window.tm_pb_smooth_scroll = function( $target, $top_section, speed, easing ) {
3		var $window_width = $( window ).width();
4
5		if ( $( 'body' ).hasClass( 'tm_fixed_nav' ) && $window_width > 980 ) {
6			$menu_offset = $( '#top-header' ).outerHeight() + $( '#main-header' ).outerHeight() - 1;
7		} else {
8			$menu_offset = -1;
9		}
10
11		if ( $ ('#wpadminbar').length && $window_width > 600 ) {
12			$menu_offset += $( '#wpadminbar' ).outerHeight();
13		}
14
15		//fix sidenav scroll to top
16		if ( $top_section ) {
17			$scroll_position = 0;
18		} else {
19			$scroll_position = $target.offset().top - $menu_offset;
20		}
21
22		// set swing (animate's scrollTop default) as default value
23		if( typeof easing === 'undefined' ){
24			easing = 'swing';
25		}
26
27		$( 'html, body' ).animate( { scrollTop :  $scroll_position }, speed, easing );
28	}
29
30	window.tm_fix_video_wmode = function( video_wrapper ) {
31		$( video_wrapper ).each( function() {
32			if ( $(this).find( 'iframe' ).length ) {
33				var $this_el = $(this).find( 'iframe' ),
34					src_attr = $this_el.attr('src'),
35					wmode_character = src_attr.indexOf( '?' ) == -1 ? '?' : '&',
36					this_src = src_attr + wmode_character + 'wmode=opaque';
37
38				$this_el.attr('src', this_src);
39			}
40		} );
41	}
42
43	window.tm_pb_form_placeholders_init = function( $form ) {
44		$form.find('input:text, textarea').each(function(index,domEle){
45			var $tm_current_input = jQuery(domEle),
46				$tm_comment_label = $tm_current_input.siblings('label'),
47				tm_comment_label_value = $tm_current_input.siblings('label').text();
48			if ( $tm_comment_label.length ) {
49				$tm_comment_label.hide();
50				if ( $tm_current_input.siblings('span.required') ) {
51					tm_comment_label_value += $tm_current_input.siblings('span.required').text();
52					$tm_current_input.siblings('span.required').hide();
53				}
54				$tm_current_input.val(tm_comment_label_value);
55			}
56		}).bind('focus',function(){
57			var tm_label_text = jQuery(this).siblings('label').text();
58			if ( jQuery(this).siblings('span.required').length ) tm_label_text += jQuery(this).siblings('span.required').text();
59			if (jQuery(this).val() === tm_label_text) jQuery(this).val("");
60		}).bind('blur',function(){
61			var tm_label_text = jQuery(this).siblings('label').text();
62			if ( jQuery(this).siblings('span.required').length ) tm_label_text += jQuery(this).siblings('span.required').text();
63			if (jQuery(this).val() === "") jQuery(this).val( tm_label_text );
64		});
65	}
66
67	window.tm_duplicate_menu = function( menu, append_to, menu_id, menu_class, menu_click_event ){
68		append_to.each( function() {
69			var $this_menu = $(this),
70				$cloned_nav;
71
72			// make this function work with existing menus, without cloning
73			if ( '' !== menu ) {
74				menu.clone().attr('id',menu_id).removeClass().attr('class',menu_class).appendTo( $this_menu );
75			}
76
77			$cloned_nav = $this_menu.find('> ul');
78			$cloned_nav.find('.menu_slide').remove();
79			$cloned_nav.find('li:first').addClass('tm_first_mobile_item');
80
81			$cloned_nav.find( 'a' ).on( 'click', function(){
82				$this_menu.trigger( 'click' );
83			} );
84
85			if ( 'no_click_event' !== menu_click_event ) {
86				$this_menu.on( 'click', '.mobile_menu_bar', function(){
87					if ( $this_menu.hasClass('closed') ){
88						$this_menu.removeClass( 'closed' ).addClass( 'opened' );
89						$cloned_nav.stop().slideDown( 500 );
90					} else {
91						$this_menu.removeClass( 'opened' ).addClass( 'closed' );
92						$cloned_nav.stop().slideUp( 500 );
93					}
94					return false;
95				} );
96			}
97		} );
98
99		$('#mobile_menu .centered-inline-logo-wrap').remove();
100	}
101
102	// remove placeholder text before form submission
103	window.tm_pb_remove_placeholder_text = function( $form ) {
104		$form.find('input:text, textarea').each(function(index,domEle){
105			var $tm_current_input = jQuery(domEle),
106				$tm_label = $tm_current_input.siblings('label'),
107				tm_label_value = $tm_current_input.siblings('label').text();
108
109			if ( $tm_label.length && $tm_label.is(':hidden') ) {
110				if ( $tm_label.text() == $tm_current_input.val() )
111					$tm_current_input.val( '' );
112			}
113		});
114	}
115
116	window.tm_fix_fullscreen_section = function() {
117		var $tm_window = $(window);
118
119		$( 'section.tm_pb_fullscreen' ).each( function(){
120			var $this_section = $( this );
121
122			$.proxy( tm_calc_fullscreen_section, $this_section )();
123
124			$tm_window.on( 'resize', $.proxy( tm_calc_fullscreen_section, $this_section ) );
125		});
126	}
127})(jQuery)

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.