Skip to content

Commit f80b9f2

Browse files
committed
Merge pull request #12 from grahampcharles/dev
Added snippets for jQuery.map and jQuery.each
2 parents f9d0eb4 + 74b63d8 commit f80b9f2

File tree

3 files changed

+58
-0
lines changed

3 files changed

+58
-0
lines changed
Lines changed: 26 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,26 @@
1+
<CodeSnippets xmlns="http://schemas.microsoft.com/VisualStudio/2005/CodeSnippet">
2+
<CodeSnippet Format="1.4.0">
3+
<Header>
4+
<SnippetTypes>
5+
<SnippetType>Expansion</SnippetType>
6+
</SnippetTypes>
7+
<Title>jQuery: A generic iterator function</Title>
8+
<Author>Graham Charles</Author>
9+
<Shortcut>jqEach</Shortcut>
10+
<HelpUrl>https://github.com/xxkylexx/Visual-Studio-jQuery-Code-Snippets</HelpUrl>
11+
</Header>
12+
<Snippet>
13+
<Declarations>
14+
<Literal>
15+
<ID>collection</ID>
16+
<ToolTip>Array or Object to iterate over</ToolTip>
17+
<Default>collection</Default>
18+
</Literal>
19+
</Declarations>
20+
<Code Language="JavaScript">
21+
<![CDATA[$$.each($collection$, function( indexInArray, valueOfElement ) { $end$ } );]]>
22+
</Code>
23+
</Snippet>
24+
</CodeSnippet>
25+
</CodeSnippets>
26+
Lines changed: 26 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,26 @@
1+
<CodeSnippets xmlns="http://schemas.microsoft.com/VisualStudio/2005/CodeSnippet">
2+
<CodeSnippet Format="1.4.0">
3+
<Header>
4+
<SnippetTypes>
5+
<SnippetType>Expansion</SnippetType>
6+
</SnippetTypes>
7+
<Title>jQuery: Translate all items in an array or object to new array of items</Title>
8+
<Author>Graham Charles</Author>
9+
<Shortcut>jqMap</Shortcut>
10+
<HelpUrl>https://github.com/xxkylexx/Visual-Studio-jQuery-Code-Snippets</HelpUrl>
11+
</Header>
12+
<Snippet>
13+
<Declarations>
14+
<Literal>
15+
<ID>arrayOrObject</ID>
16+
<ToolTip>Array or Object to be mapped</ToolTip>
17+
<Default>arrayOrObject</Default>
18+
</Literal>
19+
</Declarations>
20+
<Code Language="JavaScript">
21+
<![CDATA[$$.map($arrayOrObject$, function( elementOrValue, indexOrKey ) { $end$ } );]]>
22+
</Code>
23+
</Snippet>
24+
</CodeSnippet>
25+
</CodeSnippets>
26+

jQueryCodeSnippets/jQueryCodeSnippets.csproj

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -147,6 +147,9 @@
147147
<Content Include="JavaScript\jQuery\jqDocReadyShort.snippet">
148148
<IncludeInVSIX>true</IncludeInVSIX>
149149
</Content>
150+
<Content Include="JavaScript\jQuery\jqEach.snippet">
151+
<IncludeInVSIX>true</IncludeInVSIX>
152+
</Content>
150153
<Content Include="JavaScript\jQuery\jqEachElement.snippet">
151154
<IncludeInVSIX>true</IncludeInVSIX>
152155
</Content>
@@ -240,6 +243,9 @@
240243
<Content Include="JavaScript\jQuery\jqLoadPost.snippet">
241244
<IncludeInVSIX>true</IncludeInVSIX>
242245
</Content>
246+
<Content Include="JavaScript\jQuery\jqMap.snippet">
247+
<IncludeInVSIX>true</IncludeInVSIX>
248+
</Content>
243249
<Content Include="JavaScript\jQuery\jqMouseDown.snippet">
244250
<IncludeInVSIX>true</IncludeInVSIX>
245251
</Content>

0 commit comments

Comments
 (0)