PageSourceSearch

https://www.herboplanet.it/wp-content/plugins/profile-builder-pro/…/assets/js/wppb_cpm_main.js?ver=4.0.3

js herboplanet.it collected 2026-10-09 23:25:09 UTC 6,260 bytes, 165 lines download raw bytes

1var wppb_cpm_global_height = "";
2var wppb_cpm_global_width = "";
3
4jQuery( document ).ready( function() {
5    var url;
6
7    jQuery( 'body' ).click( function( e ) {
8        if( ( jQuery( e.target ).is( 'span.ubermenu-target-title' ) && jQuery( e.target ).parents( '.ubermenu-item-type-wppb_cpm_login_iframe, .ubermenu-item-type-wppb_cpm_register_iframe, .ubermenu-item-type-wppb_cpm_edit_profile_iframe' ).length )
9        || ( jQuery( e.target ).is( 'a.ubermenu-target' ) && jQuery( e.target ).parents( '.ubermenu-item-type-wppb_cpm_login_iframe, .ubermenu-item-type-wppb_cpm_register_iframe, .ubermenu-item-type-wppb_cpm_edit_profile_iframe' ).length ) ) {
10            e.preventDefault();
11
12            if( jQuery( e.target ).is( 'span.ubermenu-target-title' ) ) {
13                url = jQuery( e.target ).parent().attr( 'href' );
14            } else {
15                url = jQuery( e.target ).attr( 'href' );
16            }
17
18            if( url !== undefined ) {
19                wppb_cpm_open_iframe( url );
20            }
21        }
22    } );
23
24    jQuery( '.menu-item-type-wppb_cpm_login_iframe, .menu-item-type-wppb_cpm_edit_profile_iframe, .menu-item-type-wppb_cpm_register_iframe' ).click( function( e ) {
25        e.preventDefault();
26
27        url = jQuery( this ).children().attr( 'href' );
28
29        if( url !== undefined ) {
30            wppb_cpm_open_iframe( url );
31        }
32    } );
33} );
34
35function wppb_cpm_open_iframe( url ) {
36    var title = wppb_getParameterByName( 'wppb_cpm_iframe_title', url );
37    wppb_cpm_global_height = wppb_getParameterByName( 'wppb_cpm_iframe_height', url );
38    wppb_cpm_global_width = wppb_getParameterByName( 'wppb_cpm_iframe_width', url );
39
40    tb_show( title, url + 'TB_iframe=true&width=' + wppb_cpm_global_width + '&height=' + wppb_cpm_global_height, '' );
41
42    jQuery( '#TB_window').append( '<div id="wppb_cpm_spinner"></div>' );
43
44    wppb_cpm_resize_iframe();
45
46    if( wppb_getMobileOperatingSystem() == 'iOS' ) {
47        jQuery( '#TB_iframeContent' ).wrap( "<div class='wppb_cpm_iframe_wrap'></div>" );
48    }
49
50    jQuery( '#TB_iframeContent' ).load( function() {
51        jQuery( '#wppb_cpm_spinner' ).remove();
52        wppb_cpm_resize_iframe();
53    } );
54}
55
56function wppb_cpm_check_iframe() {
57    var current_url = jQuery( document )[0]['URL'];
58    var iFrame_check = ( window.location != window.parent.location );
59
60    if( iFrame_check ) {
61        if( current_url.indexOf( "wppb_cpm_redirect=yes" ) !== -1 && current_url.indexOf( "wppb_cpm_iframe=yes" ) === -1 ) {
62            window.parent.location.href = current_url;
63            parent.wppb_tb_remove();
64        } else {
65            jQuery( window ).on("unload", function() {
66                if( jQuery( '.wppb-cpm-logged-in' ).length !== 0 && current_url.indexOf( "wppb_cpm_form=login" ) !== -1 ) {
67                    window.parent.location.reload();
68                }
69            } );
70        }
71    }
72
73    removeQueryVariable( 'wppb_cpm_redirect', current_url );
74}
75wppb_cpm_check_iframe();
76
77function removeQueryVariable( variable, current_url ) {
78
79    var url_parts       = current_url.split('?');
80    var urlSearchParams = new URLSearchParams( url_parts[1] );
81
82    if ( urlSearchParams.has( variable ) ){
83        urlSearchParams.delete( variable );
84
85        var url = url_parts[0] + urlSearchParams.toString();
86
87        window.history.replaceState({}, document.title, url);
88    }
89}
90
91// edited tb_remove() function
92function wppb_tb_remove() {
93    jQuery( "#TB_imageOff" ).unbind( "click" );
94    jQuery( "#TB_closeWindowButton" ).unbind( "click" );
95    jQuery( '#TB_window, #TB_overlay, #TB_HideSelect' ).trigger( 'tb_unload' ).unbind().remove();
96    jQuery( 'body' ).removeClass( 'modal-open' );
97    jQuery( "#TB_load" ).remove();
98    if( typeof document.body.style.maxHeight == "undefined" ) { // if IE 6
99        jQuery( "body", "html" ).css( { height: "auto", width: "auto" } );
100        jQuery( "html" ).css( "overflow", "" );
101    }
102    jQuery( document ).unbind( '.thickbox' );
103    return false;
104}
105
106jQuery( window ).resize( function() {
107    if( document.getElementById( 'TB_iframeContent' ) && document.getElementById( 'TB_iframeContent' )['src'].indexOf( "wppb_cpm_iframe=yes" ) !== -1 ) {
108        wppb_cpm_resize_iframe();
109    }
110} );
111
112function wppb_cpm_resize_iframe() {
113    var max_height = wppb_cpm_global_height;
114    var max_width = wppb_cpm_global_width;
115
116    var iframe_max_height = jQuery( window ).height() * 75 / 100;
117    var iframe_max_width = jQuery( window ).width() * 80 / 100;
118
119    var iframe_selector = jQuery( '#TB_iframeContent');
120    var iframe_wrap_selector = jQuery( '.wppb_cpm_iframe_wrap');
121    var tb_window_selector = jQuery( '#TB_window');
122
123    iframe_selector.height( ( iframe_max_height < max_height ? iframe_max_height : max_height ) );
124    iframe_wrap_selector.height( ( iframe_max_height < max_height ? iframe_max_height : max_height ) );
125    tb_window_selector.css( "margin-top", parseInt( "-" + ( iframe_max_height < max_height ? iframe_max_height : max_height ) / 2 ) );
126    tb_window_selector.css( "margin-left", parseInt( "-" + ( iframe_max_width < max_width ? iframe_max_width : max_width ) / 2 ) );
127    iframe_selector.width( ( iframe_max_width < max_width ? iframe_max_width : max_width ) );
128    iframe_wrap_selector.width( ( iframe_max_width < max_width ? iframe_max_width : max_width ) );
129    tb_window_selector.width( ( iframe_max_width < max_width ? iframe_max_width : max_width ) );
130}
131
132/**
133 * Determine the mobile operating system.
134 * This function either returns 'iOS' or 'unknown'
135 *
136 * @returns {String}
137 */
138function wppb_getMobileOperatingSystem() {
139    var userAgent = navigator.userAgent || navigator.vendor || window.opera;
140
141    if( userAgent.match( /iPad/i ) || userAgent.match( /iPhone/i ) || userAgent.match( /iPod/i ) ) {
142        return 'iOS';
143    } else {
144        return 'unknown';
145    }
146}
147
148/**
149 * Get parameters from url (by name)
150 *
151 * @returns {String}
152 */
153function wppb_getParameterByName( name, url ) {
154    name = name.replace( /[\[\]]/g, "\\$&" );
155
156    var regex = new RegExp( "[?&]" + name + "(=([^&#]*)|&|#|$)" ), results = regex.exec( url );
157
158    if( ! results)
159        return null;
160
161    if( ! results[2])
162        return '';
163
164    return decodeURIComponent( results[2].replace( /\+/g, " " ) );
165}

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.