ckeditor_rails 4.16.0 → 4.16.1

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 737063851212e65634d822a9c4bbbb9d6cdfb5761a7e446f438143413fe67250
4
- data.tar.gz: 5bee55a433f3a9431f15bee258e78e392da81b395b97482675994b6a9781936d
3
+ metadata.gz: 4d976d1a83be8e2ec7d01092ac6f8c891c90a01ad6de4343d938002b77fa8f89
4
+ data.tar.gz: 5a3cad8954afd7d11a919006d7daa177f03af3f399694bf482511ace820780c3
5
5
  SHA512:
6
- metadata.gz: c34dc6ba46672d5637a0e6daf80432c6940b8f5bbb1759c8520e7e72eb0d0b31c9465af342e006812ff6c58805cedec6e06f06c840a3569d7eefb1e111b3c8d7
7
- data.tar.gz: 591917cc868f9c6545fdcfa4add705715443c55427491f724940150768a12d7a3173e611cb47ff314c052451c94b6e6da60503f1af022e4864bdd3517b15c9aa
6
+ metadata.gz: c0193cf827ab22d322e4c90e89a9a7b225fa30aa80e7b25e73d68931cfc450d536f10b45d148c992e0d5c1d97bd01a347157d9995f4be74f08aff9c8d94853f9
7
+ data.tar.gz: c895199a330bb0903f66ef66c3cac3fb5cda1d918a54cb00d1f252a8e1a3d77141d67ba1bfe1cd59beca3d0f71f306d359ebbd9eca6166b7045f36f071c08c0f
data/README.md CHANGED
@@ -64,22 +64,6 @@ CKEDITOR.editorConfig = (config) ->
64
64
  true
65
65
  ```
66
66
 
67
- ### Include customized CKEDITOR_BASEPATH setting
68
-
69
- Add your `app/assets/javascripts/ckeditor/basepath.js.erb` like
70
-
71
- ``` ruby
72
- <%
73
- base_path = ''
74
- if ENV['PROJECT'] =~ /editor/i
75
- base_path << "/#{Rails.root.basename.to_s}/"
76
- end
77
- base_path << Rails.application.config.assets.prefix
78
- base_path << '/ckeditor/'
79
- %>
80
- var CKEDITOR_BASEPATH = '<%= base_path %>';
81
- ```
82
-
83
67
  ### Include customized stylesheet for contents of CKEditor
84
68
 
85
69
  Add your `app/assets/stylesheets/ckeditor/contents.css.scss` like
@@ -96,7 +80,48 @@ ol,ul,dl {
96
80
  }
97
81
  ```
98
82
 
99
- ### Configure plugins, languages, and skins of CKEditor assets
83
+ ### Remove CKEditor addon services
84
+
85
+ To avoid see warnings like
86
+
87
+ ``` js
88
+ ckeditor.source.js:21 [CKEDITOR] Error code: exportpdf-no-token-url.
89
+ ckeditor.source.js:21 [CKEDITOR] For more information about this error go to https://ckeditor.com/docs/ckeditor4/latest/guide/dev_errors.html#exportpdf-no-token-url
90
+ ```
91
+
92
+ Edit your `app/assets/javascripts/ckeditor/config.js.coffee` like
93
+
94
+ ``` coffee
95
+ CKEDITOR.editorConfig = (config) ->
96
+ config.removePlugins = 'exportpdf'
97
+ true
98
+ ```
99
+
100
+ Ref: https://ckeditor.com/cke4/addon/exportpdf
101
+
102
+ ### Configure CKEditor addon services
103
+
104
+ Install the plugin manually by copy to Rails asset pathes like
105
+
106
+ ``` shell
107
+ vendor/assets/images/ckeditor/plugins/exportpdf/icons
108
+ vendor/assets/javascripts/ckeditor/plugins/exportpdf/lang
109
+ vendor/assets/javascripts/ckeditor/plugins/exportpdf/plugin.js
110
+ vendor/assets/javascripts/ckeditor/plugins/exportpdf/LICENSE.md
111
+ ```
112
+
113
+ Edit your `app/assets/javascripts/ckeditor/config.js.coffee` like
114
+
115
+ ``` coffee
116
+ CKEDITOR.editorConfig = (config) ->
117
+ # config.extraPlugins = 'exportpdf'
118
+ config.exportPdf_tokenUrl = 'https://example.com/cs-token-endpoint'
119
+ true
120
+ ```
121
+
122
+ Ref: https://ckeditor.com/docs/ckeditor4/latest/features/exporttopdf.html#configuration
123
+
124
+ ### Configure plugins, languages, skins and base_path of CKEditor assets
100
125
 
101
126
  Add `ckeditor_rails.rb` to `config/initializers/`
102
127
 
@@ -112,9 +137,40 @@ Ckeditor::Rails.configure do |config|
112
137
 
113
138
  # default is nil for all skins, or set as %w[moono-lisa]
114
139
  config.assets_skins = nil
140
+
141
+ # default is nil and it will be "#{::Sprockets::Railtie.config.assets.prefix}/ckeditor",
142
+ # or set as String like '/assets/ckeditor',
143
+ # or set as Proc / Lambda
144
+ # no slash in the end
145
+ config.assets_base_path = nil
115
146
  end
