Repository: flex-tourjs Updated Branches: refs/heads/develop 678baa99b -> 7dafa1b44
Added button examples and included URLs so the examples can be displayed using <Module> component. Project: http://git-wip-us.apache.org/repos/asf/flex-tourjs/repo Commit: http://git-wip-us.apache.org/repos/asf/flex-tourjs/commit/7dafa1b4 Tree: http://git-wip-us.apache.org/repos/asf/flex-tourjs/tree/7dafa1b4 Diff: http://git-wip-us.apache.org/repos/asf/flex-tourjs/diff/7dafa1b4 Branch: refs/heads/develop Commit: 7dafa1b4427baf191b800083bd604e0cf1ad3587 Parents: 678baa9 Author: Peter Ent <[email protected]> Authored: Thu Feb 2 17:00:41 2017 -0500 Committer: Peter Ent <[email protected]> Committed: Thu Feb 2 17:00:41 2017 -0500 ---------------------------------------------------------------------- TourJS/src/main/flex/TourJSMainView.mxml | 38 ++++++++++++++++----------- TourJS/src/main/resources/content.json | 16 +++++------ build.xml | 4 +++ 3 files changed, 35 insertions(+), 23 deletions(-) ---------------------------------------------------------------------- http://git-wip-us.apache.org/repos/asf/flex-tourjs/blob/7dafa1b4/TourJS/src/main/flex/TourJSMainView.mxml ---------------------------------------------------------------------- diff --git a/TourJS/src/main/flex/TourJSMainView.mxml b/TourJS/src/main/flex/TourJSMainView.mxml index e06ef0b..528fb4f 100644 --- a/TourJS/src/main/flex/TourJSMainView.mxml +++ b/TourJS/src/main/flex/TourJSMainView.mxml @@ -20,11 +20,15 @@ limitations under the License. <js:HView xmlns:fx="http://ns.adobe.com/mxml/2009" xmlns:js="library://ns.apache.org/flexjs/express" xmlns:basic="library://ns.apache.org/flexjs/basic" - width="100%" height="100%" initComplete="loadInitialData()"> + width="100%" height="100%" + initComplete="loadInitialData()"> <fx:Script> <![CDATA[ import org.apache.flex.collections.HierarchicalData; import org.apache.flex.collections.converters.JSONItemConverter; + import org.apache.flex.html.beads.ContainerView; + import org.apache.flex.core.UIBase; + import org.apache.flex.html.Module; [Bindable] private var tempExampleNames = []; @@ -33,6 +37,7 @@ limitations under the License. private var contentData:HierarchicalData; private var currentExamples:Array; + private var currentExample:Object; private function loadInitialData():void { service.url = "resources/content.json"; @@ -53,14 +58,9 @@ limitations under the License. { var node:Object = contentTree.selectedItem; if (node["type"] == "group") { - exampleTitle.text = node["title"]; - exampleDescription.text = node["description"]; codeArea.text = ""; } else { - exampleTitle.text = node["title"]; - exampleDescription.text = node["description"]; - codeArea.text = ""; - + codeArea.text = ""; var exampleNames:Array = []; currentExamples = node["example"]; @@ -91,18 +91,29 @@ limitations under the License. private function showExampleSource(index:int):void { - var item:Object = currentExamples[index]; + currentExample = currentExamples[index]; - codeLoader.url = "resources/" + item["source"]; + codeLoader.url = "resources/" + currentExample["source"]; codeLoader.send(); codeLoader.addEventListener("complete", codeLoaded); codeLoader.addEventListener("ioError", codeError); + + runExample(); } private function changeExample():void { showExampleSource(buttonBar.selectedIndex); } + + private function runExample():void + { + var item:Object = currentExample; + var swfURL:String = "resources/" + item["module_swf"]; + var htmlURL:String = "resources/" + item["module_js"]; + + exampleModule.loadContent(swfURL, htmlURL); + } ]]> </fx:Script> @@ -116,6 +127,7 @@ limitations under the License. } .RunningExample { margin-bottom: 5px; + background-color: #FEFEFE; } .ExampleCode { background-color: #FEFEFE; @@ -137,12 +149,8 @@ limitations under the License. </js:Panel> <js:VContainer width="74%" height="100%"> - <js:Panel title="Example" width="100%" height="50%" className="RunningExample"> - <js:beads> - <js:VerticalLayout /> - </js:beads> - <js:Label id="exampleTitle" width="100%" height="22" /> - <js:Label id="exampleDescription" width="100%" height="22" /> + <js:Panel id="topPanel" title="Example" width="100%" height="50%" className="RunningExample"> + <basic:Module id="exampleModule" width="100%" height="100%" /> </js:Panel> <js:VContainer width="100%" height="50%"> http://git-wip-us.apache.org/repos/asf/flex-tourjs/blob/7dafa1b4/TourJS/src/main/resources/content.json ---------------------------------------------------------------------- diff --git a/TourJS/src/main/resources/content.json b/TourJS/src/main/resources/content.json index 7660d27..3902984 100644 --- a/TourJS/src/main/resources/content.json +++ b/TourJS/src/main/resources/content.json @@ -19,12 +19,12 @@ "example": [ {"name": "Alert.mxml", "source":"content/visualComponents/generalComponents/alert/Alert/src/main/flex/Alert.mxml", - "module_swf":"x/y/z", - "module_js":"x/y/z"}, + "module_swf":"content/visualComponents/generalComponents/alert/Alert/bin-debug/Alert.swf", + "module_js":"content/visualComponents/generalComponents/alert/Alert/bin/js-release/index.html"}, {"name": "SimpleAlert.mxml", "source":"content/visualComponents/generalComponents/alert/SimpleAlert/src/main/flex/SimpleAlert.mxml", - "module_swf":"x/y/z", - "module_js":"x/y/z"} + "module_swf":"content/visualComponents/generalComponents/alert/SimpleAlert/bin-debug/SimpleAlert.swf", + "module_js":"content/visualComponents/generalComponents/alert/SimpleAlert/bin/js-release/index.html"} ]}, {"type":"component", "title":"Button", @@ -32,12 +32,12 @@ "example": [ {"name": "TextButton.mxml", "source":"content/visualComponents/generalComponents/button/TextButton/src/main/flex/TextButton.mxml", - "module_swf":"x/y/z", - "module_js":"x/y/z"}, + "module_swf":"content/visualComponents/generalComponents/button/TextButton/bin-debug/TextButton.swf", + "module_js":"content/visualComponents/generalComponents/button/TextButton/bin/js-release/index.html"}, {"name": "ImageButton.mxml", "source":"content/visualComponents/generalComponents/button/ImageButton/src/main/flex/ImageButton.mxml", - "module_swf":"x/y/z", - "module_js":"x/y/z"} + "module_swf":"content/visualComponents/generalComponents/button/ImageButton/bin-debug/ImageButton.swf", + "module_js":"content/visualComponents/generalComponents/button/ImageButton/bin/js-release/index.html"} ]}, {"type":"component", "title":"Other", http://git-wip-us.apache.org/repos/asf/flex-tourjs/blob/7dafa1b4/build.xml ---------------------------------------------------------------------- diff --git a/build.xml b/build.xml index ec3fcb9..73e212b 100644 --- a/build.xml +++ b/build.xml @@ -53,4 +53,8 @@ <echo message="build complete" /> </target> + <target name="touronly" depends="build-tourjs,copyfiles"> + <echo message="tour build complete" /> + </target> + </project> \ No newline at end of file
