Snippets

Fantom-Factory Run Fantom Code in a Browser!

Updated by Steve Eynon

File -readme.markdown Modified

  • Ignore whitespace
  • Hide word diff
 # Run Fantom Code In a Browser!
 
-See the [Run Fantom Code In a Browser!](http://www.fantomfactory.org/articles/run-fantom-code-in-a-browser) article on Fantom-Factory for details.
+See this [article](http://www.fantomfactory.org/articles/run-fantom-code-in-a-browser) on Fantom-Factory for details.
 
 The script shows Fantom's FWT windowing capabilities when run in a browser. It's a modified version of [Fantom's FWT Demo](http://fantom.org/doc/examples/fwt-demo.html).
 
Updated by Steve Eynon

File -ReadMe.markdown Deleted

  • Ignore whitespace
  • Hide word diff
-# Run Fantom Code In a Browser!
-
-The script shows Fantom's FWT windowing capabilities when run in a browser. It's a modified version of [Fantom's FWT Demo]`http://fantom.org/doc/examples/fwt-demo.html`.
-
-Run the script to compile a new pod called duvetFwtDemo:
-
-    C:\> fan DuvetFwtDemo.fan
-
-Start BedSheet with the `DuvetFwtDemo` bed app:
-
-    C:\> fan afBedSheet duvetFwtDemo 8080
-
-The point your browser at (http://localhost:8080):
-
-![Screenshot of FWT running in a browser ](http://www.fantomfactory.org/images/articles/2014/run-fantom-code-in-a-browser.duvetFwtDemo.png)
-
-See the [Run Fantom Code In a Browser!](http://www.fantomfactory.org/articles/run-fantom-code-in-a-browser) article on Fantom-Factory for details.

File -readme.markdown Added

  • Ignore whitespace
  • Hide word diff
+# Run Fantom Code In a Browser!
+
+See the [Run Fantom Code In a Browser!](http://www.fantomfactory.org/articles/run-fantom-code-in-a-browser) article on Fantom-Factory for details.
+
+The script shows Fantom's FWT windowing capabilities when run in a browser. It's a modified version of [Fantom's FWT Demo](http://fantom.org/doc/examples/fwt-demo.html).
+
+Run the script to compile a new pod called duvetFwtDemo:
+
+    C:\> fan DuvetFwtDemo.fan
+
+Start BedSheet with the `DuvetFwtDemo` bed app:
+
+    C:\> fan afBedSheet duvetFwtDemo 8080
+
+The point your browser at (http://localhost:8080):
+
+![Screenshot of FWT running in a browser ](http://www.fantomfactory.org/images/articles/2014/run-fantom-code-in-a-browser.duvetFwtDemo.png)
Updated by Steve Eynon

File -ReadMe.markdown Modified

  • Ignore whitespace
  • Hide word diff
-See http://www.fantomfactory.org/articles/run-fantom-code-in-a-browser for details
+# Run Fantom Code In a Browser!
+
+The script shows Fantom's FWT windowing capabilities when run in a browser. It's a modified version of [Fantom's FWT Demo]`http://fantom.org/doc/examples/fwt-demo.html`.
+
+Run the script to compile a new pod called duvetFwtDemo:
+
+    C:\> fan DuvetFwtDemo.fan
+
+Start BedSheet with the `DuvetFwtDemo` bed app:
+
+    C:\> fan afBedSheet duvetFwtDemo 8080
+
+The point your browser at (http://localhost:8080):
+
+![Screenshot of FWT running in a browser ](http://www.fantomfactory.org/images/articles/2014/run-fantom-code-in-a-browser.duvetFwtDemo.png)
+
+See the [Run Fantom Code In a Browser!](http://www.fantomfactory.org/articles/run-fantom-code-in-a-browser) article on Fantom-Factory for details.
Updated by Steve Eynon

File DuvetFwtDemo.fan Modified

  • Ignore whitespace
  • Hide word diff
 using afDuvet
 
 class IndexPage {
-		@Inject HtmlInjector? injector
+	@Inject HtmlInjector? injector
 
-		BsText render() {
-				injector.injectFantomMethod(FwtDemo#main, null, ["fwt.window.root": "fwt-window"])
-				return BsText.fromHtml("<html><head></head><body><div id='fwt-window' style='width:1000px; height:600px; position:relative;'></div></body></html>")
-		}
+	BsText render() {
+		injector.injectFantomMethod(FwtDemo#main, null, ["fwt.window.root": "fwt-window"])
+		return BsText.fromHtml("<html><head></head><body><div id='fwt-window' style='width:1000px; height:600px; position:relative;'></div></body></html>")
+	}
 }
 
 class AppModule {
-		@Contribute { serviceType=Routes# }
-		static Void contributeRoutes(Configuration conf) {
-				conf.add(Route(`/`, IndexPage#render))
-		}
+	@Contribute { serviceType=Routes# }
+	static Void contributeRoutes(Configuration conf) {
+		conf.add(Route(`/`, IndexPage#render))
+	}
 }
 
 class Build : BuildPod {
-		new make() {
-				podName = "duvetFwtDemo"
-				summary = "Run a Fantom FWT GUI in your browser!"
+	new make() {
+		podName = "duvetFwtDemo"
+		summary = "Run a Fantom FWT GUI in your browser!"
 
-				meta = [
-						"proj.name"				: "Duvet FWT Demo",
-						"afIoc.module"		: "duvetFwtDemo::AppModule",
-				]
+		meta = [
+			"proj.name"				: "Duvet FWT Demo",
+			"afIoc.module"		: "duvetFwtDemo::AppModule",
+		]
 
-				depends = [
-						"sys 1.0",
-						"gfx 1.0",
-						"fwt 1.0",
-						"build 1.0",
-						"afIoc 2.0",
-						"afBedSheet 1.3",
-						"afDuvet 1.0"
-				]
+		depends = [
+			"sys 1.0",
+			"gfx 1.0",
+			"fwt 1.0",
+			"build 1.0",
+			"afIoc 2.0",
+			"afBedSheet 1.3",
+			"afDuvet 1.0"
+		]
 
-				srcDirs = [`DuvetFwtDemo.fan`]
-		}
+		srcDirs = [`DuvetFwtDemo.fan`]
+	}
 }
 
 **
Updated by Steve Eynon

File -ReadMe.markdown Added

  • Ignore whitespace
  • Hide word diff
+See http://www.fantomfactory.org/articles/run-fantom-code-in-a-browser for details

File _ReadMe.markdown Deleted

  • Ignore whitespace
  • Hide word diff
-See http://www.fantomfactory.org/articles/run-fantom-code-in-a-browser for details
  1. Prev
  2. 1
  3. 2
  4. Next