Skip to content
This repository

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP

Based on work by Nicholas Zakas

branch: master

Update README.md

latest commit 94e6c94cbd
aranm authored October 13, 2013
Octocat-spinner-32 CoreModules Started raising notifications when module groupings are started and s… September 10, 2012
Octocat-spinner-32 TestHelpers Changed Core.Address test implementation to handle the new baseUrl fe… June 21, 2012
Octocat-spinner-32 Tests Fixed tests for new Core.Address html5 push state functionality June 08, 2012
Octocat-spinner-32 Core.Address.js Massive update October 08, 2013
Octocat-spinner-32 Core.Ajax.js Made changes to Core.Ajax to allow headers to be attached to the request October 11, 2013
Octocat-spinner-32 Core.Communication.js Massive update October 08, 2013
Octocat-spinner-32 Core.Controls.js Changed require in modules to be amd defines September 21, 2012
Octocat-spinner-32 Core.DataBinding.js Massive update October 08, 2013
Octocat-spinner-32 Core.DomManipulation.js Massive update October 08, 2013
Octocat-spinner-32 Core.Error.js Changed require in modules to be amd defines September 21, 2012
Octocat-spinner-32 Core.ModuleGrouping.js Massive update October 08, 2013
Octocat-spinner-32 Core.Navigation.js Massive update October 08, 2013
Octocat-spinner-32 Core.Observable.js Changed require in modules to be amd defines September 21, 2012
Octocat-spinner-32 Core.PageData.js Removed white space September 21, 2012
Octocat-spinner-32 Core.Singleton.js Massive update October 08, 2013
Octocat-spinner-32 Core.Storage.js Massive update October 08, 2013
Octocat-spinner-32 Core.UrlUtilities.js Massive update October 08, 2013
Octocat-spinner-32 Core.js Changed require in modules to be amd defines September 21, 2012
Octocat-spinner-32 README.md Update README.md October 13, 2013
Octocat-spinner-32 Sandbox.js Massive update October 08, 2013
Octocat-spinner-32 StackTrace.js first commit May 28, 2012
Octocat-spinner-32 TestModules.js first commit May 28, 2012
Octocat-spinner-32 Util.Timer.js Formatting changes September 20, 2012
README.md

Scalable Javascript Architecture

What is this for?

Basically this is an architectural framework that allows modularisation of javascript code. It also encapsulates your base library of choice in order to provide an abstraction, this allows (in certain scenarios) less dependence on the library.

How do I use it?

The library lets you define modules:

Core.register("ModuleA", function (sandbox) {
   return {
      activate: function () {
      },
      destroy: function () {
      }
   };
});

Start modules:

Core.start("ModuleA");

or

Core.startAll();

Stop modules:

Core.stop("ModuleA");

or

Core.stopAll();

Define module groupings:

Core.register("ModuleA", function (sandbox) {
   return {
      activate: function () {
      },
      destroy: function () {
      }
   };
});
Core.register("ModuleB", function (sandbox) {
   return {
      activate: function () {
      },
      destroy: function () {
      }
   };
});
Core.ModuleGrouping.registerGroup({
   name: "MyModuleGrouping",
   startsModules: ["ModuleA, ModuleB"]
});

Start and stop module groupings:

Core.ModuleGrouping.start("MyModuleGrouping");

Define module groupings that depend on other module groupings:

Core.register("ModuleC", function (sandbox) {
   return {
      activate: function () {
      },
      destroy: function () {
      }
   };
});
Core.ModuleGrouping.registerGroup({
   name: "MyNextModuleGrouping",
   dependsOnModuleGroupings: ["MyModuleGrouping"],
   startsModules: ["ModuleC"]
});
Something went wrong with that request. Please try again.