You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@flex.apache.org by pi...@apache.org on 2017/01/05 10:29:34 UTC

[12/16] git commit: [flex-asjs] [refs/heads/feature/fontawesome] - More Footer comps

More Footer comps


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

Branch: refs/heads/feature/fontawesome
Commit: dee04ad0250de10c34492a3ef35609acf07cc375
Parents: 4ace81c
Author: Carlos Rovira <ca...@apache.org>
Authored: Wed Jan 4 23:54:41 2017 +0100
Committer: Carlos Rovira <ca...@apache.org>
Committed: Wed Jan 4 23:54:41 2017 +0100

----------------------------------------------------------------------
 .../MDLExample/src/main/flex/MainFooter.mxml    |  42 ++++++++
 .../src/main/flex/MainNavigation.mxml           |   9 +-
 .../org/apache/flex/mdl/FooterBottomSection.as  | 107 +++++++++++++++++++
 .../main/flex/org/apache/flex/mdl/FooterLogo.as |  99 +++++++++++++++++
 .../org/apache/flex/mdl/FooterTopSection.as     | 107 +++++++++++++++++++
 .../src/main/resources/mdl-manifest.xml         |   4 +
 6 files changed, 361 insertions(+), 7 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/flex-asjs/blob/dee04ad0/examples/flexjs/MDLExample/src/main/flex/MainFooter.mxml
----------------------------------------------------------------------
diff --git a/examples/flexjs/MDLExample/src/main/flex/MainFooter.mxml b/examples/flexjs/MDLExample/src/main/flex/MainFooter.mxml
new file mode 100644
index 0000000..ec950c6
--- /dev/null
+++ b/examples/flexjs/MDLExample/src/main/flex/MainFooter.mxml
@@ -0,0 +1,42 @@
+<?xml version="1.0" encoding="utf-8"?>
+<!--
+
+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.
+
+-->
+<mdl:Footer xmlns:fx="http://ns.adobe.com/mxml/2009"
+            xmlns:js="library://ns.apache.org/flexjs/basic"
+            xmlns:local="*"
+            xmlns:mdl="library://ns.apache.org/flexjs/mdl"
+            xmlns="http://www.w3.org/1999/xhtml"
+            xmlns:models="models.*"
+            mini="true">
+      
+    <mdl:FooterLeftSection>
+        <mdl:FooterLogo text="Title"/>
+        <!--<mdl:List className="mdl-mini-footer__link-list">
+            <mdl:beads>
+                <js:ConstantBinding
+                    sourceID="model"
+                    sourcePropertyName="things"
+                    destinationPropertyName="dataProvider" />
+            </mdl:beads>
+        </mdl:List>-->
+    </mdl:FooterLeftSection>
+
+    <mdl:FooterRightSection>
+    </mdl:FooterRightSection>
+</mdl:Footer>
\ No newline at end of file

http://git-wip-us.apache.org/repos/asf/flex-asjs/blob/dee04ad0/examples/flexjs/MDLExample/src/main/flex/MainNavigation.mxml
----------------------------------------------------------------------
diff --git a/examples/flexjs/MDLExample/src/main/flex/MainNavigation.mxml b/examples/flexjs/MDLExample/src/main/flex/MainNavigation.mxml
index d32f555..028975d 100644
--- a/examples/flexjs/MDLExample/src/main/flex/MainNavigation.mxml
+++ b/examples/flexjs/MDLExample/src/main/flex/MainNavigation.mxml
@@ -120,11 +120,6 @@ limitations under the License.
         
     </mdl:NavigationLayoutContent>
 
-    <mdl:Footer mini="true">
-        <mdl:FooterLeftSection>
-        </mdl:FooterLeftSection>
-
-        <mdl:FooterRightSection>
-        </mdl:FooterRightSection>
-    </mdl:Footer>
+    <local:MainFooter/>
+    
 </mdl:NavigationLayout>
\ No newline at end of file

