var Class = require('std/Class'), Publisher = require('std/Publisher'), create = require('./create'), style = require('./style'), getOffset = require('./getOffset'), on = require('./on'), off = require('./off'), addClass = require('./addClass'), removeClass = require('./removeClass'), hasClass = require('./hasClass'), getDocumentOf = require('./getDocumentOf'), getElementOf = require('./getElementOf'), getWindowOf = require('./getWindowOf') module.exports = Class(Publisher, function() { this._tag = 'div' this._class = null this.init = function() { Publisher.prototype.init.apply(this) } this.render = function(component) { this._render(component) return this } this._render = function(component) { var doc = getDocumentOf(component) if (this._doc == doc) { return this._el } if (this._el) { this.unrender() } this._doc = doc this._el = doc.createElement(this._tag) if (this._class) { this._el.className = this._class } this.renderContent() return this._el } this.getElement = function() { return this._el } this.getDocument = function() { return this._doc } this.getWindow = function() { return getWindowOf(this._doc) } this.create = function(tag, properties) { return create(tag, properties, this._doc) } this.append = function(/* node1, node2, ... */) { for (var i=0; i