Commit Graph

30 Commits

Author SHA1 Message Date
Thomas Aylott b62b480d16 New snippets for switch / case 2008-08-18 10:32:07 -04:00
Thomas Aylott 3b07658fe5 onload listener snippet 2008-08-04 10:47:45 -04:00
Thomas Aylott 7013ea5911 new window. snippet like the current document. snippet 2008-08-04 10:47:07 -04:00
Thomas Aylott bff49bbc00 Updated proto snippet to match the new style of snippets for this bundle 2008-08-04 10:46:40 -04:00
Thomas Aylott cd58b83794 Removed some poorly thought out snippets.
Unified the for snippets some more
New for snippet for fast DOM iteration
2008-07-25 18:27:42 -04:00
Thomas Aylott f62ab505b7 Unifying snippet formats 2008-07-19 18:11:57 -04:00
Thomas Aylott 879f4c5c9d Changed the forin snippet to match what it actually does 2008-07-08 16:57:47 -04:00
Thomas Aylott 8f08e77bdd Snippet: try … catch 2008-07-08 16:54:39 -04:00
subtlegradient 3e3082b4d4 New document. snippet, because you end up typing that a billion times
git-svn-id: http://macromates.com/svn/Bundles/trunk/Review/Bundles/JavaScript.tmbundle@10174 dfb7d73b-c2ec-0310-8fea-fb051d288c6d
2008-07-07 12:11:41 -04:00
subtlegradient 9befbaa4c5 Attempting to unify the style of the various snippets. The idea is that if it's fewer characters to add something than to remove it, then it gets removed from the snippet.
git-svn-id: http://macromates.com/svn/Bundles/trunk/Review/Bundles/JavaScript.tmbundle@10173 dfb7d73b-c2ec-0310-8fea-fb051d288c6d
2008-07-07 12:11:41 -04:00
subtlegradient ec99bb4c5c Removed the anonymous function from the timeout snippet. You can easily add your own with the f snippet
git-svn-id: http://macromates.com/svn/Bundles/trunk/Review/Bundles/JavaScript.tmbundle@10172 dfb7d73b-c2ec-0310-8fea-fb051d288c6d
2008-07-07 12:11:41 -04:00
subtlegradient 7a68cfb531 Degault the Get Elements snippet to getElementById instead of getElementsByTagName
git-svn-id: http://macromates.com/svn/Bundles/trunk/Review/Bundles/JavaScript.tmbundle@10171 dfb7d73b-c2ec-0310-8fea-fb051d288c6d
2008-07-07 12:11:41 -04:00
Thomas Aylott 1899a8afde Internet Explorer Conditional Comment snippets 2008-07-02 13:00:07 -04:00
Thomas Aylott 7e0e08cd6a Unifying the "for" snippets
diff --git "a/Snippets/for (in) {\342\200\246}.tmSnippet" "b/Snippets/for (in) {\342\200\246}.tmSnippet"
index d7e0848..b64dede 100644
--- "a/Snippets/for (in) {\342\200\246}.tmSnippet"
+++ "b/Snippets/for (in) {\342\200\246}.tmSnippet"
@@ -3,8 +3,8 @@
 <plist version="1.0">
 <dict>
 	<key>content</key>
