effective_ckeditor 1.6.2 → 1.7.0

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
  SHA1:
3
- metadata.gz: 8437207833397094b9cff8fab239fae942535a88
4
- data.tar.gz: bcce567300727c5247c887c5159b465dc7b67d0c
3
+ metadata.gz: 4cca55711b27a89d5f5d0e400e4b7ff1ad6f0447
4
+ data.tar.gz: 3838b5eba785f56158187be50d741644067ff2ba
5
5
  SHA512:
6
- metadata.gz: 384c9eed392375343937be588390891151eda9be8ca59c801ed1836755514ab20fa605ec4bd66d8e490764f93e11fafc5fbf487e98e08d92cd7a14c6bbfd87a5
7
- data.tar.gz: e524f5014962b66a45fe2ccb24a32cd6461e47be4e7b29490692c500e9b5c3b06d860e6a187c7cdd6a3d44673609e51e6d0f973166b7d87e7afe467b7701ab20
6
+ metadata.gz: e937e320e1c879908460004b09c11f5056d3fe789360a4a5e61bdf2236e184389d621e537f41bfa2f1333cbaf939da0bbb73bfb0fbdd86f57b9f1ca68992857a
7
+ data.tar.gz: d57275ac88da1bfc7276241f0bda6ad85d8e50cc4a19651dddf1419dd3f968e8142e17c359e75e932d60a706c8f80c01abfe68f60bc28426e5e99d905ded800b
@@ -167,11 +167,6 @@ Snippets = {
167
167
  snippet
168
168
  }
169
169
 
170
- Templates = {
171
- all: -> ((CKEDITOR.config['effective_regions'] || {})['templates'] || {})
172
- build: (definition) -> definition
173
- }
174
-
175
170
  BuildInsertSnippetDropdown = (editor, all_snippets) ->
176
171
  editor.ui.addRichCombo 'InsertSnippet',
177
172
  label: 'Insert Snippet',
@@ -218,9 +213,3 @@ CKEDITOR.plugins.add 'effective_regions',
218
213
 
219
214
  editor.widgets.add(name, snippet)
220
215
  CKEDITOR.dialog.add(name, CKEDITOR.getUrl(window.location.protocol + '//' + window.location.host + snippet.dialog_url)) if snippet.dialog_url
221
-
222
- # Templates
223
- # these are loaded once per page, not for each editor (as the snippets are above)
224
- CKEDITOR.addTemplates 'effective_regions',
225
- imagesPath: CKEDITOR.getUrl( window.location.protocol + '//' + window.location.host + '/assets/effective/templates/' ),
226
- templates: Templates.build(template) for template in Templates.all()
@@ -31,6 +31,8 @@ init = ->
31
31
  affixBootstrapMenu(editor_div)
32
32
  editor_div.on 'click', -> try initEditor(this)
33
33
 
34
+ initTemplates()
35
+
34
36
  initEditor = (editor_div) ->
35
37
  region = $(editor_div).data('effective-ckeditor')
36
38
 
@@ -103,6 +105,13 @@ initEditor = (editor_div) ->
103
105
  ]
104
106
  )
105
107
 
108
+ initTemplates = ->
109
+ templates = ((CKEDITOR.config['effective_regions'] || {})['templates'] || {})
110
+
111
+ CKEDITOR.addTemplates 'effective_regions',
112
+ imagesPath: CKEDITOR.getUrl( window.location.protocol + '//' + window.location.host + '/assets/effective/templates/' ),
113
+ templates: template for template in templates
114
+
106
115
  promptToSaveIfDirty = (event) ->
107
116
  dirty = false
108
117
 
@@ -1,3 +1,3 @@
1
1
  module EffectiveCkeditor
2
- VERSION = '1.6.2'.freeze
2
+ VERSION = '1.7.0'.freeze
3
3
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: effective_ckeditor
3
3
  version: !ruby/object:Gem::Version
4
- version: 1.6.2
4
+ version: 1.7.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - Code and Effect
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2015-04-24 00:00:00.000000000 Z
11
+ date: 2015-04-30 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: rails