You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@flex.apache.org by ah...@apache.org on 2013/05/01 20:18:32 UTC

[1/4] git commit: [flex-asjs] - fix event dispatch, add missing getter

Updated Branches:
  refs/heads/develop 138cf91f9 -> f861b2c61


fix event dispatch, add missing getter


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

Branch: refs/heads/develop
Commit: bd1b987b6eff57b4866291273b35492ac9c41eee
Parents: 80e4bb7
Author: Alex Harui <ah...@apache.org>
Authored: Wed May 1 11:17:51 2013 -0700
Committer: Alex Harui <ah...@apache.org>
Committed: Wed May 1 11:18:25 2013 -0700

----------------------------------------------------------------------
 .../js/FlexJS/src/org/apache/flex/core/ViewBase.js |   11 +++++++++++
 1 files changed, 11 insertions(+), 0 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/flex-asjs/blob/bd1b987b/frameworks/js/FlexJS/src/org/apache/flex/core/ViewBase.js
----------------------------------------------------------------------
diff --git a/frameworks/js/FlexJS/src/org/apache/flex/core/ViewBase.js b/frameworks/js/FlexJS/src/org/apache/flex/core/ViewBase.js
index f0c4ade..22eee24 100644
--- a/frameworks/js/FlexJS/src/org/apache/flex/core/ViewBase.js
+++ b/frameworks/js/FlexJS/src/org/apache/flex/core/ViewBase.js
@@ -63,4 +63,15 @@ org.apache.flex.core.ViewBase.prototype.initUI = function(model) {
             this.get_MXMLProperties());
     org.apache.flex.utils.MXMLDataInterpreter.generateMXMLInstances(this,
             this, this.get_MXMLDescriptor());
+    this.dispatchEvent(new org.apache.flex.events.Event('initComplete'));
 };
+
+/**
+ * @expose
+ * @this {org.apache.flex.core.ViewBase}
+ * @return {Object} The application model.
+ */
+org.apache.flex.core.UIBase.prototype.get_applicationModel = function() {
+    return this.applicationModel;
+};
+


[2/4] git commit: [flex-asjs] - implement visible property in JS

Posted by ah...@apache.org.
implement visible property in JS


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

Branch: refs/heads/develop
Commit: 80e4bb7a0a13bd8d7b681b0cb28d697eff43c71a
Parents: b75fc5d
Author: Alex Harui <ah...@apache.org>
Authored: Wed May 1 11:17:06 2013 -0700
Committer: Alex Harui <ah...@apache.org>
Committed: Wed May 1 11:18:25 2013 -0700

----------------------------------------------------------------------
 .../js/FlexJS/src/org/apache/flex/core/UIBase.js   |   40 +++++++++++++++
 1 files changed, 40 insertions(+), 0 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/flex-asjs/blob/80e4bb7a/frameworks/js/FlexJS/src/org/apache/flex/core/UIBase.js
----------------------------------------------------------------------
diff --git a/frameworks/js/FlexJS/src/org/apache/flex/core/UIBase.js b/frameworks/js/FlexJS/src/org/apache/flex/core/UIBase.js
index dedbb0d..41e5e6d 100644
--- a/frameworks/js/FlexJS/src/org/apache/flex/core/UIBase.js
+++ b/frameworks/js/FlexJS/src/org/apache/flex/core/UIBase.js
@@ -30,6 +30,12 @@ org.apache.flex.core.UIBase = function() {
      */
     this.positioner;
 
+    /**
+     * @private
+     * @type {string}
+     */
+    this.lastDisplay;
+
 };
 goog.inherits(org.apache.flex.core.UIBase,
     org.apache.flex.core.HTMLElementWrapper);
@@ -170,3 +176,37 @@ org.apache.flex.core.UIBase.prototype.set_model = function(value) {
     }
 };
 
+/**
+ * @expose
+ * @this {org.apache.flex.core.UIBase}
+ * @return {object} True if visible.
+ */
+org.apache.flex.core.UIBase.prototype.get_visible = function() {
+    return this.element.style.display != 'none';
+};
+
+/**
+ * @expose
+ * @this {org.apache.flex.core.UIBase}
+ * @param {object} value The new model.
+ */
+org.apache.flex.core.UIBase.prototype.set_visible = function(value) {
+    var oldValue = this.element.style.display != 'none';
+    if (value != oldValue)
+    {
+        if (!value)
+        {
+            this.lastDisplay = this.element.style.display;
+            this.element.style.display = 'none';
+            this.dispatchEvent(new org.apache.flex.events.Event('hide'));
+        }
+        else
+        {
+            if (this.lastDisplay)
+                this.element.style.display = this.lastDisplay;
+            else
+                this.element.style.display = 'block';
+            this.dispatchEvent(new org.apache.flex.events.Event('show'));
+        }
+    }
+};


[3/4] git commit: [flex-asjs] - add missing event metadata, otherwise compiler will use flash.events.Event

Posted by ah...@apache.org.
add missing event metadata, otherwise compiler will use flash.events.Event


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

Branch: refs/heads/develop
Commit: b75fc5d7732ba33e96e3430c881a07be4a168dc7
Parents: 138cf91
Author: Alex Harui <ah...@apache.org>
Authored: Wed May 1 11:16:35 2013 -0700
Committer: Alex Harui <ah...@apache.org>
Committed: Wed May 1 11:18:25 2013 -0700

----------------------------------------------------------------------
 .../apache/flex/html/staticControls/CheckBox.as    |    2 ++
 .../apache/flex/html/staticControls/RadioButton.as |    2 ++
 2 files changed, 4 insertions(+), 0 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/flex-asjs/blob/b75fc5d7/frameworks/as/src/org/apache/flex/html/staticControls/CheckBox.as
