resizimg.html 3.2 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576
  1. <!DOCTYPE html>
  2. <html>
  3. <head>
  4. <meta charset="UTF-8">
  5. <title>resizimg 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">Resizimg plugin</h2>
  13. <div class="feature">
  14. <h3>Basic usage</h3>
  15. <p>
  16. Images can be resized by dragging their bottom-right corner.
  17. </p>
  18. <a href="../../documentation/plugins/#plugin-resizimg" class="button button-demo">Read resizimg plugin documentation</a>
  19. <div id="editor" style="margin: 1rem">
  20. <h2>Resize that image!</h2>
  21. <img src="https://github.com/Alex-D/Trumbowyg/raw/develop/banner.jpg" style="height: 200px">
  22. </div>
  23. <h4>The code</h4>
  24. <p>nothing to do unless you want to change the default values of options, in which case you could:</p>
  25. <pre><code class="js-code-to-eval javascript">
  26. $('#editor').trumbowyg({
  27. plugins: {
  28. resizimg : {
  29. minSize: 64,
  30. step: 16,
  31. }
  32. }
  33. });
  34. </code></pre>
  35. </div>
  36. <div class="feature">
  37. <h3>Setup</h3>
  38. <h4>In head tag</h4>
  39. <pre><code class="html loading-head">
  40. </code></pre>
  41. <h4>At the end of body</h4>
  42. <p>Note the additional requirement: the <a href="https://github.com/RickStrahl/jquery-resizable" target="_blank">jquery-resizable</a> plugin must be loaded for Resizimg to work.</p>
  43. <pre><code class="html loading-body">
  44. &lt;!-- Import jQuery -->
  45. &lt;script src="//ajax.googleapis.com/ajax/libs/jquery/3.2.1/jquery.min.js">&lt;/script>
  46. &lt;script>window.jQuery || document.write('&lt;script src="js/vendor/jquery-3.2.1.min.js">&lt;\/script>')&lt;/script>
  47. &lt;!-- Import dependency for Resizimg (note that the link below will only work for a limited number of requests, for a productive setup make a local copy from https://github.com/RickStrahl/jquery-resizable -->
  48. &lt;script src="https://rawgit.com/RickStrahl/jquery-resizable/master/dist/jquery-resizable.min.js">&lt;/script>
  49. </code></pre>
  50. </div>
  51. </section>
  52. </div>
  53. <!-- Import jQuery -->
  54. <script src="//ajax.googleapis.com/ajax/libs/jquery/3.2.1/jquery.min.js"></script>
  55. <script>window.jQuery || document.write('<script src="../../js/vendor/jquery-3.2.1.min.js"><\/script>')</script>
  56. <script type="text/javascript" src="https://rawgit.com/RickStrahl/jquery-resizable/master/dist/jquery-resizable.min.js"></script>
  57. <!-- DO NOT COPY THIS LINES IN YOUR PROJECT, THEY ARE THERE JUST FOR THE EXAMPLE PAGE PRUPOSE -->
  58. <script src="../js/loader.js"></script>
  59. <script>
  60. loadStyle('dist/ui/trumbowyg.css');
  61. loadScript('dist/trumbowyg.js', 'Import Trumbowyg');
  62. loadScript('dist/plugins/resizimg/trumbowyg.resizimg.js', 'Import all plugins you want AFTER importing jQuery and Trumbowyg');
  63. </script>
  64. <script src="../js/runExampleCode.js"></script>
  65. <script src="../js/highlight.js"></script>
  66. </body>
  67. </html>