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
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: tinymce-rails
3
3
  version: !ruby/object:Gem::Version
4
- version: 6.8.5
4
+ version: 7.0.0.1
5
5
  platform: ruby
6
6
  authors:
7
7
  - Sam Pohlenz
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2024-10-10 00:00:00.000000000 Z
11
+ date: 2024-04-08 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: railties
@@ -31,13 +31,12 @@ executables: []
31
31
  extensions: []
32
32
  extra_rdoc_files: []
33
33
  files:
34
- - LICENSE
35
34
  - README.md
36
35
  - Rakefile
36
+ - app/assets/javascripts/tinymce.js
37
+ - app/assets/javascripts/tinymce/preinit.js.erb
37
38
  - app/assets/javascripts/tinymce/rails.js
38
39
  - app/assets/source/tinymce/tinymce.js
39
- - app/assets/sprockets/tinymce.js
40
- - app/assets/sprockets/tinymce/preinit.js.erb
41
40
  - lib/tasks/tinymce-assets.rake
42
41
  - lib/tinymce-rails.rb
43
42
  - lib/tinymce/rails.rb
@@ -46,21 +45,16 @@ files:
46
45
  - lib/tinymce/rails/asset_installer/copy.rb
47
46
  - lib/tinymce/rails/asset_installer/copy_no_preserve.rb
48
47
  - lib/tinymce/rails/asset_manifest.rb
49
- - lib/tinymce/rails/asset_manifest/json_manifest.rb
50
- - lib/tinymce/rails/asset_manifest/null_manifest.rb
51
- - lib/tinymce/rails/asset_manifest/propshaft_manifest.rb
52
- - lib/tinymce/rails/asset_manifest/yaml_manifest.rb
53
48
  - lib/tinymce/rails/configuration.rb
54
49
  - lib/tinymce/rails/configuration_file.rb
55
50
  - lib/tinymce/rails/engine.rb
56
51
  - lib/tinymce/rails/environment.rb
57
52
  - lib/tinymce/rails/helper.rb
58
- - lib/tinymce/rails/propshaft/asset.rb
59
53
  - lib/tinymce/rails/version.rb
60
54
  - vendor/assets/config/tinymce-rails.manifest.js
61
55
  - vendor/assets/javascripts/tinymce/icons/default/icons.js
62
56
  - vendor/assets/javascripts/tinymce/langs/readme.md
63
- - vendor/assets/javascripts/tinymce/license.txt
57
+ - vendor/assets/javascripts/tinymce/license.md
64
58
  - vendor/assets/javascripts/tinymce/models/dom/model.js
65
59
  - vendor/assets/javascripts/tinymce/plugins/accordion/plugin.js
66
60
  - vendor/assets/javascripts/tinymce/plugins/advlist/plugin.js
@@ -129,7 +123,6 @@ files:
129
123
  - vendor/assets/javascripts/tinymce/plugins/save/plugin.js
130
124
  - vendor/assets/javascripts/tinymce/plugins/searchreplace/plugin.js
131
125
  - vendor/assets/javascripts/tinymce/plugins/table/plugin.js
132
- - vendor/assets/javascripts/tinymce/plugins/template/plugin.js
133
126
  - vendor/assets/javascripts/tinymce/plugins/visualblocks/plugin.js
134
127
  - vendor/assets/javascripts/tinymce/plugins/visualchars/plugin.js
135
128
  - vendor/assets/javascripts/tinymce/plugins/wordcount/plugin.js
@@ -204,7 +197,7 @@ files:
204
197
  - vendor/assets/javascripts/tinymce/tinymce.js
205
198
  homepage: https://github.com/spohlenz/tinymce-rails
206
199
  licenses:
207
- - MIT
200
+ - GPL-2.0-or-later
208
201
  metadata: {}
209
202
  post_install_message:
210
203
  rdoc_options: []
@@ -221,7 +214,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
221
214
  - !ruby/object:Gem::Version
222
215
  version: '0'
223
216
  requirements: []
224
- rubygems_version: 3.5.16
217
+ rubygems_version: 3.5.6
225
218
  signing_key:
226
219
  specification_version: 4
227
220
  summary: Rails asset pipeline integration for TinyMCE.
