hugerte-rails 1.0.9.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (210) hide show
  1. checksums.yaml +7 -0
  2. data/LICENSE +21 -0
  3. data/README.md +171 -0
  4. data/Rakefile +64 -0
  5. data/app/assets/javascripts/hugerte/rails.js +51 -0
  6. data/app/assets/source/hugerte/hugerte.js +31756 -0
  7. data/app/assets/sprockets/hugerte/preinit.js.erb +4 -0
  8. data/app/assets/sprockets/hugerte.js +3 -0
  9. data/lib/hugerte/rails/asset_installer/compile.rb +44 -0
  10. data/lib/hugerte/rails/asset_installer/copy.rb +54 -0
  11. data/lib/hugerte/rails/asset_installer/copy_no_preserve.rb +14 -0
  12. data/lib/hugerte/rails/asset_installer.rb +64 -0
  13. data/lib/hugerte/rails/asset_manifest/json_manifest.rb +62 -0
  14. data/lib/hugerte/rails/asset_manifest/null_manifest.rb +12 -0
  15. data/lib/hugerte/rails/asset_manifest/propshaft_manifest.rb +43 -0
  16. data/lib/hugerte/rails/asset_manifest/yaml_manifest.rb +43 -0
  17. data/lib/hugerte/rails/asset_manifest.rb +44 -0
  18. data/lib/hugerte/rails/configuration.rb +162 -0
  19. data/lib/hugerte/rails/configuration_file.rb +50 -0
  20. data/lib/hugerte/rails/engine.rb +93 -0
  21. data/lib/hugerte/rails/environment.rb +23 -0
  22. data/lib/hugerte/rails/helper.rb +89 -0
  23. data/lib/hugerte/rails/propshaft/asset.rb +11 -0
  24. data/lib/hugerte/rails/version.rb +6 -0
  25. data/lib/hugerte/rails.rb +27 -0
  26. data/lib/hugerte-rails.rb +1 -0
  27. data/lib/tasks/hugerte-assets.rake +16 -0
  28. data/vendor/assets/config/hugerte-rails.manifest.js +3 -0
  29. data/vendor/assets/javascripts/hugerte/CHANGELOG.md +125 -0
  30. data/vendor/assets/javascripts/hugerte/README.md +21 -0
  31. data/vendor/assets/javascripts/hugerte/bower.json +27 -0
  32. data/vendor/assets/javascripts/hugerte/composer.json +52 -0
  33. data/vendor/assets/javascripts/hugerte/hugerte.d.ts +3252 -0
  34. data/vendor/assets/javascripts/hugerte/hugerte.js +339 -0
  35. data/vendor/assets/javascripts/hugerte/icons/default/icons.js +1 -0
  36. data/vendor/assets/javascripts/hugerte/icons/default/index.js +7 -0
  37. data/vendor/assets/javascripts/hugerte/license.txt +22 -0
  38. data/vendor/assets/javascripts/hugerte/models/dom/index.js +7 -0
  39. data/vendor/assets/javascripts/hugerte/models/dom/model.js +7 -0
  40. data/vendor/assets/javascripts/hugerte/package.json +32 -0
  41. data/vendor/assets/javascripts/hugerte/plugins/accordion/index.js +7 -0
  42. data/vendor/assets/javascripts/hugerte/plugins/accordion/plugin.js +7 -0
  43. data/vendor/assets/javascripts/hugerte/plugins/advlist/index.js +7 -0
  44. data/vendor/assets/javascripts/hugerte/plugins/advlist/plugin.js +7 -0
  45. data/vendor/assets/javascripts/hugerte/plugins/anchor/index.js +7 -0
  46. data/vendor/assets/javascripts/hugerte/plugins/anchor/plugin.js +7 -0
  47. data/vendor/assets/javascripts/hugerte/plugins/autolink/index.js +7 -0
  48. data/vendor/assets/javascripts/hugerte/plugins/autolink/plugin.js +7 -0
  49. data/vendor/assets/javascripts/hugerte/plugins/autoresize/index.js +7 -0
  50. data/vendor/assets/javascripts/hugerte/plugins/autoresize/plugin.js +7 -0
  51. data/vendor/assets/javascripts/hugerte/plugins/autosave/index.js +7 -0
  52. data/vendor/assets/javascripts/hugerte/plugins/autosave/plugin.js +7 -0
  53. data/vendor/assets/javascripts/hugerte/plugins/charmap/index.js +7 -0
  54. data/vendor/assets/javascripts/hugerte/plugins/charmap/plugin.js +7 -0
  55. data/vendor/assets/javascripts/hugerte/plugins/code/index.js +7 -0
  56. data/vendor/assets/javascripts/hugerte/plugins/code/plugin.js +7 -0
  57. data/vendor/assets/javascripts/hugerte/plugins/codesample/index.js +7 -0
  58. data/vendor/assets/javascripts/hugerte/plugins/codesample/plugin.js +14 -0
  59. data/vendor/assets/javascripts/hugerte/plugins/directionality/index.js +7 -0
  60. data/vendor/assets/javascripts/hugerte/plugins/directionality/plugin.js +7 -0
  61. data/vendor/assets/javascripts/hugerte/plugins/emoticons/index.js +7 -0
  62. data/vendor/assets/javascripts/hugerte/plugins/emoticons/js/emojiimages.js +3 -0
  63. data/vendor/assets/javascripts/hugerte/plugins/emoticons/js/emojis.js +2 -0
  64. data/vendor/assets/javascripts/hugerte/plugins/emoticons/plugin.js +7 -0
  65. data/vendor/assets/javascripts/hugerte/plugins/fullscreen/index.js +7 -0
  66. data/vendor/assets/javascripts/hugerte/plugins/fullscreen/plugin.js +7 -0
  67. data/vendor/assets/javascripts/hugerte/plugins/help/index.js +7 -0
  68. data/vendor/assets/javascripts/hugerte/plugins/help/js/i18n/keynav/ar.js +90 -0
  69. data/vendor/assets/javascripts/hugerte/plugins/help/js/i18n/keynav/bg_BG.js +90 -0
  70. data/vendor/assets/javascripts/hugerte/plugins/help/js/i18n/keynav/ca.js +90 -0
  71. data/vendor/assets/javascripts/hugerte/plugins/help/js/i18n/keynav/cs.js +90 -0
  72. data/vendor/assets/javascripts/hugerte/plugins/help/js/i18n/keynav/da.js +90 -0
  73. data/vendor/assets/javascripts/hugerte/plugins/help/js/i18n/keynav/de.js +90 -0
  74. data/vendor/assets/javascripts/hugerte/plugins/help/js/i18n/keynav/el.js +90 -0
  75. data/vendor/assets/javascripts/hugerte/plugins/help/js/i18n/keynav/en.js +90 -0
  76. data/vendor/assets/javascripts/hugerte/plugins/help/js/i18n/keynav/es.js +90 -0
  77. data/vendor/assets/javascripts/hugerte/plugins/help/js/i18n/keynav/eu.js +90 -0
  78. data/vendor/assets/javascripts/hugerte/plugins/help/js/i18n/keynav/fa.js +90 -0
  79. data/vendor/assets/javascripts/hugerte/plugins/help/js/i18n/keynav/fi.js +90 -0
  80. data/vendor/assets/javascripts/hugerte/plugins/help/js/i18n/keynav/fr_FR.js +90 -0
  81. data/vendor/assets/javascripts/hugerte/plugins/help/js/i18n/keynav/he_IL.js +90 -0
  82. data/vendor/assets/javascripts/hugerte/plugins/help/js/i18n/keynav/hi.js +90 -0
  83. data/vendor/assets/javascripts/hugerte/plugins/help/js/i18n/keynav/hr.js +90 -0
  84. data/vendor/assets/javascripts/hugerte/plugins/help/js/i18n/keynav/hu_HU.js +90 -0
  85. data/vendor/assets/javascripts/hugerte/plugins/help/js/i18n/keynav/id.js +90 -0
  86. data/vendor/assets/javascripts/hugerte/plugins/help/js/i18n/keynav/it.js +90 -0
  87. data/vendor/assets/javascripts/hugerte/plugins/help/js/i18n/keynav/ja.js +90 -0
  88. data/vendor/assets/javascripts/hugerte/plugins/help/js/i18n/keynav/kk.js +90 -0
  89. data/vendor/assets/javascripts/hugerte/plugins/help/js/i18n/keynav/ko_KR.js +90 -0
  90. data/vendor/assets/javascripts/hugerte/plugins/help/js/i18n/keynav/ms.js +90 -0
  91. data/vendor/assets/javascripts/hugerte/plugins/help/js/i18n/keynav/nb_NO.js +90 -0
  92. data/vendor/assets/javascripts/hugerte/plugins/help/js/i18n/keynav/nl.js +90 -0
  93. data/vendor/assets/javascripts/hugerte/plugins/help/js/i18n/keynav/pl.js +90 -0
  94. data/vendor/assets/javascripts/hugerte/plugins/help/js/i18n/keynav/pt_BR.js +90 -0
  95. data/vendor/assets/javascripts/hugerte/plugins/help/js/i18n/keynav/pt_PT.js +90 -0
  96. data/vendor/assets/javascripts/hugerte/plugins/help/js/i18n/keynav/ro.js +90 -0
  97. data/vendor/assets/javascripts/hugerte/plugins/help/js/i18n/keynav/ru.js +90 -0
  98. data/vendor/assets/javascripts/hugerte/plugins/help/js/i18n/keynav/sk.js +90 -0
  99. data/vendor/assets/javascripts/hugerte/plugins/help/js/i18n/keynav/sl_SI.js +90 -0
  100. data/vendor/assets/javascripts/hugerte/plugins/help/js/i18n/keynav/sv_SE.js +90 -0
  101. data/vendor/assets/javascripts/hugerte/plugins/help/js/i18n/keynav/th_TH.js +90 -0
  102. data/vendor/assets/javascripts/hugerte/plugins/help/js/i18n/keynav/tr.js +90 -0
  103. data/vendor/assets/javascripts/hugerte/plugins/help/js/i18n/keynav/uk.js +90 -0
  104. data/vendor/assets/javascripts/hugerte/plugins/help/js/i18n/keynav/vi.js +90 -0
  105. data/vendor/assets/javascripts/hugerte/plugins/help/js/i18n/keynav/zh_CN.js +84 -0
  106. data/vendor/assets/javascripts/hugerte/plugins/help/js/i18n/keynav/zh_TW.js +90 -0
  107. data/vendor/assets/javascripts/hugerte/plugins/help/plugin.js +7 -0
  108. data/vendor/assets/javascripts/hugerte/plugins/image/index.js +7 -0
  109. data/vendor/assets/javascripts/hugerte/plugins/image/plugin.js +7 -0
  110. data/vendor/assets/javascripts/hugerte/plugins/importcss/index.js +7 -0
  111. data/vendor/assets/javascripts/hugerte/plugins/importcss/plugin.js +7 -0
  112. data/vendor/assets/javascripts/hugerte/plugins/insertdatetime/index.js +7 -0
  113. data/vendor/assets/javascripts/hugerte/plugins/insertdatetime/plugin.js +7 -0
  114. data/vendor/assets/javascripts/hugerte/plugins/link/index.js +7 -0
  115. data/vendor/assets/javascripts/hugerte/plugins/link/plugin.js +7 -0
  116. data/vendor/assets/javascripts/hugerte/plugins/lists/index.js +7 -0
  117. data/vendor/assets/javascripts/hugerte/plugins/lists/plugin.js +7 -0
  118. data/vendor/assets/javascripts/hugerte/plugins/media/index.js +7 -0
  119. data/vendor/assets/javascripts/hugerte/plugins/media/plugin.js +7 -0
  120. data/vendor/assets/javascripts/hugerte/plugins/nonbreaking/index.js +7 -0
  121. data/vendor/assets/javascripts/hugerte/plugins/nonbreaking/plugin.js +7 -0
  122. data/vendor/assets/javascripts/hugerte/plugins/pagebreak/index.js +7 -0
  123. data/vendor/assets/javascripts/hugerte/plugins/pagebreak/plugin.js +7 -0
  124. data/vendor/assets/javascripts/hugerte/plugins/preview/index.js +7 -0
  125. data/vendor/assets/javascripts/hugerte/plugins/preview/plugin.js +7 -0
  126. data/vendor/assets/javascripts/hugerte/plugins/quickbars/index.js +7 -0
  127. data/vendor/assets/javascripts/hugerte/plugins/quickbars/plugin.js +7 -0
  128. data/vendor/assets/javascripts/hugerte/plugins/save/index.js +7 -0
  129. data/vendor/assets/javascripts/hugerte/plugins/save/plugin.js +7 -0
  130. data/vendor/assets/javascripts/hugerte/plugins/searchreplace/index.js +7 -0
  131. data/vendor/assets/javascripts/hugerte/plugins/searchreplace/plugin.js +7 -0
  132. data/vendor/assets/javascripts/hugerte/plugins/table/index.js +7 -0
  133. data/vendor/assets/javascripts/hugerte/plugins/table/plugin.js +7 -0
  134. data/vendor/assets/javascripts/hugerte/plugins/template/index.js +7 -0
  135. data/vendor/assets/javascripts/hugerte/plugins/template/plugin.js +7 -0
  136. data/vendor/assets/javascripts/hugerte/plugins/visualblocks/index.js +7 -0
  137. data/vendor/assets/javascripts/hugerte/plugins/visualblocks/plugin.js +7 -0
  138. data/vendor/assets/javascripts/hugerte/plugins/visualchars/index.js +7 -0
  139. data/vendor/assets/javascripts/hugerte/plugins/visualchars/plugin.js +7 -0
  140. data/vendor/assets/javascripts/hugerte/plugins/wordcount/index.js +7 -0
  141. data/vendor/assets/javascripts/hugerte/plugins/wordcount/plugin.js +7 -0
  142. data/vendor/assets/javascripts/hugerte/skins/content/dark/content.css +1 -0
  143. data/vendor/assets/javascripts/hugerte/skins/content/dark/content.js +2 -0
  144. data/vendor/assets/javascripts/hugerte/skins/content/dark/content.min.css +1 -0
  145. data/vendor/assets/javascripts/hugerte/skins/content/default/content.css +1 -0
  146. data/vendor/assets/javascripts/hugerte/skins/content/default/content.js +2 -0
  147. data/vendor/assets/javascripts/hugerte/skins/content/default/content.min.css +1 -0
  148. data/vendor/assets/javascripts/hugerte/skins/content/document/content.css +1 -0
  149. data/vendor/assets/javascripts/hugerte/skins/content/document/content.js +2 -0
  150. data/vendor/assets/javascripts/hugerte/skins/content/document/content.min.css +1 -0
  151. data/vendor/assets/javascripts/hugerte/skins/content/hugerte-5/content.css +1 -0
  152. data/vendor/assets/javascripts/hugerte/skins/content/hugerte-5/content.js +2 -0
  153. data/vendor/assets/javascripts/hugerte/skins/content/hugerte-5/content.min.css +1 -0
  154. data/vendor/assets/javascripts/hugerte/skins/content/hugerte-5-dark/content.css +1 -0
  155. data/vendor/assets/javascripts/hugerte/skins/content/hugerte-5-dark/content.js +2 -0
  156. data/vendor/assets/javascripts/hugerte/skins/content/hugerte-5-dark/content.min.css +1 -0
  157. data/vendor/assets/javascripts/hugerte/skins/content/writer/content.css +1 -0
  158. data/vendor/assets/javascripts/hugerte/skins/content/writer/content.js +2 -0
  159. data/vendor/assets/javascripts/hugerte/skins/content/writer/content.min.css +1 -0
  160. data/vendor/assets/javascripts/hugerte/skins/ui/hugerte-5/content.css +1 -0
  161. data/vendor/assets/javascripts/hugerte/skins/ui/hugerte-5/content.inline.css +1 -0
  162. data/vendor/assets/javascripts/hugerte/skins/ui/hugerte-5/content.inline.js +2 -0
  163. data/vendor/assets/javascripts/hugerte/skins/ui/hugerte-5/content.inline.min.css +1 -0
  164. data/vendor/assets/javascripts/hugerte/skins/ui/hugerte-5/content.js +2 -0
  165. data/vendor/assets/javascripts/hugerte/skins/ui/hugerte-5/content.min.css +1 -0
  166. data/vendor/assets/javascripts/hugerte/skins/ui/hugerte-5/skin.css +1 -0
  167. data/vendor/assets/javascripts/hugerte/skins/ui/hugerte-5/skin.js +2 -0
  168. data/vendor/assets/javascripts/hugerte/skins/ui/hugerte-5/skin.min.css +1 -0
  169. data/vendor/assets/javascripts/hugerte/skins/ui/hugerte-5/skin.shadowdom.css +1 -0
  170. data/vendor/assets/javascripts/hugerte/skins/ui/hugerte-5/skin.shadowdom.js +2 -0
  171. data/vendor/assets/javascripts/hugerte/skins/ui/hugerte-5/skin.shadowdom.min.css +1 -0
  172. data/vendor/assets/javascripts/hugerte/skins/ui/hugerte-5-dark/content.css +1 -0
  173. data/vendor/assets/javascripts/hugerte/skins/ui/hugerte-5-dark/content.inline.css +1 -0
  174. data/vendor/assets/javascripts/hugerte/skins/ui/hugerte-5-dark/content.inline.js +2 -0
  175. data/vendor/assets/javascripts/hugerte/skins/ui/hugerte-5-dark/content.inline.min.css +1 -0
  176. data/vendor/assets/javascripts/hugerte/skins/ui/hugerte-5-dark/content.js +2 -0
  177. data/vendor/assets/javascripts/hugerte/skins/ui/hugerte-5-dark/content.min.css +1 -0
  178. data/vendor/assets/javascripts/hugerte/skins/ui/hugerte-5-dark/skin.css +1 -0
  179. data/vendor/assets/javascripts/hugerte/skins/ui/hugerte-5-dark/skin.js +2 -0
  180. data/vendor/assets/javascripts/hugerte/skins/ui/hugerte-5-dark/skin.min.css +1 -0
  181. data/vendor/assets/javascripts/hugerte/skins/ui/hugerte-5-dark/skin.shadowdom.css +1 -0
  182. data/vendor/assets/javascripts/hugerte/skins/ui/hugerte-5-dark/skin.shadowdom.js +2 -0
  183. data/vendor/assets/javascripts/hugerte/skins/ui/hugerte-5-dark/skin.shadowdom.min.css +1 -0
  184. data/vendor/assets/javascripts/hugerte/skins/ui/oxide/content.css +1 -0
  185. data/vendor/assets/javascripts/hugerte/skins/ui/oxide/content.inline.css +1 -0
  186. data/vendor/assets/javascripts/hugerte/skins/ui/oxide/content.inline.js +2 -0
  187. data/vendor/assets/javascripts/hugerte/skins/ui/oxide/content.inline.min.css +1 -0
  188. data/vendor/assets/javascripts/hugerte/skins/ui/oxide/content.js +2 -0
  189. data/vendor/assets/javascripts/hugerte/skins/ui/oxide/content.min.css +1 -0
  190. data/vendor/assets/javascripts/hugerte/skins/ui/oxide/skin.css +1 -0
  191. data/vendor/assets/javascripts/hugerte/skins/ui/oxide/skin.js +2 -0
  192. data/vendor/assets/javascripts/hugerte/skins/ui/oxide/skin.min.css +1 -0
  193. data/vendor/assets/javascripts/hugerte/skins/ui/oxide/skin.shadowdom.css +1 -0
  194. data/vendor/assets/javascripts/hugerte/skins/ui/oxide/skin.shadowdom.js +2 -0
  195. data/vendor/assets/javascripts/hugerte/skins/ui/oxide/skin.shadowdom.min.css +1 -0
  196. data/vendor/assets/javascripts/hugerte/skins/ui/oxide-dark/content.css +1 -0
  197. data/vendor/assets/javascripts/hugerte/skins/ui/oxide-dark/content.inline.css +1 -0
  198. data/vendor/assets/javascripts/hugerte/skins/ui/oxide-dark/content.inline.js +2 -0
  199. data/vendor/assets/javascripts/hugerte/skins/ui/oxide-dark/content.inline.min.css +1 -0
  200. data/vendor/assets/javascripts/hugerte/skins/ui/oxide-dark/content.js +2 -0
  201. data/vendor/assets/javascripts/hugerte/skins/ui/oxide-dark/content.min.css +1 -0
  202. data/vendor/assets/javascripts/hugerte/skins/ui/oxide-dark/skin.css +1 -0
  203. data/vendor/assets/javascripts/hugerte/skins/ui/oxide-dark/skin.js +2 -0
  204. data/vendor/assets/javascripts/hugerte/skins/ui/oxide-dark/skin.min.css +1 -0
  205. data/vendor/assets/javascripts/hugerte/skins/ui/oxide-dark/skin.shadowdom.css +1 -0
  206. data/vendor/assets/javascripts/hugerte/skins/ui/oxide-dark/skin.shadowdom.js +2 -0
  207. data/vendor/assets/javascripts/hugerte/skins/ui/oxide-dark/skin.shadowdom.min.css +1 -0
  208. data/vendor/assets/javascripts/hugerte/themes/silver/index.js +7 -0
  209. data/vendor/assets/javascripts/hugerte/themes/silver/theme.js +339 -0
  210. metadata +263 -0
