Commits

Simon Meers committed abdfef0

Hack to allow markup_tags to work with default settings for now.

Comments (0)

Files changed (3)

markitup/settings.py

 JQUERY_URL = getattr(
     settings, 'JQUERY_URL',
     'http://ajax.googleapis.com/ajax/libs/jquery/1.6/jquery.min.js')
+
+# hack for backwards compatibility -- assume default for markup_tags, etc
+MARKITUP_SET = MARKITUP_CONFIG[DEFAULT_CONFIG_KEY]['set']
+MARKITUP_SKIN = MARKITUP_CONFIG[DEFAULT_CONFIG_KEY]['skin']
+MARKITUP_AUTO_PREVIEW = MARKITUP_CONFIG[DEFAULT_CONFIG_KEY]['auto_preview']

markitup/templates/markitup/editor.html

   var element = $("#{{ textarea_id }}");
   if(!element.hasClass("markItUpEditor")) {
     {% if preview_url %}mySettings["previewParserPath"] = "{{ preview_url }}";{% endif %}
-    element.markItUp(mySettings);
+    element.markItUp(mySettings['{{ DEFAULT_CONFIG_KEY }}']);
   }
   {% if AUTO_PREVIEW %}$('a[title="Preview"]').trigger('mouseup');{% endif %}
 });

markitup/templatetags/markitup_tags.py

 from django import template
 from django.core.urlresolvers import reverse, NoReverseMatch
-from . import settings
-from .util import absolute_url
+from .. import settings
+from ..util import absolute_url
 
 register = template.Library()
 
 
     return {'textarea_id': textarea_id,
             'AUTO_PREVIEW': auto_preview,
-            'preview_url': preview_url}
+            'preview_url': preview_url,
+            'DEFAULT_CONFIG_KEY': settings.DEFAULT_CONFIG_KEY}