----------------------------------------------------------------------
diff --git a/frameworks/as/src/org/apache/flex/html/staticControls/CheckBox.as b/frameworks/as/src/org/apache/flex/html/staticControls/CheckBox.as
index ad8ee7c..d61015a 100644
--- a/frameworks/as/src/org/apache/flex/html/staticControls/CheckBox.as
+++ b/frameworks/as/src/org/apache/flex/html/staticControls/CheckBox.as
@@ -32,6 +32,8 @@ package org.apache.flex.html.staticControls
 	import org.apache.flex.core.ValuesManager;
 	import org.apache.flex.events.Event;
 	
+	[Event(name="change", type="org.apache.flex.events.Event")]
+
 	public class CheckBox extends SimpleButton implements IStrand, IInitSkin, IInitModel
 	{
 		public function CheckBox(upState:DisplayObject=null, overState:DisplayObject=null, downState:DisplayObject=null, hitTestState:DisplayObject=null)

http://git-wip-us.apache.org/repos/asf/flex-asjs/blob/b75fc5d7/frameworks/as/src/org/apache/flex/html/staticControls/RadioButton.as
----------------------------------------------------------------------
diff --git a/frameworks/as/src/org/apache/flex/html/staticControls/RadioButton.as b/frameworks/as/src/org/apache/flex/html/staticControls/RadioButton.as
index 8df7478..0aee02b 100644
--- a/frameworks/as/src/org/apache/flex/html/staticControls/RadioButton.as
+++ b/frameworks/as/src/org/apache/flex/html/staticControls/RadioButton.as
@@ -33,6 +33,8 @@ package org.apache.flex.html.staticControls
 	import org.apache.flex.core.ValuesManager;
 	import org.apache.flex.events.Event;
 	
+	[Event(name="change", type="org.apache.flex.events.Event")]
+
 	public class RadioButton extends SimpleButton implements IStrand, IInitSkin, IInitModel
 	{
 		public function RadioButton(upState:DisplayObject=null, overState:DisplayObject=null, downState:DisplayObject=null, hitTestState:DisplayObject=null)


[4/4] git commit: [flex-asjs] - add missing value and selectedValue properties to JS side

Posted by ah...@apache.org.
add missing value and selectedValue properties to JS side


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

Branch: refs/heads/develop
Commit: f861b2c61443c3e2996c14084387650f567f2dc0
Parents: bd1b987
Author: Alex Harui <ah...@apache.org>
Authored: Wed May 1 11:18:13 2013 -0700
Committer: Alex Harui <ah...@apache.org>
Committed: Wed May 1 11:18:26 2013 -0700

----------------------------------------------------------------------
 .../apache/flex/html/staticControls/RadioButton.js |   54 +++++++++++++++
 1 files changed, 54 insertions(+), 0 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/flex-asjs/blob/f861b2c6/frameworks/js/FlexJS/src/org/apache/flex/html/staticControls/RadioButton.js
----------------------------------------------------------------------
diff --git a/frameworks/js/FlexJS/src/org/apache/flex/html/staticControls/RadioButton.js b/frameworks/js/FlexJS/src/org/apache/flex/html/staticControls/RadioButton.js
index 8953ce9..27ab22e 100644
--- a/frameworks/js/FlexJS/src/org/apache/flex/html/staticControls/RadioButton.js
+++ b/frameworks/js/FlexJS/src/org/apache/flex/html/staticControls/RadioButton.js
@@ -101,3 +101,57 @@ org.apache.flex.html.staticControls.RadioButton.prototype.get_selected = functio
 org.apache.flex.html.staticControls.RadioButton.prototype.set_selected = function(value) {
     this.element.childNodes.item(0).checked = value;
 };
+
+/**
+ * @expose
+ * @this {org.apache.flex.html.staticControls.RadioButton}
+ * @return {Object} The value getter.
+ */
+org.apache.flex.html.staticControls.RadioButton.prototype.get_value = function() {
+    return this.element.childNodes.item(0).value;
+};
+
+/**
+ * @expose
+ * @this {org.apache.flex.html.staticControls.RadioButton}
+ * @param {Object} value The value setter.
+ */
+org.apache.flex.html.staticControls.RadioButton.prototype.set_value = function(value) {
+    this.element.childNodes.item(0).value = value;
+};
+
+/**
+ * @expose
+ * @this {org.apache.flex.html.staticControls.RadioButton}
+ * @return {Object} The value of the selected RadioButton.
+ */
+org.apache.flex.html.staticControls.RadioButton.prototype.get_selectedValue = function() {
+    var groupName = this.element.childNodes.item(0).name;
+    var buttons = document.getElementsByName(groupName);
+    var n = buttons.length;
+    for (var i = 0; i < n; i++)
+    {
+        if (buttons[i].checked)
+            return buttons[i].value;
+    }
+    return null;
+};
+
+/**
+ * @expose
+ * @this {org.apache.flex.html.staticControls.RadioButton}
+ * @param {Object} value The value of the selected RadioButton.
+ */
+org.apache.flex.html.staticControls.RadioButton.prototype.set_selectedValue = function(value) {
+    var groupName = this.element.childNodes.item(0).name;
+    var buttons = document.getElementsByName(groupName);
+    var n = buttons.length;
+    for (var i = 0; i < n; i++)
+    {
+        if (buttons[i].value == value)
+        {
+            buttons[i].checked = true;
+            break;
+        }
+    }
+};