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.
Files changed (107) hide show
  1. checksums.yaml +4 -4
  2. data/README.md +11 -11
  3. data/app/assets/source/tinymce/tinymce.js +2406 -2249
  4. data/lib/tinymce/rails/asset_installer/copy_no_preserve.rb +1 -1
  5. data/lib/tinymce/rails/asset_installer.rb +4 -4
  6. data/lib/tinymce/rails/asset_manifest.rb +108 -6
  7. data/lib/tinymce/rails/engine.rb +2 -15
  8. data/lib/tinymce/rails/helper.rb +5 -19
  9. data/lib/tinymce/rails/version.rb +2 -2
  10. data/lib/tinymce/rails.rb +2 -2
  11. data/vendor/assets/javascripts/tinymce/icons/default/icons.js +1 -1
  12. data/vendor/assets/javascripts/tinymce/license.md +6 -0
  13. data/vendor/assets/javascripts/tinymce/models/dom/model.js +2 -2
  14. data/vendor/assets/javascripts/tinymce/plugins/accordion/plugin.js +1 -1
  15. data/vendor/assets/javascripts/tinymce/plugins/advlist/plugin.js +2 -2
  16. data/vendor/assets/javascripts/tinymce/plugins/anchor/plugin.js +1 -1
  17. data/vendor/assets/javascripts/tinymce/plugins/autolink/plugin.js +1 -1
  18. data/vendor/assets/javascripts/tinymce/plugins/autoresize/plugin.js +1 -1
  19. data/vendor/assets/javascripts/tinymce/plugins/autosave/plugin.js +1 -1
  20. data/vendor/assets/javascripts/tinymce/plugins/charmap/plugin.js +1 -1
  21. data/vendor/assets/javascripts/tinymce/plugins/code/plugin.js +1 -1
  22. data/vendor/assets/javascripts/tinymce/plugins/codesample/plugin.js +1 -1
  23. data/vendor/assets/javascripts/tinymce/plugins/directionality/plugin.js +1 -1
  24. data/vendor/assets/javascripts/tinymce/plugins/emoticons/plugin.js +2 -2
  25. data/vendor/assets/javascripts/tinymce/plugins/fullscreen/plugin.js +2 -2
  26. data/vendor/assets/javascripts/tinymce/plugins/help/js/i18n/keynav/ar.js +1 -1
  27. data/vendor/assets/javascripts/tinymce/plugins/help/js/i18n/keynav/bg_BG.js +1 -1
  28. data/vendor/assets/javascripts/tinymce/plugins/help/js/i18n/keynav/ca.js +1 -1
  29. data/vendor/assets/javascripts/tinymce/plugins/help/js/i18n/keynav/cs.js +1 -1
  30. data/vendor/assets/javascripts/tinymce/plugins/help/js/i18n/keynav/da.js +1 -1
  31. data/vendor/assets/javascripts/tinymce/plugins/help/js/i18n/keynav/de.js +1 -1
  32. data/vendor/assets/javascripts/tinymce/plugins/help/js/i18n/keynav/el.js +1 -1
  33. data/vendor/assets/javascripts/tinymce/plugins/help/js/i18n/keynav/en.js +1 -1
  34. data/vendor/assets/javascripts/tinymce/plugins/help/js/i18n/keynav/es.js +1 -1
  35. data/vendor/assets/javascripts/tinymce/plugins/help/js/i18n/keynav/eu.js +1 -1
  36. data/vendor/assets/javascripts/tinymce/plugins/help/js/i18n/keynav/fa.js +1 -1
  37. data/vendor/assets/javascripts/tinymce/plugins/help/js/i18n/keynav/fi.js +1 -1
  38. data/vendor/assets/javascripts/tinymce/plugins/help/js/i18n/keynav/fr_FR.js +1 -1
  39. data/vendor/assets/javascripts/tinymce/plugins/help/js/i18n/keynav/he_IL.js +1 -1
  40. data/vendor/assets/javascripts/tinymce/plugins/help/js/i18n/keynav/hi.js +1 -1
  41. data/vendor/assets/javascripts/tinymce/plugins/help/js/i18n/keynav/hr.js +1 -1
  42. data/vendor/assets/javascripts/tinymce/plugins/help/js/i18n/keynav/hu_HU.js +1 -1
  43. data/vendor/assets/javascripts/tinymce/plugins/help/js/i18n/keynav/id.js +1 -1
  44. data/vendor/assets/javascripts/tinymce/plugins/help/js/i18n/keynav/it.js +1 -1
  45. data/vendor/assets/javascripts/tinymce/plugins/help/js/i18n/keynav/ja.js +1 -1
  46. data/vendor/assets/javascripts/tinymce/plugins/help/js/i18n/keynav/kk.js +1 -1
  47. data/vendor/assets/javascripts/tinymce/plugins/help/js/i18n/keynav/ko_KR.js +1 -1
  48. data/vendor/assets/javascripts/tinymce/plugins/help/js/i18n/keynav/ms.js +1 -1
  49. data/vendor/assets/javascripts/tinymce/plugins/help/js/i18n/keynav/nb_NO.js +1 -1
  50. data/vendor/assets/javascripts/tinymce/plugins/help/js/i18n/keynav/nl.js +1 -1
  51. data/vendor/assets/javascripts/tinymce/plugins/help/js/i18n/keynav/pl.js +1 -1
  52. data/vendor/assets/javascripts/tinymce/plugins/help/js/i18n/keynav/pt_BR.js +1 -1
  53. data/vendor/assets/javascripts/tinymce/plugins/help/js/i18n/keynav/pt_PT.js +1 -1
  54. data/vendor/assets/javascripts/tinymce/plugins/help/js/i18n/keynav/ro.js +1 -1
  55. data/vendor/assets/javascripts/tinymce/plugins/help/js/i18n/keynav/ru.js +1 -1
  56. data/vendor/assets/javascripts/tinymce/plugins/help/js/i18n/keynav/sk.js +1 -1
  57. data/vendor/assets/javascripts/tinymce/plugins/help/js/i18n/keynav/sl_SI.js +2 -2
  58. data/vendor/assets/javascripts/tinymce/plugins/help/js/i18n/keynav/sv_SE.js +1 -1
  59. data/vendor/assets/javascripts/tinymce/plugins/help/js/i18n/keynav/th_TH.js +1 -1
  60. data/vendor/assets/javascripts/tinymce/plugins/help/js/i18n/keynav/tr.js +1 -1
  61. data/vendor/assets/javascripts/tinymce/plugins/help/js/i18n/keynav/uk.js +1 -1
  62. data/vendor/assets/javascripts/tinymce/plugins/help/js/i18n/keynav/vi.js +1 -1
  63. data/vendor/assets/javascripts/tinymce/plugins/help/js/i18n/keynav/zh_CN.js +1 -1
  64. data/vendor/assets/javascripts/tinymce/plugins/help/js/i18n/keynav/zh_TW.js +1 -1
  65. data/vendor/assets/javascripts/tinymce/plugins/help/plugin.js +2 -2
  66. data/vendor/assets/javascripts/tinymce/plugins/image/plugin.js +1 -1
  67. data/vendor/assets/javascripts/tinymce/plugins/importcss/plugin.js +1 -1
  68. data/vendor/assets/javascripts/tinymce/plugins/insertdatetime/plugin.js +1 -1
  69. data/vendor/assets/javascripts/tinymce/plugins/link/plugin.js +2 -2
  70. data/vendor/assets/javascripts/tinymce/plugins/lists/plugin.js +2 -2
  71. data/vendor/assets/javascripts/tinymce/plugins/media/plugin.js +2 -2
  72. data/vendor/assets/javascripts/tinymce/plugins/nonbreaking/plugin.js +1 -1
  73. data/vendor/assets/javascripts/tinymce/plugins/pagebreak/plugin.js +1 -1
  74. data/vendor/assets/javascripts/tinymce/plugins/preview/plugin.js +1 -1
  75. data/vendor/assets/javascripts/tinymce/plugins/quickbars/plugin.js +1 -1
  76. data/vendor/assets/javascripts/tinymce/plugins/save/plugin.js +2 -2
  77. data/vendor/assets/javascripts/tinymce/plugins/searchreplace/plugin.js +2 -2
  78. data/vendor/assets/javascripts/tinymce/plugins/table/plugin.js +2 -2
  79. data/vendor/assets/javascripts/tinymce/plugins/visualblocks/plugin.js +1 -1
  80. data/vendor/assets/javascripts/tinymce/plugins/visualchars/plugin.js +1 -1
  81. data/vendor/assets/javascripts/tinymce/plugins/wordcount/plugin.js +1 -1
  82. data/vendor/assets/javascripts/tinymce/skins/ui/oxide/skin.css +1 -1
  83. data/vendor/assets/javascripts/tinymce/skins/ui/oxide/skin.js +1 -1
  84. data/vendor/assets/javascripts/tinymce/skins/ui/oxide/skin.min.css +1 -1
  85. data/vendor/assets/javascripts/tinymce/skins/ui/oxide-dark/skin.css +1 -1
  86. data/vendor/assets/javascripts/tinymce/skins/ui/oxide-dark/skin.js +1 -1
  87. data/vendor/assets/javascripts/tinymce/skins/ui/oxide-dark/skin.min.css +1 -1
  88. data/vendor/assets/javascripts/tinymce/skins/ui/tinymce-5/skin.css +1 -1
  89. data/vendor/assets/javascripts/tinymce/skins/ui/tinymce-5/skin.js +1 -1
  90. data/vendor/assets/javascripts/tinymce/skins/ui/tinymce-5/skin.min.css +1 -1
  91. data/vendor/assets/javascripts/tinymce/skins/ui/tinymce-5-dark/skin.css +1 -1
  92. data/vendor/assets/javascripts/tinymce/skins/ui/tinymce-5-dark/skin.js +1 -1
  93. data/vendor/assets/javascripts/tinymce/skins/ui/tinymce-5-dark/skin.min.css +1 -1
  94. data/vendor/assets/javascripts/tinymce/themes/silver/theme.js +2 -382
  95. data/vendor/assets/javascripts/tinymce/tinymce.d.ts +27 -15
  96. data/vendor/assets/javascripts/tinymce/tinymce.js +2 -382
  97. metadata +7 -14
  98. data/LICENSE +0 -19
  99. data/lib/tinymce/rails/asset_manifest/json_manifest.rb +0 -62
  100. data/lib/tinymce/rails/asset_manifest/null_manifest.rb +0 -12
  101. data/lib/tinymce/rails/asset_manifest/propshaft_manifest.rb +0 -43
  102. data/lib/tinymce/rails/asset_manifest/yaml_manifest.rb +0 -43
  103. data/lib/tinymce/rails/propshaft/asset.rb +0 -11
  104. data/vendor/assets/javascripts/tinymce/license.txt +0 -21
  105. data/vendor/assets/javascripts/tinymce/plugins/template/plugin.js +0 -4
  106. /data/app/assets/{sprockets → javascripts}/tinymce/preinit.js.erb +0 -0
  107. /data/app/assets/{sprockets → javascripts}/tinymce.js +0 -0