http://git-wip-us.apache.org/repos/asf/flex-asjs/blob/dee04ad0/frameworks/projects/MaterialDesignLite/src/main/flex/org/apache/flex/mdl/FooterBottomSection.as
----------------------------------------------------------------------
diff --git a/frameworks/projects/MaterialDesignLite/src/main/flex/org/apache/flex/mdl/FooterBottomSection.as b/frameworks/projects/MaterialDesignLite/src/main/flex/org/apache/flex/mdl/FooterBottomSection.as
new file mode 100644
index 0000000..4bfd810
--- /dev/null
+++ b/frameworks/projects/MaterialDesignLite/src/main/flex/org/apache/flex/mdl/FooterBottomSection.as
@@ -0,0 +1,107 @@
+////////////////////////////////////////////////////////////////////////////////
+//
+//  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.core.ContainerBase;
+    
+    COMPILE::JS
+    {
+        import org.apache.flex.core.WrappedHTMLElement;
+    }
+    
+	/**
+	 *  The FooterBottomSection class is a Container component capable of parenting other
+	 *  components 
+	 *  
+	 *  @langversion 3.0
+	 *  @playerversion Flash 10.2
+	 *  @playerversion AIR 2.6
+	 *  @productversion FlexJS 0.0
+	 */
+	public class FooterBottomSection extends ContainerBase
+	{
+		/**
+		 *  constructor.
+		 *
+		 *  @langversion 3.0
+		 *  @playerversion Flash 10.2
+		 *  @playerversion AIR 2.6
+		 *  @productversion FlexJS 0.0
+		 */
+		public function FooterBottomSection()
+		{
+			super();
+
+			className = ""; //set to empty string avoid 'undefined' output when no class selector is assigned by user;
+		}
+		
+        /**
+         * @flexjsignorecoercion org.apache.flex.core.WrappedHTMLElement
+         */
+        COMPILE::JS
+        override protected function createElement():WrappedHTMLElement
+        {
+			typeNames = "mdl-mega-footer__bottom-section";
+
+            element = document.createElement('div') as WrappedHTMLElement;
+            
+			positioner = element;
+            
+            // absolute positioned children need a non-null
+            // position value in the parent.  It might
+            // get set to 'absolute' if the container is
+            // also absolutely positioned
+            element.flexjs_wrapper = this;
+
+            return element;
+        }
+
+		/**
+         *  Configuration depends on parent Footer.
+		 *  Check to see if is mega or mini.
+         *  
+         *  @langversion 3.0
+         *  @playerversion Flash 10.2
+         *  @playerversion AIR 2.6
+         *  @productversion FlexJS 0.0
+        */ 
+		COMPILE::JS
+		override public function addedToParent():void
+        {
+			super.addedToParent();
+
+			if(parent is Footer)
+			{
+				element.classList.remove(typeNames);
+				if(!Footer(parent).mini)
+				{
+					typeNames = "mdl-mega-footer__bottom-section";
+				} else
+				{
+					typeNames = "mdl-mini-footer__bottom-section";
+				}
+				element.classList.add(typeNames);
+			}
+			else
+			{
+				throw new Error("FooterBottomSection can not be used if parent is not a MDL Footer component.");
+			}			
+        }
+	}
+}

http://git-wip-us.apache.org/repos/asf/flex-asjs/blob/dee04ad0/frameworks/projects/MaterialDesignLite/src/main/flex/org/apache/flex/mdl/FooterLogo.as
----------------------------------------------------------------------
diff --git a/frameworks/projects/MaterialDesignLite/src/main/flex/org/apache/flex/mdl/FooterLogo.as b/frameworks/projects/MaterialDesignLite/src/main/flex/org/apache/flex/mdl/FooterLogo.as
new file mode 100644
index 0000000..681c202
--- /dev/null
+++ b/frameworks/projects/MaterialDesignLite/src/main/flex/org/apache/flex/mdl/FooterLogo.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.Div;
+    
+    COMPILE::JS
+    {
+        import org.apache.flex.core.WrappedHTMLElement;
+    }
+    
+	/**
+	 *  The FooterLogo class is a Container component capable of parenting other
+	 *  components 
+	 *  
+	 *  @langversion 3.0
+	 *  @playerversion Flash 10.2
+	 *  @playerversion AIR 2.6
+	 *  @productversion FlexJS 0.0
+	 */
+	public class FooterLogo extends Div
+	{
+		/**
+		 *  constructor.
+		 *
+		 *  @langversion 3.0
+		 *  @playerversion Flash 10.2
+		 *  @playerversion AIR 2.6
+		 *  @productversion FlexJS 0.0
+		 */
+		public function FooterLogo()
+		{
+			super();
+
+			className = ""; //set to empty string avoid 'undefined' output when no class selector is assigned by user;
+		}
+		
+        /**
+         * @flexjsignorecoercion org.apache.flex.core.WrappedHTMLElement
+         */
+        COMPILE::JS
+        override protected function createElement():WrappedHTMLElement
+        {
+			typeNames = "mdl-logo";
+
+            element = document.createElement('div') as WrappedHTMLElement;
+            
+			positioner = element;
+            
+            // absolute positioned children need a non-null
+            // position value in the parent.  It might
+            // get set to 'absolute' if the container is
+            // also absolutely positioned
+            element.flexjs_wrapper = this;
+
+            return element;
+        }
+
+		/**
+         *  Configuration depends on parent Footer.
+		 *  Check to see if is mega or mini.
+         *  
+         *  @langversion 3.0
+         *  @playerversion Flash 10.2
+         *  @playerversion AIR 2.6
+         *  @productversion FlexJS 0.0
+        */ 
+		COMPILE::JS
+		override public function addedToParent():void
+        {
+			super.addedToParent();
+
+			if(parent is FooterLeftSection || parent is FooterBottomSection)
+			{
+				//ok
+			}
+			else
+			{
+				throw new Error("FooterLeftSection can not be used if parent is not a MDL Footer component.");
+			}			
+        }
+	}
+}

