You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

23 lines
751 B

9 months ago
// Global object for shared functions and data.
window.rwmb = window.rwmb || {};
( function( $, document, rwmb ) {
'use strict';
// Selectors for all plugin inputs.
rwmb.inputSelectors = 'input[class*="rwmb"], textarea[class*="rwmb"], select[class*="rwmb"], button[class*="rwmb"]';
// Detect Gutenberg.
rwmb.isGutenberg = document.body.classList.contains( 'block-editor-page' );
// Generate unique ID.
rwmb.uniqid = () => Math.random().toString( 36 ).substr( 2 );
// Trigger a custom ready event for all scripts to hook to.
// Used for static DOM and dynamic DOM (loaded in MB Blocks extension for Gutenberg).
rwmb.$document = $( document );
$( function() {
rwmb.$document.trigger( 'mb_ready' );
} );
} )( jQuery, document, rwmb );