From a1bb30a79246231f97eca41bcdd6b5cd01fb3053 Mon Sep 17 00:00:00 2001 From: Maxim Beder Date: Wed, 19 Oct 2022 15:56:26 +0200 Subject: [PATCH] refactor: remove unused JSONEditingDescriptor Removing js file related to it as well, since it's not being used anywhere, unlike with other removed descriptors. --- xmodule/editing_module.py | 12 ------------ xmodule/js/src/raw/edit/json.js | 32 -------------------------------- 2 files changed, 44 deletions(-) delete mode 100644 xmodule/js/src/raw/edit/json.js diff --git a/xmodule/editing_module.py b/xmodule/editing_module.py index 3b82cc8639..ee84cd27c9 100644 --- a/xmodule/editing_module.py +++ b/xmodule/editing_module.py @@ -96,15 +96,3 @@ class TabsEditingDescriptor(TabsEditingMixin, MakoModuleDescriptor): # lint-amn settings tab in your module descriptor. """ pass # lint-amnesty, pylint: disable=unnecessary-pass - - -class JSONEditingDescriptor(EditingDescriptor): # lint-amnesty, pylint: disable=abstract-method - """ - Module that provides a raw editing view of its data as XML. It does not perform - any validation of its definition - """ - - css = {'scss': [resource_string(__name__, 'css/codemirror/codemirror.scss')]} - - js = {'js': [resource_string(__name__, 'js/src/raw/edit/json.js')]} - js_module_name = "JSONEditingDescriptor" diff --git a/xmodule/js/src/raw/edit/json.js b/xmodule/js/src/raw/edit/json.js deleted file mode 100644 index 2de28c03f7..0000000000 --- a/xmodule/js/src/raw/edit/json.js +++ /dev/null @@ -1,32 +0,0 @@ -// Once generated by CoffeeScript 1.9.3, but now lives as pure JS -/* eslint-disable */ -(function() { - var extend = function(child, parent) { for (var key in parent) { if (hasProp.call(parent, key)) child[key] = parent[key]; } function ctor() { this.constructor = child; } ctor.prototype = parent.prototype; child.prototype = new ctor(); child.__super__ = parent.prototype; return child; }, - hasProp = {}.hasOwnProperty; - - this.JSONEditingDescriptor = (function(superClass) { - extend(JSONEditingDescriptor, superClass); - - function JSONEditingDescriptor(element) { - this.element = element; - this.edit_box = CodeMirror.fromTextArea($(".edit-box", this.element)[0], { - mode: { - name: "javascript", - json: true - }, - lineNumbers: true, - lineWrapping: true - }); - } - - JSONEditingDescriptor.prototype.save = function() { - return { - data: JSON.parse(this.edit_box.getValue()) - }; - }; - - return JSONEditingDescriptor; - - })(XModule.Descriptor); - -}).call(this);