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
@@ -0,0 +1,23 @@
1
+ #
2
+ # Rails 4.2 and sprockets-rails 3.0.0 introduces behaviour whereby asset
3
+ # digests are enabled by default in development mode and any requests to
4
+ # undigested assets raise a NoDigestError.
5
+ #
6
+ # Since hugerte-rails uses undigested assets for dynamically loaded HugeRTE
7
+ # assets, we need to bypass this behaviour by returning an empty fingerprint
8
+ # for assets beneath hugerte/ that don't already have one.
9
+ #
10
+ # This module extends the Sprockets::Rails::Environment class defined at:
11
+ # https://github.com/rails/sprockets-rails/blob/master/lib/sprockets/rails/environment.rb
12
+ #
13
+ module HugeRTE::Rails::Environment
14
+ def path_fingerprint(path)
15
+ fingerprint = super
16
+ return fingerprint if fingerprint
17
+ return "" if path =~ /^hugerte\//
18
+ end
19
+ end
20
+
21
+ Sprockets::Rails::Environment.class_eval do
22
+ include HugeRTE::Rails::Environment
23
+ end
@@ -0,0 +1,89 @@
1
+ require "active_support/core_ext/hash/keys"
2
+
3
+ module HugeRTE::Rails
4
+ module Helper
5
+ # Initializes HugeRTE on the current page based on the global configuration.
6
+ #
7
+ # Custom options can be set via the options hash, which will be passed to
8
+ # the HugeRTE init function.
9
+ #
10
+ # By default, all textareas with a class of "hugerte" will have the HugeRTE
11
+ # editor applied. The current locale will also be used as the language when
12
+ # HugeRTE language files are available, falling back to English if not
13
+ # available. The :editor_selector and :language options can be used to
14
+ # override these defaults.
15
+ #
16
+ # @example
17
+ # <%= hugerte(selector: "editorClass", theme: "inlite") %>
18
+ def hugerte(config=:default, options={})
19
+ javascript_tag(nonce: true) do
20
+ unless @_hugerte_configurations_added
21
+ concat hugerte_configurations_javascript
22
+ concat "\n"
23
+ @_hugerte_configurations_added = true
24
+ end
25
+
26
+ concat hugerte_javascript(config, options)
27
+ end
28
+ end
29
+
30
+ # Returns the JavaScript code required to initialize HugeRTE.
31
+ def hugerte_javascript(config=:default, options={})
32
+ options, config = config, :default if config.is_a?(Hash)
33
+ options = Configuration.new(options)
34
+
35
+ "HugeRTERails.initialize('#{config}', #{options.to_javascript});".html_safe
36
+ end
37
+
38
+ # Returns the JavaScript code for initializing each configuration defined within hugerte.yml.
39
+ def hugerte_configurations_javascript(options={})
40
+ javascript = []
41
+
42
+ HugeRTE::Rails.each_configuration do |name, config|
43
+ config = config.merge(options) if options.present?
44
+ javascript << "HugeRTERails.configuration.#{name} = #{config.to_javascript};".html_safe
45
+ end
46
+
47
+ safe_join(javascript, "\n")
48
+ end
49
+
50
+ # Returns the HugeRTE configuration object.
51
+ # It should be converted to JavaScript (via #to_javascript) for use within JavaScript.
52
+ def hugerte_configuration(config=:default, options={})
53
+ options, config = config, :default if config.is_a?(Hash)
54
+ options.stringify_keys!
55
+
56
+ base_configuration = HugeRTE::Rails.configuration
57
+
58
+ if base_configuration.is_a?(MultipleConfiguration)
59
+ base_configuration = base_configuration.fetch(config)
60
+ end
61
+
62
+ base_configuration.merge(options)
63
+ end
64
+
65
+ # Includes HugeRTE javascript assets via a script tag.
66
+ def hugerte_assets(options=Rails.application.config.hugerte.default_script_attributes)
67
+ if defined?(Sprockets)
68
+ javascript_include_tag("hugerte", options)
69
+ else
70
+ safe_join([
71
+ hugerte_preinit,
72
+ javascript_include_tag("hugerte/hugerte", options),
73
+ javascript_include_tag("hugerte/rails", options)
74
+ ], "\n")
75
+ end
76
+ end
77
+
78
+ # Configures where dynamically loaded HugeRTE assets are located and named
79
+ def hugerte_preinit(base=HugeRTE::Rails::Engine.base)
80
+ js = "window.hugerte = window.hugerte || { base: '#{base}', suffix: '' };"
81
+ javascript_tag(js, nonce: true)
82
+ end
83
+
84
+ # Allow methods to be called as module functions:
85
+ # e.g. HugeRTE::Rails.hugerte_javascript
86
+ module_function :hugerte, :hugerte_javascript, :hugerte_configurations_javascript, :hugerte_configuration, :hugerte_preinit
87
+ public :hugerte, :hugerte_javascript, :hugerte_configurations_javascript, :hugerte_configuration, :hugerte_preinit
88
+ end
89
+ end
@@ -0,0 +1,11 @@
1
+ require "propshaft/asset"
2
+
3
+ class Propshaft::Asset
4
+ alias fresh_without_tinymce_exception? fresh?
5
+
6
+ # Allow TinyMCE assets to be accessed (in development mode) without a digest
7
+ def fresh?(digest)
8
+ fresh_without_tinymce_exception?(digest) ||
9
+ (digest.blank? && logical_path.to_s.starts_with?("hugerte/"))
10
+ end
11
+ end
@@ -0,0 +1,6 @@
1
+ module HugeRTE
2
+ module Rails
3
+ VERSION = "1.0.9.1"
4
+ HUGERTE_VERSION = "1.0.9"
5
+ end
6
+ end
@@ -0,0 +1,27 @@
1
+ module HugeRTE
2
+ module Rails
3
+ require "hugerte/rails/engine"
4
+ require "hugerte/rails/version"
5
+ require "hugerte/rails/configuration"
6
+ require "hugerte/rails/configuration_file"
7
+ require "hugerte/rails/helper"
8
+ require "hugerte/rails/environment" if defined?(Sprockets::Rails::Environment)
9
+
10
+ def self.configuration
11
+ @configuration ||= ConfigurationFile.new(Engine.config_path)
12
+ @configuration.respond_to?(:configuration) ? @configuration.configuration : @configuration
13
+ end
14
+
15
+ def self.configuration=(configuration)
16
+ @configuration = configuration
17
+ end
18
+
19
+ def self.each_configuration(&block)
20
+ if configuration.is_a?(MultipleConfiguration)
21
+ configuration.each(&block)
22
+ else
23
+ yield :default, configuration
24
+ end
25
+ end
26
+ end
27
+ end
@@ -0,0 +1 @@
1
+ require "hugerte/rails"
@@ -0,0 +1,16 @@
1
+ assets_task = Rake::Task.task_defined?('assets:precompile:primary') ? 'assets:precompile:primary' : 'assets:precompile'
2
+
3
+ Rake::Task[assets_task].enhance do
4
+ require "hugerte/rails/asset_installer"
5
+
6
+ assets = Pathname.new(File.expand_path(File.dirname(__FILE__) + "/../../vendor/assets/javascripts/hugerte"))
7
+
8
+ config = Rails.application.config
9
+ target = File.join(Rails.public_path, config.assets.prefix)
10
+ manifest = config.assets.manifest
11
+
12
+ installer = HugeRTE::Rails::AssetInstaller.new(assets, target, manifest)
13
+ installer.log_level = Logger::INFO
14
+ installer.strategy = config.hugerte.install
15
+ installer.install
16
+ end
@@ -0,0 +1,3 @@
1
+ //= link_tree ../javascripts/hugerte .js
2
+ //= link_tree ../javascripts/hugerte .css
3
+ //= link_tree ../javascripts/hugerte .woff
@@ -0,0 +1,125 @@
1
+ # Changelog
2
+ All notable changes to this project will be documented in this file.
3
+
4
+ The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/),
5
+ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html).
6
+
7
+ ## 1.0.9 - 2025-03-15
8
+
9
+ ### Fixed
10
+ - PrismJS license info has not been present in the codesample plugin files.
11
+
12
+ ## 1.0.8 - 2025-03-11
13
+
14
+ ### Fixed
15
+ - Updated dependencies including those with security vulnerabilities.
16
+ - Switched from a polynomial regular expression possibly creating a ReDoS vulnerabiliy to the native string trim method in hugerte.utils.Tools.trim.
17
+
18
+ ## 1.0.7 - 2025-01-11
19
+
20
+ ### Fixed
21
+ - Fixed bundling HugeRTE together with a skin. (Tested with Vite/ES6 only.)
22
+ - Dompurify license info has been present in files not containing Dompurify (e.g. plugins).
23
+
24
+ ## 1.0.6 - 2024-12-20
25
+
26
+ ### Fixed
27
+ - Dompurify license info has not been present in the minified build.
28
+
29
+ ## 1.0.5 - 2024-12-19
30
+
31
+ ### Fixed
32
+ - Fixed links to TinyMCE docs #GH-29
33
+
34
+ ### Removed
35
+ - Slimmed README.md. Docs are now in the separate hugerte/hugerte-docs repo.
36
+
37
+ ## 1.0.4 - 2024-10-28
38
+
39
+ ### Added
40
+ - Copyright and license info has been added to the build header. #GH-27
41
+
42
+ ### Fixed
43
+ - The used dompurify version has been upgraded, fixing the issue that invalid HTML elements within an `svg` element weren't removed. #GH-26
44
+
45
+ ## 1.0.3 - 2024-10-04
46
+
47
+ ### Improved
48
+ - Updated references to bad HugeRTE 1.0.0 build in README.md #GH-23
49
+
50
+ ## 1.0.2 - 2024-10-04
51
+
52
+ ### Fixed
53
+ - The license field in composer.json was set to MIT-only instead of MIT. The `-only` prefix makes sense for GPL licenses but not MIT.
54
+
55
+ ## 1.0.1 - 2024-10-04
56
+
57
+ ### Improved
58
+ - The package.json and composer.json files now include better metadata.
59
+
60
+ ### Fixed
61
+ - Wrong files were published at npm. #GH-23
62
+
63
+ ## 1.0.0 - 2024-10-01
64
+
65
+ ### Added
66
+ - New custom tooltip functionality, tooltip will be shown when hovering with a mouse or with keyboard focus. #TINY-9275
67
+ - New `sandbox_iframes_exclusions` option that holds a list of URL host names to be excluded from iframe sandboxing when `sandbox_iframes` is set to `true`. #TINY-10350
68
+ - Added 'getAllEmojis' api function to the emoticons plugin #TINY-10572
69
+ - Element preset support for the `valid_children` option and Schema.addValidChildren API. #TINY-9979
70
+ - A new `trigger` property for block text pattern configurations, allowing pattern activation with either Space or Enter keys. #TINY-10324
71
+ - Added onFocus callback for CustomEditor dialog component. #TINY-10596
72
+ - Added icons for the import from Word, export to Word and export to PDF premium plugins. #TINY-10612
73
+ - Added `data` to Schema as a valid element. #TINY-10611
74
+ - More advanced schema config for custom elements. #TINY-9980
75
+ - Added custom tooltip for autocompleter, now visible on both mouse hover and keyboard focus, except single column cases. #TINY-9638
76
+ - Added importword, exportpdf and exportword menu items to default file menu. #TINY-10670
77
+
78
+ ### Improved
79
+ - Included keyboard shortcut in custom tooltip for `ToolbarButton` and `ToolbarToggleButton`. #TINY-10487
80
+ - Improved showing which element has focus for keyboard navigation. #TINY-9176
81
+ - Custom tooltips will now show for items in `collection` which is rendered inside a dialog, on mouse hover and keyboard focus. #TINY-9637
82
+ - Autocompleter will now work with IMEs. #TINY-10637
83
+ - Make table ghost element better reflect height changes when resizing. #TINY-10658
84
+
85
+ ### Changed
86
+ - `convert_unsafe_embeds` editor option is now defaulted to `true`. #TINY-10351
87
+ - `sandbox_iframes` editor option is now defaulted to `true`. #TINY-10350
88
+ - The DOMUtils.isEmpty API function has been modified to consider nodes containing only comments as empty. #TINY-10459
89
+ - The `highlight_on_focus` option now defaults to true, adding a focus outline to every editor. #TINY-10574
90
+ - Delay before the tooltip to show up, from 800ms to 300ms. #TINY-10475
91
+ - Now `tox-view__pane` has `position: relative` instead of `static`. #TINY-10561
92
+ - Update outbound link for statusbar Tiny logo #TINY-10494
93
+ - Remove the height field from the `table` plugin cell dialog. The `table` plugin row dialog now controls the row height by setting the height on the `tr` element, not the `td` elements. #TINY-10617
94
+ - Change table height resizing handling to remove heights from `td`/`th` elements and only apply to `tr` elements. #TINY-10589
95
+ - Removed incorrect `aria-placeholder` attribute from editor body when `placeholder` option is set. #TINY-10452
96
+ - The `tooltip` property for dialog's footer `togglebutton` is now optional. #TINY-10672
97
+ - `TinyMCE`, `tinymce`, `Tinymce`, `TinyMce`, `tinyMCE`, `tinyMce` have been replaced by appropiate HugeRTE variants, especially the global `tinymce` object #GH-8
98
+
99
+ ### Removed
100
+ - Removed the deprecated `remove_trailing_brs` option from DomParser. #TINY-10454
101
+ - Removed `title` attribute for buttons with visible label. #TINY-10453
102
+ - Removed `InsertOrderedList` and `InsertUnorderedList` from core. #TINY-10644
103
+ - Removed `closeButton` from `NotificationSpec`, close button in notification is now rendered by default. #TINY-10646
104
+ - The autocompleter `ch` configuration property has been removed. Use the `trigger` property instead. #TINY-8929
105
+ - The `promotion` init option has been removed. HugeRTE doesn't show an upgrade button regardless of it being present or not.
106
+
107
+ ### Fixed
108
+ - When deleting the last row in a table, the cursor would jump to the first cell (top left), instead of moving to the next adjacent cell in some cases. #TINY-6309
109
+ - Heading formatting would be partially applied to the content within the `summary` element when the caret was positioned between words. #TINY-10312
110
+ - Moving focus to the outside of the editor after having clicked a menu would not fire a `blur` event as expected. #TINY-10310
111
+ - Autocomplete would sometimes cause corrupt data when starting during text composition. #TINY-10317
112
+ - Inline mode with persisted toolbar would show regardless of the skin being loaded, causing css issues #TINY-10482
113
+ - Table classes couldn't be removed via setting an empty value in `table_class_list`. Also fixed being forced to pick the first class option. #TINY-6653
114
+ - Directly right clicking on a ol's li in FireFox didn't enable the button `List Properties...` in the context menu. #TINY-10490
115
+ - The `link_default_target` option wasn't considered when inserting a link via `quicklink` toolbar. #TINY-10439
116
+ - When inline editor toolbar wrapped to multiple lines the top wasn't always calculated correctly. #TINY-10580
117
+ - Removed manually dispatching dragend event on drop in Firefox. #TINY-10389
118
+ - Slovenian help dialog content had a dot in the wrong place. #TINY-10601
119
+ - Pressing Backspace at the start of an empty `summary` element within a `details` element nested in a list item no longer removes the `summary` element. #TINY-10303
120
+ - The toolbar width was miscalculated for the inline editor positioned inside a scrollable container. #TINY-10581
121
+ - Fixed incorrect object processor for `event_root` option. #TINY-10433
122
+ - Adding newline after using `selection.setContent` to insert a block element would throw an unhandled exception. #TINY-10560
123
+ - Floating toolbar buttons in inline editor incorrectly wrapped into multiple rows on window resizing or zooming. #TINY-10570
124
+ - When setting table border width and `table_style_by_css` is true, only the border attribute is set to 0 and border-width styling is no longer used #TINY-10308
125
+
@@ -0,0 +1,21 @@
1
+ # HugeRTE
2
+
3
+ The 100% free fork of the world's #1 open source rich text editor.
4
+
5
+ Used and trusted by millions of developers, [TinyMCE](https://github.com/tinymce/tinymce) (the original project we've forked) is the world’s most customizable, scalable, and flexible rich text editor. However, they changed the license of TinyMCE 7 to GPLv2+ (or a commercial license) while it has been MIT for TinyMCE 6 and LGPL for older versions. This creates problems for users (see [the discussion](https://github.com/tinymce/tinymce/issues/9453)) so a fork has been created here. It has originally been named HugeMCE, however, due to [potential trademark confusion with TinyMCE](https://github.com/hugerte/hugerte/issues/1#issuecomment-2373423311), it has been renamed to HugeRTE before its publishment to npm.
6
+
7
+ ## Documentation
8
+
9
+ You can find the documentation [on the dedicated repo](https://github.com/hugerte/hugerte-docs).
10
+
11
+ ## Demo
12
+
13
+ Visit the [HugeRTE website](https://hugerte.org) to quickly play around with the editor.
14
+
15
+ ## License
16
+
17
+ [MIT](LICENSE.TXT)
18
+
19
+ ## Compiling and contributing
20
+
21
+ In 2019 TinyMCE made the decision to transition their codebase to a monorepo. For information on compiling and contributing, see: [contribution guidelines](https://github.com/hugerte/hugerte/blob/master/CONTRIBUTING.md).
@@ -0,0 +1,27 @@
1
+ {
2
+ "name": "hugerte",
3
+ "description": "Web based JavaScript HTML WYSIWYG editor control.",
4
+ "license": "MIT",
5
+ "keywords": [
6
+ "wysiwyg",
7
+ "hugerte",
8
+ "richtext",
9
+ "javascript",
10
+ "html",
11
+ "text",
12
+ "rich editor",
13
+ "rich text editor",
14
+ "rte",
15
+ "rich text",
16
+ "contenteditable",
17
+ "editing"
18
+ ],
19
+ "homepage": "https:/hugerte.org/",
20
+ "ignore": [
21
+ "README.md",
22
+ "composer.json",
23
+ "package.json",
24
+ ".npmignore",
25
+ "CHANGELOG.md"
26
+ ]
27
+ }
@@ -0,0 +1,52 @@
1
+ {
2
+ "name": "hugerte/hugerte",
3
+ "version": "1.0.9",
4
+ "description": "Web based JavaScript HTML WYSIWYG editor control.",
5
+ "license": [
6
+ "MIT"
7
+ ],
8
+ "keywords": [
9
+ "wysiwyg",
10
+ "hugerte",
11
+ "richtext",
12
+ "javascript",
13
+ "html",
14
+ "text",
15
+ "rich editor",
16
+ "rich text editor",
17
+ "rte",
18
+ "rich text",
19
+ "contenteditable",
20
+ "editing"
21
+ ],
22
+ "homepage": "https://hugerte.org/",
23
+ "type": "component",
24
+ "extra": {
25
+ "component": {
26
+ "scripts": [
27
+ "hugerte.js",
28
+ "plugins/*/plugin.js",
29
+ "themes/*/theme.js",
30
+ "models/*/model.js",
31
+ "icons/*/icons.js"
32
+ ],
33
+ "files": [
34
+ "hugerte.min.js",
35
+ "plugins/*/plugin.min.js",
36
+ "themes/*/theme.min.js",
37
+ "models/*/model.min.js",
38
+ "skins/**",
39
+ "icons/*/icons.min.js"
40
+ ]
41
+ }
42
+ },
43
+ "archive": {
44
+ "exclude": [
45
+ "README.md",
46
+ "bower.js",
47
+ "package.json",
48
+ ".npmignore",
49
+ "CHANGELOG.md"
50
+ ]
51
+ }
52
+ }