card-mod-prosemirror_editor 0.12.0 → 0.13.0
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/file/mod_prosemirror_editor_script_local_machine_output/file.js +10 -0
- data/set/self/script_prosemirror.rb +0 -1
- data/set/self/script_prosemirror_config.rb +0 -1
- metadata +8 -9
- data/lib/javascript/script_prosemirror.js +0 -13243
- data/lib/javascript/script_prosemirror_config.js.coffee +0 -31
@@ -1,31 +0,0 @@
|
|
1
|
-
decko.addEditor(
|
2
|
-
'.prosemirror-editor',
|
3
|
-
->
|
4
|
-
decko.initProseMirror @[0].id,
|
5
|
-
->
|
6
|
-
prosemirrorContent @[0].id
|
7
|
-
)
|
8
|
-
|
9
|
-
$.extend decko,
|
10
|
-
setProseMirrorConfig: (string) ->
|
11
|
-
setter = ->
|
12
|
-
try
|
13
|
-
$.parseJSON string
|
14
|
-
catch
|
15
|
-
{}
|
16
|
-
decko.proseMirrorConfig = setter()
|
17
|
-
|
18
|
-
initProseMirror: (el_id) ->
|
19
|
-
conf = {
|
20
|
-
menuBar: true,
|
21
|
-
tooltipMenu: false
|
22
|
-
}
|
23
|
-
hard_conf = { docFormat: "html" }
|
24
|
-
user_conf = if decko.proseMirrorConfig? then decko.proseMirrorConfig else {}
|
25
|
-
$.extend conf, user_conf, hard_conf
|
26
|
-
createProseMirror(el_id, conf)
|
27
|
-
|
28
|
-
prosemirrorContent = (id) ->
|
29
|
-
content = getProseMirrorContent(id)
|
30
|
-
return '' if content == '<p></p>'
|
31
|
-
content
|