function addFlipbookStyle() { if (!document.getElementById('flipbookStyleSheet')) { const flipbookStyleSheet = document.createElement('link'); flipbookStyleSheet.href = 'https://katalog.buecherbaukasten.de/wp-content/plugins/dflip/assets/css/dflip.min.css?ver=2.0.65'; flipbookStyleSheet.rel = 'stylesheet'; flipbookStyleSheet.media = 'all'; flipbookStyleSheet.id = 'flipbookStyleSheet'; // Append the link element to the head section of the HTML document document.head.appendChild(flipbookStyleSheet); } } // Create script element for dflip shortcode function addFlipbookConfigs() { const dflipShortcodeScript = document.createElement('script'); dflipShortcodeScript.type = 'application/javascript'; dflipShortcodeScript.innerHTML = `window.option_df_109 = { outline: [], forceFit: 'true', autoEnableOutline: 'false', autoEnableThumbnail: 'false', overwritePDFOutline: 'false', direction: '1', pageSize: '0', source: 'https://katalog.buecherbaukasten.de/wp-content/uploads/2024/09/Findus-LGB-H24.pdf', wpOptions: 'true', }; if (window.DFLIP && window.DFLIP.parseBooks) { window.DFLIP.parseBooks(); }`; // Append the script element to the body section of the HTML document document.body.appendChild(dflipShortcodeScript); } // Create script element for jQuery function addFlipbookJQuery() { if (!window.jQuery) { const jqueryScript = document.createElement('script'); jqueryScript.src = 'https://code.jquery.com/jquery-3.6.4.min.js'; // 'https://katalog.buecherbaukasten.de/wp-includes/js/jquery/jquery.min.js?ver=3.6.3'; jqueryScript.id = 'dflip-jquery-js'; // Append the script element to the body section of the HTML document document.body.appendChild(jqueryScript); } } function addFlipbookScript() { if (window.jQuery) { // Create script element for dflip const dflipScript = document.createElement('script'); dflipScript.src = 'https://katalog.buecherbaukasten.de/wp-content/plugins/dflip/assets/js/dflip.min.js?ver=2.0.65'; dflipScript.id = 'dflip-script-js'; // Append the script element to the body section of the HTML document document.body.appendChild(dflipScript); } else { var dflipjQeury = document.getElementById('dflip-jquery-js'); if (dflipjQeury) { dflipjQeury.addEventListener('load', () => { // Create script element for dflip const dflipScript = document.createElement('script'); dflipScript.src = 'https://katalog.buecherbaukasten.de/wp-content/plugins/dflip/assets/js/dflip.min.js?ver=2.0.65'; dflipScript.id = 'dflip-script-js'; // Append the script element to the body section of the HTML document document.body.appendChild(dflipScript); }); } } } function addFlipBookDiv() { const div = document.createElement('div'); div.classList.add('_df_thumb'); div.id = 'df_109'; div.dataset.title = 'Findus Buchhandlung H24'; div.setAttribute('_slug', '109'); div.setAttribute('wpoptions', 'true'); div.setAttribute('thumb', 'https://katalog.buecherbaukasten.de/wp-content/uploads/2024/09/Findus-LGB-H24.png'); div.setAttribute('thumbtype', 'bg'); div.innerHTML = 'Findus Buchhandlung H24'; // Get the script tag element const scriptTag = document.currentScript; // Add the div before the script element scriptTag.parentNode.insertBefore(div, scriptTag.nextSibling); } addFlipbookStyle(); addFlipbookConfigs(); addFlipbookJQuery(); addFlipbookScript(); addFlipBookDiv();