Created
February 12, 2012 19:08
-
-
Save jonmagic/1810305 to your computer and use it in GitHub Desktop.
jQuery plugin template in CoffeeScript
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| $ = 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