base64.html 4.7 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123
  1. <!DOCTYPE html>
  2. <html>
  3. <head>
  4. <meta charset="UTF-8">
  5. <title>base64 plugin | Trumbowyg</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">Base64 plugin</h2>
  13. <div class="feature">
  14. <h3>Basic usage</h3>
  15. <p>
  16. You can insert an image in <em>base64</em> in src attribute of <code>img</code> tag.
  17. </p>
  18. <a href="../../documentation/plugins/#plugin-base64" class="button button-demo">Read base64 plugin documentation</a>
  19. <div id="editor">
  20. <h2>Insert your base64 image!</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. <h4>The code</h4>
  33. <pre><code class="js-code-to-eval javascript">
  34. $('#editor')
  35. .trumbowyg({
  36. btns: ['base64']
  37. });
  38. </code></pre>
  39. </div>
  40. <div class="feature">
  41. <h3>base64 in dropdown</h3>
  42. <div id="editor-dropdown">
  43. <h2>Insert your base64 image through image dropdown!</h2>
  44. <p>
  45. Lorem ipsum dolor sit amet, consectetur adipisicing elit. Possimus, aliquam, minima fugiat placeat provident
  46. optio nam reiciendis eius beatae quibusdam!
  47. </p>
  48. <p>
  49. The text is derived from Cicero's De Finibus Bonorum et Malorum (On the Ends of Goods and Evils, or
  50. alternatively [About] The Purposes of Good and Evil ). The original passage began: Neque porro quisquam est
  51. qui dolorem ipsum quia dolor sit amet, consectetur, adipisci velit (Translation: &quot;Neither is there
  52. anyone who loves grief itself since it is grief and thus wants to obtain it&quot;).
  53. </p>
  54. </div>
  55. <h4>The code</h4>
  56. <pre><code class="js-code-to-eval javascript">
  57. $('#editor-dropdown')
  58. .trumbowyg({
  59. btnsDef: {
  60. // Create a new dropdown
  61. image: {
  62. dropdown: ['insertImage', 'base64'],
  63. ico: 'insertImage'
  64. }
  65. },
  66. // Redefine the button pane
  67. btns: [
  68. ['viewHTML'],
  69. ['formatting'],
  70. ['strong', 'em', 'del'],
  71. ['superscript', 'subscript'],
  72. ['link'],
  73. ['image'], // Our fresh created dropdown
  74. ['justifyLeft', 'justifyCenter', 'justifyRight', 'justifyFull'],
  75. ['unorderedList', 'orderedList'],
  76. ['horizontalRule'],
  77. ['removeformat'],
  78. ['fullscreen']
  79. ]
  80. });
  81. </code></pre>
  82. </div>
  83. <div class="feature">
  84. <h3>Setup</h3>
  85. <h4>In head tag</h4>
  86. <pre><code class="html loading-head">
  87. </code></pre>
  88. <h4>At the end of body</h4>
  89. <pre><code class="html loading-body">
  90. &lt;!-- Import jQuery -->
  91. &lt;script src="//ajax.googleapis.com/ajax/libs/jquery/3.2.1/jquery.min.js">&lt;/script>
  92. &lt;script>window.jQuery || document.write('&lt;script src="js/vendor/jquery-3.2.1.min.js">&lt;\/script>')&lt;/script>
  93. </code></pre>
  94. </div>
  95. </section>
  96. </div>
  97. <!-- Import jQuery -->
  98. <script src="//ajax.googleapis.com/ajax/libs/jquery/3.2.1/jquery.min.js"></script>
  99. <script>window.jQuery || document.write('<script src="../../js/vendor/jquery-3.2.1.min.js"><\/script>')</script>
  100. <!-- DO NOT COPY THIS LINES IN YOUR PROJECT, THEY ARE THERE JUST FOR THE EXAMPLE PAGE PRUPOSE -->
  101. <script src="../js/loader.js"></script>
  102. <script>
  103. loadStyle('dist/ui/trumbowyg.css');
  104. loadScript('dist/trumbowyg.js', 'Import Trumbowyg');
  105. loadScript('dist/plugins/base64/trumbowyg.base64.js', 'Import all plugins you want AFTER importing jQuery and Trumbowyg');
  106. </script>
  107. <script src="../js/runExampleCode.js"></script>
  108. <script src="../js/highlight.js"></script>
  109. </body>
  110. </html>