Skip to content

Commit 05c2159

Browse files
committed
Refactoring snippets with better titles, descriptions, and tooltips from jquery 1.11.0 docs.
Renamed `jqClassToggleFn` -> `jqClassToggleSwitch` Added `jqDataSetObj`
1 parent 8bb0ac7 commit 05c2159

29 files changed

+399
-285
lines changed
Lines changed: 15 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -1,31 +1,34 @@
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: Add a class to the selected elements</Title>
8+
<Title>jqClassAdd</Title>
89
<Author>John Sheehan (@johnsheehan)</Author>
9-
<Shortcut>jqClassAdd</Shortcut>
10+
<Description>Adds the specified class(es) to each of the set of matched elements.</Description>
1011
<HelpUrl>https://github.com/kspearrin/Visual-Studio-jQuery-Code-Snippets</HelpUrl>
12+
<Shortcut>jqClassAdd</Shortcut>
1113
</Header>
1214
<Snippet>
1315
<Declarations>
14-
<Literal>
16+
<Literal Editable="true">
1517
<ID>selector</ID>
1618
<ToolTip>Element(s) to modify</ToolTip>
1719
<Default>selector</Default>
20+
<Function>
21+
</Function>
1822
</Literal>
19-
<Literal>
20-
<ID>name</ID>
21-
<ToolTip>Name of class to add</ToolTip>
22-
<Default>name</Default>
23+
<Literal Editable="true">
24+
<ID>className</ID>
25+
<ToolTip>One or more space-separated classes to be added to the class attribute of each matched element.</ToolTip>
26+
<Default>className</Default>
27+
<Function>
28+
</Function>
2329
</Literal>
2430
</Declarations>
25-
<Code Language="JavaScript">
26-
<![CDATA[$$($selector$).addClass($name$);$end$]]>
27-
</Code>
31+
<Code Language="javascript"><![CDATA[$$($selector$).addClass($className$);$end$]]></Code>
2832
</Snippet>
2933
</CodeSnippet>
30-
</CodeSnippets>
31-
34+
</CodeSnippets>
Lines changed: 15 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -1,31 +1,34 @@
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: Remove a class to the selected elements</Title>
8+
<Title>jqClassRemove</Title>
89
<Author>John Sheehan (@johnsheehan)</Author>
9-
<Shortcut>jqClassRemove</Shortcut>
10+
<Description>Remove a single class, multiple classes, or all classes from each element in the set of matched elements.</Description>
1011
<HelpUrl>https://github.com/kspearrin/Visual-Studio-jQuery-Code-Snippets</HelpUrl>
12+
<Shortcut>jqClassRemove</Shortcut>
1113
</Header>
1214
<Snippet>
1315
<Declarations>
14-
<Literal>
16+
<Literal Editable="true">
1517
<ID>selector</ID>
1618
<ToolTip>Element(s) to modify</ToolTip>
1719
<Default>selector</Default>
20+
<Function>
21+
</Function>
1822
</Literal>
19-
<Literal>
20-
<ID>name</ID>
21-
<ToolTip>Name of class to remove</ToolTip>
22-
<Default>name</Default>
23+
<Literal Editable="true">
24+
<ID>className</ID>
25+
<ToolTip>One or more space-separated classes to be removed from the class attribute of each matched element.</ToolTip>
26+
<Default>className</Default>
27+
<Function>
28+
</Function>
2329
</Literal>
2430
</Declarations>
25-
<Code Language="JavaScript">
26-
<![CDATA[$$($selector$).removeClass($name$);$end$]]>
27-
</Code>
31+
<Code Language="javascript"><![CDATA[$$($selector$).removeClass($className$);$end$]]></Code>
2832
</Snippet>
2933
</CodeSnippet>
30-
</CodeSnippets>
31-
34+
</CodeSnippets>
Lines changed: 15 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -1,31 +1,34 @@
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: Toggle a class on the selected elements</Title>
8+
<Title>jqClassToggle</Title>
89
<Author>John Sheehan (@johnsheehan)</Author>
9-
<Shortcut>jqClassToggle</Shortcut>
10+
<Description>Add or remove one or more classes from each element in the set of matched elements, depending on either the class's presence.</Description>
1011
<HelpUrl>https://github.com/kspearrin/Visual-Studio-jQuery-Code-Snippets</HelpUrl>
12+
<Shortcut>jqClassToggle</Shortcut>
1113
</Header>
1214
<Snippet>
1315
<Declarations>
14-
<Literal>
16+
<Literal Editable="true">
1517
<ID>selector</ID>
1618
<ToolTip>Element(s) to modify</ToolTip>
1719
<Default>selector</Default>
20+
<Function>
21+
</Function>
1822
</Literal>
19-
<Literal>
20-
<ID>name</ID>
21-
<ToolTip>Name of class to toggle</ToolTip>
22-
<Default>name</Default>
23+
<Literal Editable="true">
24+
<ID>className</ID>
25+
<ToolTip>One or more class names (separated by spaces) to be toggled for each element in the matched set.</ToolTip>
26+
<Default>className</Default>
27+
<Function>
28+
</Function>
2329
</Literal>
2430
</Declarations>
25-
<Code Language="JavaScript">
26-
<![CDATA[$$($selector$).toggleClass($name$);$end$]]>
27-
</Code>
31+
<Code Language="javascript"><![CDATA[$$($selector$).toggleClass($className$);$end$]]></Code>
2832
</Snippet>
2933
</CodeSnippet>
30-
</CodeSnippets>
31-
34+
</CodeSnippets>
Lines changed: 10 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -1,28 +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: click()</Title>
8+
<Title>jqClick</Title>
89
<Author>John Sheehan (@johnsheehan)</Author>
9-
<Shortcut>jqClick</Shortcut>
10+
<Description>Bind an event handler to the "click" JavaScript event, or trigger that event on an element.</Description>
1011
<HelpUrl>https://github.com/kspearrin/Visual-Studio-jQuery-Code-Snippets</HelpUrl>
12+
<Shortcut>jqClick</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[$$($selector$).click(function (e) {
24+
<Code Language="javascript"><![CDATA[$$($selector$).click(function (e) {
2225
e.preventDefault();
2326
$end$
24-
});]]>
25-
</Code>
27+
});]]></Code>
2628
</Snippet>
2729
</CodeSnippet>
28-
</CodeSnippets>
30+
</CodeSnippets>
Lines changed: 9 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -1,26 +1,27 @@
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: Clone matched DOM Elements and select the clones.</Title>
8+
<Title>jqClone</Title>
89
<Author>John Sheehan (@johnsheehan)</Author>
9-
<Shortcut>jqClone</Shortcut>
10+
<Description>Create a deep copy of the set of matched elements.</Description>
1011
<HelpUrl>https://github.com/kspearrin/Visual-Studio-jQuery-Code-Snippets</HelpUrl>
12+
<Shortcut>jqClone</Shortcut>
1113
</Header>
1214
<Snippet>
1315
<Declarations>
14-
<Literal>
16+
<Literal Editable="true">
1517
<ID>selector</ID>
1618
<ToolTip>Element(s) to be cloned</ToolTip>
1719
<Default>selector</Default>
20+
<Function>
21+
</Function>
1822
</Literal>
1923
</Declarations>
20-
<Code Language="JavaScript">
21-
<![CDATA[$$($selector$).clone();$end$]]>
22-
</Code>
24+
<Code Language="javascript"><![CDATA[$$($selector$).clone();$end$]]></Code>
2325
</Snippet>
2426
</CodeSnippet>
25-
</CodeSnippets>
26-
27+
</CodeSnippets>
Lines changed: 9 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -1,26 +1,27 @@
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: Clone matched DOM Elements, and all their event handlers, and select the clones.</Title>
8+
<Title>jqCloneWithEvents</Title>
89
<Author>John Sheehan (@johnsheehan)</Author>
9-
<Shortcut>jqCloneWithEvents</Shortcut>
10+
<Description>Create a deep copy of the set of matched elements.</Description>
1011
<HelpUrl>https://github.com/kspearrin/Visual-Studio-jQuery-Code-Snippets</HelpUrl>
12+
<Shortcut>jqCloneWithEvents</Shortcut>
1113
</Header>
1214
<Snippet>
1315
<Declarations>
14-
<Literal>
16+
<Literal Editable="true">
1517
<ID>selector</ID>
1618
<ToolTip>Element(s) to be cloned</ToolTip>
1719
<Default>selector</Default>
20+
<Function>
21+
</Function>
1822
</Literal>
1923
</Declarations>
20-
<Code Language="JavaScript">
21-
<![CDATA[$$($selector$).clone(true);$end$]]>
22-
</Code>
24+
<Code Language="javascript"><![CDATA[$$($selector$).clone(true);$end$]]></Code>
2325
</Snippet>
2426
</CodeSnippet>
25-
</CodeSnippets>
26-
27+
</CodeSnippets>
Lines changed: 15 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -1,31 +1,34 @@
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: Return a style property on the first matched element.</Title>
8+
<Title>jqCssGet</Title>
89
<Author>John Sheehan (@johnsheehan)</Author>
9-
<Shortcut>jqCssGet</Shortcut>
10+
<Description>Get the computed style properties for the first element in the set of matched elements.</Description>
1011
<HelpUrl>https://github.com/kspearrin/Visual-Studio-jQuery-Code-Snippets</HelpUrl>
12+
<Shortcut>jqCssGet</Shortcut>
1113
</Header>
1214
<Snippet>
1315
<Declarations>
14-
<Literal>
16+
<Literal Editable="true">
1517
<ID>selector</ID>
1618
<ToolTip>Element containing style to be retrieved</ToolTip>
1719
<Default>selector</Default>
20+
<Function>
21+
</Function>
1822
</Literal>
19-
<Literal>
20-
<ID>name</ID>
21-
<ToolTip>Name of style property</ToolTip>
22-
<Default>name</Default>
23+
<Literal Editable="true">
24+
<ID>propertyName</ID>
25+
<ToolTip>A CSS property.</ToolTip>
26+
<Default>propertyName</Default>
27+
<Function>
28+
</Function>
2329
</Literal>
2430
</Declarations>
25-
<Code Language="JavaScript">
26-
<![CDATA[$$($selector$).css($name$);$end$]]>
27-
</Code>
31+
<Code Language="javascript"><![CDATA[$$($selector$).css($propertyName$);$end$]]></Code>
2832
</Snippet>
2933
</CodeSnippet>
30-
</CodeSnippets>
31-
34+
</CodeSnippets>
Lines changed: 19 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -1,36 +1,41 @@
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: Set a single style property to a value on all matched elements.</Title>
8+
<Title>jqCssSet</Title>
89
<Author>John Sheehan (@johnsheehan)</Author>
9-
<Shortcut>jqCssSet</Shortcut>
10+
<Description>Set one or more CSS properties for the set of matched elements.</Description>
1011
<HelpUrl>https://github.com/kspearrin/Visual-Studio-jQuery-Code-Snippets</HelpUrl>
12+
<Shortcut>jqCssSet</Shortcut>
1113
</Header>
1214
<Snippet>
1315
<Declarations>
14-
<Literal>
16+
<Literal Editable="true">
1517
<ID>selector</ID>
1618
<ToolTip>Element(s) to set style properties on</ToolTip>
1719
<Default>selector</Default>
20+
<Function>
21+
</Function>
1822
</Literal>
19-
<Literal>
20-
<ID>name</ID>
21-
<ToolTip>Name of style property</ToolTip>
22-
<Default>name</Default>
23+
<Literal Editable="true">
24+
<ID>propertyName</ID>
25+
<ToolTip>A CSS property name.</ToolTip>
26+
<Default>propertyName</Default>
27+
<Function>
28+
</Function>
2329
</Literal>
24-
<Literal>
30+
<Literal Editable="true">
2531
<ID>value</ID>
26-
<ToolTip>Value to set</ToolTip>
32+
<ToolTip>A value to set for the property.</ToolTip>
2733
<Default>value</Default>
34+
<Function>
35+
</Function>
2836
</Literal>
2937
</Declarations>
30-
<Code Language="JavaScript">
31-
<![CDATA[$$($selector$).css($name$, $value$);$end$]]>
32-
</Code>
38+
<Code Language="javascript"><![CDATA[$$($selector$).css($propertyName$, $value$);$end$]]></Code>
3339
</Snippet>
3440
</CodeSnippet>
35-
</CodeSnippets>
36-
41+
</CodeSnippets>

0 commit comments

Comments
 (0)