diff options
Diffstat (limited to '97suifangqa/apps/utils/widget.py')
-rw-r--r-- | 97suifangqa/apps/utils/widget.py | 40 |
1 files changed, 40 insertions, 0 deletions
diff --git a/97suifangqa/apps/utils/widget.py b/97suifangqa/apps/utils/widget.py new file mode 100644 index 0000000..77eefe9 --- /dev/null +++ b/97suifangqa/apps/utils/widget.py @@ -0,0 +1,40 @@ +# -*- coding: utf8 -*- +from django import forms +class MarkitUpWidget(forms.Textarea): + u''' + 一个将textarea改造成markitup的widget + ''' + class Media: + js = ( + 'jquery-1.9.1.min.js', + 'markitup/jquery.markitup.js', + 'markitup/sets/markdown/set.js', + 'markitup/markItUp_init.js', + ) + + css = { + 'screen': ( + 'markitup/skins/simple/style.css', + 'markitup/sets/markdown/style.css', + ) + } + + +class TinyMceWidget(forms.Textarea): + u''' + 一个将textarea改造成tinymce编辑器的widget + ''' + + class Media: + js = ( + 'jquery-1.9.1.min.js', + 'tinymce/js/tinymce/tinymce.min.js', + 'tinymce/js/tinymce/tinymce_init.js', + ) + + css = { + 'screen': ( + 'tinymce/css/custom_tinymce.css', + ) + } + |