checksums.yaml ADDED
@@ -0,0 +1,7 @@
1
+ ---
2
+ SHA256:
3
+ metadata.gz: 853e36941b21ff9601cc7512e7999c768158cd5a90dceed0c7bbf48d63ce2d79
4
+ data.tar.gz: dd99c1395cb74de4f4d8356a93403e0ec39734a2a67face77e7d37230a40101e
5
+ SHA512:
6
+ metadata.gz: b0475932b6df567a6c100674df2bbdab0f4ffd98223daa8050976dcff16c9064fe47dd75885e9de9c15217038ea35d001276141a754a5a5849f12433d68cb7e7
7
+ data.tar.gz: dec527aba2279bc3e7b70233028a919fdf8ceeb93b0209527483b8f378bad49b47783ba631591c702b3565a4aed0d3677854ab149955084402a8b5d504d37992
data/LICENSE ADDED
@@ -0,0 +1,21 @@
1
+ The MIT License (MIT)
2
+
3
+ Copyright (C) 2011-25 by Liberaldev, Sam Pohlenz
4
+
5
+ Permission is hereby granted, free of charge, to any person obtaining a copy
6
+ of this software and associated documentation files (the "Software"), to deal
7
+ in the Software without restriction, including without limitation the rights
8
+ to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
9
+ copies of the Software, and to permit persons to whom the Software is
10
+ furnished to do so, subject to the following conditions:
11
+
12
+ The above copyright notice and this permission notice shall be included in
13
+ all copies or substantial portions of the Software.
14
+
15
+ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16
+ IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17
+ FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
18
+ AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19
+ LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
20
+ OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
21
+ SOFTWARE.
data/README.md ADDED
@@ -0,0 +1,171 @@
1
+ Rails Integration for TinyMCE
2
+ =============================
3
+
4
+ The `hugerte-rails` gem integrates the [HugeRTE](https://hugerte.org/) editor with the Rails asset pipeline.
5
+
6
+ This gem is compatible with Rails 6.0 and higher.
7
+
8
+ [![Build Status](https://img.shields.io/github/actions/workflow/status/liberaldev/hugerte-rails/rspec.yml)](https://github.com/liberaldev/hugerte-rails/actions)
9
+
10
+
11
+ Instructions
12
+ ------------
13
+
14
+ **1. Add `hugerte-rails` to your Gemfile**
15
+
16
+ ```ruby
17
+ gem 'hugerte-rails'
18
+ ```
19
+
20
+ Be sure to add to the global group, not the `assets` group. Then run `bundle install`.
21
+
22
+
23
+ **2. Create a `config/hugerte.yml` file with your global configuration options:**
24
+
25
+ ```yml
26
+ toolbar:
27
+ - styleselect | bold italic | undo redo
28
+ - image | link
29
+ plugins:
30
+ - image
31
+ - link
32
+ ```
33
+
34
+ The Rails server no longer needs to be restarted when this file is updated in development mode.
35
+
36
+ To define multiple configuration sets, follow this syntax (a default configuration must be specified):
37
+
38
+ ```yml
39
+ default: &default
40
+ plugins:
41
+ - image
42
+ - link
43
+
44
+ alternate:
45
+ <<: *default
46
+ toolbar: styleselect | bold italic | undo redo | table
47
+ plugins:
48
+ - table
49
+ ```
50
+
51
+ See the [TinyMCE 6 Documentation](https://www.tiny.cloud/docs/tinymce/6/) for a full list of configuration options.
52
+
53
+ **3. Include the TinyMCE assets**
54
+
55
+ Use *one* of the following options to include TinyMCE assets.
56
+
57
+ (1) Add to your application.js (Sprockets only):
58
+
59
+ ```js
60
+ //= require hugerte
61
+ ```
62
+
63
+ or (2) add the script tag to your layout using the `hugerte_assets` helper:
64
+
65
+ ```erb
66
+ <%= hugerte_assets data: { turbo_track: "reload" } %>
67
+ #=> <script type="text/javascript" src="/assets/hugerte.js" data-turbo-track="reload">
68
+ ```
69
+
70
+ When using Propshaft, the `hugerte_assets` helper adds multiple script tags including the pre-init code (available via the `hugerte_preinit` helper), as well as `hugerte/hugerte.js` and `hugerte/rails.js`. You may prefer to selectively include these manually depending on your requirements.
71
+
72
+ For Sprockets, these are bundled together into one script tag.
73
+
74
+
75
+ **4. Initialize TinyMCE**
76
+
77
+ For each textarea that you want to use with TinyMCE, add the "hugerte" class and ensure it has a unique ID:
78
+
79
+ ```erb
80
+ <%= text_area_tag :content, "", class: "hugerte", rows: 40, cols: 120 %>
81
+ ```
82
+
83
+ or if you are using Rails' form builders:
84
+
85
+ ```erb
86
+ <%= f.text_area :content, class: "hugerte", rows: 40, cols: 120 %>
87
+ ```
88
+
89
+ Then invoke the `hugerte` helper to initialize TinyMCE:
90
+
91
+ ```erb
92
+ <%= hugerte %>
93
+ ```
94
+
95
+ Custom options can be passed to `hugerte` to override the global options specified in `config/hugerte.yml`:
96
+
97
+ ```erb
98
+ <%= hugerte theme: "simple", language: "de", plugins: ["wordcount", "paste"] %>
99
+ ```
100
+
101
+ Alternate configurations defined in 'config/hugerte.yml' can be used with:
102
+
103
+ ```erb
104
+ <%= hugerte :alternate %>
105
+ ```
106
+
107
+
108
+ Language Packs
109
+ --------------
110
+
111
+ See the [liberaldev-rails-langs](https://github.com/liberaldev/hugerte-rails-langs) gem for additional language packs for HugeRTE.
112
+
113
+
114
+ Manual Initialization
115
+ ---------------------
116
+
117
+ Using the `hugerte` helper and global configuration file is entirely optional. The `hugerte.init` JS function can be invoked manually if desired.
118
+
119
+ ```erb
120
+ <%= text_area_tag :editor, "", rows: 40, cols: 120 %>
121
+
122
+ <script type="text/javascript">
123
+ hugerte.init({
124
+ selector: 'textarea.editor'
125
+ });
126
+ </script>
127
+ ```
128
+
129
+
130
+ Asset Compilation
131
+ -----------------
132
+
133
+ Since TinyMCE loads most of its files dynamically, some workarounds are required to ensure that the TinyMCE asset files are accessible using non-digested filenames.
134
+
135
+ As of hugerte-rails 3.5.11, 4.1.10 and 4.2.1, two alternative asset installation methods are available, which can be changed by setting `config.hugerte.install` within your `config/application.rb` file. These methods are called when you run `rake asset:precompile` (via `Rake::Task#enhance`) after the regular application assets are compiled.
136
+
137
+ The default method (as of 4.5.2), `compile`, adds the TinyMCE paths to the Sprockets precompilation paths and then creates symlinks from the non-digested filenames to their digested versions.
138
+
139
+ ```ruby
140
+ config.hugerte.install = :compile
141
+ ```
142
+
143
+ If you experience issues with the `compile` method, you may wish to use the `copy` method instead, which copies the TinyMCE assets directly into `public/assets` and appends the file information into the asset manifest. The `copy_no_preserve` method is also available of you do not wish to or cannot preserve file modes on your filesystem.
144
+
145
+ ```ruby
146
+ config.hugerte.install = :copy
147
+ ```
148
+
149
+ If you are including TinyMCE via `application.js` or using the `hugerte_assets` helper, you do not need to manually add the scripts to the Sprockets precompile paths.
150
+
151
+
152
+ Custom Plugins & Skins
153
+ ----------------------
154
+
155
+ To use custom plugins or skins, simply add the files to your asset load path so that they are locatable at a path beneath `hugerte/plugins/` or `hugerte/skins/`.
156
+
157
+ For example, a plugin called `mycustomplugin` could have its main JS file at `app/assets/javascripts/hugerte/plugins/mycustomplugin/plugin.js`.
158
+
159
+ You should also ensure that your custom paths are added to the asset precompile paths.
160
+
161
+
162
+ Using hugerte-rails as an Engine Dependency
163
+ -------------------------------------------
164
+
165
+ Ensure that you explicitly require `hugerte-rails` within your engine file. Including hugerte-rails as a dependency in your gemspec is not enough.
166
+
167
+
168
+ Updating
169
+ --------
170
+
171
+ When new versions of TinyMCE are released, simply update the `hugerte-rails` gem to the latest version. There is no need to run any extra rake tasks (apart from `rake assets:precompile`).
data/Rakefile ADDED
@@ -0,0 +1,64 @@
1
+ require File.expand_path('../lib/hugerte/rails/version', __FILE__)
2
+
3
+ def step(name)
4
+ print "#{name} ..."
5
+ yield
6
+ puts " DONE"
7
+ end
8
+
9
+ def download(url, filename)
10
+ puts "Downloading #{url} ..."
11
+ `mkdir -p tmp`
12
+ `curl -L -# #{url} -o tmp/#{filename}`
13
+ end
14
+
15
+ desc "Update HugeRTE to version #{HugeRTE::Rails::HUGERTE_VERSION}"
16
+ task :update => [ :fetch, :extract, :rename ]
17
+
18
+ task :fetch do
19
+ download("https://github.com/hugerte/hugerte-dist/archive/refs/tags/v#{HugeRTE::Rails::HUGERTE_VERSION}.zip", "hugerte.zip")
20
+ end
21
+
22
+ task :extract do
23
+ step "Extracting core files" do
24
+ `rm -rf tmp/hugerte-dist-*`
25
+ `unzip -u tmp/hugerte.zip -d tmp`
26
+ `rm -rf vendor/assets/javascripts/hugerte`
27
+ `mkdir -p vendor/assets/javascripts/hugerte`
28
+ `cp -r tmp/hugerte-dist-#{HugeRTE::Rails::HUGERTE_VERSION}/* vendor/assets/javascripts/hugerte/`
29
+ end
30
+
31
+ step "Extracting unminified source" do
32
+ `mkdir -p app/assets/source/hugerte`
33
+ `mv tmp/hugerte-dist-#{HugeRTE::Rails::HUGERTE_VERSION}/hugerte.js app/assets/source/hugerte/hugerte.js`
34
+ `rm -rf tmp/hugerte-dist-#{HugeRTE::Rails::HUGERTE_VERSION}`
35
+ end
36
+ end
37
+
38
+ task :rename do
39
+ step "Renaming files" do
40
+ Dir["vendor/assets/javascripts/hugerte/**/*.min.js"].each do |min_file|
41
+ js_file = min_file.sub(/\.min\.js$/, '.js')
42
+ if File.exist?(js_file)
43
+ FileUtils.rm(js_file)
44
+ FileUtils.mv(min_file, js_file)
45
+ puts "Replaced #{js_file} with #{min_file}"
46
+ end
47
+ end
48
+
49
+ Dir["vendor/assets/javascripts/hugerte/**/*.min.css"].each do |min_file|
50
+ css_file = min_file.sub(/\.min\.css$/, '.css')
51
+ if File.exist?(css_file)
52
+ FileUtils.rm(css_file)
53
+ FileUtils.cp(min_file, css_file)
54
+ puts "Replaced #{css_file} with #{min_file}"
55
+ end
56
+ end
57
+ end
58
+ end
59
+
60
+ require 'rspec/core/rake_task'
61
+ RSpec::Core::RakeTask.new(:spec)
62
+ task :default => :spec
63
+
64
+ require "bundler/gem_tasks"
@@ -0,0 +1,51 @@
1
+ window.HugeRTERails = {
2
+ configuration: {
3
+ default: {}
4
+ },
5
+
6
+ initialize: function(config, options) {
7
+ if (typeof hugeRTE != 'undefined') {
8
+ // Merge the custom options with the given configuration
9
+ var configuration = HugeRTERails.configuration[config || 'default'];
10
+ configuration = HugeRTERails._merge(configuration, options);
11
+
12
+ hugeRTE.init(configuration);
13
+ } else {
14
+ // Wait until HugeRTE is loaded
15
+ setTimeout(function() {
16
+ HugeRTERails.initialize(config, options);
17
+ }, 50);
18
+ }
19
+ },
20
+
21
+ setupTurbolinks: function() {
22
+ // Remove all HugeRTE instances before rendering
23
+ document.addEventListener('turbolinks:before-render', function() {
24
+ hugeRTE.remove();
25
+ });
26
+ },
27
+
28
+ _merge: function() {
29
+ var result = {};
30
+
31
+ for (var i = 0; i < arguments.length; ++i) {
32
+ var source = arguments[i];
33
+
34
+ for (var key in source) {
35
+ if (Object.prototype.hasOwnProperty.call(source, key)) {
36
+ if (Object.prototype.toString.call(source[key]) === '[object Object]') {
37
+ result[key] = HugeRTERails._merge(result[key], source[key]);
38
+ } else {
39
+ result[key] = source[key];
40
+ }
41
+ }
42
+ }
43
+ }
44
+
45
+ return result;
46
+ }
47
+ };
48
+
49
+ if (typeof Turbolinks != 'undefined' && Turbolinks.supported) {
50
+ HugeRTERails.setupTurbolinks();
51
+ }