Created
July 25, 2011 19:17
-
-
Save fehrenbach/1104927 to your computer and use it in GitHub Desktop.
ClojureScript and Sencha Touch
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| <!DOCTYPE html> | |
| <html> | |
| <head> | |
| <meta http-equiv="Content-Type" content="text/html; charset=utf-8"> | |
| <title>Hello World</title> | |
| <script src="lib/touch/sencha-touch.js" type="text/javascript"></script> | |
| <script type="text/javascript" src="out/goog/base.js"></script> | |
| <script src="test.js" type="text/javascript"></script> | |
| <script>goog.require('test');</script> | |
| <link href="lib/touch/resources/css/sencha-touch.css" rel="stylesheet" type="text/css" /> | |
| <script type="text/javascript">test.init();</script> | |
| </head> | |
| <body></body> | |
| </html> |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| (ns test) | |
| (defn make-js-map | |
| "makes a javascript map from a clojure one | |
| (stolen from https://gist.github.com/1098417)" | |
| [cljmap] | |
| (let [out (js-obj)] | |
| (doall (map #(aset out (name (first %)) (second %)) cljmap)) | |
| out)) | |
| (defn ^:export init [] | |
| (Ext.Application. (make-js-map {"launch" #(Ext.Panel. (make-js-map {"fullscreen" true, "html" "Hello World!!"}))}))) |
Author
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Assumes Sencha Touch in lib/touch/ and can be built with $ cljsc . > test.js
Layout: $ ls
index.html lib out test.cljs test.js