• I’m using shortcode [cluevo item=”16″] to show course on pages and it’s all setup to use iframes, yet I get a div with id=”cluevo-module-lightbox-overlay” at the end and it’s messing up with the visuals.

    I am using this css to get rid of it:

    #cluevo-module-lightbox-overlay {
        display: none !important;
    }

    Is there any point in having that visible? Or is there an option I missed?


Viewing 7 replies - 1 through 7 (of 7 total)
  • Plugin Author eliasatcluevo

    (@eliasatcluevo)

    Hi there,

    thank you for reaching out and bringing this to our attention. We will look into it and maybe remove the element in iframe mode.

    Best regards,
    Elias

    Thread Starter AdrianFx

    (@adrianfx)

    In my haste, I didn’t realize that overlay also holds the resume buttons, and now the page goes black and user is stuck. My fix makes it worse.

    So there are two scenarios:
    1. User click “Resume” than overlay remains and user needs to press the X button on overlay… and everything works ok.
    2. User clicks X button on overlay first page goes black and user is stuck without the course visible.

    Last one is impairing the user of using the site.

    Update:
    I’ve compared to older versions and found that cluevo.js line 1208 dialog.on("click", ".cluevo-btn.no" doesn’t call cluevoCloseLightbox(); anymore. I’ve put it back and hid the close button with CSS and seams to be working fine for me. But some logic around that section has changed and might need to be adjusted.

    • This reply was modified 11 months, 2 weeks ago by AdrianFx.
    Plugin Author eliasatcluevo

    (@eliasatcluevo)

    Hi,

    thank you again for this message and your input. We are updating many aspects of our plugin and extensions at the moment and I will make sure that this will be addressed in one of these upcoming updated.

    Best regards,
    Elias

    Thread Starter AdrianFx

    (@adrianfx)

    I’ve just install this on a new site. I made my own “blank” template with the help on 2024 theme and the page contains only the shortcode with id. I’ve added JS to open the page in a custom size popup. And all works except this annoyance that was not resolved.

    When I open the course I get this page, that is normal:

    I click on “Resume” and the buttons go away. I am now left with this blank overlay:

    You can see the course trough the overlay. That is the default Adobe Captivate “play” / start button.

    User has to manually close the blank overlay first in order to continue.

    “New attempt” button works fine.

    • This reply was modified 9 months ago by AdrianFx.
    Thread Starter AdrianFx

    (@adrianfx)

    One more thing I found out. Settings -> Module Settings -> Module attempts -> [Selected] Always start new attempts

    I still got asked if I want to resume.

    Plugin Author eliasatcluevo

    (@eliasatcluevo)

    Hi Adrian,
    is the new blank page you are talking about publicly available, so it would be possible for us to see for ourselves?

    About our 2nd question: Are you logged in as admin when you test the “Always start new attempts” setting? Because admins can always choose to resume or start new. Please test it with a regular user and let me know if that helps.

    Best regards,
    Elias

    Thread Starter AdrianFx

    (@adrianfx)

    Here is my current permanent fix for version 1.12.6 and maybe above. Error or fix is marked in bold on cluevo-mod.js file. You might need to review the code there, see conclusions at the bottom.

    1. First I’ve added In theme functions.php this code:
    // Conditional enqueueing of modified script and its dependencies
    function enqueue_mod_script_conditionally() {
        // Check if either 'cluevo-scorm' or 'cluevo' plugin script is enqueued
        if ( wp_script_is( 'cluevo-scorm', 'enqueued' ) || is_plugin_active( 'cluevo-lms/cluevo-lms.php' ) ) {
            // Enqueue cluevo-scorm-wrapper if it's not already enqueued
            if ( ! wp_script_is( 'cluevo-scorm-wrapper', 'enqueued' ) ) {
                wp_enqueue_script( 'cluevo-scorm-wrapper' );
            }
            
            // Enqueue cluevo-scorm if it's not already enqueued
            if ( ! wp_script_is( 'cluevo-scorm', 'enqueued' ) ) {
                wp_enqueue_script( 'cluevo-scorm' );
            }
            
            // Enqueue your modified script
            wp_enqueue_script( 'cluevo-mod-script', get_stylesheet_directory_uri() . '/assets/javascript/cluevo-mod.js' , array( 'cluevo-scorm' ), '1.0.0', true);
        }
    }
    add_action( 'wp_enqueue_scripts', 'enqueue_mod_script_conditionally', 999 ); // Use a high priority to ensure it runs late
    

    2. Made file in theme /assets/javascript/cluevo-mod.js below:

    // Wrap the original function
    (function() {
        var originalShowResumePrompt = showResumePrompt;
    
        // Redefine the showResumePrompt function with your fix
        showResumePrompt = async function(itemId, data, callback) {
            // Your fixed implementation here
    
            cluevoRemoveTileOverlays();
            var el =
            '<div class="cluevo-module-tile-overlay"><h2>' +
            cluevoStrings.start_over_dialog_header +
            '</h2><div class="cluevo-prompt-btns-container"><div class="cluevo-btn yes">' +
            cluevoStrings.start_over_opt_reset +
            '</div><div class="cluevo-btn no">' +
            cluevoStrings.start_over_opt_resume +
            "</div></div></div>";
            var dialog = jQuery(el);
            var needLightbox =
            jQuery(
                '.cluevo-content-item-link[data-item-id="' +
                itemId +
                '"] .cluevo-post-thumb:first'
                ).length === 0;
            dialog.on("click", ".cluevo-btn.yes", async function() {
                cluevoShowLightboxSpinner();
                var url =
                cluevoWpApiSettings.root + "cluevo/v1/modules/" + itemId + "/new-attempt";
                await jQuery.ajax({
                    url: url,
                    method: "GET",
                    contentType: "application/json",
                    dataType: "json",
                    beforeSend: function(xhr) {
                        xhr.setRequestHeader("X-WP-Nonce", cluevoWpApiSettings.nonce);
                    },
                    success: function(response) {
                        jQuery(dialog).remove();
                        if (needLightbox) {
                            cluevoCloseLightbox();
                        }
                        callback(true, response);
                    },
                });
            });
            dialog.on("click", ".cluevo-btn.no", function(e) {
                e.stopPropagation();
                e.preventDefault();
                jQuery(dialog).remove();
    /******** the actual fix - next 3 lines *******/
                if (needLightbox) {
                    cluevoCloseLightbox();
                }
                callback(false);
            });
            dialog.on("click", ".cluevo-btn:not(.no)", function(e) {
                e.stopPropagation();
                e.preventDefault();
                jQuery(dialog).remove();
    /******** nonsense maybe *******/
                if (!needLightbox) {
                    cluevoCloseLightbox();
                }
            });
            if (!needLightbox) {
                jQuery(
                    '.cluevo-content-item-link[data-item-id="' +
                    itemId +
                    '"] .cluevo-post-thumb:first'
                    ).append(dialog);
            } else {
                cluevoOpenLightbox(null, "", dialog);
                cluevoShowLightbox();
            }
            jQuery(dialog).fadeIn();
        }
    })();

    Conclusion:
    1. “.cluevo-btn.no” does not have a lightbox close logic similar to “.cluevo-btn.yes”
    2. “.cluevo-btn:not(.no)” => “.cluevo-btn.yes” OR “.cluevo-btn.cluevo-close-button” – you have specific logic for “.yes”, and no logic or function for close button, but if lighbox was not needed you close it anyway.
    3. script “cluevo-scorm” requires “cluevo-scorm-wrapper” – it’s a small thing but I couldn’t add my mod without fixing the enqueue order. ChatGPT helped to write the code and enqueue my mod.

    You may close the issue after reading it. But I hope you will fix it, if not it may serve the next person with this issue.

Viewing 7 replies - 1 through 7 (of 7 total)
  • The topic ‘Lightbox overs on iframe.’ is closed to new replies.