HEX
Server: Apache
System: Linux pdx1-shared-a1-38 6.6.104-grsec-jammy+ #3 SMP Tue Sep 16 00:28:11 UTC 2025 x86_64
User: mmickelson (3396398)
PHP: 8.1.31
Disabled: NONE
Upload Files
File: /home/mmickelson/martyknows.com/wp-content/plugins/enhanced-media-library/js/eml-admin.js
window.eml = window.eml || { l10n: {} };


( function( $ ) {

    _.extend( eml.l10n, wpuxss_eml_admin_l10n );




    var w;


    if ( 'settings_page_media' == window.adminpage )
        window.adminpage = 'options-media-php';
    if ( 'settings_page_media' == window.pagenow )
        window.pagenow = 'options-media';


    if ( $(window).width() < 600 )
        w = '90%';
    else if ( $(window).width() > 1024 )
        w = '500';
    else
        w = '50%';


    window.emlConfirmDialog = function( title, html, yes, no, yesClass ) {

        var def = $.Deferred(),

            confirmdialog = $('<div id="eml-dialog-modal"></div>').appendTo('body')
            .html( html )
            .dialog({
                dialogClass : 'eml-dialog-modal',
                modal       : true,
                resizable   : false,
                width       : w,
                autoOpen    : false,
                title       : title,
                buttons     : [
                    {
                        'text'  : yes,
                        'class' : yesClass,
                        'click' : function() {
                            $(this).dialog( 'close' );
                            def.resolve();
                        }
                    },
                    {
                        'text'  : no,
                        'click': function() {
                            $(this).dialog( 'close' );
                            def.reject();
                        }
                    }
                ],
                close: function() {
                    $(this).remove();
                }
            });

        confirmdialog.dialog('open');

        return def.promise();
    }


    window.emlAlertDialog = function( title, html, yes, yesClass ) {

        var def = $.Deferred(),

            alertdialog = $('<div id="eml-dialog-modal"></div>').appendTo('body')
            .html( html )
            .dialog({
                dialogClass : 'eml-dialog-modal',
                modal       : true,
                resizable   : false,
                width       : w,
                autoOpen    : false,
                title       : title,
                buttons     : [
                    {
                        'text'  : yes,
                        'class' : yesClass,
                        'click' : function() {
                            $(this).dialog( 'close' );
                            def.resolve();
                        }
                    }
                ],
                close: function() {
                    $(this).remove();
                }
            });

        alertdialog.dialog('open');

        return def.promise();
    }


    window.emlFullscreenSpinnerStart = function( text ) {
        $('body').append( '<div class="fullscreen-spinner-box"><div class="fullscreen-spinner-inner-box"><span class="eml-spinner">'+text+'</span></div></div>' );
    }


    window.emlFullscreenSpinnerStop = function() {
        $('.fullscreen-spinner-box').remove();
    }

    $( document ).on( 'click', '.eml-admin-notice .notice-dismiss', function( event ) {

        var notice_id = $( event.currentTarget ).parent('.eml-admin-notice').attr('id');

        $.post( ajaxurl, {
            nonce:     eml.l10n.admin_notice_nonce,
            action:    'eml-admin-notice-dismiss',
            notice_id: notice_id
        });        
    });

})( jQuery );