Skip to content

Commit

Permalink
added a jQuery.foo snippet for every $.foo
Browse files Browse the repository at this point in the history
  • Loading branch information
kswedberg committed Nov 30, 2010
1 parent 4fb792c commit 7d6bbde
Show file tree
Hide file tree
Showing 25 changed files with 429 additions and 5 deletions.
2 changes: 1 addition & 1 deletion Snippets/$ (Select DOM Element).tmSnippet
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
<key>content</key>
<string>\$(${1/(.+)/(?1:':)/}${1:string/element/array/function/jQuery object/string, context}${1/(.+)/(?1:':)/})$0</string>
<key>name</key>
<string>$ (Select DOM Element)</string>
<string>$ (Select or Create DOM Element)</string>
<key>scope</key>
<string>source.js.jquery</string>
<key>tabTrigger</key>
Expand Down
19 changes: 19 additions & 0 deletions Snippets/document ready - jQuery.tmSnippet
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
<?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>content</key>
<string>jQuery(document).ready(function() {
${0:// Stuff to do as soon as the DOM is ready;}
});
</string>
<key>name</key>
<string>document ready - jQuery</string>
<key>scope</key>
<string>source.js.jquery</string>
<key>tabTrigger</key>
<string>ready</string>
<key>uuid</key>
<string>E8D16A6D-7659-45DE-BD15-E015B1F643E4</string>
</dict>
</plist>
16 changes: 16 additions & 0 deletions Snippets/jQuery (Select or Create DOM Element) copy.tmSnippet
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
<?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>content</key>
<string>\jQuery(${1/(.+)/(?1:':)/}${1:string/element/array/function/jQuery object/string, context}${1/(.+)/(?1:':)/})$0</string>
<key>name</key>
<string>jQuery (Select or Create DOM Element)</string>
<key>scope</key>
<string>source.js.jquery</string>
<key>tabTrigger</key>
<string>jQuery</string>
<key>uuid</key>
<string>CD3ABABC-389D-4DEF-AE97-C42B8BD8D4CF</string>
</dict>
</plist>
31 changes: 31 additions & 0 deletions Snippets/jQuery_ajax.tmSnippet
Original file line number Diff line number Diff line change
@@ -0,0 +1,31 @@
<?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>content</key>
<string>jQuery.ajax({
url: '${1:/path/to/file}',
${2/(.+)/(?1: type\: ':)/}${2:POST}${2/(.+)/(?1:',
:)/}${3/(.+)/(?1: dataType\: ':)/}${3:xml/html/script/json/jsonp}${3/(.+)/(?1:',
:)/}${4/(.+)/(?1: data\: {:)/}${4:param1: 'value1'}${4/(.+)/(?1:},
:)/}${5/(.+)/(?1: complete\: function\(xhr, textStatus\) {
:)/}${5://called when complete}${5/(.+)/(?1:
},
:)/}${6/(.+)/(?1: success\: function\(data, textStatus, xhr\) {
:)/}${6://called when successful}${6/(.+)/(?1:
},
:)/}${7/(.+)/(?1: error\: function\(xhr, textStatus, errorThrown\) {
:)/}${7://called when there is an error}
${7/(.+)/(?1: }
:)/}});
$0</string>
<key>name</key>
<string>jQuery.ajax</string>
<key>scope</key>
<string>source.js.jquery</string>
<key>tabTrigger</key>
<string>jQuery.ajax</string>
<key>uuid</key>
<string>F18DAC78-14B2-4D02-AFBC-A9C47F915590</string>
</dict>
</plist>
31 changes: 31 additions & 0 deletions Snippets/jQuery_ajaxSetup.tmSnippet
Original file line number Diff line number Diff line change
@@ -0,0 +1,31 @@
<?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>content</key>
<string>jQuery.ajaxSetup({
url: '${1:/path/to/file}',
${2/(.+)/(?1: type\: ':)/}${2:POST}${2/(.+)/(?1:',
:)/}${3/(.+)/(?1: dataType\: ':)/}${3:xml/html/script/json/jsonp}${3/(.+)/(?1:',
:)/}${4/(.+)/(?1: data\: {:)/}${4:param1: 'value1'}${4/(.+)/(?1:},
:)/}${5/(.+)/(?1: complete\: function\(xhr, textStatus\) {
:)/}${5://called when complete}${5/(.+)/(?1:
},
:)/}${6/(.+)/(?1: success\: function\(data, textStatus, xhr\) {
:)/}${6://called when successful}${6/(.+)/(?1:
},
:)/}${7/(.+)/(?1: error\: function\(xhr, textStatus, errorThrown\) {
:)/}${7://called when there is an error}
${7/(.+)/(?1: }
:)/}});
$0</string>
<key>name</key>
<string>jQuery.ajaxSetup</string>
<key>scope</key>
<string>source.js.jquery</string>
<key>tabTrigger</key>
<string>jQuery.ajaxSetup</string>
<key>uuid</key>
<string>D65B8AE7-6504-4CC4-9EFB-4012D980DFB5</string>
</dict>
</plist>
16 changes: 16 additions & 0 deletions Snippets/jQuery_boxModel.tmSnippet
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
<?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>content</key>
<string>jQuery.boxModel</string>
<key>name</key>
<string>jQuery.boxModel</string>
<key>scope</key>
<string>source.js.jquery</string>
<key>tabTrigger</key>
<string>jQuery.boxModel</string>
<key>uuid</key>
<string>928C97F0-0994-4F91-BDDA-40C8E77A3666</string>
</dict>
</plist>
16 changes: 16 additions & 0 deletions Snippets/jQuery_browser.tmSnippet
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
<?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>content</key>
<string>jQuery.browser${1/(.+)/(?1:.:)/}${1:webkit/opera/msie/mozilla}${1/(.+)/(?1: :)/}$0</string>
<key>name</key>
<string>jQuery.browser</string>
<key>scope</key>
<string>source.js.jquery</string>
<key>tabTrigger</key>
<string>jQuery.browser</string>
<key>uuid</key>
<string>E53A000B-0E54-4DCD-A53B-89FFA80B7F9E</string>
</dict>
</plist>
16 changes: 16 additions & 0 deletions Snippets/jQuery_browser_version.tmSnippet
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
<?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>content</key>
<string>jQuery.browser.version</string>
<key>name</key>
<string>jQuery.browser.version</string>
<key>scope</key>
<string>source.js.jquery</string>
<key>tabTrigger</key>
<string>jQuery.browser</string>
<key>uuid</key>
<string>6F342C78-D195-4062-81D2-A6B91C8DAD72</string>
</dict>
</plist>
18 changes: 18 additions & 0 deletions Snippets/jQuery_each.tmSnippet
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
<?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>content</key>
<string>jQuery.each(${1:array/object}, function(${2:index}${3:, ${4:val}}) {
${0://iterate through array or object}
});</string>
<key>name</key>
<string>jQuery.each</string>
<key>scope</key>
<string>source.js.jquery</string>
<key>tabTrigger</key>
<string>jQuery.each</string>
<key>uuid</key>
<string>A16AD94D-AA5D-4CDB-81F2-D7DBC87EB03D</string>
</dict>
</plist>
17 changes: 17 additions & 0 deletions Snippets/jQuery_extend.tmSnippet
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
<?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>content</key>
<string>jQuery.extend(${1:true, }${2:target object}, ${3:object1});
$0</string>
<key>name</key>
<string>jQuery.extend</string>
<key>scope</key>
<string>source.js.jquery</string>
<key>tabTrigger</key>
<string>jQuery.extend</string>
<key>uuid</key>
<string>71CE8077-FA1A-44DE-AD87-9C809702BAC4</string>
</dict>
</plist>
19 changes: 19 additions & 0 deletions Snippets/jQuery_get.tmSnippet
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
<?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>content</key>
<string>jQuery.get('${1:/path/to/file}'${2/(.+)/(?1:, {:)/}${2:param1: 'value1'}${2/(.+)/(?1:}:)/}${3/(.+)/(?1:, function\(data, textStatus, xhr\) {
:)/}${3://optional stuff to do after success}${3/(.+)/(?1:
}:)/});
$0</string>
<key>name</key>
<string>jQuery.get</string>
<key>scope</key>
<string>source.js.jquery</string>
<key>tabTrigger</key>
<string>jQuery.get</string>
<key>uuid</key>
<string>8F8BE76F-F6AC-448A-9F75-339275ED18BF</string>
</dict>
</plist>
19 changes: 19 additions & 0 deletions Snippets/jQuery_getJSON.tmSnippet
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
<?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>content</key>
<string>jQuery.getJSON('${1:/path/to/file}'${2/(.+)/(?1:, {:)/}${2:param1: 'value1'}${2/(.+)/(?1:}:)/}${3/(.+)/(?1:, function\(json, textStatus\) {
:)/}${3://optional stuff to do after success}${3/(.+)/(?1:
}:)/});
$0</string>
<key>name</key>
<string>jQuery.getJSON</string>
<key>scope</key>
<string>source.js.jquery</string>
<key>tabTrigger</key>
<string>jQuery.getJSON</string>
<key>uuid</key>
<string>1E5851C8-C77F-48B1-B81E-CCF2E9F50E90</string>
</dict>
</plist>
19 changes: 19 additions & 0 deletions Snippets/jQuery_getScript.tmSnippet
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
<?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>content</key>
<string>jQuery.getScript('${1:path/to/file}'${2/(.+)/(?1:, function\(data, textStatus\) {
:)/}${2://optional stuff to do after getScript}${2/(.+)/(?1:
}:)/});
$0</string>
<key>name</key>
<string>jQuery.getScript</string>
<key>scope</key>
<string>source.js.jquery</string>
<key>tabTrigger</key>
<string>jQuery.getScript</string>
<key>uuid</key>
<string>E7A389DC-77F8-4D48-9B4E-35C966A9722B</string>
</dict>
</plist>
16 changes: 16 additions & 0 deletions Snippets/jQuery_inArray.tmSnippet
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
<?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>content</key>
<string>jQuery.inArray(${1:value}, ${2:array});$0</string>
<key>name</key>
<string>jQuery.inArray</string>
<key>scope</key>
<string>source.js.jquery</string>
<key>tabTrigger</key>
<string>jQuery.inArray</string>
<key>uuid</key>
<string>E96A90AC-73ED-46A6-A0C5-6E47043B8F4B</string>
</dict>
</plist>
16 changes: 16 additions & 0 deletions Snippets/jQuery_isEmptyObject.tmSnippet
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
<?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>content</key>
<string>jQuery.isEmptyObject('${1:object}')$0</string>
<key>name</key>
<string>jQuery.isEmptyObject</string>
<key>scope</key>
<string>source.js.jquery</string>
<key>tabTrigger</key>
<string>jQuery.isEmptyObject</string>
<key>uuid</key>
<string>C91FAB3B-AB50-4113-B29A-A93B79930A56</string>
</dict>
</plist>
16 changes: 16 additions & 0 deletions Snippets/jQuery_isPlainObject.tmSnippet
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
<?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>content</key>
<string>jQuery.isPlainObject('${1:object}')$0</string>
<key>name</key>
<string>jQuery.isPlainObject</string>
<key>scope</key>
<string>source.js.jquery</string>
<key>tabTrigger</key>
<string>jQuery.isPlainObject</string>
<key>uuid</key>
<string>BB98D569-21AB-4A7A-BA0B-95322E41715E</string>
</dict>
</plist>
18 changes: 18 additions & 0 deletions Snippets/jQuery_map.tmSnippet
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
<?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>content</key>
<string>jQuery.map(${1:array}, function(${2:item}${3:, ${4:index}}) {
${5:return ${6:something};}
});</string>
<key>name</key>
<string>jQuery.map</string>
<key>scope</key>
<string>source.js.jquery</string>
<key>tabTrigger</key>
<string>jQuery.map</string>
<key>uuid</key>
<string>AE82E287-8D4F-4077-85C3-75CF4B1083C7</string>
</dict>
</plist>
17 changes: 17 additions & 0 deletions Snippets/jQuery_merge.tmSnippet
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
<?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>content</key>
<string>jQuery.merge(${1:array1}, ${2:array2});
$0</string>
<key>name</key>
<string>jQuery.merge</string>
<key>scope</key>
<string>source.js.jquery</string>
<key>tabTrigger</key>
<string>jQuery.merge</string>
<key>uuid</key>
<string>55304395-C690-4D69-B696-1837C5A5B03D</string>
</dict>
</plist>
16 changes: 16 additions & 0 deletions Snippets/jQuery_noop.tmSnippet
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
<?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>content</key>
<string>jQuery.noop()${0:;}${1:}</string>
<key>name</key>
<string>jQuery.noop</string>
<key>scope</key>
<string>source.js.jquery</string>
<key>tabTrigger</key>
<string>jQuery.noop</string>
<key>uuid</key>
<string>390F8483-BB8F-45F1-B2EB-C943AC5B24CA</string>
</dict>
</plist>
16 changes: 16 additions & 0 deletions Snippets/jQuery_parseJSON.tmSnippet
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
<?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>content</key>
<string>jQuery.parseJSON(${1:json});${0:}</string>
<key>name</key>
<string>jQuery.parseJSON</string>
<key>scope</key>
<string>source.js.jquery</string>
<key>tabTrigger</key>
<string>jQuery.parseJSON</string>
<key>uuid</key>
<string>D502E460-8AD5-487D-9AAD-D39FC1A62127</string>
</dict>
</plist>
19 changes: 19 additions & 0 deletions Snippets/jQuery_post.tmSnippet
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
<?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>content</key>
<string>jQuery.post('${1:/path/to/file}'${2/(.+)/(?1:, {:)/}${2:param1: 'value1'}${2/(.+)/(?1:}:)/}${3/(.+)/(?1:, function\(data, textStatus, xhr\) {
:)/}${3://optional stuff to do after success}${3/(.+)/(?1:
}:)/});
$0</string>
<key>name</key>
<string>jQuery.post</string>
<key>scope</key>
<string>source.js.jquery</string>
<key>tabTrigger</key>
<string>jQuery.post</string>
<key>uuid</key>
<string>5E500FD9-6E49-4D3F-91F2-733051DE2CD9</string>
</dict>
</plist>
Loading

0 comments on commit 7d6bbde

Please sign in to comment.