Skip to content

Commit

Permalink
fix javascript
Browse files Browse the repository at this point in the history
  • Loading branch information
ethanchewy committed May 29, 2018
1 parent f5be45f commit d0758e2
Showing 1 changed file with 7 additions and 0 deletions.
7 changes: 7 additions & 0 deletions static/js/javascript.js
Original file line number Diff line number Diff line change
Expand Up @@ -147,6 +147,13 @@ $(document).ready(function(){
$("#output").append("<pre>"+data+"</pre>");
}
});
var exampleCode = function (id, text) {
$(id).click(function (e) {
//console.log("sdf");
editor.setValue(text);
editor.focus(); // so that F5 works, hmm
});
};

exampleCode('#codeexample1', "methods = []\nfor i in range(10):\n methodds.append(lambda x: x + i)\nprint methods[0](10)");
exampleCode('#codeexample2', "for i in range(5):\n print i\n");
Expand Down

0 comments on commit d0758e2

Please sign in to comment.