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.
- checksums.yaml +4 -4
- data/README.md +21 -0
- data/set/all/prosemirror_editor.rb +3 -0
- data/set/self/prose_mirror.rb +8 -0
- metadata +15 -27
- data/assets/script/script_prosemirror.js +0 -13243
- data/assets/script/script_prosemirror_config.js.coffee +0 -31
- data/db/migrate_core_cards/20160804112548_add_prosemirror_cards.rb +0 -30
- data/file/mod_prosemirror_editor_script_local_machine_output/file.js +0 -10
- data/lib/stylesheets/style_prosemirror.scss +0 -298
- data/set/self/script_prosemirror.rb +0 -3
- data/set/self/script_prosemirror_config.rb +0 -4
- data/set/self/style_prosemirror.rb +0 -3
@@ -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
|