BioTorrents.de’s version of Gazelle
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

textarea.phtml 1.3KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253
  1. <script>
  2. $(document).ready(function() {
  3. 'use strict';
  4. // Hide Preview by default
  5. $('.button_preview_<?=$NID?>')
  6. .css('display', 'none');
  7. var easyMDE = new EasyMDE({
  8. element: $( <?=$ID?> )[0],
  9. autoDownloadFontAwesome: false,
  10. toolbar: [
  11. // https://github.com/Ionaru/easy-markdown-editor#toolbar-icons
  12. 'bold', 'italic', 'strikethrough', 'heading',
  13. '|', 'code', 'quote', 'unordered-list', 'ordered-list', 'clean-block',
  14. '|', 'link', 'image', 'table',
  15. '|', 'preview', 'side-by-side', 'fullscreen',
  16. '|', 'guide',
  17. {
  18. name: 'plain',
  19. action: function customFunction(editor) {
  20. easyMDE.toTextArea();
  21. easyMDE = null;
  22. // Show Preview on easyMDE destruction
  23. $('.button_preview_<?=$NID?>')
  24. .css('display', 'inline');
  25. },
  26. className: 'fa fa-toggle-on',
  27. title: 'Plain Text Editor',
  28. },
  29. ],
  30. shortcuts: {
  31. 'toggleStrikethrough': 'Cmd-Alt-S',
  32. 'drawTable': 'Cmd-Alt-T',
  33. },
  34. });
  35. });
  36. </script>
  37. <div id="textarea_wrap_<?=$NID?>" class="textarea_wrap">
  38. <textarea name="<?=$Name?>"
  39. id="<?=$ID?>"
  40. placeholder="<?=$Placeholder?>"
  41. cols="<?=$Cols?>"
  42. rows="<?=$Rows?>"
  43. <?=$Attributes?>><?=$Value?></textarea>
  44. </div>