flex-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From erikdebr...@apache.org
Subject [2/2] git commit: [flex-asjs] [refs/heads/develop] - Made CreateJSExample "work"
Date Sun, 05 May 2013 12:10:38 GMT
Made CreateJSExample "work"

The CreateJSExample now "works" in the sense that the controls seem to show up, but not sure
about what functionality was present before the 'goog.events' commit, so stuff might still
be not back to the way it worked before...

Signed-off-by: Erik de Bruin <erik@ixsoftware.nl>


Project: http://git-wip-us.apache.org/repos/asf/flex-asjs/repo
Commit: http://git-wip-us.apache.org/repos/asf/flex-asjs/commit/059a9a66
Tree: http://git-wip-us.apache.org/repos/asf/flex-asjs/tree/059a9a66
Diff: http://git-wip-us.apache.org/repos/asf/flex-asjs/diff/059a9a66

Branch: refs/heads/develop
Commit: 059a9a66d198854c177cd4e7747c820d91480c50
Parents: 71b9a78
Author: Erik de Bruin <erik@ixsoftware.nl>
Authored: Sun May 5 14:10:25 2013 +0200
Committer: Erik de Bruin <erik@ixsoftware.nl>
Committed: Sun May 5 14:10:25 2013 +0200

----------------------------------------------------------------------
 .../src/org/apache/flex/createjs/Application.js    |   56 ++-------------
 .../src/org/apache/flex/createjs/core/UIBase.js    |   21 +++---
 .../src/org/apache/flex/createjs/core/ViewBase.js  |   13 ++--
 .../js/FlexJS/src/org/apache/flex/events/Event.js  |    2 +-
 4 files changed, 23 insertions(+), 69 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/flex-asjs/blob/059a9a66/frameworks/js/FlexJS/src/org/apache/flex/createjs/Application.js
----------------------------------------------------------------------
diff --git a/frameworks/js/FlexJS/src/org/apache/flex/createjs/Application.js b/frameworks/js/FlexJS/src/org/apache/flex/createjs/Application.js
index 60c9ffe..dc698e8 100644
--- a/frameworks/js/FlexJS/src/org/apache/flex/createjs/Application.js
+++ b/frameworks/js/FlexJS/src/org/apache/flex/createjs/Application.js
@@ -28,11 +28,7 @@
 
 goog.provide('org.apache.flex.createjs.Application');
 
-//goog.require('org.apache.flex.core.HTMLElementWrapper');
-
-goog.require('org.apache.flex.core.SimpleValuesImpl');
-goog.require('org.apache.flex.core.ValuesManager');
-goog.require('org.apache.flex.createjs.core.ViewBase');
+goog.require('org.apache.flex.core.HTMLElementWrapper');
 goog.require('org.apache.flex.utils.MXMLDataInterpreter');
 
 /**
@@ -40,14 +36,7 @@ goog.require('org.apache.flex.utils.MXMLDataInterpreter');
  * @extends {org.apache.flex.core.HTMLElementWrapper}
  */
 org.apache.flex.createjs.Application = function() {
-    org.apache.flex.core.HTMLElementWrapper.call(this);
-
-    /**
-     * @private
-     * @type {Array.<Object>}
-     */
-    this.queuedListeners_;
-
+    goog.base(this);
 };
 goog.inherits(org.apache.flex.createjs.Application,
     org.apache.flex.core.HTMLElementWrapper);
