Skip to content
Based on work by Nicholas Zakas
JavaScript
Find file
Failed to load latest commit information.
CoreModules Started raising notifications when module groupings are started and s… Sep 10, 2012
TestHelpers Changed Core.Address test implementation to handle the new baseUrl fe… Jun 21, 2012
Tests
Core.Address.js Massive update Oct 8, 2013
Core.Ajax.js Core.Ajax update Jul 8, 2014
Core.Communication.js Massive update Oct 7, 2013
Core.Controls.js Changed require in modules to be amd defines Sep 21, 2012
Core.DataBinding.js Massive update Oct 7, 2013
Core.DomManipulation.js Fixed modal show function (depends on bootstrap modal) Jul 9, 2014
Core.Error.js
Core.ModuleGrouping.js
Core.Navigation.js Massive update Oct 7, 2013
Core.Observable.js Changed require in modules to be amd defines Sep 20, 2012
Core.OpenPostRequestPage.js Added a handler to download files and open new windows with attached … Jul 9, 2014
Core.PageData.js Removed white space Sep 21, 2012
Core.Singleton.js Massive update Oct 7, 2013
Core.Storage.js
Core.UrlUtilities.js Massive update Oct 7, 2013
Core.js Changed require in modules to be amd defines Sep 20, 2012
README.md Update README.md Oct 13, 2013
Sandbox.js Sandbox changes for new functions Jul 9, 2014
StackTrace.js first commit May 28, 2012
TestModules.js first commit May 28, 2012
Util.Timer.js Formatting changes Sep 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.