Repository: flex-asjs
Updated Branches:
  refs/heads/develop 11107053d -> b34796eea


CardTitleText


Project: http://git-wip-us.apache.org/repos/asf/flex-asjs/repo
Commit: http://git-wip-us.apache.org/repos/asf/flex-asjs/commit/b34796ee
Tree: http://git-wip-us.apache.org/repos/asf/flex-asjs/tree/b34796ee
Diff: http://git-wip-us.apache.org/repos/asf/flex-asjs/diff/b34796ee

Branch: refs/heads/develop
Commit: b34796eea359c22907d70db0a28a86a4de4f64ab
Parents: 1110705
Author: Carlos Rovira <carlosrov...@apache.org>
Authored: Tue Nov 22 23:21:50 2016 +0100
Committer: Carlos Rovira <carlosrov...@apache.org>
Committed: Tue Nov 22 23:21:50 2016 +0100

----------------------------------------------------------------------
 .../flexjs/MDLExample/src/main/flex/App.mxml    |   4 +-
 .../src/main/resources/assets/Unknown.jpg       | Bin 50531 -> 0 bytes
 .../src/main/resources/assets/welcome_card.jpg  | Bin 0 -> 50531 bytes
 .../src/main/resources/mdl-styles.css           |   9 +--
 .../flex/org/apache/flex/mdl/CardTitleText.as   |  78 +++++++++++++++++++
 .../src/main/resources/mdl-manifest.xml         |   1 +
 6 files changed, 85 insertions(+), 7 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/flex-asjs/blob/b34796ee/examples/flexjs/MDLExample/src/main/flex/App.mxml
----------------------------------------------------------------------
diff --git a/examples/flexjs/MDLExample/src/main/flex/App.mxml 
b/examples/flexjs/MDLExample/src/main/flex/App.mxml
index 0045f75..ea433fe 100644
--- a/examples/flexjs/MDLExample/src/main/flex/App.mxml
+++ b/examples/flexjs/MDLExample/src/main/flex/App.mxml
@@ -187,8 +187,8 @@ limitations under the License.
                             </js:VContainer>
 
                             <mdl:Card width="512" shadow="2" 
style="margin:10;">
-                                <mdl:CardTitle className="cardTitle">
-                                    <js:H2 text="Welcome" 
className="mdl-card__title-text"/>
+                                <mdl:CardTitle>
+                                    <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..."/>

http://git-wip-us.apache.org/repos/asf/flex-asjs/blob/b34796ee/examples/flexjs/MDLExample/src/main/resources/assets/Unknown.jpg
----------------------------------------------------------------------
diff --git a/examples/flexjs/MDLExample/src/main/resources/assets/Unknown.jpg 
b/examples/flexjs/MDLExample/src/main/resources/assets/Unknown.jpg
deleted file mode 100644
index 08fb201..0000000
Binary files a/examples/flexjs/MDLExample/src/main/resources/assets/Unknown.jpg 
and /dev/null differ

http://git-wip-us.apache.org/repos/asf/flex-asjs/blob/b34796ee/examples/flexjs/MDLExample/src/main/resources/assets/welcome_card.jpg
----------------------------------------------------------------------
diff --git 
a/examples/flexjs/MDLExample/src/main/resources/assets/welcome_card.jpg 
b/examples/flexjs/MDLExample/src/main/resources/assets/welcome_card.jpg
new file mode 100644
index 0000000..08fb201
Binary files /dev/null and 
b/examples/flexjs/MDLExample/src/main/resources/assets/welcome_card.jpg differ

http://git-wip-us.apache.org/repos/asf/flex-asjs/blob/b34796ee/examples/flexjs/MDLExample/src/main/resources/mdl-styles.css
----------------------------------------------------------------------
diff --git a/examples/flexjs/MDLExample/src/main/resources/mdl-styles.css 
b/examples/flexjs/MDLExample/src/main/resources/mdl-styles.css
index e8e05a8..094d14f 100644
--- a/examples/flexjs/MDLExample/src/main/resources/mdl-styles.css
+++ b/examples/flexjs/MDLExample/src/main/resources/mdl-styles.css
@@ -40,11 +40,10 @@ Image
        IBeadView:  ClassReference("org.apache.flex.html.beads.ImageView");
 }
 
