Add popup script

This commit is contained in:
Jeremy Dormitzer 2018-01-11 20:15:05 -05:00
parent c592c38f59
commit 20ac362a41
No known key found for this signature in database
GPG Key ID: 04F17C0F5A32C320
4 changed files with 22 additions and 7 deletions

View File

@ -10,7 +10,11 @@
"128": "icons/icon128.png"
},
"background": {
"scripts": ["js/browser-polyfill.min.js", "js/generated/main.js"]
"scripts": [
"js/browser-polyfill.min.js",
"js/generated/out/cljs_base.js",
"js/generated/background.js"
]
},
"browser_action": {
"default_icon": "icons/icon48.png",

View File

@ -12,6 +12,11 @@
:cljsbuild {:builds [{:source-paths ["src"]
:compiler {:optimizations :simple
:pretty-print true
:output-to "ext/js/generated/main.js"
:source-map "ext/js/generated/main.js.map"
:output-dir "ext/js/generated/out"}}]})
:source-map true
:output-dir "ext/js/generated/out"
:modules {:background
{:output-to "ext/js/generated/background.js"
:entries #{"looped-in.background"}}
:popup
{:output-to "ext/js/generated/popup.js"
:entries #{"looped-in.popup"}}}}}]})

View File

@ -1,4 +1,4 @@
(ns looped-in.main
(ns looped-in.background
(:require [clojure.core.match :refer [match]]
[cljs.core.async :refer [go go-loop chan close! >! <!]]
[ajax.core :refer [GET]]
@ -103,5 +103,7 @@
;; 2. Fetch HN hits
;; 3. Filter and sort hits
;; 4. Count comments, update badge
;; 5. Fetch item details
;; 6. Construct popup (or sidebar?) html
;; 5. When the popup is opened:
;; 6. Fetch items based on the id (this will have to come
;; from the background script to avoid repeating the request)
;; 7. Render the popup

4
src/looped_in/popup.cljs Normal file
View File

@ -0,0 +1,4 @@
(ns looped-in.popup
(:require [looped-in.logging :as log]))
(log/info "Hello from the popup script!")