summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorNeil Drumm <drumm@3064.no-reply.drupal.org>2006-08-23 04:59:17 +0000
committerNeil Drumm <drumm@3064.no-reply.drupal.org>2006-08-23 04:59:17 +0000
commit4fdc90e1d24701d22a7734d83e7b73b9861b0438 (patch)
tree8039850a3ae517009e0664031534f7785d30c45a
parent02b3898e8f088f50279d860f6c12fb02ee360963 (diff)
downloadbrdo-4fdc90e1d24701d22a7734d83e7b73b9861b0438.tar.gz
brdo-4fdc90e1d24701d22a7734d83e7b73b9861b0438.tar.bz2
#76637 by timcn. Adding some documentation to drupal.js.
-rw-r--r--misc/drupal.js14
1 files changed, 13 insertions, 1 deletions
diff --git a/misc/drupal.js b/misc/drupal.js
index 6fb336b56..927403ab1 100644
--- a/misc/drupal.js
+++ b/misc/drupal.js
@@ -21,8 +21,20 @@ if (isJsEnabled()) {
document.documentElement.className = 'js';
}
+/**
+ * The global Drupal variable.
+ */
Drupal = { };
+/**
+ * Merge an object into the Drupal namespace.
+ *
+ * @param obj
+ * The object that should be merged into the Drupal namespace. Arbitrary objects
+ * containing functions, variables or other objects can be used. An example object
+ * would be { settings: { tree: { '/js/menu/tree': { mid: 206 } } } }. This item
+ * can now be accessed at Drupal.settings.tree['/js/menu/tree'].mid.
+ */
Drupal.extend = function(obj) {
for (var i in obj) {
if (this[i]) {
@@ -32,7 +44,7 @@ Drupal.extend = function(obj) {
this[i] = obj[i];
}
}
-}
+};
/**
* Make IE's XMLHTTP object accessible through XMLHttpRequest()