• Resolved Howdy_McGee

    (@howdy_mcgee)


    Hello,

    I’m working with a client who has bought a premium version of this plugin. They are looking to connect the WordPress search to the Flipbook search through customizations. I’m fairly certain I can get the search to land onto a specific page with the Flipbook but getting the query var to connect to the Flipbook JS seems like it might be an issue. It’s difficult to tell with the JS being minified.

    1) Is there an unminifed version of the scripts?

    2) Would it be possible through customizations to link the WordPress search with a Flipbook search?

    3) Does the Flipbook search script look for any specific URL query vars we may be able to use?

Viewing 2 replies - 1 through 2 (of 2 total)
  • Plugin Author iberezansky

    (@iberezansky)

    hi,

    1) yes, pro version has unpacked version, also it has project files.
    2) actually you do not need to change the script, you can use the book ready function for this.
    3) no.

    Thread Starter Howdy_McGee

    (@howdy_mcgee)

    @iberezansky

    Thanks for the reply! Could you elaborate on the book-ready function, please?

    At the end of the day I did end up using a custom script to pull in the search value. I’m open to better or easier ways to do so. Here’s what I ended up using:

    $( window ).on( 'load', function() {
    
    	/* Used to differentiate between initial WordPress search and User Input Book Search */
    	let searchTriggered = false;
    	let $iframe = $( '._3d-flip-book iframe' ).contents();
    	
    	/* Custom function to get specific URL parameter. */
    	let search = getUrlParameter( 'search' );
    
    	$iframe.on( 'DOMNodeInserted', function( e ) {
    
    		if( searchTriggered ) {
    			return;
    		}
    
    		/* iFrame Loaded */
    		if( e.target.classList.contains( 'bookmarks' ) ) {
    
    			$iframe.find( '[type="search"]' ).val( search );
    			$iframe.find( '[type="search"]' ).trigger( 'keyup' );
    			$iframe.find( '[type="search"]' ).trigger( 'keypress' );
    
    		}
    
    		/* Search got a hit - trigger a click to that specific page */
    		if( e.target.classList.contains( 'result' ) ) {
    			searchTriggered = true;
    			$( 'a', e.target ).trigger( 'click' );
    		}
    		
    	} );
    } );
Viewing 2 replies - 1 through 2 (of 2 total)
  • The topic ‘Connect WordPress Search with FlipBook Search’ is closed to new replies.