Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse files

Add khanscript!

Summary:
You can now create <script type="text/khanscript"> blocks in exercise questions
and hints that get executed at the right time. This can basically be used
wherever we use graphie but don't need SVG.

Reviewers: emily, alpert

Reviewed By: alpert

Differential Revision: http://phabricator.khanacademy.org/D549
  • Loading branch information...
commit b0613b78f9979c925814d11800314a9934abf721 1 parent 9e4a4b9
@beneater beneater authored
Showing with 9 additions and 0 deletions.
  1. +9 −0 utils/khanscript.js
View
9 utils/khanscript.js
@@ -0,0 +1,9 @@
+(function() {
+ $.fn.khanscript = function(problem) {
+ return this.find("script[type='text/khanscript']").each(function() {
+ var code = $(this).text();
+ code = "(function() {" + code + "})()";
+ $.tmpl.getVAR(code);
+ }).end();
+ };
+})();
Please sign in to comment.
Something went wrong with that request. Please try again.