chunks
1 week ago
vendor
8 months ago
admin.build.js
1 week ago
admin.js
2 months ago
analytics-tracker.js
3 weeks ago
analytics.build.js
1 week ago
blocks.build.js
1 week ago
carousel.js
1 year ago
custom-player.build.js
1 week ago
documents-viewer-script.js
2 months ago
ep-pdf-lightbox.js
2 months ago
ep-view-count.js
1 week ago
ep-yt-queue.js
3 weeks ago
feature-notices.js
7 months ago
front.js
3 weeks ago
frontend.build.js
2 months ago
gallery-justify.js
1 week ago
gutneberg-script.js
1 month ago
index.html
7 years ago
initCarousel.js
2 years ago
initplyr.js
1 month ago
instafeed.js
3 weeks ago
instagram-shortcode-generator.js
1 month ago
lazy-load.js
6 months ago
license.js
3 months ago
meetup-timezone.js
2 months ago
onboarding.build.js
1 week ago
pdf-gallery-elementor-editor.js
2 months ago
pdf-gallery.js
2 months ago
preview.js
8 months ago
settings.js
2 months ago
sponsored.js
9 months ago
admin.js
167 lines
| 1 | /** |
| 2 | * @package EmbedPress |
| 3 | * @author EmbedPress <help@embedpress.com> |
| 4 | * @copyright Copyright (C) 2018 EmbedPress. All rights reserved. |
| 5 | * @license GPLv2 or later |
| 6 | * @since 1.7.0 |
| 7 | */ |
| 8 | (function ($) { |
| 9 | 'use strict'; |
| 10 | |
| 11 | var __ = wp.i18n.__; |
| 12 | $(document).on('click', '.embedpress-plugin-notice-dismissible.is-dismissible', function () { |
| 13 | var data = { |
| 14 | action: 'embedpress_notice_dismiss', |
| 15 | security: EMBEDPRESS_ADMIN_PARAMS.nonce, |
| 16 | }; |
| 17 | |
| 18 | $.post(EMBEDPRESS_ADMIN_PARAMS.ajaxurl, data, function () { |
| 19 | |
| 20 | }); |
| 21 | }); |
| 22 | |
| 23 | |
| 24 | })(jQuery); |
| 25 | |
| 26 | |
| 27 | |
| 28 | |
| 29 | // leon js |
| 30 | |
| 31 | const rengeControls = document.querySelectorAll('.range-control'); |
| 32 | const adToggleSwitch = document.querySelector('.sponsored-active_btn'); |
| 33 | const videoBtn = document.querySelector('.btn-video'); |
| 34 | const imgBtn = document.querySelector('.btn-img'); |
| 35 | const videoBtnBody = document.querySelector('.video-body'); |
| 36 | const imgBtnBody = document.querySelector('.img-body'); |
| 37 | const videoPlayBtn = document.querySelector('.video-play_btn'); |
| 38 | const videoPopPup = document.querySelector('.popup-video-wrap'); |
| 39 | const closePopPup = document.querySelector('.close-video_btn'); |
| 40 | const slideLink = document.querySelector('.sponsored-floating_quick-links_wrapper'); |
| 41 | const floatingQuckLinks = document.querySelector('.sponsored-floating_quick-links'); |
| 42 | const activeIcon = document.querySelector('.active-icon'); |
| 43 | const closeIcon = document.querySelector('.close-icon'); |
| 44 | |
| 45 | rengeControls?.forEach((rangeControl) => { |
| 46 | const minus = rangeControl.querySelector('.range_negative'); |
| 47 | const plus = rangeControl.querySelector('.range_positive'); |
| 48 | const input = rangeControl.querySelector('.range__value'); |
| 49 | |
| 50 | |
| 51 | minus.addEventListener('click', function () { |
| 52 | let v = parseInt(input.value); |
| 53 | |
| 54 | if (v > 0) { |
| 55 | input.value = v - 1; |
| 56 | } |
| 57 | }) |
| 58 | |
| 59 | plus.addEventListener('click', function () { |
| 60 | input.value = parseInt(input.value) + 1; |
| 61 | }) |
| 62 | }) |
| 63 | |
| 64 | videoBtn?.addEventListener('click', function () { |
| 65 | |
| 66 | if (adToggleSwitch) { |
| 67 | this.classList.add('sponsored-active_btn'); |
| 68 | imgBtn.classList.remove('sponsored-active_btn'); |
| 69 | videoBtnBody.classList.add('toggle-active'); |
| 70 | imgBtnBody.classList.remove('toggle-active'); |
| 71 | } |
| 72 | }); |
| 73 | |
| 74 | imgBtn?.addEventListener('click', function () { |
| 75 | if (adToggleSwitch) { |
| 76 | this.classList.add('sponsored-active_btn'); |
| 77 | videoBtn.classList.remove('sponsored-active_btn'); |
| 78 | imgBtnBody.classList.add('toggle-active'); |
| 79 | videoBtnBody.classList.remove('toggle-active'); |
| 80 | |
| 81 | } |
| 82 | }); |
| 83 | |
| 84 | videoPlayBtn?.addEventListener('click', function () { |
| 85 | videoPopPup.classList.add('popup-active'); |
| 86 | }) |
| 87 | |
| 88 | closePopPup?.addEventListener('click', function () { |
| 89 | videoPopPup.classList.remove('popup-active'); |
| 90 | }) |
| 91 | |
| 92 | activeIcon?.addEventListener('click', function(){ |
| 93 | slideLink.classList.add('sponsored-link_active'); |
| 94 | this.classList.remove('sponsored-link_active'); |
| 95 | closeIcon.classList.add('sponsored-link_active') |
| 96 | }) |
| 97 | closeIcon?.addEventListener('click', function(){ |
| 98 | slideLink.classList.remove('sponsored-link_active'); |
| 99 | this.classList.remove('sponsored-link_active'); |
| 100 | activeIcon.classList.add('sponsored-link_active') |
| 101 | }) |
| 102 | floatingQuckLinks?.addEventListener('click', function(){ |
| 103 | slideLink.classList.remove('sponsored-link_active'); |
| 104 | activeIcon.classList.add('sponsored-link_active'); |
| 105 | closeIcon.classList.remove('sponsored-link_active') |
| 106 | }) |
| 107 | |
| 108 | // Introduction Tab Functionality |
| 109 | document.addEventListener('DOMContentLoaded', function() { |
| 110 | const tabButtons = document.querySelectorAll('.embedpress-intro-tab-btn'); |
| 111 | const tabPanels = document.querySelectorAll('.embedpress-intro-tab-panel'); |
| 112 | |
| 113 | tabButtons.forEach(function(button) { |
| 114 | button.addEventListener('click', function() { |
| 115 | const targetTab = this.getAttribute('data-tab'); |
| 116 | |
| 117 | // Remove active class from all buttons and panels |
| 118 | tabButtons.forEach(function(btn) { |
| 119 | btn.classList.remove('active'); |
| 120 | }); |
| 121 | tabPanels.forEach(function(panel) { |
| 122 | panel.classList.remove('active'); |
| 123 | }); |
| 124 | |
| 125 | // Add active class to clicked button |
| 126 | this.classList.add('active'); |
| 127 | |
| 128 | // Show corresponding panel |
| 129 | const targetPanel = document.getElementById(targetTab + '-tab'); |
| 130 | if (targetPanel) { |
| 131 | targetPanel.classList.add('active'); |
| 132 | } |
| 133 | }); |
| 134 | }); |
| 135 | |
| 136 | // Video Popup Functionality |
| 137 | var videoTrigger = document.querySelector('.embedpress-video-trigger'); |
| 138 | var videoOverlay = document.querySelector('.embedpress-video-popup-overlay'); |
| 139 | |
| 140 | if (videoTrigger && videoOverlay) { |
| 141 | var videoIframe = videoOverlay.querySelector('iframe'); |
| 142 | var videoClose = videoOverlay.querySelector('.embedpress-video-popup-close'); |
| 143 | var videoUrl = videoTrigger.getAttribute('data-video-url'); |
| 144 | |
| 145 | videoTrigger.addEventListener('click', function () { |
| 146 | videoIframe.setAttribute('src', videoUrl); |
| 147 | videoOverlay.style.display = 'flex'; |
| 148 | }); |
| 149 | |
| 150 | videoClose.addEventListener('click', function () { |
| 151 | videoOverlay.style.display = 'none'; |
| 152 | videoIframe.setAttribute('src', ''); |
| 153 | }); |
| 154 | |
| 155 | videoOverlay.addEventListener('click', function (e) { |
| 156 | if (e.target === videoOverlay) { |
| 157 | videoOverlay.style.display = 'none'; |
| 158 | videoIframe.setAttribute('src', ''); |
| 159 | } |
| 160 | }); |
| 161 | } |
| 162 | }); |
| 163 | |
| 164 | |
| 165 | |
| 166 | |
| 167 |