Skip to content

Commit 3e2df71

Browse files
committed
bam
1 parent c1d7f88 commit 3e2df71

2 files changed

Lines changed: 36 additions & 5 deletions

File tree

‎v3/js/opt-office-mix.js‎

Lines changed: 23 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -371,13 +371,35 @@ function mixLazyExecuteCode() {
371371
}
372372

373373

374+
// for opt-testcases.js
375+
function getBaseBackendOptionsObj() {
376+
var ret = {cumulative_mode: false,
377+
heap_primitives: false,
378+
show_only_outputs: false,
379+
py_crazy_mode: false,
380+
origin: originFrontendJsFile};
381+
return ret;
382+
}
383+
384+
function getBaseFrontendOptionsObj() {
385+
ret = {embeddedMode: true};
386+
return ret;
387+
}
388+
389+
374390
$(document).ready(function() {
375391
$('#pythonVersionSelector').change(setAceMode);
376392

377393
$("#executeBtn").click(function() {
378394
mixLazyExecuteCode();
379395
});
380396

397+
$("#createTestsLink").click(function() {
398+
initTestcasesPane('#testCasesPane');
399+
$(this).hide();
400+
return false;
401+
});
402+
381403
// To run in https://labsjs.blob.core.windows.net/sdk/LabsJS-1.0.4/labshost.html
382404
// append "?PostMessageLabHost" to the query string.
383405
Labs.DefaultHostBuilder = function() {
@@ -406,7 +428,7 @@ $(document).ready(function() {
406428
// TODO: in the future, make it flexible height but for now, just make
407429
// it fixed-height but kinda small-ish
408430
initAceEditor(200);
409-
pyInputAceEditor.setOptions({minLines: 12, maxLines: 1000});
431+
pyInputAceEditor.setOptions({minLines: 10, maxLines: 1000});
410432

411433
// no frills footer
412434
$("#footer").css("margin-top", "0px")

‎v3/opt-office-mix.html‎

Lines changed: 13 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -58,6 +58,11 @@
5858
<script type="text/javascript" src="js/codemirror/python.js"></script>
5959
-->
6060

61+
<!-- test cases -->
62+
<script type="text/javascript" src="js/opt-testcases.js"></script>
63+
<link rel="stylesheet" href="css/opt-testcases.css"/>
64+
65+
6166
<!-- Ace online code editor -->
6267
<script type="text/javascript" src="js/ace/src-min-noconflict/ace.js" charset="utf-8"></script>
6368

@@ -103,6 +108,14 @@
103108
<div id="codeInputPane"></div> <!-- populate with a CodeMirror or Ace code editor instance -->
104109
<div id="frontendErrorOutput"></div>
105110

111+
<button style="margin-top: 10px;" id="executeBtn" class="bigBtn">???</button>
112+
113+
<p style="margin-top: 20px;">
114+
<a href="#" id="createTestsLink">Create test cases</a>
115+
</p>
116+
117+
<div id="testCasesPane"></div>
118+
106119
</div>
107120

108121

@@ -111,10 +124,6 @@
111124

112125
<div id="footer">
113126

114-
<p>
115-
<button id="executeBtn" class="bigBtn">???</button>
116-
</p>
117-
118127
<p>
119128
<a href="http://pythontutor.com/" target="_blank">Online Python Tutor</a> supports
120129
Python 2.7 and 3.3, Java 7, JavaScript ES5 strict, TypeScript 1.4.1, and Ruby 2.2.2

0 commit comments

Comments
 (0)