This is an automated email from the ASF dual-hosted git repository. joshtynjala pushed a commit to branch develop in repository https://gitbox.apache.org/repos/asf/royale-asjs.git
commit 3c975ad52c0732d8fa00529c35e3c976f300efe4 Author: Josh Tynjala <[email protected]> AuthorDate: Tue Apr 1 10:10:26 2025 -0700 TourDeJewel: copy .mxml files into output and load from there instead of GitHub --- examples/jewel/TourDeJewel/build.xml | 12 ++++++++ examples/jewel/TourDeJewel/pom.xml | 36 ++++++++++++++++++++++ .../ExampleAndSourceCodeTabbedSectionContent.as | 8 ++--- .../{GitHubService.as => SourceCodeService.as} | 25 +++------------ 4 files changed, 56 insertions(+), 25 deletions(-) diff --git a/examples/jewel/TourDeJewel/build.xml b/examples/jewel/TourDeJewel/build.xml index f3f473a51d..a6dd92524f 100644 --- a/examples/jewel/TourDeJewel/build.xml +++ b/examples/jewel/TourDeJewel/build.xml @@ -43,6 +43,18 @@ <include name="**" /> </fileset> </copy> + <mkdir dir="${basedir}/bin/js-debug/src" /> + <copy todir="${basedir}/bin/js-debug/src" failonerror="false"> + <fileset dir="${basedir}/src/main/royale"> + <include name="**/*.mxml" /> + </fileset> + </copy> + <mkdir dir="${basedir}/bin/js-release/src" /> + <copy todir="${basedir}/bin/js-release/src" failonerror="false"> + <fileset dir="${basedir}/src/main/royale"> + <include name="**/*.mxml" /> + </fileset> + </copy> </target> <target name="clean"> diff --git a/examples/jewel/TourDeJewel/pom.xml b/examples/jewel/TourDeJewel/pom.xml index 2c37fa2c70..530ef5fd17 100644 --- a/examples/jewel/TourDeJewel/pom.xml +++ b/examples/jewel/TourDeJewel/pom.xml @@ -938,6 +938,42 @@ <outputDirectory>${project.build.directory}/javascript/bin/js-release/assets/themes</outputDirectory> </configuration> </execution> + <execution> + <id>copy-source-to-debug</id> + <phase>process-resources</phase> + <goals> + <goal>copy-resources</goal> + </goals> + <configuration> + <resources> + <resource> + <directory>${project.build.sourceDirectory}</directory> + <includes> + <include>**/*.mxml</include> + </includes> + </resource> + </resources> + <outputDirectory>${project.build.directory}/javascript/bin/js-debug/src/</outputDirectory> + </configuration> + </execution> + <execution> + <id>copy-source-to-release</id> + <phase>process-resources</phase> + <goals> + <goal>copy-resources</goal> + </goals> + <configuration> + <resources> + <resource> + <directory>${project.build.sourceDirectory}</directory> + <includes> + <include>**/*.mxml</include> + </includes> + </resource> + </resources> + <outputDirectory>${project.build.directory}/javascript/bin/js-release/src/</outputDirectory> + </configuration> + </execution> </executions> </plugin> <plugin> diff --git a/examples/jewel/TourDeJewel/src/main/royale/components/ExampleAndSourceCodeTabbedSectionContent.as b/examples/jewel/TourDeJewel/src/main/royale/components/ExampleAndSourceCodeTabbedSectionContent.as index 2f0c9e3ea5..66fb7e0791 100644 --- a/examples/jewel/TourDeJewel/src/main/royale/components/ExampleAndSourceCodeTabbedSectionContent.as +++ b/examples/jewel/TourDeJewel/src/main/royale/components/ExampleAndSourceCodeTabbedSectionContent.as @@ -29,7 +29,7 @@ package components import org.apache.royale.jewel.TabBarContent; import org.apache.royale.html.beads.layouts.Paddings; - import services.GitHubService; + import services.SourceCodeService; import vos.TabBarButtonVO; @@ -50,7 +50,7 @@ package components addEventListener("beadsAdded", beadsAddedHandler); } - private var service:GitHubService; + private var service:SourceCodeService; private var tabbar:TabBar; private var tabBarNavigation:ArrayList; private var tabcontent:TabBarContent; @@ -58,7 +58,7 @@ package components private var sourceCodeTab:ScrollableSectionContent; private var sourceCodeMXMLText:Code; - private var sourceCodeUrlPrefix:String = "https://api.github.com/repos/apache/royale-asjs/contents/examples/jewel/TourDeJewel/src/main/royale/"; + private var sourceCodeUrlPrefix:String = "./src/"; private var sourceCodeUrlWebPrefix:String = "https://github.com/apache/royale-asjs/blob/develop/examples/jewel/TourDeJewel/src/main/royale/"; private var _sourceCodeUrl:String; @@ -118,7 +118,7 @@ package components tabcontent.selectedContent = "exampleTab"; strandChildren.addElement(tabcontent); - service = new GitHubService(); + service = new SourceCodeService(); service.addEventListener("dataReady", dataReadyHandler); service.sourceCodeUrl = sourceCodeUrlPrefix + sourceCodeUrl; } diff --git a/examples/jewel/TourDeJewel/src/main/royale/services/GitHubService.as b/examples/jewel/TourDeJewel/src/main/royale/services/SourceCodeService.as similarity index 80% rename from examples/jewel/TourDeJewel/src/main/royale/services/GitHubService.as rename to examples/jewel/TourDeJewel/src/main/royale/services/SourceCodeService.as index 28c834035e..cd2cd528bd 100644 --- a/examples/jewel/TourDeJewel/src/main/royale/services/GitHubService.as +++ b/examples/jewel/TourDeJewel/src/main/royale/services/SourceCodeService.as @@ -22,19 +22,18 @@ package services import org.apache.royale.events.EventDispatcher; import org.apache.royale.net.HTTPConstants; import org.apache.royale.net.HTTPService; - import org.apache.royale.utils.string.Base64; [Event(name="dataReady", type="org.apache.royale.events.Event")] /** - * GitHubService is in charge of getting the source code of some example + * SourceCodeService is in charge of getting the source code of some example * so we can show the code in a TabBarContentPanel along with the working example */ - public class GitHubService extends EventDispatcher + public class SourceCodeService extends EventDispatcher { /** * constructor */ - public function GitHubService():void + public function SourceCodeService():void { service = new HTTPService(); service.addEventListener(HTTPConstants.COMPLETE, completeHandler); @@ -70,25 +69,9 @@ package services /** * json return the retrieved GitHub JSON Object */ - public function get json():Object - { - return service.json; - } - - /** - * jsonToString return the retrieved GitHub JSON Object as String - */ - public function get jsonToString():String - { - return service.data; - } - - /** - * decode and return the base 64 content (real source code) - */ public function get sourceCode():String { - return Base64.decode(service.json.content); + return service.data; } /**
