function showModal( ) {
        var modalDom;
        var modalBodyDom;
        var bodyDom = null;
        var saveBtnDom;

        // Set header template.
        var MODAL_BODY_TEMPLATE = [ '<header class="nice-padding hasform">',
                                        '<div class="row">',
                                            '<div class="left">',
                                                '<div class="col">',
                                                    '<h1 class="icon icon-table">Edit Table Cell</h1>',
                                                '</div>',
                                            '</div>',
                                        '</div>',
                                    '</header>',
                                    '<div class="row active nice-padding struct-block object">',
                                        '<input id="table-block-editor" maxlength="255" name="title" type="text">',
                                    '</div></br>',
                                    '<div class="row active nice-padding m-t-10">',
                                        '<button id="table-block-save-btn" type="button" data-dismiss="modal" class="button" >',
                                            '<span class="icon"></span><em>Save</em>',
                                        '</button>',
                                    '</div>' ].join( '' );

        // Set body template.
        var MODAL_TEMPLATE = [ '<div class="table-block-modal fade"',
                               'tabindex="-1" role="dialog" aria-hidden="true">',
                                    '<div class="modal-dialog">',
                                        '<div class="modal-content">',
                                            '<button type="button" class="button close icon text-replace icon-cross"',
                                            'data-dismiss="modal" aria-hidden="true">×</button>',
                                        '<div class="modal-body"></div>',
                                    '</div>',
                                '</div>' ].join( '' );

        modalDom = $( MODAL_TEMPLATE );
        modalBodyDom = modalDom.find( '.modal-body' );
        modalBodyDom.html( MODAL_BODY_TEMPLATE );
        bodyDom = $( 'body' );
        bodyDom.find( '.table-block-modal' ).remove();
        bodyDom.append( modalDom );
        modalDom.modal( 'show' );
        saveBtnDom = modalDom.find( '#table-block-save-btn' );
        saveBtnDom.on( 'click', function( event ) {
            modalDom.trigger( 'save-btn:clicked', event );
        } );

        return modalDom;
    }
/*
     *  showModal
     *
     *  Code copied from
     *  https://github.com/torchbox/wagtail/blob/master/wagtail/wagtailadmin/
     *  static_src/wagtailadmin/js/hallo-bootstrap.js
     *
     *  Create a Wagtail modal using Javascript.
     */


Create a Wagtail modal using Javascript.
Create a Wagtail modal using Javascript .
function showModal( ) {
        var modalDom;
        var modalBodyDom;
        var bodyDom = null;
        var saveBtnDom;
        var MODAL_BODY_TEMPLATE = [ '<header class="nice-padding hasform">',
                                        '<div class="row">',
                                            '<div class="left">',
                                                '<div class="col">',
                                                    '<h1 class="icon icon-table">Edit Table Cell</h1>',
                                                '</div>',
                                            '</div>',
                                        '</div>',
                                    '</header>',
                                    '<div class="row active nice-padding struct-block object">',
                                        '<input id="table-block-editor" maxlength="255" name="title" type="text">',
                                    '</div></br>',
                                    '<div class="row active nice-padding m-t-10">',
                                        '<button id="table-block-save-btn" type="button" data-dismiss="modal" class="button" >',
                                            '<span class="icon"></span><em>Save</em>',
                                        '</button>',
                                    '</div>' ].join( '' );
        var MODAL_TEMPLATE = [ '<div class="table-block-modal fade"',
                               'tabindex="-1" role="dialog" aria-hidden="true">',
                                    '<div class="modal-dialog">',
                                        '<div class="modal-content">',
                                            '<button type="button" class="button close icon text-replace icon-cross"',
                                            'data-dismiss="modal" aria-hidden="true">×</button>',
                                        '<div class="modal-body"></div>',
                                    '</div>',
                                '</div>' ].join( '' );
        modalDom = $( MODAL_TEMPLATE );
        modalBodyDom = modalDom.find( '.modal-body' );
        modalBodyDom.html( MODAL_BODY_TEMPLATE );
        bodyDom = $( 'body' );
        bodyDom.find( '.table-block-modal' ).remove();
        bodyDom.append( modalDom );
        modalDom.modal( 'show' );
        saveBtnDom = modalDom.find( '#table-block-save-btn' );
        saveBtnDom.on( 'click', function( event ) {
            modalDom.trigger( 'save-btn:clicked', event );
        } );
        return modalDom;
    }
function showModal ( ) { var modalDom ; var modalBodyDom ; var bodyDom = null ; var saveBtnDom ; var MODAL_BODY_TEMPLATE = [ '<header class="nice-padding hasform">' , '<div class="row">' , '<div class="left">' , '<div class="col">' , '<h1 class="icon icon-table">Edit Table Cell</h1>' , '</div>' , '</div>' , '</div>' , '</header>' , '<div class="row active nice-padding struct-block object">' , '<input id="table-block-editor" maxlength="255" name="title" type="text">' , '</div></br>' , '<div class="row active nice-padding m-t-10">' , '<button id="table-block-save-btn" type="button" data-dismiss="modal" class="button" >' , '<span class="icon"></span><em>Save</em>' , '</button>' , '</div>' ] . join ( '' ) ; var MODAL_TEMPLATE = [ '<div class="table-block-modal fade"' , 'tabindex="-1" role="dialog" aria-hidden="true">' , '<div class="modal-dialog">' , '<div class="modal-content">' , '<button type="button" class="button close icon text-replace icon-cross"' , 'data-dismiss="modal" aria-hidden="true">×</button>', '<div class="modal-body"></div>' , '</div>' , '</div>' ] . join ( '' ) ; modalDom = $ ( MODAL_TEMPLATE ) ; modalBodyDom = modalDom . find ( '.modal-body' ) ; modalBodyDom . html ( MODAL_BODY_TEMPLATE ) ; bodyDom = $ ( 'body' ) ; bodyDom . find ( '.table-block-modal' ) . remove ( ) ; bodyDom . append ( modalDom ) ; modalDom . modal ( 'show' ) ; saveBtnDom = modalDom . find ( '#table-block-save-btn' ) ; saveBtnDom . on ( 'click' , function ( event ) { modalDom . trigger ( 'save-btn:clicked' , event ) ; } ) ; return modalDom ; }
showModal
  Code copied from
  https://github.com/torchbox/wagtail/blob/master/wagtail/wagtailadmin
  static_src/wagtailadmin/js/hallo-bootstrap.js
showModal Code copied from https : // github . com / torchbox / wagtail / blob / master / wagtail / wagtailadmin static_src / wagtailadmin / js / hallo - bootstrap . js
// Set header template. // Set body template.