MMCT TEAM
Server IP : 111.118.215.189  /  Your IP : 216.73.216.172
Web Server : Apache
System : Linux md-in-83.webhostbox.net 4.19.286-203.ELK.el7.x86_64 #1 SMP Wed Jun 14 04:33:55 CDT 2023 x86_64
User : a1673wkz ( 2475)
PHP Version : 8.2.25
Disable Function : NONE
MySQL : OFF  |  cURL : ON  |  WGET : ON  |  Perl : ON  |  Python : ON
Directory (0755) :  /proc/thread-self/root/opt/wp/plugins/wpforms-lite/assets/js/

[  Home  ][  C0mmand  ][  Upload File  ]

Current File : //proc/thread-self/root/opt/wp/plugins/wpforms-lite/assets/js/admin-editor.js
;(function($){
	$(function(){
		// Close modal
		var wpformsModalClose = function() {
			if ( $('#wpforms-modal-select-form').length ) {
				$('#wpforms-modal-select-form').get(0).selectedIndex = 0;
				$('#wpforms-modal-checkbox-title, #wpforms-modal-checkbox-description').prop('checked', false);
			}
			$('#wpforms-modal-backdrop, #wpforms-modal-wrap').css('display','none');
			$( document.body ).removeClass( 'modal-open' );
		};
		// Open modal when media button is clicked
		$(document).on('click', '.wpforms-insert-form-button', function(event) {
			event.preventDefault();
			$('#wpforms-modal-backdrop, #wpforms-modal-wrap').css('display','block');
			$( document.body ).addClass( 'modal-open' );
		});
		// Close modal on close or cancel links
		$(document).on('click', '#wpforms-modal-close, #wpforms-modal-cancel a', function(event) {
			event.preventDefault();
			wpformsModalClose();
		});
		// Insert shortcode into TinyMCE
		$(document).on('click', '#wpforms-modal-submit', function(event) {
			event.preventDefault();
			var shortcode;
			shortcode = '[wpforms id="' + $('#wpforms-modal-select-form').val() + '"';
			if ( $('#wpforms-modal-checkbox-title').is(':checked') ) {
				shortcode = shortcode+' title="true"';
			}
			if ( $('#wpforms-modal-checkbox-description').is(':checked') ) {
				shortcode = shortcode+' description="true"';
			}
			shortcode = shortcode+']';
			wp.media.editor.insert(shortcode);
			wpformsModalClose();
		});
	});
}(jQuery));

MMCT - 2023