Repository: flex-asjs Updated Branches: refs/heads/develop 18c3d1f5a -> a6614e82d
Mdl blog Template project Project: http://git-wip-us.apache.org/repos/asf/flex-asjs/repo Commit: http://git-wip-us.apache.org/repos/asf/flex-asjs/commit/a6614e82 Tree: http://git-wip-us.apache.org/repos/asf/flex-asjs/tree/a6614e82 Diff: http://git-wip-us.apache.org/repos/asf/flex-asjs/diff/a6614e82 Branch: refs/heads/develop Commit: a6614e82d9a213bbb5e8ab4b3493962b10588542 Parents: 18c3d1f Author: Carlos Rovira <[email protected]> Authored: Fri Feb 3 19:58:58 2017 +0100 Committer: Carlos Rovira <[email protected]> Committed: Fri Feb 3 19:58:58 2017 +0100 ---------------------------------------------------------------------- .../flexjs/MDLBlogExample/.vscode/launch.json | 21 +++++ .../flexjs/MDLBlogExample/.vscode/tasks.json | 9 ++ examples/flexjs/MDLBlogExample/asconfig.json | 14 +++ examples/flexjs/MDLBlogExample/build.xml | 63 ++++++++++++++ examples/flexjs/MDLBlogExample/pom.xml | 91 ++++++++++++++++++++ .../MDLBlogExample/src/main/flex/App.mxml | 34 ++++++++ .../src/main/flex/BlogTemplate.mxml | 29 +++++++ .../main/resources/mdl-js-index-template.html | 33 +++++++ .../src/main/resources/mdl-styles.css | 65 ++++++++++++++ 9 files changed, 359 insertions(+) ---------------------------------------------------------------------- http://git-wip-us.apache.org/repos/asf/flex-asjs/blob/a6614e82/examples/flexjs/MDLBlogExample/.vscode/launch.json ---------------------------------------------------------------------- diff --git a/examples/flexjs/MDLBlogExample/.vscode/launch.json b/examples/flexjs/MDLBlogExample/.vscode/launch.json new file mode 100644 index 0000000..fe64613 --- /dev/null +++ b/examples/flexjs/MDLBlogExample/.vscode/launch.json @@ -0,0 +1,21 @@ +{ + "version": "0.2.0", + "configurations": [ + { + "name": "Launch Chrome against debug.html, with sourcemaps", + "type": "chrome", + "request": "launch", + "file": "${workspaceRoot}/target/javascript/bin/js-debug/index.html", + "sourceMaps": true, + "preLaunchTask": "mvn" + }, + { + "name": "Launch Firefox against debug.html, with sourcemaps", + "type": "firefox", + "request": "launch", + "file": "${workspaceRoot}/target/javascript/bin/js-debug/index.html", + "sourceMaps": true, + "preLaunchTask": "mvn" + } + ] +} \ No newline at end of file http://git-wip-us.apache.org/repos/asf/flex-asjs/blob/a6614e82/examples/flexjs/MDLBlogExample/.vscode/tasks.json ---------------------------------------------------------------------- diff --git a/examples/flexjs/MDLBlogExample/.vscode/tasks.json b/examples/flexjs/MDLBlogExample/.vscode/tasks.json new file mode 100644 index 0000000..e562c32 --- /dev/null +++ b/examples/flexjs/MDLBlogExample/.vscode/tasks.json @@ -0,0 +1,9 @@ +{ + // See https://go.microsoft.com/fwlink/?LinkId=733558 + // for the documentation about the tasks.json format + "version": "0.1.0", + "command": "mvn", + "args": ["clean", "install", "-DskipTests"], + "isShellCommand": true, + "showOutput": "always" +} \ No newline at end of file http://git-wip-us.apache.org/repos/asf/flex-asjs/blob/a6614e82/examples/flexjs/MDLBlogExample/asconfig.json ---------------------------------------------------------------------- diff --git a/examples/flexjs/MDLBlogExample/asconfig.json b/examples/flexjs/MDLBlogExample/asconfig.json new file mode 100644 index 0000000..d15de04 --- /dev/null +++ b/examples/flexjs/MDLBlogExample/asconfig.json @@ -0,0 +1,14 @@ +{ + "config": "flex", + "compilerOptions": { + "debug": true, + "source-map": true, + "js-output-type": "flexjs", + "output": "./target/javascript" + }, + "additionalOptions": "-html-template=src/main/resources/mdl-js-index-template.html", + "files": + [ + "src/main/flex/App.mxml" + ] +} \ No newline at end of file http://git-wip-us.apache.org/repos/asf/flex-asjs/blob/a6614e82/examples/flexjs/MDLBlogExample/build.xml ---------------------------------------------------------------------- diff --git a/examples/flexjs/MDLBlogExample/build.xml b/examples/flexjs/MDLBlogExample/build.xml new file mode 100644 index 0000000..f43c825 --- /dev/null +++ b/examples/flexjs/MDLBlogExample/build.xml @@ -0,0 +1,63 @@ +<?xml version="1.0"?> +<!-- + + 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. + +--> + + +<project name="MDLBlogExample" default="main" basedir="."> + <property name="FLEXJS_HOME" location="../../.."/> + <property name="example" value="App" /> + + <property file="${FLEXJS_HOME}/env.properties"/> + <property environment="env"/> + <property file="${FLEXJS_HOME}/build.properties"/> + <property name="FLEX_HOME" value="${FLEXJS_HOME}"/> + <property name="opt1_arg" value="-compiler.exclude-defaults-css-files=HTML.swc:defaults.css" /> + <property name="opt2_arg" value="-html-template=${basedir}/src/main/resources/mdl-js-index-template.html" /> + + <include file="${basedir}/../../build_example.xml" /> + + <target name="main" depends="clean,build_example.compile,build_example.compilejs" description="Clean build of ${example}"> + <mkdir dir="${basedir}/bin/js-debug/assets" /> + <copy todir="${basedir}/bin/js-debug/assets" > + <fileset dir="${basedir}/src/main/resources/assets"> + <include name="**" /> + </fileset> + </copy> + <mkdir dir="${basedir}/bin/js-release/assets" /> + <copy todir="${basedir}/bin/js-release/assets" > + <fileset dir="${basedir}/src/main/resources/assets"> + <include name="**" /> + </fileset> + </copy> + <replace file="${basedir}/bin/js-debug/index.html" token="${primary}" value="indigo" /> + <replace file="${basedir}/bin/js-debug/index.html" token="${accent}" value="pink" /> + <replace file="${basedir}/bin/js-release/index.html" token="${primary}" value="indigo" /> + <replace file="${basedir}/bin/js-release/index.html" token="${accent}" value="pink" /> + </target> + + <target name="clean"> + <delete dir="${basedir}/bin" failonerror="false" /> + <delete dir="${basedir}/bin-debug" failonerror="false" /> + <delete dir="${basedir}/bin-release" failonerror="false" /> + <delete dir="${basedir}/target" failonerror="false" /> + </target> + + + +</project> http://git-wip-us.apache.org/repos/asf/flex-asjs/blob/a6614e82/examples/flexjs/MDLBlogExample/pom.xml ---------------------------------------------------------------------- diff --git a/examples/flexjs/MDLBlogExample/pom.xml b/examples/flexjs/MDLBlogExample/pom.xml new file mode 100644 index 0000000..c1389a4 --- /dev/null +++ b/examples/flexjs/MDLBlogExample/pom.xml @@ -0,0 +1,91 @@ +<?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. + +--> +<project xmlns="http://maven.apache.org/POM/4.0.0" + xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" + xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd"> + <modelVersion>4.0.0</modelVersion> + + <parent> + <groupId>org.apache.flex.flexjs.examples</groupId> + <artifactId>examples-flexjs</artifactId> + <version>0.8.0-SNAPSHOT</version> + </parent> + + <artifactId>MDLBlogExample</artifactId> + <version>0.8.0-SNAPSHOT</version> + <packaging>swf</packaging> + + <name>Apache Flex - FlexJS: Examples: FlexJS: MDLBlogExample</name> + + <properties> + <!-- Customize MDL colors using this the tool at : https://getmdl.io/customize/index.html --> + <primary>indigo</primary> + <accent>pink</accent> + </properties> + + <build> + <sourceDirectory>src/main/flex</sourceDirectory> + <resources> + <resource> + <directory>src/main/resources</directory> + <filtering>true</filtering> + </resource> + </resources> + <plugins> + <plugin> + <groupId>org.apache.flex.flexjs.compiler</groupId> + <artifactId>flexjs-maven-plugin</artifactId> + <extensions>true</extensions> + <configuration> + <mainClass>App.mxml</mainClass> + <htmlTemplate>${basedir}/target/javascript/bin/js-debug/mdl-js-index-template.html</htmlTemplate> + <additionalCompilerOptions>-compiler.exclude-defaults-css-files=HTML-0.8.0-SNAPSHOT.swc:defaults.css</additionalCompilerOptions> + </configuration> + </plugin> + <plugin> + <groupId>org.apache.maven.plugins</groupId> + <artifactId>maven-war-plugin</artifactId> + </plugin> + <plugin> + <groupId>org.codehaus.mojo</groupId> + <artifactId>build-helper-maven-plugin</artifactId> + </plugin> + </plugins> + </build> + + <dependencies> + <dependency> + <groupId>org.apache.flex.flexjs.framework</groupId> + <artifactId>MaterialDesignLite</artifactId> + <version>0.8.0-SNAPSHOT</version> + <type>swc</type> + </dependency> + + <!-- Needed for Flash compilation --> + <dependency> + <groupId>com.adobe.flash.framework</groupId> + <artifactId>playerglobal</artifactId> + <version>20.0</version> + <type>swc</type> + <scope>provided</scope> + </dependency> + </dependencies> + +</project> \ No newline at end of file http://git-wip-us.apache.org/repos/asf/flex-asjs/blob/a6614e82/examples/flexjs/MDLBlogExample/src/main/flex/App.mxml ---------------------------------------------------------------------- diff --git a/examples/flexjs/MDLBlogExample/src/main/flex/App.mxml b/examples/flexjs/MDLBlogExample/src/main/flex/App.mxml new file mode 100644 index 0000000..6a86332 --- /dev/null +++ b/examples/flexjs/MDLBlogExample/src/main/flex/App.mxml @@ -0,0 +1,34 @@ +<?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:Application xmlns:fx="http://ns.adobe.com/mxml/2009" + xmlns:js="library://ns.apache.org/flexjs/basic" + xmlns:mdl="library://ns.apache.org/flexjs/mdl" + xmlns:local="*"> + + <fx:Style source="../../main/resources/mdl-styles.css"/> + + <js:valuesImpl> + <js:SimpleCSSValuesImpl /> + </js:valuesImpl> + + <js:initialView> + <local:BlogTemplate/> + </js:initialView> +</mdl:Application> http://git-wip-us.apache.org/repos/asf/flex-asjs/blob/a6614e82/examples/flexjs/MDLBlogExample/src/main/flex/BlogTemplate.mxml ---------------------------------------------------------------------- diff --git a/examples/flexjs/MDLBlogExample/src/main/flex/BlogTemplate.mxml b/examples/flexjs/MDLBlogExample/src/main/flex/BlogTemplate.mxml new file mode 100644 index 0000000..a3c5398 --- /dev/null +++ b/examples/flexjs/MDLBlogExample/src/main/flex/BlogTemplate.mxml @@ -0,0 +1,29 @@ +<?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:TabBarPanel xmlns:fx="http://ns.adobe.com/mxml/2009" + xmlns:js="library://ns.apache.org/flexjs/basic" + xmlns:mdl="library://ns.apache.org/flexjs/mdl" + xmlns="http://www.w3.org/1999/xhtml"> + + + + + +</mdl:TabBarPanel> \ No newline at end of file http://git-wip-us.apache.org/repos/asf/flex-asjs/blob/a6614e82/examples/flexjs/MDLBlogExample/src/main/resources/mdl-js-index-template.html ---------------------------------------------------------------------- diff --git a/examples/flexjs/MDLBlogExample/src/main/resources/mdl-js-index-template.html b/examples/flexjs/MDLBlogExample/src/main/resources/mdl-js-index-template.html new file mode 100644 index 0000000..35e4c3a --- /dev/null +++ b/examples/flexjs/MDLBlogExample/src/main/resources/mdl-js-index-template.html @@ -0,0 +1,33 @@ +<!-- + 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. +--> +<!DOCTYPE html> +<html> +<head> + <meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1"> + <meta http-equiv="Content-Type" content="text/html; charset=utf-8"> + <meta name="Custom Template for injecting custom style CSS"> + <meta name="viewport" content="width=device-width, initial-scale=1.0, minimum-scale=1.0""> + <link rel="stylesheet" type="text/css" href="${application}.css"> + <link rel="stylesheet" href="https://fonts.googleapis.com/icon?family=Material+Icons"> + <link rel="stylesheet" href="https://code.getmdl.io/1.3.0/material.${primary}-${accent}.min.css"> + <script defer src="https://code.getmdl.io/1.3.0/material.min.js"></script> +${head} +</head> +<body> +${body} +</body> +</html> \ No newline at end of file http://git-wip-us.apache.org/repos/asf/flex-asjs/blob/a6614e82/examples/flexjs/MDLBlogExample/src/main/resources/mdl-styles.css ---------------------------------------------------------------------- diff --git a/examples/flexjs/MDLBlogExample/src/main/resources/mdl-styles.css b/examples/flexjs/MDLBlogExample/src/main/resources/mdl-styles.css new file mode 100644 index 0000000..e2b6574 --- /dev/null +++ b/examples/flexjs/MDLBlogExample/src/main/resources/mdl-styles.css @@ -0,0 +1,65 @@ +/* +//////////////////////////////////////////////////////////////////////////////// +// +// 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. +// +//////////////////////////////////////////////////////////////////////////////// +*/ + +@namespace "http://www.w3.org/1999/xhtml"; +@namespace js "library://ns.apache.org/flexjs/basic"; +@namespace mdl "library://ns.apache.org/flexjs/mdl"; + +.flexjs *, . flexjs *:before, . flexjs *:after { + -moz-box-sizing: border-box; + -webkit-box-sizing: border-box; + box-sizing: border-box; +} + +.page-content +{ + padding: 10px; + margin: 10px; +} + + +/* Grids Example */ +.demo-grid .mdl-cell { + box-sizing: border-box; + background-color: #BDBDBD; + height: 200px; + padding-left: 8px; + padding-top: 4px; + color: white; +} +.demo-grid .mdl-grid:first-of-type .mdl-cell { + height: 50px; +} + +/* center items in grid */ +.mdl-grid.center-items { + flex-direction: column; + align-items: center; +} + +/* make center items have some padding */ +.mdl-grid.center-items > .mdl-card { + margin: 10px; +} + + +/* Icons */ +.material-icons.orange600 { color: #FB8C00; } \ No newline at end of file