-	<string>for (var ${1:x} in ${2:Things}) {
-	${0:${1:x}}
+	<string>for (var ${1:thing} in ${2:Things}) {
+	$0${1:thing}
 };</string>
 	<key>name</key>
 	<string>for (in) {…}</string>
diff --git "a/Snippets/for (\342\200\246) {\342\200\246} (PPK).tmSnippet" "b/Snippets/for (\342\200\246) {\342\200\246} (PPK).tmSnippet"
index b34c0f5..9408455 100644
--- "a/Snippets/for (\342\200\246) {\342\200\246} (PPK).tmSnippet"
+++ "b/Snippets/for (\342\200\246) {\342\200\246} (PPK).tmSnippet"
@@ -4,7 +4,7 @@
 <dict>
 	<key>content</key>
 	<string>for (var ${20:i}=0,${2:thing}; ${2:thing}=${1:Things}[${20:i}]; ${20:i}++){
-	${2:thing}$0
+	$0${2:thing}
 };
 </string>
 	<key>name</key>
diff --git "a/Snippets/for (\342\200\246) {\342\200\246} (faster).tmSnippet" "b/Snippets/for (\342\200\246) {\342\200\246} (faster).tmSnippet"
index 34e6b71..2853eb2 100644
--- "a/Snippets/for (\342\200\246) {\342\200\246} (faster).tmSnippet"
+++ "b/Snippets/for (\342\200\246) {\342\200\246} (faster).tmSnippet"
@@ -1,10 +1,10 @@
 <?xml version="1.0" encoding="UTF-8"?>
-<!DOCTYPE plist PUBLIC "-//Apple Computer//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
+<!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>for (var ${20:i} = ${1:Things}.length - 1; ${20:i} &gt;= 0; ${20:i}--){
-	${100:${1:Things}[${20:i}]}$0
+	$0${100:${1:Things}[${20:i}]}
 };</string>
 	<key>name</key>
 	<string>for (…) {…} (Improved Native For-Loop)</string>
diff --git "a/Snippets/for (\342\200\246) {\342\200\246}.tmSnippet" "b/Snippets/for (\342\200\246) {\342\200\246}.tmSnippet"
index 6208a16..852d3f5 100644
--- "a/Snippets/for (\342\200\246) {\342\200\246}.tmSnippet"
+++ "b/Snippets/for (\342\200\246) {\342\200\246}.tmSnippet"
@@ -4,7 +4,7 @@
 <dict>
 	<key>content</key>
 	<string>for (var ${20:i}=0; ${20:i} &lt; ${1:Things}.length; ${20:i}++) {
-	${100:${1:Things}[${20:i}]}$0
+	$0${100:${1:Things}[${20:i}]}
 };</string>
 	<key>name</key>
 	<string>for (…) {…}</string>
2008-07-02 11:04:01 -04:00
subtlegradient 7a80c6d2ab Fixed snippet. I'd accidentally sent a half-finished version :'(
git-svn-id: http://macromates.com/svn/Bundles/trunk/Review/Bundles/JavaScript.tmbundle@9129 dfb7d73b-c2ec-0310-8fea-fb051d288c6d
2008-03-16 06:14:13 +00:00
subtlegradient bc39c3bdca Cleaned up "for in" snippets and added a new ultra-fast one from quirksmode.
git-svn-id: http://macromates.com/svn/Bundles/trunk/Review/Bundles/JavaScript.tmbundle@9114 dfb7d73b-c2ec-0310-8fea-fb051d288c6d
2008-03-14 18:31:48 +00:00
subtlegradient b6f84d2641 New "for (in){…}" snippet
git-svn-id: http://macromates.com/svn/Bundles/trunk/Review/Bundles/JavaScript.tmbundle@8634 dfb7d73b-c2ec-0310-8fea-fb051d288c6d
2007-12-09 08:20:27 +00:00
subtlegradient 1f347c3df7 Cleaned up snippets
git-svn-id: http://macromates.com/svn/Bundles/trunk/Review/Bundles/JavaScript.tmbundle@8633 dfb7d73b-c2ec-0310-8fea-fb051d288c6d
2007-12-09 08:19:31 +00:00
subtlegradient 5335a0d676 Copying JavaScript to review
git-svn-id: http://macromates.com/svn/Bundles/trunk/Review/Bundles/JavaScript.tmbundle@8600 dfb7d73b-c2ec-0310-8fea-fb051d288c6d
2007-12-05 18:44:38 +00:00
subtlegradient 0539e44989 Removed old bas scope
Set ⌥⇧: as the shortcut for object keys
Set the trigger for "for faster" to "for" to get the menu

git-svn-id: http://macromates.com/svn/Bundles/trunk/Bundles/JavaScript.tmbundle@6595 dfb7d73b-c2ec-0310-8fea-fb051d288c6d
2007-02-15 04:34:38 +00:00
subtlegradient dcb51d605c Fixed bad copy/paste. It was an em-dash not a -- :/
git-svn-id: http://macromates.com/svn/Bundles/trunk/Bundles/JavaScript.tmbundle@6542 dfb7d73b-c2ec-0310-8fea-fb051d288c6d
2007-02-09 15:37:15 +00:00
subtlegradient 8918fc0380 Added the "Improved Native For-Loop" snippet from http://solutoire.com/2007/02/02/efficient-looping-in-javascript/
git-svn-id: http://macromates.com/svn/Bundles/trunk/Bundles/JavaScript.tmbundle@6518 dfb7d73b-c2ec-0310-8fea-fb051d288c6d
2007-02-03 07:52:40 +00:00
cskiadas 5fdf24b4fa First attempt at rearranging.
Added getElement snippet.

git-svn-id: http://macromates.com/svn/Bundles/trunk/Bundles/JavaScript.tmbundle@5720 dfb7d73b-c2ec-0310-8fea-fb051d288c6d
2006-10-29 19:52:42 +00:00
haraldmartin 704e02f030 • Added a really handy snippet for all iteration methods. Instead of typing 'each' and then ⇥ (tab) to get the each snippet, you now press ⇧⌃⌘( and you'll get the iterator function. Therefore this works for all iterator functions (inject, reject, each, map etc)
• Moved more of the genreric JavaScript snippets (subtleGradient's?) from Prototype → JS bundle

• Added whitespace around '=' and ':' in the Create Class alt snippet (we aren't afraid of whitespace, are we?)

git-svn-id: http://macromates.com/svn/Bundles/trunk/Bundles/JavaScript.tmbundle@5310 dfb7d73b-c2ec-0310-8fea-fb051d288c6d
2006-09-26 15:50:54 +00:00
haraldmartin 7c8a8d1c75 • ⇧↩ (shift + enter) will turn the current word as a function (like the ruby one does). ⇧⌃↩ (shift + control + enter) will make it into a method instead (blah: function() { ... })
• Cleaned up some snippets like setTimeout and the if/if else/function and others

git-svn-id: http://macromates.com/svn/Bundles/trunk/Bundles/JavaScript.tmbundle@5308 dfb7d73b-c2ec-0310-8fea-fb051d288c6d
2006-09-26 15:20:02 +00:00
duff fa12f1385a • use the ellipsis glyph (…) instead of three periods
git-svn-id: http://macromates.com/svn/Bundles/trunk/Bundles/JavaScript.tmbundle@4374 dfb7d73b-c2ec-0310-8fea-fb051d288c6d
2006-07-17 11:24:53 +00:00
subtlegradient 3f366bbbbb Added a better indent pref. Added some handy snippets. Added some handy scopes to the language
git-svn-id: http://macromates.com/svn/Bundles/trunk/Bundles/JavaScript.tmbundle@4352 dfb7d73b-c2ec-0310-8fea-fb051d288c6d
2006-07-17 07:55:50 +00:00
duff 6392496e90 • remove mention of tab trigger from the name
git-svn-id: http://macromates.com/svn/Bundles/trunk/Bundles/JavaScript.tmbundle@3648 dfb7d73b-c2ec-0310-8fea-fb051d288c6d
2006-06-14 02:52:10 +00:00
duff 5a2572890b • add prototype snippet from Mike Ter Louw
• fix comment character in function snippet


git-svn-id: http://macromates.com/svn/Bundles/trunk/Bundles/JavaScript.tmbundle@2721 dfb7d73b-c2ec-0310-8fea-fb051d288c6d
2006-02-20 11:02:30 +00:00
duff 558a9b2102 • snippet to create a js function
git-svn-id: http://macromates.com/svn/Bundles/trunk/Bundles/JavaScript.tmbundle@1325 dfb7d73b-c2ec-0310-8fea-fb051d288c6d
2005-07-11 23:49:10 +00:00