var images_global_path = "../static/themes/theme_tadpole/images_global/"; var images_product_path = "../static/themes/theme_tadpole/images_analyzer/"; /////////////////// ToolbarButton /////////////////// function ToolbarButton(props) { this.init(props); } ToolbarButton.newInstance = function(props) { return new ToolbarButton(props); } ToolbarButton.prototype.init = function(props) { if (props == null) { props = {}; } this.id = props.id; this.visible = (props.visible == undefined) ? true : props.visible; this.enabled = (props.enabled == undefined) ? true : props.enabled; this.label = props.label; this.tooltip = props.tooltip; this.image = props.image; this.href = props.href; this.onClick = props.onClick; this.target = props.target; } ToolbarButton.prototype.getElement = function() { var node = null; if (!this.visible) { node = null; } else { node = document.createElement("a"); if (this.id) { node.id = this.id; } if (this.enabled && this.href) { node.href = this.href; } if (this.enabled && this.onClick) { node.setAttribute("onClick", this.onClick); node.href = "javascript:void(0)"; } node.title = this.tooltip; if (this.target) { node.target = this.target; } var img = document.createElement("img"); img.border = 0; node.appendChild(img); if (this.enabled) { img.src = images_product_path + this.image + "_active.gif"; node.setAttribute("onMouseOver", "this.childNodes[0].src=\"" + images_product_path + this.image + "_active.gif\";this.childNodes[0].style.border=\"1px outset ThreeDHighlight\""); node.setAttribute("onMouseOut", "this.childNodes[0].src=\"" + images_product_path + this.image + "_active.gif\";this.childNodes[0].style.border=\"none\""); node.setAttribute("onMouseDown", "this.childNodes[0].src=\"" + images_product_path + this.image + "_active.gif\";this.childNodes[0].style.border=\"1px inset ThreeDHighlight\""); } else { img.src = images_product_path + this.image + "_disabled.gif"; img.style.border = "none"; } } return node; } /////////////////// ToolbarSeparator /////////////////// ToolbarSeparator.prototype = new ToolbarButton(); ToolbarSeparator.prototype.constructor = ToolbarSeparator; ToolbarSeparator.superclass = ToolbarButton.prototype; function ToolbarSeparator(props) { this.init(props); } ToolbarSeparator.newInstance = function(props) { return new ToolbarSeparator(props); } ToolbarSeparator.prototype.init = function(props) { ToolbarSeparator.superclass.init.call(this, props); } ToolbarSeparator.prototype.getElement = function() { var img = document.createElement("img"); img.border = 0; img.src = images_global_path + "toolbar_sep.gif"; img.className = "toolbar_sep"; return img; } /////////////////// Toolbar /////////////////// function Toolbar(btns) { this.btns = btns; } Toolbar.prototype.getElement = function() { var table = document.createElement("table"); table.cellSpacing = 0; table.cellPadding = 0; table.border = 0; var tr = document.createElement("tr"); for (var i=0; i 0) { if (this.btns[0] instanceof FormButtonUsingInput) { span.className = "button"; } else { span.className = "htmlButtons"; } } span.appendChild(table); return span; } FormButtonBar.prototype.toString = function() { var node = document.createElement("span"); node.appendChild(this.getElement()); return node.innerHTML; } FormButtonBar.newInstance = function(btns) { return new FormButtonBar(btns); } FormButtonBar.newInstanceOut = function(btns) { var btnBar = FormButtonBar.newInstance(btns); document.write(btnBar); }