Skip to content

Commit 9427f70

Browse files
committed
Refactoring more snippets with modern jQuery docs
Renamed jqToggleVis* -> jqToggle* Removed jqToggleMore Removed jqUnbindFn Renamed jqOffset -> jqOffsetGet Added jqSlideToggle and jqSlideToggleFull
1 parent cc5beaf commit 9427f70

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

67 files changed

+904
-801
lines changed
Lines changed: 10 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -1,28 +1,29 @@
1+
<?xml version="1.0" encoding="utf-8"?>
12
<CodeSnippets xmlns="http://schemas.microsoft.com/VisualStudio/2005/CodeSnippet">
23
<CodeSnippet Format="1.4.0">
34
<Header>
45
<SnippetTypes>
56
<SnippetType>Expansion</SnippetType>
67
</SnippetTypes>
7-
<Title>jQuery: mousedown()</Title>
8+
<Title>jqMouseDown</Title>
89
<Author>John Sheehan (@johnsheehan)</Author>
9-
<Shortcut>jqMouseDown</Shortcut>
10+
<Description>Bind an event handler to the "mousedown" JavaScript event, or trigger that event on an element.</Description>
1011
<HelpUrl>https://github.com/kspearrin/Visual-Studio-jQuery-Code-Snippets</HelpUrl>
12+
<Shortcut>jqMouseDown</Shortcut>
1113
</Header>
1214
<Snippet>
1315
<Declarations>
14-
<Literal>
16+
<Literal Editable="true">
1517
<ID>selector</ID>
1618
<ToolTip>Element(s) to bind to</ToolTip>
1719
<Default>selector</Default>
20+
<Function>
21+
</Function>
1822
</Literal>
1923
</Declarations>
20-
<Code Language="JavaScript">
21-
<![CDATA[
22-
$$($selector$).mousedown(function () {
24+
<Code Language="javascript"><![CDATA[$$($selector$).mousedown(function () {
2325
$end$
24-
});]]>
25-
</Code>
26+
});]]></Code>
2627
</Snippet>
2728
</CodeSnippet>
28-
</CodeSnippets>
29+
</CodeSnippets>
Lines changed: 10 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -1,28 +1,29 @@
1+
<?xml version="1.0" encoding="utf-8"?>
12
<CodeSnippets xmlns="http://schemas.microsoft.com/VisualStudio/2005/CodeSnippet">
23
<CodeSnippet Format="1.4.0">
34
<Header>
45
<SnippetTypes>
56
<SnippetType>Expansion</SnippetType>
67
</SnippetTypes>
7-
<Title>jQuery: mouseenter()</Title>
8+
<Title>jqMouseEnter</Title>
89
<Author>John Sheehan (@johnsheehan)</Author>
9-
<Shortcut>jqMouseEnter</Shortcut>
10+
<Description>Bind an event handler to be fired when the mouse enters an element, or trigger that handler on an element.</Description>
1011
<HelpUrl>https://github.com/kspearrin/Visual-Studio-jQuery-Code-Snippets</HelpUrl>
12+
<Shortcut>jqMouseEnter</Shortcut>
1113
</Header>
1214
<Snippet>
1315
<Declarations>
14-
<Literal>
16+
<Literal Editable="true">
1517
<ID>selector</ID>
1618
<ToolTip>Element(s) to bind to</ToolTip>
1719
<Default>selector</Default>
20+
<Function>
21+
</Function>
1822
</Literal>
1923
</Declarations>
20-
<Code Language="JavaScript">
21-
<![CDATA[
22-
$$($selector$).mouseenter(function () {
24+
<Code Language="javascript"><![CDATA[$$($selector$).mouseenter(function () {
2325
$end$
24-
});]]>
25-
</Code>
26+
});]]></Code>
2627
</Snippet>
2728
</CodeSnippet>
28-
</CodeSnippets>
29+
</CodeSnippets>
Lines changed: 10 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -1,28 +1,29 @@
1+
<?xml version="1.0" encoding="utf-8"?>
12
<CodeSnippets xmlns="http://schemas.microsoft.com/VisualStudio/2005/CodeSnippet">
23
<CodeSnippet Format="1.4.0">
34
<Header>
45
<SnippetTypes>
56
<SnippetType>Expansion</SnippetType>
67
</SnippetTypes>
7-
<Title>jQuery: mouseleave()</Title>
8+
<Title>jqMouseLeave</Title>
89
<Author>John Sheehan (@johnsheehan)</Author>
9-
<Shortcut>jqMouseLeave</Shortcut>
10+
<Description>Bind an event handler to be fired when the mouse leaves an element, or trigger that handler on an element.</Description>
1011
<HelpUrl>https://github.com/kspearrin/Visual-Studio-jQuery-Code-Snippets</HelpUrl>
12+
<Shortcut>jqMouseLeave</Shortcut>
1113
</Header>
1214
<Snippet>
1315
<Declarations>
14-
<Literal>
16+
<Literal Editable="true">
1517
<ID>selector</ID>
1618
<ToolTip>Element(s) to bind to</ToolTip>
1719
<Default>selector</Default>
20+
<Function>
21+
</Function>
1822
</Literal>
1923
</Declarations>
20-
<Code Language="JavaScript">
21-
<![CDATA[
22-
$$($selector$).mouseleave(function () {
24+
<Code Language="javascript"><![CDATA[$$($selector$).mouseleave(function () {
2325
$end$
24-
});]]>
25-
</Code>
26+
});]]></Code>
2627
</Snippet>
2728
</CodeSnippet>
28-
</CodeSnippets>
29+
</CodeSnippets>
Lines changed: 10 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -1,29 +1,30 @@
1+
<?xml version="1.0" encoding="utf-8"?>
12
<CodeSnippets xmlns="http://schemas.microsoft.com/VisualStudio/2005/CodeSnippet">
23
<CodeSnippet Format="1.4.0">
34
<Header>
45
<SnippetTypes>
56
<SnippetType>Expansion</SnippetType>
67
</SnippetTypes>
7-
<Title>jQuery: mousemove()</Title>
8+
<Title>jqMouseMove</Title>
89
<Author>John Sheehan (@johnsheehan)</Author>
9-
<Shortcut>jqMouseMove</Shortcut>
10+
<Description>Bind an event handler to the "mousemove" JavaScript event, or trigger that event on an element.</Description>
1011
<HelpUrl>https://github.com/kspearrin/Visual-Studio-jQuery-Code-Snippets</HelpUrl>
12+
<Shortcut>jqMouseMove</Shortcut>
1113
</Header>
1214
<Snippet>
1315
<Declarations>
14-
<Literal>
16+
<Literal Editable="true">
1517
<ID>selector</ID>
1618
<ToolTip>Element(s) to bind to</ToolTip>
1719
<Default>selector</Default>
20+
<Function>
21+
</Function>
1822
</Literal>
1923
</Declarations>
20-
<Code Language="JavaScript">
21-
<![CDATA[
22-
$$($selector$).mousemove(function (e) {
24+
<Code Language="javascript"><![CDATA[$$($selector$).mousemove(function (e) {
2325
// values: e.clientX, e.clientY, e.pageX, e.pageY
2426
$end$
25-
});]]>
26-
</Code>
27+
});]]></Code>
2728
</Snippet>
2829
</CodeSnippet>
29-
</CodeSnippets>
30+
</CodeSnippets>
Lines changed: 10 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -1,28 +1,29 @@
1+
<?xml version="1.0" encoding="utf-8"?>
12
<CodeSnippets xmlns="http://schemas.microsoft.com/VisualStudio/2005/CodeSnippet">
23
<CodeSnippet Format="1.4.0">
34
<Header>
45
<SnippetTypes>
56
<SnippetType>Expansion</SnippetType>
67
</SnippetTypes>
7-
<Title>jQuery: mouseout()</Title>
8+
<Title>jqMouseOut</Title>
89
<Author>John Sheehan (@johnsheehan)</Author>
9-
<Shortcut>jqMouseOut</Shortcut>
10+
<Description>Bind an event handler to the "mouseout" JavaScript event, or trigger that event on an element.</Description>
1011
<HelpUrl>https://github.com/kspearrin/Visual-Studio-jQuery-Code-Snippets</HelpUrl>
12+
<Shortcut>jqMouseOut</Shortcut>
1113
</Header>
1214
<Snippet>
1315
<Declarations>
14-
<Literal>
16+
<Literal Editable="true">
1517
<ID>selector</ID>
1618
<ToolTip>Element(s) to bind to</ToolTip>
1719
<Default>selector</Default>
20+
<Function>
21+
</Function>
1822
</Literal>
1923
</Declarations>
20-
<Code Language="JavaScript">
21-
<![CDATA[
22-
$$($selector$).mouseout(function () {
24+
<Code Language="javascript"><![CDATA[$$($selector$).mouseout(function () {
2325
$end$
24-
});]]>
25-
</Code>
26+
});]]></Code>
2627
</Snippet>
2728
</CodeSnippet>
28-
</CodeSnippets>
29+
</CodeSnippets>
Lines changed: 10 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -1,28 +1,29 @@
1+
<?xml version="1.0" encoding="utf-8"?>
12
<CodeSnippets xmlns="http://schemas.microsoft.com/VisualStudio/2005/CodeSnippet">
23
<CodeSnippet Format="1.4.0">
34
<Header>
45
<SnippetTypes>
56
<SnippetType>Expansion</SnippetType>
67
</SnippetTypes>
7-
<Title>jQuery: mouseover()</Title>
8+
<Title>jqMouseOver</Title>
89
<Author>John Sheehan (@johnsheehan)</Author>
9-
<Shortcut>jqMouseOver</Shortcut>
10+
<Description>Bind an event handler to the "mouseover" JavaScript event, or trigger that event on an element.</Description>
1011
<HelpUrl>https://github.com/kspearrin/Visual-Studio-jQuery-Code-Snippets</HelpUrl>
12+
<Shortcut>jqMouseOver</Shortcut>
1113
</Header>
1214
<Snippet>
1315
<Declarations>
14-
<Literal>
16+
<Literal Editable="true">
1517
<ID>selector</ID>
1618
<ToolTip>Element(s) to bind to</ToolTip>
1719
<Default>selector</Default>
20+
<Function>
21+
</Function>
1822
</Literal>
1923
</Declarations>
20-
<Code Language="JavaScript">
21-
<![CDATA[
22-
$$($selector$).mouseover(function () {
24+
<Code Language="javascript"><![CDATA[$$($selector$).mouseover(function () {
2325
$end$
24-
});]]>
25-
</Code>
26+
});]]></Code>
2627
</Snippet>
2728
</CodeSnippet>
28-
</CodeSnippets>
29+
</CodeSnippets>
Lines changed: 10 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -1,28 +1,29 @@
1+
<?xml version="1.0" encoding="utf-8"?>
12
<CodeSnippets xmlns="http://schemas.microsoft.com/VisualStudio/2005/CodeSnippet">
23
<CodeSnippet Format="1.4.0">
34
<Header>
45
<SnippetTypes>
56
<SnippetType>Expansion</SnippetType>
67
</SnippetTypes>
7-
<Title>jQuery: mouseup()</Title>
8+
<Title>jqMouseUp</Title>
89
<Author>John Sheehan (@johnsheehan)</Author>
9-
<Shortcut>jqMouseUp</Shortcut>
10+
<Description>Bind an event handler to the "mouseup" JavaScript event, or trigger that event on an element.</Description>
1011
<HelpUrl>https://github.com/kspearrin/Visual-Studio-jQuery-Code-Snippets</HelpUrl>
12+
<Shortcut>jqMouseUp</Shortcut>
1113
</Header>
1214
<Snippet>
1315
<Declarations>
14-
<Literal>
16+
<Literal Editable="true">
1517
<ID>selector</ID>
1618
<ToolTip>Element(s) to bind to</ToolTip>
1719
<Default>selector</Default>
20+
<Function>
21+
</Function>
1822
</Literal>
1923
</Declarations>
20-
<Code Language="JavaScript">
21-
<![CDATA[
22-
$$($selector$).mouseup(function () {
24+
<Code Language="javascript"><![CDATA[$$($selector$).mouseup(function () {
2325
$end$
24-
});]]>
25-
</Code>
26+
});]]></Code>
2627
</Snippet>
2728
</CodeSnippet>
28-
</CodeSnippets>
29+
</CodeSnippets>
Lines changed: 21 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -1,41 +1,43 @@
1+
<?xml version="1.0" encoding="utf-8"?>
12
<CodeSnippets xmlns="http://schemas.microsoft.com/VisualStudio/2005/CodeSnippet">
23
<CodeSnippet Format="1.4.0">
34
<Header>
45
<SnippetTypes>
56
<SnippetType>Expansion</SnippetType>
67
</SnippetTypes>
7-
<Title>jQuery: namespace template</Title>
8+
<Title>jqNamespace</Title>
89
<Author>Brad Turner</Author>
9-
<Shortcut>jqNamespace</Shortcut>
10+
<Description>A namespace template. ref: http://enterprisejquery.com/2010/10/how-good-c-habits-can-encourage-bad-javascript-habits-part-1/</Description>
1011
<HelpUrl>https://github.com/kspearrin/Visual-Studio-jQuery-Code-Snippets</HelpUrl>
11-
<Description>Reference: http://enterprisejquery.com/2010/10/how-good-c-habits-can-encourage-bad-javascript-habits-part-1/</Description>
12+
<Shortcut>jqNamespace</Shortcut>
1213
</Header>
1314
<Snippet>
1415
<Declarations>
15-
<Literal>
16+
<Literal Editable="true">
1617
<ID>name</ID>
1718
<ToolTip>The namespace declaration</ToolTip>
1819
<Default>myNamespace</Default>
20+
<Function>
21+
</Function>
1922
</Literal>
2023
</Declarations>
21-
<Code Language="JavaScript">
22-
<![CDATA[(function( $name$, $$, undefined ) {
23-
//Private Property
24-
myPrivateProperty = "Private Property";
24+
<Code Language="javascript"><![CDATA[(function( $name$, $$, undefined ) {
25+
// Private Property
26+
myPrivateProperty = "Private Property";
27+
28+
// Public Property
29+
$name$.myPublicProperty = "Publically Accessible Property";
30+
31+
// Private Method
32+
function myPrivateMethod () {
2533

26-
//Public Property
27-
$name$.myPublicProperty = "Publically Accessible Property";
34+
}
2835

29-
//Private Method
30-
function myPrivateMethod () {
31-
}
36+
// Public Method
37+
$name$.myPublicMethod = function () {
3238

33-
//Public Method
34-
$name$.myPublicMethod = function () {
35-
};
36-
37-
}(window.$name$ = window.$name$ || {}, jQuery ));]]>
38-
</Code>
39+
};
40+
}(window.$name$ = window.$name$ || {}, jQuery ));]]></Code>
3941
</Snippet>
4042
</CodeSnippet>
4143
</CodeSnippets>
Original file line numberDiff line numberDiff line change
@@ -1,30 +1,30 @@
1+
<?xml version="1.0" encoding="utf-8"?>
12
<CodeSnippets xmlns="http://schemas.microsoft.com/VisualStudio/2005/CodeSnippet">
23
<CodeSnippet Format="1.4.0">
34
<Header>
45
<SnippetTypes>
56
<SnippetType>Expansion</SnippetType>
67
</SnippetTypes>
7-
<Title>jQuery: Get the current offset of the first matched element, in pixels, relative to the document.</Title>
8+
<Title>jqOffsetGet</Title>
89
<Author>John Sheehan (@johnsheehan)</Author>
9-
<Shortcut>jqOffset</Shortcut>
10+
<Description>Get the current coordinates of the first element, or set the coordinates of every element, in the set of matched elements, relative to the document.</Description>
1011
<HelpUrl>https://github.com/kspearrin/Visual-Studio-jQuery-Code-Snippets</HelpUrl>
12+
<Shortcut>jqOffsetGet</Shortcut>
1113
</Header>
1214
<Snippet>
1315
<Declarations>
14-
<Literal>
16+
<Literal Editable="true">
1517
<ID>selector</ID>
16-
<ToolTip>jQuery selector</ToolTip>
18+
<ToolTip>Element to bind to</ToolTip>
1719
<Default>selector</Default>
20+
<Function>
21+
</Function>
1822
</Literal>
1923
</Declarations>
20-
<Code Language="JavaScript">
21-
<![CDATA[
22-
var offset = $$($selector$).offset();
24+
<Code Language="javascript"><![CDATA[var offset = $$($selector$).offset();
2325
var top = offset.top;
2426
var left = offset.left;
25-
$end$]]>
26-
</Code>
27+
$end$]]></Code>
2728
</Snippet>
2829
</CodeSnippet>
29-
</CodeSnippets>
30-
30+
</CodeSnippets>

0 commit comments

Comments
 (0)