Skip to content

Instantly share code, notes, and snippets.

@nickw
nickw / jquery.myplugin.coffee
Created April 24, 2012 01:49 — forked from jimeh/jquery.myplugin.coffee
Example jQuery plugin written in CoffeeScript, and the resulting compiled JavaScript file.
$.fn.extend
myplugin: (options) ->
self = $.fn.myplugin
opts = $.extend {}, self.defaultOptions, options
for el in this
self.init el, opts
self.log el if opts.log
$.extend $.fn.myplugin,
// Attempt to make a drop-and-forget bunch of scripts that mimick some missing html5 goodies automatically
// Example:
// $(document).ready(function() {
// ProvideHtml5.autofocus()
// ProvideHtml5.datepicker()
// ProvideHtml5.forcenumber()
// })
var ProvideHtml5 = {
autofocus = function() {