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 2015/09/03 20:46:22 UTC
[1/4] git commit: [flex-asjs] [refs/heads/develop] - missing require
Repository: flex-asjs
Updated Branches:
refs/heads/develop b4dd74238 -> fdd2e6b92
missing require
Project: http://git-wip-us.apache.org/repos/asf/flex-asjs/repo
Commit: http://git-wip-us.apache.org/repos/asf/flex-asjs/commit/feade601
Tree: http://git-wip-us.apache.org/repos/asf/flex-asjs/tree/feade601
Diff: http://git-wip-us.apache.org/repos/asf/flex-asjs/diff/feade601
Branch: refs/heads/develop
Commit: feade6019f2b1b57c6fd13e0f25bbf09e43f35f0
Parents: b4dd742
Author: Alex Harui <ah...@apache.org>
Authored: Thu Sep 3 09:07:13 2015 -0700
Committer: Alex Harui <ah...@apache.org>
Committed: Thu Sep 3 11:46:41 2015 -0700
----------------------------------------------------------------------
.../HTML/js/src/org/apache/flex/html/supportClasses/Viewport.js | 1 +
1 file changed, 1 insertion(+)
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/flex-asjs/blob/feade601/frameworks/projects/HTML/js/src/org/apache/flex/html/supportClasses/Viewport.js
----------------------------------------------------------------------
diff --git a/frameworks/projects/HTML/js/src/org/apache/flex/html/supportClasses/Viewport.js b/frameworks/projects/HTML/js/src/org/apache/flex/html/supportClasses/Viewport.js
index 47d5ad7..4be4ef4 100644
--- a/frameworks/projects/HTML/js/src/org/apache/flex/html/supportClasses/Viewport.js
+++ b/frameworks/projects/HTML/js/src/org/apache/flex/html/supportClasses/Viewport.js
@@ -17,6 +17,7 @@ goog.provide('org.apache.flex.html.supportClasses.Viewport');
goog.require('org.apache.flex.core.IBead');
goog.require('org.apache.flex.core.IContentView');
goog.require('org.apache.flex.core.IViewport');
+goog.require('org.apache.flex.core.ValuesManager');
goog.require('org.apache.flex.geom.Rectangle');
goog.require('org.apache.flex.geom.Size');
[3/4] git commit: [flex-asjs] [refs/heads/develop] - add way to
enable browser scrolling
Posted by ah...@apache.org.
add way to enable browser scrolling
Project: http://git-wip-us.apache.org/repos/asf/flex-asjs/repo
Commit: http://git-wip-us.apache.org/repos/asf/flex-asjs/commit/fdd2e6b9
Tree: http://git-wip-us.apache.org/repos/asf/flex-asjs/tree/fdd2e6b9
Diff: http://git-wip-us.apache.org/repos/asf/flex-asjs/diff/fdd2e6b9
Branch: refs/heads/develop
Commit: fdd2e6b921c8741e69c524ce4cd364b4b21c89de
Parents: 51f8ce2
Author: Alex Harui <ah...@apache.org>
Authored: Thu Sep 3 11:45:48 2015 -0700
Committer: Alex Harui <ah...@apache.org>
Committed: Thu Sep 3 11:46:42 2015 -0700
----------------------------------------------------------------------
.../flexjs/ChartExample/src/ChartExample.mxml | 4 +-
.../src/org/apache/flex/core/BrowserScroller.as | 81 ++++++++++++++++++++
frameworks/projects/Core/basic-manifest.xml | 1 +
.../src/org/apache/flex/core/BrowserScroller.js | 55 +++++++++++++
4 files changed, 140 insertions(+), 1 deletion(-)
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/flex-asjs/blob/fdd2e6b9/examples/flexjs/ChartExample/src/ChartExample.mxml
----------------------------------------------------------------------
diff --git a/examples/flexjs/ChartExample/src/ChartExample.mxml b/examples/flexjs/ChartExample/src/ChartExample.mxml
index 6cf51d9..57bc2a4 100644
--- a/examples/flexjs/ChartExample/src/ChartExample.mxml
+++ b/examples/flexjs/ChartExample/src/ChartExample.mxml
@@ -23,7 +23,9 @@
xmlns:models="models.*"
xmlns:js="library://ns.apache.org/flexjs/basic"
>
-
+ <js:beads>
+ <js:BrowserScroller />
+ </js:beads>
<js:valuesImpl>
<js:SimpleCSSValuesImpl />
</js:valuesImpl>
http://git-wip-us.apache.org/repos/asf/flex-asjs/blob/fdd2e6b9/frameworks/projects/Core/as/src/org/apache/flex/core/BrowserScroller.as
----------------------------------------------------------------------
diff --git a/frameworks/projects/Core/as/src/org/apache/flex/core/BrowserScroller.as b/frameworks/projects/Core/as/src/org/apache/flex/core/BrowserScroller.as
new file mode 100644
index 0000000..355453a
--- /dev/null
+++ b/frameworks/projects/Core/as/src/org/apache/flex/core/BrowserScroller.as
@@ -0,0 +1,81 @@
+////////////////////////////////////////////////////////////////////////////////
+//
+// Licensed to the Apache Software Foundation (ASF) under one or more
+// contributor license agreements. See the NOTICE file distributed with
+// this work for additional information regarding copyright ownership.
+// The ASF licenses this file to You under the Apache License, Version 2.0
+// (the "License"); you may not use this file except in compliance with
+// the License. You may obtain a copy of the License at
+//
+// http://www.apache.org/licenses/LICENSE-2.0
+//
+// Unless required by applicable law or agreed to in writing, software
+// distributed under the License is distributed on an "AS IS" BASIS,
+// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+// See the License for the specific language governing permissions and
+// limitations under the License.
+//
+////////////////////////////////////////////////////////////////////////////////
+package org.apache.flex.core
+{
+ import flash.external.ExternalInterface;
+ import flash.utils.getQualifiedClassName;
+
+ import org.apache.flex.events.Event;
+
+ /**
+ * The BrowserScroller class enables browser scrollbars
+ * when the application is larger than the screen.
+ *
+ * @langversion 3.0
+ * @playerversion Flash 10.2
+ * @playerversion AIR 2.6
+ * @productversion FlexJS 0.0
+ */
+ public class BrowserScroller implements IBead
+ {
+ /**
+ * Constructor.
+ *
+ * @langversion 3.0
+ * @playerversion Flash 10.2
+ * @playerversion AIR 2.6
+ * @productversion FlexJS 0.0
+ */
+ public function BrowserScroller()
+ {
+ }
+
+ private var app:Application;
+
+ /**
+ * @copy org.apache.flex.core.IBead#strand
+ *
+ * @langversion 3.0
+ * @playerversion Flash 10.2
+ * @playerversion AIR 2.6
+ * @productversion FlexJS 0.0
+ */
+ public function set strand(value:IStrand):void
+ {
+ app = value as Application;
+ app.addEventListener("viewChanged", viewChangedHandler);
+ }
+
+ private function viewChangedHandler(event:Event):void
+ {
+ // some day also listen to initial view for size changes
+ if (ExternalInterface.available)
+ {
+ // Get application name. This assumes that the wrapper is using an
+ // object tag with the id that matches the application name
+ var appName:String = getQualifiedClassName(app);
+ var js:String = "var o = document.getElementById('" + appName + "');";
+ js += "o.width = " + app.initialView.width.toString() + ";";
+ js += "o.height = " + app.initialView.height.toString() + ";"
+ ExternalInterface.call("eval", js);
+ }
+ }
+
+ }
+}
\ No newline at end of file
http://git-wip-us.apache.org/repos/asf/flex-asjs/blob/fdd2e6b9/frameworks/projects/Core/basic-manifest.xml
----------------------------------------------------------------------
diff --git a/frameworks/projects/Core/basic-manifest.xml b/frameworks/projects/Core/basic-manifest.xml
index 995157d..65f0db8 100644
--- a/frameworks/projects/Core/basic-manifest.xml
+++ b/frameworks/projects/Core/basic-manifest.xml
@@ -22,6 +22,7 @@
<componentPackage>
<component id="Application" class="org.apache.flex.core.Application"/>
+ <component id="BrowserScroller" class="org.apache.flex.core.BrowserScroller"/>
<component id="SimpleValuesImpl" class="org.apache.flex.core.SimpleValuesImpl"/>
<component id="SimpleCSSValuesImpl" class="org.apache.flex.core.SimpleCSSValuesImpl"/>
<component id="ViewBase" class="org.apache.flex.core.ViewBase"/>
http://git-wip-us.apache.org/repos/asf/flex-asjs/blob/fdd2e6b9/frameworks/projects/Core/js/src/org/apache/flex/core/BrowserScroller.js
----------------------------------------------------------------------
diff --git a/frameworks/projects/Core/js/src/org/apache/flex/core/BrowserScroller.js b/frameworks/projects/Core/js/src/org/apache/flex/core/BrowserScroller.js
new file mode 100644
index 0000000..e6a4987
--- /dev/null
+++ b/frameworks/projects/Core/js/src/org/apache/flex/core/BrowserScroller.js
@@ -0,0 +1,55 @@
+/**
+ * Licensed under the Apache License, Version 2.0 (the 'License');
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an 'AS IS' BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+goog.provide('org.apache.flex.core.BrowserScroller');
+
+
+
+/**
+ * @constructor
+ */
+org.apache.flex.core.BrowserScroller = function() {
+ this.strand_ = null;
+};
+
+
+/**
+ * Metadata
+ *
+ * @type {Object.<string, Array.<Object>>}
+ */
+org.apache.flex.core.BrowserScroller.prototype.FLEXJS_CLASS_INFO =
+ { names: [{ name: 'BrowserScroller',
+ qName: 'org.apache.flex.core.BrowserScroller'}]};
+
+
+/**
+ * @param {Event} e The event.
+ */
+org.apache.flex.core.BrowserScroller.prototype.viewChangedHandler = function(e) {
+ this.strand_.element.style.overflow = 'auto';
+};
+
+
+Object.defineProperties(org.apache.flex.core.BrowserScroller.prototype, {
+ /** @export */
+ strand: {
+ /** @this {org.apache.flex.core.BrowserScroller} */
+ set: function(value) {
+ this.strand_ = value;
+ value.addEventListener('viewChanged',
+ goog.bind(this.viewChangedHandler, this));
+ }
+ }
+});
[2/4] git commit: [flex-asjs] [refs/heads/develop] - left align since
html browsers do that
Posted by ah...@apache.org.
left align since html browsers do that
Project: http://git-wip-us.apache.org/repos/asf/flex-asjs/repo
Commit: http://git-wip-us.apache.org/repos/asf/flex-asjs/commit/4df2c717
Tree: http://git-wip-us.apache.org/repos/asf/flex-asjs/tree/4df2c717
Diff: http://git-wip-us.apache.org/repos/asf/flex-asjs/diff/4df2c717
Branch: refs/heads/develop
Commit: 4df2c7172c855ad0dddf6ea62200271e12491f9c
Parents: feade60
Author: Alex Harui <ah...@apache.org>
Authored: Thu Sep 3 11:43:41 2015 -0700
Committer: Alex Harui <ah...@apache.org>
Committed: Thu Sep 3 11:46:42 2015 -0700
----------------------------------------------------------------------
templates/swfobject/index.template.html | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/flex-asjs/blob/4df2c717/templates/swfobject/index.template.html
----------------------------------------------------------------------
diff --git a/templates/swfobject/index.template.html b/templates/swfobject/index.template.html
index dc6e0e1..7a15def 100644
--- a/templates/swfobject/index.template.html
+++ b/templates/swfobject/index.template.html
@@ -67,7 +67,7 @@
var attributes = {};
attributes.id = "${application}";
attributes.name = "${application}";
- attributes.align = "middle";
+ attributes.align = "left";
swfobject.embedSWF(
"${swf}.swf", "flashContent",
"${width}", "${height}",
[4/4] git commit: [flex-asjs] [refs/heads/develop] - don't scroll
apps by default and let them take natural size if not specified otherwise
Posted by ah...@apache.org.
don't scroll apps by default and let them take natural size if not specified otherwise
Project: http://git-wip-us.apache.org/repos/asf/flex-asjs/repo
Commit: http://git-wip-us.apache.org/repos/asf/flex-asjs/commit/51f8ce2e
Tree: http://git-wip-us.apache.org/repos/asf/flex-asjs/tree/51f8ce2e
Diff: http://git-wip-us.apache.org/repos/asf/flex-asjs/diff/51f8ce2e
Branch: refs/heads/develop
Commit: 51f8ce2e3a48b865221819534a6da826f726d6d9
Parents: 4df2c71
Author: Alex Harui <ah...@apache.org>
Authored: Thu Sep 3 11:45:29 2015 -0700
Committer: Alex Harui <ah...@apache.org>
Committed: Thu Sep 3 11:46:42 2015 -0700
----------------------------------------------------------------------
.../Core/as/src/org/apache/flex/core/Application.as | 12 +++++++-----
.../Core/js/src/org/apache/flex/core/Application.js | 1 +
2 files changed, 8 insertions(+), 5 deletions(-)
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/flex-asjs/blob/51f8ce2e/frameworks/projects/Core/as/src/org/apache/flex/core/Application.as
----------------------------------------------------------------------
diff --git a/frameworks/projects/Core/as/src/org/apache/flex/core/Application.as b/frameworks/projects/Core/as/src/org/apache/flex/core/Application.as
index 3e4821e..d4ba73a 100644
--- a/frameworks/projects/Core/as/src/org/apache/flex/core/Application.as
+++ b/frameworks/projects/Core/as/src/org/apache/flex/core/Application.as
@@ -182,17 +182,19 @@ package org.apache.flex.core
if (initialView)
{
initialView.applicationModel = model;
- if (isNaN(initialView.explicitWidth))
- initialView.width = stage.stageWidth;
- if (isNaN(initialView.explicitHeight))
- initialView.height = stage.stageHeight;
+ if (!isNaN(initialView.percentWidth) && !isNaN(initialView.percentHeight))
+ initialView.setWidthAndHeight(stage.stageWidth, stage.stageHeight);
+ else if (!isNaN(initialView.percentWidth))
+ initialView.setWidth(stage.stageWidth);
+ else if (!isNaN(initialView.percentHeight))
+ initialView.setHeight(stage.stageHeight);
this.addElement(initialView);
var bgColor:Object = ValuesManager.valuesImpl.getValue(this, "background-color");
if (bgColor != null)
{
var backgroundColor:uint = ValuesManager.valuesImpl.convertColor(bgColor);
graphics.beginFill(backgroundColor);
- graphics.drawRect(0, 0, stage.stageWidth, stage.stageHeight);
+ graphics.drawRect(0, 0, initialView.width, initialView.height);
graphics.endFill();
}
dispatchEvent(new org.apache.flex.events.Event("viewChanged"));
http://git-wip-us.apache.org/repos/asf/flex-asjs/blob/51f8ce2e/frameworks/projects/Core/js/src/org/apache/flex/core/Application.js
----------------------------------------------------------------------
diff --git a/frameworks/projects/Core/js/src/org/apache/flex/core/Application.js b/frameworks/projects/Core/js/src/org/apache/flex/core/Application.js
index ccb618b..e9b2a3e 100644
--- a/frameworks/projects/Core/js/src/org/apache/flex/core/Application.js
+++ b/frameworks/projects/Core/js/src/org/apache/flex/core/Application.js
@@ -72,6 +72,7 @@ org.apache.flex.core.Application.prototype.start = function() {
this.element = document.getElementsByTagName('body')[0];
this.element.flexjs_wrapper = this;
this.element.className = 'Application';
+ this.element.style.overflow = 'hidden';
org.apache.flex.utils.MXMLDataInterpreter.generateMXMLInstances(this, null, this.MXMLDescriptor);