From 4fdc90e1d24701d22a7734d83e7b73b9861b0438 Mon Sep 17 00:00:00 2001 From: Neil Drumm <drumm@3064.no-reply.drupal.org> Date: Wed, 23 Aug 2006 04:59:17 +0000 Subject: [PATCH] #76637 by timcn. Adding some documentation to drupal.js. --- misc/drupal.js | 14 +++++++++++++- 1 file changed, 13 insertions(+), 1 deletion(-) diff --git a/misc/drupal.js b/misc/drupal.js index 6fb336b56ec8..927403ab1d11 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() -- GitLab