docs: function Widgets() {
          var that;
  
          /**
           * ### Widgets.widgets
           *
           * Container of currently registered widgets
           *
           * @see Widgets.register
           */
          this.widgets = {};
  
          /**
           * ### Widgets.instances
           *
           * Container of appended widget instances
           *
           * @see Widgets.append
           * @see Widgets.lastAppended
           */
          this.instances = [];
  
          /**
           * ### Widgets.lastAppended
           *
           * Reference to lastAppended widget
           *
           * @see Widgets.append
           */
          this.lastAppended = null;
  
          /**
           * ### Widgets.docked
           *
           * List of docked widgets
           */
          this.docked = [];
  
          /**
           * ### Widgets.dockedHidden
           *
           * List of hidden docked widgets (cause not enough space on page)
           */
          this.dockedHidden = [];
  
          /**
           * ### Widgets.boxSelector
           *
           * A box selector widget containing hidden docked widgets
           */
          this.boxSelector = null;
  
          /**
           * ### Widgets.collapseTarget
           *
           * Collapsed widgets are by default moved inside element
           */
          this.collapseTarget = null;
  
          that = this;
          node.registerSetup('widgets', function(conf) {
              var name, root, collapseTarget;
              if (!conf) return;
  
              // Add new widgets.
              if (conf.widgets) {
                  for (name in conf.widgets) {
                      if (conf.widgets.hasOwnProperty(name)) {
                          that.register(name, conf.widgets[name]);
                      }
                  }
              }
  
              // Destroy all existing widgets.
              if (conf.destroyAll) that.destroyAll();
  
              // Append existing widgets.
              if (conf.append) {
                  for (name in conf.append) {
                      if (conf.append.hasOwnProperty(name)) {
                          // Determine root.
                          root = conf.append[name].root;
                          if ('function' === typeof root) {
                              root = root();
                          }
                          else if ('string' === typeof root) {
                              root = W.getElementById(root);
                          }
                          if (!root) root = W.getScreen();
  
                          if (!root) {
                              node.warn('setup widgets: could not find a root ' +
                                        'for widget ' + name + '. Requested: ' +
                                        conf.append[name].root);
                          }
                          else {
                              that.append(name, root, conf.append[name]);
                          }
                      }
                  }
              }
  
              if (conf.collapseTarget) {
                  if ('function' === typeof conf.collapseTarget) {
                      collapseTarget = conf.collapseTarget();
                  }
                  else if ('string' === typeof conf.collapseTarget) {
                      collapseTarget = W.getElementById(conf.collapseTarget);
                  }
                  else if (J.isElement(conf.collapseTarget)) {
                      collapseTarget = conf.collapseTarget;
                  }
                  if (!collapseTarget) {
                      node.warn('setup widgets: could not find collapse target.');
                  }
                  else {
                      that.collapseTarget = collapseTarget;
                  }
              }
  
              return conf;
          });
  
          // Garbage collection.
          node.on('FRAME_LOADED', function() {
              node.widgets.garbageCollection();
          });
  
          node.info('node-widgets: loading');
      }