-.cardTitle
-{
-       color: #fff;
-       height: 176px;
-       background: url('assets/Unknown.jpg') center / cover;
+.mdl-card__title {
+  color: #fff;
+  height: 176px;
+  background: url('assets/welcome_card.jpg') center / cover;
 }
 
 .dogTitle

http://git-wip-us.apache.org/repos/asf/flex-asjs/blob/b34796ee/frameworks/projects/MaterialDesignLite/src/main/flex/org/apache/flex/mdl/CardTitleText.as
----------------------------------------------------------------------
diff --git 
a/frameworks/projects/MaterialDesignLite/src/main/flex/org/apache/flex/mdl/CardTitleText.as
 
b/frameworks/projects/MaterialDesignLite/src/main/flex/org/apache/flex/mdl/CardTitleText.as
new file mode 100644
index 0000000..466f8db
--- /dev/null
+++ 
b/frameworks/projects/MaterialDesignLite/src/main/flex/org/apache/flex/mdl/CardTitleText.as
@@ -0,0 +1,78 @@
+////////////////////////////////////////////////////////////////////////////////
+//
+//  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.H2;
+
+    COMPILE::JS
+    {
+        import org.apache.flex.core.WrappedHTMLElement;            
+    }
+
+       /**
+        *  The CardTitleText class represents an HTML <h2> element
+     *  used for Title in CardTitle
+     *  
+        *  
+        *  @langversion 3.0
+        *  @playerversion Flash 10.2
+        *  @playerversion AIR 2.6
+        *  @productversion FlexJS 0.0
+        */
+       public class CardTitleText extends H2
+       {
+               /**
+                *  constructor.
+                *
+                *  @langversion 3.0
+                *  @playerversion Flash 10.2
+                *  @playerversion AIR 2.6
+                *  @productversion FlexJS 0.0
+                */
+               public function CardTitleText()
+               {
+                       super();
+
+            className = ""; //set to empty string avoid 'undefined' output 
when no class selector is assigned by user;
+               }
+               
+        /**
+         * @flexjsignorecoercion org.apache.flex.core.WrappedHTMLElement
+                * @flexjsignorecoercion HTMLElement
+         */
+        COMPILE::JS
+        override protected function createElement():WrappedHTMLElement
+        {
+            typeNames = "mdl-card__title-text";
+
+                       var h2:HTMLElement = document.createElement('h2') as 
HTMLElement;
+            
+            textNode = document.createTextNode('') as Text;
+            h2.appendChild(textNode); 
+
+                       element = h2 as WrappedHTMLElement;
+            element.className = typeNames;
+
+            positioner = element;
+                       element.flexjs_wrapper = this;
+            
+            return element;
+        }
+    }
+}

http://git-wip-us.apache.org/repos/asf/flex-asjs/blob/b34796ee/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 31452d1..7786a7c 100644
--- a/frameworks/projects/MaterialDesignLite/src/main/resources/mdl-manifest.xml
+++ b/frameworks/projects/MaterialDesignLite/src/main/resources/mdl-manifest.xml
@@ -35,6 +35,7 @@
     <component id="Card" class="org.apache.flex.mdl.Card"/>
     <component id="CardInner" 
class="org.apache.flex.mdl.supportClasses.CardInner"/>
     <component id="CardTitle" class="org.apache.flex.mdl.CardTitle"/>
+    <component id="CardTitleText" class="org.apache.flex.mdl.CardTitleText"/>
     <component id="CardSupportingText" 
class="org.apache.flex.mdl.CardSupportingText"/>
     <component id="CardMedia" class="org.apache.flex.mdl.CardMedia"/>
     <component id="CardActions" class="org.apache.flex.mdl.CardActions"/>

Reply via email to