Skip to content

Commit

Permalink
fixed most jquery snippets
Browse files Browse the repository at this point in the history
Signed-off-by: Martin Grenfell <martin_grenfell@msn.com>
  • Loading branch information
Reza Jelveh authored and Martin Grenfell committed Feb 19, 2009
1 parent 9bd74e2 commit 9e7789e
Show file tree
Hide file tree
Showing 92 changed files with 183 additions and 184 deletions.
2 changes: 1 addition & 1 deletion javascript-jquery/add.snippet
@@ -1 +1 @@
<+obj+>.add('<+selector expression+>')<++>
${1:obj}.add('${2:selector expression}')${3}
2 changes: 1 addition & 1 deletion javascript-jquery/addClass.snippet
@@ -1 +1 @@
<+obj+>.addClass('<+class name+>')<++>
${1:obj}.addClass('${2:class name}')${3}
2 changes: 1 addition & 1 deletion javascript-jquery/after.snippet
@@ -1 +1 @@
<+obj+>.after('<+Some text <b>and bold!</b>+>')<++>
${1:obj}.after('${2:Some text <b>and bold!</b>}')${3}
26 changes: 13 additions & 13 deletions javascript-jquery/ajax.snippet
@@ -1,18 +1,18 @@
$.ajax({
url: "<+mydomain.com/url+>",
type: "<+POST+>",
dataType: "<+xml/html/script/json+>",
data: $.param( $("<+Element or Expression+>") ),
url: "${1:mydomain.com/url}",
type: "${2:POST}",
dataType: "${3:xml/html/script/json}",
data: $.param( $("${4:Element or Expression}") ),

complete: function() {
<+//called when complete+>
},
complete: function() {
${5://called when complete}
},

success: function() {
<+//called when successful+>
},
success: function() {
${6://called when successful}
},

error: function() {
<+//called when there is an error+>
},
error: function() {
${7://called when there is an error}
},
});
6 changes: 3 additions & 3 deletions javascript-jquery/ajaxerror.snippet
@@ -1,4 +1,4 @@
.ajaxError(function(<+request, settings+>) {
<+//stuff to do when an AJAX call returns an error+>;
.ajaxError(function(${1:request, settings}) {
${2://stuff to do when an AJAX call returns an error};
});
<++>
${3}
6 changes: 3 additions & 3 deletions javascript-jquery/ajaxget.snippet
@@ -1,3 +1,3 @@
$.get('<+/test/ajax-test.xml+>', function(xml){
<+alert( ("title",xml).text() ) //optional stuff to do after get;+>
});
$.get('${1:/test/ajax-test.xml}', function(xml){
${2:alert( ("title",xml).text() ) //optional stuff to do after get;}
});
4 changes: 2 additions & 2 deletions javascript-jquery/ajaxgetif.snippet
@@ -1,3 +1,3 @@
$.getIfModified('<+/test/test.cgi+>', function(data){
<+alert( "Data loaded: " + data ) //optional stuff to do after get;+>
$.getIfModified('${1:/test/test.cgi}', function(data){
${2:alert( "Data loaded: " + data ) //optional stuff to do after get;}
});
6 changes: 3 additions & 3 deletions javascript-jquery/ajaxsend.snippet
@@ -1,4 +1,4 @@
.ajaxSend(function(<+request, settings+>) {
<+//stuff to do when an AJAX call returns an error+>;
.ajaxSend(function(${1:request, settings}) {
${2://stuff to do when an AJAX call returns an error};
});
<++>
${3}
26 changes: 13 additions & 13 deletions javascript-jquery/ajaxsetup.snippet
@@ -1,18 +1,18 @@
$.ajaxSetup({
url: "<+mydomain.com/url+>",
type: "<+POST+>",
dataType: "<+xml/html/script/json+>",
data: $.param( $("<+Element or Expression+>") ),
url: "${1:mydomain.com/url}",
type: "${2:POST}",
dataType: "${3:xml/html/script/json}",
data: $.param( $("${4:Element or Expression}") ),

complete: function() {
<+//called when complete+>
},
complete: function() {
${5://called when complete}
},

success: function() {
<+//called when successful+>
},
success: function() {
${6://called when successful}
},

error: function() {
<+//called when there is an error+>
},
error: function() {
${7://called when there is an error}
},
});
4 changes: 2 additions & 2 deletions javascript-jquery/ajaxstart.snippet
@@ -1,4 +1,4 @@
$.ajaxStart(function() {
<+//stuff to do when an AJAX call is started and no other AJAX calls are in progress+>;
${1://stuff to do when an AJAX call is started and no other AJAX calls are in progress};
});
<++>
${2}
4 changes: 2 additions & 2 deletions javascript-jquery/ajaxstop.snippet
@@ -1,4 +1,4 @@
$.ajaxStop(function() {
<+//stuff to do when an AJAX call is started and no other AJAX calls are in progress+>;
${1://stuff to do when an AJAX call is started and no other AJAX calls are in progress};
});
<++>
${2}
4 changes: 2 additions & 2 deletions javascript-jquery/ajaxsuccess.snippet
@@ -1,4 +1,4 @@
$.ajaxSuccess(function() {
<+//stuff to do when an AJAX call is started and no other AJAX calls are in progress+>;
${1://stuff to do when an AJAX call is started and no other AJAX calls are in progress};
});
<++>
${2}
2 changes: 1 addition & 1 deletion javascript-jquery/animate.snippet
@@ -1 +1 @@
<+obj+>.animate({<+param1: value1, param2: value2+>}, <+speed+>)<++>
${1:obj}.animate({${2:param1: value1, param2: value2}}, ${3:speed})${4}
2 changes: 1 addition & 1 deletion javascript-jquery/append.snippet
@@ -1 +1 @@
<+obj+>.append('<+Some text <b>and bold!</b>+>')<++>
${1:obj}.append('${2:Some text <b>and bold!</b>}')${3}
2 changes: 1 addition & 1 deletion javascript-jquery/appendTo.snippet
@@ -1 +1 @@
<+obj+>.appendTo('<+selector expression+>')<++>
${1:obj}.appendTo('${2:selector expression}')${3}
2 changes: 1 addition & 1 deletion javascript-jquery/before.snippet
@@ -1 +1 @@
<+obj+>.before('<+Some text <b>and bold!</b>+>')<++>
${1:obj}.before('${2:Some text <b>and bold!</b>}')${3}
6 changes: 3 additions & 3 deletions javascript-jquery/bind.snippet
@@ -1,3 +1,3 @@
<+obj+>.bind('<+event name+>', function(<+event+>) {
<+// Act on the event+>
});
${1:obj}.bind('${2:event name}', function(${3:event}) {
${4:// Act on the event}
});
6 changes: 3 additions & 3 deletions javascript-jquery/blur.snippet
@@ -1,3 +1,3 @@
<+obj+>.blur(function() {
<+// Act on the event+>
});
${1:obj}.blur(function() {
${2:// Act on the event}
});
6 changes: 3 additions & 3 deletions javascript-jquery/change.snippet
@@ -1,3 +1,3 @@
<+obj+>.change(function() {
<+// Act on the event+>
});
${1:obj}.change(function() {
${2:// Act on the event}
});
2 changes: 1 addition & 1 deletion javascript-jquery/children.snippet
@@ -1 +1 @@
<+obj+>.children('<+selector expression+>')<++>
${1:obj}.children('${2:selector expression}')${3}
6 changes: 3 additions & 3 deletions javascript-jquery/click.snippet
@@ -1,3 +1,3 @@
<+obj+>.click(function() {
<+// Act on the event+>
});
${1:obj}.click(function() {
${2:// Act on the event}
});
2 changes: 1 addition & 1 deletion javascript-jquery/clone.snippet
@@ -1 +1 @@
<+obj+>.clone()<++>
${1:obj}.clone()${2}
2 changes: 1 addition & 1 deletion javascript-jquery/contains.snippet
@@ -1 +1 @@
<+obj+>.contains('<+text to find+>')<++>
${1:obj}.contains('${2:text to find}')${3}
2 changes: 1 addition & 1 deletion javascript-jquery/css.snippet
@@ -1 +1 @@
<+obj+>.css('<+attribute+>', '<+value+>')<++>
${1:obj}.css('${2:attribute}', '${3:value}')${4}
2 changes: 1 addition & 1 deletion javascript-jquery/cssm.snippet
@@ -1 +1 @@
<+obj+>.css({<+attribute1+>: '<+value1+>', <+attribute2+>: '<+value2+>'})<++>
${1:obj}.css({${2:attribute1}: '${3:value1}', ${4:attribute2}: '${5:value2}'})${6}
6 changes: 3 additions & 3 deletions javascript-jquery/dblclick.snippet
@@ -1,3 +1,3 @@
<+obj+>.dblclick(function() {
<+// Act on the event+>
});
${1:obj}.dblclick(function() {
${2:// Act on the event}
});
6 changes: 3 additions & 3 deletions javascript-jquery/each.snippet
@@ -1,3 +1,3 @@
<+obj+>.each(function(index) {
<+this.innerHTML = this + " is the element, " + index + " is the position";+>
});
${1:obj}.each(function(index) {
${2:this.innerHTML = this + " is the element, " + index + " is the position";}
});
2 changes: 1 addition & 1 deletion javascript-jquery/el.snippet
@@ -1 +1 @@
$('<++>')<++>
$('${1}')${2:}
2 changes: 1 addition & 1 deletion javascript-jquery/eltrim.snippet
@@ -1 +1 @@
$.trim('<+string+>')<++>
$.trim('${1:string}')${2}
2 changes: 1 addition & 1 deletion javascript-jquery/end.snippet
@@ -1 +1 @@
<+obj+>.end()<++>
${1:obj}.end()${2}
6 changes: 3 additions & 3 deletions javascript-jquery/error.snippet
@@ -1,3 +1,3 @@
<+obj+>.error(function() {
<+// Act on the event+>
});
${1:obj}.error(function() {
${2:// Act on the event}
});
2 changes: 1 addition & 1 deletion javascript-jquery/fadein.snippet
@@ -1 +1 @@
<+obj+>.fadeIn('<+slow/400/fast+>')<++>
${1:obj}.fadeIn('${2:slow/400/fast}')${3}
4 changes: 2 additions & 2 deletions javascript-jquery/fadeinc.snippet
@@ -1,3 +1,3 @@
<+obj+>.fadeIn('slow/400/fast', function() {
<+//Stuff to do *after* the animation takes place+>;
${1:obj}.fadeIn('slow/400/fast', function() {
${2://Stuff to do *after* the animation takes place};
});
2 changes: 1 addition & 1 deletion javascript-jquery/fadeout.snippet
@@ -1 +1 @@
<+obj+>.fadeOut('<+slow/400/fast+>')<++>
${1:obj}.fadeOut('${2:slow/400/fast}')${3}
4 changes: 2 additions & 2 deletions javascript-jquery/fadeoutc.snippet
@@ -1,3 +1,3 @@
<+obj+>.fadeOut('slow/400/fast', function() {
<+//Stuff to do *after* the animation takes place+>;
${1:obj}.fadeOut('slow/400/fast', function() {
${2://Stuff to do *after* the animation takes place};
});
2 changes: 1 addition & 1 deletion javascript-jquery/fadeto.snippet
@@ -1 +1 @@
<+obj+>.fadeTo('<+slow/400/fast+>', <+0.5+>)<++>
${1:obj}.fadeTo('${2:slow/400/fast}', ${3:0.5})${4}
4 changes: 2 additions & 2 deletions javascript-jquery/fadetoc.snippet
@@ -1,3 +1,3 @@
<+obj+>.fadeTo('slow/400/fast', <+0.5+>, function() {
<+//Stuff to do *after* the animation takes place+>;
${1:obj}.fadeTo('slow/400/fast', ${2:0.5}, function() {
${3://Stuff to do *after* the animation takes place};
});
2 changes: 1 addition & 1 deletion javascript-jquery/filter.snippet
@@ -1 +1 @@
<+obj+>.filter('<+selector expression+>')<++>
${1:obj}.filter('${2:selector expression}')${3}
2 changes: 1 addition & 1 deletion javascript-jquery/find.snippet
@@ -1 +1 @@
<+obj+>.find('<+selector expression+>')<++>
${1:obj}.find('${2:selector expression}')${3}
6 changes: 3 additions & 3 deletions javascript-jquery/focus.snippet
@@ -1,3 +1,3 @@
<+obj+>.focus(function() {
<+// Act on the event+>
});
${1:obj}.focus(function() {
${2:// Act on the event}
});
2 changes: 1 addition & 1 deletion javascript-jquery/get.snippet
@@ -1 +1 @@
<+obj+>.get(<+element index+>)<++>
${1:obj}.get(${2:element index})${3}
4 changes: 2 additions & 2 deletions javascript-jquery/getscript.snippet
@@ -1,3 +1,3 @@
$.getScript('<+somescript.js+>', function(){
<+//optional stuff to do after getScript;+>
$.getScript('${1:somescript.js}', function(){
${2://optional stuff to do after getScript;}
});
2 changes: 1 addition & 1 deletion javascript-jquery/height.snippet
@@ -1 +1 @@
<+obj+>.height(<+integer+>)<++>
${1:obj}.height(${2:integer})${3}
2 changes: 1 addition & 1 deletion javascript-jquery/hide.snippet
@@ -1 +1 @@
<+obj+>.hide('<+slow/400/fast+>')<++>
${1:obj}.hide('${2:slow/400/fast}')${3}
4 changes: 2 additions & 2 deletions javascript-jquery/hidec.snippet
@@ -1,3 +1,3 @@
<+obj+>.hide('<+slow/400/fast+>', function() {
<+//Stuff to do *after* the animation takes place+>
${1:obj}.hide('${2:slow/400/fast}', function() {
${3://Stuff to do *after* the animation takes place}
});
8 changes: 4 additions & 4 deletions javascript-jquery/hover.snippet
@@ -1,5 +1,5 @@
<+obj+>.hover(function() {
<+// Stuff to do when the mouse enters the element;+>
${1:obj}.hover(function() {
${2:// Stuff to do when the mouse enters the element;}
}, function() {
<+// Stuff to do when the mouse leaves the element;+>
});<++>
${3:// Stuff to do when the mouse leaves the element;}
});${4}
2 changes: 1 addition & 1 deletion javascript-jquery/html.snippet
@@ -1 +1 @@
<+obj+>.html('<+Some text <b>and bold!</b>+>')<++>
${1:obj}.html('${2:Some text <b>and bold!</b>}')${3}
2 changes: 1 addition & 1 deletion javascript-jquery/insertAfter.snippet
@@ -1 +1 @@
<+obj+>.insertAfter('<+selector expression+>')<++>
${1:obj}.insertAfter('${2:selector expression}')${3}
2 changes: 1 addition & 1 deletion javascript-jquery/insertBefore.snippet
@@ -1 +1 @@
<+obj+>.insertBefore('<+selector expression+>')<++>
${1:obj}.insertBefore('${2:selector expression}')${3}
2 changes: 1 addition & 1 deletion javascript-jquery/is.snippet
@@ -1 +1 @@
<+obj+>.is('<+selector expression+>')<++>
${1:obj}.is('${2:selector expression}')${3}
6 changes: 3 additions & 3 deletions javascript-jquery/load.snippet
@@ -1,3 +1,3 @@
<+obj+>.load(function() {
<+// Act on the event+>
});
${1:obj}.load(function() {
${2:// Act on the event}
});
6 changes: 3 additions & 3 deletions javascript-jquery/mdown.snippet
@@ -1,3 +1,3 @@
<+obj+>.mousedown(function() {
<+// Act on the event+>
});
${1:obj}.mousedown(function() {
${2:// Act on the event}
});
6 changes: 3 additions & 3 deletions javascript-jquery/mmove.snippet
@@ -1,3 +1,3 @@
<+obj+>.mousemove(function() {
<+// Act on the event+>
});
${1:obj}.mousemove(function() {
${2:// Act on the event}
});
6 changes: 3 additions & 3 deletions javascript-jquery/mout.snippet
@@ -1,3 +1,3 @@
<+obj+>.mouseout(function() {
<+// Act on the event+>
});
${1:obj}.mouseout(function() {
${2:// Act on the event}
});
6 changes: 3 additions & 3 deletions javascript-jquery/mover.snippet
@@ -1,3 +1,3 @@
<+obj+>.mouseover(function() {
<+// Act on the event+>
});
${1:obj}.mouseover(function() {
${2:// Act on the event}
});
6 changes: 3 additions & 3 deletions javascript-jquery/mup.snippet
@@ -1,3 +1,3 @@
<+obj+>.mouseup(function() {
<+// Act on the event+>
});
${1:obj}.mouseup(function() {
${2:// Act on the event}
});
2 changes: 1 addition & 1 deletion javascript-jquery/next.snippet
@@ -1 +1 @@
<+obj+>.next('<+selector expression+>')<++>
${1:obj}.next('${2:selector expression}')${3}
2 changes: 1 addition & 1 deletion javascript-jquery/not.snippet
@@ -1 +1 @@
<+obj+>.not('<+selector expression+>')<++>
${1:obj}.not('${2:selector expression}')${3}
6 changes: 3 additions & 3 deletions javascript-jquery/one.snippet
@@ -1,3 +1,3 @@
<+obj+>.one('<+event name+>', function(<+event+>) {
<+// Act on the event once+>
});
${1:obj}.one('${2:event name}', function(${3:event}) {
${4:// Act on the event once}
});
2 changes: 1 addition & 1 deletion javascript-jquery/parent.snippet
@@ -1 +1 @@
<+obj+>.parent('<+selector expression+>')<++>
${1:obj}.parent('${2:selector expression}')${3}
2 changes: 1 addition & 1 deletion javascript-jquery/parents.snippet
@@ -1 +1 @@
<+obj+>.parents('<+selector expression+>')<++>
${1:obj}.parents('${2:selector expression}')${3}
2 changes: 1 addition & 1 deletion javascript-jquery/prepend.snippet
@@ -1 +1 @@
<+obj+>.prepend('<+Some text <b>and bold!</b>+>')<++>
${1:obj}.prepend('${2:Some text <b>and bold!</b>}')${3}
2 changes: 1 addition & 1 deletion javascript-jquery/prependto.snippet
@@ -1 +1 @@
<+obj+>.prependTo('<+selector expression+>')<++>
${1:obj}.prependTo('${2:selector expression}')${3}
2 changes: 1 addition & 1 deletion javascript-jquery/prev.snippet
@@ -1 +1 @@
<+obj+>.prev('<+selector expression+>')<++>
${1:obj}.prev('${2:selector expression}')${3}
2 changes: 1 addition & 1 deletion javascript-jquery/ready.snippet
@@ -1,3 +1,3 @@
$(document).ready(function() {
<+// Stuff to do as soon as the DOM is ready;+>
${1:// Stuff to do as soon as the DOM is ready;}
});
2 changes: 1 addition & 1 deletion javascript-jquery/remove.snippet
@@ -1 +1 @@
<+obj+>.remove()<++>
${1:obj}.remove()${2}
2 changes: 1 addition & 1 deletion javascript-jquery/removeattr.snippet
@@ -1 +1 @@
<+obj+>.removeAttr('<+attribute name+>')<++>
${1:obj}.removeAttr('${2:attribute name}')${3}
2 changes: 1 addition & 1 deletion javascript-jquery/removeclass.snippet
@@ -1 +1 @@
<+obj+>.removeClass('<+class name+>')<++>
${1:obj}.removeClass('${2:class name}')${3}

0 comments on commit 9e7789e

Please sign in to comment.