media_embed_ckeditor.theme.es6.js 758 B

123456789101112131415161718192021222324252627282930
  1. /**
  2. * @file
  3. * Theme elements for the Media Embed CKEditor plugin.
  4. */
  5. (Drupal => {
  6. /**
  7. * Themes the error displayed when the media embed preview fails.
  8. *
  9. * @return {string}
  10. * A string representing a DOM fragment.
  11. *
  12. * @see media-embed-error.html.twig
  13. */
  14. Drupal.theme.mediaEmbedPreviewError = () =>
  15. `<div>${Drupal.t(
  16. 'An error occurred while trying to preview the media. Please save your work and reload this page.',
  17. )}</div>`;
  18. /**
  19. * Themes the edit button for a media embed.
  20. *
  21. * @return {string}
  22. * An HTML string to insert in the CKEditor.
  23. */
  24. Drupal.theme.mediaEmbedEditButton = () =>
  25. `<button class="media-library-item__edit">${Drupal.t(
  26. 'Edit media',
  27. )}</button>`;
  28. })(Drupal);