src/meadco-core.js
function (namespace) {
            var nsparts = namespace.split(".");
            var parent = module.scope.MeadCo;

            // we want to be able to include or exclude the root namespace so we strip
            // it if it's in the namespace
            if (nsparts[0] === "MeadCo") {
                nsparts = nsparts.slice(1);
            }

            // loop through the parts and create a nested namespace if necessary
            for (var i = 0; i < nsparts.length; i++) {
                var partname = nsparts[i];
                // check if the current parent already has the namespace declared
                // if it isn't, then create it
                if (typeof parent[partname] === "undefined") {
                    parent[partname] = {};
                }
                // get a reference to the deepest element in the hierarchy so far
                parent = parent[partname];
            }
            // the parent is now constructed with empty namespaces and can be used.
            // we return the outermost namespace
            return parent;
        }
function (namespace) {
            var nsparts = namespace.split(".");
            var parent = module.scope.MeadCo;

            // we want to be able to include or exclude the root namespace so we strip
            // it if it's in the namespace
            if (nsparts[0] === "MeadCo") {
                nsparts = nsparts.slice(1);
            }

            // loop through the parts and create a nested namespace if necessary
            for (var i = 0; i < nsparts.length; i++) {
                var partname = nsparts[i];
                // check if the current parent already has the namespace declared
                // if it isn't, then create it
                if (typeof parent[partname] === "undefined") {
                    parent[partname] = {};
                }
                // get a reference to the deepest element in the hierarchy so far
                parent = parent[partname];
            }
            // the parent is now constructed with empty namespaces and can be used.
            // we return the outermost namespace
            return parent;
        }
function ( namespace ) { var nsparts = namespace . split ( "." ) ; var parent = module . scope . MeadCo ; // we want to be able to include or exclude the root namespace so we strip // it if it's in the namespace if ( nsparts [ 0 ] === "MeadCo" ) { nsparts = nsparts . slice ( 1 ) ; } // loop through the parts and create a nested namespace if necessary for ( var i = 0 ; i < nsparts . length ; i ++ ) { var partname = nsparts [ i ] ; // check if the current parent already has the namespace declared // if it isn't, then create it if ( typeof parent [ partname ] === "undefined" ) { parent [ partname ] = { } ; } // get a reference to the deepest element in the hierarchy so far parent = parent [ partname ] ; } // the parent is now constructed with empty namespaces and can be used. // we return the outermost namespace return parent ; }
Create a namespace
@function createNS
@memberof MeadCo
@param {string} namespace path of the namespace
@returns {object} static object for the namespace
@example
var ui = MeadCo.createNS("MeadCo.ScriptX.Print.UI");
ui.Show = function() { alert("hello"); }
Create a namespace