116
147
  ```
117
148
 
149
+ ### Configure customized CKEDITOR_BASEPATH setting
150
+
151
+ It is important to keep these two the same.
152
+
153
+ * `Ckeditor::Rails::AssetUrlProcessor` will post process css `url()` attribute in all css files of ckeditor based on `Ckeditor::Rails.assets_base_path`.
154
+ * `CKEDITOR_BASEPATH` will be defined with `Ckeditor::Rails.assets_base_path` directly.
155
+
156
+ Edit your `config/initializers/ckeditor_rails.rb` like
157
+
158
+ ``` ruby
159
+ Ckeditor::Rails.configure do |config|
160
+ config.assets_base_path = Proc.new {
161
+ base_path = ''
162
+ if ENV['PROJECT'] =~ /editor/i
163
+ base_path << "/#{Rails.root.basename.to_s}/"
164
+ end
165
+ base_path << Rails.application.config.assets.prefix
166
+ base_path << '/ckeditor'
167
+ base_path
168
+ }
169
+ end
170
+ ```
171
+
172
+ Note: if `Rails.application.config.action_controller.relative_url_root` is set, it will prepend to `Ckeditor::Rails.assets_base_path` automatically.
173
+
118
174
  ## Gem maintenance
119
175
 
120
176
  Maintain `ckeditor_rails` gem with `Rake` commands.
@@ -8,9 +8,9 @@ Gem::Specification.new do |gem|
8
8
  gem.summary = %q{Integrate CKEditor javascript library with Rails asset pipeline}
9
9
  gem.homepage = 'https://github.com/tsechingho/ckeditor-rails'
10
10
 
11
- gem.executables = `git ls-files -- bin/*`.split("\n").map{ |f| File.basename(f) }
12
- gem.files = `git ls-files`.split("\n")
13
- gem.test_files = `git ls-files -- {test,spec,features}/*`.split("\n")
11
+ gem.executables = `git ls-files -- exe/*`.split("\n").map { |f| File.basename(f) }
12
+ gem.files = `git ls-files`.split("\n").reject { |f| f.start_with?('test') }
13
+ gem.test_files = `git ls-files -- {spec,features}/*`.split("\n")
14
14
  gem.name = 'ckeditor_rails'
15
15
  gem.require_paths = ['lib']
16
16
  gem.version = Ckeditor::Rails::VERSION
@@ -1,6 +1 @@
1
- <%
2
- base_path = File.join(Rails.application.config.assets.prefix, 'ckeditor/')
3
- base_path = File.join(Rails.application.config.action_controller.relative_url_root, base_path) if Rails.application.config.action_controller.relative_url_root
4
- %>
5
-
6
- var CKEDITOR_BASEPATH = "<%= base_path %>";
1
+ var CKEDITOR_BASEPATH = "<%= "#{::Ckeditor::Rails.assets_base_path}/" %>";
@@ -1,3 +1,3 @@
1
1
  //= require ckeditor/basepath
2
2
  //= require ckeditor/ckeditor
3
- //= require ckeditor/jquery
3
+ //= require ckeditor/adapters/jquery
@@ -11,10 +11,10 @@ module Ckeditor
11
11
 
12
12
  def image_files
13
13
  path = root.join('images', name)
14
- files = Dir.glob(path.join('plugins', '**', '*.{png,gif,jpg}')).reject { |file|
14
+ files = Dir.glob(path.join('plugins', '**', '*.{png,gif,jpg,svg}')).reject { |file|
15
15
  invalid_plugin_file?(file)
16
16
  }
17
- files += Dir.glob(path.join('skins', '**', '*.{png,gif,jpg}')).reject { |file|
17
+ files += Dir.glob(path.join('skins', '**', '*.{png,gif,jpg,svg}')).reject { |file|
18
18
  invalid_skin_file?(file)
19
19
  }
20
20
  files
@@ -0,0 +1,39 @@
1
+ module Ckeditor
2
+ module Rails
3
+ # Rewrites urls in CSS files with the digested paths
4
+ class AssetUrlProcessor
5
+ REGEX = /url\(\s*["']?(?!(?:\#|data|http))([^"'\s)]+)\s*["']?\)/
6
+
7
+ def self.stylesheet_files
8
+ @stylesheet_files ||= ::Ckeditor::Rails::Asset.new.stylesheet_files
9
+ end
10
+
11
+ def self.assets_base_path(context = nil)
12
+ return ::Ckeditor::Rails.assets_base_path unless context
13
+
14
+ "#{context.assets_prefix}/ckeditor"
15
+ end
16
+
17
+ def self.call(input)
18
+ return { data: input[:data] } unless stylesheet_files.include?(input[:filename])
19
+
20
+ context = input[:environment].context_class.new(input)
21
+ path_prefix = assets_base_path()
22
+ matched_folders = input[:filename].match(/\/ckeditor\/(plugins|skins)\/([\w-]+)\//)
23
+
24
+ data = input[:data].gsub(REGEX) { |_match|
25
+ raw_asset_path = context.asset_path($1)
26
+ if raw_asset_path.starts_with?(path_prefix)
27
+ "url(#{raw_asset_path})"
28
+ elsif matched_folders
29
+ "url(#{path_prefix}/#{matched_folders[1]}/#{matched_folders[2]}#{raw_asset_path.gsub('/..', '')})"
30
+ else
31
+ "url(#{path_prefix}#{raw_asset_path})"
32
+ end
33
+ }
34
+
35
+ { data: data }
36
+ end
37
+ end
38
+ end
39
+ end
@@ -1,3 +1,5 @@
1
+ require 'ckeditor-rails/asset_url_processor'
2
+
1
3
  module Ckeditor
2
4
  module Rails
3
5
  class Engine < ::Rails::Engine
@@ -5,6 +7,14 @@ module Ckeditor
5
7
  app.config.assets.precompile += Ckeditor::Rails::Asset.new.files
6
8
  end
7
9
 
10
+ # Follow sprockets-rails 3.3.0+ to use postprocessor of Sprockets
11
+ # https://github.com/rails/sprockets-rails/blob/v3.3.0/lib/sprockets/railtie.rb#L121
12
+ initializer 'ckeditor.asset_url_processor' do |app|
13
+ if ::Sprockets.respond_to? :register_postprocessor
14
+ ::Sprockets.register_postprocessor 'text/css', ::Ckeditor::Rails::AssetUrlProcessor
15
+ end
16
+ end
17
+
8
18
  rake_tasks do
9
19
  load "ckeditor-rails/tasks.rake"
10
20
  end
@@ -26,9 +26,11 @@ class SourceFile < Thor
26
26
  def move
27
27
  FileUtils.rm_rf destination_root
28
28
  copy_files_in_source_root
29
+ copy_adapters
29
30
  copy_langs
30
31
  copy_plugins
31
32
  copy_skins
33
+ copy_vendors
32
34
  end
33
35
 
34
36
  desc 'fix_css', 'fix some css caused precompilation error'
@@ -77,6 +79,10 @@ class SourceFile < Thor
77
79
  end
78
80
  end
79
81
 
82
+ def copy_adapters
83
+ directory 'ckeditor/adapters', 'javascripts/ckeditor/adapters'
84
+ end
85
+
80
86
  def copy_langs
81
87
  directory 'ckeditor/lang', 'javascripts/ckeditor/lang'
82
88
  end
@@ -91,6 +97,8 @@ class SourceFile < Thor
91
97
  # ckeditor.js would lookup 'plugins/icons.png'
92
98
  file = 'ckeditor/plugins/icons.png'
93
99
  copy_file file, "images/#{file}"
100
+ file = 'ckeditor/plugins/icons_hidpi.png'
101
+ copy_file file, "images/#{file}"
94
102
  end
95
103
 
96
104
  def copy_skins
@@ -99,12 +107,17 @@ class SourceFile < Thor
99
107
  end
100
108
  end
101
109
 
110
+ def copy_vendors
111
+ directory 'ckeditor/vendor', 'javascripts/ckeditor/vendor'
112
+ end
113
+
102
114
  def copy_assets path
103
115
  batch_copy path, 'css', 'stylesheets'
104
116
  batch_copy path, 'js', 'javascripts'
105
117
  batch_copy path, 'png', 'images'
106
118
  batch_copy path, 'gif', 'images'
107
119
  batch_copy path, 'jpg', 'images'
120
+ batch_copy path, 'svg', 'images'
108
121
  end
109
122
 
110
123
  def batch_copy path, type, asset_path, pattern = nil
@@ -1,6 +1,6 @@
1
1
  module Ckeditor
2
2
  module Rails
3
- VERSION = '4.16.0'
3
+ VERSION = '4.16.1'
4
4
  EDITOR_VERSION = '4.16.2'
5
5
  end
6
6
  end
@@ -12,6 +12,9 @@ module Ckeditor
12
12
  mattr_accessor :assets_skins
13
13
  @@assets_skins = nil
14
14
 
15
+ mattr_writer :assets_base_path
16
+ @@assets_base_path = nil
17
+
15
18
  class << self
16
19
  def configure
17
20
  yield self
@@ -49,7 +52,30 @@ module Ckeditor
49
52
  end
50
53
 
51
54
  def default_skins
52
- %w[moono]
55
+ %w[moono-lisa]
56
+ end
57
+
58
+ def default_base_path
59
+ return "#{::Sprockets::Railtie.config.assets.prefix}/ckeditor" if defined? ::Sprockets
60
+
61
+ "#{::Rails.application.config.assets.prefix}/ckeditor"
62
+ end
63
+
64
+ def assets_base_path
65
+ return @@assets_base_path unless @@assets_base_path.nil?
66
+
67
+ if @@assets_base_path.respond_to? :call
68
+ self.assets_base_path = @@assets_base_path.call
69
+ elsif !@@assets_base_path.is_a? String
70
+ self.assets_base_path = default_base_path
71
+ end
72
+
73
+ relative_path = ::Rails.application.config.action_controller.relative_url_root
74
+ self.assets_base_path = File.join(relative_path, @@assets_base_path) if relative_path && @@assets_base_path
75
+
76
+ self.assets_base_path = @@assets_base_path.sub(/\/\z/, '') if @@assets_base_path.ends_with?('/')
77
+
78
+ @@assets_base_path
53
79
  end
54
80
  end
55
81
 
@@ -0,0 +1,25 @@
1
+ <?xml version="1.0" encoding="UTF-8" standalone="no"?>
2
+ <svg width="16px" height="16px" viewBox="0 0 256 256" version="1.1" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink">
3
+
4
+ <title>cursor_disabled</title>
5
+ <desc></desc>
6
+ <defs></defs>
7
+ <g id="Page-4" stroke="none" stroke-width="1" fill="none" fill-rule="evenodd">
8
+ <g id="cursor_disabled_5">
9
+ <g id="cursor_disabled_illustrator" transform="translate(24.000000, 2.000000)">
10
+ <g id="Layer_1">
11
+ <path d="M225,14 C227.8,14 230,11.8 230,9 L230,5 C230,2.2 227.8,0 225,0 L127,0 C124.2,0 122,2.2 122,5 L122,9 C122,11.8 124.2,14 127,14 L158,14 L158,26.3 C172.4,34 185,44.6 195,57.4 L195,14 L225,14 L225,14 Z" id="Shape" fill="#000000"></path>
12
+ <path d="M158,228.7 L158,238 L134.5,238 C130.6,239.1 126.7,239.9 122.6,240.6 C122.2,241.3 121.9,242.1 121.9,243 L121.9,247 C121.9,249.8 124.1,252 126.9,252 L224.9,252 C227.7,252 229.9,249.8 229.9,247 L229.9,243 C229.9,240.2 227.7,238 224.9,238 L194.9,238 L194.9,197.6 C185,210.4 172.4,221 158,228.7 L158,228.7 Z" id="Shape" fill="#000000"></path>
13
+ <path d="M54.7,107.6 C53.9,110.7 51.1,112.9 41.8,116.1 C35.6,118.3 31.9,121.1 29.5,124.5 C29.5,125.5 29.4,126.4 29.4,127.4 C29.4,134.1 30.3,140.7 32,146.9 L93.9,146.9 L54.7,107.6 L54.7,107.6 Z" id="Shape" fill="#000000"></path>
14
+ <path d="M70.8,13 C70.7,13 70.6,13.1 70.5,13.3 C65.9,13.7 58.9,15.5 54.6,24.4 C63.2,20.2 72.5,17.1 82.2,15.1 C77.4,12.7 72.6,13 70.8,13 L70.8,13 Z" id="Shape" fill="#000000"></path>
15
+ <path d="M55,170 L55,183.7 C58.7,187 62.7,189.9 67,192.3 L67,170 L78,170 L78,197.6 C81.9,199.1 85.9,200.2 90,201 L90,170 L101,170 L101,202.4 C102.2,202.5 103.3,202.5 104.5,202.5 C109.4,202.5 114.3,202 119.1,201.1 C119.3,193.5 119.5,182.8 119.6,172.6 L105.1,158 L36.1,158 C38.3,162.8 40.9,167.4 44,171.7 L44,170 L55,170 L55,170 Z" id="Shape" fill="#000000"></path>
16
+ <path d="M26.3,211.5 C26.3,211.5 24.6,222.6 36.8,222.6 L40.8,222.6 C35.7,219.1 30.8,215.3 26.3,211.1 L26.3,211.5 L26.3,211.5 Z" id="Shape" fill="#000000"></path>
17
+ <path d="M172.1,159.8 C176.9,149.8 179.4,138.7 179.4,127.5 C179.4,107.1 171.2,88.6 158,75.1 L158,145.7 L172.1,159.8 L172.1,159.8 Z" id="Shape" fill="#000000"></path>
18
+ <path d="M72.2,59.9 L91.2,78.9 C92.3,73 93.7,65.4 94.1,53.3 C86.5,54.3 79.1,56.6 72.2,59.9 L72.2,59.9 Z" id="Shape" fill="#000000"></path>
19
+ <path d="M119.7,158 L119.2,158 L119.7,158.5 L119.7,158 L119.7,158 Z" id="Shape" fill="#FF0000"></path>
20
+ <path d="M195,75.3 C186.1,59.9 173.3,46.9 158,37.8 C142.3,28.4 124,23 104.5,23 C99.7,23 95,23.3 90.4,24 C86.3,24.6 82.3,25.3 78.3,26.4 C73.4,27.7 68.7,29.3 64.1,31.2 C59.6,33.1 55.3,35.3 51.2,37.7 C20.6,55.9 0,89.3 0,127.5 C0,153.8 9.8,177.9 25.9,196.3 C31.3,202.4 37.3,207.9 44,212.6 C47.5,215.1 51.2,217.4 55,219.5 C57,220.6 59,221.6 61.1,222.5 C74.3,228.6 89,231.9 104.5,231.9 C124,231.9 142.3,226.5 158,217.1 C173.3,207.9 186.1,195 195,179.6 C203.9,164.2 209,146.4 209,127.4 C209,108.5 203.9,90.7 195,75.3 L195,75.3 Z M151.2,198.5 C141.4,205 130.4,209.3 118.9,211.3 C114.2,212.1 109.4,212.5 104.5,212.5 C103.3,212.5 102.2,212.5 101,212.4 C97.3,212.2 93.6,211.8 90,211.2 C85.9,210.5 81.9,209.5 78,208.2 C74.2,207 70.5,205.5 67,203.7 C62.8,201.6 58.8,199.2 55,196.5 C51.1,193.7 47.4,190.5 44,187.1 C36,179 29.6,169.2 25.4,158.4 C21.6,148.8 19.6,138.4 19.6,127.5 C19.6,110.8 24.4,94.7 33.6,80.8 L37,75.7 L55.7,94.4 L108.4,147.1 L119.4,158.1 L119.9,158.1 L119.9,158.6 L156.5,195.2 L151.2,198.5 L151.2,198.5 Z M177.7,170.7 L174.4,176.2 L158,159.9 L89.4,91.3 L55.8,57.6 L61.3,54.3 C71.4,48.3 82.6,44.6 94.2,43.1 C97.6,42.7 101,42.5 104.5,42.5 C124.8,42.5 143.4,49.6 158,61.5 C177.2,77.1 189.4,100.8 189.4,127.4 C189.4,142.7 185.4,157.7 177.7,170.7 L177.7,170.7 Z" id="Shape" fill="#FF0000"></path>
21
+ </g>
22
+ </g>
23
+ </g>
24
+ </g>
25
+ </svg>
@@ -0,0 +1,14 @@
1
+ <?xml version="1.0" encoding="UTF-8" standalone="no"?>
2
+ <svg width="16px" height="16px" viewBox="0 0 205 252" version="1.1" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink">
3
+ <title>cursor</title>
4
+ <desc></desc>
5
+ <defs></defs>
6
+ <g id="Page-4" stroke="none" stroke-width="1" fill="none" fill-rule="evenodd">
7
+ <g id="Artboard-1" transform="translate(-49.000000, -2.000000)" fill="#000000">
8
+ <g id="cursor" transform="translate(49.000000, 2.000000)">
9
+ <path d="M170,14 L200.007537,14 C202.769057,14 205,11.7636493 205,9.00497092 L205,4.99502908 C205,2.23382212 202.764798,0 200.007537,0 L101.992463,0 C99.2309431,0 97,2.23635069 97,4.99502908 L97,9.00497092 C97,11.7661779 99.2352017,14 101.992463,14 L133,14 L133,238 L101.992463,238 C99.2309431,238 97,240.236351 97,242.995029 L97,247.004971 C97,249.766178 99.2352017,252 101.992463,252 L200.007537,252 C202.769057,252 205,249.763649 205,247.004971 L205,242.995029 C205,240.233822 202.764798,238 200.007537,238 L170,238 L170,14 Z" id="Combined-Shape"></path>
10
+ <path d="M65,222.280829 C60.6131176,222.280829 56.3742162,222.280828 52.9999995,222.280828 L53,170 L42,170 L42,222.560593 C38.6130246,222.560593 34.3763308,222.560593 30.0000005,222.560594 L30,170 L19,170 L19,222.560595 C16.324865,222.560595 13.8463369,222.560595 11.7612725,222.560596 C-0.369586438,222.560599 1.28381746,211.509313 1.28381746,211.509313 C1.28381746,211.509313 0.389689944,177.756 0.396571277,158 L94.7408232,158 C94.7392736,177.793089 93.8535396,211.229548 93.8535396,211.229548 C93.8535396,211.229548 95.5069435,222.280834 83.3760845,222.280831 C81.2553782,222.28083 78.7276415,222.28083 76.0000002,222.28083 L76,170 L65,170 L65,222.280829 Z M0.574534036,147 C0.579768387,146.896149 0.585131638,146.794755 0.590625514,146.695866 C1.28381748,134.218409 -0.797112286,122.434146 16.8792816,116.195422 C34.5556755,109.956698 28.6662536,107.530522 30.3978792,95.7462576 C32.1295048,83.961993 25.8921298,78.069863 25.8921315,44.7966496 C25.892133,17.9607206 38.5169467,13.9220173 45.5220939,13.3637617 C45.6089814,13.1340727 45.7002506,13.0164391 45.7960631,13.0164391 C49.8372056,13.0164389 69.2452237,11.2436713 69.2452255,44.5168847 C69.2452273,77.7900982 63.0078523,83.6822281 64.7394778,95.4664928 C66.4711034,107.250757 60.5816815,109.676933 78.2580754,115.915657 C95.9344693,122.154381 93.8535395,133.938644 94.5467315,146.416101 C94.5570586,146.601989 94.5669242,146.796724 94.5763397,147 L0.574534036,147 Z M47.5,41 C52.1944204,41 56,37.1944204 56,32.5 C56,27.8055796 52.1944204,24 47.5,24 C42.8055796,24 39,27.8055796 39,32.5 C39,37.1944204 42.8055796,41 47.5,41 Z" id="Combined-Shape"></path>
11
+ </g>
12
+ </g>
13
+ </g>
14
+ </svg>
@@ -0,0 +1,10 @@
1
+ /*
2
+ Copyright (c) 2003-2021, CKSource - Frederico Knabben. All rights reserved.
3
+ For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-oss-license
4
+ */
5
+ (function(a){if("undefined"==typeof a)throw Error("jQuery should be loaded before CKEditor jQuery adapter.");if("undefined"==typeof CKEDITOR)throw Error("CKEditor should be loaded before CKEditor jQuery adapter.");CKEDITOR.config.jqueryOverrideVal="undefined"==typeof CKEDITOR.config.jqueryOverrideVal?!0:CKEDITOR.config.jqueryOverrideVal;a.extend(a.fn,{ckeditorGet:function(){var a=this.eq(0).data("ckeditorInstance");if(!a)throw"CKEditor is not initialized yet, use ckeditor() with a callback.";return a},
6
+ ckeditor:function(g,e){if(!CKEDITOR.env.isCompatible)throw Error("The environment is incompatible.");if(!a.isFunction(g)){var m=e;e=g;g=m}var k=[];e=e||{};this.each(function(){var b=a(this),c=b.data("ckeditorInstance"),f=b.data("_ckeditorInstanceLock"),h=this,l=new a.Deferred;k.push(l.promise());if(c&&!f)g&&g.apply(c,[this]),l.resolve();else if(f)c.once("instanceReady",function(){setTimeout(function d(){c.element?(c.element.$==h&&g&&g.apply(c,[h]),l.resolve()):setTimeout(d,100)},0)},null,null,9999);
7
+ else{if(e.autoUpdateElement||"undefined"==typeof e.autoUpdateElement&&CKEDITOR.config.autoUpdateElement)e.autoUpdateElementJquery=!0;e.autoUpdateElement=!1;b.data("_ckeditorInstanceLock",!0);c=a(this).is("textarea")?CKEDITOR.replace(h,e):CKEDITOR.inline(h,e);b.data("ckeditorInstance",c);c.on("instanceReady",function(e){var d=e.editor;setTimeout(function n(){if(d.element){e.removeListener();d.on("dataReady",function(){b.trigger("dataReady.ckeditor",[d])});d.on("setData",function(a){b.trigger("setData.ckeditor",
8
+ [d,a.data])});d.on("getData",function(a){b.trigger("getData.ckeditor",[d,a.data])},999);d.on("destroy",function(){b.trigger("destroy.ckeditor",[d])});d.on("save",function(){a(h.form).submit();return!1},null,null,20);if(d.config.autoUpdateElementJquery&&b.is("textarea")&&a(h.form).length){var c=function(){b.ckeditor(function(){d.updateElement()})};a(h.form).submit(c);a(h.form).bind("form-pre-serialize",c);b.bind("destroy.ckeditor",function(){a(h.form).unbind("submit",c);a(h.form).unbind("form-pre-serialize",
9
+ c)})}d.on("destroy",function(){b.removeData("ckeditorInstance")});b.removeData("_ckeditorInstanceLock");b.trigger("instanceReady.ckeditor",[d]);g&&g.apply(d,[h]);l.resolve()}else setTimeout(n,100)},0)},null,null,9999)}});var f=new a.Deferred;this.promise=f.promise();a.when.apply(this,k).then(function(){f.resolve()});this.editor=this.eq(0).data("ckeditorInstance");return this}});CKEDITOR.config.jqueryOverrideVal&&(a.fn.val=CKEDITOR.tools.override(a.fn.val,function(g){return function(e){if(arguments.length){var m=
10
+ this,k=[],f=this.each(function(){var b=a(this),c=b.data("ckeditorInstance");if(b.is("textarea")&&c){var f=new a.Deferred;c.setData(e,function(){f.resolve()});k.push(f.promise());return!0}return g.call(b,e)});if(k.length){var b=new a.Deferred;a.when.apply(this,k).done(function(){b.resolveWith(m)});return b.promise()}return f}var f=a(this).eq(0),c=f.data("ckeditorInstance");return f.is("textarea")&&c?c.getData():g.call(f)}}))})(window.jQuery);
@@ -0,0 +1,13 @@
1
+ (function(v,w){"object"===typeof exports&&"undefined"!==typeof module?module.exports=w():"function"===typeof define&&define.amd?define(w):v.ES6Promise=w()})(this,function(){function v(a){return"function"===typeof a}function w(){return function(){return process.nextTick(n)}}function R(){return"undefined"!==typeof B?function(){B(n)}:C()}function S(){var a=0,b=new J(n),c=document.createTextNode("");b.observe(c,{characterData:!0});return function(){c.data=a=++a%2}}function T(){var a=new MessageChannel;
2
+ a.port1.onmessage=n;return function(){return a.port2.postMessage(0)}}function C(){var a=setTimeout;return function(){return a(n,1)}}function n(){for(var a=0;a<k;a+=2)(0,q[a])(q[a+1]),q[a]=void 0,q[a+1]=void 0;k=0}function U(){try{var a=Function("return this")().require("vertx");B=a.runOnLoop||a.runOnContext;return R()}catch(b){return C()}}function D(a,b){var c=this,d=new this.constructor(r);void 0===d[z]&&K(d);var e=c._state;if(e){var f=arguments[e-1];l(function(){return L(e,d,f,c._result)})}else E(c,
3
+ d,a,b);return d}function F(a){if(a&&"object"===typeof a&&a.constructor===this)return a;var b=new this(r);x(b,a);return b}function r(){}function M(a){try{return a.then}catch(b){return p.error=b,p}}function V(a,b,c,d){try{a.call(b,c,d)}catch(e){return e}}function W(a,b,c){l(function(a){var e=!1,f=V(c,b,function(c){e||(e=!0,b!==c?x(a,c):m(a,c))},function(b){e||(e=!0,g(a,b))},"Settle: "+(a._label||" unknown promise"));!e&&f&&(e=!0,g(a,f))},a)}function X(a,b){b._state===y?m(a,b._result):b._state===t?g(a,
4
+ b._result):E(b,void 0,function(b){return x(a,b)},function(b){return g(a,b)})}function N(a,b,c){b.constructor===a.constructor&&c===D&&b.constructor.resolve===F?X(a,b):c===p?(g(a,p.error),p.error=null):void 0===c?m(a,b):v(c)?W(a,b,c):m(a,b)}function x(a,b){if(a===b)g(a,new TypeError("You cannot resolve a promise with itself"));else{var c=typeof b;null===b||"object"!==c&&"function"!==c?m(a,b):N(a,b,M(b))}}function Y(a){a._onerror&&a._onerror(a._result);G(a)}function m(a,b){a._state===u&&(a._result=b,
5
+ a._state=y,0!==a._subscribers.length&&l(G,a))}function g(a,b){a._state===u&&(a._state=t,a._result=b,l(Y,a))}function E(a,b,c,d){var e=a._subscribers,f=e.length;a._onerror=null;e[f]=b;e[f+y]=c;e[f+t]=d;0===f&&a._state&&l(G,a)}function G(a){var b=a._subscribers,c=a._state;if(0!==b.length){for(var d=void 0,e=void 0,f=a._result,g=0;g<b.length;g+=3)d=b[g],e=b[g+c],d?L(c,d,e,f):e(f);a._subscribers.length=0}}function L(a,b,c,d){var e=v(c),f=void 0,h=void 0,k=void 0,l=void 0;if(e){try{f=c(d)}catch(n){p.error=
6
+ n,f=p}f===p?(l=!0,h=f.error,f.error=null):k=!0;if(b===f){g(b,new TypeError("A promises callback cannot return that same promise."));return}}else f=d,k=!0;b._state===u&&(e&&k?x(b,f):l?g(b,h):a===y?m(b,f):a===t&&g(b,f))}function Z(a,b){try{b(function(b){x(a,b)},function(b){g(a,b)})}catch(c){g(a,c)}}function K(a){a[z]=O++;a._state=void 0;a._result=void 0;a._subscribers=[]}var H=void 0,P=H=Array.isArray?Array.isArray:function(a){return"[object Array]"===Object.prototype.toString.call(a)},k=0,B=void 0,
7
+ I=void 0,l=function(a,b){q[k]=a;q[k+1]=b;k+=2;2===k&&(I?I(n):Q())},A=(H="undefined"!==typeof window?window:void 0)||{},J=A.MutationObserver||A.WebKitMutationObserver,A="undefined"===typeof self&&"undefined"!==typeof process&&"[object process]"==={}.toString.call(process),aa="undefined"!==typeof Uint8ClampedArray&&"undefined"!==typeof importScripts&&"undefined"!==typeof MessageChannel,q=Array(1E3),Q=void 0,Q=A?w():J?S():aa?T():void 0===H&&"function"===typeof require?U():C(),z=Math.random().toString(36).substring(2),
8
+ u=void 0,y=1,t=2,p={error:null},O=0,ba=function(){function a(a,c){this._instanceConstructor=a;this.promise=new a(r);this.promise[z]||K(this.promise);P(c)?(this._remaining=this.length=c.length,this._result=Array(this.length),0===this.length?m(this.promise,this._result):(this.length=this.length||0,this._enumerate(c),0===this._remaining&&m(this.promise,this._result))):g(this.promise,Error("Array Methods must be provided an Array"))}a.prototype._enumerate=function(a){for(var c=0;this._state===u&&c<a.length;c++)this._eachEntry(a[c],
9
+ c)};a.prototype._eachEntry=function(a,c){var d=this._instanceConstructor,e=d.resolve;e===F?(e=M(a),e===D&&a._state!==u?this._settledAt(a._state,c,a._result):"function"!==typeof e?(this._remaining--,this._result[c]=a):d===h?(d=new d(r),N(d,a,e),this._willSettleAt(d,c)):this._willSettleAt(new d(function(c){return c(a)}),c)):this._willSettleAt(e(a),c)};a.prototype._settledAt=function(a,c,d){var e=this.promise;e._state===u&&(this._remaining--,a===t?g(e,d):this._result[c]=d);0===this._remaining&&m(e,this._result)};
10
+ a.prototype._willSettleAt=function(a,c){var d=this;E(a,void 0,function(a){return d._settledAt(y,c,a)},function(a){return d._settledAt(t,c,a)})};return a}(),h=function(){function a(b){this[z]=O++;this._result=this._state=void 0;this._subscribers=[];if(r!==b){if("function"!==typeof b)throw new TypeError("You must pass a resolver function as the first argument to the promise constructor");if(this instanceof a)Z(this,b);else throw new TypeError("Failed to construct 'Promise': Please use the 'new' operator, this object constructor cannot be called as a function.");
11
+ }}a.prototype["catch"]=function(a){return this.then(null,a)};a.prototype["finally"]=function(a){var c=this.constructor;return v(a)?this.then(function(d){return c.resolve(a()).then(function(){return d})},function(d){return c.resolve(a()).then(function(){throw d;})}):this.then(a,a)};return a}();h.prototype.then=D;h.all=function(a){return(new ba(this,a)).promise};h.race=function(a){var b=this;return P(a)?new b(function(c,d){for(var e=a.length,f=0;f<e;f++)b.resolve(a[f]).then(c,d)}):new b(function(a,
12
+ b){return b(new TypeError("You must pass an array to race."))})};h.resolve=F;h.reject=function(a){var b=new this(r);g(b,a);return b};h._setScheduler=function(a){I=a};h._setAsap=function(a){l=a};h._asap=l;h.polyfill=function(){var a=void 0;if("undefined"!==typeof global)a=global;else if("undefined"!==typeof self)a=self;else try{a=Function("return this")()}catch(b){throw Error("polyfill failed because global object is unavailable in this environment");}var c=a.Promise;if(c){var d=null;try{d=Object.prototype.toString.call(c.resolve())}catch(e){}if("[object Promise]"===
13
+ d&&!c.cast)return}a.Promise=h};return h.Promise=h});
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: ckeditor_rails
3
3
  version: !ruby/object:Gem::Version
