template.html 3.3 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485868788
  1. <!DOCTYPE html>
  2. <html>
  3. <head>
  4. <meta charset="UTF-8">
  5. <title>Template plugin | Trumbowyg by Alex-D</title>
  6. <link href='https://fonts.googleapis.com/css?family=Open+Sans:300,400' rel='stylesheet' type='text/css'>
  7. <link rel="stylesheet" href="../../css/main.css">
  8. </head>
  9. <body class="documentation-body">
  10. <div class="main main-demo-inner">
  11. <section class="wrapper section">
  12. <h2 class="section-title">Template plugin</h2>
  13. <div class="feature">
  14. <h3>Basic usage</h3>
  15. <p>
  16. This plugin allows you to add a template-dropdown.
  17. </p>
  18. <a href="../../documentation/plugins/#plugin-template" class="button button-demo">Read template plugin documentation</a>
  19. <div id="editor">
  20. <h2>Lorem ipsum dolor sit amet</h2>
  21. <p>
  22. Lorem ipsum dolor sit amet, consectetur adipisicing elit. Possimus, aliquam, minima fugiat placeat provident
  23. optio nam reiciendis eius beatae quibusdam!
  24. </p>
  25. <p>
  26. The text is derived from Cicero's De Finibus Bonorum et Malorum (On the Ends of Goods and Evils, or
  27. alternatively [About] The Purposes of Good and Evil ). The original passage began: Neque porro quisquam est
  28. qui dolorem ipsum quia dolor sit amet, consectetur, adipisci velit (Translation: &quot;Neither is there
  29. anyone who loves grief itself since it is grief and thus wants to obtain it&quot;).
  30. </p>
  31. </div>
  32. <h3>The code</h3>
  33. <pre><code class="js-code-to-eval javascript">
  34. $('#editor')
  35. .trumbowyg({
  36. btns: ['template'],
  37. plugins: {
  38. templates: [
  39. {
  40. name: 'Template 1',
  41. html: '&lt;p&gt;I am a template!&lt;/p&gt;'
  42. },
  43. {
  44. name: 'Template 2',
  45. html: '&lt;p&gt;I am a different template!&lt;/p&gt;'
  46. }
  47. ]
  48. }
  49. });
  50. </code></pre>
  51. </div>
  52. <div class="feature">
  53. <h3>Setup</h3>
  54. <h4>In head tag</h4>
  55. <pre><code class="html loading-head">
  56. </code></pre>
  57. <h4>At the end of body</h4>
  58. <pre><code class="html loading-body">
  59. &lt;!-- Import jQuery -->
  60. &lt;script src="//ajax.googleapis.com/ajax/libs/jquery/3.2.1/jquery.min.js">&lt;/script>
  61. &lt;script>window.jQuery || document.write('&lt;script src="js/vendor/jquery-3.2.1.min.js">&lt;\/script>')&lt;/script>
  62. </code></pre>
  63. </div>
  64. </section>
  65. </div>
  66. <!-- Import jQuery -->
  67. <script src="//ajax.googleapis.com/ajax/libs/jquery/3.2.1/jquery.min.js"></script>
  68. <script>window.jQuery || document.write('<script src="../../js/vendor/jquery-3.2.1.min.js"><\/script>')</script>
  69. <!-- DO NOT COPY THIS LINES IN YOUR PROJECT, THEY ARE THERE JUST FOR THE EXAMPLE PAGE PRUPOSE -->
  70. <script src="../js/loader.js"></script>
  71. <script>
  72. loadStyle('dist/ui/trumbowyg.css');
  73. loadScript('dist/trumbowyg.js', 'Import Trumbowyg');
  74. loadScript('dist/plugins/template/trumbowyg.template.js', 'Import all plugins you want AFTER importing jQuery and Trumbowyg');
  75. </script>
  76. <script src="../js/runExampleCode.js"></script>
  77. <script src="../js/highlight.js"></script>
  78. </body>
  79. </html>