Skip to content
Merged
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
18 changes: 0 additions & 18 deletions common/lib/xmodule/xmodule/js/src/capa/schematic.js
Original file line number Diff line number Diff line change
Expand Up @@ -1987,23 +1987,6 @@ function update_schematics() {
}
window.update_schematics = update_schematics;

// add ourselves to the tasks that get performed when window is loaded
function add_schematic_handler(other_onload) {
return function() {
// execute othe onload functions first
if (other_onload) other_onload();

update_schematics();
}
}

// ask each schematic input widget to update its value field for submission
function prepare_schematics() {
var schematics = $('.schematic');
for (var i = schematics.length - 1; i >= 0; i--)
schematics[i].schematic.update_value();
}

schematic = (function() {
var background_style = 'rgb(220,220,220)';

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The only references to this function are in the two wiki templates, removed in this commit.

grep -r 'add_schematic_handler' /edx/app/edxapp/edx-platform/

var element_style = 'rgb(255,255,255)';
Expand Down Expand Up @@ -6196,4 +6179,3 @@ schematic = (function() {
}
return module;
}());

9 changes: 0 additions & 9 deletions common/static/js/capa/schematicinput.js
Original file line number Diff line number Diff line change
@@ -1,8 +1,3 @@
var schematic_height = 220;
var schematic_width = 400;
var styling_height_delta = 2; //How many pixels are added to the height of the box because of styling (like a shadow)
var styling_width_delta = 2;

$(function() {
// TODO: someone should fix all of this...
//$("a[rel*=leanModal]").leanModal(); //TODO: Make this work with the new modal library. Try and integrate this with the "slices"
Expand Down Expand Up @@ -50,9 +45,5 @@ $(function() {

editingCircuit.schematic.load_schematic(saving_circuit, "");
editingCircuit.schematic.zoomall();

if (editingCircuit.codeMirrorLine) {
editingCircuit.codeMirrorLine.replace(0, null, "circuit-schematic:" + saving_circuit);
}
});
});
38 changes: 2 additions & 36 deletions common/static/js/vendor/CodeMirror/addons/edx_markdown.js
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ CodeMirror.defineMode("edx_markdown", function(cmCfg, modeCfg) {
, olRE = /^[0-9]+\.\s+/
, headerRE = /^(?:\={3,}|-{3,})$/
, textRE = /^[^\[*_\\<>`]+/
, circuitRE = /^circuit-schematic:(.*)$/;
;

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

One less regex to match.


function switchInline(stream, state, f) {
state.f = state.inline = f;
Expand Down Expand Up @@ -55,43 +55,9 @@ CodeMirror.defineMode("edx_markdown", function(cmCfg, modeCfg) {
.replace(/'/g, "&#039;");
}

var circuit_formatter = {
creator: function(text) {
var circuit_value = text.match(circuitRE)[1]

circuit_value = escapeHtml(circuit_value);

var html = "<div style='display:block;line-height:0;' class='schematic_container'><a href='#circuit_editor_modal' data-toggle='modal' class='schematic_open' style='display:inline-block;'>" +
"<input type='hidden' parts='' value='" + circuit_value + "' width='" + schematic_width + "' height='" + schematic_height + "' analyses='' class='schematic ctrls'/></a></div>";

return html;
},
size: function(text) {
return {width: schematic_width + styling_width_delta, height:schematic_height + styling_height_delta};
},
callback: function(node, line) {
try {
update_schematics();
var schmInput = node.firstChild.firstChild;
schmInput.codeMirrorLine = line;
if (schmInput.schematic) { //This is undefined if there was an error making the schematic
schmInput.schematic.canvas.style.display = "block"; //Otherwise, it gets line height and is a weird size
schmInput.schematic.always_draw_grid = true;
schmInput.schematic.redraw_background();
}
} catch (err) {
console.log("Error in edx_markdown callback: " + err);
}

}
};

function blockNormal(stream, state) {
var match;
if (stream.sol() && stream.match(circuitRE)) {
stream.skipToEnd();
return circuit_formatter;
} else if (state.indentationDiff >= 4) {
if (state.indentationDiff >= 4) {
state.indentation -= state.indentationDiff;
stream.skipToEnd();
return code;
Expand Down
Empty file removed lms/djangoapps/circuit/__init__.py
Empty file.
10 changes: 0 additions & 10 deletions lms/djangoapps/circuit/models.py

This file was deleted.

65 changes: 0 additions & 65 deletions lms/djangoapps/circuit/views.py

This file was deleted.

71 changes: 0 additions & 71 deletions lms/djangoapps/course_wiki/plugins/markdownedx/mdx_circuit.py

This file was deleted.

9 changes: 5 additions & 4 deletions lms/djangoapps/course_wiki/plugins/markdownedx/wiki_plugin.py
Original file line number Diff line number Diff line change
Expand Up @@ -3,16 +3,17 @@
from wiki.core.plugins.base import BasePlugin
from wiki.core.plugins import registry as plugin_registry

from course_wiki.plugins.markdownedx import mdx_circuit, mdx_mathjax, mdx_video
from course_wiki.plugins.markdownedx import mdx_mathjax, mdx_video


class ExtendMarkdownPlugin(BasePlugin):
"""
This plugin simply loads all of the markdown extensions we use in edX.
"""

markdown_extensions = [mdx_circuit.CircuitExtension(configs={}),
mdx_mathjax.MathJaxExtension(configs={}),
mdx_video.VideoExtension(configs={})]
markdown_extensions = [
mdx_mathjax.MathJaxExtension(configs={}),
mdx_video.VideoExtension(configs={}),
]

plugin_registry.register(ExtendMarkdownPlugin)
1 change: 0 additions & 1 deletion lms/envs/common.py
Original file line number Diff line number Diff line change
Expand Up @@ -1819,7 +1819,6 @@
'openedx.core.djangoapps.theming',

# Our courseware
'circuit',
'courseware',
'student',

Expand Down
9 changes: 0 additions & 9 deletions lms/static/coffee/src/main.coffee
Original file line number Diff line number Diff line change
Expand Up @@ -18,15 +18,6 @@ $ ->
if $('body').hasClass('courseware')
Courseware.start()

# Preserved for backward compatibility
window.submit_circuit = (circuit_id) ->
$("input.schematic").each (index, el) ->
el.schematic.update_value()

schematic_value $("#schematic_#{circuit_id}").attr("value")
$.postWithPrefix "/save_circuit/#{circuit_id}", schematic: schematic_value, (data) ->
alert('Saved') if data.results == 'success'

window.postJSON = (url, data, callback) ->
$.postWithPrefix url, data, callback

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This is one of a half dozen or so global variables removed in this PR.


Expand Down
54 changes: 0 additions & 54 deletions lms/static/sass/course/wiki/_wiki.scss
Original file line number Diff line number Diff line change
Expand Up @@ -973,57 +973,3 @@ section.wiki {
width: 100% !important;
margin-left: 0;
}


#circuit_editor_modal.modal {
@extend %ui-depth4;
width: 648px;
margin-left: -325px;
top: 150px;

.modal-header {
h1, p {
color: $white;
}

h1 {
margin: 3px 12px 8px;
font-size: 1.1em;
}

p {
font-size: 0.9em;
margin: 5px 12px 20px;
line-height: 1em;
}
}

.modal-body {
padding-bottom: 8px;
}

.modal-footer {
margin: 12px;
}

.modal-footer .btn {
@include button(simple, #eee);
font-size: 0.8em;
margin-right: ($baseline/4);
line-height: 1.2em;
text-transform: none !important;
letter-spacing: 0 !important;

&:hover, &:focus {
color: $base-font-color;
text-decoration: none;
}

&.btn-primary {
@include button;
font-size: 0.8em;
}

margin-right: ($baseline/2);
}
}
8 changes: 0 additions & 8 deletions lms/templates/edit_circuit.html

This file was deleted.

2 changes: 0 additions & 2 deletions lms/templates/show_circuit.html

This file was deleted.

4 changes: 0 additions & 4 deletions lms/templates/wiki/base.html
Original file line number Diff line number Diff line change
Expand Up @@ -34,10 +34,6 @@

{% addtoblock 'js' %}
{% comment %} These scripts load at the bottom of the body {% endcomment %}
<script>
window.onload = add_schematic_handler(window.onload);
</script>

<script src="{% static 'js/bootstrap-alert.js' %}"></script>
<script src="{% static 'js/bootstrap-collapse.js' %}"></script>
<script src="{% static 'js/bootstrap-modal.js' %}"></script>
Expand Down
1 change: 0 additions & 1 deletion lms/templates/wiki/includes/cheatsheet.html
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,6 @@ <h2>{% trans "Wiki Syntax Help" %}</h2>
</section>
<section>
<h3>{% blocktrans with platform_name=settings.PLATFORM_NAME %}{{ platform_name }} Additions:{% endblocktrans %}</h3>
<pre>circuit-schematic:</pre>
<pre>$LaTeX {% trans "Math Expression" %}$</pre>
</section>
</div>
Expand Down
5 changes: 0 additions & 5 deletions lms/templates/wiki/preview_inline.html
Original file line number Diff line number Diff line change
Expand Up @@ -41,11 +41,6 @@ <h1 class="page-header">{{ title }}</h1>

{% compressed_js 'application' %}
{% compressed_js 'module-js' %}

<script>
window.onload = add_schematic_handler(window.onload);
</script>

{% with mathjax_mode='wiki' %}
{% include "mathjax_include.html" %}
{% endwith %}
Expand Down
Loading