Message Generator

The messaging from the client-js to the user is a critical function. I developed dynamic-modals.js to display a message modal. This Generator allows you to create and test your message modal. Edits to the Generator automatically updates the Generated code block with the fewest parameters needed. A dismiss button and/or a link is required. The message modal does not implement the close button in the head to force a redirection. Notice a modal created in the page's html can co-exists with dynamic-modals.js.

Generator

Defaults are set in dynamic-modals.js

Generated

Empty arguments will use the runtime defaults.

showMessageModal('', '', true, '', '', true, '', '', '', '');
showMessageModal('This is called with just a message. You set defaults in dynamic-modals.js.');
showMessageModal('This is called with just a message and class. You set defaults in dynamic-modals.js.', 'alert-secondary');
showMessageModal('You can include a link. Please support KenHaggerty.Com.', 'alert-success', true, 'Later', 'btn-primary', true, 'https://kenhaggerty.com', '_self', 'KenHaggerty.Com');
showMessageModal('Hide Backdrop sets the backdrop to false. Clicking outside the modal will not dismiss the modal.', 'alert-warning', true, 'Got It', 'btn-success', true, 'https://getbootstrap.com/docs/5.3/components/modal/', '_blank', 'More', 'btn-info', true);
showMessageModal('We use cookies to analyse usage. See our privacy policy.', 'alert-primary', true, 'Agree', '', true, '/Privacy', '_blank', 'Privacy Policy');
showMessageModal('Congraulations!', 'alert-success', true, 'Done');
showMessageModal('You have run out of time. You must start over.', 'alert-dark', false, '', '', true, '/', '_self', 'Try Again');
showMessageModal('Oops! Something went wrong. Please help me fix it by sending me an email about how to recreate the issue.', 'alert-danger', false, '', '', true, '/', '_self', 'Home');