Permalink
Browse files

adding snippets from ed's branch

  • Loading branch information...
0 parents commit 0a09370ccb68428ca5122a0763ebd9581504d236 @rdougan rdougan committed Apr 9, 2011
Showing with 360 additions and 0 deletions.
  1. +14 −0 Add Events.sublime-snippet
  2. +12 −0 Define Event.sublime-snippet
  3. +9 −0 Ext_apply.sublime-snippet
  4. +11 −0 Ext_applyIf to config.sublime-snippet
  5. +9 −0 Ext_applyIf.sublime-snippet
  6. +9 −0 Ext_each.sublime-snippet
  7. +19 −0 Ext_extend Object.sublime-snippet
  8. +23 −0 Ext_extend.sublime-snippet
  9. +9 −0 Ext_iterate.sublime-snippet
  10. +7 −0 Ext_ns.sublime-snippet
  11. +9 −0 Ext_onReady.sublime-snippet
  12. +9 −0 Ext_override.sublime-snippet
  13. +7 −0 Ext_reg.sublime-snippet
  14. +10 −0 Extend Block: config.sublime-snippet
  15. +15 −0 Extend Block: constructor.sublime-snippet
  16. +14 −0 Extend Block: function.sublime-snippet
  17. +11 −0 Extend Block: initComponent.sublime-snippet
  18. +12 −0 Extend Block: property.sublime-snippet
  19. +7 −0 JSDoc new line.sublime-snippet
  20. +6 −0 JSDoc: class.sublime-snippet
  21. +8 −0 JSDoc: comment block.sublime-snippet
  22. +6 −0 JSDoc: config.sublime-snippet
  23. +6 −0 JSDoc: extends.sublime-snippet
  24. +6 −0 JSDoc: param (config).sublime-snippet
  25. +6 −0 JSDoc: param.sublime-snippet
  26. +13 −0 JSDoc: property.sublime-snippet
  27. +6 −0 JSDoc: return.sublime-snippet
  28. +7 −0 call superclass.sublime-snippet
  29. +7 −0 console_log arguments.sublime-snippet
  30. +7 −0 console_log object.sublime-snippet
  31. +7 −0 console_log.sublime-snippet
  32. +11 −0 fireEvent (before and after).sublime-snippet
  33. +9 −0 fireEvent (before).sublime-snippet
  34. +7 −0 fireEvent.sublime-snippet
  35. +9 −0 if not undefined.sublime-snippet
  36. +9 −0 if undefined.sublime-snippet
  37. +6 −0 on (addListener).sublime-snippet
  38. +8 −0 onReady.sublime-snippet