4
- version: 4.16.0
4
+ version: 4.16.1
5
5
  platform: ruby
6
6
  authors:
7
7
  - Tse-Ching Ho
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2021-11-08 00:00:00.000000000 Z
11
+ date: 2021-11-16 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: railties
@@ -83,9 +83,9 @@ files:
83
83
  - ckeditor-rails.gemspec
84
84
  - lib/assets/javascripts/ckeditor-jquery.js
85
85
  - lib/assets/javascripts/ckeditor/basepath.js.erb
86
- - lib/assets/javascripts/ckeditor/jquery.js
87
86
  - lib/ckeditor-rails.rb
88
87
  - lib/ckeditor-rails/asset.rb
88
+ - lib/ckeditor-rails/asset_url_processor.rb
89
89
  - lib/ckeditor-rails/engine.rb
90
90
  - lib/ckeditor-rails/engine3.rb
91
91
  - lib/ckeditor-rails/railtie.rb
@@ -95,9 +95,12 @@ files:
95
95
  - lib/ckeditor_rails.rb
96
96
  - vendor/assets/images/ckeditor/plugins/about/dialogs/hidpi/logo_ckeditor.png
97
97
  - vendor/assets/images/ckeditor/plugins/about/dialogs/logo_ckeditor.png
98
+ - vendor/assets/images/ckeditor/plugins/copyformatting/cursors/cursor-disabled.svg
99
+ - vendor/assets/images/ckeditor/plugins/copyformatting/cursors/cursor.svg
98
100
  - vendor/assets/images/ckeditor/plugins/flash/images/placeholder.png
