can3p (can3p) wrote in changelog,
can3p
can3p
changelog

[livejournal] r21988: LJSUP-12148: JSON-RPC

Committer: dpetrov
LJSUP-12148: JSON-RPC
U   trunk/htdocs/js/basic.js
Modified: trunk/htdocs/js/basic.js
===================================================================
--- trunk/htdocs/js/basic.js	2012-05-18 07:42:31 UTC (rev 21987)
+++ trunk/htdocs/js/basic.js	2012-05-18 07:59:28 UTC (rev 21988)
@@ -309,6 +309,35 @@
 	return (LJ._const.hasOwnProperty(name) ? LJ._const[name] : void 0);
 }
 
+/**
+ * Define a namespace.
+ *
+ * @param {string} path The String with namespace to be created.
+ * @param {Object=} top An optional object. If set then the namespace will be built relative to it. Defaults to the window.
+ */
+LJ.define = function(path, top) {
+	var ns = path.split('.'),
+		name;
+
+	top = top || window;
+
+	while (name = ns.shift()) {
+		top[name] = top[name] || {};
+		top = top[name];
+	}
+
+}
+
+/**
+ * Mark the namespace as a dependency. The function does nothing now.
+ *
+ * @param {string} path Namespace name.
+ */
+LJ.require = function(path) {
+	//fillme
+};
+
+
 LJ.DOM = LJ.DOM || {};
 
 /**

Tags: can3p, dpetrov, js, livejournal
Subscribe

  • Post a new comment

    Error

    Anonymous comments are disabled in this journal

    default userpic

    Your reply will be screened

    Your IP address will be recorded 

  • 0 comments