at path:
ROOT
/
wp-content
/
plugins
/
meta-box
/
js
/
modal.js
run:
R
W
Run
block-editor
DIR
2026-03-30 21:13:33
R
W
Run
jqueryui
DIR
2026-03-30 21:13:33
R
W
Run
leaflet
DIR
2026-03-30 21:13:33
R
W
Run
select2
DIR
2026-03-30 21:13:33
R
W
Run
validation
DIR
2026-03-30 21:13:33
R
W
Run
wp-color-picker-alpha
DIR
2026-03-30 21:13:33
R
W
Run
autocomplete.js
1.62 KB
2019-08-29 08:43:46
R
W
Run
Delete
Rename
autosave.js
595 By
2018-09-08 07:29:32
R
W
Run
Delete
Rename
button-group.js
1018 By
2022-12-06 12:16:48
R
W
Run
Delete
Rename
clone.js
9.19 KB
2025-11-05 19:50:18
R
W
Run
Delete
Rename
color.js
1.33 KB
2023-03-21 05:35:52
R
W
Run
Delete
Rename
date.js
2.47 KB
2025-01-11 08:07:14
R
W
Run
Delete
Rename
datetime.js
2.87 KB
2025-01-11 08:07:14
R
W
Run
Delete
Rename
file-input.js
1.87 KB
2022-03-01 14:16:10
R
W
Run
Delete
Rename
file-upload.js
5.49 KB
2025-08-13 13:15:06
R
W
Run
Delete
Rename
file.js
3.88 KB
2023-01-29 07:00:16
R
W
Run
Delete
Rename
icon.js
795 By
2026-03-05 12:31:14
R
W
Run
Delete
Rename
image-advanced.js
2.22 KB
2025-08-13 13:15:06
R
W
Run
Delete
Rename
image-upload.js
1.09 KB
2025-08-13 13:15:06
R
W
Run
Delete
Rename
input-list.js
1.07 KB
2024-06-20 07:56:06
R
W
Run
Delete
Rename
map-frontend.js
2.01 KB
2025-08-13 13:15:06
R
W
Run
Delete
Rename
map.js
8.63 KB
2025-10-06 11:05:52
R
W
Run
Delete
Rename
media.js
17.87 KB
2025-08-13 13:15:06
R
W
Run
Delete
Rename
modal.js
4.12 KB
2024-07-02 05:43:22
R
W
Run
Delete
Rename
oembed.js
880 By
2023-08-10 18:36:10
R
W
Run
Delete
Rename
osm-frontend.js
1.23 KB
2025-08-13 13:15:06
R
W
Run
Delete
Rename
osm.js
7.84 KB
2025-10-06 11:05:52
R
W
Run
Delete
Rename
password.js
672 By
2025-05-21 12:41:30
R
W
Run
Delete
Rename
post.js
1.23 KB
2024-06-20 07:56:06
R
W
Run
Delete
Rename
range.js
475 By
2024-09-27 11:22:22
R
W
Run
Delete
Rename
script.js
751 By
2022-12-13 11:10:44
R
W
Run
Delete
Rename
select-advanced.js
3.67 KB
2025-08-13 13:15:06
R
W
Run
Delete
Rename
select-tree.js
1.62 KB
2021-06-01 12:45:46
R
W
Run
Delete
Rename
select.js
536 By
2023-05-23 08:06:40
R
W
Run
Delete
Rename
slider.js
922 By
2020-04-17 08:24:00
R
W
Run
Delete
Rename
taxonomy.js
1.21 KB
2024-06-20 07:56:06
R
W
Run
Delete
Rename
time.js
1.5 KB
2026-03-05 12:31:14
R
W
Run
Delete
Rename
user.js
1.43 KB
2024-06-20 07:56:06
R
W
Run
Delete
Rename
video.js
2.73 KB
2025-08-13 13:15:06
R
W
Run
Delete
Rename
wysiwyg.js
5.36 KB
2023-07-18 06:41:26
R
W
Run
Delete
Rename
error_log
up
📄
modal.js
Save
( $ => { 'use strict'; const $body = $( 'body' ); const defaultOptions = { wrapper: `<div class="rwmb-modal"> <header class="rwmb-modal-title"> <h2></h2> <button type="button" class="rwmb-modal-close">×</button> </header> <div class="rwmb-modal-content"></div> </div>`, markupIframe: '<iframe id="rwmb-modal-iframe" width="100%" height="700" src="{URL}" border="0"></iframe>', markupOverlay: '<div class="rwmb-modal-overlay"></div>', hideElement: '', hideElementDefault: '#adminmenumain, #wpadminbar, #wpfooter, .row-actions, .form-wrap.edit-term-notes, #screen-meta-links, .wp-heading-inline, .wp-header-end, .page-title-action', callback: null, closeModalCallback: null, isBlockEditor: false, $objectId: null, $objectDisplay: null, isEdit: false, size: 'large', }; $.fn.rwmbModal = function ( options = {} ) { options = { ...defaultOptions, ...options }; if ( $( '.rwmb-modal' ).length === 0 ) { return; } // $this is the button that opens the modal const $this = $( this ), $modal = $( '.rwmb-modal' ); let $input = $this.closest( '.rwmb-input' ); if ( $input.find( '.rwmb-clone' ).length > 0 && $this.closest( '.rwmb-clone' ).length > 0 ) { $input = $this.closest( '.rwmb-clone' ); } $this.click( function ( e ) { e.preventDefault(); $modal.attr( 'size', options.size ); $modal.find( '.rwmb-modal-title h2' ).html( $this.html() ); $modal.find( '.rwmb-modal-content' ).html( options.markupIframe.replace( '{URL}', $this.attr( 'data-url' ) ) ); $( '#rwmb-modal-iframe' ).on( 'load', function () { const $contents = $( this ).contents(); options.isBlockEditor = $contents.find( 'body' ).hasClass( 'block-editor-page' ); $contents.find( options.hideElement ).hide(); $modal.find( '.rwmb-modal-title' ).css( 'background-color', '' ); if ( options.isBlockEditor ) { $modal.find( '.rwmb-modal-title' ).css( 'background-color', '#fff' ); } $contents .find( options.hideElementDefault ).hide().end() .find( '.rwmb-modal-add-button' ).parents('.rwmb-field').hide(); $contents.find( 'html' ).css( 'padding-top', 0 ).end() .find( '#wpcontent' ).css( 'margin-left', 0 ).end() .find( 'a' ).on( 'click', e => e.preventDefault() ); if ( options.callback !== null && typeof options.callback === 'function' ) { options.callback( $modal, $contents ); } $body.addClass( 'rwmb-modal-show' ); $( '.rwmb-modal-overlay' ).fadeIn( 'medium' ).css( 'display', 'flex' ); $modal.fadeIn( 'medium' ).css( 'display', 'flex' ); return false; } ); $( '.rwmb-modal-close' ).on( 'click', function ( event ) { if ( options.closeModalCallback !== null && typeof options.closeModalCallback === 'function' ) { options.closeModalCallback( $( '#rwmb-modal-iframe' ).contents(), $input ); } $modal.fadeOut( 'medium' ); $( '.rwmb-modal-overlay' ).fadeOut( 'medium' ); $body.removeClass( 'rwmb-modal-show' ); // If not add new if ( !options.$objectId || !options.$objectDisplay ) { $( this ).off( event ); return; } // Select, select advanced, select tree. const $select = $input.find( 'select' ); if ( $select.length > 0 ) { $select.prepend( $( '<option>', { value: options.$objectId, text: options.$objectDisplay, selected: true } ) ); $( this ).off( event ); return; } // Radio, checkbox list, checkbox tree const $inputList = $input.find( '.rwmb-input-list:first' ), $labelClone = $inputList.find( '> label:first' ).clone(), $inputClone = $labelClone.find( 'input' ).clone(); $labelClone.html( $inputClone.val( options.$objectId ) .attr( 'checked', true ) .prop( 'outerHTML' ) + options.$objectDisplay ); $inputList.prepend( $labelClone ); // Clear event after close modal. options.$objectId = null; options.$objectDisplay = null; $( this ).off( event ); }); } ); }; if ( $( '.rwmb-modal' ).length === 0 ) { $body.append( defaultOptions.wrapper ) .append( defaultOptions.markupOverlay ); } } )( jQuery );