Skip to content

Commit

Permalink
replaced occurances of try clojure with trycljs, including altering t…
Browse files Browse the repository at this point in the history
…he namespace structure and renaming files
  • Loading branch information
AlexBaranosky committed Dec 15, 2011
1 parent 8070eb9 commit 66d2a4b
Show file tree
Hide file tree
Showing 12 changed files with 28 additions and 35 deletions.
3 changes: 2 additions & 1 deletion .gitignore
Expand Up @@ -6,4 +6,5 @@ classes
/resources/public/javascript/jquery*
/resources/private/cljs-compiler/
*.iml
.idea
.idea
.lein-deps-sum
3 changes: 1 addition & 2 deletions TODO.md
@@ -1,5 +1,4 @@
* Update all references from TryClojure to TryCLJS (or whatever)
* Make note of origin, link back to tryclj + repo
* add contributors to home.clj @ [:p.bottom "©2011 BAZNEX: contributorA, B, C ..."]
* Call out to cljsc (stdin/stdout hacks? or API call?) to compile in compile.clj
* Use CLJS on browser side to pr-str results back in s-expressions
* Switch views to use Enlive or other templating system, all that hiccup is
Expand Down
2 changes: 1 addition & 1 deletion project.clj
Expand Up @@ -8,6 +8,6 @@
:jvm-opts ["-Djava.security.policy=example.policy""-Xmx80M"]
:hooks [leiningen.fetch-js
leiningen.fetch-cljs]
:main tryclojure.server)
:main trycljs.server)


File renamed without changes.
File renamed without changes.
@@ -1,4 +1,4 @@
(ns tryclojure.models.compile)
(ns trycljs.models.compile)

(defn compile-expr [cljs]
cljs ;; for now, just echo
Expand Down
4 changes: 2 additions & 2 deletions src/tryclojure/server.clj → src/trycljs/server.clj
@@ -1,9 +1,9 @@
(ns tryclojure.server
(ns trycljs.server
(:use [ring.middleware.file :only [wrap-file]])
(:require [noir.server :as server]))

(server/add-middleware wrap-file (System/getProperty "user.dir"))
(server/load-views "src/tryclojure/views")
(server/load-views "src/trycljs/views")

(defn to-port [s]
(when-let [port s] (Long. port)))
Expand Down
@@ -1,6 +1,6 @@
(ns tryclojure.views.compile
(ns trycljs.views.compile
(:use [noir.core :only [defpage]]
[tryclojure.models.compile :only [compile-request]])
[trycljs.models.compile :only [compile-request]])
(:require [noir.response :as resp]))

(defpage "/compile.json" {:keys [expr jsonp]}
Expand Down
31 changes: 12 additions & 19 deletions src/tryclojure/views/home.clj → src/trycljs/views/home.clj
@@ -1,4 +1,4 @@
(ns tryclojure.views.home
(ns trycljs.views.home
(:use [noir.core :only [defpartial defpage]]
[hiccup form-helpers page-helpers]))

Expand All @@ -24,40 +24,36 @@
"It'll be in an entirely new namespace/sandbox."]
[:p.bottom
"You can find the site's source and such on its "
(link-to "http://github.com/Raynes/tryclojure" "github")
(link-to "http://github.com/baznex/trycljs" "github")
" page."]
[:p.bottom
"TryClojure is written in Clojure and JavaScript (JQuery), powered by "
(link-to "https://github.com/flatland/clojail" "clojail")
" and Chris Done's "
"TryCljs is written in Clojure and JavaScript (JQuery), powered by Chris Done's "
(link-to "https://github.com/chrisdone/jquery-console" "jquery-console")]
[:p.bottom "Design by " (link-to "http://apgwoz.com" "Andrew Gwozdziewycz")])

(defpartial home-html []
[:p.bottom
"Welcome to Try Clojure. See that little box up there? That's a Clojure repl. You can type "
"Welcome to TryCljs. See that little box up there? That's a ClojureScript repl. You can type "
"expressions and see their results right here in your browser. We also have a brief tutorial to "
"give you a taste of Clojure. Try it out by typing " [:code.expr "tutorial"] " in the console!"]
"give you a taste of ClojureScript. Try it out by typing " [:code.expr "tutorial"] " in the console!"]
[:p.bottom
"Check out the site's source on "
(link-to "http://github.com/Raynes/tryclojure" "github")
"!"])
"Check out the site's source on " (link-to "http://github.com/baznex/trycljs" "github") "!"])

(defpartial root-html []
(html4
[:head
(include-css "/resources/public/css/tryclojure.css")
(include-css "/resources/public/css/trycljs.css")
(include-js "/resources/public/javascript/jquery-1.4.2.min.js"
"/resources/public/javascript/jquery.console.js"
"/resources/public/javascript/tryclojure.js")
[:title "Try Clojure"]]
"/resources/public/javascript/trycljs.js")
[:title "TryCljs"]]
[:body
[:div#wrapper
[:div#content
[:div#header
[:h1
[:span.logo-try "Try"] " "
[:span.logo-clojure "Clo" [:em "j"] "ure"]]]
[:span.logo-clojure "Cl" [:em "j"] "s"]]]
[:div#container
[:div#console.console]
[:div#buttons
Expand All @@ -66,11 +62,8 @@
[:a#about.buttons.last "about"]]
[:div#changer (home-html)]]
[:div.footer
[:p.bottom "©2011 Anthony Grimes and numerous contributors"]
[:p.bottom
"Built with "
(link-to "http://webnoir.org" "Noir")
"."]]]]]))
[:p.bottom "©2011 BAZNEX"]
[:p.bottom "Built with " (link-to "http://webnoir.org" "Noir") "."]]]]]))

(defpage "/" []
(root-html))
Expand Down
5 changes: 5 additions & 0 deletions src/trycljs/views/tutorial.clj
@@ -0,0 +1,5 @@
(ns trycljs.views.tutorial
(:use [noir.core :only [defpage]]))

(defpage [:post "/tutorial"] {n :n}
(slurp (str "resources/public/tutorial/page" n ".html")))
5 changes: 0 additions & 5 deletions src/tryclojure/views/tutorial.clj

This file was deleted.

4 changes: 2 additions & 2 deletions test/tryclojure/eval_test.clj
@@ -1,5 +1,5 @@
(ns tryclojure.eval-test
(:use tryclojure.models.eval
(ns trycljs.eval-test
(:use trycljs.models.eval
clojure.test)
(:require noir.session))

Expand Down

0 comments on commit 66d2a4b

Please sign in to comment.