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.
- checksums.yaml +7 -0
- data/LICENSE +21 -0
- data/README.md +171 -0
- data/Rakefile +64 -0
- data/app/assets/javascripts/hugerte/rails.js +51 -0
- data/app/assets/source/hugerte/hugerte.js +31756 -0
- data/app/assets/sprockets/hugerte/preinit.js.erb +4 -0
- data/app/assets/sprockets/hugerte.js +3 -0
- data/lib/hugerte/rails/asset_installer/compile.rb +44 -0
- data/lib/hugerte/rails/asset_installer/copy.rb +54 -0
- data/lib/hugerte/rails/asset_installer/copy_no_preserve.rb +14 -0
- data/lib/hugerte/rails/asset_installer.rb +64 -0
- data/lib/hugerte/rails/asset_manifest/json_manifest.rb +62 -0
- data/lib/hugerte/rails/asset_manifest/null_manifest.rb +12 -0
- data/lib/hugerte/rails/asset_manifest/propshaft_manifest.rb +43 -0
- data/lib/hugerte/rails/asset_manifest/yaml_manifest.rb +43 -0
- data/lib/hugerte/rails/asset_manifest.rb +44 -0
- data/lib/hugerte/rails/configuration.rb +162 -0
- data/lib/hugerte/rails/configuration_file.rb +50 -0
- data/lib/hugerte/rails/engine.rb +93 -0
- data/lib/hugerte/rails/environment.rb +23 -0
- data/lib/hugerte/rails/helper.rb +89 -0
- data/lib/hugerte/rails/propshaft/asset.rb +11 -0
- data/lib/hugerte/rails/version.rb +6 -0
- data/lib/hugerte/rails.rb +27 -0
- data/lib/hugerte-rails.rb +1 -0
- data/lib/tasks/hugerte-assets.rake +16 -0
- data/vendor/assets/config/hugerte-rails.manifest.js +3 -0
- data/vendor/assets/javascripts/hugerte/CHANGELOG.md +125 -0
- data/vendor/assets/javascripts/hugerte/README.md +21 -0
- data/vendor/assets/javascripts/hugerte/bower.json +27 -0
- data/vendor/assets/javascripts/hugerte/composer.json +52 -0
- data/vendor/assets/javascripts/hugerte/hugerte.d.ts +3252 -0
- data/vendor/assets/javascripts/hugerte/hugerte.js +339 -0
- data/vendor/assets/javascripts/hugerte/icons/default/icons.js +1 -0
- data/vendor/assets/javascripts/hugerte/icons/default/index.js +7 -0
- data/vendor/assets/javascripts/hugerte/license.txt +22 -0
- data/vendor/assets/javascripts/hugerte/models/dom/index.js +7 -0
- data/vendor/assets/javascripts/hugerte/models/dom/model.js +7 -0
- data/vendor/assets/javascripts/hugerte/package.json +32 -0
- data/vendor/assets/javascripts/hugerte/plugins/accordion/index.js +7 -0
- data/vendor/assets/javascripts/hugerte/plugins/accordion/plugin.js +7 -0
- data/vendor/assets/javascripts/hugerte/plugins/advlist/index.js +7 -0
- data/vendor/assets/javascripts/hugerte/plugins/advlist/plugin.js +7 -0
- data/vendor/assets/javascripts/hugerte/plugins/anchor/index.js +7 -0
- data/vendor/assets/javascripts/hugerte/plugins/anchor/plugin.js +7 -0
- data/vendor/assets/javascripts/hugerte/plugins/autolink/index.js +7 -0
- data/vendor/assets/javascripts/hugerte/plugins/autolink/plugin.js +7 -0
- data/vendor/assets/javascripts/hugerte/plugins/autoresize/index.js +7 -0
- data/vendor/assets/javascripts/hugerte/plugins/autoresize/plugin.js +7 -0
- data/vendor/assets/javascripts/hugerte/plugins/autosave/index.js +7 -0
- data/vendor/assets/javascripts/hugerte/plugins/autosave/plugin.js +7 -0
- data/vendor/assets/javascripts/hugerte/plugins/charmap/index.js +7 -0
- data/vendor/assets/javascripts/hugerte/plugins/charmap/plugin.js +7 -0
- data/vendor/assets/javascripts/hugerte/plugins/code/index.js +7 -0
- data/vendor/assets/javascripts/hugerte/plugins/code/plugin.js +7 -0
- data/vendor/assets/javascripts/hugerte/plugins/codesample/index.js +7 -0
- data/vendor/assets/javascripts/hugerte/plugins/codesample/plugin.js +14 -0
- data/vendor/assets/javascripts/hugerte/plugins/directionality/index.js +7 -0
- data/vendor/assets/javascripts/hugerte/plugins/directionality/plugin.js +7 -0
- data/vendor/assets/javascripts/hugerte/plugins/emoticons/index.js +7 -0
- data/vendor/assets/javascripts/hugerte/plugins/emoticons/js/emojiimages.js +3 -0
- data/vendor/assets/javascripts/hugerte/plugins/emoticons/js/emojis.js +2 -0
- data/vendor/assets/javascripts/hugerte/plugins/emoticons/plugin.js +7 -0
- data/vendor/assets/javascripts/hugerte/plugins/fullscreen/index.js +7 -0
- data/vendor/assets/javascripts/hugerte/plugins/fullscreen/plugin.js +7 -0
- data/vendor/assets/javascripts/hugerte/plugins/help/index.js +7 -0
- data/vendor/assets/javascripts/hugerte/plugins/help/js/i18n/keynav/ar.js +90 -0
- data/vendor/assets/javascripts/hugerte/plugins/help/js/i18n/keynav/bg_BG.js +90 -0
- data/vendor/assets/javascripts/hugerte/plugins/help/js/i18n/keynav/ca.js +90 -0
- data/vendor/assets/javascripts/hugerte/plugins/help/js/i18n/keynav/cs.js +90 -0
- data/vendor/assets/javascripts/hugerte/plugins/help/js/i18n/keynav/da.js +90 -0
- data/vendor/assets/javascripts/hugerte/plugins/help/js/i18n/keynav/de.js +90 -0
- data/vendor/assets/javascripts/hugerte/plugins/help/js/i18n/keynav/el.js +90 -0
- data/vendor/assets/javascripts/hugerte/plugins/help/js/i18n/keynav/en.js +90 -0
- data/vendor/assets/javascripts/hugerte/plugins/help/js/i18n/keynav/es.js +90 -0
- data/vendor/assets/javascripts/hugerte/plugins/help/js/i18n/keynav/eu.js +90 -0
- data/vendor/assets/javascripts/hugerte/plugins/help/js/i18n/keynav/fa.js +90 -0
- data/vendor/assets/javascripts/hugerte/plugins/help/js/i18n/keynav/fi.js +90 -0
- data/vendor/assets/javascripts/hugerte/plugins/help/js/i18n/keynav/fr_FR.js +90 -0
- data/vendor/assets/javascripts/hugerte/plugins/help/js/i18n/keynav/he_IL.js +90 -0
- data/vendor/assets/javascripts/hugerte/plugins/help/js/i18n/keynav/hi.js +90 -0
- data/vendor/assets/javascripts/hugerte/plugins/help/js/i18n/keynav/hr.js +90 -0
- data/vendor/assets/javascripts/hugerte/plugins/help/js/i18n/keynav/hu_HU.js +90 -0
- data/vendor/assets/javascripts/hugerte/plugins/help/js/i18n/keynav/id.js +90 -0
- data/vendor/assets/javascripts/hugerte/plugins/help/js/i18n/keynav/it.js +90 -0
- data/vendor/assets/javascripts/hugerte/plugins/help/js/i18n/keynav/ja.js +90 -0
- data/vendor/assets/javascripts/hugerte/plugins/help/js/i18n/keynav/kk.js +90 -0
- data/vendor/assets/javascripts/hugerte/plugins/help/js/i18n/keynav/ko_KR.js +90 -0
- data/vendor/assets/javascripts/hugerte/plugins/help/js/i18n/keynav/ms.js +90 -0
- data/vendor/assets/javascripts/hugerte/plugins/help/js/i18n/keynav/nb_NO.js +90 -0
- data/vendor/assets/javascripts/hugerte/plugins/help/js/i18n/keynav/nl.js +90 -0
- data/vendor/assets/javascripts/hugerte/plugins/help/js/i18n/keynav/pl.js +90 -0
- data/vendor/assets/javascripts/hugerte/plugins/help/js/i18n/keynav/pt_BR.js +90 -0
- data/vendor/assets/javascripts/hugerte/plugins/help/js/i18n/keynav/pt_PT.js +90 -0
- data/vendor/assets/javascripts/hugerte/plugins/help/js/i18n/keynav/ro.js +90 -0
- data/vendor/assets/javascripts/hugerte/plugins/help/js/i18n/keynav/ru.js +90 -0
- data/vendor/assets/javascripts/hugerte/plugins/help/js/i18n/keynav/sk.js +90 -0
- data/vendor/assets/javascripts/hugerte/plugins/help/js/i18n/keynav/sl_SI.js +90 -0
- data/vendor/assets/javascripts/hugerte/plugins/help/js/i18n/keynav/sv_SE.js +90 -0
- data/vendor/assets/javascripts/hugerte/plugins/help/js/i18n/keynav/th_TH.js +90 -0
- data/vendor/assets/javascripts/hugerte/plugins/help/js/i18n/keynav/tr.js +90 -0
- data/vendor/assets/javascripts/hugerte/plugins/help/js/i18n/keynav/uk.js +90 -0
- data/vendor/assets/javascripts/hugerte/plugins/help/js/i18n/keynav/vi.js +90 -0
- data/vendor/assets/javascripts/hugerte/plugins/help/js/i18n/keynav/zh_CN.js +84 -0
- data/vendor/assets/javascripts/hugerte/plugins/help/js/i18n/keynav/zh_TW.js +90 -0
- data/vendor/assets/javascripts/hugerte/plugins/help/plugin.js +7 -0
- data/vendor/assets/javascripts/hugerte/plugins/image/index.js +7 -0
- data/vendor/assets/javascripts/hugerte/plugins/image/plugin.js +7 -0
- data/vendor/assets/javascripts/hugerte/plugins/importcss/index.js +7 -0
- data/vendor/assets/javascripts/hugerte/plugins/importcss/plugin.js +7 -0
- data/vendor/assets/javascripts/hugerte/plugins/insertdatetime/index.js +7 -0
- data/vendor/assets/javascripts/hugerte/plugins/insertdatetime/plugin.js +7 -0
- data/vendor/assets/javascripts/hugerte/plugins/link/index.js +7 -0
- data/vendor/assets/javascripts/hugerte/plugins/link/plugin.js +7 -0
- data/vendor/assets/javascripts/hugerte/plugins/lists/index.js +7 -0
- data/vendor/assets/javascripts/hugerte/plugins/lists/plugin.js +7 -0
- data/vendor/assets/javascripts/hugerte/plugins/media/index.js +7 -0
- data/vendor/assets/javascripts/hugerte/plugins/media/plugin.js +7 -0
- data/vendor/assets/javascripts/hugerte/plugins/nonbreaking/index.js +7 -0
- data/vendor/assets/javascripts/hugerte/plugins/nonbreaking/plugin.js +7 -0
- data/vendor/assets/javascripts/hugerte/plugins/pagebreak/index.js +7 -0
- data/vendor/assets/javascripts/hugerte/plugins/pagebreak/plugin.js +7 -0
- data/vendor/assets/javascripts/hugerte/plugins/preview/index.js +7 -0
- data/vendor/assets/javascripts/hugerte/plugins/preview/plugin.js +7 -0
- data/vendor/assets/javascripts/hugerte/plugins/quickbars/index.js +7 -0
- data/vendor/assets/javascripts/hugerte/plugins/quickbars/plugin.js +7 -0
- data/vendor/assets/javascripts/hugerte/plugins/save/index.js +7 -0
- data/vendor/assets/javascripts/hugerte/plugins/save/plugin.js +7 -0
- data/vendor/assets/javascripts/hugerte/plugins/searchreplace/index.js +7 -0
- data/vendor/assets/javascripts/hugerte/plugins/searchreplace/plugin.js +7 -0
- data/vendor/assets/javascripts/hugerte/plugins/table/index.js +7 -0
- data/vendor/assets/javascripts/hugerte/plugins/table/plugin.js +7 -0
- data/vendor/assets/javascripts/hugerte/plugins/template/index.js +7 -0
- data/vendor/assets/javascripts/hugerte/plugins/template/plugin.js +7 -0
- data/vendor/assets/javascripts/hugerte/plugins/visualblocks/index.js +7 -0
- data/vendor/assets/javascripts/hugerte/plugins/visualblocks/plugin.js +7 -0
- data/vendor/assets/javascripts/hugerte/plugins/visualchars/index.js +7 -0
- data/vendor/assets/javascripts/hugerte/plugins/visualchars/plugin.js +7 -0
- data/vendor/assets/javascripts/hugerte/plugins/wordcount/index.js +7 -0
- data/vendor/assets/javascripts/hugerte/plugins/wordcount/plugin.js +7 -0
- data/vendor/assets/javascripts/hugerte/skins/content/dark/content.css +1 -0
- data/vendor/assets/javascripts/hugerte/skins/content/dark/content.js +2 -0
- data/vendor/assets/javascripts/hugerte/skins/content/dark/content.min.css +1 -0
- data/vendor/assets/javascripts/hugerte/skins/content/default/content.css +1 -0
- data/vendor/assets/javascripts/hugerte/skins/content/default/content.js +2 -0
- data/vendor/assets/javascripts/hugerte/skins/content/default/content.min.css +1 -0
- data/vendor/assets/javascripts/hugerte/skins/content/document/content.css +1 -0
- data/vendor/assets/javascripts/hugerte/skins/content/document/content.js +2 -0
- data/vendor/assets/javascripts/hugerte/skins/content/document/content.min.css +1 -0
- data/vendor/assets/javascripts/hugerte/skins/content/hugerte-5/content.css +1 -0
- data/vendor/assets/javascripts/hugerte/skins/content/hugerte-5/content.js +2 -0
- data/vendor/assets/javascripts/hugerte/skins/content/hugerte-5/content.min.css +1 -0
- data/vendor/assets/javascripts/hugerte/skins/content/hugerte-5-dark/content.css +1 -0
- data/vendor/assets/javascripts/hugerte/skins/content/hugerte-5-dark/content.js +2 -0
- data/vendor/assets/javascripts/hugerte/skins/content/hugerte-5-dark/content.min.css +1 -0
- data/vendor/assets/javascripts/hugerte/skins/content/writer/content.css +1 -0
- data/vendor/assets/javascripts/hugerte/skins/content/writer/content.js +2 -0
- data/vendor/assets/javascripts/hugerte/skins/content/writer/content.min.css +1 -0
- data/vendor/assets/javascripts/hugerte/skins/ui/hugerte-5/content.css +1 -0
- data/vendor/assets/javascripts/hugerte/skins/ui/hugerte-5/content.inline.css +1 -0
- data/vendor/assets/javascripts/hugerte/skins/ui/hugerte-5/content.inline.js +2 -0
- data/vendor/assets/javascripts/hugerte/skins/ui/hugerte-5/content.inline.min.css +1 -0
- data/vendor/assets/javascripts/hugerte/skins/ui/hugerte-5/content.js +2 -0
- data/vendor/assets/javascripts/hugerte/skins/ui/hugerte-5/content.min.css +1 -0
- data/vendor/assets/javascripts/hugerte/skins/ui/hugerte-5/skin.css +1 -0
- data/vendor/assets/javascripts/hugerte/skins/ui/hugerte-5/skin.js +2 -0
- data/vendor/assets/javascripts/hugerte/skins/ui/hugerte-5/skin.min.css +1 -0
- data/vendor/assets/javascripts/hugerte/skins/ui/hugerte-5/skin.shadowdom.css +1 -0
- data/vendor/assets/javascripts/hugerte/skins/ui/hugerte-5/skin.shadowdom.js +2 -0
- data/vendor/assets/javascripts/hugerte/skins/ui/hugerte-5/skin.shadowdom.min.css +1 -0
- data/vendor/assets/javascripts/hugerte/skins/ui/hugerte-5-dark/content.css +1 -0
- data/vendor/assets/javascripts/hugerte/skins/ui/hugerte-5-dark/content.inline.css +1 -0
- data/vendor/assets/javascripts/hugerte/skins/ui/hugerte-5-dark/content.inline.js +2 -0
- data/vendor/assets/javascripts/hugerte/skins/ui/hugerte-5-dark/content.inline.min.css +1 -0
- data/vendor/assets/javascripts/hugerte/skins/ui/hugerte-5-dark/content.js +2 -0
- data/vendor/assets/javascripts/hugerte/skins/ui/hugerte-5-dark/content.min.css +1 -0
- data/vendor/assets/javascripts/hugerte/skins/ui/hugerte-5-dark/skin.css +1 -0
- data/vendor/assets/javascripts/hugerte/skins/ui/hugerte-5-dark/skin.js +2 -0
- data/vendor/assets/javascripts/hugerte/skins/ui/hugerte-5-dark/skin.min.css +1 -0
- data/vendor/assets/javascripts/hugerte/skins/ui/hugerte-5-dark/skin.shadowdom.css +1 -0
- data/vendor/assets/javascripts/hugerte/skins/ui/hugerte-5-dark/skin.shadowdom.js +2 -0
- data/vendor/assets/javascripts/hugerte/skins/ui/hugerte-5-dark/skin.shadowdom.min.css +1 -0
- data/vendor/assets/javascripts/hugerte/skins/ui/oxide/content.css +1 -0
- data/vendor/assets/javascripts/hugerte/skins/ui/oxide/content.inline.css +1 -0
- data/vendor/assets/javascripts/hugerte/skins/ui/oxide/content.inline.js +2 -0
- data/vendor/assets/javascripts/hugerte/skins/ui/oxide/content.inline.min.css +1 -0
- data/vendor/assets/javascripts/hugerte/skins/ui/oxide/content.js +2 -0
- data/vendor/assets/javascripts/hugerte/skins/ui/oxide/content.min.css +1 -0
- data/vendor/assets/javascripts/hugerte/skins/ui/oxide/skin.css +1 -0
- data/vendor/assets/javascripts/hugerte/skins/ui/oxide/skin.js +2 -0
- data/vendor/assets/javascripts/hugerte/skins/ui/oxide/skin.min.css +1 -0
- data/vendor/assets/javascripts/hugerte/skins/ui/oxide/skin.shadowdom.css +1 -0
- data/vendor/assets/javascripts/hugerte/skins/ui/oxide/skin.shadowdom.js +2 -0
- data/vendor/assets/javascripts/hugerte/skins/ui/oxide/skin.shadowdom.min.css +1 -0
- data/vendor/assets/javascripts/hugerte/skins/ui/oxide-dark/content.css +1 -0
- data/vendor/assets/javascripts/hugerte/skins/ui/oxide-dark/content.inline.css +1 -0
- data/vendor/assets/javascripts/hugerte/skins/ui/oxide-dark/content.inline.js +2 -0
- data/vendor/assets/javascripts/hugerte/skins/ui/oxide-dark/content.inline.min.css +1 -0
- data/vendor/assets/javascripts/hugerte/skins/ui/oxide-dark/content.js +2 -0
- data/vendor/assets/javascripts/hugerte/skins/ui/oxide-dark/content.min.css +1 -0
- data/vendor/assets/javascripts/hugerte/skins/ui/oxide-dark/skin.css +1 -0
- data/vendor/assets/javascripts/hugerte/skins/ui/oxide-dark/skin.js +2 -0
- data/vendor/assets/javascripts/hugerte/skins/ui/oxide-dark/skin.min.css +1 -0
- data/vendor/assets/javascripts/hugerte/skins/ui/oxide-dark/skin.shadowdom.css +1 -0
- data/vendor/assets/javascripts/hugerte/skins/ui/oxide-dark/skin.shadowdom.js +2 -0
- data/vendor/assets/javascripts/hugerte/skins/ui/oxide-dark/skin.shadowdom.min.css +1 -0
- data/vendor/assets/javascripts/hugerte/themes/silver/index.js +7 -0
- data/vendor/assets/javascripts/hugerte/themes/silver/theme.js +339 -0
- 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,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,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
|
+
}
|