royale-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From ha...@apache.org
Subject [royale-asjs] branch develop updated: Added Img
Date Mon, 04 Dec 2017 14:52:41 GMT
This is an automated email from the ASF dual-hosted git repository.

harbs pushed a commit to branch develop
in repository https://gitbox.apache.org/repos/asf/royale-asjs.git


The following commit(s) were added to refs/heads/develop by this push:
     new d3339b6  Added Img
d3339b6 is described below

commit d3339b6f83738ff33b2787b17a1e86f18814b643
Author: Harbs <harbs@in-tools.com>
AuthorDate: Mon Dec 4 16:52:27 2017 +0200

    Added Img
---
 .../HTML/src/main/resources/html-manifest.xml      |   1 +
 .../royale/org/apache/royale/html/elements/Img.as  | 127 +++++++++++++++++++++
 2 files changed, 128 insertions(+)

diff --git a/frameworks/projects/HTML/src/main/resources/html-manifest.xml b/frameworks/projects/HTML/src/main/resources/html-manifest.xml
index 9579093..9e9024a 100644
--- a/frameworks/projects/HTML/src/main/resources/html-manifest.xml
+++ b/frameworks/projects/HTML/src/main/resources/html-manifest.xml
@@ -41,6 +41,7 @@
     <component id="Strong" class="org.apache.royale.html.elements.Strong" />
     <component id="Div" class="org.apache.royale.html.elements.Div" />
     <component id="I" class="org.apache.royale.html.elements.I" />
+    <component id="Img" class="org.apache.royale.html.elements.Img" />
     <component id="Input" class="org.apache.royale.html.elements.Input" />
     <component id="Ul" class="org.apache.royale.html.elements.Ul" />
     <component id="Li" class="org.apache.royale.html.elements.Li" />
diff --git a/frameworks/projects/HTML/src/main/royale/org/apache/royale/html/elements/Img.as
b/frameworks/projects/HTML/src/main/royale/org/apache/royale/html/elements/Img.as
new file mode 100644
index 0000000..5ce543e
--- /dev/null
+++ b/frameworks/projects/HTML/src/main/royale/org/apache/royale/html/elements/Img.as
@@ -0,0 +1,127 @@
+////////////////////////////////////////////////////////////////////////////////
+//
+//  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.royale.html.elements
+{
+	import org.apache.royale.core.UIBase;
+
+    COMPILE::JS
+    {
+        import org.apache.royale.core.WrappedHTMLElement;
+		import org.apache.royale.html.util.addElementToWrapper;
+    }
+    import org.apache.royale.html.NodeElementBase;
+
+	/**
+	 *  The Img class represents an HTML <img> element
+     *  
+	 *  
+     *  @toplevel
+	 *  @langversion 3.0
+	 *  @playerversion Flash 10.2
+	 *  @playerversion AIR 2.6
+	 *  @productversion Royale 0.0
+	 */
+	public class Img extends NodeElementBase
+	{
+		/**
+		 *  constructor.
+		 *
+		 *  @langversion 3.0
+		 *  @playerversion Flash 10.2
+		 *  @playerversion AIR 2.6
+		 *  @productversion Royale 0.0
+		 */
+		public function Img()
+		{
+			super();
+		}
+
+        private var _src:String;
+        /**
+         *  The img src
+         *  
+         *  @langversion 3.0
+         *  @playerversion Flash 10.2
+         *  @playerversion AIR 2.6
+         *  @productversion Royale 0.9
+         */
+        public function get src():String
+        {
+            COMPILE::SWF
+            {
+                return _src;
+            }
+            COMPILE::JS
+            {
+                return (element as HTMLImageElement).src;
+            }
+        }
+        public function set src(value:String):void
+        {
+            COMPILE::SWF
+            {
+                _src = value;
+            }
+
+            COMPILE::JS
+            {
+                (element as HTMLImageElement).src = value;
+            }
+        }
+
+        private var _alt:String;
+        /**
+         *  The img alt
+         *  
+         *  @langversion 3.0
+         *  @playerversion Flash 10.2
+         *  @playerversion AIR 2.6
+         *  @productversion Royale 0.9
+         */
+        public function get alt():String
+        {
+            COMPILE::SWF
+            {
+                return _alt;
+            }
+            COMPILE::JS
+            {
+                return (element as HTMLImageElement).alt;
+            }
+        }
+        public function set alt(value:String):void
+        {
+            COMPILE::SWF
+            {
+                _alt = value;
+            }
+
+            COMPILE::JS
+            {
+                (element as HTMLImageElement).alt = value;
+            }
+        }		
+
+        COMPILE::JS
+        override protected function createElement():WrappedHTMLElement
+        {
+			return addElementToWrapper(this,'img');
+        }
+    }
+}

-- 
To stop receiving notification emails like this one, please contact
['"commits@royale.apache.org" <commits@royale.apache.org>'].

Mime
View raw message