You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@royale.apache.org by ha...@apache.org on 2017/12/04 18:22:44 UTC

[royale-asjs] branch develop updated: Added basic properties to Input

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 1698d74  Added basic properties to Input
1698d74 is described below

commit 1698d749570b7aab583d4381361c13e563ff08ff
Author: Harbs <ha...@in-tools.com>
AuthorDate: Mon Dec 4 20:22:34 2017 +0200

    Added basic properties to Input
    
    I’m not sure how crazy to go on that…
---
 .../org/apache/royale/html/elements/Input.as       | 194 ++++++++++++++++++---
 1 file changed, 173 insertions(+), 21 deletions(-)

diff --git a/frameworks/projects/HTML/src/main/royale/org/apache/royale/html/elements/Input.as b/frameworks/projects/HTML/src/main/royale/org/apache/royale/html/elements/Input.as
index f9e9f2b..34414a7 100644
--- a/frameworks/projects/HTML/src/main/royale/org/apache/royale/html/elements/Input.as
+++ b/frameworks/projects/HTML/src/main/royale/org/apache/royale/html/elements/Input.as
@@ -52,40 +52,149 @@ package org.apache.royale.html.elements
 			super();
 		}
 		
-        private var _text:String = "";
+        COMPILE::JS
+        private function get input():HTMLInputElement
+        {
+            return element as HTMLInputElement;
+        }
 
+		COMPILE::SWF
+        private var _autofocus:Boolean;
         /**
-         *  The current value of the control
+         *  Whether the input is autofocused
          *  
          *  @langversion 3.0
          *  @playerversion Flash 10.2
          *  @playerversion AIR 2.6
          *  @productversion Royale 0.9
          */
-		public function get value():String
-		{
+        public function get autofocus():Boolean
+        {
             COMPILE::SWF
             {
-                return _text;
+                return _autofocus;
             }
+
             COMPILE::JS
             {
-                return (element as HTMLInputElement).value;
+                return input.autofocus;
             }
-		}
+        }
+        public function set autofocus(value:Boolean):void
+        {
+            COMPILE::SWF
+            {
+                _autofocus = value;
+            }
+            COMPILE::JS
+            {
+                input.autofocus = value;
+            }
+        }
 
-		public function set value(value:String):void
-		{
+		COMPILE::SWF
+        private var _disabled:Boolean;
+        /**
+         *  Whether the input is disabled
+         *  
+         *  @langversion 3.0
+         *  @playerversion Flash 10.2
+         *  @playerversion AIR 2.6
+         *  @productversion Royale 0.9
+         */
+        public function get disabled():Boolean
+        {
             COMPILE::SWF
             {
-                _text = value;
+                return _disabled;
             }
+
             COMPILE::JS
             {
-                (element as HTMLInputElement).value = value;
+                return input.disabled;
             }
-		}
-		
+        }
+        public function set disabled(value:Boolean):void
+        {
+            COMPILE::SWF
+            {
+                _disabled = value;
+            }
+            COMPILE::JS
+            {
+                input.disabled = value;
+            }
+        }
+
+		COMPILE::SWF
+        private var _name:String;
+        /**
+         *  The input name
+         *  
+         *  @langversion 3.0
+         *  @playerversion Flash 10.2
+         *  @playerversion AIR 2.6
+         *  @productversion Royale 0.9
+         */
+        public function get name():String
+        {
+            COMPILE::SWF
+            {
+                return _name;
+            }
+
+            COMPILE::JS
+            {
+                return input.name;
+            }
+        }
+        public function set name(value:String):void
+        {
+            COMPILE::SWF
+            {
+                _name = value;
+            }
+            COMPILE::JS
+            {
+                input.name = value;
+            }
+        }
+
+		COMPILE::SWF
+        private var _required:Boolean;
+        /**
+         *  Whether the input is required
+         *  
+         *  @langversion 3.0
+         *  @playerversion Flash 10.2
+         *  @playerversion AIR 2.6
+         *  @productversion Royale 0.9
+         */
+        public function get required():Boolean
+        {
+            COMPILE::SWF
+            {
+                return _required;
+            }
+
+            COMPILE::JS
+            {
+                return input.required;
+            }
+        }
+        public function set required(value:Boolean):void
+        {
+            COMPILE::SWF
+            {
+                _required = value;
+            }
+            COMPILE::JS
+            {
+                input.required = value;
+            }
+        }
+
+		COMPILE::SWF
         private var _type:String;
         /**
          *  The input type
@@ -97,25 +206,68 @@ package org.apache.royale.html.elements
          */
         public function get type():String
         {
-            return _type;
+            COMPILE::SWF
+            {
+                return _type;
+            }
+
+            COMPILE::JS
+            {
+                return input.type;
+            }
         }
         public function set type(value:String):void
         {
-            _type = value;
+            COMPILE::SWF
+            {
+                _type = value;
+            }
             COMPILE::JS
             {
-                if(element)
-                    element.setAttribute('type', value);
+                input.type = value;
             }
         }
+
+        COMPILE::SWF
+        private var _value:String = "";
+
+        /**
+         *  The current value of the control
+         *  
+         *  @langversion 3.0
+         *  @playerversion Flash 10.2
+         *  @playerversion AIR 2.6
+         *  @productversion Royale 0.9
+         */
+		public function get value():String
+		{
+            COMPILE::SWF
+            {
+                return _value;
+            }
+            COMPILE::JS
+            {
+                return input.value;
+            }
+		}
+
+		public function set value(value:String):void
+		{
+            COMPILE::SWF
+            {
+                _value = value;
+            }
+            COMPILE::JS
+            {
+                input.value = value;
+            }
+		}
+
         
         COMPILE::JS
         override protected function createElement():WrappedHTMLElement
         {
-			addElementToWrapper(this,'input');
-            if(_type)
-                element.setAttribute('type', _type);
-            return element;
+			return addElementToWrapper(this,'input');
         }
     }
 }

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