card-mod-prosemirror_editor 0.13.2 → 0.15

Sign up to get free protection for your applications and to get access to all the features.
@@ -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
@@ -1,30 +0,0 @@
1
- # -*- encoding : utf-8 -*-
2
-
3
- class AddProsemirrorCards < Cardio::Migration
4
- PM_CONFIG = <<-JSON.strip_heredoc
5
- {
6
- "menuBar": true,
7
- "tooltipMenu": false
8
- }
9
- JSON
10
- def up
11
- ensure_card name: "*ProseMirror", type_id: Card::PlainTextID,
12
- codename: "prose_mirror",
13
- content: PM_CONFIG
14
- create_or_update name: "*ProseMirrorz+*self+*help", content: pm_help
15
- ensure_card name: "script: prosemirror", type_id: Card::JavaScriptID,
16
- codename: "script_prosemirror"
17
- ensure_card name: "style: prosemirror", type_id: Card::ScssID,
18
- codename: "style_prosemirror"
19
- ensure_card name: "script: prosemirror config",
20
- type_id: Card::CoffeeScriptID,
21
- codename: "script_prosemirror_config"
22
- end
23
-
24
- def pm_help
25
- "Configure [[http://prosemirror.net|ProseMirror]], "\
26
- "Decko's default "\
27
- "[[http://en.wikipedia.org/wiki/Wysiwyg|wysiwyg]] editor. "\
28
- "[[https://decko.org/ProseMirror|more]]"
29
- end
30
- end