first commit

This commit is contained in:
Senad Uka
2018-05-07 16:07:00 +02:00
commit 8b4f09f9d5
3368 changed files with 852614 additions and 0 deletions

View File

@@ -0,0 +1,19 @@
$.fn.executr = (opts) ->
defaults =
codeSelector: 'code[executable]'
opts = $.extend {}, defaults, opts
this.on 'click', opts.codeSelector, (e) ->
$target = $ e.target
$code = $target.parents(opts.codeSelector)
ctx = window
if opts.setUp?
CoffeeScript.run opts.setUp, ctx
CoffeeScript.run $code.text(), ctx
if opts.tearDown?
CoffeeScript.run opts.tearDown, ctx