tinymce-rails 6.8.5 → 7.0.0.1
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/README.md +11 -11
- data/app/assets/source/tinymce/tinymce.js +2406 -2249
- data/lib/tinymce/rails/asset_installer/copy_no_preserve.rb +1 -1
- data/lib/tinymce/rails/asset_installer.rb +4 -4
- data/lib/tinymce/rails/asset_manifest.rb +108 -6
- data/lib/tinymce/rails/engine.rb +2 -15
- data/lib/tinymce/rails/helper.rb +5 -19
- data/lib/tinymce/rails/version.rb +2 -2
- data/lib/tinymce/rails.rb +2 -2
- data/vendor/assets/javascripts/tinymce/icons/default/icons.js +1 -1
- data/vendor/assets/javascripts/tinymce/license.md +6 -0
- data/vendor/assets/javascripts/tinymce/models/dom/model.js +2 -2
- data/vendor/assets/javascripts/tinymce/plugins/accordion/plugin.js +1 -1
- data/vendor/assets/javascripts/tinymce/plugins/advlist/plugin.js +2 -2
- data/vendor/assets/javascripts/tinymce/plugins/anchor/plugin.js +1 -1
- data/vendor/assets/javascripts/tinymce/plugins/autolink/plugin.js +1 -1
- data/vendor/assets/javascripts/tinymce/plugins/autoresize/plugin.js +1 -1
- data/vendor/assets/javascripts/tinymce/plugins/autosave/plugin.js +1 -1
- data/vendor/assets/javascripts/tinymce/plugins/charmap/plugin.js +1 -1
- data/vendor/assets/javascripts/tinymce/plugins/code/plugin.js +1 -1
- data/vendor/assets/javascripts/tinymce/plugins/codesample/plugin.js +1 -1
- data/vendor/assets/javascripts/tinymce/plugins/directionality/plugin.js +1 -1
- data/vendor/assets/javascripts/tinymce/plugins/emoticons/plugin.js +2 -2
- data/vendor/assets/javascripts/tinymce/plugins/fullscreen/plugin.js +2 -2
- data/vendor/assets/javascripts/tinymce/plugins/help/js/i18n/keynav/ar.js +1 -1
- data/vendor/assets/javascripts/tinymce/plugins/help/js/i18n/keynav/bg_BG.js +1 -1
- data/vendor/assets/javascripts/tinymce/plugins/help/js/i18n/keynav/ca.js +1 -1
- data/vendor/assets/javascripts/tinymce/plugins/help/js/i18n/keynav/cs.js +1 -1
- data/vendor/assets/javascripts/tinymce/plugins/help/js/i18n/keynav/da.js +1 -1
- data/vendor/assets/javascripts/tinymce/plugins/help/js/i18n/keynav/de.js +1 -1
- data/vendor/assets/javascripts/tinymce/plugins/help/js/i18n/keynav/el.js +1 -1
- data/vendor/assets/javascripts/tinymce/plugins/help/js/i18n/keynav/en.js +1 -1
- data/vendor/assets/javascripts/tinymce/plugins/help/js/i18n/keynav/es.js +1 -1
- data/vendor/assets/javascripts/tinymce/plugins/help/js/i18n/keynav/eu.js +1 -1
- data/vendor/assets/javascripts/tinymce/plugins/help/js/i18n/keynav/fa.js +1 -1
- data/vendor/assets/javascripts/tinymce/plugins/help/js/i18n/keynav/fi.js +1 -1
- data/vendor/assets/javascripts/tinymce/plugins/help/js/i18n/keynav/fr_FR.js +1 -1
- data/vendor/assets/javascripts/tinymce/plugins/help/js/i18n/keynav/he_IL.js +1 -1
- data/vendor/assets/javascripts/tinymce/plugins/help/js/i18n/keynav/hi.js +1 -1
- data/vendor/assets/javascripts/tinymce/plugins/help/js/i18n/keynav/hr.js +1 -1
- data/vendor/assets/javascripts/tinymce/plugins/help/js/i18n/keynav/hu_HU.js +1 -1
- data/vendor/assets/javascripts/tinymce/plugins/help/js/i18n/keynav/id.js +1 -1
- data/vendor/assets/javascripts/tinymce/plugins/help/js/i18n/keynav/it.js +1 -1
- data/vendor/assets/javascripts/tinymce/plugins/help/js/i18n/keynav/ja.js +1 -1
- data/vendor/assets/javascripts/tinymce/plugins/help/js/i18n/keynav/kk.js +1 -1
- data/vendor/assets/javascripts/tinymce/plugins/help/js/i18n/keynav/ko_KR.js +1 -1
- data/vendor/assets/javascripts/tinymce/plugins/help/js/i18n/keynav/ms.js +1 -1
- data/vendor/assets/javascripts/tinymce/plugins/help/js/i18n/keynav/nb_NO.js +1 -1
- data/vendor/assets/javascripts/tinymce/plugins/help/js/i18n/keynav/nl.js +1 -1
- data/vendor/assets/javascripts/tinymce/plugins/help/js/i18n/keynav/pl.js +1 -1
- data/vendor/assets/javascripts/tinymce/plugins/help/js/i18n/keynav/pt_BR.js +1 -1
- data/vendor/assets/javascripts/tinymce/plugins/help/js/i18n/keynav/pt_PT.js +1 -1
- data/vendor/assets/javascripts/tinymce/plugins/help/js/i18n/keynav/ro.js +1 -1
- data/vendor/assets/javascripts/tinymce/plugins/help/js/i18n/keynav/ru.js +1 -1
- data/vendor/assets/javascripts/tinymce/plugins/help/js/i18n/keynav/sk.js +1 -1
- data/vendor/assets/javascripts/tinymce/plugins/help/js/i18n/keynav/sl_SI.js +2 -2
- data/vendor/assets/javascripts/tinymce/plugins/help/js/i18n/keynav/sv_SE.js +1 -1
- data/vendor/assets/javascripts/tinymce/plugins/help/js/i18n/keynav/th_TH.js +1 -1
- data/vendor/assets/javascripts/tinymce/plugins/help/js/i18n/keynav/tr.js +1 -1
- data/vendor/assets/javascripts/tinymce/plugins/help/js/i18n/keynav/uk.js +1 -1
- data/vendor/assets/javascripts/tinymce/plugins/help/js/i18n/keynav/vi.js +1 -1
- data/vendor/assets/javascripts/tinymce/plugins/help/js/i18n/keynav/zh_CN.js +1 -1
- data/vendor/assets/javascripts/tinymce/plugins/help/js/i18n/keynav/zh_TW.js +1 -1
- data/vendor/assets/javascripts/tinymce/plugins/help/plugin.js +2 -2
- data/vendor/assets/javascripts/tinymce/plugins/image/plugin.js +1 -1
- data/vendor/assets/javascripts/tinymce/plugins/importcss/plugin.js +1 -1
- data/vendor/assets/javascripts/tinymce/plugins/insertdatetime/plugin.js +1 -1
- data/vendor/assets/javascripts/tinymce/plugins/link/plugin.js +2 -2
- data/vendor/assets/javascripts/tinymce/plugins/lists/plugin.js +2 -2
- data/vendor/assets/javascripts/tinymce/plugins/media/plugin.js +2 -2
- data/vendor/assets/javascripts/tinymce/plugins/nonbreaking/plugin.js +1 -1
- data/vendor/assets/javascripts/tinymce/plugins/pagebreak/plugin.js +1 -1
- data/vendor/assets/javascripts/tinymce/plugins/preview/plugin.js +1 -1
- data/vendor/assets/javascripts/tinymce/plugins/quickbars/plugin.js +1 -1
- data/vendor/assets/javascripts/tinymce/plugins/save/plugin.js +2 -2
- data/vendor/assets/javascripts/tinymce/plugins/searchreplace/plugin.js +2 -2
- data/vendor/assets/javascripts/tinymce/plugins/table/plugin.js +2 -2
- data/vendor/assets/javascripts/tinymce/plugins/visualblocks/plugin.js +1 -1
- data/vendor/assets/javascripts/tinymce/plugins/visualchars/plugin.js +1 -1
- data/vendor/assets/javascripts/tinymce/plugins/wordcount/plugin.js +1 -1
- data/vendor/assets/javascripts/tinymce/skins/ui/oxide/skin.css +1 -1
- data/vendor/assets/javascripts/tinymce/skins/ui/oxide/skin.js +1 -1
- data/vendor/assets/javascripts/tinymce/skins/ui/oxide/skin.min.css +1 -1
- data/vendor/assets/javascripts/tinymce/skins/ui/oxide-dark/skin.css +1 -1
- data/vendor/assets/javascripts/tinymce/skins/ui/oxide-dark/skin.js +1 -1
- data/vendor/assets/javascripts/tinymce/skins/ui/oxide-dark/skin.min.css +1 -1
- data/vendor/assets/javascripts/tinymce/skins/ui/tinymce-5/skin.css +1 -1
- data/vendor/assets/javascripts/tinymce/skins/ui/tinymce-5/skin.js +1 -1
- data/vendor/assets/javascripts/tinymce/skins/ui/tinymce-5/skin.min.css +1 -1
- data/vendor/assets/javascripts/tinymce/skins/ui/tinymce-5-dark/skin.css +1 -1
- data/vendor/assets/javascripts/tinymce/skins/ui/tinymce-5-dark/skin.js +1 -1
- data/vendor/assets/javascripts/tinymce/skins/ui/tinymce-5-dark/skin.min.css +1 -1
- data/vendor/assets/javascripts/tinymce/themes/silver/theme.js +2 -382
- data/vendor/assets/javascripts/tinymce/tinymce.d.ts +27 -15
- data/vendor/assets/javascripts/tinymce/tinymce.js +2 -382
- metadata +7 -14
- data/LICENSE +0 -19
- data/lib/tinymce/rails/asset_manifest/json_manifest.rb +0 -62
- data/lib/tinymce/rails/asset_manifest/null_manifest.rb +0 -12
- data/lib/tinymce/rails/asset_manifest/propshaft_manifest.rb +0 -43
- data/lib/tinymce/rails/asset_manifest/yaml_manifest.rb +0 -43
- data/lib/tinymce/rails/propshaft/asset.rb +0 -11
- data/vendor/assets/javascripts/tinymce/license.txt +0 -21
- data/vendor/assets/javascripts/tinymce/plugins/template/plugin.js +0 -4
- /data/app/assets/{sprockets → javascripts}/tinymce/preinit.js.erb +0 -0
- /data/app/assets/{sprockets → javascripts}/tinymce.js +0 -0
@@ -1,8 +1,8 @@
|
|
1
|
-
|
1
|
+
require "tinymce/rails/asset_manifest"
|
2
2
|
|
3
|
-
|
4
|
-
|
5
|
-
|
3
|
+
require "tinymce/rails/asset_installer/copy"
|
4
|
+
require "tinymce/rails/asset_installer/copy_no_preserve"
|
5
|
+
require "tinymce/rails/asset_installer/compile"
|
6
6
|
|
7
7
|
module TinyMCE
|
8
8
|
module Rails
|
@@ -4,8 +4,7 @@ module TinyMCE
|
|
4
4
|
attr_reader :file
|
5
5
|
|
6
6
|
def self.load(manifest_path)
|
7
|
-
|
8
|
-
JsonManifest.try(manifest_path, ".sprockets-manifest*.json") ||
|
7
|
+
JsonManifest.try(manifest_path, ".sprockets-manifest*.json") ||
|
9
8
|
JsonManifest.try(manifest_path, "manifest*.json") ||
|
10
9
|
JsonManifest.try(manifest_path) ||
|
11
10
|
YamlManifest.try(manifest_path) ||
|
@@ -36,9 +35,112 @@ module TinyMCE
|
|
36
35
|
end
|
37
36
|
end
|
38
37
|
|
39
|
-
|
40
|
-
|
41
|
-
|
42
|
-
|
38
|
+
class YamlManifest < AssetManifest
|
39
|
+
def self.try(manifest_path)
|
40
|
+
yaml_file = File.join(manifest_path, "manifest.yml")
|
41
|
+
new(yaml_file) if File.exist?(yaml_file)
|
42
|
+
end
|
43
|
+
|
44
|
+
def initialize(file)
|
45
|
+
@file = file
|
46
|
+
@manifest = YAML.load_file(file)
|
47
|
+
end
|
48
|
+
|
49
|
+
def append(logical_path, file)
|
50
|
+
assets[logical_path] = logical_path
|
51
|
+
end
|
52
|
+
|
53
|
+
def remove(logical_path)
|
54
|
+
assets.delete(logical_path)
|
55
|
+
end
|
56
|
+
|
57
|
+
def remove_digest(logical_path)
|
58
|
+
asset_path(logical_path) do |digested, logical_path|
|
59
|
+
assets[logical_path] = logical_path
|
60
|
+
|
61
|
+
yield digested, logical_path if block_given?
|
62
|
+
end
|
63
|
+
end
|
64
|
+
|
65
|
+
def assets
|
66
|
+
@manifest
|
67
|
+
end
|
68
|
+
|
69
|
+
def dump(io=nil)
|
70
|
+
YAML.dump(@manifest, io)
|
71
|
+
end
|
72
|
+
|
73
|
+
def write
|
74
|
+
File.open(@file, "wb") { |f| dump(f) }
|
75
|
+
end
|
76
|
+
end
|
77
|
+
|
78
|
+
class JsonManifest < AssetManifest
|
79
|
+
def self.try(manifest_path, pattern=nil)
|
80
|
+
if pattern
|
81
|
+
paths = Dir[File.join(manifest_path, pattern)]
|
82
|
+
new(paths.first) if paths.any?
|
83
|
+
elsif File.file?(manifest_path)
|
84
|
+
new(manifest_path)
|
85
|
+
end
|
86
|
+
end
|
87
|
+
|
88
|
+
def initialize(file)
|
89
|
+
@file = file
|
90
|
+
@manifest = JSON.parse(File.read(file))
|
91
|
+
end
|
92
|
+
|
93
|
+
def append(logical_path, file)
|
94
|
+
stat = File.stat(file)
|
95
|
+
|
96
|
+
assets[logical_path] = logical_path
|
97
|
+
files[logical_path] = {
|
98
|
+
"logical_path" => logical_path,
|
99
|
+
"mtime" => stat.mtime.iso8601,
|
100
|
+
"size" => stat.size,
|
101
|
+
"digest" => nil
|
102
|
+
}
|
103
|
+
end
|
104
|
+
|
105
|
+
def remove(logical_path)
|
106
|
+
if digested = assets.delete(logical_path)
|
107
|
+
files.delete(digested)
|
108
|
+
end
|
109
|
+
end
|
110
|
+
|
111
|
+
def remove_digest(logical_path)
|
112
|
+
asset_path(logical_path) do |digested, logical_path|
|
113
|
+
assets[logical_path] = logical_path
|
114
|
+
files[logical_path] = files.delete(digested).tap { |f| f["digest"] = nil }
|
115
|
+
|
116
|
+
yield digested, logical_path if block_given?
|
117
|
+
end
|
118
|
+
end
|
119
|
+
|
120
|
+
def assets
|
121
|
+
@manifest["assets"]
|
122
|
+
end
|
123
|
+
|
124
|
+
def files
|
125
|
+
@manifest["files"]
|
126
|
+
end
|
127
|
+
|
128
|
+
def dump
|
129
|
+
JSON.generate(@manifest)
|
130
|
+
end
|
131
|
+
|
132
|
+
def write
|
133
|
+
File.open(@file, "wb") { |f| f.write(dump) }
|
134
|
+
end
|
135
|
+
end
|
136
|
+
|
137
|
+
class NullManifest < AssetManifest
|
138
|
+
def append(*); end
|
139
|
+
def remove(*); end
|
140
|
+
def remove_digest(*); end
|
141
|
+
def assets; {}; end
|
142
|
+
def each(*); end
|
143
|
+
def write; end
|
144
|
+
end
|
43
145
|
end
|
44
146
|
end
|
data/lib/tinymce/rails/engine.rb
CHANGED
@@ -13,27 +13,14 @@ module TinyMCE::Rails
|
|
13
13
|
# :copy - copies across the TinyMCE assets statically
|
14
14
|
config.tinymce.install = :compile
|
15
15
|
|
16
|
-
# Set default attributes for script source tags (defaults to data-turbolinks-track="reload" for backwards compatibility)
|
17
|
-
config.tinymce.default_script_attributes = { "data-turbolinks-track" => "reload" }
|
18
|
-
|
19
16
|
initializer "precompile", :group => :all do |app|
|
20
17
|
if config.tinymce.install == :compile
|
21
18
|
app.config.assets.precompile << "tinymce-rails.manifest.js" # Sprockets 4 manifest
|
22
19
|
app.config.assets.precompile << "tinymce/*" # Sprockets 3
|
23
20
|
end
|
24
21
|
|
25
|
-
app.config.assets.precompile << "tinymce.js"
|
26
|
-
end
|
27
|
-
|
28
|
-
initializer "propshaft" do |app|
|
29
|
-
config.assets.excluded_paths << root.join("app/assets/sprockets")
|
30
|
-
|
31
|
-
if config.assets.server
|
32
|
-
# Monkey-patch Propshaft::Asset to enable access
|
33
|
-
# of TinyMCE assets without a hash digest.
|
34
|
-
require_relative "propshaft/asset"
|
35
|
-
end
|
36
|
-
end if defined?(Propshaft)
|
22
|
+
app.config.assets.precompile << "tinymce.js"
|
23
|
+
end
|
37
24
|
|
38
25
|
initializer "helper" do |app|
|
39
26
|
ActiveSupport.on_load(:action_view) do
|
data/lib/tinymce/rails/helper.rb
CHANGED
@@ -1,4 +1,4 @@
|
|
1
|
-
require
|
1
|
+
require 'active_support/core_ext/hash/keys'
|
2
2
|
|
3
3
|
module TinyMCE::Rails
|
4
4
|
module Helper
|
@@ -63,27 +63,13 @@ module TinyMCE::Rails
|
|
63
63
|
end
|
64
64
|
|
65
65
|
# Includes TinyMCE javascript assets via a script tag.
|
66
|
-
def tinymce_assets
|
67
|
-
|
68
|
-
javascript_include_tag("tinymce", options)
|
69
|
-
else
|
70
|
-
safe_join([
|
71
|
-
tinymce_preinit,
|
72
|
-
javascript_include_tag("tinymce/tinymce", options),
|
73
|
-
javascript_include_tag("tinymce/rails", options)
|
74
|
-
], "\n")
|
75
|
-
end
|
76
|
-
end
|
77
|
-
|
78
|
-
# Configures where dynamically loaded TinyMCE assets are located and named
|
79
|
-
def tinymce_preinit(base=TinyMCE::Rails::Engine.base)
|
80
|
-
js = "window.tinymce = window.tinymce || { base: '#{base}', suffix: '' };"
|
81
|
-
javascript_tag(js, nonce: true)
|
66
|
+
def tinymce_assets
|
67
|
+
javascript_include_tag "tinymce", "data-turbolinks-track" => "reload"
|
82
68
|
end
|
83
69
|
|
84
70
|
# Allow methods to be called as module functions:
|
85
71
|
# e.g. TinyMCE::Rails.tinymce_javascript
|
86
|
-
module_function :tinymce, :tinymce_javascript, :tinymce_configurations_javascript, :tinymce_configuration
|
87
|
-
public :tinymce, :tinymce_javascript, :tinymce_configurations_javascript, :tinymce_configuration
|
72
|
+
module_function :tinymce, :tinymce_javascript, :tinymce_configurations_javascript, :tinymce_configuration
|
73
|
+
public :tinymce, :tinymce_javascript, :tinymce_configurations_javascript, :tinymce_configuration
|
88
74
|
end
|
89
75
|
end
|
data/lib/tinymce/rails.rb
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
module TinyMCE
|
2
2
|
module Rails
|
3
|
-
require
|
4
|
-
require
|
3
|
+
require 'tinymce/rails/engine'
|
4
|
+
require 'tinymce/rails/version'
|
5
5
|
require "tinymce/rails/configuration"
|
6
6
|
require "tinymce/rails/configuration_file"
|
7
7
|
require "tinymce/rails/helper"
|