Skip to content

Instantly share code, notes, and snippets.

@brihter
Created May 6, 2014 14:20
Show Gist options
  • Save brihter/9ef98acbe8b8d2d7edb8 to your computer and use it in GitHub Desktop.
Save brihter/9ef98acbe8b8d2d7edb8 to your computer and use it in GitHub Desktop.
ExtJS 3.x Visual Studio snippets
<CodeSnippet Format="1.1.0" xmlns="http://schemas.microsoft.com/VisualStudio/2005/CodeSnippet">
<Header>
<Title>ext3_object</Title>
<Author>Bostjan Rihter</Author>
<Shortcut>ext3_object</Shortcut>
<Description>ExtJS object snippet</Description>
<SnippetTypes>
<SnippetType>Expansion</SnippetType>
</SnippetTypes>
</Header>
<Snippet>
<Declarations>
<Literal>
<ID>ns</ID>
<ToolTip>Object namespace</ToolTip>
<Default>Namespace</Default>
</Literal>
<Literal>
<ID>name</ID>
<ToolTip>Object name</ToolTip>
<Default>SampleObject</Default>
</Literal>
<Literal>
<ID>extend_from</ID>
<ToolTip>Extend object from</ToolTip>
<Default>Object</Default>
</Literal>
</Declarations>
<Code Language="JavaScript">
<![CDATA[Ext.ns('$ns$');
$ns$.$name$ = Ext.extend($extend_from$, {
//#region properties
//#endregion
//#region constructor
constructor: function(cfg) {
var me = this;
$ns$.$name$.superclass.constructor.call(me, cfg);
}
//#endregion
//#region getters
//#endregion
//#region setters
//#endregion
//#region methods
//#endregion
//#region event handlers
//#endregion
});]]>
</Code>
</Snippet>
</CodeSnippet>
<CodeSnippet Format="1.1.0" xmlns="http://schemas.microsoft.com/VisualStudio/2005/CodeSnippet">
<Header>
<Title>ext3_singleton</Title>
<Author>Bostjan Rihter</Author>
<Shortcut>ext3_singleton</Shortcut>
<Description>ExtJS singleton object snippet</Description>
<SnippetTypes>
<SnippetType>Expansion</SnippetType>
</SnippetTypes>
</Header>
<Snippet>
<Declarations>
<Literal>
<ID>ns</ID>
<ToolTip>Object namespace</ToolTip>
<Default>Namespace</Default>
</Literal>
<Literal>
<ID>name</ID>
<ToolTip>Object name</ToolTip>
<Default>SampleObject</Default>
</Literal>
</Declarations>
<Code Language="JavaScript">
<![CDATA[Ext.ns('$ns$');
$ns$.$name$ = function() {
//#region private
var _init = false;
//#endregion
//#region public
return {
init: function() {
if (_init === true)
return;
_init = true;
}
};
//#endregion
}();]]>
</Code>
</Snippet>
</CodeSnippet>
<CodeSnippet Format="1.1.0" xmlns="http://schemas.microsoft.com/VisualStudio/2005/CodeSnippet">
<Header>
<Title>ext3_widget</Title>
<Author>Bostjan Rihter</Author>
<Shortcut>ext3_widget</Shortcut>
<Description>ExtJS widget snippet</Description>
<SnippetTypes>
<SnippetType>Expansion</SnippetType>
</SnippetTypes>
</Header>
<Snippet>
<Declarations>
<Literal>
<ID>ns</ID>
<ToolTip>Object namespace</ToolTip>
<Default>Namespace</Default>
</Literal>
<Literal>
<ID>name</ID>
<ToolTip>Object name</ToolTip>
<Default>SampleObject</Default>
</Literal>
<Literal>
<ID>extend_from</ID>
<ToolTip>Extend object from</ToolTip>
<Default>Object</Default>
</Literal>
</Declarations>
<Code Language="JavaScript">
<![CDATA[Ext.ns('$ns$');
$ns$.$name$ = Ext.extend($extend_from$, {
//#region properties
//#endregion
//#region constructor
constructor: function(cfg) {
var me = this;
$ns$.$name$.superclass.constructor.call(me, cfg);
},
initComponent: function() {
var me = this;
$ns$.$name$.superclass.initComponent.call(me);
}
//#endregion
//#region getters
//#endregion
//#region setters
//#endregion
//#region methods
//#endregion
//#region event handlers
//#endregion
});]]>
</Code>
</Snippet>
</CodeSnippet>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment