src/web/static/js/main.js
/**
 * Show a toast.
 * Toast elements are found in the HTML by their id: toast-{{ name }}
 * If content is specified, it is used in the .custom-content element inside the toast
 */
Show a toast.
Toast elements are found in the HTML by their id: toast-{{ name }}
If content is specified, it is used in the .custom-content element inside the toast
Show a toast . Toast elements are found in the HTML by their id : toast - {{ name }} If content is specified it is used in the . custom - content element inside the toast
function showToast(name, content = '') {
  const el = document.getElementById(`toast-${ name }`);
  if (!el) throw new ReferenceError(`toast element not found for '${ name }'`);
  const toast = bootstrap.Toast.getInstance(el);
  if (!toast) throw new ReferenceError(`toast instance not found for '${ name }'`);
  if (content) {
    const contentEl = el.querySelector('.custom-content');
    if (!contentEl) throw new ReferenceError(`sub-element with class 'custom-content' not found for '${ name }' but required for displaying custom content`);
    contentEl.textContent = content;
  }
  toast.show();
}
function showToast ( name , content = '' ) { const el = document . getElementById ( ` ${ name } ` ) ; if ( ! el ) throw new ReferenceError ( ` ${ name } ` ) ; const toast = bootstrap . Toast . getInstance ( el ) ; if ( ! toast ) throw new ReferenceError ( ` ${ name } ` ) ; if ( content ) { const contentEl = el . querySelector ( '.custom-content' ) ; if ( ! contentEl ) throw new ReferenceError ( ` ${ name } ` ) ; contentEl . textContent = content ; } toast . show ( ) ; }
Show a toast.
Show a toast .