Skip to content
This repository was archived by the owner on Jun 7, 2023. It is now read-only.

Commit 041e989

Browse files
committed
Merge branch 'master' of https://github.com/vqum/RunestoneComponents into master
2 parents 5b252f3 + 286da09 commit 041e989

21 files changed

Lines changed: 279 additions & 294 deletions

File tree

runestone/__init__.py

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -208,7 +208,6 @@ def build(options):
208208
"presenter_mode.css",
209209
"jquery-ui-1.10.3.custom.min.css",
210210
"bootstrap-sphinx.css",
211-
"user-highlights.css",
212211
"runestone-custom-sphinx-bootstrap.css?v=" + runestone_version,
213212
"theme-overrides.css",
214213
]

runestone/activecode/js/acfactory.js

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -160,9 +160,9 @@ export default class ACFactory {
160160
// Page Initialization
161161
//
162162

163-
$(document).ready(function () {
163+
$(document).bind("runestone:login-complete", function () {
164164
ACFactory.createScratchActivecode();
165-
$("[data-component=activecode]").each(function (index) {
165+
$("[data-component=activecode]").each(function () {
166166
if ($(this).closest("[data-component=timedAssessment]").length == 0) {
167167
// If this element exists within a timed component, don't render it here
168168
try {

runestone/activecode/js/livecode.js

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
11
import { ActiveCode } from "./activecode.js";
22
import MD5 from "./md5.js";
33
import JUnitTestParser from "./extractUnitResults.js";
4+
import "../../codelens/js/pytutor-embed.bundle.js";
45

56
export default class LiveCode extends ActiveCode {
67
constructor(opts) {

runestone/activecode/test/test_activecode.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@ def find_ac(selenium_utils, div_id):
1313

1414
def click_run(selenium_utils, ac_selenium_element):
1515
# The run button can sometimes be scrolled to the top of the screen, where it's hidden by the navigation bar. In this case, we can't click it, since Selenium will complain ``Message: element click intercepted: Element <button class="btn btn-success run-button" type="button">...</button> is not clickable at point (460, 17). Other element would receive the click: <div class="navbar-collapse collapse navbar-ex1-collapse">...</div>``. To avoid this, always scroll to the top of the document, guaranteeing that the navbar won't be hiding the run button.
16-
selenium_utils.driver.execute_script("window.scrollTo(0, 0);")
16+
selenium_utils.scroll_to_top()
1717
rb = ac_selenium_element.find_element_by_class_name("run-button")
1818
rb.click()
1919
# After clicking run, the browser may need some time to load and execute the code. Wait until the run button becomes clickable, indicating the code has finished running.

runestone/codelens/js/codelens.js

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,8 @@
1111
return the buttons, but I'm having a hard time thinking of any other use for that besides mine.
1212
*/
1313

14+
import RunestoneBase from "../../common/js/runestonebase.js";
15+
import "./pytutor-embed.bundle.js";
1416
import "./../css/pytutor.css";
1517

1618
function attachLoggers(codelens, divid) {

runestone/codelens/visualizer.py

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -29,8 +29,6 @@
2929
def setup(app):
3030
app.add_directive("codelens", Codelens)
3131

32-
app.add_autoversioned_javascript("pytutor-embed.bundle.js")
33-
3432
app.add_config_value("codelens_div_class", "alert alert-warning cd_section", "html")
3533
app.add_config_value("trace_url", "http://tracer.runestone.academy:5000", "html")
3634
app.add_node(CodeLensNode, html=(visit_codelens_node, depart_codelens_node))
@@ -40,7 +38,7 @@ def setup(app):
4038

4139
VIS = """
4240
<div class="runestone" style="max-width: none;">
43-
<div class="%(divclass)s" data-question_label="%(question_label)s">
41+
<div class="%(divclass)s" data-component="codelens" data-question_label="%(question_label)s">
4442
<div class="pytutorVisualizer" id="%(divid)s"
4543
data-params='{"embeddedMode": true, "lang": "%(language)s", "jumpToEnd": false}'>
4644
</div>

runestone/common/js/renderComponent.js

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,3 @@
1-
import TimedMC from "../../mchoice/js/timedmc";
2-
31
export function renderRunestoneComponent(componentSrc, whereDiv, moreOpts) {
42
/**
53
* The easy part is adding the componentSrc to the existing div.

runestone/common/js/user-highlights.js

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -2,12 +2,8 @@
22

33
"use strict";
44

5-
import RunestoneBase from "./runestonebase";
65
import "../css/user-highlights.css";
76

8-
var urlList;
9-
var extendType;
10-
var rsb = new RunestoneBase();
117

128
function getCompletions() {
139
// Get the completion status

runestone/datafile/js/datafile.js

Lines changed: 13 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -40,26 +40,27 @@ class DataFile extends RunestoneBase {
4040
this.createPre();
4141
}
4242
}
43+
this.indicate_component_ready();
4344
}
4445
/*=====================================
4546
== Create either <pre> or <textarea> ==
4647
== depending on if editing is true ==
4748
==================================*/
4849
createPre() {
49-
this.preContainer = document.createElement("pre");
50-
this.preContainer.id = this.divid;
51-
$(this.preContainer).attr({ style: "display: " + this.displayClass });
52-
this.preContainer.innerHTML = this.origElem.innerHTML;
53-
$(this.origElem).replaceWith(this.preContainer);
50+
this.containerDiv = document.createElement("pre");
51+
this.containerDiv.id = this.divid;
52+
$(this.containerDiv).attr({ style: "display: " + this.displayClass });
53+
this.containerDiv.innerHTML = this.origElem.innerHTML;
54+
$(this.origElem).replaceWith(this.containerDiv);
5455
}
5556
createTextArea() {
56-
this.textAreaContainer = document.createElement("textarea");
57-
this.textAreaContainer.id = this.divid;
58-
this.textAreaContainer.rows = this.numberOfRows;
59-
this.textAreaContainer.cols = this.numberOfCols;
60-
this.textAreaContainer.innerHTML = this.origElem.innerHTML;
61-
$(this.textAreaContainer).addClass("datafiletextfield");
62-
$(this.origElem).replaceWith(this.textAreaContainer);
57+
this.containerDiv = document.createElement("textarea");
58+
this.containerDiv.id = this.divid;
59+
this.containerDiv.rows = this.numberOfRows;
60+
this.containerDiv.cols = this.numberOfCols;
61+
this.containerDiv.innerHTML = this.origElem.innerHTML;
62+
$(this.containerDiv).addClass("datafiletextfield");
63+
$(this.origElem).replaceWith(this.containerDiv);
6364
}
6465
}
6566

runestone/fitb/fitb.py

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -144,7 +144,6 @@ class FillInTheBlank(RunestoneIdDirective):
144144
option_spec = RunestoneIdDirective.option_spec.copy()
145145
option_spec.update(
146146
{
147-
"blankid": directives.unchanged,
148147
"casei": directives.flag, # case insensitive matching
149148
}
150149
)

0 commit comments

Comments
 (0)