card-mod-tinymce_editor 0.13.0 → 0.13.4
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -0,0 +1,57 @@
|
|
1
|
+
decko.addEditor(
|
2
|
+
'.tinymce-textarea',
|
3
|
+
->
|
4
|
+
decko.initTinyMCE @[0].id
|
5
|
+
->
|
6
|
+
ed = tinyMCE.get(@[0].id)
|
7
|
+
ed && ed.getContent()
|
8
|
+
)
|
9
|
+
|
10
|
+
decko.slotDestroy (slot) ->
|
11
|
+
slot.find("textarea.tinymce-textarea").each ->
|
12
|
+
ed = tinyMCE.get($(this)[0].id)
|
13
|
+
ed && ed.remove()
|
14
|
+
|
15
|
+
$.extend decko,
|
16
|
+
setTinyMCEConfig: (string) ->
|
17
|
+
setter = ->
|
18
|
+
try
|
19
|
+
$.parseJSON string
|
20
|
+
catch
|
21
|
+
{}
|
22
|
+
decko.tinyMCEConfig = setter()
|
23
|
+
|
24
|
+
initTinyMCE: (el_id) ->
|
25
|
+
# verify_html: false -- note: this option needed for empty
|
26
|
+
# paragraphs to add space.
|
27
|
+
conf = {
|
28
|
+
theme: "silver"
|
29
|
+
plugins: 'autoresize'
|
30
|
+
autoresize_max_height: 500
|
31
|
+
mobile: { theme: 'mobile' }
|
32
|
+
contextmenu: "deckolink nest"
|
33
|
+
}
|
34
|
+
user_conf = if decko.tinyMCEConfig? then decko.tinyMCEConfig else {}
|
35
|
+
hard_conf = {
|
36
|
+
selector: "##{el_id}"
|
37
|
+
branding: false
|
38
|
+
extended_valid_elements: "card-nest[id]"
|
39
|
+
# CSS could be made optional, but it may involve migrating old legacy
|
40
|
+
# *tinyMCE settings to get rid of stale stuff.
|
41
|
+
content_css: decko.cssPath
|
42
|
+
entity_encoding: 'raw'
|
43
|
+
}
|
44
|
+
$.extend conf, user_conf, hard_conf
|
45
|
+
decko.addNestPlugin(conf)
|
46
|
+
|
47
|
+
|
48
|
+
tinyMCE.baseURL = decko.path('mod/tinymce_editor')
|
49
|
+
tinyMCE.suffix = '.min'
|
50
|
+
# "##{el_id}"
|
51
|
+
# tinyMCE.get(el_id).remove() if $("##{el_id}")[0]? and tinyMCE.get(el_id)?
|
52
|
+
tinyMCE.init conf
|
53
|
+
|
54
|
+
addNestPlugin: (conf) ->
|
55
|
+
if conf.plugins? then conf.plugins += " nest" else conf.plugins = "nest"
|
56
|
+
# if conf.toolbar1? then conf.toolbar1 += " | nest" else conf.toolbar1 = "nest"
|
57
|
+
conf.menu = { insert: { title: "Insert", items: "deckolink nest image | hr"}}
|
data/set/self/script_tinymce.rb
CHANGED
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: card-mod-tinymce_editor
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.13.
|
4
|
+
version: 0.13.4
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Ethan McCutchen
|
@@ -10,7 +10,7 @@ authors:
|
|
10
10
|
autorequire:
|
11
11
|
bindir: bin
|
12
12
|
cert_chain: []
|
13
|
-
date: 2021-
|
13
|
+
date: 2021-09-24 00:00:00.000000000 Z
|
14
14
|
dependencies:
|
15
15
|
- !ruby/object:Gem::Dependency
|
16
16
|
name: card
|
@@ -18,28 +18,28 @@ dependencies:
|
|
18
18
|
requirements:
|
19
19
|
- - '='
|
20
20
|
- !ruby/object:Gem::Version
|
21
|
-
version: 1.103.
|
21
|
+
version: 1.103.4
|
22
22
|
type: :runtime
|
23
23
|
prerelease: false
|
24
24
|
version_requirements: !ruby/object:Gem::Requirement
|
25
25
|
requirements:
|
26
26
|
- - '='
|
27
27
|
- !ruby/object:Gem::Version
|
28
|
-
version: 1.103.
|
28
|
+
version: 1.103.4
|
29
29
|
- !ruby/object:Gem::Dependency
|
30
30
|
name: card-mod-edit
|
31
31
|
requirement: !ruby/object:Gem::Requirement
|
32
32
|
requirements:
|
33
33
|
- - '='
|
34
34
|
- !ruby/object:Gem::Version
|
35
|
-
version: 0.13.
|
35
|
+
version: 0.13.4
|
36
36
|
type: :runtime
|
37
37
|
prerelease: false
|
38
38
|
version_requirements: !ruby/object:Gem::Requirement
|
39
39
|
requirements:
|
40
40
|
- - '='
|
41
41
|
- !ruby/object:Gem::Version
|
42
|
-
version: 0.13.
|
42
|
+
version: 0.13.4
|
43
43
|
description: ''
|
44
44
|
email:
|
45
45
|
- info@decko.org
|
@@ -47,6 +47,8 @@ executables: []
|
|
47
47
|
extensions: []
|
48
48
|
extra_rdoc_files: []
|
49
49
|
files:
|
50
|
+
- assets/script/script_tinymce.js
|
51
|
+
- assets/script/script_tinymce_config.js.coffee
|
50
52
|
- db/migrate_core_cards/20160804112560_add_tinymce_cards.rb
|
51
53
|
- db/migrate_core_cards/20171113233151_update_tinymce_config.rb
|
52
54
|
- db/migrate_core_cards/20190306172623_update_tinymce_config_to_v5.rb
|