http://git-wip-us.apache.org/repos/asf/flex-asjs/blob/dee04ad0/frameworks/projects/MaterialDesignLite/src/main/flex/org/apache/flex/mdl/FooterTopSection.as
----------------------------------------------------------------------
diff --git a/frameworks/projects/MaterialDesignLite/src/main/flex/org/apache/flex/mdl/FooterTopSection.as b/frameworks/projects/MaterialDesignLite/src/main/flex/org/apache/flex/mdl/FooterTopSection.as
new file mode 100644
index 0000000..5f26e7f
--- /dev/null
+++ b/frameworks/projects/MaterialDesignLite/src/main/flex/org/apache/flex/mdl/FooterTopSection.as
@@ -0,0 +1,107 @@
+////////////////////////////////////////////////////////////////////////////////
+//
+//  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.core.ContainerBase;
+    
+    COMPILE::JS
+    {
+        import org.apache.flex.core.WrappedHTMLElement;
+    }
+    
+	/**
+	 *  The FooterTopSection class is a Container component capable of parenting other
+	 *  components 
+	 *  
+	 *  @langversion 3.0
+	 *  @playerversion Flash 10.2
+	 *  @playerversion AIR 2.6
+	 *  @productversion FlexJS 0.0
+	 */
+	public class FooterTopSection extends ContainerBase
+	{
+		/**
+		 *  constructor.
+		 *
+		 *  @langversion 3.0
+		 *  @playerversion Flash 10.2
+		 *  @playerversion AIR 2.6
+		 *  @productversion FlexJS 0.0
+		 */
+		public function FooterTopSection()
+		{
+			super();
+
+			className = ""; //set to empty string avoid 'undefined' output when no class selector is assigned by user;
+		}
+		
+        /**
+         * @flexjsignorecoercion org.apache.flex.core.WrappedHTMLElement
+         */
+        COMPILE::JS
+        override protected function createElement():WrappedHTMLElement
+        {
+			typeNames = "mdl-mega-footer__top-section";
+
+            element = document.createElement('div') as WrappedHTMLElement;
+            
+			positioner = element;
+            
+            // absolute positioned children need a non-null
+            // position value in the parent.  It might
+            // get set to 'absolute' if the container is
+            // also absolutely positioned
+            element.flexjs_wrapper = this;
+
+            return element;
+        }
+
+		/**
+         *  Configuration depends on parent Footer.
+		 *  Check to see if is mega or mini.
+         *  
+         *  @langversion 3.0
+         *  @playerversion Flash 10.2
+         *  @playerversion AIR 2.6
+         *  @productversion FlexJS 0.0
+        */ 
+		COMPILE::JS
+		override public function addedToParent():void
+        {
+			super.addedToParent();
+
+			if(parent is Footer)
+			{
+				element.classList.remove(typeNames);
+				if(!Footer(parent).mini)
+				{
+					typeNames = "mdl-mega-footer__top-section";
+				} else
+				{
+					typeNames = "mdl-mini-footer__top-section";
+				}
+				element.classList.add(typeNames);
+			}
+			else
+			{
+				throw new Error("FooterTopSection can not be used if parent is not a MDL Footer component.");
+			}			
+        }
+	}
+}

http://git-wip-us.apache.org/repos/asf/flex-asjs/blob/dee04ad0/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 b411018..6cff420 100644
--- a/frameworks/projects/MaterialDesignLite/src/main/resources/mdl-manifest.xml
+++ b/frameworks/projects/MaterialDesignLite/src/main/resources/mdl-manifest.xml
@@ -82,6 +82,10 @@
     <component id="Footer" class="org.apache.flex.mdl.Footer"/>
     <component id="FooterLeftSection" class="org.apache.flex.mdl.FooterLeftSection"/>
     <component id="FooterRightSection" class="org.apache.flex.mdl.FooterRightSection"/>
+    <component id="FooterTopSection" class="org.apache.flex.mdl.FooterTopSection"/>
+    <component id="FooterBottomSection" class="org.apache.flex.mdl.FooterBottomSection"/>
+    <component id="FooterLogo" class="org.apache.flex.mdl.FooterLogo"/>
+
 
     <component id="TabBarView" class="org.apache.flex.mdl.beads.views.TabBarView"/>
     <component id="TabBar" class="org.apache.flex.mdl.TabBar"/>