Return-Path: X-Original-To: archive-asf-public-internal@cust-asf2.ponee.io Delivered-To: archive-asf-public-internal@cust-asf2.ponee.io Received: from cust-asf.ponee.io (cust-asf.ponee.io [163.172.22.183]) by cust-asf2.ponee.io (Postfix) with ESMTP id BEF7D200BDD for ; Fri, 4 Nov 2016 17:10:40 +0100 (CET) Received: by cust-asf.ponee.io (Postfix) id BDFA3160B13; Fri, 4 Nov 2016 16:10:40 +0000 (UTC) Delivered-To: archive-asf-public@cust-asf.ponee.io Received: from mail.apache.org (hermes.apache.org [140.211.11.3]) by cust-asf.ponee.io (Postfix) with SMTP id CF476160B14 for ; Fri, 4 Nov 2016 17:10:39 +0100 (CET) Received: (qmail 25153 invoked by uid 500); 4 Nov 2016 16:10:38 -0000 Mailing-List: contact commits-help@flex.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Reply-To: dev@flex.apache.org Delivered-To: mailing list commits@flex.apache.org Received: (qmail 24855 invoked by uid 99); 4 Nov 2016 16:10:38 -0000 Received: from git1-us-west.apache.org (HELO git1-us-west.apache.org) (140.211.11.23) by apache.org (qpsmtpd/0.29) with ESMTP; Fri, 04 Nov 2016 16:10:38 +0000 Received: by git1-us-west.apache.org (ASF Mail Server at git1-us-west.apache.org, from userid 33) id 6B0B2DFE5C; Fri, 4 Nov 2016 16:10:38 +0000 (UTC) Content-Type: text/plain; charset="us-ascii" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit From: carlosrovira@apache.org To: commits@flex.apache.org Date: Fri, 04 Nov 2016 16:10:49 -0000 Message-Id: In-Reply-To: <6c796cbf0329430c929398481f98a1e3@git.apache.org> References: <6c796cbf0329430c929398481f98a1e3@git.apache.org> X-Mailer: ASF-Git Admin Mailer Subject: [13/35] git commit: [flex-asjs] [refs/heads/feature/mdl] - MDL TextInput archived-at: Fri, 04 Nov 2016 16:10:40 -0000 MDL TextInput Project: http://git-wip-us.apache.org/repos/asf/flex-asjs/repo Commit: http://git-wip-us.apache.org/repos/asf/flex-asjs/commit/23dc31f1 Tree: http://git-wip-us.apache.org/repos/asf/flex-asjs/tree/23dc31f1 Diff: http://git-wip-us.apache.org/repos/asf/flex-asjs/diff/23dc31f1 Branch: refs/heads/feature/mdl Commit: 23dc31f14269afff391df8c7268843eaee6ddafb Parents: 14ab11d Author: Carlos Rovira Authored: Mon Oct 17 13:40:29 2016 +0200 Committer: Carlos Rovira Committed: Fri Nov 4 17:10:12 2016 +0100 ---------------------------------------------------------------------- .../main/flex/org/apache/flex/mdl/TextInput.as | 99 ++++++++++++++++++++ .../src/main/resources/mdl-manifest.xml | 2 +- 2 files changed, 100 insertions(+), 1 deletion(-) ---------------------------------------------------------------------- http://git-wip-us.apache.org/repos/asf/flex-asjs/blob/23dc31f1/frameworks/projects/MaterialDesignLite/src/main/flex/org/apache/flex/mdl/TextInput.as ---------------------------------------------------------------------- diff --git a/frameworks/projects/MaterialDesignLite/src/main/flex/org/apache/flex/mdl/TextInput.as b/frameworks/projects/MaterialDesignLite/src/main/flex/org/apache/flex/mdl/TextInput.as new file mode 100644 index 0000000..dace484 --- /dev/null +++ b/frameworks/projects/MaterialDesignLite/src/main/flex/org/apache/flex/mdl/TextInput.as @@ -0,0 +1,99 @@ +// +// 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.mdl +{ + import org.apache.flex.html.TextInput; + + COMPILE::JS + { + import goog.events; + import org.apache.flex.core.WrappedHTMLElement; + } + + /** + * The TextInput class provides a Material Design Library UI-like appearance for + * a TextInput. + * + * @langversion 3.0 + * @playerversion Flash 10.2 + * @playerversion AIR 2.6 + * @productversion FlexJS 0.0 + */ + public class TextInput extends org.apache.flex.html.TextInput + { + /** + * Constructor. + * + * @langversion 3.0 + * @playerversion Flash 10.2 + * @playerversion AIR 2.6 + * @productversion FlexJS 0.0 + */ + public function TextInput() + { + super(); + } + + /** + * @flexjsignorecoercion org.apache.flex.core.WrappedHTMLElement + */ + COMPILE::JS + override protected function createElement():WrappedHTMLElement + { + var div:HTMLDivElement; + var input:HTMLInputElement; + var label:HTMLLabelElement; + var textNode:Text; + //element = document.createElement('input') as WrappedHTMLElement; + + div = document.createElement('div') as HTMLDivElement; + div.className = "mdl-textfield mdl-js-textfield"; + + input = document.createElement('input') as HTMLInputElement; + input.setAttribute('type', 'text'); + input.className = 'mdl-textfield__input'; + + label = document.createElement('label') as HTMLLabelElement; + label.className = "mdl-textfield__label"; + + textNode = document.createTextNode('Text...') as Text; + label.appendChild(textNode); + //element.className = 'TextInput'; + //typeNames = 'TextInput'; + + div.appendChild(input); + div.appendChild(label); + + element = div as WrappedHTMLElement; + + //attach input handler to dispatch flexjs change event when user write in textinput + //goog.events.listen(element, 'change', killChangeHandler); + goog.events.listen(input, 'input', textChangeHandler); + + positioner = element; + positioner.style.position = 'relative'; + (div as WrappedHTMLElement).flexjs_wrapper = this; + (input as WrappedHTMLElement).flexjs_wrapper = this; + (label as WrappedHTMLElement).flexjs_wrapper = this; + element.flexjs_wrapper = this; + + return element; + } + + } +} http://git-wip-us.apache.org/repos/asf/flex-asjs/blob/23dc31f1/frameworks/projects/MaterialDesignLite/src/main/resources/mdl-manifest.xml ---------------------------------------------------------------------- diff --git a/frameworks/projects/MaterialDesignLite/src/main/resources/mdl-manifest.xml b/frameworks/projects/MaterialDesignLite/src/main/resources/mdl-manifest.xml index 897aab5..eb65435 100644 --- a/frameworks/projects/MaterialDesignLite/src/main/resources/mdl-manifest.xml +++ b/frameworks/projects/MaterialDesignLite/src/main/resources/mdl-manifest.xml @@ -22,6 +22,6 @@ - +