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

Commit 0e71838

Browse files
committed
Enable codelens for other languages
1 parent e9c5b2f commit 0e71838

2 files changed

Lines changed: 12 additions & 4 deletions

File tree

runestone/activecode/js/activecode.js

Lines changed: 11 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -724,11 +724,18 @@ ActiveCode.prototype.showCodelens = function () {
724724
myVars.textReferences = false;
725725
myVars.showOnlyOutputs = false;
726726
myVars.rawInputLstJSON = JSON.stringify([]);
727-
if (this.python3) {
728-
myVars.py = 3;
727+
if (this.language == 'python') {
728+
if (this.python3) {
729+
myVars.py = 3;
730+
} else {
731+
myVars.py = 2;
732+
}
733+
} else if (this.langauge == 'javascript') {
734+
myVars.py = 'js'
729735
} else {
730-
myVars.py = 2;
736+
myVars.py = this.language;
731737
}
738+
732739
myVars.curInstr = 0;
733740
myVars.codeDivWidth = 350;
734741
myVars.codeDivHeight = 400;
@@ -2744,6 +2751,7 @@ ACFactory.toggleScratchActivecode = function () {
27442751
var divid = "ac_modal_" + eBookConfig.scratchDiv;
27452752
var div = $("#" + divid);
27462753

2754+
$(`#${eBookConfig.scratchDiv}`).removeClass('ac_section');
27472755
div.modal('toggle');
27482756

27492757
};

runestone/common/css/runestone-custom-sphinx-bootstrap.css

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -462,7 +462,7 @@ div.flash {
462462

463463
/* Modal dialog styles (scratch activecode, compare me, etc) */
464464
.scratch-ac-modal {
465-
width: 800px;
465+
width: 90%;
466466
}
467467

468468
.compare-modal .progress {

0 commit comments

Comments
 (0)