@@ -0,0 +1,14 @@
+<snippet>
+ <content><![CDATA[${1:this}.addEvents(
+ /**
+ * @event ${2:eventName}
+ * ${3:Event description}${4:
+ * @param {${5:paramType}\} ${6:paramName} ${7:parameter description}}
+ */
+ '${2:eventName}'$0
+);]]></content>
+ <description>Add Events</description>
+ <scope>source.js</scope>
+ <tabTrigger>ae</tabTrigger>
+</snippet>
+
@@ -0,0 +1,12 @@
+<snippet>
+ <content><![CDATA[/**
+ * @event ${1:eventName}
+ * ${2:Event description}${3:
+ * @param {${4:paramType}\} ${5:paramName} ${6:parameter description}}
+ */
+'${1:eventName}'$0]]></content>
+ <description>Define Event</description>
+ <scope>source.js</scope>
+ <tabTrigger>e</tabTrigger>
+</snippet>
+
@@ -0,0 +1,9 @@
+<snippet>
+ <content><![CDATA[Ext.apply(${1:config}, {
+ $0
+});]]></content>
+ <description>Ext.apply</description>
+ <scope>source.js</scope>
+ <tabTrigger>app</tabTrigger>
+</snippet>
+
@@ -0,0 +1,11 @@
+<snippet>
+ <content><![CDATA[config = config || {};
+
+Ext.applyIf(config, {
+ $0
+});]]></content>
+ <description>Ext.applyIf to config</description>
+ <scope>source.js</scope>
+ <tabTrigger>aifc</tabTrigger>
+</snippet>
+
@@ -0,0 +1,9 @@
+<snippet>
+ <content><![CDATA[Ext.applyIf(${1:config}, {
+ $0
+});]]></content>
+ <description>Ext.applyIf</description>
+ <scope>source.js</scope>
+ <tabTrigger>aif</tabTrigger>
+</snippet>
+
@@ -0,0 +1,9 @@
+<snippet>
+ <content><![CDATA[Ext.each(${1:Array}, ${2:function(${4}) {
+ ${0}
+\}}${3:, this});]]></content>
+ <description>Ext.each</description>
+ <scope>source.js</scope>
+ <tabTrigger>each</tabTrigger>
+</snippet>
+
@@ -0,0 +1,19 @@
+<snippet>
+ <content><![CDATA[/**
+ * @class ${1:MyNamespace.}${2:${TM_FILENAME/(.+)\.js$/$1/}}
+ * @extends ${3:Object}
+ * ${4:Description}
+ */
+${1:MyNamespace.}${2:ClassName} = Ext.extend(${3:Object}, {
+
+ constructor: function() {
+ Ext.applyIf(this, {
+ $0
+ });
+ }
+});]]></content>
+ <description>Ext.extend Object</description>
+ <scope>source.js</scope>
+ <tabTrigger>extendo</tabTrigger>
+</snippet>
+
@@ -0,0 +1,23 @@
+<snippet>
+ <content><![CDATA[/**
+ * @class ${1:MyNamespace.}${2:${TM_FILENAME/(.+)\.js$/$1/}}
+ * @extends ${3:extendsClass}
+ * ${6:Description}
+ */
+${1:MyNamespace.}${2:ClassName} = Ext.extend(${3:extendsClass}, {
+
+ initComponent: function() {
+ Ext.applyIf(this, {
+ $0
+ });
+
+ ${1:MyNamespace.}${2:ClassName}.superclass.initComponent.apply(this, arguments);
+ }
+});${4:
+
+Ext.reg('${5:xtype}', ${1:MyNamespace.}${2:ClassName});}]]></content>
+ <description>Ext.extend</description>
+ <scope>source.js</scope>
+ <tabTrigger>extend</tabTrigger>
+</snippet>
+
@@ -0,0 +1,9 @@
+<snippet>
+ <content><![CDATA[Ext.iterate(${1:Object}, ${2:function(key, value) {
+ ${0}
+\}}${3:, this});]]></content>
+ <description>Ext.iterate</description>
+ <scope>source.js</scope>
+ <tabTrigger>iterate</tabTrigger>
+</snippet>
+
@@ -0,0 +1,7 @@
+<snippet>
+ <content><![CDATA[Ext.ns('$1');$0]]></content>
+ <description>Ext.ns</description>
+ <scope>source.js</scope>
+ <tabTrigger>ns</tabTrigger>
+</snippet>
+
@@ -0,0 +1,9 @@
+<snippet>
+ <content><![CDATA[Ext.onReady(function() {
+ $0
+});]]></content>
+ <description>Ext.onReady</description>
+ <scope>source.js</scope>
+ <tabTrigger>ready</tabTrigger>
+</snippet>
+
@@ -0,0 +1,9 @@
+<snippet>
+ <content><![CDATA[Ext.override(${1:Ext.${2:SomeClass}}, {
+ $0
+});]]></content>
+ <description>Ext.override</description>
+ <scope>source.js</scope>
+ <tabTrigger>override</tabTrigger>
+</snippet>
+
@@ -0,0 +1,7 @@
+<snippet>
+ <content><![CDATA[Ext.reg('${1:xtype}', ${2:ClassName});$0]]></content>
+ <description>Ext.reg</description>
+ <scope>source.js</scope>
+ <tabTrigger>reg</tabTrigger>
+</snippet>
+
@@ -0,0 +1,10 @@
+<snippet>
+ <content><![CDATA[/**
+ * @cfg {${1:String}} ${2:configName} ${3:Property description}
+ */
+${2:configName}: ${0}]]></content>
+ <description>Extend Block: config</description>
+ <scope>source.js</scope>
+ <tabTrigger>ec</tabTrigger>
+</snippet>
+
@@ -0,0 +1,15 @@
+<snippet>
+ <content><![CDATA[constructor: function(config) {
+ config = config || {};
+
+ Ext.applyIf(config, {
+ $0
+ });
+
+ ${2:Ext.Panel}.superclass.constructor.call(this, config);
+}${1:,}]]></content>
+ <description>Extend Block: constructor</description>
+ <scope>source.js</scope>
+ <tabTrigger>cons</tabTrigger>
+</snippet>
+
@@ -0,0 +1,14 @@
+<snippet>
+ <content><![CDATA[/**
+ * ${10:Function description}${2:
+ * @param {${3:String}\} ${4:paramName} ${5:parameter description}}${7:
+ * @return {${8:String}\} ${9:Return value description}}
+ */
+${1:functionName}: function($4$6) {
+ $0
+}]]></content>
+ <description>Extend Block: function</description>
+ <scope>source.js</scope>
+ <tabTrigger>ef</tabTrigger>
+</snippet>
+
@@ -0,0 +1,11 @@
+<snippet>
+ <content><![CDATA[initComponent: function() {
+ $0
+
+ ${1:${TM_FILENAME/(.+)\.js$/$1/}}.superclass.initComponent.apply(this, arguments);
+}${2:,}]]></content>
+ <description>Extend Block: initComponent</description>
+ <scope>source.js</scope>
+ <tabTrigger>initc</tabTrigger>
+</snippet>
+
@@ -0,0 +1,12 @@
+<snippet>
+ <content><![CDATA[/**
+ * ${3:Property description}
+ * @property ${1:propertyName}
+ * @type ${2:Boolean}
+ */
+${1:propertyName}: ${0}]]></content>
+ <description>Extend Block: property</description>
+ <scope>source.js</scope>
+ <tabTrigger>ep</tabTrigger>
+</snippet>
+
@@ -0,0 +1,7 @@
+<snippet>
+ <content><![CDATA[
+* ${0]]></content>
+ <description>JSDoc new line</description>
+ <tabTrigger>/**</tabTrigger>
+ <scope>comment.block.documentation.js</scope>
+</snippet>
@@ -0,0 +1,6 @@
+<snippet>
+ <content><![CDATA[* @class ${1:ClassName}]]></content>
+ <tabTrigger>* cl</tabTrigger>
+ <scope>source.js</scope>
+ <description>JSDoc: class</description>
+</snippet>
@@ -0,0 +1,8 @@
+<snippet>
+ <content><![CDATA[/**
+ * $0
+ */]]></content>
+ <tabTrigger>/**</tabTrigger>
+ <scope>source.js</scope>
+ <description>JSDoc: comment block</description>
+</snippet>
@@ -0,0 +1,6 @@
+<snippet>
+ <content><![CDATA[* @cfg {${1:String}} ${2:configName} ${3:Config description}]]></content>
+ <tabTrigger>* c</tabTrigger>
+ <scope>source.js</scope>
+ <description>JSDoc: config</description>
+</snippet>
@@ -0,0 +1,6 @@
+<snippet>
+ <content><![CDATA[* @extends ${1:ClassName}]]></content>
+ <tabTrigger>* e</tabTrigger>
+ <scope>source.js</scope>
+ <description>JSDoc: extends</description>
+</snippet>
@@ -0,0 +1,6 @@
+<snippet>
+ <content><![CDATA[* @param {Object} ${1:config} ${2:Optional config object}$0]]></content>
+ <tabTrigger>* pc</tabTrigger>
+ <scope>source.js</scope>
+ <description>JSDoc: param (config)</description>
+</snippet>
@@ -0,0 +1,6 @@
+<snippet>
+ <content><![CDATA[* @param {${1:String}} ${2:paramName} ${3:Parameter description}]]></content>
+ <tabTrigger>* p</tabTrigger>
+ <scope>source.js</scope>
+ <description>JSDoc: param</description>
+</snippet>
@@ -0,0 +1,13 @@
+<snippet>
+ <content><![CDATA[/**
+ * @property ${1:propertyName}
+ * @type ${2:Boolean}
+ * ${3:Description}
+ */
+${4:this.$1} = ${5:new ${2:Boolean}({
+ $0
+\})};]]></content>
+ <tabTrigger>prop</tabTrigger>
+ <scope>source.js</scope>
+ <description>JSDoc: property</description>
+</snippet>
@@ -0,0 +1,6 @@
+<snippet>
+ <content><![CDATA[* @return {${1:String}} ${2:Returned parameter description}]]></content>
+ <tabTrigger>* r</tabTrigger>
+ <scope>source.js</scope>
+ <description>JSDoc: return</description>
+</snippet>
@@ -0,0 +1,7 @@
+<snippet>
+ <content><![CDATA[${1:MyClassName}.superclass.${2:constructor}.${3:apply}(${4:this, arguments});$0]]></content>
+ <description>call superclass</description>
+ <scope>source.js</scope>
+ <tabTrigger>super</tabTrigger>
+</snippet>
+
@@ -0,0 +1,7 @@
+<snippet>
+ <content><![CDATA[console.log(arguments);$0]]></content>
+ <description>console.log arguments</description>
+ <scope>source.js</scope>
+ <tabTrigger>coa</tabTrigger>
+</snippet>
+
@@ -0,0 +1,7 @@
+<snippet>
+ <content><![CDATA[console.log($1);$0]]></content>
+ <description>console.log object</description>
+ <scope>source.js</scope>
+ <tabTrigger>co</tabTrigger>
+</snippet>
+
@@ -0,0 +1,7 @@
+<snippet>
+ <content><![CDATA[console.log('$1');$0]]></content>
+ <description>console.log</description>
+ <scope>source.js</scope>
+ <tabTrigger>c</tabTrigger>
+</snippet>
+
@@ -0,0 +1,11 @@
+<snippet>
+ <content><![CDATA[if (${1:this}.fireEvent('${3:before-${2:eventName}}'${4:, ${5:params}}) !== false) {
+ $0
+
+ ${1:this}.fireEvent('${2:eventName}'${6:${4:, ${5:params}}});
+}]]></content>
+ <description>fireEvent (before and after)</description>
+ <scope>source.js</scope>
+ <tabTrigger>bfefe</tabTrigger>
+</snippet>
+
@@ -0,0 +1,9 @@
+<snippet>
+ <content><![CDATA[if (${1:this}.fireEvent('${2:eventName}'${3:, ${4:params}})) {
+ $0
+}]]></content>
+ <description>fireEvent (before)</description>
+ <scope>source.js</scope>
+ <tabTrigger>bfe</tabTrigger>
+</snippet>
+
@@ -0,0 +1,7 @@
+<snippet>
+ <content><![CDATA[${1:this}.fireEvent('${2:eventName}'${3:, ${4:params}});]]></content>
+ <description>fireEvent</description>
+ <scope>source.js</scope>
+ <tabTrigger>fe</tabTrigger>
+</snippet>
+
@@ -0,0 +1,9 @@
+<snippet>
+ <content><![CDATA[if (${1:myObject} != undefined) ${2:{
+ $0
+\}}]]></content>
+ <description>if not undefined</description>
+ <scope>source.js</scope>
+ <tabTrigger>ifnu</tabTrigger>
+</snippet>
+
@@ -0,0 +1,9 @@
+<snippet>
+ <content><![CDATA[if (${1:myObject} == undefined) ${2:{
+ $0
+\}}]]></content>
+ <description>if undefined</description>
+ <scope>source.js</scope>
+ <tabTrigger>ifu</tabTrigger>
+</snippet>
+
@@ -0,0 +1,6 @@
+<snippet>
+ <content><![CDATA[${1:this}.on('${2:click}', ${4:function($5) {$0\}}, ${3:this});]]></content>
+ <tabTrigger>on</tabTrigger>
+ <scope>source.js</scope>
+ <description>on (addListener)</description>
+</snippet>
@@ -0,0 +1,8 @@
+<snippet>
+ <content><![CDATA[Ext.onReady(function() {
+ ${0:$TM_SELECTED_TEXT}
+});]]></content>
+ <tabTrigger>ready</tabTrigger>
+ <scope>source.js</scope>
+ <description>Ext.onReady</description>
+</snippet>

0 comments on commit 0a09370

Please sign in to comment.