Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion html_xblock/__init__.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
"""HTML XBlock module."""
from .html import ExcludedHTML5XBlock, HTML5XBlock

__version__ = "2.0.0"
__version__ = "2.0.1"
17 changes: 5 additions & 12 deletions html_xblock/html.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,6 @@

import logging

import pkg_resources
from django.conf import settings
from web_fragments.fragment import Fragment
from xblock.completable import XBlockCompletionMode
Expand Down Expand Up @@ -63,12 +62,6 @@ def get_settings(self):

return {}

@staticmethod
def resource_string(path):
"""Handy helper for getting resources from our kit."""
data = pkg_resources.resource_string(__name__, path)
return data.decode('utf8')

@XBlock.supports('multi_device')
def student_view(self, context=None): # pylint: disable=unused-argument
"""
Expand All @@ -77,11 +70,11 @@ def student_view(self, context=None): # pylint: disable=unused-argument
frag = Fragment()
frag.content = xblock_loader.render_django_template('static/html/lms.html', {'self': self})

frag.add_css(self.resource_string('public/plugins/codesample/css/prism.css'))
frag.add_javascript(self.resource_string('public/plugins/codesample/js/prism.js'))
frag.add_css(self.runtime.local_resource_url('public/plugins/codesample/css/prism.css'))
frag.add_javascript(self.runtime.local_resource_url('public/plugins/codesample/js/prism.js'))

if getattr(self.runtime, 'is_author_mode', False):
frag.add_css(self.resource_string('static/css/html_preview.css'))
frag.add_css(self.runtime.local_resource_url('static/css/html_preview.css'))

return frag

Expand Down Expand Up @@ -160,7 +153,7 @@ def add_edit_stylesheets(self, frag):
A helper method to add all styles to the fragment necesesary for edit.
:param frag: The fragment that will hold the scripts.
"""
frag.add_css(self.resource_string('static/css/html_edit.css'))
frag.add_css(self.runtime.local_resource_url('static/css/html_edit.css'))

if self.editor == 'raw':
frag.add_css_url(settings.STATIC_URL + 'js/vendor/CodeMirror/codemirror.css')
Expand All @@ -172,7 +165,7 @@ def add_edit_scripts(self, frag):
"""
frag.add_javascript_url(settings.STATIC_URL + 'js/vendor/tinymce/js/tinymce/tinymce.full.min.js')
frag.add_javascript_url(settings.STATIC_URL + 'js/vendor/tinymce/js/tinymce/themes/silver/theme.min.js')
frag.add_javascript(self.resource_string('static/js/html_edit.js'))
frag.add_javascript(self.runtime.local_resource_url('static/js/html_edit.js'))
frag.add_javascript(loader.load_unicode('public/studio_edit.js'))

if self.editor == 'raw':
Expand Down
24 changes: 12 additions & 12 deletions requirements/base.txt
Original file line number Diff line number Diff line change
Expand Up @@ -6,17 +6,17 @@
#
appdirs==1.4.4
# via fs
asgiref==3.11.0
asgiref==3.11.1
# via django
bleach[css]==6.3.0
# via -r requirements/base.in
boto3==1.42.34
boto3==1.43.2
# via fs-s3fs
botocore==1.42.34
botocore==1.43.2
# via
# boto3
# s3transfer
django==5.2.10
django==5.2.13
# via
# -c https://raw.githubusercontent.com/edx/edx-lint/master/edx_lint/files/common_constraints.txt
# -r requirements/base.in
Expand All @@ -34,27 +34,27 @@ jmespath==1.1.0
# botocore
lazy==1.6
# via xblock
lxml==6.0.2
lxml==6.1.0
# via xblock
mako==1.3.10
mako==1.3.12
# via xblock
markupsafe==3.0.3
# via
# mako
# xblock
openedx-django-pyfs==3.8.0
openedx-django-pyfs==4.0.0
# via xblock
python-dateutil==2.9.0.post0
# via
# botocore
# xblock
pytz==2025.2
pytz==2026.2
# via xblock
pyyaml==6.0.3
# via xblock
s3transfer==0.16.0
s3transfer==0.17.0
# via boto3
simplejson==3.20.2
simplejson==4.1.1
# via xblock
six==1.17.0
# via
Expand All @@ -67,15 +67,15 @@ tinycss2==1.4.0
# via bleach
urllib3==2.6.3
# via botocore
web-fragments==3.1.0
web-fragments==4.0.0
# via xblock
webencodings==0.5.1
# via
# bleach
# tinycss2
webob==1.8.9
# via xblock
xblock[django]==5.3.0
xblock[django]==6.1.0
# via -r requirements/base.in

# The following packages are considered to be unsafe in a requirements file:
Expand Down
14 changes: 10 additions & 4 deletions requirements/ci.txt
Original file line number Diff line number Diff line change
Expand Up @@ -6,22 +6,28 @@
#
distlib==0.4.0
# via virtualenv
filelock==3.20.3
filelock==3.29.0
# via
# python-discovery
# tox
# virtualenv
packaging==26.0
packaging==26.2
# via
# pyproject-api
# tox
platformdirs==4.5.1
platformdirs==4.9.6
# via
# python-discovery
# tox
# virtualenv
pluggy==1.6.0
# via tox
py==1.11.0
# via tox
python-discovery==1.2.2
# via
# tox
# virtualenv
six==1.17.0
# via tox
tox==3.28.0
Expand All @@ -30,5 +36,5 @@ tox==3.28.0
# tox-battery
tox-battery==0.6.2
# via -r requirements/ci.in
virtualenv==20.36.1
virtualenv==21.3.0
# via tox
Loading
Loading