From 510c482eef7edd3443c03ee90b484138e6725681 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Andreas=20St=C3=B6ckel?= Date: Wed, 10 Aug 2011 14:39:35 +0000 Subject: [PATCH] Fixed some dependencies --- etemplate/js/et2_baseWidget.js | 55 +++++++++++++++++++++++++++++++++ etemplate/js/et2_inputWidget.js | 2 +- etemplate/js/et2_widget.js | 54 -------------------------------- etemplate/js/test/test_xml.html | 2 ++ 4 files changed, 58 insertions(+), 55 deletions(-) diff --git a/etemplate/js/et2_baseWidget.js b/etemplate/js/et2_baseWidget.js index 21f0769864..5f633719ec 100644 --- a/etemplate/js/et2_baseWidget.js +++ b/etemplate/js/et2_baseWidget.js @@ -115,4 +115,59 @@ var et2_baseWidget = et2_DOMWidget.extend({ }); +/** + * Simple container object + */ +var et2_container = et2_baseWidget.extend({ + + init: function() { + this._super.apply(this, arguments); + + this.setDOMNode(document.createElement("div")); + } + +}); + +/** + * Container object for not-yet supported widgets + */ +var et2_placeholder = et2_baseWidget.extend({ + + init: function() { + this._super.apply(this, arguments); + + // The attrNodes object will hold the DOM nodes which represent the + // values of this object + this.attrNodes = {}; + + // Create the placeholder div + this.placeDiv = $j(document.createElement("span")) + .addClass("et2_placeholder"); + + var headerNode = $j(document.createElement("span")) + .text(this.type) + .addClass("et2_caption") + .appendTo(this.placeDiv); + + this.setDOMNode(this.placeDiv[0]); + }, + + loadAttributes: function(_attrs) { + for (var i = 0; i < _attrs.length; i++) + { + var attr = _attrs[i]; + + if (typeof this.attrNodes[attr.name] == "undefined") + { + this.attrNodes[attr.name] = $j(document.createElement("span")) + .addClass("et2_attr"); + this.placeDiv.append(this.attrNodes[attr.name]); + } + + this.attrNodes[attr.name].text(attr.name + "=" + attr.value); + } + } +}); + + diff --git a/etemplate/js/et2_inputWidget.js b/etemplate/js/et2_inputWidget.js index 7c37e69039..6b2d541431 100644 --- a/etemplate/js/et2_inputWidget.js +++ b/etemplate/js/et2_inputWidget.js @@ -43,7 +43,7 @@ var et2_IInput = new Interface({ * interface. When derriving from this class, call setDOMNode with an input * DOMNode. */ -var et2_inputWidget = et2_simpleWidget.extend(et2_IInput, { +var et2_inputWidget = et2_baseWidget.extend(et2_IInput, { attributes: { "value": { diff --git a/etemplate/js/et2_widget.js b/etemplate/js/et2_widget.js index 84d2fc42c9..3426fc1a79 100644 --- a/etemplate/js/et2_widget.js +++ b/etemplate/js/et2_widget.js @@ -595,58 +595,4 @@ var et2_DOMWidget = et2_widget.extend(et2_IDOMNode, { }); -/** - * Common container object - */ -var et2_container = et2_simpleWidget.extend({ - - init: function() { - this._super.apply(this, arguments); - - this.setDOMNode(document.createElement("div")); - } - -}); - - -/** - * Container object for not-yet supported widgets - */ -var et2_placeholder = et2_baseWidget.extend({ - - init: function() { - this._super.apply(this, arguments); - - // The attrNodes object will hold the DOM nodes which represent the - // values of this object - this.attrNodes = {}; - - // Create the placeholder div - this.placeDiv = $j(document.createElement("span")) - .addClass("et2_placeholder"); - - var headerNode = $j(document.createElement("span")) - .text(this.type) - .addClass("et2_caption") - .appendTo(this.placeDiv); - - this.setDOMNode(this.placeDiv[0]); - }, - - loadAttributes: function(_attrs) { - for (var i = 0; i < _attrs.length; i++) - { - var attr = _attrs[i]; - - if (typeof this.attrNodes[attr.name] == "undefined") - { - this.attrNodes[attr.name] = $j(document.createElement("span")) - .addClass("et2_attr"); - this.placeDiv.append(this.attrNodes[attr.name]); - } - - this.attrNodes[attr.name].text(attr.name + "=" + attr.value); - } - } -}); diff --git a/etemplate/js/test/test_xml.html b/etemplate/js/test/test_xml.html index 804ca50b8f..d274130069 100644 --- a/etemplate/js/test/test_xml.html +++ b/etemplate/js/test/test_xml.html @@ -7,6 +7,8 @@ + +