Permalink
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...
1 parent 9e4a4b9 commit b0613b78f9979c925814d11800314a9934abf721 @beneater beneater committed Aug 8, 2012
Showing with 9 additions and 0 deletions.
  1. +9 −0 utils/khanscript.js
View
@@ -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();
+ };
+})();

0 comments on commit b0613b7

Please sign in to comment.