aboutsummaryrefslogtreecommitdiffstats
path: root/97suifangqa/apps/utils/widget.py
blob: 77eefe9f6343ef72b4f121afa47fe43c32c1c12c (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
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',
            )
        }