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/03 06:58:19 UTC
[1/3] git commit: [flex-asjs] [refs/heads/develop] - HTML5 Button now
uses CSSTextButtonBead so we can try svg skinning for it
Updated Branches:
refs/heads/develop 355f113c8 -> 993440296
HTML5 Button now uses CSSTextButtonBead so we can try svg skinning for it
Project: http://git-wip-us.apache.org/repos/asf/flex-asjs/repo
Commit: http://git-wip-us.apache.org/repos/asf/flex-asjs/commit/99344029
Tree: http://git-wip-us.apache.org/repos/asf/flex-asjs/tree/99344029
Diff: http://git-wip-us.apache.org/repos/asf/flex-asjs/diff/99344029
Branch: refs/heads/develop
Commit: 993440296578a4317c2ef22430a92401404e21f6
Parents: d281aa9
Author: Alex Harui <ah...@apache.org>
Authored: Thu May 2 21:57:19 2013 -0700
Committer: Alex Harui <ah...@apache.org>
Committed: Thu May 2 21:57:35 2013 -0700
----------------------------------------------------------------------
frameworks/as/defaults.css | 2 +-
1 files changed, 1 insertions(+), 1 deletions(-)
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/flex-asjs/blob/99344029/frameworks/as/defaults.css
----------------------------------------------------------------------
diff --git a/frameworks/as/defaults.css b/frameworks/as/defaults.css
index 9d063aa..64b9b07 100644
--- a/frameworks/as/defaults.css
+++ b/frameworks/as/defaults.css
@@ -118,7 +118,7 @@ TextInput
h5|TextButton
{
- ITextButtonBead: ClassReference("org.apache.flex.html.staticControls.beads.TextButtonBead");
+ ITextButtonBead: ClassReference("org.apache.flex.html.staticControls.beads.CSSTextButtonBead");
}
h5|TextInput
[3/3] git commit: [flex-asjs] [refs/heads/develop] - add ViewSource
bead
Posted by ah...@apache.org.
add ViewSource bead
Project: http://git-wip-us.apache.org/repos/asf/flex-asjs/repo
Commit: http://git-wip-us.apache.org/repos/asf/flex-asjs/commit/7376da79
Tree: http://git-wip-us.apache.org/repos/asf/flex-asjs/tree/7376da79
Diff: http://git-wip-us.apache.org/repos/asf/flex-asjs/diff/7376da79
Branch: refs/heads/develop
Commit: 7376da79fe36348c8664a8c7daec6e7b89231eca
Parents: 355f113
Author: Alex Harui <ah...@apache.org>
Authored: Thu May 2 21:21:47 2013 -0700
Committer: Alex Harui <ah...@apache.org>
Committed: Thu May 2 21:57:35 2013 -0700
----------------------------------------------------------------------
frameworks/as/basic-manifest.xml | 1 +
.../flex/utils/ViewSourceContextMenuOption.as | 63 +++++++++++++++
.../flex/utils/ViewSourceContextMenuOption.js | 31 +++++++
3 files changed, 95 insertions(+), 0 deletions(-)
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/flex-asjs/blob/7376da79/frameworks/as/basic-manifest.xml
----------------------------------------------------------------------
diff --git a/frameworks/as/basic-manifest.xml b/frameworks/as/basic-manifest.xml
index 8fe7d0f..3998ceb 100644
--- a/frameworks/as/basic-manifest.xml
+++ b/frameworks/as/basic-manifest.xml
@@ -42,5 +42,6 @@
<component id="LazyCollection" class="org.apache.flex.net.dataConverters.LazyCollection"/>
<component id="JSONInputParser" class="org.apache.flex.net.JSONInputParser"/>
<component id="JSONItemConverter" class="org.apache.flex.net.JSONItemConverter"/>
+ <component id="ViewSourceContextMenuOption" class="org.apache.flex.utils.ViewSourceContextMenuOption"/>
</componentPackage>
http://git-wip-us.apache.org/repos/asf/flex-asjs/blob/7376da79/frameworks/as/src/org/apache/flex/utils/ViewSourceContextMenuOption.as
----------------------------------------------------------------------
diff --git a/frameworks/as/src/org/apache/flex/utils/ViewSourceContextMenuOption.as b/frameworks/as/src/org/apache/flex/utils/ViewSourceContextMenuOption.as
new file mode 100644
index 0000000..e119377
--- /dev/null
+++ b/frameworks/as/src/org/apache/flex/utils/ViewSourceContextMenuOption.as
@@ -0,0 +1,63 @@
+////////////////////////////////////////////////////////////////////////////////
+//
+// 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.utils
+{
+
+import flash.display.InteractiveObject;
+import flash.events.ContextMenuEvent;
+import flash.net.URLRequest;
+import flash.net.navigateToURL;
+import flash.ui.ContextMenu;
+import flash.ui.ContextMenuItem;
+
+import org.apache.flex.core.IBead;
+import org.apache.flex.core.IStrand;
+
+public class ViewSourceContextMenuOption implements IBead
+{
+ public function ViewSourceContextMenuOption()
+ {
+ }
+
+ private var _strand:IStrand;
+
+ public function set strand(value:IStrand):void
+ {
+ _strand = value;
+
+ var menuHost:InteractiveObject = InteractiveObject(value);
+ var cm:ContextMenu = menuHost.contextMenu;
+ if (!cm)
+ {
+ cm = new ContextMenu();
+ menuHost.contextMenu = cm;
+ }
+ var cmi:ContextMenuItem = new ContextMenuItem("View Source...");
+ cm.hideBuiltInItems();
+ cm.customItems.push(cmi);
+ cmi.addEventListener(ContextMenuEvent.MENU_ITEM_SELECT, viewSource);
+ }
+
+ private function viewSource(e:ContextMenuEvent):void
+ {
+ var urlRequest:URLRequest = new URLRequest("srcview/index.html");
+ navigateToURL(urlRequest, "_blank");
+ }
+}
+}
http://git-wip-us.apache.org/repos/asf/flex-asjs/blob/7376da79/frameworks/js/FlexJS/src/org/apache/flex/utils/ViewSourceContextMenuOption.js
----------------------------------------------------------------------
diff --git a/frameworks/js/FlexJS/src/org/apache/flex/utils/ViewSourceContextMenuOption.js b/frameworks/js/FlexJS/src/org/apache/flex/utils/ViewSourceContextMenuOption.js
new file mode 100644
index 0000000..53820b2
--- /dev/null
+++ b/frameworks/js/FlexJS/src/org/apache/flex/utils/ViewSourceContextMenuOption.js
@@ -0,0 +1,31 @@
+/**
+ * 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.utils.ViewSourceContextMenuOption');
+
+/**
+ * @constructor
+ * @extends {org.apache.flex.events.EventDispatcher}
+ */
+org.apache.flex.utils.ViewSourceContextMenuOption = function() {
+ // no implementation in JS since ViewSource is already in menu
+};
+
+/**
+ * @this {org.apache.flex.utils.ViewSourceContextMenuOption}
+ * @param {object} value The strand (owner) of the bead.
+ */
+org.apache.flex.utils.ViewSourceContextMenuOption.prototype.set_strand = function(value) {
+};
+
[2/3] git commit: [flex-asjs] [refs/heads/develop] - fix plain ol'
text button bead
Posted by ah...@apache.org.
fix plain ol' text button bead
Project: http://git-wip-us.apache.org/repos/asf/flex-asjs/repo
Commit: http://git-wip-us.apache.org/repos/asf/flex-asjs/commit/d281aa92
Tree: http://git-wip-us.apache.org/repos/asf/flex-asjs/tree/d281aa92
Diff: http://git-wip-us.apache.org/repos/asf/flex-asjs/diff/d281aa92
Branch: refs/heads/develop
Commit: d281aa925abea4f0404ffacdfd9fd787a6512745
Parents: 7376da7
Author: Alex Harui <ah...@apache.org>
Authored: Thu May 2 21:46:42 2013 -0700
Committer: Alex Harui <ah...@apache.org>
Committed: Thu May 2 21:57:35 2013 -0700
----------------------------------------------------------------------
.../as/src/org/apache/flex/core/CSSTextField.as | 19 +++++++++++----
.../html/staticControls/beads/TextButtonBead.as | 3 ++
2 files changed, 17 insertions(+), 5 deletions(-)
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/flex-asjs/blob/d281aa92/frameworks/as/src/org/apache/flex/core/CSSTextField.as
----------------------------------------------------------------------
diff --git a/frameworks/as/src/org/apache/flex/core/CSSTextField.as b/frameworks/as/src/org/apache/flex/core/CSSTextField.as
index eb2cc21..ed1c87b 100644
--- a/frameworks/as/src/org/apache/flex/core/CSSTextField.as
+++ b/frameworks/as/src/org/apache/flex/core/CSSTextField.as
@@ -30,14 +30,23 @@ package org.apache.flex.core
super();
}
+ // if used as the display object in a button, parent is null and
+ // the css lookup doesn't work. This will be used if parent is
+ // null.
+ public var styleParent:Object;
+
override public function set text(value:String):void
{
+ var sp:Object = parent;
+ if (!sp)
+ sp = styleParent;
+
var tf: TextFormat = new TextFormat();
- tf.font = ValuesManager.valuesImpl.getValue(parent, "fontFamily") as String;
- tf.size = ValuesManager.valuesImpl.getValue(parent, "fontSize");
- tf.bold = ValuesManager.valuesImpl.getValue(parent, "fontWeight") == "bold";
- tf.color = ValuesManager.valuesImpl.getValue(parent, "color");
- var padding:Object = ValuesManager.valuesImpl.getValue(parent, "padding");
+ tf.font = ValuesManager.valuesImpl.getValue(sp, "fontFamily") as String;
+ tf.size = ValuesManager.valuesImpl.getValue(sp, "fontSize");
+ tf.bold = ValuesManager.valuesImpl.getValue(sp, "fontWeight") == "bold";
+ tf.color = ValuesManager.valuesImpl.getValue(sp, "color");
+ var padding:Object = ValuesManager.valuesImpl.getValue(sp, "padding");
if (padding != null)
{
tf.leftMargin = padding;
http://git-wip-us.apache.org/repos/asf/flex-asjs/blob/d281aa92/frameworks/as/src/org/apache/flex/html/staticControls/beads/TextButtonBead.as
----------------------------------------------------------------------
diff --git a/frameworks/as/src/org/apache/flex/html/staticControls/beads/TextButtonBead.as b/frameworks/as/src/org/apache/flex/html/staticControls/beads/TextButtonBead.as
index 172c56e..8bdf2a9 100644
--- a/frameworks/as/src/org/apache/flex/html/staticControls/beads/TextButtonBead.as
+++ b/frameworks/as/src/org/apache/flex/html/staticControls/beads/TextButtonBead.as
@@ -78,6 +78,9 @@ package org.apache.flex.html.staticControls.beads
SimpleButton(value).downState = downTextField;
SimpleButton(value).overState = overTextField;
SimpleButton(value).hitTestState = shape;
+ upTextField.styleParent = value;
+ downTextField.styleParent = value;
+ overTextField.styleParent = value;
if (textModel.text !== null)
text = textModel.text;
if (textModel.html !== null)