Loading config/install/modal_page.settings.yml +1 −0 Original line number Diff line number Diff line verify_load_bootstrap_automatically: true load_bootstrap: false bootstrap_version: '3x' allowed_tags: 'h1,h2,a,b,big,code,del,em,i,ins,pre,q,small,span,strong,sub,sup,tt,ol,ul,li,p,br,img' clear_caches_on_modal_save: false default_cookie_expiration: 10000 config/schema/modal.schema.yml +3 −0 Original line number Diff line number Diff line Loading @@ -153,6 +153,9 @@ modal_page.settings: load_bootstrap: type: boolean label: 'Load bootstrap' bootstrap_version: type: string label: 'Bootstrap version' allowed_tags: type: string label: 'Allowed tags' Loading css/modal-page.css +14 −2 Original line number Diff line number Diff line Loading @@ -97,6 +97,7 @@ fieldset[disabled] a.btn { text-shadow: 0 1px 0 #fff; filter: alpha(opacity=20); opacity: .2; order: 2; } .close:hover, .close:focus { Loading Loading @@ -148,7 +149,8 @@ button.close { -o-transform: translate(0, -25%); transform: translate(0, -25%); } .modal.in .modal-dialog { .modal.in .modal-dialog, .modal.show .modal-dialog { -webkit-transform: translate(0, 0); -ms-transform: translate(0, 0); -o-transform: translate(0, 0); Loading Loading @@ -208,9 +210,12 @@ button.close { padding: 15px; } .modal-footer { display: flex; padding: 15px; text-align: left; border-top: 1px solid #e5e5e5; justify-content: space-between; align-items: center; } .modal-footer .btn + .btn { margin-bottom: 0; Loading Loading @@ -250,7 +255,6 @@ button.close { .modal-footer:after { display: table; content: " "; } .modal-header:after, .modal-footer:after { Loading @@ -261,3 +265,11 @@ button.close { .modal-no-border { border: none; } em.placeholder { display: unset; min-height: unset; vertical-align: unset; cursor: unset; background-color: unset; opacity: unset; } js/modal-page.js +18 −5 Original line number Diff line number Diff line Loading @@ -24,7 +24,7 @@ } // If Bootstrap is automatic enable it only if its necessary. if (!$.fn.modal && verify_load_bootstrap_automatically) { if (!$.fn.modal && !window.bootstrap && verify_load_bootstrap_automatically) { $.ajax({url: "/modal-page/ajax/enable-bootstrap", success: function(result){ location.reload(); }}); Loading Loading @@ -143,14 +143,22 @@ var delay = $(modal).find('#delay_display').val() * 1000; setTimeout(function () { if (drupalSettings.modal_page.bootstrap_version == "3x") { modal.modal(); } else { modal.modal('show'); } }, delay); } } // Open Modal Page clicking on "open-modal-page" class. $('.open-modal-page', modal).on('click', function () { if (drupalSettings.modal_page.bootstrap_version == "3x") { modal.modal(); } else { modal.modal('show'); } }); // Open Modal Page clicking on user custom element. Loading @@ -159,7 +167,11 @@ var link_open_modal = modal.data('modal-options').open_modal_on_element_click; $(link_open_modal).on('click', function () { if (drupalSettings.modal_page.bootstrap_version == "3x") { modal.modal(); } else { modal.modal('show'); } }); } Loading @@ -184,6 +196,8 @@ } modal.modal('hide'); var modalElement = $('.js-modal-page-ok-button').parents('#js-modal-page-show-modal'); // URL to send data. Loading Loading @@ -218,7 +232,6 @@ } }); }); } }; Loading modal_page.install +12 −0 Original line number Diff line number Diff line Loading @@ -657,6 +657,18 @@ function modal_page_update_400013() { } } /** * Update the bootstrap version configuration with default value. */ function modal_page_update_500001() { $config = \Drupal::configFactory()->getEditable('modal_page.settings'); $config->set('bootstrap_version', '3x'); $config->save(); } // ----------------------------------------------------------------------------- // Auxiliar Methods. @codingStandardsIgnoreLine // ----------------------------------------------------------------------------- Loading Loading
config/install/modal_page.settings.yml +1 −0 Original line number Diff line number Diff line verify_load_bootstrap_automatically: true load_bootstrap: false bootstrap_version: '3x' allowed_tags: 'h1,h2,a,b,big,code,del,em,i,ins,pre,q,small,span,strong,sub,sup,tt,ol,ul,li,p,br,img' clear_caches_on_modal_save: false default_cookie_expiration: 10000
config/schema/modal.schema.yml +3 −0 Original line number Diff line number Diff line Loading @@ -153,6 +153,9 @@ modal_page.settings: load_bootstrap: type: boolean label: 'Load bootstrap' bootstrap_version: type: string label: 'Bootstrap version' allowed_tags: type: string label: 'Allowed tags' Loading
css/modal-page.css +14 −2 Original line number Diff line number Diff line Loading @@ -97,6 +97,7 @@ fieldset[disabled] a.btn { text-shadow: 0 1px 0 #fff; filter: alpha(opacity=20); opacity: .2; order: 2; } .close:hover, .close:focus { Loading Loading @@ -148,7 +149,8 @@ button.close { -o-transform: translate(0, -25%); transform: translate(0, -25%); } .modal.in .modal-dialog { .modal.in .modal-dialog, .modal.show .modal-dialog { -webkit-transform: translate(0, 0); -ms-transform: translate(0, 0); -o-transform: translate(0, 0); Loading Loading @@ -208,9 +210,12 @@ button.close { padding: 15px; } .modal-footer { display: flex; padding: 15px; text-align: left; border-top: 1px solid #e5e5e5; justify-content: space-between; align-items: center; } .modal-footer .btn + .btn { margin-bottom: 0; Loading Loading @@ -250,7 +255,6 @@ button.close { .modal-footer:after { display: table; content: " "; } .modal-header:after, .modal-footer:after { Loading @@ -261,3 +265,11 @@ button.close { .modal-no-border { border: none; } em.placeholder { display: unset; min-height: unset; vertical-align: unset; cursor: unset; background-color: unset; opacity: unset; }
js/modal-page.js +18 −5 Original line number Diff line number Diff line Loading @@ -24,7 +24,7 @@ } // If Bootstrap is automatic enable it only if its necessary. if (!$.fn.modal && verify_load_bootstrap_automatically) { if (!$.fn.modal && !window.bootstrap && verify_load_bootstrap_automatically) { $.ajax({url: "/modal-page/ajax/enable-bootstrap", success: function(result){ location.reload(); }}); Loading Loading @@ -143,14 +143,22 @@ var delay = $(modal).find('#delay_display').val() * 1000; setTimeout(function () { if (drupalSettings.modal_page.bootstrap_version == "3x") { modal.modal(); } else { modal.modal('show'); } }, delay); } } // Open Modal Page clicking on "open-modal-page" class. $('.open-modal-page', modal).on('click', function () { if (drupalSettings.modal_page.bootstrap_version == "3x") { modal.modal(); } else { modal.modal('show'); } }); // Open Modal Page clicking on user custom element. Loading @@ -159,7 +167,11 @@ var link_open_modal = modal.data('modal-options').open_modal_on_element_click; $(link_open_modal).on('click', function () { if (drupalSettings.modal_page.bootstrap_version == "3x") { modal.modal(); } else { modal.modal('show'); } }); } Loading @@ -184,6 +196,8 @@ } modal.modal('hide'); var modalElement = $('.js-modal-page-ok-button').parents('#js-modal-page-show-modal'); // URL to send data. Loading Loading @@ -218,7 +232,6 @@ } }); }); } }; Loading
modal_page.install +12 −0 Original line number Diff line number Diff line Loading @@ -657,6 +657,18 @@ function modal_page_update_400013() { } } /** * Update the bootstrap version configuration with default value. */ function modal_page_update_500001() { $config = \Drupal::configFactory()->getEditable('modal_page.settings'); $config->set('bootstrap_version', '3x'); $config->save(); } // ----------------------------------------------------------------------------- // Auxiliar Methods. @codingStandardsIgnoreLine // ----------------------------------------------------------------------------- Loading