99
101
  - vendor/assets/images/ckeditor/plugins/forms/images/hiddenfield.gif
100
102
  - vendor/assets/images/ckeditor/plugins/icons.png
103
+ - vendor/assets/images/ckeditor/plugins/icons_hidpi.png
101
104
  - vendor/assets/images/ckeditor/plugins/iframe/images/placeholder.png
102
105
  - vendor/assets/images/ckeditor/plugins/image/images/noimage.png
103
106
  - vendor/assets/images/ckeditor/plugins/link/images/anchor.png
@@ -184,6 +187,7 @@ files:
184
187
  - vendor/assets/javascripts/ckeditor/CHANGES.md
185
188
  - vendor/assets/javascripts/ckeditor/LICENSE.md
186
189
  - vendor/assets/javascripts/ckeditor/README.md
190
+ - vendor/assets/javascripts/ckeditor/adapters/jquery.js
187
191
  - vendor/assets/javascripts/ckeditor/build-config.js
188
192
  - vendor/assets/javascripts/ckeditor/ckeditor.js
189
193
  - vendor/assets/javascripts/ckeditor/config.js
@@ -527,6 +531,7 @@ files:
527
531
  - vendor/assets/javascripts/ckeditor/plugins/wsc/lang/zh.js
528
532
  - vendor/assets/javascripts/ckeditor/plugins/wsc/plugin.js
