From e0330cf418dc8ea7b58084bfbd2af16118a54831 Mon Sep 17 00:00:00 2001 From: Maxim Beder Date: Sat, 15 Oct 2022 12:46:18 +0200 Subject: [PATCH] refactor: clean up HTMLSnippet Remove code that is no longer needed after conversion of all the XModules to standard XBlocks. --- xmodule/x_module.py | 46 +-------------------------------------------- 1 file changed, 1 insertion(+), 45 deletions(-) diff --git a/xmodule/x_module.py b/xmodule/x_module.py index 7859bc8370..3dc3190d2d 100644 --- a/xmodule/x_module.py +++ b/xmodule/x_module.py @@ -14,7 +14,7 @@ from lazy import lazy from lxml import etree from opaque_keys.edx.asides import AsideDefinitionKeyV2, AsideUsageKeyV2 from opaque_keys.edx.keys import UsageKey -from pkg_resources import resource_isdir, resource_string, resource_filename +from pkg_resources import resource_isdir, resource_filename from web_fragments.fragment import Fragment from webob import Response from webob.multidict import MultiDict @@ -213,40 +213,12 @@ class HTMLSnippet: html snippet, along with associated javascript and css """ - js = {} - js_module_name = None - preview_view_js = {} studio_view_js = {} - css = {} preview_view_css = {} studio_view_css = {} - @classmethod - def get_javascript(cls): - """ - Return a dictionary containing some of the following keys: - - coffee: A list of coffeescript fragments that should be compiled and - placed on the page - - js: A list of javascript fragments that should be included on the - page - - All of these will be loaded onto the page in the CMS - """ - # cdodge: We've moved the xmodule.coffee script from an outside directory into the xmodule area of common - # this means we need to make sure that all xmodules include this dependency which had been previously implicitly - # fulfilled in a different area of code - coffee = cls.js.setdefault('coffee', []) # lint-amnesty, pylint: disable=unused-variable - js = cls.js.setdefault('js', []) # lint-amnesty, pylint: disable=unused-variable - - # Added xmodule.js separately to enforce 000 prefix for this only. - cls.js.setdefault('xmodule_js', resource_string(__name__, 'js/src/xmodule.js')) - - return cls.js - @classmethod def get_preview_view_js(cls): return cls.preview_view_js @@ -263,22 +235,6 @@ class HTMLSnippet: def get_studio_view_js_bundle_name(cls): return cls.__name__ + 'Studio' - @classmethod - def get_css(cls): - """ - Return a dictionary containing some of the following keys: - - css: A list of css fragments that should be applied to the html - contents of the snippet - - sass: A list of sass fragments that should be applied to the html - contents of the snippet - - scss: A list of scss fragments that should be applied to the html - contents of the snippet - """ - return cls.css - @classmethod def get_preview_view_css(cls): return cls.preview_view_css