|
<?xml version="1.0" encoding="UTF-8"?> |
|
<templateSet group="JavaScript"> |
|
<template name="forin" value="for (var $VAR$ in $ARRAY$) { $END$ }" description="Iterate (for..in)" toReformat="true" toShortenFQNames="true"> |
|
<variable name="ARRAY" expression="jsArrayVariable()" defaultValue=""array "" alwaysStopAt="true" /> |
|
<variable name="VAR" expression="jsSuggestVariableName()" defaultValue=""o"" alwaysStopAt="true" /> |
|
<context> |
|
<option name="HTML_TEXT" value="false" /> |
|
<option name="HTML" value="false" /> |
|
<option name="XSL_TEXT" value="false" /> |
|
<option name="XML" value="false" /> |
|
<option name="CSS_PROPERTY_VALUE" value="false" /> |
|
<option name="CSS_DECLARATION_BLOCK" value="false" /> |
|
<option name="CSS_RULESET_LIST" value="false" /> |
|
<option name="CSS" value="false" /> |
|
<option name="JAVA_SCRIPT" value="true" /> |
|
<option name="CoffeeScript" value="false" /> |
|
<option name="HAML" value="false" /> |
|
<option name="OTHER" value="false" /> |
|
</context> |
|
</template> |
|
<template name="for" value="for (var $INDEX$ = 0, len = $ARRAY$.length; $INDEX$ < len; $INDEX$++) { var $VAR$ = $ARRAY$[$INDEX$]; $END$ }" description="Iterate elements of array" toReformat="true" toShortenFQNames="true"> |
|
<variable name="INDEX" expression="jsSuggestIndexName()" defaultValue=""i"" alwaysStopAt="true" /> |
|
<variable name="ARRAY" expression="jsArrayVariable()" defaultValue=""array"" alwaysStopAt="true" /> |
|
<variable name="VAR" expression="decapitalize(jsArrayVariable())" defaultValue=""a"" alwaysStopAt="true" /> |
|
<context> |
|
<option name="HTML_TEXT" value="false" /> |
|
<option name="HTML" value="false" /> |
|
<option name="XSL_TEXT" value="false" /> |
|
<option name="XML" value="false" /> |
|
<option name="CSS_PROPERTY_VALUE" value="false" /> |
|
<option name="CSS_DECLARATION_BLOCK" value="false" /> |
|
<option name="CSS_RULESET_LIST" value="false" /> |
|
<option name="CSS" value="false" /> |
|
<option name="JAVA_SCRIPT" value="true" /> |
|
<option name="CoffeeScript" value="false" /> |
|
<option name="HAML" value="false" /> |
|
<option name="OTHER" value="false" /> |
|
</context> |
|
</template> |
|
<template name="rfor" value="for (var $INDEX$ = $ARRAY$.length - 1; $INDEX$ >= 0; $INDEX$--) { var $VAR$ = $ARRAY$[$INDEX$]; $END$ }" description="Iterate elements of array in reverse order" toReformat="true" toShortenFQNames="true"> |
|
<variable name="INDEX" expression="jsSuggestIndexName()" defaultValue=""i"" alwaysStopAt="true" /> |
|
<variable name="ARRAY" expression="jsArrayVariable()" defaultValue=""array"" alwaysStopAt="true" /> |
|
<variable name="VAR" expression="decapitalize(jsArrayVariable())" defaultValue=""o"" alwaysStopAt="true" /> |
|
<context> |
|
<option name="HTML_TEXT" value="false" /> |
|
<option name="HTML" value="false" /> |
|
<option name="XSL_TEXT" value="false" /> |
|
<option name="XML" value="false" /> |
|
<option name="CSS_PROPERTY_VALUE" value="false" /> |
|
<option name="CSS_DECLARATION_BLOCK" value="false" /> |
|
<option name="CSS_RULESET_LIST" value="false" /> |
|
<option name="CSS" value="false" /> |
|
<option name="JAVA_SCRIPT" value="true" /> |
|
<option name="CoffeeScript" value="false" /> |
|
<option name="HAML" value="false" /> |
|
<option name="OTHER" value="false" /> |
|
</context> |
|
</template> |
|
<template name="m" value="$CLASS$.prototype.$FN$ = function($PARAMS$) { $END$ };" description="Declare a method" toReformat="true" toShortenFQNames="true"> |
|
<variable name="CLASS" expression="jsQualifiedClassName()" defaultValue=""Class"" alwaysStopAt="true" /> |
|
<variable name="FN" expression="jsMethodName()" defaultValue=""fn"" alwaysStopAt="true" /> |
|
<variable name="PARAMS" expression="" defaultValue=""param"" alwaysStopAt="true" /> |
|
<context> |
|
<option name="HTML_TEXT" value="false" /> |
|
<option name="HTML" value="false" /> |
|
<option name="XSL_TEXT" value="false" /> |
|
<option name="XML" value="false" /> |
|
<option name="CSS_PROPERTY_VALUE" value="false" /> |
|
<option name="CSS_DECLARATION_BLOCK" value="false" /> |
|
<option name="CSS_RULESET_LIST" value="false" /> |
|
<option name="CSS" value="false" /> |
|
<option name="JAVA_SCRIPT" value="true" /> |
|
<option name="CoffeeScript" value="false" /> |
|
<option name="HAML" value="false" /> |
|
<option name="OTHER" value="false" /> |
|
</context> |
|
</template> |
|
<template name="ctor" value="var $CLASS$ = function($PARAM$) { $END$ };" description="Declare a constructor" toReformat="true" toShortenFQNames="true"> |
|
<variable name="CLASS" expression="" defaultValue=""Class"" alwaysStopAt="true" /> |
|
<variable name="PARAM" expression="" defaultValue="" alwaysStopAt="true" /> |
|
<context> |
|
<option name="HTML_TEXT" value="false" /> |
|
<option name="HTML" value="false" /> |
|
<option name="XSL_TEXT" value="false" /> |
|
<option name="XML" value="false" /> |
|
<option name="CSS_PROPERTY_VALUE" value="false" /> |
|
<option name="CSS_DECLARATION_BLOCK" value="false" /> |
|
<option name="CSS_RULESET_LIST" value="false" /> |
|
<option name="CSS" value="false" /> |
|
<option name="JAVA_SCRIPT" value="true" /> |
|
<option name="CoffeeScript" value="false" /> |
|
<option name="HAML" value="false" /> |
|
<option name="OTHER" value="false" /> |
|
</context> |
|
</template> |
|
<template name="if" value="if ($COND$) { $END$ }" description="If ..." toReformat="false" toShortenFQNames="true"> |
|
<variable name="COND" expression="" defaultValue="" alwaysStopAt="true" /> |
|
<context> |
|
<option name="HTML_TEXT" value="false" /> |
|
<option name="HTML" value="false" /> |
|
<option name="XSL_TEXT" value="false" /> |
|
<option name="XML" value="false" /> |
|
<option name="CSS_PROPERTY_VALUE" value="false" /> |
|
<option name="CSS_DECLARATION_BLOCK" value="false" /> |
|
<option name="CSS_RULESET_LIST" value="false" /> |
|
<option name="CSS" value="false" /> |
|
<option name="JAVA_SCRIPT" value="true" /> |
|
<option name="CoffeeScript" value="false" /> |
|
<option name="HAML" value="false" /> |
|
<option name="OTHER" value="false" /> |
|
</context> |
|
</template> |
|
<template name="ifel" value="if ($COND$) { $END$ } else { }" description="If ... Else ..." toReformat="false" toShortenFQNames="true"> |
|
<variable name="COND" expression="" defaultValue="" alwaysStopAt="true" /> |
|
<context> |
|
<option name="HTML_TEXT" value="false" /> |
|
<option name="HTML" value="false" /> |
|
<option name="XSL_TEXT" value="false" /> |
|
<option name="XML" value="false" /> |
|
<option name="CSS_PROPERTY_VALUE" value="false" /> |
|
<option name="CSS_DECLARATION_BLOCK" value="false" /> |
|
<option name="CSS_RULESET_LIST" value="false" /> |
|
<option name="CSS" value="false" /> |
|
<option name="JAVA_SCRIPT" value="true" /> |
|
<option name="CoffeeScript" value="false" /> |
|
<option name="HAML" value="false" /> |
|
<option name="OTHER" value="false" /> |
|
</context> |
|
</template> |
|
<template name="ter" value="$COND$ ? $EXPR$ : $END$;" description="Ternary operator" toReformat="false" toShortenFQNames="true"> |
|
<variable name="COND" expression="" defaultValue="" alwaysStopAt="true" /> |
|
<variable name="EXPR" expression="" defaultValue="" alwaysStopAt="true" /> |
|
<context> |
|
<option name="HTML_TEXT" value="false" /> |
|
<option name="HTML" value="false" /> |
|
<option name="XSL_TEXT" value="false" /> |
|
<option name="XML" value="false" /> |
|
<option name="CSS_PROPERTY_VALUE" value="false" /> |
|
<option name="CSS_DECLARATION_BLOCK" value="false" /> |
|
<option name="CSS_RULESET_LIST" value="false" /> |
|
<option name="CSS" value="false" /> |
|
<option name="JAVA_SCRIPT" value="true" /> |
|
<option name="CoffeeScript" value="false" /> |
|
<option name="HAML" value="false" /> |
|
<option name="OTHER" value="false" /> |
|
</context> |
|
</template> |
|
<template name="scl" value="(function() { $SELECTION$ })();" description="Closure" toReformat="true" toShortenFQNames="true"> |
|
<variable name="SELECTION" expression="" defaultValue="" alwaysStopAt="false" /> |
|
<context> |
|
<option name="HTML_TEXT" value="false" /> |
|
<option name="HTML" value="false" /> |
|
<option name="XSL_TEXT" value="false" /> |
|
<option name="XML" value="false" /> |
|
<option name="CSS_PROPERTY_VALUE" value="false" /> |
|
<option name="CSS_DECLARATION_BLOCK" value="false" /> |
|
<option name="CSS_RULESET_LIST" value="false" /> |
|
<option name="CSS" value="false" /> |
|
<option name="JAVA_SCRIPT" value="true" /> |
|
<option name="CoffeeScript" value="false" /> |
|
<option name="HAML" value="false" /> |
|
<option name="OTHER" value="false" /> |
|
</context> |
|
</template> |
|
<template name="cl" value="(function() { $END$ })();" description="Closure" toReformat="true" toShortenFQNames="true"> |
|
<context> |
|
<option name="HTML_TEXT" value="false" /> |
|
<option name="HTML" value="false" /> |
|
<option name="XSL_TEXT" value="false" /> |
|
<option name="XML" value="false" /> |
|
<option name="CSS_PROPERTY_VALUE" value="false" /> |
|
<option name="CSS_DECLARATION_BLOCK" value="false" /> |
|
<option name="CSS_RULESET_LIST" value="false" /> |
|
<option name="CSS" value="false" /> |
|
<option name="JAVA_SCRIPT" value="true" /> |
|
<option name="CoffeeScript" value="false" /> |
|
<option name="HAML" value="false" /> |
|
<option name="OTHER" value="false" /> |
|
</context> |
|
</template> |
|
<template name="sp" value="$PROP$: $VAL$, $END$" description="Declare a property" toReformat="true" toShortenFQNames="true"> |
|
<variable name="PROP" expression="" defaultValue="" alwaysStopAt="true" /> |
|
<variable name="VAL" expression="" defaultValue="" alwaysStopAt="true" /> |
|
<context> |
|
<option name="HTML_TEXT" value="false" /> |
|
<option name="HTML" value="false" /> |
|
<option name="XSL_TEXT" value="false" /> |
|
<option name="XML" value="false" /> |
|
<option name="CSS_PROPERTY_VALUE" value="false" /> |
|
<option name="CSS_DECLARATION_BLOCK" value="false" /> |
|
<option name="CSS_RULESET_LIST" value="false" /> |
|
<option name="CSS" value="false" /> |
|
<option name="JAVA_SCRIPT" value="true" /> |
|
<option name="CoffeeScript" value="false" /> |
|
<option name="HAML" value="false" /> |
|
<option name="OTHER" value="false" /> |
|
</context> |
|
</template> |
|
<template name="f" value="function $FN$($PARAMS$) { $END$ };" description="Declare a function" toReformat="true" toShortenFQNames="true"> |
|
<variable name="FN" expression="jsMethodName()" defaultValue=""fn"" alwaysStopAt="true" /> |
|
<variable name="PARAMS" expression="" defaultValue=""param"" alwaysStopAt="true" /> |
|
<context> |
|
<option name="HTML_TEXT" value="false" /> |
|
<option name="HTML" value="false" /> |
|
<option name="XSL_TEXT" value="false" /> |
|
<option name="XML" value="false" /> |
|
<option name="CSS_PROPERTY_VALUE" value="false" /> |
|
<option name="CSS_DECLARATION_BLOCK" value="false" /> |
|
<option name="CSS_RULESET_LIST" value="false" /> |
|
<option name="CSS" value="false" /> |
|
<option name="JAVA_SCRIPT" value="true" /> |
|
<option name="CoffeeScript" value="false" /> |
|
<option name="HAML" value="false" /> |
|
<option name="OTHER" value="false" /> |
|
</context> |
|
</template> |
|
<template name="t" value="this.$PROP$; $END$" description="this" toReformat="true" toShortenFQNames="true"> |
|
<variable name="PROP" expression="completeSmart()" defaultValue="" alwaysStopAt="true" /> |
|
<context> |
|
<option name="HTML_TEXT" value="false" /> |
|
<option name="HTML" value="false" /> |
|
<option name="XSL_TEXT" value="false" /> |
|
<option name="XML" value="false" /> |
|
<option name="CSS_PROPERTY_VALUE" value="false" /> |
|
<option name="CSS_DECLARATION_BLOCK" value="false" /> |
|
<option name="CSS_RULESET_LIST" value="false" /> |
|
<option name="CSS" value="false" /> |
|
<option name="JAVA_SCRIPT" value="true" /> |
|
<option name="CoffeeScript" value="false" /> |
|
<option name="HAML" value="false" /> |
|
<option name="OTHER" value="false" /> |
|
</context> |
|
</template> |
|
<template name="so" value="{ sp$END$ };" description="Declare a literal object" toReformat="true" toShortenFQNames="true"> |
|
<context> |
|
<option name="HTML_TEXT" value="false" /> |
|
<option name="HTML" value="false" /> |
|
<option name="XSL_TEXT" value="false" /> |
|
<option name="XML" value="false" /> |
|
<option name="CSS_PROPERTY_VALUE" value="false" /> |
|
<option name="CSS_DECLARATION_BLOCK" value="false" /> |
|
<option name="CSS_RULESET_LIST" value="false" /> |
|
<option name="CSS" value="false" /> |
|
<option name="JAVA_SCRIPT" value="true" /> |
|
<option name="CoffeeScript" value="false" /> |
|
<option name="HAML" value="false" /> |
|
<option name="OTHER" value="false" /> |
|
</context> |
|
</template> |
|
<template name="o" value="{ p$END$ };" description="Declare a literal object" toReformat="true" toShortenFQNames="true"> |
|
<context> |
|
<option name="HTML_TEXT" value="false" /> |
|
<option name="HTML" value="false" /> |
|
<option name="XSL_TEXT" value="false" /> |
|
<option name="XML" value="false" /> |
|
<option name="CSS_PROPERTY_VALUE" value="false" /> |
|
<option name="CSS_DECLARATION_BLOCK" value="false" /> |
|
<option name="CSS_RULESET_LIST" value="false" /> |
|
<option name="CSS" value="false" /> |
|
<option name="JAVA_SCRIPT" value="true" /> |
|
<option name="CoffeeScript" value="false" /> |
|
<option name="HAML" value="false" /> |
|
<option name="OTHER" value="false" /> |
|
</context> |
|
</template> |
|
<template name="p" value="$PROP$: $VAL$, $END$" description="Declare a property" toReformat="true" toShortenFQNames="true"> |
|
<variable name="PROP" expression="" defaultValue="" alwaysStopAt="true" /> |
|
<variable name="VAL" expression="" defaultValue="" alwaysStopAt="true" /> |
|
<context> |
|
<option name="HTML_TEXT" value="false" /> |
|
<option name="HTML" value="false" /> |
|
<option name="XSL_TEXT" value="false" /> |
|
<option name="XML" value="false" /> |
|
<option name="CSS_PROPERTY_VALUE" value="false" /> |
|
<option name="CSS_DECLARATION_BLOCK" value="false" /> |
|
<option name="CSS_RULESET_LIST" value="false" /> |
|
<option name="CSS" value="false" /> |
|
<option name="JAVA_SCRIPT" value="true" /> |
|
<option name="CoffeeScript" value="false" /> |
|
<option name="HAML" value="false" /> |
|
<option name="OTHER" value="false" /> |
|
</context> |
|
</template> |
|
<template name="us" value=""use strict"; $END$" description="Inserts 'use strict' statement" toReformat="true" toShortenFQNames="true"> |
|
<context> |
|
<option name="HTML_TEXT" value="false" /> |
|
<option name="HTML" value="false" /> |
|
<option name="XSL_TEXT" value="false" /> |
|
<option name="XML" value="false" /> |
|
<option name="CSS_PROPERTY_VALUE" value="false" /> |
|
<option name="CSS_DECLARATION_BLOCK" value="false" /> |
|
<option name="CSS_RULESET_LIST" value="false" /> |
|
<option name="CSS" value="false" /> |
|
<option name="CoffeeScript" value="false" /> |
|
<option name="HAML" value="false" /> |
|
<option name="OTHER" value="false" /> |
|
</context> |
|
</template> |
|
<template name="clog" value="console.log($END$);" description="console.log" toReformat="true" toShortenFQNames="true"> |
|
<context> |
|
<option name="HTML_TEXT" value="false" /> |
|
<option name="HTML" value="false" /> |
|
<option name="XSL_TEXT" value="false" /> |
|
<option name="XML" value="false" /> |
|
<option name="CSS_PROPERTY_VALUE" value="false" /> |
|
<option name="CSS_DECLARATION_BLOCK" value="false" /> |
|
<option name="CSS_RULESET_LIST" value="false" /> |
|
<option name="CSS" value="false" /> |
|
<option name="JAVA_SCRIPT" value="true" /> |
|
<option name="CoffeeScript" value="false" /> |
|
<option name="HAML" value="false" /> |
|
<option name="OTHER" value="false" /> |
|
</context> |
|
</template> |
|
<template name="it" value="it('should $WHAT$', function(done) { 	$END$ });" description="It should..." toReformat="false" toShortenFQNames="true"> |
|
<variable name="WHAT" expression="" defaultValue="" alwaysStopAt="true" /> |
|
<context> |
|
<option name="HTML_TEXT" value="false" /> |
|
<option name="HTML" value="false" /> |
|
<option name="XSL_TEXT" value="false" /> |
|
<option name="XML" value="false" /> |
|
<option name="CSS_PROPERTY_VALUE" value="false" /> |
|
<option name="CSS_DECLARATION_BLOCK" value="false" /> |
|
<option name="CSS_RULESET_LIST" value="false" /> |
|
<option name="CSS" value="false" /> |
|
<option name="JAVA_SCRIPT" value="true" /> |
|
<option name="CoffeeScript" value="false" /> |
|
<option name="HAML" value="false" /> |
|
<option name="OTHER" value="false" /> |
|
</context> |
|
</template> |
|
<template name="on" value="on('$EVT$', function(e) { 	$END$; });" description="On event" toReformat="false" toShortenFQNames="true"> |
|
<variable name="EVT" expression="" defaultValue="" alwaysStopAt="true" /> |
|
<context> |
|
<option name="HTML_TEXT" value="false" /> |
|
<option name="HTML" value="false" /> |
|
<option name="XSL_TEXT" value="false" /> |
|
<option name="XML" value="false" /> |
|
<option name="CSS_PROPERTY_VALUE" value="false" /> |
|
<option name="CSS_DECLARATION_BLOCK" value="false" /> |
|
<option name="CSS_RULESET_LIST" value="false" /> |
|
<option name="CSS" value="false" /> |
|
<option name="JAVA_SCRIPT" value="true" /> |
|
<option name="CoffeeScript" value="false" /> |
|
<option name="HAML" value="false" /> |
|
<option name="OTHER" value="false" /> |
|
</context> |
|
</template> |
|
<template name="pf" value="$FN$: function($PARAMS$) { $END$ }" description="Declare a property function" toReformat="true" toShortenFQNames="true"> |
|
<variable name="FN" expression="" defaultValue="" alwaysStopAt="true" /> |
|
<variable name="PARAMS" expression="" defaultValue=""param"" alwaysStopAt="true" /> |
|
<context> |
|
<option name="HTML_TEXT" value="false" /> |
|
<option name="HTML" value="false" /> |
|
<option name="XSL_TEXT" value="false" /> |
|
<option name="XML" value="false" /> |
|
<option name="CSS_PROPERTY_VALUE" value="false" /> |
|
<option name="CSS_DECLARATION_BLOCK" value="false" /> |
|
<option name="CSS_RULESET_LIST" value="false" /> |
|
<option name="CSS" value="false" /> |
|
<option name="JAVA_SCRIPT" value="true" /> |
|
<option name="CoffeeScript" value="false" /> |
|
<option name="HAML" value="false" /> |
|
<option name="OTHER" value="false" /> |
|
</context> |
|
</template> |
|
<template name="desc" value="describe('$WHAT$', function() { 	$END$ });" description="Describe..." toReformat="false" toShortenFQNames="true"> |
|
<variable name="WHAT" expression="" defaultValue="" alwaysStopAt="true" /> |
|
<context> |
|
<option name="HTML_TEXT" value="false" /> |
|
<option name="HTML" value="false" /> |
|
<option name="XSL_TEXT" value="false" /> |
|
<option name="XML" value="false" /> |
|
<option name="CSS_PROPERTY_VALUE" value="false" /> |
|
<option name="CSS_DECLARATION_BLOCK" value="false" /> |
|
<option name="CSS_RULESET_LIST" value="false" /> |
|
<option name="CSS" value="false" /> |
|
<option name="JAVA_SCRIPT" value="true" /> |
|
<option name="CoffeeScript" value="false" /> |
|
<option name="HAML" value="false" /> |
|
<option name="OTHER" value="false" /> |
|
</context> |
|
</template> |
|
</templateSet> |
|
|
The easy way is copy the xml file to:
/home/USER/.WebStorm2017.1/config/templates
and restart webstorm