Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

klipse local #261

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@
"url": "git+https://github.com/viebel/klipse.git"
},
"dependencies": {
"codemirror": "5.21.0"
"codemirror-minified": "5.21.0"
},
"keywords": [
"clojure",
Expand Down
3 changes: 2 additions & 1 deletion resources/public/clojure-dbg.html
Original file line number Diff line number Diff line change
Expand Up @@ -123,7 +123,8 @@
<br/>
<script>
window.klipse_settings = {
// clojure_bundled_ns_ignore: /gadjett\..*/
// clojure_bundled_ns_ignore: /gadjett\..*/,

};
if(window.location.search.match(/transpile=1/)) {
window.klipse_settings.selector_js = '.clojure';
Expand Down
46 changes: 46 additions & 0 deletions resources/public/local-dbg.html
Original file line number Diff line number Diff line change
@@ -0,0 +1,46 @@
<!DOCTYPE html>
<html>
<head lang="en">
<meta charset="UTF-8">
<title>KLIPSE: a simple and elegant online cljs compiler and evaluator</title>
<link rel='shortcut icon' type='image/x-icon' href='img/klipse.png' />
<link rel="stylesheet" type="text/css" href="css/codemirror.css">
</head>
<body>
<div class="clojure">
(if 1 2 3)
</div>
<br/>
<div class="clojure">
(ns my.ns
(:require [clojure.set :as ss]))
</div>
<div class="clojure">
(require '[clojure.spec :as s]
'[clojure.spec.test :as stest]
'[clojure.spec.impl.gen :as gen])
(stest/instrument `map)
(defn foo [x] x)
(s/fdef foo :args (s/cat :x integer?)
:ret string?)
(stest/instrument `foo)
(foo 1)
</div>
<br/>
<script>
window.klipse_settings = {
codemirror_root: "http://localhost:31338/node_modules/codemirror-minified/mode",
scripts_root: "http://localhost:31338",

};
if(window.location.search.match(/transpile=1/)) {
window.klipse_settings.selector_js = '.clojure';
} else {
window.klipse_settings.selector = '.clojure';
}

</script>
<script src="/fig/js/klipse.fig.js"></script>
<!--script src="/plugin/js/klipse_plugin.js"></script-->
</body>
</html>
10 changes: 6 additions & 4 deletions src/klipse/common/registry.cljs
Original file line number Diff line number Diff line change
Expand Up @@ -8,12 +8,14 @@
(def mode-options (atom {}))

(defn codemirror-mode-src [mode]
(let [root (:codemirror_root (klipse-settings) "https://cdnjs.cloudflare.com/ajax/libs/codemirror/5.21.0/mode")]
(str root "/" mode "/" mode ".min.js")))
(if-let [root (:codemirror_root (klipse-settings))]
(str root "/" mode "/" mode ".js")
(str "https://cdnjs.cloudflare.com/ajax/libs/codemirror/5.21.0/mode" "/" mode "/" mode ".min.js")))

(defn codemirror-keymap-src [mode]
(let [root (:codemirror_root (klipse-settings) "https://cdnjs.cloudflare.com/ajax/libs/codemirror/5.21.0/keymap")]
(str root "/" mode ".min.js")))
(if-let [root (:codemirror_root (klipse-settings))]
(str root "/keymap/" mode ".js")
(str "https://cdnjs.cloudflare.com/ajax/libs/codemirror/5.21.0/keymap" "/" mode ".min.js")))

(defn scripts-src [name]
(let [root (:scripts_root (klipse-settings) "https://viebel.github.io/klipse/repo/js")]
Expand Down