def _get_markitup_context():
    context = {
        "MARKITUP_SET": absolute_url(settings.MARKITUP_SET).rstrip("/"),
        "MARKITUP_SKIN": absolute_url(settings.MARKITUP_SKIN).rstrip("/"),
        "MARKITUP_JS": absolute_url("markitup/jquery.markitup.js"),
        "AJAXCSRF_JS": absolute_url("markitup/ajax_csrf.js"),
    }
    if settings.JQUERY_URL is not None:
        context["JQUERY_URL"] = absolute_url(settings.JQUERY_URL)
    return context
Esempio n. 2
0
    def __init__(self, attrs=None, markup_set=None, markup_skin=None, auto_preview=None):

    #        self.miu_set = absolute_url(markup_set or settings.MARKUP_SET)
        self.miu_skin = absolute_url(markup_skin or MARKUP_SKIN)
        if auto_preview is None:
            auto_preview = MARKUP_AUTO_PREVIEW
        self.auto_preview = auto_preview
        #        super(MarkupWidget, self).__init__(attrs)
        super(MarkupWidget, self).__init__({'class': 'dice_markup_editor'})
Esempio n. 3
0
    def _media(self):
        js = []

        if JQUERY_URL is not None:
            js.append(absolute_url(JQUERY_URL))

        js.append(absolute_url('markitup/ajax_csrf.js'))
        js.append(absolute_url('markitup/jquery.markitup.js'))
        js.append(absolute_url('markitup/update_widget.js'))

        css = []
        css.append(absolute_url(posixpath.join(self.miu_skin, 'style.css')))
        css.append(absolute_url('markitup/sets/style.css'))

        return forms.Media(css={'all': css}, js=js)