Skip to content

Commit

Permalink
using default storage instead of posixpath for accessing static files
Browse files Browse the repository at this point in the history
  • Loading branch information
rhblind committed Oct 15, 2014
1 parent 22b5bdd commit 2b664d9
Showing 1 changed file with 7 additions and 7 deletions.
14 changes: 7 additions & 7 deletions django_markdown/widgets.py
Original file line number Diff line number Diff line change
@@ -1,8 +1,9 @@
""" Widgets for django-markdown. """
import posixpath
import os

from django import forms
from django.contrib.admin.widgets import AdminTextareaWidget
from django.core.files.storage import default_storage
from django.utils.safestring import mark_safe

from . import settings
Expand Down Expand Up @@ -35,16 +36,15 @@ def media(self):
:returns: form's media
"""

js = (
posixpath.join(settings.STATIC_URL, 'django_markdown', 'jquery.init.js'), # noqa
posixpath.join(settings.STATIC_URL, 'django_markdown', 'jquery.markitup.js'), # noqa
posixpath.join(settings.STATIC_URL, settings.MARKDOWN_SET_PATH, self.__set, 'set.js'), # noqa
default_storage.url(os.path.join(settings.STATIC_URL, 'django_markdown', 'jquery.init.js')),
default_storage.url(os.path.join(settings.STATIC_URL, 'django_markdown', 'jquery.markitup.js')),
default_storage.url(os.path.join(settings.STATIC_URL, settings.MARKDOWN_SET_PATH, self.__set, 'set.js'))
)
css = {
'screen': (
posixpath.join(settings.STATIC_URL, 'django_markdown', 'skins', self.__skin, 'style.css'), # noqa
posixpath.join(settings.STATIC_URL, settings.MARKDOWN_SET_PATH, self.__set, 'style.css'), # noqa
default_storage.url(os.path.join(settings.STATIC_URL, 'django_markdown', 'skins', self.__skin, 'style.css')),
default_storage.url(os.path.join(settings.STATIC_URL, settings.MARKDOWN_SET_PATH, self.__set, 'style.css'))
)
}
return forms.Media(css=css, js=js)
Expand Down

0 comments on commit 2b664d9

Please sign in to comment.