Permalink
Browse files

jQuery Plugin

  • Loading branch information...
1 parent f1b06e2 commit 5afcf228f92fdc751bf4f3237784d4c8bd7eeae4 @sumeetjain committed Aug 27, 2010
Showing with 33 additions and 1 deletion.
  1. +3 −0 README.markdown
  2. +2 −1 js/README.markdown
  3. +28 −0 js/jQuery Plugin.tmSnippet
View
@@ -15,6 +15,9 @@ Here's a quick rundown of what each snippet does:
### Javascript
- jQuery Scope - Type `q` and hit TAB to insert an anonymous function that's automatically bound to $(document).ready(). I put all of my jQuery goodness inside of this.
- jQuery Selector - Type `$` and hit TAB to insert a blank jQuery selector. The cursor focus moves into the quotes. Example: `$` + `TAB` + `#someId` results in `$('#someId')`.
+- jQuery Plugin - Type `jp` and hit TAB to insert a jQuery plugin template. *(Credit: [kneath](http://github.com/kneath/textmate-snippets)*
+
+kneath)
### Markdown
- Add Footnote - Type `^` and hit TAB to insert a reference and footnote. After hitting TAB, you type the number of the reference. This is one of my favorites.
View
@@ -11,4 +11,5 @@ Here's a quick rundown of what each snippet does:
# Javascript
- jQuery Scope - Type `q` and hit TAB to insert an anonymous function that's automatically bound to $(document).ready(). I put all of my jQuery goodness inside of this.
-- jQuery Selector - Type `$` and hit TAB to insert a blank jQuery selector. The cursor focus moves into the quotes. Example: `$` + `TAB` + `#someId` results in `$('#someId')`.
+- jQuery Selector - Type `$` and hit TAB to insert a blank jQuery selector. The cursor focus moves into the quotes. Example: `$` + `TAB` + `#someId` results in `$('#someId')`.
+- jQuery Plugin - Type `jp` and hit TAB to insert a jQuery plugin template. *(Credit: [kneath](http://github.com/kneath/textmate-snippets)*
@@ -0,0 +1,28 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
+<plist version="1.0">
+<dict>
+ <key>bundleUUID</key>
+ <string>AAB4FD74-73F9-11D9-B89A-000D93589AF6</string>
+ <key>content</key>
+ <string>(function(\$){
+ \$.fn.$1 = function(options){
+ var opts = \$.extend({}, \$.fn.$1.defaults, options);
+
+ return this.each(function(){
+ $2
+ })
+ }
+
+ \$.fn.$1.defaults = {
+
+ }
+})(jQuery);</string>
+ <key>name</key>
+ <string>jQuery Plugin</string>
+ <key>tabTrigger</key>
+ <string>jp</string>
+ <key>uuid</key>
+ <string>1291F8B1-087F-4B86-A9DB-CC3518969F40</string>
+</dict>
+</plist>

0 comments on commit 5afcf22

Please sign in to comment.