~bendersteed/wikisophy-fe

dc86fc886d41c31228553287be99002fb2fc9b4a — Dimakakos Dimos 4 years ago 0faa9d3
Clean: minor fixes for first deployment
3 files changed, 14 insertions(+), 23 deletions(-)

M project.clj
M public/index.html
M src/wikisophy/core.cljs
M project.clj => project.clj +4 -5
@@ 1,5 1,5 @@
(defproject wikisophy "0.1.0-SNAPSHOT"
  :description "A Reagent content that consumes an array of titles and
(defproject wikisophy "0.2.0"
  :description "A Reagent app that consumes an array of titles and
  links of the path taken through wikipedia articles' first link
  leading mostly to wikipedia."
  :url "https://wikisophy.bendersteed.tech"


@@ 9,8 9,7 @@
  :dependencies [[org.clojure/clojure "1.10.1"]
                 [org.clojure/clojurescript "1.10.597"]
                 [reagent "0.9.0-rc3"]
                 [cljs-ajax "0.8.0"]
                 [metasoarous/oz "1.6.0-alpha6"]]
                 [cljs-ajax "0.8.0"]]

  :plugins [[lein-cljsbuild "1.1.7"]
            [lein-figwheel "0.5.19"]]


@@ 39,7 38,7 @@
                         :optimizations :none
                         :pretty-print  true}
                        :figwheel
                        {:on-jsload "wikisophy.core/mount-root"
                        {:on-jsload "wikisophy.core/init!"
                         :open-urls ["http://localhost:3449/index.html"]}}
                       :release
                       {:source-paths ["src" "env/prod/cljs"]

M public/index.html => public/index.html +1 -4
@@ 2,7 2,7 @@
<!DOCTYPE html>
<html>
    <head>
	<title> Wikisophy </title>
	<title> wikisophy </title>
	<meta charset="utf-8">
	<meta content="width=device-width, initial-scale=1" name="viewport">
	<link rel="stylesheet" href="https://unpkg.com/picnic">


@@ 10,10 10,7 @@
    </head>
    <body>
	<div id="app">
	    <h3>ClojureScript has not been compiled!</h3>
	    <p>please run <b>lein figwheel</b> in order to start the compiler</p>
	</div>
	<script src="/js/app.js" type="text/javascript"></script>
	
    </body>
</html>

M src/wikisophy/core.cljs => src/wikisophy/core.cljs +9 -14
@@ 1,7 1,6 @@
(ns wikisophy.core
    (:require [reagent.core :as r]
              [ajax.core :refer [GET POST]]
              [oz.core :as oz]))
              [ajax.core :refer [GET POST]]))

;; -------------------------
;; State and State updates


@@ 15,7 14,7 @@
               response))

(defn get-query! [query]
  (GET "http://localhost:4242/wikisophy"
  (GET "https://api.wikisophy.bendersteed.tech"
       {:content-type :json
        :api (js/XMLHttpRequest.)
        :url-params {:query query}


@@ 39,8 38,7 @@
   [:label.icon-g {:for "bmenub" :class "burger pseudo button"} "menu"]
   [:div.menu
    [:a.button {:href ""} "Home"]
    [:a.pseudo.button {:href "#about"} "About"]
    [:a.pseudo.button {:href "#analytics"} "Analytics"]]])
    [:a.pseudo.button {:href "#about"} "About"]]])

(defn header []
  [:header


@@ 92,21 90,18 @@

(defn about-page []
  [:body [navbar]
   [:h1 "About Page"]])

(defn analytics-page []
  [:body [navbar]
   [:h1 "Analytics Page"]
   [:p "Analytics have not been implemented yet, stay tuned to learn
   more!"]])
   [:h1 "About Page"]
   [:p "This is an early version of a project that aims in collecting data
about the paths that get created by following the first links in Wikipedia
entries. There is the conjecture that almost all such paths lead to the
Philosophy entry. How many of them really do?"]])

;; -------------------------
;; Routing

(def routes
  {"" front-page
   "#about" about-page
   "#analytics" analytics-page})
   "#about" about-page})

(defn handle-routes [routes event]
  (let [hash (.-location.hash js/window)