@@ -1,4 +1,4 @@
1
- require_relative "copy"
1
+ require "tinymce/rails/asset_installer/copy"
2
2
 
3
3
  module TinyMCE
4
4
  module Rails
@@ -1,8 +1,8 @@
1
- require_relative "asset_manifest"
1
+ require "tinymce/rails/asset_manifest"
2
2
 
3
- require_relative "asset_installer/copy"
4
- require_relative "asset_installer/copy_no_preserve"
5
- require_relative "asset_installer/compile"
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
- PropshaftManifest.try(manifest_path) ||
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
- require_relative "asset_manifest/json_manifest"
40
- require_relative "asset_manifest/null_manifest"
41
- require_relative "asset_manifest/propshaft_manifest"
42
- require_relative "asset_manifest/yaml_manifest"
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
@@ -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" << "tinymce-jquery.js"
26
- end if defined?(Sprockets)
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
@@ -1,4 +1,4 @@
1
- require "active_support/core_ext/hash/keys"
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(options=Rails.application.config.tinymce.default_script_attributes)
67
- if defined?(Sprockets)
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, :tinymce_preinit
87
- public :tinymce, :tinymce_javascript, :tinymce_configurations_javascript, :tinymce_configuration, :tinymce_preinit
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
@@ -1,6 +1,6 @@
1
1
  module TinyMCE
2
2
  module Rails
3
- VERSION = "6.8.5"
4
- TINYMCE_VERSION = "6.8.5"
3
+ VERSION = "7.0.0.1"
4
+ TINYMCE_VERSION = "7.0.0"
5
5
  end
6
6
  end
data/lib/tinymce/rails.rb CHANGED
@@ -1,7 +1,7 @@
1
1
  module TinyMCE
2
2
  module Rails
3
- require "tinymce/rails/engine"
4
- require "tinymce/rails/version"
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"