Sha256: 9296ea77c427ef769719e430dd8969e827c6a774c2c6f736e4a943589a1ce34b
Contents?: true
Size: 722 Bytes
Versions: 9
Compression:
Stored size: 722 Bytes
Contents
class Previewer constructor: (@el)-> init: -> @el.on 'adhoq:updatePreview', => @update() @el.on 'click', => @el.trigger 'adhoq:updatePreview' false update: -> jQuery.ajax( type: @el.data('method'), url: @el.attr('href'), data: {query: @source()}, complete: (xhr)=> @result().html(xhr.responseText) ) source: -> $(@el.data('source')).val() result: -> $(@el.data('result')) Adhoq.enablePreview = ($el)-> (new Previewer($el)).init() Adhoq.enablePreviewKeybordShortCut= ($textarea, previewSelector)-> $textarea.on 'keyup', (ev)-> if(ev.ctrlKey && ev.keyCode is 82) $(previewSelector).trigger('adhoq:updatePreview') false
Version data entries
9 entries across 9 versions & 1 rubygems