Repository: flex-asjs Updated Branches: refs/heads/develop f13dedc39 -> 5f3c1015b
A bead to insert innerHTML text in a component element Project: http://git-wip-us.apache.org/repos/asf/flex-asjs/repo Commit: http://git-wip-us.apache.org/repos/asf/flex-asjs/commit/5f3c1015 Tree: http://git-wip-us.apache.org/repos/asf/flex-asjs/tree/5f3c1015 Diff: http://git-wip-us.apache.org/repos/asf/flex-asjs/diff/5f3c1015 Branch: refs/heads/develop Commit: 5f3c1015bf6b70d74e1c1caf1add3272bedc8395 Parents: f13dedc Author: Carlos Rovira <[email protected]> Authored: Sun Dec 11 09:58:49 2016 +0100 Committer: Carlos Rovira <[email protected]> Committed: Sun Dec 11 09:58:49 2016 +0100 ---------------------------------------------------------------------- .../flexjs/MDLExample/src/main/flex/Cards.mxml | 12 ++- frameworks/projects/HTML/.vscode/tasks.json | 10 ++ .../org/apache/flex/html/beads/InnerText.as | 98 ++++++++++++++++++++ .../HTML/src/main/resources/basic-manifest.xml | 2 + 4 files changed, 120 insertions(+), 2 deletions(-) ---------------------------------------------------------------------- http://git-wip-us.apache.org/repos/asf/flex-asjs/blob/5f3c1015/examples/flexjs/MDLExample/src/main/flex/Cards.mxml ---------------------------------------------------------------------- diff --git a/examples/flexjs/MDLExample/src/main/flex/Cards.mxml b/examples/flexjs/MDLExample/src/main/flex/Cards.mxml index dbb126c..72296cd 100644 --- a/examples/flexjs/MDLExample/src/main/flex/Cards.mxml +++ b/examples/flexjs/MDLExample/src/main/flex/Cards.mxml @@ -29,7 +29,13 @@ limitations under the License. <mdl:CardTitleText text="Welcome"/> </mdl:CardTitle> <mdl:CardSupportingText> - <js:MultilineLabel text="Lorem ipsum dolor sit amet, consectetur adipiscing elit. Mauris sagittis pellentesque lacus eleifend lacinia..."/> + <js:beads> + <js:InnerText> + <![CDATA[ + Lorem ipsum dolor sit <b>amet</b>, consectetur <i>adipiscing elit</i>. Mauris sagittis pellentesque lacus eleifend lacinia... + ]]> + </js:InnerText> + </js:beads> </mdl:CardSupportingText> <mdl:CardActions border="true"> <mdl:Button text="Get Started" ripple="true" colored="true"/> @@ -46,7 +52,9 @@ limitations under the License. <mdl:CardTitleText text="Update"/> </mdl:CardTitle> <mdl:CardSupportingText> - <js:MultilineLabel text="Lorem ipsum dolor sit amet, consectetur adipiscing elit. Aenan convallis."/> + <js:beads> + <js:InnerText text="Lorem ipsum dolor sit amet, consectetur adipiscing elit. Aenan convallis."/> + </js:beads> </mdl:CardSupportingText> <mdl:CardActions border="true"> <mdl:Button colored="true" ripple="true" text="View Updates"/> http://git-wip-us.apache.org/repos/asf/flex-asjs/blob/5f3c1015/frameworks/projects/HTML/.vscode/tasks.json ---------------------------------------------------------------------- diff --git a/frameworks/projects/HTML/.vscode/tasks.json b/frameworks/projects/HTML/.vscode/tasks.json new file mode 100644 index 0000000..c207148 --- /dev/null +++ b/frameworks/projects/HTML/.vscode/tasks.json @@ -0,0 +1,10 @@ +{ + // See https://go.microsoft.com/fwlink/?LinkId=733558 + // for the documentation about the tasks.json format + //"--flexHome=/Users/carlosrovira/Dev/Flex/sdks/flexjs-0.8.0" + "version": "0.1.0", + "command": "mvn", + "args": ["clean", "install", "-DskipTests"], + "isShellCommand": true, + "showOutput": "always" +} \ No newline at end of file http://git-wip-us.apache.org/repos/asf/flex-asjs/blob/5f3c1015/frameworks/projects/HTML/src/main/flex/org/apache/flex/html/beads/InnerText.as ---------------------------------------------------------------------- diff --git a/frameworks/projects/HTML/src/main/flex/org/apache/flex/html/beads/InnerText.as b/frameworks/projects/HTML/src/main/flex/org/apache/flex/html/beads/InnerText.as new file mode 100644 index 0000000..fe1097d --- /dev/null +++ b/frameworks/projects/HTML/src/main/flex/org/apache/flex/html/beads/InnerText.as @@ -0,0 +1,98 @@ +//////////////////////////////////////////////////////////////////////////////// +// +// 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.html.beads +{ + import org.apache.flex.core.IBead; + import org.apache.flex.core.IStrand; + import org.apache.flex.core.UIBase; + + [DefaultProperty("text")] + + /** + * The InnerText bead class adds innetHTML text to a html tag. + * + * @langversion 3.0 + * @playerversion Flash 10.2 + * @playerversion AIR 2.6 + * @productversion FlexJS 0.0 + */ + public class InnerText implements IBead + { + /** + * constructor. + * + * @langversion 3.0 + * @playerversion Flash 10.2 + * @playerversion AIR 2.6 + * @productversion FlexJS 0.0 + */ + public function InnerText() + { + super(); + } + + private var _text:String = null; + + /** + * The text of the heading + * + * @langversion 3.0 + * @playerversion Flash 10.2 + * @playerversion AIR 2.6 + * @productversion FlexJS 0.0 + */ + public function get text():String + { + return _text; + } + + public function set text(value:String):void + { + _text = value; + } + + private var host:UIBase; + + private var _strand:IStrand; + /** + * @copy org.apache.flex.core.IBead#strand + * + * @langversion 3.0 + * @playerversion Flash 10.2 + * @playerversion AIR 2.6 + * @productversion FlexJS 0.0 + * @flexjsignorecoercion org.apache.flex.mdl.TextInput; + */ + public function set strand(value:IStrand):void + { + _strand = value; + + host = value as UIBase; + + if(_text != null && _text != "" && host != null) + { + COMPILE::JS + { + var e:HTMLElement = host.element as HTMLElement; + e.innerHTML = _text; + } + } + } + } +} \ No newline at end of file http://git-wip-us.apache.org/repos/asf/flex-asjs/blob/5f3c1015/frameworks/projects/HTML/src/main/resources/basic-manifest.xml ---------------------------------------------------------------------- diff --git a/frameworks/projects/HTML/src/main/resources/basic-manifest.xml b/frameworks/projects/HTML/src/main/resources/basic-manifest.xml index 36570e5..443e42b 100644 --- a/frameworks/projects/HTML/src/main/resources/basic-manifest.xml +++ b/frameworks/projects/HTML/src/main/resources/basic-manifest.xml @@ -151,4 +151,6 @@ <component id="Ul" class="org.apache.flex.html.Ul" /> <component id="Li" class="org.apache.flex.html.Li" /> + <component id="InnerText" class="org.apache.flex.html.beads.InnerText" /> + </componentPackage>
