You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@flex.apache.org by ca...@apache.org on 2016/11/04 16:43:27 UTC
[2/2] git commit: [flex-asjs] [refs/heads/develop] - Span and Div
html classes
Span and Div html classes
Project: http://git-wip-us.apache.org/repos/asf/flex-asjs/repo
Commit: http://git-wip-us.apache.org/repos/asf/flex-asjs/commit/5de45afe
Tree: http://git-wip-us.apache.org/repos/asf/flex-asjs/tree/5de45afe
Diff: http://git-wip-us.apache.org/repos/asf/flex-asjs/diff/5de45afe
Branch: refs/heads/develop
Commit: 5de45afe44c5520a0877b058d32734954a481f8b
Parents: 9a872c1
Author: Carlos Rovira <ca...@apache.org>
Authored: Fri Nov 4 17:41:49 2016 +0100
Committer: Carlos Rovira <ca...@apache.org>
Committed: Fri Nov 4 17:42:58 2016 +0100
----------------------------------------------------------------------
.../src/main/flex/org/apache/flex/html/Div.as | 112 +++++++++++++++++++
.../src/main/flex/org/apache/flex/html/Span.as | 112 +++++++++++++++++++
.../HTML/src/main/resources/basic-manifest.xml | 2 +
3 files changed, 226 insertions(+)
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/flex-asjs/blob/5de45afe/frameworks/projects/HTML/src/main/flex/org/apache/flex/html/Div.as
----------------------------------------------------------------------
diff --git a/frameworks/projects/HTML/src/main/flex/org/apache/flex/html/Div.as b/frameworks/projects/HTML/src/main/flex/org/apache/flex/html/Div.as
new file mode 100644
index 0000000..0e1815f
--- /dev/null
+++ b/frameworks/projects/HTML/src/main/flex/org/apache/flex/html/Div.as
@@ -0,0 +1,112 @@
+////////////////////////////////////////////////////////////////////////////////
+//
+// 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
+{
+ import org.apache.flex.core.UIBase;
+
+ COMPILE::JS
+ {
+ import org.apache.flex.core.WrappedHTMLElement;
+ }
+
+ /**
+ * The Div class represents an HTML <div> element
+ *
+ *
+ * @langversion 3.0
+ * @playerversion Flash 10.2
+ * @playerversion AIR 2.6
+ * @productversion FlexJS 0.0
+ */
+ public class Div extends UIBase
+ {
+ /**
+ * constructor.
+ *
+ * @langversion 3.0
+ * @playerversion Flash 10.2
+ * @playerversion AIR 2.6
+ * @productversion FlexJS 0.0
+ */
+ public function Div()
+ {
+ super();
+ }
+
+ private var _text:String = "";
+
+ /**
+ * 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
+ {
+ COMPILE::SWF
+ {
+ return _text;
+ }
+ COMPILE::JS
+ {
+ return textNode.nodeValue;
+ }
+ }
+
+ public function set text(value:String):void
+ {
+ COMPILE::SWF
+ {
+ _text = value;
+ }
+ COMPILE::JS
+ {
+ textNode.nodeValue = value;
+ }
+ }
+
+ COMPILE::JS
+ private var textNode:Text;
+
+ /**
+ * @flexjsignorecoercion org.apache.flex.core.WrappedHTMLElement
+ * @flexjsignorecoercion HTMLDivElement
+ */
+ COMPILE::JS
+ override protected function createElement():WrappedHTMLElement
+ {
+ var div:HTMLElement = document.createElement('div') as HTMLDivElement;
+
+ textNode = document.createTextNode('') as Text;
+ div.appendChild(textNode);
+
+ element = div as WrappedHTMLElement;
+
+ positioner = element;
+ positioner.style.position = 'relative';
+ element.flexjs_wrapper = this;
+
+ //className = typeNames = 'Div';
+
+ return element;
+ }
+ }
+}
http://git-wip-us.apache.org/repos/asf/flex-asjs/blob/5de45afe/frameworks/projects/HTML/src/main/flex/org/apache/flex/html/Span.as
----------------------------------------------------------------------
diff --git a/frameworks/projects/HTML/src/main/flex/org/apache/flex/html/Span.as b/frameworks/projects/HTML/src/main/flex/org/apache/flex/html/Span.as
new file mode 100644
index 0000000..91b94f7
--- /dev/null
+++ b/frameworks/projects/HTML/src/main/flex/org/apache/flex/html/Span.as
@@ -0,0 +1,112 @@
+////////////////////////////////////////////////////////////////////////////////
+//
+// 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
+{
+ import org.apache.flex.core.UIBase;
+
+ COMPILE::JS
+ {
+ import org.apache.flex.core.WrappedHTMLElement;
+ }
+
+ /**
+ * The Span class represents an HTML <span> element
+ *
+ *
+ * @langversion 3.0
+ * @playerversion Flash 10.2
+ * @playerversion AIR 2.6
+ * @productversion FlexJS 0.0
+ */
+ public class Span extends UIBase
+ {
+ /**
+ * constructor.
+ *
+ * @langversion 3.0
+ * @playerversion Flash 10.2
+ * @playerversion AIR 2.6
+ * @productversion FlexJS 0.0
+ */
+ public function Span()
+ {
+ super();
+ }
+
+ private var _text:String = "";
+
+ /**
+ * 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
+ {
+ COMPILE::SWF
+ {
+ return _text;
+ }
+ COMPILE::JS
+ {
+ return textNode.nodeValue;
+ }
+ }
+
+ public function set text(value:String):void
+ {
+ COMPILE::SWF
+ {
+ _text = value;
+ }
+ COMPILE::JS
+ {
+ textNode.nodeValue = value;
+ }
+ }
+
+ COMPILE::JS
+ private var textNode:Text;
+
+ /**
+ * @flexjsignorecoercion org.apache.flex.core.WrappedHTMLElement
+ * @flexjsignorecoercion HTMLSpanElement
+ */
+ COMPILE::JS
+ override protected function createElement():WrappedHTMLElement
+ {
+ var span:HTMLElement = document.createElement('span') as HTMLSpanElement;
+
+ textNode = document.createTextNode('') as Text;
+ span.appendChild(textNode);
+
+ element = span as WrappedHTMLElement;
+
+ positioner = element;
+ positioner.style.position = 'relative';
+ element.flexjs_wrapper = this;
+
+ className = typeNames = 'Span';
+
+ return element;
+ }
+ }
+}
http://git-wip-us.apache.org/repos/asf/flex-asjs/blob/5de45afe/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 8a09ce0..cf67089 100644
--- a/frameworks/projects/HTML/src/main/resources/basic-manifest.xml
+++ b/frameworks/projects/HTML/src/main/resources/basic-manifest.xml
@@ -136,5 +136,7 @@
<component id="H4" class="org.apache.flex.html.H4" />
<component id="H5" class="org.apache.flex.html.H5" />
<component id="H6" class="org.apache.flex.html.H6" />
+ <component id="Span" class="org.apache.flex.html.Span" />
+ <component id="Div" class="org.apache.flex.html.Div" />
</componentPackage>