Skip to content

Commit a777c31

Browse files
committed
added error message
1 parent 3164ed3 commit a777c31

File tree

3 files changed

+31
-11
lines changed

3 files changed

+31
-11
lines changed

draceditor/settings.py

Lines changed: 8 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -54,15 +54,12 @@
5454

5555
# https://getuikit.com/docs/htmleditor.html#javascript-options
5656
DRACEDITOR_EDITOR_OPTIONS = getattr(
57-
settings, 'DRACEDITOR_EDITOR_OPTIONS', "{markdown:true}"
57+
settings, 'DRACEDITOR_EDITOR_OPTIONS', {
58+
'markdown': 'true',
59+
'toolbar': [
60+
'bold', 'italic', 'strike',
61+
'link', 'image', 'blockquote',
62+
'listUl', 'listOl', 'upload',
63+
]
64+
}
5865
)
59-
"""
60-
{
61-
'markdown': 'true',
62-
'toolbar': [
63-
'bold', 'italic', 'strike',
64-
'link', 'picture', 'blockquote',
65-
'listUl', 'listOl', 'upload'
66-
]
67-
}
68-
"""

draceditor/static/js/draceditor.js

Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -140,3 +140,23 @@ $(function() {
140140
$('.draceditor').draceditor();
141141
});
142142
})(jQuery);
143+
144+
// Development mode:
145+
// * http://stackoverflow.com/a/27417339/6396981
146+
// * http://cgit.drupalcode.org/uikitapi/tree/uikit/js/components/htmleditor.js?id=6b5fc5f8d767b7e2b70c44e7e01b949b89870d8f
147+
/*
148+
$(document).ready(function(){
149+
var textArea = document.getElementById('id_description');
150+
var editor = CodeMirror.fromTextArea(textArea, {
151+
onKeyEvent: function(e , s){
152+
if (s.type == "keyup") {
153+
console.log("test");
154+
}
155+
}
156+
});
157+
console.log(editor);
158+
editor.on("keyup", function(editor, event) {
159+
console.log(editor);
160+
});
161+
});
162+
*/

draceditor/widgets.py

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -52,6 +52,9 @@ class Media:
5252
'plugins/js/overlay.js',
5353
'plugins/js/xml.js',
5454
'plugins/js/marked.min.js',
55+
56+
# i dont't know if use this editor,
57+
# the `emoji` and `mention` is't work well.
5558
'plugins/js/htmleditor.js',
5659

5760
'plugins/js/caret.min.js',

0 commit comments

Comments
 (0)