data/LICENSE DELETED
@@ -1,19 +0,0 @@
1
- Copyright (C) 2011-14 by Sam Pohlenz
2
-
3
- Permission is hereby granted, free of charge, to any person obtaining a copy
4
- of this software and associated documentation files (the "Software"), to deal
5
- in the Software without restriction, including without limitation the rights
6
- to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
7
- copies of the Software, and to permit persons to whom the Software is
8
- furnished to do so, subject to the following conditions:
9
-
10
- The above copyright notice and this permission notice shall be included in
11
- all copies or substantial portions of the Software.
12
-
13
- THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
14
- IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
15
- FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
16
- AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
17
- LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
18
- OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
19
- SOFTWARE.
@@ -1,62 +0,0 @@
1
- module TinyMCE
2
- module Rails
3
- class JsonManifest < AssetManifest
4
- def self.try(manifest_path, pattern=nil)
5
- if pattern
6
- paths = Dir[File.join(manifest_path, pattern)]
7
- new(paths.first) if paths.any?
8
- elsif File.file?(manifest_path)
9
- new(manifest_path)
10
- end
11
- end
12
-
13
- def initialize(file)
14
- @file = file
15
- @manifest = JSON.parse(File.read(file))
16
- end
17
-
18
- def append(logical_path, file)
19
- stat = File.stat(file)
20
-
21
- assets[logical_path] = logical_path
22
- files[logical_path] = {
23
- "logical_path" => logical_path,
24
- "mtime" => stat.mtime.iso8601,
25
- "size" => stat.size,
26
- "digest" => nil
27
- }
28
- end
29
-
30
- def remove(logical_path)
31
- if digested = assets.delete(logical_path)
32
- files.delete(digested)
33
- end
34
- end
35
-
36
- def remove_digest(logical_path)
37
- asset_path(logical_path) do |digested, logical_path|
38
- assets[logical_path] = logical_path
39
- files[logical_path] = files.delete(digested).tap { |f| f["digest"] = nil }
40
-
41
- yield digested, logical_path if block_given?
42
- end
43
- end
44
-
45
- def assets
46
- @manifest["assets"]
47
- end
48
-
49
- def files
50
- @manifest["files"]
51
- end
52
-
53
- def dump
54
- JSON.generate(@manifest)
55
- end
56
-
57
- def write
58
- File.open(@file, "wb") { |f| f.write(dump) }
59
- end
60
- end
61
- end
62
- end
@@ -1,12 +0,0 @@
1
- module TinyMCE
2
- module Rails
3
- class NullManifest < AssetManifest
4
- def append(*); end
5
- def remove(*); end
6
- def remove_digest(*); end
7
- def assets; {}; end
8
- def each(*); end
9
- def write; end
10
- end
11
- end
12
- end
@@ -1,43 +0,0 @@
1
- module TinyMCE
2
- module Rails
3
- class PropshaftManifest < AssetManifest
4
- def self.try(manifest_path)
5
- json_file = File.join(manifest_path, ".manifest.json")
6
- new(json_file) if File.exist?(json_file)
7
- end
8
-
9
- def initialize(file)
10
- @file = file
11
- @manifest = JSON.parse(File.read(file))
12
- end
13
-
14
- def append(logical_path, file)
15
- assets[logical_path] = logical_path
16
- end
17
-
18
- def remove(logical_path)
19
- assets.delete(logical_path)
20
- end
21
-
22
- def remove_digest(logical_path)
23
- asset_path(logical_path) do |digested, logical_path|
24
- assets[logical_path] = logical_path
25
-
26
- yield digested, logical_path if block_given?
27
- end
28
- end
29
-
30
- def assets
31
- @manifest
32
- end
33
-
34
- def dump
35
- JSON.generate(@manifest)
36
- end
37
-
38
- def write
39
- File.open(@file, "wb") { |f| f.write(dump) }
40
- end
41
- end
42
- end
43
- end
@@ -1,43 +0,0 @@
1
- module TinyMCE
2
- module Rails
3
- class YamlManifest < AssetManifest
4
- def self.try(manifest_path)
5
- yaml_file = File.join(manifest_path, "manifest.yml")
6
- new(yaml_file) if File.exist?(yaml_file)
7
- end
8
-
9
- def initialize(file)
10
- @file = file
11
- @manifest = YAML.load_file(file)
12
- end
13
-
14
- def append(logical_path, file)
15
- assets[logical_path] = logical_path
16
- end
17
-
18
- def remove(logical_path)
19
- assets.delete(logical_path)
20
- end
21
-
22
- def remove_digest(logical_path)
23
- asset_path(logical_path) do |digested, logical_path|
24
- assets[logical_path] = logical_path
25
-
26
- yield digested, logical_path if block_given?
27
- end
28
- end
29
-
30
- def assets
31
- @manifest
32
- end
33
-
34
- def dump(io=nil)
35
- YAML.dump(@manifest, io)
36
- end
37
-
38
- def write
39
- File.open(@file, "wb") { |f| dump(f) }
40
- end
41
- end
42
- end
43
- end
@@ -1,11 +0,0 @@
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?("tinymce/"))
10
- end
11
- end
@@ -1,21 +0,0 @@
1
- MIT License
2
-
3
- Copyright (c) 2022 Ephox Corporation DBA Tiny Technologies, Inc.
4
-
5
- Permission is hereby granted, free of charge, to any person obtaining a copy
6
- of this software and associated documentation files (the "Software"), to deal
7
- in the Software without restriction, including without limitation the rights
8
- to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
9
- copies of the Software, and to permit persons to whom the Software is
10
- furnished to do so, subject to the following conditions:
11
-
12
- The above copyright notice and this permission notice shall be included in all
13
- copies or substantial portions of the Software.
14
-
15
- THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16
- IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17
- FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
18
- AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19
- LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
20
- OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
21
- SOFTWARE.
@@ -1,4 +0,0 @@
1
- /**
2
- * TinyMCE version 6.8.5 (TBD)
3
- */
4
- !function(){"use strict";var e=tinymce.util.Tools.resolve("tinymce.PluginManager");const t=e=>t=>(e=>{const t=typeof e;return null===e?"null":"object"===t&&Array.isArray(e)?"array":"object"===t&&(a=n=e,(r=String).prototype.isPrototypeOf(a)||(null===(s=n.constructor)||void 0===s?void 0:s.name)===r.name)?"string":t;var a,n,r,s})(t)===e,a=t("string"),n=t("object"),r=t("array"),s=("function",e=>"function"==typeof e);const l=(!1,()=>false);var o=tinymce.util.Tools.resolve("tinymce.util.Tools");const c=e=>t=>t.options.get(e),i=c("template_cdate_classes"),u=c("template_mdate_classes"),m=c("template_selected_content_classes"),p=c("template_preview_replace_values"),d=c("template_replace_values"),h=c("templates"),g=c("template_cdate_format"),v=c("template_mdate_format"),f=c("content_style"),y=c("content_css_cors"),b=c("body_class"),_=(e,t)=>{if((e=""+e).length<t)for(let a=0;a<t-e.length;a++)e="0"+e;return e},M=(e,t,a=new Date)=>{const n="Sun Mon Tue Wed Thu Fri Sat Sun".split(" "),r="Sunday Monday Tuesday Wednesday Thursday Friday Saturday Sunday".split(" "),s="Jan Feb Mar Apr May Jun Jul Aug Sep Oct Nov Dec".split(" "),l="January February March April May June July August September October November December".split(" ");return(t=(t=(t=(t=(t=(t=(t=(t=(t=(t=(t=(t=(t=(t=(t=t.replace("%D","%m/%d/%Y")).replace("%r","%I:%M:%S %p")).replace("%Y",""+a.getFullYear())).replace("%y",""+a.getYear())).replace("%m",_(a.getMonth()+1,2))).replace("%d",_(a.getDate(),2))).replace("%H",""+_(a.getHours(),2))).replace("%M",""+_(a.getMinutes(),2))).replace("%S",""+_(a.getSeconds(),2))).replace("%I",""+((a.getHours()+11)%12+1))).replace("%p",a.getHours()<12?"AM":"PM")).replace("%B",""+e.translate(l[a.getMonth()]))).replace("%b",""+e.translate(s[a.getMonth()]))).replace("%A",""+e.translate(r[a.getDay()]))).replace("%a",""+e.translate(n[a.getDay()]))).replace("%%","%")};class T{constructor(e,t){this.tag=e,this.value=t}static some(e){return new T(!0,e)}static none(){return T.singletonNone}fold(e,t){return this.tag?t(this.value):e()}isSome(){return this.tag}isNone(){return!this.tag}map(e){return this.tag?T.some(e(this.value)):T.none()}bind(e){return this.tag?e(this.value):T.none()}exists(e){return this.tag&&e(this.value)}forall(e){return!this.tag||e(this.value)}filter(e){return!this.tag||e(this.value)?this:T.none()}getOr(e){return this.tag?this.value:e}or(e){return this.tag?this:e}getOrThunk(e){return this.tag?this.value:e()}orThunk(e){return this.tag?this:e()}getOrDie(e){if(this.tag)return this.value;throw new Error(null!=e?e:"Called getOrDie on None")}static from(e){return null==e?T.none():T.some(e)}getOrNull(){return this.tag?this.value:null}getOrUndefined(){return this.value}each(e){this.tag&&e(this.value)}toArray(){return this.tag?[this.value]:[]}toString(){return this.tag?`some(${this.value})`:"none()"}}T.singletonNone=new T(!1);const S=Object.hasOwnProperty;var x=tinymce.util.Tools.resolve("tinymce.html.Serializer");const C={'"':"&quot;","<":"&lt;",">":"&gt;","&":"&amp;","'":"&#039;"},w=e=>e.replace(/["'<>&]/g,(e=>{return(t=C,a=e,((e,t)=>S.call(e,t))(t,a)?T.from(t[a]):T.none()).getOr(e);var t,a})),O=(e,t,a)=>((a,n)=>{for(let n=0,s=a.length;n<s;n++)if(r=a[n],e.hasClass(t,r))return!0;var r;return!1})(a.split(/\s+/)),A=(e,t)=>x({validate:!0},e.schema).serialize(e.parser.parse(t,{insert:!0})),D=(e,t)=>(o.each(t,((t,a)=>{s(t)&&(t=t(a)),e=e.replace(new RegExp("\\{\\$"+a.replace(/[.*+?^${}()|[\]\\]/g,"\\$&")+"\\}","g"),t)})),e),N=(e,t)=>{const a=e.dom,n=d(e);o.each(a.select("*",t),(e=>{o.each(n,((t,n)=>{a.hasClass(e,n)&&s(t)&&t(e)}))}))},I=(e,t,a)=>{const n=e.dom,r=e.selection.getContent();a=D(a,d(e));let s=n.create("div",{},A(e,a));const l=n.select(".mceTmpl",s);l&&l.length>0&&(s=n.create("div"),s.appendChild(l[0].cloneNode(!0))),o.each(n.select("*",s),(t=>{O(n,t,i(e))&&(t.innerHTML=M(e,g(e))),O(n,t,u(e))&&(t.innerHTML=M(e,v(e))),O(n,t,m(e))&&(t.innerHTML=r)})),N(e,s),e.execCommand("mceInsertContent",!1,s.innerHTML),e.addVisual()};var E=tinymce.util.Tools.resolve("tinymce.Env");const k=(e,t)=>{const a=(e,t)=>((e,t,a)=>{for(let n=0,r=e.length;n<r;n++){const r=e[n];if(t(r,n))return T.some(r);if(a(r,n))break}return T.none()})(e,(e=>e.text===t),l),n=t=>{e.windowManager.alert("Could not load the specified template.",(()=>t.focus("template")))},r=e=>e.value.url.fold((()=>Promise.resolve(e.value.content.getOr(""))),(e=>fetch(e).then((e=>e.ok?e.text():Promise.reject())))),s=(e,t)=>(s,l)=>{if("template"===l.name){const l=s.getData().template;a(e,l).each((e=>{s.block("Loading..."),r(e).then((a=>{t(s,e,a)})).catch((()=>{t(s,e,""),s.setEnabled("save",!1),n(s)}))}))}},c=t=>s=>{const l=s.getData();a(t,l.template).each((t=>{r(t).then((t=>{e.execCommand("mceInsertTemplate",!1,t),s.close()})).catch((()=>{s.setEnabled("save",!1),n(s)}))}))};(()=>{if(!t||0===t.length){const t=e.translate("No templates defined.");return e.notificationManager.open({text:t,type:"info"}),T.none()}return T.from(o.map(t,((e,t)=>{const a=e=>void 0!==e.url;return{selected:0===t,text:e.title,value:{url:a(e)?T.from(e.url):T.none(),content:a(e)?T.none():T.from(e.content),description:e.description}}})))})().each((t=>{const a=(e=>((e,t)=>{const a=e.length,n=new Array(a);for(let t=0;t<a;t++){const a=e[t];n[t]={text:(r=a).text,value:r.text}}var r;return n})(e))(t),l=(e,a)=>({title:"Insert Template",size:"large",body:{type:"panel",items:e},initialData:a,buttons:[{type:"cancel",name:"cancel",text:"Cancel"},{type:"submit",name:"save",text:"Save",primary:!0}],onSubmit:c(t),onChange:s(t,i)}),i=(t,n,r)=>{const s=((e,t)=>{var a;let n=A(e,t);if(-1===t.indexOf("<html>")){let t="";const r=null!==(a=f(e))&&void 0!==a?a:"",s=y(e)?' crossorigin="anonymous"':"";o.each(e.contentCSS,(a=>{t+='<link type="text/css" rel="stylesheet" href="'+e.documentBaseURI.toAbsolute(a)+'"'+s+">"})),r&&(t+='<style type="text/css">'+r+"</style>");const l=b(e),c=e.dom.encode,i='<script>document.addEventListener && document.addEventListener("click", function(e) {for (var elm = e.target; elm; elm = elm.parentNode) {if (elm.nodeName === "A" && !('+(E.os.isMacOS()||E.os.isiOS()?"e.metaKey":"e.ctrlKey && !e.altKey")+")) {e.preventDefault();}}}, false);<\/script> ",u=e.getBody().dir,m=u?' dir="'+c(u)+'"':"";n='<!DOCTYPE html><html><head><base href="'+c(e.documentBaseURI.getURI())+'">'+t+i+'</head><body class="'+c(l)+'"'+m+">"+n+"</body></html>"}return D(n,p(e))})(e,r),c=[{type:"listbox",name:"template",label:"Templates",items:a},{type:"htmlpanel",html:`<p aria-live="polite">${w(n.value.description)}</p>`},{label:"Preview",type:"iframe",name:"preview",sandboxed:!1,transparent:!1}],i={template:n.text,preview:s};t.unblock(),t.redial(l(c,i)),t.focus("template")},u=e.windowManager.open(l([],{template:"",preview:""}));u.block("Loading..."),r(t[0]).then((e=>{i(u,t[0],e)})).catch((()=>{i(u,t[0],""),u.setEnabled("save",!1),n(u)}))}))},P=e=>t=>{const a=()=>{t.setEnabled(e.selection.isEditable())};return e.on("NodeChange",a),a(),()=>{e.off("NodeChange",a)}};e.add("template",(e=>{(e=>{const t=e.options.register;t("template_cdate_classes",{processor:"string",default:"cdate"}),t("template_mdate_classes",{processor:"string",default:"mdate"}),t("template_selected_content_classes",{processor:"string",default:"selcontent"}),t("template_preview_replace_values",{processor:"object"}),t("template_replace_values",{processor:"object"}),t("templates",{processor:e=>a(e)||((e,t)=>{if(r(e)){for(let a=0,n=e.length;a<n;++a)if(!t(e[a]))return!1;return!0}return!1})(e,n)||s(e),default:[]}),t("template_cdate_format",{processor:"string",default:e.translate("%Y-%m-%d")}),t("template_mdate_format",{processor:"string",default:e.translate("%Y-%m-%d")})})(e),(e=>{const t=()=>e.execCommand("mceTemplate");e.ui.registry.addButton("template",{icon:"template",tooltip:"Insert template",onSetup:P(e),onAction:t}),e.ui.registry.addMenuItem("template",{icon:"template",text:"Insert template...",onSetup:P(e),onAction:t})})(e),(e=>{e.addCommand("mceInsertTemplate",function(e,...t){return(...a)=>{const n=t.concat(a);return e.apply(null,n)}}(I,e)),e.addCommand("mceTemplate",((e,t)=>()=>{const n=h(e);s(n)?n(t):a(n)?fetch(n).then((e=>{e.ok&&e.json().then(t)})):t(n)})(e,(e=>t=>{k(e,t)})(e)))})(e),(e=>{e.on("PreProcess",(t=>{const a=e.dom,n=v(e);o.each(a.select("div",t.node),(t=>{a.hasClass(t,"mceTmpl")&&(o.each(a.select("*",t),(t=>{O(a,t,u(e))&&(t.innerHTML=M(e,n))})),N(e,t))}))}))})(e)}))}();
File without changes