You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@flex.apache.org by er...@apache.org on 2013/01/22 17:40:15 UTC

svn commit: r1437037 - in /flex/asjs/branches/develop/frameworks/js/VanillaSDK: mx/ mx/core/ mx/core/UIComponent.js spark/components/Button.js spark/components/Label.js

Author: erikdebruin
Date: Tue Jan 22 16:40:15 2013
New Revision: 1437037

URL: http://svn.apache.org/viewvc?rev=1437037&view=rev
Log:
- minor changes and added 'UIComponent' - needed to test Publisher app and workflow

Added:
    flex/asjs/branches/develop/frameworks/js/VanillaSDK/mx/
    flex/asjs/branches/develop/frameworks/js/VanillaSDK/mx/core/
    flex/asjs/branches/develop/frameworks/js/VanillaSDK/mx/core/UIComponent.js   (with props)
Modified:
    flex/asjs/branches/develop/frameworks/js/VanillaSDK/spark/components/Button.js
    flex/asjs/branches/develop/frameworks/js/VanillaSDK/spark/components/Label.js

Added: flex/asjs/branches/develop/frameworks/js/VanillaSDK/mx/core/UIComponent.js
URL: http://svn.apache.org/viewvc/flex/asjs/branches/develop/frameworks/js/VanillaSDK/mx/core/UIComponent.js?rev=1437037&view=auto
==============================================================================
--- flex/asjs/branches/develop/frameworks/js/VanillaSDK/mx/core/UIComponent.js (added)
+++ flex/asjs/branches/develop/frameworks/js/VanillaSDK/mx/core/UIComponent.js Tue Jan 22 16:40:15 2013
@@ -0,0 +1,54 @@
+goog.provide('mx.core.UIComponent');
+
+/**
+ * @constructor
+ */
+mx.core.UIComponent = function() {
+	this.element = goog.dom.createDom('div');
+	goog.dom.appendChild(document.body, this.element);
+}
+
+/**
+ * @type {mx.core.UIComponent}
+ */
+mx.core.UIComponent.prototype.addChild = function(child) {
+	goog.dom.appendChild(this.element, child);
+}
+
+/**
+ * @type {number}
+ */
+mx.core.UIComponent.prototype.x;
+Object.defineProperty(
+	mx.core.UIComponent.prototype, 
+	'x', 
+	{
+	get:
+		function() {
+			return this.element.style.offsetLeft;
+		}, 
+	set:
+		function(value) {
+			this.element.style.left = value + "px";
+		}
+	}
+);
+
+/**
+ * @type {number}
+ */
+mx.core.UIComponent.prototype.y;
+Object.defineProperty(
+	mx.core.UIComponent.prototype, 
+	'y', 
+	{
+	get:
+		function() {
+			return this.element.style.offsetTop;
+		}, 
+	set:
+		function(value) {
+			this.element.style.top = value + "px";
+		}
+	}
+);

Propchange: flex/asjs/branches/develop/frameworks/js/VanillaSDK/mx/core/UIComponent.js
------------------------------------------------------------------------------
    svn:eol-style = native

Modified: flex/asjs/branches/develop/frameworks/js/VanillaSDK/spark/components/Button.js
URL: http://svn.apache.org/viewvc/flex/asjs/branches/develop/frameworks/js/VanillaSDK/spark/components/Button.js?rev=1437037&r1=1437036&r2=1437037&view=diff
==============================================================================
--- flex/asjs/branches/develop/frameworks/js/VanillaSDK/spark/components/Button.js (original)
+++ flex/asjs/branches/develop/frameworks/js/VanillaSDK/spark/components/Button.js Tue Jan 22 16:40:15 2013
@@ -4,13 +4,18 @@ goog.require("goog.dom");
 goog.require("goog.events");
 goog.require("goog.events.EventType");
 
+goog.require("mx.core.UIComponent");
+
 /**
  * @constructor
  */
 spark.components.Button = function() {
+	goog.base(this);
+	
 	this.element = goog.dom.createDom('button', {'id':'button'}, 'Click here');
-	goog.dom.appendChild(document.body, this.element);
+	this.addChild(this.element);
 }
+goog.inherits(spark.components.Button, mx.core.UIComponent);
 
 spark.components.Button.prototype.addEventListener = function(type, handler) {
 	goog.events.listen(this.element, goog.events.EventType.CLICK, handler, false, this);

Modified: flex/asjs/branches/develop/frameworks/js/VanillaSDK/spark/components/Label.js
URL: http://svn.apache.org/viewvc/flex/asjs/branches/develop/frameworks/js/VanillaSDK/spark/components/Label.js?rev=1437037&r1=1437036&r2=1437037&view=diff
==============================================================================
--- flex/asjs/branches/develop/frameworks/js/VanillaSDK/spark/components/Label.js (original)
+++ flex/asjs/branches/develop/frameworks/js/VanillaSDK/spark/components/Label.js Tue Jan 22 16:40:15 2013
@@ -1,17 +1,22 @@
 goog.provide('spark.components.Label');
 
+goog.require("mx.core.UIComponent");
+
 /**
  * @constructor
  */
 spark.components.Label = function() {
+	goog.base(this);
+	
 	this.element = goog.dom.createDom('div', null, 'Boo!');
-	goog.dom.appendChild(document.body, this.element);
+	this.addChild(this.element);
 }
+goog.inherits(spark.components.Label, mx.core.UIComponent);
 
 /**
- * @type {number}
+ * @type {string}
  */
-spark.components.Label.prototype.a;
+spark.components.Label.prototype.text;
 
 Object.defineProperty(
 	spark.components.Label.prototype,