@@ -83,31 +72,11 @@ org.apache.flex.createjs.Application.prototype.model = null;
 org.apache.flex.createjs.Application.prototype.valuesImpl = null;
 
 /**
- * @this {org.apache.flex.createjs.Application}
- * @param {string} t The event type.
- * @param {function(?): ?} fn The event handler.
- */
-org.apache.flex.createjs.Application.prototype.addEventListener =
-  function(t, fn) {
-    if (!this.element) {
-        if (!this.queuedListeners_) {
-            this.queuedListeners_ = [];
-        }
-
-        this.queuedListeners_.push({ type: t, handler: fn });
-
-        return;
-    }
-
-    goog.base(this, 'addEventListener', t, fn);
-};
-
-/**
  * @expose
  * @this {org.apache.flex.createjs.Application}
  */
 org.apache.flex.createjs.Application.prototype.start = function() {
-    var evt, i, n, q;
+    var body;
 
     // For createjs, the application is the same as the canvas
     // and it provides convenient access to the stage.
@@ -117,32 +86,19 @@ org.apache.flex.createjs.Application.prototype.start = function() {
     this.element.width = 700;
     this.element.height = 500;
 
-    var body = document.getElementsByTagName('body')[0];
+    body = document.getElementsByTagName('body')[0];
     body.appendChild(this.element);
 
     this.stage = new createjs.Stage('flexjsCanvas');
 
-    if (this.queuedListeners_) {
-        n = this.queuedListeners_.length;
-        for (i = 0; i < n; i++) {
-            q = this.queuedListeners_[i];
-
-            this.addEventListener(q.type, q.handler);
-        }
-    }
-
     org.apache.flex.utils.MXMLDataInterpreter.generateMXMLProperties(this,
             this.get_MXMLProperties());
 
-    org.apache.flex.core.ValuesManager.valuesImpl = this.valuesImpl;
-
-    evt = this.createEvent('initialize');
-    this.dispatchEvent(evt);
+    this.dispatchEvent('initialize');
 
     this.initialView.addToParent(this.stage);
     this.initialView.initUI(this.model);
 
-    evt = this.createEvent('viewChanged');
-    this.dispatchEvent(evt);
+    this.dispatchEvent('viewChanged');
 };
 

http://git-wip-us.apache.org/repos/asf/flex-asjs/blob/059a9a66/frameworks/js/FlexJS/src/org/apache/flex/createjs/core/UIBase.js
----------------------------------------------------------------------
diff --git a/frameworks/js/FlexJS/src/org/apache/flex/createjs/core/UIBase.js b/frameworks/js/FlexJS/src/org/apache/flex/createjs/core/UIBase.js
index 2f7f806..ec893bc 100644
--- a/frameworks/js/FlexJS/src/org/apache/flex/createjs/core/UIBase.js
+++ b/frameworks/js/FlexJS/src/org/apache/flex/createjs/core/UIBase.js
@@ -14,21 +14,22 @@
 
 goog.provide('org.apache.flex.createjs.core.UIBase');
 
-goog.require('org.apache.flex.FlexGlobal');
 goog.require('org.apache.flex.core.HTMLElementWrapper');
 
+
+
 /**
  * @constructor
  * @extends {org.apache.flex.core.HTMLElementWrapper}
  */
 org.apache.flex.createjs.core.UIBase = function() {
-    org.apache.flex.core.HTMLElementWrapper.call(this);
+    goog.base(this);
 
     /**
      * @protected
      * @type {Object}
      */
-    this.positioner;
+    this.positioner = null;
 
 };
 goog.inherits(org.apache.flex.createjs.core.UIBase,
@@ -39,7 +40,6 @@ goog.inherits(org.apache.flex.createjs.core.UIBase,
  * @param {Object} p The parent element.
  */
 org.apache.flex.createjs.core.UIBase.prototype.addToParent = function(p) {
-
     this.element = new createjs.Container();
     p.addChild(this.element);
 
@@ -90,7 +90,7 @@ org.apache.flex.createjs.core.UIBase.prototype.set_height = function(pixels)
{
  * @expose
  * @type {string}
  */
-org.apache.flex.createjs.core.UIBase.prototype.id;
+org.apache.flex.createjs.core.UIBase.prototype.id = null;
 
 /**
  * @expose
@@ -107,12 +107,11 @@ org.apache.flex.createjs.core.UIBase.prototype.get_id = function() {
  * @param {object} value The new id.
  */
 org.apache.flex.createjs.core.UIBase.prototype.set_id = function(value) {
-    if (this.name != value)
+    if (this.name !== value)
     {
         this.element.name = value;
         this.name = value;
-        var evt = this.createEvent('idChanged');
-        this.dispatchEvent(evt);
+        this.dispatchEvent('idChanged');
     }
 };
 
@@ -120,7 +119,7 @@ org.apache.flex.createjs.core.UIBase.prototype.set_id = function(value)
{
  * @expose
  * @type {object}
  */
-org.apache.flex.createjs.core.UIBase.prototype.model;
+org.apache.flex.createjs.core.UIBase.prototype.model = null;
 
 /**
  * @expose
@@ -137,10 +136,10 @@ org.apache.flex.createjs.core.UIBase.prototype.get_model = function()
{
  * @param {object} value The new model.
  */
 org.apache.flex.createjs.core.UIBase.prototype.set_model = function(value) {
-    if (this.model != value)
+    if (this.model !== value)
     {
         this.addBead(value);
-        this.dispatchEvent(new Event('modelChanged'));
+        this.dispatchEvent('modelChanged');
     }
 };
 

http://git-wip-us.apache.org/repos/asf/flex-asjs/blob/059a9a66/frameworks/js/FlexJS/src/org/apache/flex/createjs/core/ViewBase.js
----------------------------------------------------------------------
diff --git a/frameworks/js/FlexJS/src/org/apache/flex/createjs/core/ViewBase.js b/frameworks/js/FlexJS/src/org/apache/flex/createjs/core/ViewBase.js
index a60fc89..e5ac4ef 100644
--- a/frameworks/js/FlexJS/src/org/apache/flex/createjs/core/ViewBase.js
+++ b/frameworks/js/FlexJS/src/org/apache/flex/createjs/core/ViewBase.js
@@ -14,24 +14,23 @@
 
 goog.provide('org.apache.flex.createjs.core.ViewBase');
 
-goog.require('org.apache.flex.FlexGlobal');
-
 goog.require('org.apache.flex.createjs.core.UIBase');
-
 goog.require('org.apache.flex.utils.MXMLDataInterpreter');
 
+
+
 /**
  * @constructor
  * @extends {org.apache.flex.createjs.core.UIBase}
  */
 org.apache.flex.createjs.core.ViewBase = function() {
-    org.apache.flex.createjs.core.UIBase.call(this);
+    goog.base(this);
 
      /**
       * @private
       * @type {org.apache.flex.createjs.core.ViewBase}
       */
-      this.currentObject_;
+      this.currentObject_ = null;
 };
 goog.inherits(org.apache.flex.createjs.core.ViewBase,
   org.apache.flex.createjs.core.UIBase);
@@ -58,13 +57,13 @@ org.apache.flex.createjs.core.ViewBase.prototype.set_applicationModel
=
  * @expose
  * @type {Array}
  */
-org.apache.flex.createjs.core.ViewBase.prototype.MXMLProperties;
+org.apache.flex.createjs.core.ViewBase.prototype.MXMLProperties = null;
 
 /**
  * @expose
  * @type {Array}
  */
-org.apache.flex.createjs.core.ViewBase.prototype.MXMLDescriptor;
+org.apache.flex.createjs.core.ViewBase.prototype.MXMLDescriptor = null;
 
 /**
  * @this {org.apache.flex.createjs.core.ViewBase}

http://git-wip-us.apache.org/repos/asf/flex-asjs/blob/059a9a66/frameworks/js/FlexJS/src/org/apache/flex/events/Event.js
----------------------------------------------------------------------
diff --git a/frameworks/js/FlexJS/src/org/apache/flex/events/Event.js b/frameworks/js/FlexJS/src/org/apache/flex/events/Event.js
index 2c7900f..3ca1904 100644
--- a/frameworks/js/FlexJS/src/org/apache/flex/events/Event.js
+++ b/frameworks/js/FlexJS/src/org/apache/flex/events/Event.js
@@ -54,4 +54,4 @@ org.apache.flex.events.Event.prototype.get_target = function() {
  * @expose
  * @type {string} type The event type.
  */
-org.apache.flex.events.CustomEvent.prototype.type;
+org.apache.flex.events.Event.prototype.type = null;


Mime
View raw message