Skip to content

Instantly share code, notes, and snippets.

@jonmagic
Created February 12, 2012 19:08
Show Gist options
  • Select an option

  • Save jonmagic/1810305 to your computer and use it in GitHub Desktop.

Select an option

Save jonmagic/1810305 to your computer and use it in GitHub Desktop.
jQuery plugin template in CoffeeScript
$ = jQuery # Adds plugin object to jQuery
$.fn.extend {}= # Change the pluginName
queueSearch: (options) ->
settings = # Default settings
option1: true
option2: false
debug: false
settings = $.extend settings, options # Merge default settings with options
log = (msg) -> # Simple logger
console?.log msg if settings.debug
return @each ()-> # Insert magic here
log "Preparing magic show."
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment