I’ve been doing a lot of WinJS work recently, and I am an avid user of the JustCode Template functionality. So, I thought I’d share my templates as I have them now, and will update this post as I update them or create more. For more information on creating JustCode templates, please see this help content.

For each template, I show my acronym in parenthesis. For example, the first template’s acronym is “winjsfile”. I also don’t show the results for every template, since some of them are obvious.

Templates for New JavaScript File

This template and the related templates following are used when I have created a new, blank JavaScript file.

Template (winjsfullfile):

/// <reference path="//Microsoft.WinJS.1.0/js/ui.js" />

/// <reference path="//Microsoft.WinJS.1.0/js/base.js" />

(function () {

"use strict";

WinJS.Namespace.define("$1$", {

|

});

})();

Related templates

Microsoft WinJS References and Self Executing Function

Template (winjsfile):

/// <reference path="//Microsoft.WinJS.1.0/js/ui.js" />

/// <reference path="//Microsoft.WinJS.1.0/js/base.js" />

(function () {

"use strict";

|

})();

Microsoft WinJS References

Template (references):

/// <reference path="//Microsoft.WinJS.1.0/js/ui.js" />

/// <reference path="//Microsoft.WinJS.1.0/js/base.js" />

|

Self Executing Function

Template (sefunc):

(function () {

"use strict";

|

})();

WinJS Namespace

Template (namespace):

WinJS.Namespace.define("$1$", {

|

});

Namespace Templates

I’ve created several templates for common items in namespaces, such as property functions, observable properties, and class definitions.