529
533
  - vendor/assets/javascripts/ckeditor/styles.js
534
+ - vendor/assets/javascripts/ckeditor/vendor/promise.js
530
535
  - vendor/assets/stylesheets/ckeditor/contents.css
531
536
  - vendor/assets/stylesheets/ckeditor/plugins/colordialog/dialogs/colordialog.css
532
537
  - vendor/assets/stylesheets/ckeditor/plugins/copyformatting/styles/copyformatting.css
@@ -1,10 +0,0 @@
1
- /*
2
- Copyright (c) 2003-2017, CKSource - Frederico Knabben. All rights reserved.
3
- For licensing, see LICENSE.md or http://ckeditor.com/license
4
- */
5
- (function(a){if("undefined"==typeof a)throw Error("jQuery should be loaded before CKEditor jQuery adapter.");if("undefined"==typeof CKEDITOR)throw Error("CKEditor should be loaded before CKEditor jQuery adapter.");CKEDITOR.config.jqueryOverrideVal="undefined"==typeof CKEDITOR.config.jqueryOverrideVal?!0:CKEDITOR.config.jqueryOverrideVal;a.extend(a.fn,{ckeditorGet:function(){var a=this.eq(0).data("ckeditorInstance");if(!a)throw"CKEditor is not initialized yet, use ckeditor() with a callback.";return a},
6
- ckeditor:function(g,d){if(!CKEDITOR.env.isCompatible)throw Error("The environment is incompatible.");if(!a.isFunction(g)){var m=d;d=g;g=m}var k=[];d=d||{};this.each(function(){var b=a(this),c=b.data("ckeditorInstance"),f=b.data("_ckeditorInstanceLock"),h=this,l=new a.Deferred;k.push(l.promise());if(c&&!f)g&&g.apply(c,[this]),l.resolve();else if(f)c.once("instanceReady",function(){setTimeout(function(){c.element?(c.element.$==h&&g&&g.apply(c,[h]),l.resolve()):setTimeout(arguments.callee,100)},0)},
7
- null,null,9999);else{if(d.autoUpdateElement||"undefined"==typeof d.autoUpdateElement&&CKEDITOR.config.autoUpdateElement)d.autoUpdateElementJquery=!0;d.autoUpdateElement=!1;b.data("_ckeditorInstanceLock",!0);c=a(this).is("textarea")?CKEDITOR.replace(h,d):CKEDITOR.inline(h,d);b.data("ckeditorInstance",c);c.on("instanceReady",function(d){var e=d.editor;setTimeout(function(){if(e.element){d.removeListener();e.on("dataReady",function(){b.trigger("dataReady.ckeditor",[e])});e.on("setData",function(a){b.trigger("setData.ckeditor",
8
- [e,a.data])});e.on("getData",function(a){b.trigger("getData.ckeditor",[e,a.data])},999);e.on("destroy",function(){b.trigger("destroy.ckeditor",[e])});e.on("save",function(){a(h.form).submit();return!1},null,null,20);if(e.config.autoUpdateElementJquery&&b.is("textarea")&&a(h.form).length){var c=function(){b.ckeditor(function(){e.updateElement()})};a(h.form).submit(c);a(h.form).bind("form-pre-serialize",c);b.bind("destroy.ckeditor",function(){a(h.form).unbind("submit",c);a(h.form).unbind("form-pre-serialize",
9
- c)})}e.on("destroy",function(){b.removeData("ckeditorInstance")});b.removeData("_ckeditorInstanceLock");b.trigger("instanceReady.ckeditor",[e]);g&&g.apply(e,[h]);l.resolve()}else setTimeout(arguments.callee,100)},0)},null,null,9999)}});var f=new a.Deferred;this.promise=f.promise();a.when.apply(this,k).then(function(){f.resolve()});this.editor=this.eq(0).data("ckeditorInstance");return this}});CKEDITOR.config.jqueryOverrideVal&&(a.fn.val=CKEDITOR.tools.override(a.fn.val,function(g){return function(d){if(arguments.length){var m=
10
- this,k=[],f=this.each(function(){var b=a(this),c=b.data("ckeditorInstance");if(b.is("textarea")&&c){var f=new a.Deferred;c.setData(d,function(){f.resolve()});k.push(f.promise());return!0}return g.call(b,d)});if(k.length){var b=new a.Deferred;a.when.apply(this,k).done(function(){b.resolveWith(m)});return b.promise()}return f}var f=a(this).eq(0),c=f.data("ckeditorInstance");return f.is("textarea")&&c?c.getData():g.call(f)}}))})(window.jQuery);