This is an automated email from the ASF dual-hosted git repository.
carlosrovira 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 e8d8f91 blog-examples: preparing project for next example
e8d8f91 is described below
commit e8d8f91d252221d8043681cdb8f45fd0a06d837a
Author: Carlos Rovira <[email protected]>
AuthorDate: Sun May 19 09:46:11 2019 +0200
blog-examples: preparing project for next example
---
...l_javascript_libraries_in_Apache_Royale.as3proj | 95 ++++++++++++++++++++++
.../README.txt | 29 +++++++
.../asconfig.json | 34 ++++++++
.../build.xml | 63 ++++++++++++++
.../pom.xml | 92 +++++++++++++++++++++
.../resources/jewel-example-index-template.html | 30 +++++++
...rnal_javascript_libraries_in_Apache_Royale.mxml | 65 +++++++++++++++
.../src/main/royale/hljs.as | 28 +++++++
8 files changed, 436 insertions(+)
diff --git
a/examples/blog/BE0012_Using_external_javascript_libraries_in_Apache_Royale/BE0012_Using_external_javascript_libraries_in_Apache_Royale.as3proj
b/examples/blog/BE0012_Using_external_javascript_libraries_in_Apache_Royale/BE0012_Using_external_javascript_libraries_in_Apache_Royale.as3proj
new file mode 100644
index 0000000..965d90a
--- /dev/null
+++
b/examples/blog/BE0012_Using_external_javascript_libraries_in_Apache_Royale/BE0012_Using_external_javascript_libraries_in_Apache_Royale.as3proj
@@ -0,0 +1,95 @@
+<?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>
+ <output>
+ <movie disabled="False"/>
+ <movie
path="bin-debug/BE0012_Using_external_javascript_libraries_in_Apache_Royale.swf"/>
+ <movie version="11"/>
+ <movie input=""/>
+ <movie width="800"/>
+ <movie height="600"/>
+ <movie fps="60"/>
+ <movie background="#FFFFFF"/>
+ <movie platform="Flash Player"/>
+ </output>
+ <!-- Other classes to be compiled into your SWF -->
+ <classpaths>
+ <class path="src/main/royale"/>
+ </classpaths>
+ <moonshineResourcePaths></moonshineResourcePaths>
+ <moonshineNativeExtensionPaths></moonshineNativeExtensionPaths>
+ <build>
+ <option useResourceBundleMetadata="True"/>
+ <option showBindingWarnings="True"/>
+ <option warnings="True"/>
+ <option es="False"/>
+ <option verboseStackTraces="False"/>
+ <option
additional="-theme=${royalelib}/themes/Jewel-Light-NoFlat-Primary-Blue-Theme/src/main/resources/defaults.css
-html-template=src/main/resources/jewel-example-index-template.html"/>
+ <option loadConfig=""/>
+ <option linkReport=""/>
+ <option benchmark="False"/>
+ <option optimize="False"/>
+ <option showActionScriptWarnings="True"/>
+ <option staticLinkRSL="False"/>
+ <option locale=""/>
+ <option compilerConstants=""/>
+ <option showDeprecationWarnings="True"/>
+ <option antBuildPath="build/build.xml"/>
+ <option showUnusedTypeSelectorWarnings="True"/>
+ <option customSDK=""/>
+ <option strict="True"/>
+ <option accessible="False"/>
+ <option useNetwork="True"/>
+ <option allowSourcePathOverlap="False"/>
+ </build>
+ <includeLibraries></includeLibraries>
+ <libraryPaths></libraryPaths>
+ <externalLibraryPaths></externalLibraryPaths>
+ <rslPaths></rslPaths>
+ <intrinsics>
+ <element path="Library/AS3/frameworks/Flex4"/>
+ <element path="Library\AS3\frameworks\Flex4"/>
+ </intrinsics>
+ <library></library>
+ <compileTargets>
+ <compile
path="src/main/royale/BE0012_Using_external_javascript_libraries_in_Apache_Royale.mxml"/>
+ </compileTargets>
+ <hiddenPaths></hiddenPaths>
+ <preBuildCommand>null</preBuildCommand>
+ <postBuildCommand alwaysRun="False">null</postBuildCommand>
+ <options>
+ <option testMovie=""/>
+ <option showHiddenPaths="False"/>
+ <option testMovieCommand=""/>
+ <option defaultBuildTargets=""/>
+ <option isPrimeFacesVisualEditor="False"/>
+ </options>
+ <moonshineRunCustomization>
+ <option deviceSimulator="null"/>
+ <option targetPlatform="2"/>
+ <option launchMethod="Simulator"/>
+ <option urlToLaunch=""/>
+ <option projectType="2"/>
+ <deviceSimulator>null</deviceSimulator>
+ <certAndroid>null</certAndroid>
+ <certIos>null</certIos>
+ <certIosProvisioning>null</certIosProvisioning>
+ </moonshineRunCustomization>
+</project>
\ No newline at end of file
diff --git
a/examples/blog/BE0012_Using_external_javascript_libraries_in_Apache_Royale/README.txt
b/examples/blog/BE0012_Using_external_javascript_libraries_in_Apache_Royale/README.txt
new file mode 100644
index 0000000..559a47e
--- /dev/null
+++
b/examples/blog/BE0012_Using_external_javascript_libraries_in_Apache_Royale/README.txt
@@ -0,0 +1,29 @@
+////////////////////////////////////////////////////////////////////////////////
+//
+// 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.
+//
+////////////////////////////////////////////////////////////////////////////////
+
+DESCRIPTION
+
+Loading external data through HTTPService
+
+Learn how to use the HTTPService to load external data from a server. In this
case we load the source code of
+this example using the Github API in a Royale panel to browse it.
+
+Source code of the code exposed in the following Apache Royale Blog Example
post:
+
+https://royale.apache.org//customization-through-the-royale-api/
diff --git
a/examples/blog/BE0012_Using_external_javascript_libraries_in_Apache_Royale/asconfig.json
b/examples/blog/BE0012_Using_external_javascript_libraries_in_Apache_Royale/asconfig.json
new file mode 100644
index 0000000..c3fe245
--- /dev/null
+++
b/examples/blog/BE0012_Using_external_javascript_libraries_in_Apache_Royale/asconfig.json
@@ -0,0 +1,34 @@
+////////////////////////////////////////////////////////////////////////////////
+//
+// 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.
+//
+////////////////////////////////////////////////////////////////////////////////
+{
+ "config": "royale",
+ "compilerOptions": {
+ "debug": false,
+ "targets": ["JSRoyale"],
+ "source-map": true,
+ "html-template":
"src/main/resources/jewel-example-index-template.html",
+ "theme":
"${royalelib}/themes/JewelTheme/src/main/resources/defaults.css"
+ },
+ "copySourcePathAssets": true,
+ "additionalOptions": "-remove-circulars
-js-output-optimization=skipAsCoercions",
+ "files":
+ [
+
"src/main/royale/BE0012_Using_external_javascript_libraries_in_Apache_Royale.mxml"
+ ]
+}
diff --git
a/examples/blog/BE0012_Using_external_javascript_libraries_in_Apache_Royale/build.xml
b/examples/blog/BE0012_Using_external_javascript_libraries_in_Apache_Royale/build.xml
new file mode 100644
index 0000000..c2d2c1b
--- /dev/null
+++
b/examples/blog/BE0012_Using_external_javascript_libraries_in_Apache_Royale/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="BE0012_Using_external_javascript_libraries_in_Apache_Royale"
default="main" basedir=".">
+ <property name="ROYALE_HOME" location="../../.."/>
+ <property name="example" value="App" />
+
+ <property file="${ROYALE_HOME}/env.properties"/>
+ <property environment="env"/>
+ <property file="${ROYALE_HOME}/build.properties"/>
+ <property name="ROYALE_HOME" value="${ROYALE_HOME}"/>
+
+ <include file="${basedir}/../../build_example.xml" />
+
+ <target name="main" depends="clean,build_example.compile"
description="Clean build of ${example}">
+ <mkdir dir="${basedir}/bin/js-debug/assets" />
+ <copy todir="${basedir}/bin/js-debug/assets" failonerror="false">
+ <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" failonerror="false">
+ <fileset dir="${basedir}/src/main/resources/assets">
+ <include name="**" />
+ </fileset>
+ </copy>
+ </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>
+
+ <target name="examine" depends="build_example.get.browser">
+ <property name="which" value="debug" />
+ <echo message="See various team members."/>
+ <exec executable="${browser}" dir="${basedir}/bin/js-${which}"
failonerror="true">
+ <arg value="${basedir}/bin/js-${which}/index.html"/>
+ </exec>
+ </target>
+
+</project>
diff --git
a/examples/blog/BE0012_Using_external_javascript_libraries_in_Apache_Royale/pom.xml
b/examples/blog/BE0012_Using_external_javascript_libraries_in_Apache_Royale/pom.xml
new file mode 100644
index 0000000..ad0d11b
--- /dev/null
+++
b/examples/blog/BE0012_Using_external_javascript_libraries_in_Apache_Royale/pom.xml
@@ -0,0 +1,92 @@
+<?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.royale.examples</groupId>
+ <artifactId>examples-blog</artifactId>
+ <version>0.9.6-SNAPSHOT</version>
+ </parent>
+
+
<artifactId>BE0012_Using_external_javascript_libraries_in_Apache_Royale</artifactId>
+ <version>0.9.6-SNAPSHOT</version>
+ <packaging>swf</packaging>
+
+ <name>Apache Royale: Examples: Blog: 0012: Using external javascript
libraries in Apache Royale</name>
+
+ <build>
+ <sourceDirectory>src/main/royale</sourceDirectory>
+ <plugins>
+ <plugin>
+ <groupId>org.apache.royale.compiler</groupId>
+ <artifactId>royale-maven-plugin</artifactId>
+ <extensions>true</extensions>
+ <configuration>
+
<mainClass>BE0012_Using_external_javascript_libraries_in_Apache_Royale.mxml</mainClass>
+ <targets>${royale.example.targets}</targets>
+ <debug>false</debug>
+
<htmlTemplate>${basedir}/target/javascript/bin/js-debug/jewel-example-index-template.html</htmlTemplate>
+
<additionalCompilerOptions>-source-map=true;-js-dynamic-access-unknown-members=true</additionalCompilerOptions>
+ </configuration>
+ </plugin>
+ </plugins>
+ </build>
+
+ <dependencies>
+ <dependency>
+ <groupId>org.apache.royale.framework</groupId>
+ <artifactId>Network</artifactId>
+ <version>0.9.6-SNAPSHOT</version>
+ <type>swc</type>
+ <classifier>swf</classifier>
+ </dependency>
+ <dependency>
+ <groupId>org.apache.royale.framework</groupId>
+ <artifactId>Network</artifactId>
+ <version>0.9.6-SNAPSHOT</version>
+ <type>swc</type>
+ <classifier>js</classifier>
+ </dependency>
+ <dependency>
+ <groupId>org.apache.royale.framework</groupId>
+ <artifactId>Jewel</artifactId>
+ <version>0.9.6-SNAPSHOT</version>
+ <type>swc</type>
+ <classifier>swf</classifier>
+ </dependency>
+ <dependency>
+ <groupId>org.apache.royale.framework</groupId>
+ <artifactId>Jewel</artifactId>
+ <version>0.9.6-SNAPSHOT</version>
+ <type>swc</type>
+ <classifier>js</classifier>
+ </dependency>
+ <dependency>
+ <groupId>org.apache.royale.framework</groupId>
+ <artifactId>Jewel-Light-NoFlat-Primary-Turquoise-Theme</artifactId>
+ <version>0.9.6-SNAPSHOT</version>
+ <type>swc</type>
+ <scope>theme</scope>
+ <classifier>js</classifier>
+ </dependency>
+ </dependencies>
+
+</project>
diff --git
a/examples/blog/BE0012_Using_external_javascript_libraries_in_Apache_Royale/src/main/resources/jewel-example-index-template.html
b/examples/blog/BE0012_Using_external_javascript_libraries_in_Apache_Royale/src/main/resources/jewel-example-index-template.html
new file mode 100644
index 0000000..140ba98
--- /dev/null
+++
b/examples/blog/BE0012_Using_external_javascript_libraries_in_Apache_Royale/src/main/resources/jewel-example-index-template.html
@@ -0,0 +1,30 @@
+<!--
+ 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="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 href="https://fonts.googleapis.com/css?family=Lato:400,700"
rel="stylesheet">
+${head}
+</head>
+<body>
+${body}
+</body>
+</html>
diff --git
a/examples/blog/BE0012_Using_external_javascript_libraries_in_Apache_Royale/src/main/royale/BE0012_Using_external_javascript_libraries_in_Apache_Royale.mxml
b/examples/blog/BE0012_Using_external_javascript_libraries_in_Apache_Royale/src/main/royale/BE0012_Using_external_javascript_libraries_in_Apache_Royale.mxml
new file mode 100644
index 0000000..bf89d5d
--- /dev/null
+++
b/examples/blog/BE0012_Using_external_javascript_libraries_in_Apache_Royale/src/main/royale/BE0012_Using_external_javascript_libraries_in_Apache_Royale.mxml
@@ -0,0 +1,65 @@
+<?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.
+
+-->
+<j:Application xmlns:fx="http://ns.adobe.com/mxml/2009"
+ xmlns:j="library://ns.apache.org/royale/jewel"
+ xmlns:js="library://ns.apache.org/royale/basic"
+ xmlns:html="library://ns.apache.org/royale/html">
+
+ <fx:Script>
+ <![CDATA[
+ public var _hljs:hljs;
+
+ public function highLightContent():void
+ {
+ // dot access notation using a class hljs created with @externs
+
+ hljs.highlightBlock(sourceCodeMXMLText.element);
+
+ // bracket access notation for a diynaimc access without
create additional class
+ //var hljs:Object = window["hljs"];
+ //prevent renaming by compiler
+ //hljs["highlightBlock"](block);
+ }
+ ]]>
+ </fx:Script>
+
+ <j:initialView>
+ <j:View>
+ <js:beads>
+ <j:HorizontalCenteredLayout/>
+ </js:beads>
+
+ <j:Card percentWidth="90">
+ <html:H3 text="Using external Javascript Libraries"/>
+
+ <j:Label html="This example uses hljs library to highligh a
piece of code"/>
+
+ <html:Pre height="300" percentWidth="100"
style="background-color: white">
+ <js:beads>
+ <j:ScrollingViewport/>
+ </js:beads>
+ <html:Code id="sourceCodeMXMLText" text="public function
hello(){}"/>รง
+ </html:Pre>
+
+ <j:Button text="highlight Block" emphasis="primary"
click="highLightContent()"/>
+ </j:Card>
+ </j:View>
+ </j:initialView>
+</j:Application>
\ No newline at end of file
diff --git
a/examples/blog/BE0012_Using_external_javascript_libraries_in_Apache_Royale/src/main/royale/hljs.as
b/examples/blog/BE0012_Using_external_javascript_libraries_in_Apache_Royale/src/main/royale/hljs.as
new file mode 100644
index 0000000..60866b2
--- /dev/null
+++
b/examples/blog/BE0012_Using_external_javascript_libraries_in_Apache_Royale/src/main/royale/hljs.as
@@ -0,0 +1,28 @@
+////////////////////////////////////////////////////////////////////////////////
+//
+// 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
+{
+ /**
+ * @externs
+ */
+ public class hljs
+ {
+ public static function highlightBlock(block:Element):void {}
+ }
+}
\ No newline at end of file