Edit File by line
/home/zeestwma/richards.../wp-conte.../plugins/wpforms-.../assets/js/admin
File: admin-editor.js
;( function( $ ) {
[0] Fix | Delete
[1] Fix | Delete
$( function() {
[2] Fix | Delete
[3] Fix | Delete
// Close modal.
[4] Fix | Delete
var wpformsModalClose = function() {
[5] Fix | Delete
[6] Fix | Delete
if ( $( '#wpforms-modal-select-form' ).length ) {
[7] Fix | Delete
$( '#wpforms-modal-select-form' ).get( 0 ).selectedIndex = 0;
[8] Fix | Delete
$( '#wpforms-modal-checkbox-title, #wpforms-modal-checkbox-description' ).prop( 'checked', false );
[9] Fix | Delete
}
[10] Fix | Delete
[11] Fix | Delete
$( '#wpforms-modal-backdrop, #wpforms-modal-wrap' ).css( 'display', 'none' );
[12] Fix | Delete
$( document.body ).removeClass( 'modal-open' );
[13] Fix | Delete
};
[14] Fix | Delete
[15] Fix | Delete
// Open modal when media button is clicked.
[16] Fix | Delete
$( document ).on( 'click', '.wpforms-insert-form-button', function( event ) {
[17] Fix | Delete
[18] Fix | Delete
event.preventDefault();
[19] Fix | Delete
$( '#wpforms-modal-backdrop, #wpforms-modal-wrap' ).css( 'display', 'block' );
[20] Fix | Delete
$( document.body ).addClass( 'modal-open' );
[21] Fix | Delete
} );
[22] Fix | Delete
[23] Fix | Delete
// Close modal on close or cancel links.
[24] Fix | Delete
$( document ).on( 'click', '#wpforms-modal-close, #wpforms-modal-cancel a', function( event ) {
[25] Fix | Delete
[26] Fix | Delete
event.preventDefault();
[27] Fix | Delete
wpformsModalClose();
[28] Fix | Delete
} );
[29] Fix | Delete
[30] Fix | Delete
// Insert shortcode into TinyMCE.
[31] Fix | Delete
$( document ).on( 'click', '#wpforms-modal-submit', function( event ) {
[32] Fix | Delete
[33] Fix | Delete
event.preventDefault();
[34] Fix | Delete
[35] Fix | Delete
var shortcode;
[36] Fix | Delete
[37] Fix | Delete
shortcode = '[wpforms id="' + $( '#wpforms-modal-select-form' ).val() + '"';
[38] Fix | Delete
[39] Fix | Delete
if ( $( '#wpforms-modal-checkbox-title' ).is( ':checked' ) ) {
[40] Fix | Delete
shortcode = shortcode + ' title="true"';
[41] Fix | Delete
}
[42] Fix | Delete
[43] Fix | Delete
if ( $( '#wpforms-modal-checkbox-description' ).is( ':checked' ) ) {
[44] Fix | Delete
shortcode = shortcode + ' description="true"';
[45] Fix | Delete
}
[46] Fix | Delete
[47] Fix | Delete
shortcode = shortcode + ']';
[48] Fix | Delete
[49] Fix | Delete
wp.media.editor.insert( shortcode );
[50] Fix | Delete
wpformsModalClose();
[51] Fix | Delete
} );
[52] Fix | Delete
[53] Fix | Delete
} );
[54] Fix | Delete
[55] Fix | Delete
}( jQuery ) );
[56] Fix | Delete
[57] Fix | Delete
It is recommended that you Edit text format, this type of Fix handles quite a lot in one request
Function