Compare commits

..

2 commits

58 changed files with 161 additions and 7918 deletions

7
.gitignore vendored
View file

@ -1,5 +1,3 @@
.clj-kondo/
.lsp/
/target
/lib
/classes
@ -7,17 +5,12 @@
pom.xml
*.jar
*.class
/.calva/
/.lein-*
/.env
*.log
.nrepl-port
# Links to other places:
resources/public/docs/mw-*/uberdoc.html
# Artefacts:
mw_ui.log
pom.xml
buildall.tmp.*/

View file

@ -1,3 +0,0 @@
FROM tomcat:alpine
COPY target/microworld.war $CATALINA_HOME/webapps/

View file

@ -1,13 +1,18 @@
## Part of the overall Microworld system
## Part of the overall MicroWorld system
*mw-ui* is not a stand-alone project. To use it you also need at least
[mw-parser](https://github.com/simon-brooke/mw-parser) and
[mw-engine](https://github.com/simon-brooke/mw-engine). There will be other
modules in due course.
You can see MicroWorld in action [here](http://www.journeyman.cc/microworld/) -
but please don't be mean to my poor little server. If you want to run big maps
or complex rule-sets, please run it on your own machines.
## What this is about
<img alt="Screenshot" id="screenshot" style="float: left; padding-right: 2em;" src="img/screenshot_med.png"/>
<img alt="Screenshot" id="screenshot" alt="MicroWrold in action"
style="float: left; padding-right: 2em;" src="img/screenshot_med.png"/>
MicroWorld is a rule driven cellular automaton. What does that mean? Well, it's
a two dimensional world made up of squares called **cells**. The world develops
in steps, and at each step, each cell is modified by applying the rules.

View file

@ -1,40 +0,0 @@
.covered {
font-family: 'Bitstream Vera Sans Mono', 'Courier', monospace;
background-color: #558B55;
}
.not-covered {
font-family: 'Bitstream Vera Sans Mono', 'Courier', monospace;
background-color: red;
}
.partial {
font-family: 'Bitstream Vera Sans Mono', 'Courier', monospace;
background-color: orange;
}
.not-tracked {
font-family: 'Bitstream Vera Sans Mono', 'Courier', monospace;
}
.blank {
font-family: 'Bitstream Vera Sans Mono', 'Courier', monospace;
}
td {
padding-right: 10px;
}
td.with-bar {
width: 250px;
text-align: center;
}
td.with-number {
text-align: right;
}
td.ns-name {
min-width: 150px;
padding-right: 25px;
}

View file

@ -1,200 +0,0 @@
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
<link rel="stylesheet" href="./coverage.css"/>
<title>Coverage Summary</title>
</head>
<body>
<table>
<thead><tr>
<td class="ns-name"> Namespace </td>
<td class="with-bar"> Forms </td>
<td class="with-number">Forms %</td>
<td class="with-bar"> Lines </td>
<td class="with-number">Lines %</td>
<td class="with-number">Total</td><td class="with-number">Blank</td><td class="with-number">Instrumented</td>
</tr></thead>
<tr>
<td><a href="mw_ui/handler.clj.html">mw-ui.handler</a></td><td class="with-bar"><div class="covered"
style="width:48.68421052631579%;
float:left;"> 37 </div><div class="not-covered"
style="width:51.31578947368421%;
float:left;"> 39 </div></td>
<td class="with-number">48.68 %</td>
<td class="with-bar"><div class="covered"
style="width:81.25%;
float:left;"> 13 </div><div class="not-covered"
style="width:18.75%;
float:left;"> 3 </div></td>
<td class="with-number">81.25 %</td>
<td class="with-number">86</td><td class="with-number">10</td><td class="with-number">16</td>
</tr>
<tr>
<td><a href="mw_ui/layout.clj.html">mw-ui.layout</a></td><td class="with-bar"><div class="covered"
style="width:87.03703703703704%;
float:left;"> 47 </div><div class="not-covered"
style="width:12.962962962962964%;
float:left;"> 7 </div></td>
<td class="with-number">87.04 %</td>
<td class="with-bar"><div class="covered"
style="width:75.0%;
float:left;"> 9 </div><div class="partial"
style="width:16.666666666666668%;
float:left;"> 2 </div><div class="not-covered"
style="width:8.333333333333334%;
float:left;"> 1 </div></td>
<td class="with-number">91.67 %</td>
<td class="with-number">51</td><td class="with-number">7</td><td class="with-number">12</td>
</tr>
<tr>
<td><a href="mw_ui/middleware.clj.html">mw-ui.middleware</a></td><td class="with-bar"><div class="covered"
style="width:73.77049180327869%;
float:left;"> 45 </div><div class="not-covered"
style="width:26.229508196721312%;
float:left;"> 16 </div></td>
<td class="with-number">73.77 %</td>
<td class="with-bar"><div class="covered"
style="width:92.85714285714286%;
float:left;"> 13 </div><div class="partial"
style="width:7.142857142857143%;
float:left;"> 1 </div></td>
<td class="with-number">100.00 %</td>
<td class="with-number">52</td><td class="with-number">9</td><td class="with-number">14</td>
</tr>
<tr>
<td><a href="mw_ui/render_world.clj.html">mw-ui.render-world</a></td><td class="with-bar"><div class="covered"
style="width:3.864734299516908%;
float:left;"> 8 </div><div class="not-covered"
style="width:96.13526570048309%;
float:left;"> 199 </div></td>
<td class="with-number">3.86 %</td>
<td class="with-bar"><div class="covered"
style="width:19.51219512195122%;
float:left;"> 8 </div><div class="not-covered"
style="width:80.48780487804878%;
float:left;"> 33 </div></td>
<td class="with-number">19.51 %</td>
<td class="with-number">104</td><td class="with-number">17</td><td class="with-number">41</td>
</tr>
<tr>
<td><a href="mw_ui/repl.clj.html">mw-ui.repl</a></td><td class="with-bar"><div class="covered"
style="width:22.950819672131146%;
float:left;"> 14 </div><div class="not-covered"
style="width:77.04918032786885%;
float:left;"> 47 </div></td>
<td class="with-number">22.95 %</td>
<td class="with-bar"><div class="covered"
style="width:26.31578947368421%;
float:left;"> 5 </div><div class="partial"
style="width:5.2631578947368425%;
float:left;"> 1 </div><div class="not-covered"
style="width:68.42105263157895%;
float:left;"> 13 </div></td>
<td class="with-number">31.58 %</td>
<td class="with-number">66</td><td class="with-number">8</td><td class="with-number">19</td>
</tr>
<tr>
<td><a href="mw_ui/routes/home.clj.html">mw-ui.routes.home</a></td><td class="with-bar"><div class="covered"
style="width:26.575342465753426%;
float:left;"> 97 </div><div class="not-covered"
style="width:73.42465753424658%;
float:left;"> 268 </div></td>
<td class="with-number">26.58 %</td>
<td class="with-bar"><div class="covered"
style="width:17.647058823529413%;
float:left;"> 12 </div><div class="partial"
style="width:20.58823529411765%;
float:left;"> 14 </div><div class="not-covered"
style="width:61.76470588235294%;
float:left;"> 42 </div></td>
<td class="with-number">38.24 %</td>
<td class="with-number">133</td><td class="with-number">12</td><td class="with-number">68</td>
</tr>
<tr>
<td><a href="mw_ui/routes/load.clj.html">mw-ui.routes.load</a></td><td class="with-bar"><div class="covered"
style="width:4.918032786885246%;
float:left;"> 3 </div><div class="not-covered"
style="width:95.08196721311475%;
float:left;"> 58 </div></td>
<td class="with-number">4.92 %</td>
<td class="with-bar"><div class="covered"
style="width:17.647058823529413%;
float:left;"> 3 </div><div class="not-covered"
style="width:82.3529411764706%;
float:left;"> 14 </div></td>
<td class="with-number">17.65 %</td>
<td class="with-number">62</td><td class="with-number">9</td><td class="with-number">17</td>
</tr>
<tr>
<td><a href="mw_ui/routes/params.clj.html">mw-ui.routes.params</a></td><td class="with-bar"><div class="covered"
style="width:2.027027027027027%;
float:left;"> 3 </div><div class="not-covered"
style="width:97.97297297297297%;
float:left;"> 145 </div></td>
<td class="with-number">2.03 %</td>
<td class="with-bar"><div class="covered"
style="width:8.823529411764707%;
float:left;"> 3 </div><div class="not-covered"
style="width:91.17647058823529%;
float:left;"> 31 </div></td>
<td class="with-number">8.82 %</td>
<td class="with-number">80</td><td class="with-number">5</td><td class="with-number">34</td>
</tr>
<tr>
<td><a href="mw_ui/routes/rules.clj.html">mw-ui.routes.rules</a></td><td class="with-bar"><div class="covered"
style="width:31.57894736842105%;
float:left;"> 30 </div><div class="not-covered"
style="width:68.42105263157895%;
float:left;"> 65 </div></td>
<td class="with-number">31.58 %</td>
<td class="with-bar"><div class="covered"
style="width:41.666666666666664%;
float:left;"> 10 </div><div class="partial"
style="width:4.166666666666667%;
float:left;"> 1 </div><div class="not-covered"
style="width:54.166666666666664%;
float:left;"> 13 </div></td>
<td class="with-number">45.83 %</td>
<td class="with-number">72</td><td class="with-number">6</td><td class="with-number">24</td>
</tr>
<tr>
<td><a href="mw_ui/routes/save.clj.html">mw-ui.routes.save</a></td><td class="with-bar"><div class="covered"
style="width:8.0%;
float:left;"> 2 </div><div class="not-covered"
style="width:92.0%;
float:left;"> 23 </div></td>
<td class="with-number">8.00 %</td>
<td class="with-bar"><div class="covered"
style="width:50.0%;
float:left;"> 2 </div><div class="not-covered"
style="width:50.0%;
float:left;"> 2 </div></td>
<td class="with-number">50.00 %</td>
<td class="with-number">41</td><td class="with-number">4</td><td class="with-number">4</td>
</tr>
<tr>
<td><a href="mw_ui/util.clj.html">mw-ui.util</a></td><td class="with-bar"><div class="covered"
style="width:18.354430379746834%;
float:left;"> 29 </div><div class="not-covered"
style="width:81.64556962025317%;
float:left;"> 129 </div></td>
<td class="with-number">18.35 %</td>
<td class="with-bar"><div class="covered"
style="width:35.8974358974359%;
float:left;"> 14 </div><div class="partial"
style="width:2.5641025641025643%;
float:left;"> 1 </div><div class="not-covered"
style="width:61.53846153846154%;
float:left;"> 24 </div></td>
<td class="with-number">38.46 %</td>
<td class="with-number">91</td><td class="with-number">10</td><td class="with-number">39</td>
</tr>
<tr><td>Totals:</td>
<td class="with-bar"></td>
<td class="with-number">24.03 %</td>
<td class="with-bar"></td>
<td class="with-number">38.89 %</td>
</tr>
</table>
</body>
</html>

View file

@ -1,266 +0,0 @@
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
<link rel="stylesheet" href="../coverage.css"/> <title> mw_ui/handler.clj </title>
</head>
<body>
<span class="covered" title="1 out of 1 forms covered">
001&nbsp;&nbsp;(ns&nbsp;^{:doc&nbsp;&quot;Set&nbsp;up&nbsp;and&nbsp;tear&nbsp;down&nbsp;the&nbsp;request&nbsp;handler.&quot;
</span><br/>
<span class="not-tracked" title="0 out of 0 forms covered">
002&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;:author&nbsp;&quot;Simon&nbsp;Brooke&quot;}
</span><br/>
<span class="not-tracked" title="0 out of 0 forms covered">
003&nbsp;&nbsp;&nbsp;&nbsp;mw-ui.handler
</span><br/>
<span class="not-tracked" title="0 out of 0 forms covered">
004&nbsp;&nbsp;&nbsp;&nbsp;(:require&nbsp;[compojure.core&nbsp;:refer&nbsp;[defroutes]]
</span><br/>
<span class="not-tracked" title="0 out of 0 forms covered">
005&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;[mw-ui.routes.home&nbsp;:refer&nbsp;[home-routes]]
</span><br/>
<span class="not-tracked" title="0 out of 0 forms covered">
006&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;[mw-ui.middleware&nbsp;:refer&nbsp;[load-middleware]]
</span><br/>
<span class="not-tracked" title="0 out of 0 forms covered">
007&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;[noir.response&nbsp;:refer&nbsp;[redirect]]
</span><br/>
<span class="not-tracked" title="0 out of 0 forms covered">
008&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;[noir.util.middleware&nbsp;:refer&nbsp;[app-handler]]
</span><br/>
<span class="not-tracked" title="0 out of 0 forms covered">
009&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;[compojure.route&nbsp;:as&nbsp;route]
</span><br/>
<span class="not-tracked" title="0 out of 0 forms covered">
010&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;[taoensso.timbre&nbsp;:as&nbsp;timbre]
</span><br/>
<span class="not-tracked" title="0 out of 0 forms covered">
011&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;;;&nbsp;[taoensso.timbre.appenders.rotor&nbsp;:as&nbsp;rotor]
</span><br/>
<span class="not-tracked" title="0 out of 0 forms covered">
012&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;[selmer.parser&nbsp;:as&nbsp;parser]
</span><br/>
<span class="not-tracked" title="0 out of 0 forms covered">
013&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;[environ.core&nbsp;:refer&nbsp;[env]]))
</span><br/>
<span class="blank" title="0 out of 0 forms covered">
014&nbsp;&nbsp;
</span><br/>
<span class="not-tracked" title="0 out of 0 forms covered">
015&nbsp;&nbsp;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
</span><br/>
<span class="not-tracked" title="0 out of 0 forms covered">
016&nbsp;&nbsp;;;;;
</span><br/>
<span class="not-tracked" title="0 out of 0 forms covered">
017&nbsp;&nbsp;;;;;&nbsp;mw-ui:&nbsp;a&nbsp;servlet&nbsp;user&#x2F;visualisation&nbsp;interface&nbsp;for&nbsp;MicroWorld.
</span><br/>
<span class="not-tracked" title="0 out of 0 forms covered">
018&nbsp;&nbsp;;;;;
</span><br/>
<span class="not-tracked" title="0 out of 0 forms covered">
019&nbsp;&nbsp;;;;;&nbsp;This&nbsp;program&nbsp;is&nbsp;free&nbsp;software;&nbsp;you&nbsp;can&nbsp;redistribute&nbsp;it&nbsp;and&#x2F;or
</span><br/>
<span class="not-tracked" title="0 out of 0 forms covered">
020&nbsp;&nbsp;;;;;&nbsp;modify&nbsp;it&nbsp;under&nbsp;the&nbsp;terms&nbsp;of&nbsp;the&nbsp;GNU&nbsp;General&nbsp;Public&nbsp;License
</span><br/>
<span class="not-tracked" title="0 out of 0 forms covered">
021&nbsp;&nbsp;;;;;&nbsp;as&nbsp;published&nbsp;by&nbsp;the&nbsp;Free&nbsp;Software&nbsp;Foundation;&nbsp;either&nbsp;version&nbsp;2
</span><br/>
<span class="not-tracked" title="0 out of 0 forms covered">
022&nbsp;&nbsp;;;;;&nbsp;of&nbsp;the&nbsp;License,&nbsp;or&nbsp;(at&nbsp;your&nbsp;option)&nbsp;any&nbsp;later&nbsp;version.
</span><br/>
<span class="not-tracked" title="0 out of 0 forms covered">
023&nbsp;&nbsp;;;;;
</span><br/>
<span class="not-tracked" title="0 out of 0 forms covered">
024&nbsp;&nbsp;;;;;&nbsp;This&nbsp;program&nbsp;is&nbsp;distributed&nbsp;in&nbsp;the&nbsp;hope&nbsp;that&nbsp;it&nbsp;will&nbsp;be&nbsp;useful,
</span><br/>
<span class="not-tracked" title="0 out of 0 forms covered">
025&nbsp;&nbsp;;;;;&nbsp;but&nbsp;WITHOUT&nbsp;ANY&nbsp;WARRANTY;&nbsp;without&nbsp;even&nbsp;the&nbsp;implied&nbsp;warranty&nbsp;of
</span><br/>
<span class="not-tracked" title="0 out of 0 forms covered">
026&nbsp;&nbsp;;;;;&nbsp;MERCHANTABILITY&nbsp;or&nbsp;FITNESS&nbsp;FOR&nbsp;A&nbsp;PARTICULAR&nbsp;PURPOSE.&nbsp;&nbsp;See&nbsp;the
</span><br/>
<span class="not-tracked" title="0 out of 0 forms covered">
027&nbsp;&nbsp;;;;;&nbsp;GNU&nbsp;General&nbsp;Public&nbsp;License&nbsp;for&nbsp;more&nbsp;details.
</span><br/>
<span class="not-tracked" title="0 out of 0 forms covered">
028&nbsp;&nbsp;;;;;
</span><br/>
<span class="not-tracked" title="0 out of 0 forms covered">
029&nbsp;&nbsp;;;;;&nbsp;You&nbsp;should&nbsp;have&nbsp;received&nbsp;a&nbsp;copy&nbsp;of&nbsp;the&nbsp;GNU&nbsp;General&nbsp;Public&nbsp;License
</span><br/>
<span class="not-tracked" title="0 out of 0 forms covered">
030&nbsp;&nbsp;;;;;&nbsp;along&nbsp;with&nbsp;this&nbsp;program;&nbsp;if&nbsp;not,&nbsp;write&nbsp;to&nbsp;the&nbsp;Free&nbsp;Software
</span><br/>
<span class="not-tracked" title="0 out of 0 forms covered">
031&nbsp;&nbsp;;;;;&nbsp;Foundation,&nbsp;Inc.,&nbsp;51&nbsp;Franklin&nbsp;Street,&nbsp;Fifth&nbsp;Floor,&nbsp;Boston,&nbsp;MA&nbsp;&nbsp;02110-1301,
</span><br/>
<span class="not-tracked" title="0 out of 0 forms covered">
032&nbsp;&nbsp;;;;;&nbsp;USA.
</span><br/>
<span class="not-tracked" title="0 out of 0 forms covered">
033&nbsp;&nbsp;;;;;
</span><br/>
<span class="not-tracked" title="0 out of 0 forms covered">
034&nbsp;&nbsp;;;;;&nbsp;Copyright&nbsp;(C)&nbsp;2014&nbsp;Simon&nbsp;Brooke
</span><br/>
<span class="not-tracked" title="0 out of 0 forms covered">
035&nbsp;&nbsp;;;;;
</span><br/>
<span class="not-tracked" title="0 out of 0 forms covered">
036&nbsp;&nbsp;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
</span><br/>
<span class="blank" title="0 out of 0 forms covered">
037&nbsp;&nbsp;
</span><br/>
<span class="covered" title="3 out of 3 forms covered">
038&nbsp;&nbsp;(defroutes&nbsp;app-routes
</span><br/>
<span class="covered" title="3 out of 3 forms covered">
039&nbsp;&nbsp;&nbsp;&nbsp;(route&#x2F;resources&nbsp;&quot;&#x2F;&quot;)
</span><br/>
<span class="covered" title="3 out of 3 forms covered">
040&nbsp;&nbsp;&nbsp;&nbsp;(route&#x2F;not-found&nbsp;&quot;Not&nbsp;Found&quot;))
</span><br/>
<span class="blank" title="0 out of 0 forms covered">
041&nbsp;&nbsp;
</span><br/>
<span class="blank" title="0 out of 0 forms covered">
042&nbsp;&nbsp;
</span><br/>
<span class="covered" title="1 out of 1 forms covered">
043&nbsp;&nbsp;(defn&nbsp;init
</span><br/>
<span class="not-tracked" title="0 out of 0 forms covered">
044&nbsp;&nbsp;&nbsp;&nbsp;&quot;init&nbsp;will&nbsp;be&nbsp;called&nbsp;once&nbsp;when
</span><br/>
<span class="not-tracked" title="0 out of 0 forms covered">
045&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;app&nbsp;is&nbsp;deployed&nbsp;as&nbsp;a&nbsp;servlet&nbsp;on
</span><br/>
<span class="not-tracked" title="0 out of 0 forms covered">
046&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;an&nbsp;app&nbsp;server&nbsp;such&nbsp;as&nbsp;Tomcat
</span><br/>
<span class="not-tracked" title="0 out of 0 forms covered">
047&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;put&nbsp;any&nbsp;initialization&nbsp;code&nbsp;here&quot;
</span><br/>
<span class="not-tracked" title="0 out of 0 forms covered">
048&nbsp;&nbsp;&nbsp;&nbsp;[]
</span><br/>
<span class="not-tracked" title="0 out of 0 forms covered">
049&nbsp;&nbsp;&nbsp;&nbsp;;;&nbsp;TODO&nbsp;fix&nbsp;timbre&nbsp;config!
</span><br/>
<span class="not-tracked" title="0 out of 0 forms covered">
050&nbsp;&nbsp;&nbsp;&nbsp;;;&nbsp;(timbre&#x2F;set-config!
</span><br/>
<span class="not-tracked" title="0 out of 0 forms covered">
051&nbsp;&nbsp;&nbsp;&nbsp;;;&nbsp;&nbsp;&nbsp;[:appenders&nbsp;:rotor]
</span><br/>
<span class="not-tracked" title="0 out of 0 forms covered">
052&nbsp;&nbsp;&nbsp;&nbsp;;;&nbsp;&nbsp;&nbsp;{:min-level&nbsp;:info
</span><br/>
<span class="not-tracked" title="0 out of 0 forms covered">
053&nbsp;&nbsp;&nbsp;&nbsp;;;&nbsp;&nbsp;&nbsp;&nbsp;:enabled?&nbsp;true
</span><br/>
<span class="not-tracked" title="0 out of 0 forms covered">
054&nbsp;&nbsp;&nbsp;&nbsp;;;&nbsp;&nbsp;&nbsp;&nbsp;:async?&nbsp;false&nbsp;;&nbsp;should&nbsp;be&nbsp;always&nbsp;false&nbsp;for&nbsp;rotor
</span><br/>
<span class="not-tracked" title="0 out of 0 forms covered">
055&nbsp;&nbsp;&nbsp;&nbsp;;;&nbsp;&nbsp;&nbsp;&nbsp;:max-message-per-msecs&nbsp;nil
</span><br/>
<span class="not-tracked" title="0 out of 0 forms covered">
056&nbsp;&nbsp;&nbsp;&nbsp;;;&nbsp;&nbsp;&nbsp;&nbsp;:fn&nbsp;rotor&#x2F;appender-fn})
</span><br/>
<span class="not-tracked" title="0 out of 0 forms covered">
057&nbsp;&nbsp;&nbsp;&nbsp;;;&nbsp;(timbre&#x2F;set-config!
</span><br/>
<span class="not-tracked" title="0 out of 0 forms covered">
058&nbsp;&nbsp;&nbsp;&nbsp;;;&nbsp;&nbsp;&nbsp;[:shared-appender-config&nbsp;:rotor]
</span><br/>
<span class="not-tracked" title="0 out of 0 forms covered">
059&nbsp;&nbsp;&nbsp;&nbsp;;;&nbsp;&nbsp;&nbsp;{:path&nbsp;&quot;mw_ui.log&quot;&nbsp;:max-size&nbsp;(*&nbsp;512&nbsp;1024)&nbsp;:backlog&nbsp;10})
</span><br/>
<span class="blank" title="0 out of 0 forms covered">
060&nbsp;&nbsp;
</span><br/>
<span class="blank" title="0 out of 0 forms covered">
061&nbsp;&nbsp;
</span><br/>
<span class="not-covered" title="0 out of 7 forms covered">
062&nbsp;&nbsp;&nbsp;&nbsp;(when&nbsp;(env&nbsp;:dev)&nbsp;(parser&#x2F;cache-off!))
</span><br/>
<span class="not-covered" title="0 out of 16 forms covered">
063&nbsp;&nbsp;&nbsp;&nbsp;(timbre&#x2F;info&nbsp;&quot;mw-ui&nbsp;started&nbsp;successfully&quot;))
</span><br/>
<span class="blank" title="0 out of 0 forms covered">
064&nbsp;&nbsp;
</span><br/>
<span class="blank" title="0 out of 0 forms covered">
065&nbsp;&nbsp;
</span><br/>
<span class="covered" title="1 out of 1 forms covered">
066&nbsp;&nbsp;(defn&nbsp;destroy
</span><br/>
<span class="not-tracked" title="0 out of 0 forms covered">
067&nbsp;&nbsp;&nbsp;&nbsp;&quot;destroy&nbsp;will&nbsp;be&nbsp;called&nbsp;when&nbsp;your&nbsp;application
</span><br/>
<span class="not-tracked" title="0 out of 0 forms covered">
068&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;shuts&nbsp;down,&nbsp;put&nbsp;any&nbsp;clean&nbsp;up&nbsp;code&nbsp;here&quot;
</span><br/>
<span class="not-tracked" title="0 out of 0 forms covered">
069&nbsp;&nbsp;&nbsp;&nbsp;[]
</span><br/>
<span class="not-covered" title="0 out of 16 forms covered">
070&nbsp;&nbsp;&nbsp;&nbsp;(timbre&#x2F;info&nbsp;&quot;mw-ui&nbsp;is&nbsp;shutting&nbsp;down...&quot;))
</span><br/>
<span class="blank" title="0 out of 0 forms covered">
071&nbsp;&nbsp;
</span><br/>
<span class="blank" title="0 out of 0 forms covered">
072&nbsp;&nbsp;
</span><br/>
<span class="covered" title="7 out of 7 forms covered">
073&nbsp;&nbsp;(def&nbsp;app&nbsp;(app-handler
</span><br/>
<span class="not-tracked" title="0 out of 0 forms covered">
074&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;;;&nbsp;add&nbsp;your&nbsp;application&nbsp;routes&nbsp;here
</span><br/>
<span class="covered" title="3 out of 3 forms covered">
075&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;[home-routes&nbsp;app-routes]
</span><br/>
<span class="not-tracked" title="0 out of 0 forms covered">
076&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;;;&nbsp;add&nbsp;custom&nbsp;middleware&nbsp;here
</span><br/>
<span class="covered" title="2 out of 2 forms covered">
077&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;:middleware&nbsp;(load-middleware)
</span><br/>
<span class="not-tracked" title="0 out of 0 forms covered">
078&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;;;&nbsp;timeout&nbsp;sessions&nbsp;after&nbsp;30&nbsp;minutes
</span><br/>
<span class="covered" title="6 out of 6 forms covered">
079&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;:session-options&nbsp;{:timeout&nbsp;(*&nbsp;60&nbsp;30)
</span><br/>
<span class="covered" title="3 out of 3 forms covered">
080&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;:timeout-response&nbsp;(redirect&nbsp;&quot;&#x2F;&quot;)}
</span><br/>
<span class="not-tracked" title="0 out of 0 forms covered">
081&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;;;&nbsp;add&nbsp;access&nbsp;rules&nbsp;here
</span><br/>
<span class="covered" title="1 out of 1 forms covered">
082&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;:access-rules&nbsp;[]
</span><br/>
<span class="not-tracked" title="0 out of 0 forms covered">
083&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;;;&nbsp;serialize&#x2F;deserialize&nbsp;the&nbsp;following&nbsp;data&nbsp;formats
</span><br/>
<span class="not-tracked" title="0 out of 0 forms covered">
084&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;;;&nbsp;available&nbsp;formats:
</span><br/>
<span class="not-tracked" title="0 out of 0 forms covered">
085&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;;;&nbsp;:json&nbsp;:json-kw&nbsp;:yaml&nbsp;:yaml-kw&nbsp;:edn&nbsp;:yaml-in-html
</span><br/>
<span class="covered" title="3 out of 3 forms covered">
086&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;:formats&nbsp;[:json-kw&nbsp;:edn]))
</span><br/>
</body>
</html>

View file

@ -1,161 +0,0 @@
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
<link rel="stylesheet" href="../coverage.css"/> <title> mw_ui/layout.clj </title>
</head>
<body>
<span class="covered" title="1 out of 1 forms covered">
001&nbsp;&nbsp;(ns&nbsp;^{:doc&nbsp;&quot;Layout&nbsp;content&nbsp;as&nbsp;HTML.&quot;
</span><br/>
<span class="not-tracked" title="0 out of 0 forms covered">
002&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;:author&nbsp;&quot;Simon&nbsp;Brooke&quot;}
</span><br/>
<span class="not-tracked" title="0 out of 0 forms covered">
003&nbsp;&nbsp;&nbsp;&nbsp;mw-ui.layout
</span><br/>
<span class="not-tracked" title="0 out of 0 forms covered">
004&nbsp;&nbsp;&nbsp;&nbsp;(:require&nbsp;[selmer.parser&nbsp;:as&nbsp;parser]
</span><br/>
<span class="not-tracked" title="0 out of 0 forms covered">
005&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;[clojure.string&nbsp;:as&nbsp;s]
</span><br/>
<span class="not-tracked" title="0 out of 0 forms covered">
006&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;[ring.util.response&nbsp;:refer&nbsp;[content-type&nbsp;response]]
</span><br/>
<span class="not-tracked" title="0 out of 0 forms covered">
007&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;[compojure.response&nbsp;:refer&nbsp;[Renderable]]))
</span><br/>
<span class="blank" title="0 out of 0 forms covered">
008&nbsp;&nbsp;
</span><br/>
<span class="not-tracked" title="0 out of 0 forms covered">
009&nbsp;&nbsp;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
</span><br/>
<span class="not-tracked" title="0 out of 0 forms covered">
010&nbsp;&nbsp;;;;;
</span><br/>
<span class="not-tracked" title="0 out of 0 forms covered">
011&nbsp;&nbsp;;;;;&nbsp;mw-ui:&nbsp;a&nbsp;servlet&nbsp;user&#x2F;visualisation&nbsp;interface&nbsp;for&nbsp;MicroWorld.
</span><br/>
<span class="not-tracked" title="0 out of 0 forms covered">
012&nbsp;&nbsp;;;;;
</span><br/>
<span class="not-tracked" title="0 out of 0 forms covered">
013&nbsp;&nbsp;;;;;&nbsp;This&nbsp;program&nbsp;is&nbsp;free&nbsp;software;&nbsp;you&nbsp;can&nbsp;redistribute&nbsp;it&nbsp;and&#x2F;or
</span><br/>
<span class="not-tracked" title="0 out of 0 forms covered">
014&nbsp;&nbsp;;;;;&nbsp;modify&nbsp;it&nbsp;under&nbsp;the&nbsp;terms&nbsp;of&nbsp;the&nbsp;GNU&nbsp;General&nbsp;Public&nbsp;License
</span><br/>
<span class="not-tracked" title="0 out of 0 forms covered">
015&nbsp;&nbsp;;;;;&nbsp;as&nbsp;published&nbsp;by&nbsp;the&nbsp;Free&nbsp;Software&nbsp;Foundation;&nbsp;either&nbsp;version&nbsp;2
</span><br/>
<span class="not-tracked" title="0 out of 0 forms covered">
016&nbsp;&nbsp;;;;;&nbsp;of&nbsp;the&nbsp;License,&nbsp;or&nbsp;(at&nbsp;your&nbsp;option)&nbsp;any&nbsp;later&nbsp;version.
</span><br/>
<span class="not-tracked" title="0 out of 0 forms covered">
017&nbsp;&nbsp;;;;;
</span><br/>
<span class="not-tracked" title="0 out of 0 forms covered">
018&nbsp;&nbsp;;;;;&nbsp;This&nbsp;program&nbsp;is&nbsp;distributed&nbsp;in&nbsp;the&nbsp;hope&nbsp;that&nbsp;it&nbsp;will&nbsp;be&nbsp;useful,
</span><br/>
<span class="not-tracked" title="0 out of 0 forms covered">
019&nbsp;&nbsp;;;;;&nbsp;but&nbsp;WITHOUT&nbsp;ANY&nbsp;WARRANTY;&nbsp;without&nbsp;even&nbsp;the&nbsp;implied&nbsp;warranty&nbsp;of
</span><br/>
<span class="not-tracked" title="0 out of 0 forms covered">
020&nbsp;&nbsp;;;;;&nbsp;MERCHANTABILITY&nbsp;or&nbsp;FITNESS&nbsp;FOR&nbsp;A&nbsp;PARTICULAR&nbsp;PURPOSE.&nbsp;&nbsp;See&nbsp;the
</span><br/>
<span class="not-tracked" title="0 out of 0 forms covered">
021&nbsp;&nbsp;;;;;&nbsp;GNU&nbsp;General&nbsp;Public&nbsp;License&nbsp;for&nbsp;more&nbsp;details.
</span><br/>
<span class="not-tracked" title="0 out of 0 forms covered">
022&nbsp;&nbsp;;;;;
</span><br/>
<span class="not-tracked" title="0 out of 0 forms covered">
023&nbsp;&nbsp;;;;;&nbsp;You&nbsp;should&nbsp;have&nbsp;received&nbsp;a&nbsp;copy&nbsp;of&nbsp;the&nbsp;GNU&nbsp;General&nbsp;Public&nbsp;License
</span><br/>
<span class="not-tracked" title="0 out of 0 forms covered">
024&nbsp;&nbsp;;;;;&nbsp;along&nbsp;with&nbsp;this&nbsp;program;&nbsp;if&nbsp;not,&nbsp;write&nbsp;to&nbsp;the&nbsp;Free&nbsp;Software
</span><br/>
<span class="not-tracked" title="0 out of 0 forms covered">
025&nbsp;&nbsp;;;;;&nbsp;Foundation,&nbsp;Inc.,&nbsp;51&nbsp;Franklin&nbsp;Street,&nbsp;Fifth&nbsp;Floor,&nbsp;Boston,&nbsp;MA&nbsp;&nbsp;02110-1301,
</span><br/>
<span class="not-tracked" title="0 out of 0 forms covered">
026&nbsp;&nbsp;;;;;&nbsp;USA.
</span><br/>
<span class="not-tracked" title="0 out of 0 forms covered">
027&nbsp;&nbsp;;;;;
</span><br/>
<span class="not-tracked" title="0 out of 0 forms covered">
028&nbsp;&nbsp;;;;;&nbsp;Copyright&nbsp;(C)&nbsp;2014&nbsp;Simon&nbsp;Brooke
</span><br/>
<span class="not-tracked" title="0 out of 0 forms covered">
029&nbsp;&nbsp;;;;;
</span><br/>
<span class="not-tracked" title="0 out of 0 forms covered">
030&nbsp;&nbsp;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
</span><br/>
<span class="blank" title="0 out of 0 forms covered">
031&nbsp;&nbsp;
</span><br/>
<span class="blank" title="0 out of 0 forms covered">
032&nbsp;&nbsp;
</span><br/>
<span class="covered" title="2 out of 2 forms covered">
033&nbsp;&nbsp;(def&nbsp;template-path&nbsp;&quot;templates&#x2F;&quot;)
</span><br/>
<span class="blank" title="0 out of 0 forms covered">
034&nbsp;&nbsp;
</span><br/>
<span class="partial" title="5 out of 8 forms covered">
035&nbsp;&nbsp;(deftype&nbsp;RenderableTemplate&nbsp;[template&nbsp;params]
</span><br/>
<span class="not-tracked" title="0 out of 0 forms covered">
036&nbsp;&nbsp;&nbsp;&nbsp;Renderable
</span><br/>
<span class="not-tracked" title="0 out of 0 forms covered">
037&nbsp;&nbsp;&nbsp;&nbsp;(render&nbsp;[_&nbsp;request]
</span><br/>
<span class="covered" title="3 out of 3 forms covered">
038&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;(content-type
</span><br/>
<span class="covered" title="12 out of 12 forms covered">
039&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;(-&gt;&gt;&nbsp;(assoc&nbsp;(merge&nbsp;params&nbsp;{:version&nbsp;(System&#x2F;getProperty&nbsp;&quot;mw-ui.version&quot;)})
</span><br/>
<span class="covered" title="7 out of 7 forms covered">
040&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;(keyword&nbsp;(s&#x2F;replace&nbsp;template&nbsp;#&quot;.html&quot;&nbsp;&quot;-selected&quot;))&nbsp;&quot;active&quot;
</span><br/>
<span class="not-tracked" title="0 out of 0 forms covered">
041&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;:servlet-context
</span><br/>
<span class="partial" title="6 out of 9 forms covered">
042&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;(when-let&nbsp;[context&nbsp;(:servlet-context&nbsp;request)]
</span><br/>
<span class="not-covered" title="0 out of 1 forms covered">
043&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;(.getContextPath&nbsp;context)))
</span><br/>
<span class="covered" title="6 out of 6 forms covered">
044&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;(parser&#x2F;render-file&nbsp;(str&nbsp;template-path&nbsp;template))
</span><br/>
<span class="covered" title="1 out of 1 forms covered">
045&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;response)
</span><br/>
<span class="not-tracked" title="0 out of 0 forms covered">
046&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&quot;text&#x2F;html;&nbsp;charset=utf-8&quot;)))
</span><br/>
<span class="blank" title="0 out of 0 forms covered">
047&nbsp;&nbsp;
</span><br/>
<span class="blank" title="0 out of 0 forms covered">
048&nbsp;&nbsp;
</span><br/>
<span class="covered" title="1 out of 1 forms covered">
049&nbsp;&nbsp;(defn&nbsp;render&nbsp;[template&nbsp;&amp;&nbsp;[params]]
</span><br/>
<span class="covered" title="3 out of 3 forms covered">
050&nbsp;&nbsp;&nbsp;&nbsp;(RenderableTemplate.&nbsp;template&nbsp;params))
</span><br/>
<span class="blank" title="0 out of 0 forms covered">
051&nbsp;&nbsp;
</span><br/>
</body>
</html>

View file

@ -1,164 +0,0 @@
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
<link rel="stylesheet" href="../coverage.css"/> <title> mw_ui/middleware.clj </title>
</head>
<body>
<span class="covered" title="1 out of 1 forms covered">
001&nbsp;&nbsp;(ns&nbsp;^{:doc&nbsp;&quot;In&nbsp;truth,&nbsp;boilerplate&nbsp;from&nbsp;Luminus.&quot;
</span><br/>
<span class="not-tracked" title="0 out of 0 forms covered">
002&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;:author&nbsp;&quot;Simon&nbsp;Brooke&quot;}
</span><br/>
<span class="not-tracked" title="0 out of 0 forms covered">
003&nbsp;&nbsp;&nbsp;mw-ui.middleware
</span><br/>
<span class="not-tracked" title="0 out of 0 forms covered">
004&nbsp;&nbsp;&nbsp;&nbsp;(:require&nbsp;[taoensso.timbre&nbsp;:as&nbsp;timbre]
</span><br/>
<span class="not-tracked" title="0 out of 0 forms covered">
005&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;[environ.core&nbsp;:refer&nbsp;[env]]
</span><br/>
<span class="not-tracked" title="0 out of 0 forms covered">
006&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;[selmer.middleware&nbsp;:refer&nbsp;[wrap-error-page]]
</span><br/>
<span class="not-tracked" title="0 out of 0 forms covered">
007&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;[noir-exception.core
</span><br/>
<span class="not-tracked" title="0 out of 0 forms covered">
008&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;:refer&nbsp;[wrap-internal-error&nbsp;wrap-exceptions]]))
</span><br/>
<span class="blank" title="0 out of 0 forms covered">
009&nbsp;&nbsp;
</span><br/>
<span class="not-tracked" title="0 out of 0 forms covered">
010&nbsp;&nbsp;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
</span><br/>
<span class="not-tracked" title="0 out of 0 forms covered">
011&nbsp;&nbsp;;;;;
</span><br/>
<span class="not-tracked" title="0 out of 0 forms covered">
012&nbsp;&nbsp;;;;;&nbsp;mw-ui:&nbsp;a&nbsp;servlet&nbsp;user&#x2F;visualisation&nbsp;interface&nbsp;for&nbsp;MicroWorld.
</span><br/>
<span class="not-tracked" title="0 out of 0 forms covered">
013&nbsp;&nbsp;;;;;
</span><br/>
<span class="not-tracked" title="0 out of 0 forms covered">
014&nbsp;&nbsp;;;;;&nbsp;This&nbsp;program&nbsp;is&nbsp;free&nbsp;software;&nbsp;you&nbsp;can&nbsp;redistribute&nbsp;it&nbsp;and&#x2F;or
</span><br/>
<span class="not-tracked" title="0 out of 0 forms covered">
015&nbsp;&nbsp;;;;;&nbsp;modify&nbsp;it&nbsp;under&nbsp;the&nbsp;terms&nbsp;of&nbsp;the&nbsp;GNU&nbsp;General&nbsp;Public&nbsp;License
</span><br/>
<span class="not-tracked" title="0 out of 0 forms covered">
016&nbsp;&nbsp;;;;;&nbsp;as&nbsp;published&nbsp;by&nbsp;the&nbsp;Free&nbsp;Software&nbsp;Foundation;&nbsp;either&nbsp;version&nbsp;2
</span><br/>
<span class="not-tracked" title="0 out of 0 forms covered">
017&nbsp;&nbsp;;;;;&nbsp;of&nbsp;the&nbsp;License,&nbsp;or&nbsp;(at&nbsp;your&nbsp;option)&nbsp;any&nbsp;later&nbsp;version.
</span><br/>
<span class="not-tracked" title="0 out of 0 forms covered">
018&nbsp;&nbsp;;;;;
</span><br/>
<span class="not-tracked" title="0 out of 0 forms covered">
019&nbsp;&nbsp;;;;;&nbsp;This&nbsp;program&nbsp;is&nbsp;distributed&nbsp;in&nbsp;the&nbsp;hope&nbsp;that&nbsp;it&nbsp;will&nbsp;be&nbsp;useful,
</span><br/>
<span class="not-tracked" title="0 out of 0 forms covered">
020&nbsp;&nbsp;;;;;&nbsp;but&nbsp;WITHOUT&nbsp;ANY&nbsp;WARRANTY;&nbsp;without&nbsp;even&nbsp;the&nbsp;implied&nbsp;warranty&nbsp;of
</span><br/>
<span class="not-tracked" title="0 out of 0 forms covered">
021&nbsp;&nbsp;;;;;&nbsp;MERCHANTABILITY&nbsp;or&nbsp;FITNESS&nbsp;FOR&nbsp;A&nbsp;PARTICULAR&nbsp;PURPOSE.&nbsp;&nbsp;See&nbsp;the
</span><br/>
<span class="not-tracked" title="0 out of 0 forms covered">
022&nbsp;&nbsp;;;;;&nbsp;GNU&nbsp;General&nbsp;Public&nbsp;License&nbsp;for&nbsp;more&nbsp;details.
</span><br/>
<span class="not-tracked" title="0 out of 0 forms covered">
023&nbsp;&nbsp;;;;;
</span><br/>
<span class="not-tracked" title="0 out of 0 forms covered">
024&nbsp;&nbsp;;;;;&nbsp;You&nbsp;should&nbsp;have&nbsp;received&nbsp;a&nbsp;copy&nbsp;of&nbsp;the&nbsp;GNU&nbsp;General&nbsp;Public&nbsp;License
</span><br/>
<span class="not-tracked" title="0 out of 0 forms covered">
025&nbsp;&nbsp;;;;;&nbsp;along&nbsp;with&nbsp;this&nbsp;program;&nbsp;if&nbsp;not,&nbsp;write&nbsp;to&nbsp;the&nbsp;Free&nbsp;Software
</span><br/>
<span class="not-tracked" title="0 out of 0 forms covered">
026&nbsp;&nbsp;;;;;&nbsp;Foundation,&nbsp;Inc.,&nbsp;51&nbsp;Franklin&nbsp;Street,&nbsp;Fifth&nbsp;Floor,&nbsp;Boston,&nbsp;MA&nbsp;&nbsp;02110-1301,
</span><br/>
<span class="not-tracked" title="0 out of 0 forms covered">
027&nbsp;&nbsp;;;;;&nbsp;USA.
</span><br/>
<span class="not-tracked" title="0 out of 0 forms covered">
028&nbsp;&nbsp;;;;;
</span><br/>
<span class="not-tracked" title="0 out of 0 forms covered">
029&nbsp;&nbsp;;;;;&nbsp;Copyright&nbsp;(C)&nbsp;2014&nbsp;Simon&nbsp;Brooke
</span><br/>
<span class="not-tracked" title="0 out of 0 forms covered">
030&nbsp;&nbsp;;;;;
</span><br/>
<span class="not-tracked" title="0 out of 0 forms covered">
031&nbsp;&nbsp;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
</span><br/>
<span class="blank" title="0 out of 0 forms covered">
032&nbsp;&nbsp;
</span><br/>
<span class="blank" title="0 out of 0 forms covered">
033&nbsp;&nbsp;
</span><br/>
<span class="covered" title="1 out of 1 forms covered">
034&nbsp;&nbsp;(defn&nbsp;log-request&nbsp;[handler]
</span><br/>
<span class="covered" title="1 out of 1 forms covered">
035&nbsp;&nbsp;&nbsp;&nbsp;(fn&nbsp;[req]
</span><br/>
<span class="covered" title="16 out of 16 forms covered">
036&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;(timbre&#x2F;debug&nbsp;req)
</span><br/>
<span class="covered" title="3 out of 3 forms covered">
037&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;(handler&nbsp;req)))
</span><br/>
<span class="blank" title="0 out of 0 forms covered">
038&nbsp;&nbsp;
</span><br/>
<span class="blank" title="0 out of 0 forms covered">
039&nbsp;&nbsp;
</span><br/>
<span class="covered" title="1 out of 1 forms covered">
040&nbsp;&nbsp;(def&nbsp;development-middleware
</span><br/>
<span class="covered" title="2 out of 2 forms covered">
041&nbsp;&nbsp;&nbsp;&nbsp;[log-request
</span><br/>
<span class="covered" title="1 out of 1 forms covered">
042&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;wrap-error-page
</span><br/>
<span class="covered" title="1 out of 1 forms covered">
043&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;wrap-exceptions])
</span><br/>
<span class="blank" title="0 out of 0 forms covered">
044&nbsp;&nbsp;
</span><br/>
<span class="blank" title="0 out of 0 forms covered">
045&nbsp;&nbsp;
</span><br/>
<span class="covered" title="1 out of 1 forms covered">
046&nbsp;&nbsp;(def&nbsp;production-middleware
</span><br/>
<span class="partial" title="7 out of 23 forms covered">
047&nbsp;&nbsp;&nbsp;&nbsp;[#(wrap-internal-error&nbsp;%&nbsp;:log&nbsp;(fn&nbsp;[e]&nbsp;(timbre&#x2F;error&nbsp;e)))])
</span><br/>
<span class="blank" title="0 out of 0 forms covered">
048&nbsp;&nbsp;
</span><br/>
<span class="blank" title="0 out of 0 forms covered">
049&nbsp;&nbsp;
</span><br/>
<span class="covered" title="1 out of 1 forms covered">
050&nbsp;&nbsp;(defn&nbsp;load-middleware&nbsp;[]
</span><br/>
<span class="covered" title="8 out of 8 forms covered">
051&nbsp;&nbsp;&nbsp;&nbsp;(concat&nbsp;(when&nbsp;(env&nbsp;:dev)&nbsp;development-middleware)
</span><br/>
<span class="covered" title="1 out of 1 forms covered">
052&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;production-middleware))
</span><br/>
</body>
</html>

View file

@ -1,320 +0,0 @@
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
<link rel="stylesheet" href="../coverage.css"/> <title> mw_ui/render_world.clj </title>
</head>
<body>
<span class="covered" title="1 out of 1 forms covered">
001&nbsp;&nbsp;(ns&nbsp;^{:doc&nbsp;&quot;Render&nbsp;the&nbsp;state&nbsp;of&nbsp;the&nbsp;world&nbsp;as&nbsp;an&nbsp;HTML&nbsp;table.&quot;
</span><br/>
<span class="not-tracked" title="0 out of 0 forms covered">
002&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;:author&nbsp;&quot;Simon&nbsp;Brooke&quot;}
</span><br/>
<span class="not-tracked" title="0 out of 0 forms covered">
003&nbsp;&nbsp;&nbsp;&nbsp;mw-ui.render-world
</span><br/>
<span class="not-tracked" title="0 out of 0 forms covered">
004&nbsp;&nbsp;&nbsp;&nbsp;(:require&nbsp;[mw-engine.core&nbsp;:as&nbsp;engine]
</span><br/>
<span class="not-tracked" title="0 out of 0 forms covered">
005&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;[mw-engine.heightmap&nbsp;:as&nbsp;heightmap]
</span><br/>
<span class="not-tracked" title="0 out of 0 forms covered">
006&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;[mw-parser.bulk&nbsp;:as&nbsp;compiler]
</span><br/>
<span class="not-tracked" title="0 out of 0 forms covered">
007&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;[noir.io&nbsp;:as&nbsp;io]
</span><br/>
<span class="not-tracked" title="0 out of 0 forms covered">
008&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;[noir.session&nbsp;:as&nbsp;session]))
</span><br/>
<span class="blank" title="0 out of 0 forms covered">
009&nbsp;&nbsp;
</span><br/>
<span class="not-tracked" title="0 out of 0 forms covered">
010&nbsp;&nbsp;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
</span><br/>
<span class="not-tracked" title="0 out of 0 forms covered">
011&nbsp;&nbsp;;;;;
</span><br/>
<span class="not-tracked" title="0 out of 0 forms covered">
012&nbsp;&nbsp;;;;;&nbsp;mw-ui:&nbsp;a&nbsp;servlet&nbsp;user&#x2F;visualisation&nbsp;interface&nbsp;for&nbsp;MicroWorld.
</span><br/>
<span class="not-tracked" title="0 out of 0 forms covered">
013&nbsp;&nbsp;;;;;
</span><br/>
<span class="not-tracked" title="0 out of 0 forms covered">
014&nbsp;&nbsp;;;;;&nbsp;This&nbsp;program&nbsp;is&nbsp;free&nbsp;software;&nbsp;you&nbsp;can&nbsp;redistribute&nbsp;it&nbsp;and&#x2F;or
</span><br/>
<span class="not-tracked" title="0 out of 0 forms covered">
015&nbsp;&nbsp;;;;;&nbsp;modify&nbsp;it&nbsp;under&nbsp;the&nbsp;terms&nbsp;of&nbsp;the&nbsp;GNU&nbsp;General&nbsp;Public&nbsp;License
</span><br/>
<span class="not-tracked" title="0 out of 0 forms covered">
016&nbsp;&nbsp;;;;;&nbsp;as&nbsp;published&nbsp;by&nbsp;the&nbsp;Free&nbsp;Software&nbsp;Foundation;&nbsp;either&nbsp;version&nbsp;2
</span><br/>
<span class="not-tracked" title="0 out of 0 forms covered">
017&nbsp;&nbsp;;;;;&nbsp;of&nbsp;the&nbsp;License,&nbsp;or&nbsp;(at&nbsp;your&nbsp;option)&nbsp;any&nbsp;later&nbsp;version.
</span><br/>
<span class="not-tracked" title="0 out of 0 forms covered">
018&nbsp;&nbsp;;;;;
</span><br/>
<span class="not-tracked" title="0 out of 0 forms covered">
019&nbsp;&nbsp;;;;;&nbsp;This&nbsp;program&nbsp;is&nbsp;distributed&nbsp;in&nbsp;the&nbsp;hope&nbsp;that&nbsp;it&nbsp;will&nbsp;be&nbsp;useful,
</span><br/>
<span class="not-tracked" title="0 out of 0 forms covered">
020&nbsp;&nbsp;;;;;&nbsp;but&nbsp;WITHOUT&nbsp;ANY&nbsp;WARRANTY;&nbsp;without&nbsp;even&nbsp;the&nbsp;implied&nbsp;warranty&nbsp;of
</span><br/>
<span class="not-tracked" title="0 out of 0 forms covered">
021&nbsp;&nbsp;;;;;&nbsp;MERCHANTABILITY&nbsp;or&nbsp;FITNESS&nbsp;FOR&nbsp;A&nbsp;PARTICULAR&nbsp;PURPOSE.&nbsp;&nbsp;See&nbsp;the
</span><br/>
<span class="not-tracked" title="0 out of 0 forms covered">
022&nbsp;&nbsp;;;;;&nbsp;GNU&nbsp;General&nbsp;Public&nbsp;License&nbsp;for&nbsp;more&nbsp;details.
</span><br/>
<span class="not-tracked" title="0 out of 0 forms covered">
023&nbsp;&nbsp;;;;;
</span><br/>
<span class="not-tracked" title="0 out of 0 forms covered">
024&nbsp;&nbsp;;;;;&nbsp;You&nbsp;should&nbsp;have&nbsp;received&nbsp;a&nbsp;copy&nbsp;of&nbsp;the&nbsp;GNU&nbsp;General&nbsp;Public&nbsp;License
</span><br/>
<span class="not-tracked" title="0 out of 0 forms covered">
025&nbsp;&nbsp;;;;;&nbsp;along&nbsp;with&nbsp;this&nbsp;program;&nbsp;if&nbsp;not,&nbsp;write&nbsp;to&nbsp;the&nbsp;Free&nbsp;Software
</span><br/>
<span class="not-tracked" title="0 out of 0 forms covered">
026&nbsp;&nbsp;;;;;&nbsp;Foundation,&nbsp;Inc.,&nbsp;51&nbsp;Franklin&nbsp;Street,&nbsp;Fifth&nbsp;Floor,&nbsp;Boston,&nbsp;MA&nbsp;&nbsp;02110-1301,
</span><br/>
<span class="not-tracked" title="0 out of 0 forms covered">
027&nbsp;&nbsp;;;;;&nbsp;USA.
</span><br/>
<span class="not-tracked" title="0 out of 0 forms covered">
028&nbsp;&nbsp;;;;;
</span><br/>
<span class="not-tracked" title="0 out of 0 forms covered">
029&nbsp;&nbsp;;;;;&nbsp;Copyright&nbsp;(C)&nbsp;2014&nbsp;Simon&nbsp;Brooke
</span><br/>
<span class="not-tracked" title="0 out of 0 forms covered">
030&nbsp;&nbsp;;;;;
</span><br/>
<span class="not-tracked" title="0 out of 0 forms covered">
031&nbsp;&nbsp;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
</span><br/>
<span class="blank" title="0 out of 0 forms covered">
032&nbsp;&nbsp;
</span><br/>
<span class="blank" title="0 out of 0 forms covered">
033&nbsp;&nbsp;
</span><br/>
<span class="covered" title="1 out of 1 forms covered">
034&nbsp;&nbsp;(defn&nbsp;format-css-class&nbsp;
</span><br/>
<span class="not-tracked" title="0 out of 0 forms covered">
035&nbsp;&nbsp;&nbsp;&nbsp;&quot;Format&nbsp;this&nbsp;statekey,&nbsp;assumed&nbsp;to&nbsp;be&nbsp;a&nbsp;keyword&nbsp;indicating&nbsp;a&nbsp;state&nbsp;in&nbsp;the
</span><br/>
<span class="not-tracked" title="0 out of 0 forms covered">
036&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;world,&nbsp;into&nbsp;a&nbsp;CSS&nbsp;class&quot;
</span><br/>
<span class="not-tracked" title="0 out of 0 forms covered">
037&nbsp;&nbsp;&nbsp;&nbsp;[statekey]
</span><br/>
<span class="not-covered" title="0 out of 6 forms covered">
038&nbsp;&nbsp;&nbsp;&nbsp;(subs&nbsp;(str&nbsp;statekey)&nbsp;1))
</span><br/>
<span class="blank" title="0 out of 0 forms covered">
039&nbsp;&nbsp;
</span><br/>
<span class="blank" title="0 out of 0 forms covered">
040&nbsp;&nbsp;
</span><br/>
<span class="covered" title="1 out of 1 forms covered">
041&nbsp;&nbsp;(defn&nbsp;format-image-path
</span><br/>
<span class="not-tracked" title="0 out of 0 forms covered">
042&nbsp;&nbsp;&nbsp;&nbsp;&quot;Render&nbsp;this&nbsp;statekey,&nbsp;assumed&nbsp;to&nbsp;be&nbsp;a&nbsp;keyword&nbsp;indicating&nbsp;a&nbsp;state&nbsp;in&nbsp;the
</span><br/>
<span class="not-tracked" title="0 out of 0 forms covered">
043&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;world,&nbsp;into&nbsp;a&nbsp;path&nbsp;which&nbsp;should&nbsp;recover&nbsp;the&nbsp;corresponding&nbsp;image&nbsp;file.&quot;
</span><br/>
<span class="not-tracked" title="0 out of 0 forms covered">
044&nbsp;&nbsp;&nbsp;&nbsp;[statekey]
</span><br/>
<span class="not-covered" title="0 out of 6 forms covered">
045&nbsp;&nbsp;&nbsp;&nbsp;(format&nbsp;&quot;img&#x2F;tiles&#x2F;%s.png&quot;&nbsp;(format-css-class&nbsp;statekey)))
</span><br/>
<span class="blank" title="0 out of 0 forms covered">
046&nbsp;&nbsp;
</span><br/>
<span class="blank" title="0 out of 0 forms covered">
047&nbsp;&nbsp;
</span><br/>
<span class="covered" title="1 out of 1 forms covered">
048&nbsp;&nbsp;(defn&nbsp;format-mouseover&nbsp;[cell]
</span><br/>
<span class="not-covered" title="0 out of 3 forms covered">
049&nbsp;&nbsp;&nbsp;&nbsp;(str&nbsp;cell))
</span><br/>
<span class="blank" title="0 out of 0 forms covered">
050&nbsp;&nbsp;
</span><br/>
<span class="blank" title="0 out of 0 forms covered">
051&nbsp;&nbsp;
</span><br/>
<span class="covered" title="1 out of 1 forms covered">
052&nbsp;&nbsp;(defn&nbsp;render-cell
</span><br/>
<span class="not-tracked" title="0 out of 0 forms covered">
053&nbsp;&nbsp;&nbsp;&nbsp;&quot;Render&nbsp;this&nbsp;world&nbsp;cell&nbsp;as&nbsp;a&nbsp;Hiccup&nbsp;table&nbsp;cell.&quot;
</span><br/>
<span class="not-tracked" title="0 out of 0 forms covered">
054&nbsp;&nbsp;&nbsp;&nbsp;[cell]
</span><br/>
<span class="not-covered" title="0 out of 4 forms covered">
055&nbsp;&nbsp;&nbsp;&nbsp;(let&nbsp;[state&nbsp;(:state&nbsp;cell)]
</span><br/>
<span class="not-covered" title="0 out of 11 forms covered">
056&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;[:td&nbsp;{:class&nbsp;(format-css-class&nbsp;state)&nbsp;:title&nbsp;(format-mouseover&nbsp;cell)}
</span><br/>
<span class="not-covered" title="0 out of 13 forms covered">
057&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;[:a&nbsp;{:href&nbsp;(format&nbsp;&quot;inspect?x=%d&amp;y=%d&quot;&nbsp;(:x&nbsp;cell)&nbsp;(:y&nbsp;cell))}
</span><br/>
<span class="not-covered" title="0 out of 11 forms covered">
058&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;[:img&nbsp;{:alt&nbsp;(:state&nbsp;cell)&nbsp;:src&nbsp;(format-image-path&nbsp;state)}]]]))
</span><br/>
<span class="blank" title="0 out of 0 forms covered">
059&nbsp;&nbsp;
</span><br/>
<span class="blank" title="0 out of 0 forms covered">
060&nbsp;&nbsp;
</span><br/>
<span class="covered" title="1 out of 1 forms covered">
061&nbsp;&nbsp;(defn&nbsp;render-world-row
</span><br/>
<span class="not-tracked" title="0 out of 0 forms covered">
062&nbsp;&nbsp;&nbsp;&nbsp;&quot;Render&nbsp;this&nbsp;world&nbsp;row&nbsp;as&nbsp;a&nbsp;Hiccup&nbsp;table&nbsp;row.&quot;
</span><br/>
<span class="not-tracked" title="0 out of 0 forms covered">
063&nbsp;&nbsp;&nbsp;&nbsp;[row]
</span><br/>
<span class="not-covered" title="0 out of 10 forms covered">
064&nbsp;&nbsp;&nbsp;&nbsp;(apply&nbsp;vector&nbsp;(cons&nbsp;:tr&nbsp;(map&nbsp;render-cell&nbsp;row))))
</span><br/>
<span class="blank" title="0 out of 0 forms covered">
065&nbsp;&nbsp;
</span><br/>
<span class="blank" title="0 out of 0 forms covered">
066&nbsp;&nbsp;
</span><br/>
<span class="covered" title="1 out of 1 forms covered">
067&nbsp;&nbsp;(defn&nbsp;render-world-table
</span><br/>
<span class="not-tracked" title="0 out of 0 forms covered">
068&nbsp;&nbsp;&nbsp;&nbsp;&quot;Render&nbsp;the&nbsp;world&nbsp;implied&nbsp;by&nbsp;the&nbsp;current&nbsp;session&nbsp;as&nbsp;a&nbsp;complete&nbsp;HTML&nbsp;table&nbsp;in&nbsp;a&nbsp;DIV.&quot;
</span><br/>
<span class="not-tracked" title="0 out of 0 forms covered">
069&nbsp;&nbsp;&nbsp;&nbsp;[]
</span><br/>
<span class="not-covered" title="0 out of 9 forms covered">
070&nbsp;&nbsp;&nbsp;&nbsp;(let&nbsp;[world&nbsp;(or&nbsp;(session&#x2F;get&nbsp;:world)
</span><br/>
<span class="not-covered" title="0 out of 1 forms covered">
071&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;(heightmap&#x2F;apply-heightmap
</span><br/>
<span class="not-covered" title="0 out of 3 forms covered">
072&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;(io&#x2F;get-resource&nbsp;&quot;&#x2F;img&#x2F;heightmaps&#x2F;small_hill.png&quot;)))
</span><br/>
<span class="not-covered" title="0 out of 8 forms covered">
073&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;rules&nbsp;(or&nbsp;(session&#x2F;get&nbsp;:rules)
</span><br/>
<span class="not-covered" title="0 out of 3 forms covered">
074&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;(do&nbsp;(session&#x2F;put!&nbsp;:rules
</span><br/>
<span class="not-covered" title="0 out of 2 forms covered">
075&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;(compiler&#x2F;compile-file
</span><br/>
<span class="not-covered" title="0 out of 3 forms covered">
076&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;(io&#x2F;get-resource&nbsp;&quot;&#x2F;rulesets&#x2F;basic.txt&quot;)))
</span><br/>
<span class="not-covered" title="0 out of 3 forms covered">
077&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;(session&#x2F;get&nbsp;:rules)))
</span><br/>
<span class="not-covered" title="0 out of 9 forms covered">
078&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;generation&nbsp;(inc&nbsp;(or&nbsp;(session&#x2F;get&nbsp;:generation)&nbsp;0))
</span><br/>
<span class="not-covered" title="0 out of 4 forms covered">
079&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;w2&nbsp;(engine&#x2F;transform-world&nbsp;world&nbsp;rules)
</span><br/>
<span class="not-tracked" title="0 out of 0 forms covered">
080&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;]
</span><br/>
<span class="not-covered" title="0 out of 4 forms covered">
081&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;(session&#x2F;put!&nbsp;:world&nbsp;w2)
</span><br/>
<span class="not-covered" title="0 out of 4 forms covered">
082&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;(session&#x2F;put!&nbsp;:generation&nbsp;generation)
</span><br/>
<span class="not-covered" title="0 out of 5 forms covered">
083&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;[:div&nbsp;{:class&nbsp;&quot;world&quot;}
</span><br/>
<span class="not-covered" title="0 out of 3 forms covered">
084&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;(apply&nbsp;vector
</span><br/>
<span class="not-covered" title="0 out of 3 forms covered">
085&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;(cons&nbsp;:table
</span><br/>
<span class="not-covered" title="0 out of 4 forms covered">
086&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;(map&nbsp;render-world-row&nbsp;w2)))
</span><br/>
<span class="not-covered" title="0 out of 2 forms covered">
087&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;[:p
</span><br/>
<span class="not-covered" title="0 out of 4 forms covered">
088&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;(str&nbsp;&quot;Generation&nbsp;&quot;&nbsp;generation)]]))
</span><br/>
<span class="blank" title="0 out of 0 forms covered">
089&nbsp;&nbsp;
</span><br/>
<span class="blank" title="0 out of 0 forms covered">
090&nbsp;&nbsp;
</span><br/>
<span class="covered" title="1 out of 1 forms covered">
091&nbsp;&nbsp;(defn&nbsp;render-inspector
</span><br/>
<span class="not-tracked" title="0 out of 0 forms covered">
092&nbsp;&nbsp;&nbsp;&nbsp;&quot;Render&nbsp;in&nbsp;Hiccup&nbsp;format&nbsp;the&nbsp;HTML&nbsp;content&nbsp;of&nbsp;an&nbsp;inspector&nbsp;on&nbsp;this&nbsp;cell.&quot;
</span><br/>
<span class="not-covered" title="0 out of 3 forms covered">
093&nbsp;&nbsp;&nbsp;&nbsp;([cell&nbsp;_]&nbsp;(render-inspector&nbsp;cell))
</span><br/>
<span class="not-tracked" title="0 out of 0 forms covered">
094&nbsp;&nbsp;&nbsp;&nbsp;([cell]
</span><br/>
<span class="not-covered" title="0 out of 5 forms covered">
095&nbsp;&nbsp;&nbsp;&nbsp;[:table&nbsp;{:class&nbsp;&quot;music-ruled&quot;}
</span><br/>
<span class="not-covered" title="0 out of 2 forms covered">
096&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;[:tr
</span><br/>
<span class="not-covered" title="0 out of 7 forms covered">
097&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;[:td&nbsp;{:colspan&nbsp;2&nbsp;:style&nbsp;&quot;text-align:&nbsp;center;&quot;}
</span><br/>
<span class="not-covered" title="0 out of 17 forms covered">
098&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;[:img&nbsp;{:src&nbsp;(str&nbsp;&quot;img&#x2F;tiles&#x2F;&quot;&nbsp;(name&nbsp;(:state&nbsp;cell))&nbsp;&quot;.png&quot;)
</span><br/>
<span class="not-tracked" title="0 out of 0 forms covered">
099&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;:width&nbsp;64
</span><br/>
<span class="not-tracked" title="0 out of 0 forms covered">
100&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;:height&nbsp;64}]]]
</span><br/>
<span class="not-covered" title="0 out of 8 forms covered">
101&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;[:tr&nbsp;[:th&nbsp;&quot;Key&quot;][:th&nbsp;&quot;Value&quot;]]
</span><br/>
<span class="not-covered" title="0 out of 19 forms covered">
102&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;(map&nbsp;#(vector&nbsp;:tr&nbsp;(vector&nbsp;:th&nbsp;%)(vector&nbsp;:td&nbsp;(cell&nbsp;%)))&nbsp;(keys&nbsp;cell))]))
</span><br/>
<span class="blank" title="0 out of 0 forms covered">
103&nbsp;&nbsp;
</span><br/>
<span class="blank" title="0 out of 0 forms covered">
104&nbsp;&nbsp;
</span><br/>
</body>
</html>

View file

@ -1,206 +0,0 @@
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
<link rel="stylesheet" href="../coverage.css"/> <title> mw_ui/repl.clj </title>
</head>
<body>
<span class="covered" title="1 out of 1 forms covered">
001&nbsp;&nbsp;(ns&nbsp;^{:doc&nbsp;&quot;In&nbsp;truth,&nbsp;boilerplate&nbsp;from&nbsp;Luminus.&quot;
</span><br/>
<span class="not-tracked" title="0 out of 0 forms covered">
002&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;:author&nbsp;&quot;Simon&nbsp;Brooke&quot;}
</span><br/>
<span class="not-tracked" title="0 out of 0 forms covered">
003&nbsp;&nbsp;&nbsp;&nbsp;mw-ui.repl
</span><br/>
<span class="not-tracked" title="0 out of 0 forms covered">
004&nbsp;&nbsp;&nbsp;&nbsp;(:require&nbsp;[mw-ui.handler&nbsp;:as&nbsp;handler]
</span><br/>
<span class="not-tracked" title="0 out of 0 forms covered">
005&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;[ring.server.standalone&nbsp;:refer&nbsp;[serve]]
</span><br/>
<span class="not-tracked" title="0 out of 0 forms covered">
006&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;[ring.middleware.file&nbsp;:refer&nbsp;[wrap-file]]
</span><br/>
<span class="not-tracked" title="0 out of 0 forms covered">
007&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;[ring.middleware.file-info&nbsp;:refer&nbsp;[wrap-file-info]])
</span><br/>
<span class="not-tracked" title="0 out of 0 forms covered">
008&nbsp;&nbsp;&nbsp;&nbsp;(:gen-class))
</span><br/>
<span class="blank" title="0 out of 0 forms covered">
009&nbsp;&nbsp;
</span><br/>
<span class="not-tracked" title="0 out of 0 forms covered">
010&nbsp;&nbsp;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
</span><br/>
<span class="not-tracked" title="0 out of 0 forms covered">
011&nbsp;&nbsp;;;;;
</span><br/>
<span class="not-tracked" title="0 out of 0 forms covered">
012&nbsp;&nbsp;;;;;&nbsp;mw-ui:&nbsp;a&nbsp;servlet&nbsp;user&#x2F;visualisation&nbsp;interface&nbsp;for&nbsp;MicroWorld.
</span><br/>
<span class="not-tracked" title="0 out of 0 forms covered">
013&nbsp;&nbsp;;;;;
</span><br/>
<span class="not-tracked" title="0 out of 0 forms covered">
014&nbsp;&nbsp;;;;;&nbsp;This&nbsp;program&nbsp;is&nbsp;free&nbsp;software;&nbsp;you&nbsp;can&nbsp;redistribute&nbsp;it&nbsp;and&#x2F;or
</span><br/>
<span class="not-tracked" title="0 out of 0 forms covered">
015&nbsp;&nbsp;;;;;&nbsp;modify&nbsp;it&nbsp;under&nbsp;the&nbsp;terms&nbsp;of&nbsp;the&nbsp;GNU&nbsp;General&nbsp;Public&nbsp;License
</span><br/>
<span class="not-tracked" title="0 out of 0 forms covered">
016&nbsp;&nbsp;;;;;&nbsp;as&nbsp;published&nbsp;by&nbsp;the&nbsp;Free&nbsp;Software&nbsp;Foundation;&nbsp;either&nbsp;version&nbsp;2
</span><br/>
<span class="not-tracked" title="0 out of 0 forms covered">
017&nbsp;&nbsp;;;;;&nbsp;of&nbsp;the&nbsp;License,&nbsp;or&nbsp;(at&nbsp;your&nbsp;option)&nbsp;any&nbsp;later&nbsp;version.
</span><br/>
<span class="not-tracked" title="0 out of 0 forms covered">
018&nbsp;&nbsp;;;;;
</span><br/>
<span class="not-tracked" title="0 out of 0 forms covered">
019&nbsp;&nbsp;;;;;&nbsp;This&nbsp;program&nbsp;is&nbsp;distributed&nbsp;in&nbsp;the&nbsp;hope&nbsp;that&nbsp;it&nbsp;will&nbsp;be&nbsp;useful,
</span><br/>
<span class="not-tracked" title="0 out of 0 forms covered">
020&nbsp;&nbsp;;;;;&nbsp;but&nbsp;WITHOUT&nbsp;ANY&nbsp;WARRANTY;&nbsp;without&nbsp;even&nbsp;the&nbsp;implied&nbsp;warranty&nbsp;of
</span><br/>
<span class="not-tracked" title="0 out of 0 forms covered">
021&nbsp;&nbsp;;;;;&nbsp;MERCHANTABILITY&nbsp;or&nbsp;FITNESS&nbsp;FOR&nbsp;A&nbsp;PARTICULAR&nbsp;PURPOSE.&nbsp;&nbsp;See&nbsp;the
</span><br/>
<span class="not-tracked" title="0 out of 0 forms covered">
022&nbsp;&nbsp;;;;;&nbsp;GNU&nbsp;General&nbsp;Public&nbsp;License&nbsp;for&nbsp;more&nbsp;details.
</span><br/>
<span class="not-tracked" title="0 out of 0 forms covered">
023&nbsp;&nbsp;;;;;
</span><br/>
<span class="not-tracked" title="0 out of 0 forms covered">
024&nbsp;&nbsp;;;;;&nbsp;You&nbsp;should&nbsp;have&nbsp;received&nbsp;a&nbsp;copy&nbsp;of&nbsp;the&nbsp;GNU&nbsp;General&nbsp;Public&nbsp;License
</span><br/>
<span class="not-tracked" title="0 out of 0 forms covered">
025&nbsp;&nbsp;;;;;&nbsp;along&nbsp;with&nbsp;this&nbsp;program;&nbsp;if&nbsp;not,&nbsp;write&nbsp;to&nbsp;the&nbsp;Free&nbsp;Software
</span><br/>
<span class="not-tracked" title="0 out of 0 forms covered">
026&nbsp;&nbsp;;;;;&nbsp;Foundation,&nbsp;Inc.,&nbsp;51&nbsp;Franklin&nbsp;Street,&nbsp;Fifth&nbsp;Floor,&nbsp;Boston,&nbsp;MA&nbsp;&nbsp;02110-1301,
</span><br/>
<span class="not-tracked" title="0 out of 0 forms covered">
027&nbsp;&nbsp;;;;;&nbsp;USA.
</span><br/>
<span class="not-tracked" title="0 out of 0 forms covered">
028&nbsp;&nbsp;;;;;
</span><br/>
<span class="not-tracked" title="0 out of 0 forms covered">
029&nbsp;&nbsp;;;;;&nbsp;Copyright&nbsp;(C)&nbsp;2014&nbsp;Simon&nbsp;Brooke
</span><br/>
<span class="not-tracked" title="0 out of 0 forms covered">
030&nbsp;&nbsp;;;;;
</span><br/>
<span class="not-tracked" title="0 out of 0 forms covered">
031&nbsp;&nbsp;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
</span><br/>
<span class="blank" title="0 out of 0 forms covered">
032&nbsp;&nbsp;
</span><br/>
<span class="blank" title="0 out of 0 forms covered">
033&nbsp;&nbsp;
</span><br/>
<span class="partial" title="9 out of 10 forms covered">
034&nbsp;&nbsp;(defonce&nbsp;server&nbsp;(atom&nbsp;nil))
</span><br/>
<span class="blank" title="0 out of 0 forms covered">
035&nbsp;&nbsp;
</span><br/>
<span class="covered" title="1 out of 1 forms covered">
036&nbsp;&nbsp;(defn&nbsp;get-handler&nbsp;[]
</span><br/>
<span class="not-tracked" title="0 out of 0 forms covered">
037&nbsp;&nbsp;&nbsp;&nbsp;;;&nbsp;#&#x27;app&nbsp;expands&nbsp;to&nbsp;(var&nbsp;app)&nbsp;so&nbsp;that&nbsp;when&nbsp;we&nbsp;reload&nbsp;our&nbsp;code,
</span><br/>
<span class="not-tracked" title="0 out of 0 forms covered">
038&nbsp;&nbsp;&nbsp;&nbsp;;;&nbsp;the&nbsp;server&nbsp;is&nbsp;forced&nbsp;to&nbsp;re-resolve&nbsp;the&nbsp;symbol&nbsp;in&nbsp;the&nbsp;var
</span><br/>
<span class="not-tracked" title="0 out of 0 forms covered">
039&nbsp;&nbsp;&nbsp;&nbsp;;;&nbsp;rather&nbsp;than&nbsp;having&nbsp;its&nbsp;own&nbsp;copy.&nbsp;When&nbsp;the&nbsp;root&nbsp;binding
</span><br/>
<span class="not-tracked" title="0 out of 0 forms covered">
040&nbsp;&nbsp;&nbsp;&nbsp;;;&nbsp;changes,&nbsp;the&nbsp;server&nbsp;picks&nbsp;it&nbsp;up&nbsp;without&nbsp;having&nbsp;to&nbsp;restart.
</span><br/>
<span class="not-covered" title="0 out of 1 forms covered">
041&nbsp;&nbsp;&nbsp;&nbsp;(-&gt;&nbsp;#&#x27;handler&#x2F;app
</span><br/>
<span class="not-tracked" title="0 out of 0 forms covered">
042&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;;&nbsp;Makes&nbsp;static&nbsp;assets&nbsp;in&nbsp;$PROJECT_DIR&#x2F;resources&#x2F;public&#x2F;&nbsp;available.
</span><br/>
<span class="not-covered" title="0 out of 4 forms covered">
043&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;(wrap-file&nbsp;&quot;resources&quot;)
</span><br/>
<span class="not-tracked" title="0 out of 0 forms covered">
044&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;;&nbsp;Content-Type,&nbsp;Content-Length,&nbsp;and&nbsp;Last&nbsp;Modified&nbsp;headers&nbsp;for&nbsp;files&nbsp;in&nbsp;body
</span><br/>
<span class="not-covered" title="0 out of 1 forms covered">
045&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;(wrap-file-info)))
</span><br/>
<span class="blank" title="0 out of 0 forms covered">
046&nbsp;&nbsp;
</span><br/>
<span class="covered" title="1 out of 1 forms covered">
047&nbsp;&nbsp;(defn&nbsp;start-server
</span><br/>
<span class="not-tracked" title="0 out of 0 forms covered">
048&nbsp;&nbsp;&nbsp;&nbsp;&quot;used&nbsp;for&nbsp;starting&nbsp;the&nbsp;server&nbsp;in&nbsp;development&nbsp;mode&nbsp;from&nbsp;REPL&quot;
</span><br/>
<span class="not-tracked" title="0 out of 0 forms covered">
049&nbsp;&nbsp;&nbsp;&nbsp;[&amp;&nbsp;[port]]
</span><br/>
<span class="not-covered" title="0 out of 6 forms covered">
050&nbsp;&nbsp;&nbsp;&nbsp;(let&nbsp;[port&nbsp;(if&nbsp;port&nbsp;(Integer&#x2F;parseInt&nbsp;port)&nbsp;3000)]
</span><br/>
<span class="not-covered" title="0 out of 3 forms covered">
051&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;(reset!&nbsp;server
</span><br/>
<span class="not-covered" title="0 out of 4 forms covered">
052&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;(serve&nbsp;(get-handler)
</span><br/>
<span class="not-covered" title="0 out of 9 forms covered">
053&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;{:port&nbsp;port
</span><br/>
<span class="not-covered" title="0 out of 1 forms covered">
054&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;:init&nbsp;handler&#x2F;init
</span><br/>
<span class="not-tracked" title="0 out of 0 forms covered">
055&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;:auto-reload?&nbsp;true
</span><br/>
<span class="not-covered" title="0 out of 1 forms covered">
056&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;:destroy&nbsp;handler&#x2F;destroy
</span><br/>
<span class="not-tracked" title="0 out of 0 forms covered">
057&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;:join?&nbsp;false}))
</span><br/>
<span class="not-covered" title="0 out of 6 forms covered">
058&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;(println&nbsp;(str&nbsp;&quot;You&nbsp;can&nbsp;view&nbsp;the&nbsp;site&nbsp;at&nbsp;http:&#x2F;&#x2F;localhost:&quot;&nbsp;port))))
</span><br/>
<span class="blank" title="0 out of 0 forms covered">
059&nbsp;&nbsp;
</span><br/>
<span class="covered" title="1 out of 1 forms covered">
060&nbsp;&nbsp;(defn&nbsp;stop-server&nbsp;[]
</span><br/>
<span class="not-covered" title="0 out of 4 forms covered">
061&nbsp;&nbsp;&nbsp;&nbsp;(.stop&nbsp;@server)
</span><br/>
<span class="not-covered" title="0 out of 4 forms covered">
062&nbsp;&nbsp;&nbsp;&nbsp;(reset!&nbsp;server&nbsp;nil))
</span><br/>
<span class="blank" title="0 out of 0 forms covered">
063&nbsp;&nbsp;
</span><br/>
<span class="covered" title="1 out of 1 forms covered">
064&nbsp;&nbsp;(defn&nbsp;-main&nbsp;[]
</span><br/>
<span class="not-covered" title="0 out of 2 forms covered">
065&nbsp;&nbsp;&nbsp;&nbsp;(start-server))
</span><br/>
<span class="blank" title="0 out of 0 forms covered">
066&nbsp;&nbsp;
</span><br/>
</body>
</html>

View file

@ -1,407 +0,0 @@
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
<link rel="stylesheet" href="../../coverage.css"/> <title> mw_ui/routes/home.clj </title>
</head>
<body>
<span class="covered" title="1 out of 1 forms covered">
001&nbsp;&nbsp;(ns&nbsp;^{:doc&nbsp;&quot;Routes&nbsp;which&nbsp;serve&nbsp;the&nbsp;main&nbsp;pages&nbsp;of&nbsp;the&nbsp;application.&quot;
</span><br/>
<span class="not-tracked" title="0 out of 0 forms covered">
002&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;:author&nbsp;&quot;Simon&nbsp;Brooke&quot;}
</span><br/>
<span class="not-tracked" title="0 out of 0 forms covered">
003&nbsp;&nbsp;&nbsp;&nbsp;mw-ui.routes.home
</span><br/>
<span class="not-tracked" title="0 out of 0 forms covered">
004&nbsp;&nbsp;&nbsp;&nbsp;(:require&nbsp;[clojure.java.io&nbsp;:refer&nbsp;[file]]
</span><br/>
<span class="not-tracked" title="0 out of 0 forms covered">
005&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;[clojure.walk&nbsp;:refer&nbsp;[keywordize-keys]]
</span><br/>
<span class="not-tracked" title="0 out of 0 forms covered">
006&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;[compojure.core&nbsp;:refer&nbsp;[defroutes&nbsp;GET&nbsp;POST]]
</span><br/>
<span class="not-tracked" title="0 out of 0 forms covered">
007&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;[hiccup.core&nbsp;:refer&nbsp;[html]]
</span><br/>
<span class="not-tracked" title="0 out of 0 forms covered">
008&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;[mw-engine.utils&nbsp;:as&nbsp;engine-utils]
</span><br/>
<span class="not-tracked" title="0 out of 0 forms covered">
009&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;[mw-ui.layout&nbsp;:as&nbsp;layout]
</span><br/>
<span class="not-tracked" title="0 out of 0 forms covered">
010&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;[mw-ui.render-world&nbsp;:as&nbsp;world]
</span><br/>
<span class="not-tracked" title="0 out of 0 forms covered">
011&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;[mw-ui.routes.load&nbsp;:as&nbsp;load]
</span><br/>
<span class="not-tracked" title="0 out of 0 forms covered">
012&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;[mw-ui.routes.rules&nbsp;:as&nbsp;rules]
</span><br/>
<span class="not-tracked" title="0 out of 0 forms covered">
013&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;[mw-ui.routes.params&nbsp;:as&nbsp;params]
</span><br/>
<span class="not-tracked" title="0 out of 0 forms covered">
014&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;[mw-ui.routes.save&nbsp;:as&nbsp;save]
</span><br/>
<span class="not-tracked" title="0 out of 0 forms covered">
015&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;[mw-ui.util&nbsp;:as&nbsp;util]
</span><br/>
<span class="not-tracked" title="0 out of 0 forms covered">
016&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;[noir.session&nbsp;:as&nbsp;session]
</span><br/>
<span class="not-tracked" title="0 out of 0 forms covered">
017&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;[ring.util.response&nbsp;:as&nbsp;response]))
</span><br/>
<span class="blank" title="0 out of 0 forms covered">
018&nbsp;&nbsp;
</span><br/>
<span class="not-tracked" title="0 out of 0 forms covered">
019&nbsp;&nbsp;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
</span><br/>
<span class="not-tracked" title="0 out of 0 forms covered">
020&nbsp;&nbsp;;;;;
</span><br/>
<span class="not-tracked" title="0 out of 0 forms covered">
021&nbsp;&nbsp;;;;;&nbsp;mw-ui:&nbsp;a&nbsp;servlet&nbsp;user&#x2F;visualisation&nbsp;interface&nbsp;for&nbsp;MicroWorld.
</span><br/>
<span class="not-tracked" title="0 out of 0 forms covered">
022&nbsp;&nbsp;;;;;
</span><br/>
<span class="not-tracked" title="0 out of 0 forms covered">
023&nbsp;&nbsp;;;;;&nbsp;This&nbsp;program&nbsp;is&nbsp;free&nbsp;software;&nbsp;you&nbsp;can&nbsp;redistribute&nbsp;it&nbsp;and&#x2F;or
</span><br/>
<span class="not-tracked" title="0 out of 0 forms covered">
024&nbsp;&nbsp;;;;;&nbsp;modify&nbsp;it&nbsp;under&nbsp;the&nbsp;terms&nbsp;of&nbsp;the&nbsp;GNU&nbsp;General&nbsp;Public&nbsp;License
</span><br/>
<span class="not-tracked" title="0 out of 0 forms covered">
025&nbsp;&nbsp;;;;;&nbsp;as&nbsp;published&nbsp;by&nbsp;the&nbsp;Free&nbsp;Software&nbsp;Foundation;&nbsp;either&nbsp;version&nbsp;2
</span><br/>
<span class="not-tracked" title="0 out of 0 forms covered">
026&nbsp;&nbsp;;;;;&nbsp;of&nbsp;the&nbsp;License,&nbsp;or&nbsp;(at&nbsp;your&nbsp;option)&nbsp;any&nbsp;later&nbsp;version.
</span><br/>
<span class="not-tracked" title="0 out of 0 forms covered">
027&nbsp;&nbsp;;;;;
</span><br/>
<span class="not-tracked" title="0 out of 0 forms covered">
028&nbsp;&nbsp;;;;;&nbsp;This&nbsp;program&nbsp;is&nbsp;distributed&nbsp;in&nbsp;the&nbsp;hope&nbsp;that&nbsp;it&nbsp;will&nbsp;be&nbsp;useful,
</span><br/>
<span class="not-tracked" title="0 out of 0 forms covered">
029&nbsp;&nbsp;;;;;&nbsp;but&nbsp;WITHOUT&nbsp;ANY&nbsp;WARRANTY;&nbsp;without&nbsp;even&nbsp;the&nbsp;implied&nbsp;warranty&nbsp;of
</span><br/>
<span class="not-tracked" title="0 out of 0 forms covered">
030&nbsp;&nbsp;;;;;&nbsp;MERCHANTABILITY&nbsp;or&nbsp;FITNESS&nbsp;FOR&nbsp;A&nbsp;PARTICULAR&nbsp;PURPOSE.&nbsp;&nbsp;See&nbsp;the
</span><br/>
<span class="not-tracked" title="0 out of 0 forms covered">
031&nbsp;&nbsp;;;;;&nbsp;GNU&nbsp;General&nbsp;Public&nbsp;License&nbsp;for&nbsp;more&nbsp;details.
</span><br/>
<span class="not-tracked" title="0 out of 0 forms covered">
032&nbsp;&nbsp;;;;;
</span><br/>
<span class="not-tracked" title="0 out of 0 forms covered">
033&nbsp;&nbsp;;;;;&nbsp;You&nbsp;should&nbsp;have&nbsp;received&nbsp;a&nbsp;copy&nbsp;of&nbsp;the&nbsp;GNU&nbsp;General&nbsp;Public&nbsp;License
</span><br/>
<span class="not-tracked" title="0 out of 0 forms covered">
034&nbsp;&nbsp;;;;;&nbsp;along&nbsp;with&nbsp;this&nbsp;program;&nbsp;if&nbsp;not,&nbsp;write&nbsp;to&nbsp;the&nbsp;Free&nbsp;Software
</span><br/>
<span class="not-tracked" title="0 out of 0 forms covered">
035&nbsp;&nbsp;;;;;&nbsp;Foundation,&nbsp;Inc.,&nbsp;51&nbsp;Franklin&nbsp;Street,&nbsp;Fifth&nbsp;Floor,&nbsp;Boston,&nbsp;MA&nbsp;&nbsp;02110-1301,
</span><br/>
<span class="not-tracked" title="0 out of 0 forms covered">
036&nbsp;&nbsp;;;;;&nbsp;USA.
</span><br/>
<span class="not-tracked" title="0 out of 0 forms covered">
037&nbsp;&nbsp;;;;;
</span><br/>
<span class="not-tracked" title="0 out of 0 forms covered">
038&nbsp;&nbsp;;;;;&nbsp;Copyright&nbsp;(C)&nbsp;2014&nbsp;Simon&nbsp;Brooke
</span><br/>
<span class="not-tracked" title="0 out of 0 forms covered">
039&nbsp;&nbsp;;;;;
</span><br/>
<span class="not-tracked" title="0 out of 0 forms covered">
040&nbsp;&nbsp;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
</span><br/>
<span class="blank" title="0 out of 0 forms covered">
041&nbsp;&nbsp;
</span><br/>
<span class="blank" title="0 out of 0 forms covered">
042&nbsp;&nbsp;
</span><br/>
<span class="covered" title="1 out of 1 forms covered">
043&nbsp;&nbsp;(defn&nbsp;list-states&nbsp;[]
</span><br/>
<span class="not-covered" title="0 out of 2 forms covered">
044&nbsp;&nbsp;&nbsp;&nbsp;(sort
</span><br/>
<span class="not-covered" title="0 out of 8 forms covered">
045&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;(filter&nbsp;#(not&nbsp;(nil?&nbsp;%))
</span><br/>
<span class="not-covered" title="0 out of 11 forms covered">
046&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;(map&nbsp;#(first&nbsp;(rest&nbsp;(re-matches&nbsp;#&quot;([0-9a-z-]+).png&quot;&nbsp;(.getName&nbsp;%))))
</span><br/>
<span class="not-tracked" title="0 out of 0 forms covered">
047&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;;;&nbsp;TODO:&nbsp;this&nbsp;will&nbsp;not&nbsp;work&nbsp;when&nbsp;running&nbsp;from&nbsp;jar;&nbsp;see&nbsp;utils.clj
</span><br/>
<span class="not-covered" title="0 out of 5 forms covered">
048&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;(file-seq&nbsp;(file&nbsp;&quot;resources&#x2F;public&#x2F;img&#x2F;tiles&quot;))))))
</span><br/>
<span class="blank" title="0 out of 0 forms covered">
049&nbsp;&nbsp;
</span><br/>
<span class="blank" title="0 out of 0 forms covered">
050&nbsp;&nbsp;
</span><br/>
<span class="covered" title="1 out of 1 forms covered">
051&nbsp;&nbsp;(defn&nbsp;about-page&nbsp;[]
</span><br/>
<span class="not-covered" title="0 out of 3 forms covered">
052&nbsp;&nbsp;&nbsp;&nbsp;(layout&#x2F;render&nbsp;&quot;trusted-content.html&quot;
</span><br/>
<span class="not-covered" title="0 out of 7 forms covered">
053&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;{:title&nbsp;&quot;About&nbsp;MicroWorld&quot;
</span><br/>
<span class="not-tracked" title="0 out of 0 forms covered">
054&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;:about-selected&nbsp;&quot;active&quot;
</span><br/>
<span class="not-covered" title="0 out of 3 forms covered">
055&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;:content&nbsp;(util&#x2F;md-&gt;html&nbsp;&quot;&#x2F;md&#x2F;about.md&quot;)
</span><br/>
<span class="not-covered" title="0 out of 2 forms covered">
056&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;:version&nbsp;(System&#x2F;getProperty&nbsp;&quot;mw-ui.version&quot;)}))
</span><br/>
<span class="blank" title="0 out of 0 forms covered">
057&nbsp;&nbsp;
</span><br/>
<span class="covered" title="1 out of 1 forms covered">
058&nbsp;&nbsp;(defn&nbsp;docs-page&nbsp;[]
</span><br/>
<span class="not-covered" title="0 out of 11 forms covered">
059&nbsp;&nbsp;&nbsp;&nbsp;(layout&#x2F;render&nbsp;&quot;docs.html&quot;&nbsp;{:title&nbsp;&quot;Documentation&quot;
</span><br/>
<span class="not-covered" title="0 out of 3 forms covered">
060&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;:parser&nbsp;(util&#x2F;md-&gt;html&nbsp;&quot;&#x2F;md&#x2F;mw-parser.md&quot;&nbsp;)
</span><br/>
<span class="not-covered" title="0 out of 4 forms covered">
061&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;:states&nbsp;(util&#x2F;list-resources&nbsp;&quot;&#x2F;img&#x2F;tiles&quot;&nbsp;#&quot;([0-9a-z-_]+).png&quot;)
</span><br/>
<span class="not-covered" title="0 out of 4 forms covered">
062&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;:lessons&nbsp;(util&#x2F;list-resources&nbsp;&quot;&#x2F;md&#x2F;lesson-plans&quot;&nbsp;&nbsp;#&quot;([0-9a-z-_]+).md&quot;)
</span><br/>
<span class="not-covered" title="0 out of 4 forms covered">
063&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;:components&nbsp;[&quot;mw-engine&quot;&nbsp;&quot;mw-parser&quot;&nbsp;&quot;mw-ui&quot;]
</span><br/>
<span class="not-covered" title="0 out of 2 forms covered">
064&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;:version&nbsp;(System&#x2F;getProperty&nbsp;&quot;mw-ui.version&quot;)}))
</span><br/>
<span class="blank" title="0 out of 0 forms covered">
065&nbsp;&nbsp;
</span><br/>
<span class="covered" title="1 out of 1 forms covered">
066&nbsp;&nbsp;(defn&nbsp;home-page&nbsp;
</span><br/>
<span class="not-tracked" title="0 out of 0 forms covered">
067&nbsp;&nbsp;&nbsp;&nbsp;&quot;Render&nbsp;the&nbsp;home&nbsp;page.&quot;
</span><br/>
<span class="not-tracked" title="0 out of 0 forms covered">
068&nbsp;&nbsp;&nbsp;&nbsp;[]
</span><br/>
<span class="covered" title="8 out of 8 forms covered">
069&nbsp;&nbsp;&nbsp;&nbsp;(layout&#x2F;render&nbsp;&quot;trusted-content.html&quot;&nbsp;{:title&nbsp;&quot;Welcome&nbsp;to&nbsp;MicroWorld&quot;
</span><br/>
<span class="covered" title="3 out of 3 forms covered">
070&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;:content&nbsp;(util&#x2F;md-&gt;html&nbsp;&quot;&#x2F;md&#x2F;mw-ui.md&quot;)
</span><br/>
<span class="covered" title="2 out of 2 forms covered">
071&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;:version&nbsp;(System&#x2F;getProperty&nbsp;&quot;mw-ui.version&quot;)}))
</span><br/>
<span class="blank" title="0 out of 0 forms covered">
072&nbsp;&nbsp;
</span><br/>
<span class="covered" title="1 out of 1 forms covered">
073&nbsp;&nbsp;(defn&nbsp;inspect-page&nbsp;
</span><br/>
<span class="not-tracked" title="0 out of 0 forms covered">
074&nbsp;&nbsp;&nbsp;&nbsp;&quot;Open&nbsp;an&nbsp;inspector&nbsp;on&nbsp;the&nbsp;cell&nbsp;at&nbsp;the&nbsp;co-ordinates&nbsp;specified&nbsp;in&nbsp;this&nbsp;request&quot;
</span><br/>
<span class="not-tracked" title="0 out of 0 forms covered">
075&nbsp;&nbsp;&nbsp;&nbsp;[request]
</span><br/>
<span class="not-covered" title="0 out of 6 forms covered">
076&nbsp;&nbsp;&nbsp;&nbsp;(let&nbsp;[params&nbsp;(keywordize-keys&nbsp;(:params&nbsp;request))
</span><br/>
<span class="not-covered" title="0 out of 3 forms covered">
077&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;xs&nbsp;(:x&nbsp;params)
</span><br/>
<span class="not-covered" title="0 out of 3 forms covered">
078&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;ys&nbsp;(:y&nbsp;params)
</span><br/>
<span class="not-covered" title="0 out of 8 forms covered">
079&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;x&nbsp;(if&nbsp;(seq&nbsp;xs)&nbsp;(read-string&nbsp;xs)&nbsp;0)
</span><br/>
<span class="not-covered" title="0 out of 8 forms covered">
080&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;y&nbsp;(if&nbsp;(seq&nbsp;ys)&nbsp;(read-string&nbsp;ys)&nbsp;0)
</span><br/>
<span class="not-covered" title="0 out of 3 forms covered">
081&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;world&nbsp;(session&#x2F;get&nbsp;:world)
</span><br/>
<span class="not-covered" title="0 out of 5 forms covered">
082&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;cell&nbsp;(engine-utils&#x2F;get-cell&nbsp;world&nbsp;x&nbsp;y)
</span><br/>
<span class="not-covered" title="0 out of 3 forms covered">
083&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;state&nbsp;(:state&nbsp;params)]
</span><br/>
<span class="not-covered" title="0 out of 5 forms covered">
084&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;(cond&nbsp;state
</span><br/>
<span class="not-covered" title="0 out of 1 forms covered">
085&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;(do
</span><br/>
<span class="not-covered" title="0 out of 11 forms covered">
086&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;(session&#x2F;put!&nbsp;:world&nbsp;(engine-utils&#x2F;set-property&nbsp;world&nbsp;cell&nbsp;:state&nbsp;(keyword&nbsp;state)))
</span><br/>
<span class="not-covered" title="0 out of 3 forms covered">
087&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;(response&#x2F;redirect&nbsp;&quot;world&quot;))
</span><br/>
<span class="not-tracked" title="0 out of 0 forms covered">
088&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;true
</span><br/>
<span class="not-covered" title="0 out of 3 forms covered">
089&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;(layout&#x2F;render&nbsp;&quot;inspector.html&quot;
</span><br/>
<span class="not-covered" title="0 out of 12 forms covered">
090&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;{:title&nbsp;(format&nbsp;&quot;Inspect&nbsp;cell&nbsp;at&nbsp;%d,&nbsp;%d&quot;&nbsp;x&nbsp;y)
</span><br/>
<span class="not-covered" title="0 out of 7 forms covered">
091&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;:content&nbsp;(html&nbsp;(world&#x2F;render-inspector&nbsp;cell))
</span><br/>
<span class="not-covered" title="0 out of 1 forms covered">
092&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;:cell&nbsp;cell
</span><br/>
<span class="not-covered" title="0 out of 3 forms covered">
093&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;:x&nbsp;(:x&nbsp;cell)
</span><br/>
<span class="not-covered" title="0 out of 3 forms covered">
094&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;:y&nbsp;(:y&nbsp;cell)
</span><br/>
<span class="not-covered" title="0 out of 4 forms covered">
095&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;:states&nbsp;(util&#x2F;list-resources
</span><br/>
<span class="not-tracked" title="0 out of 0 forms covered">
096&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&quot;&#x2F;img&#x2F;tiles&quot;&nbsp;#&quot;([0-9a-z-_]+).png&quot;)}))))
</span><br/>
<span class="blank" title="0 out of 0 forms covered">
097&nbsp;&nbsp;
</span><br/>
<span class="covered" title="1 out of 1 forms covered">
098&nbsp;&nbsp;(defn&nbsp;md-page
</span><br/>
<span class="not-tracked" title="0 out of 0 forms covered">
099&nbsp;&nbsp;&nbsp;&nbsp;&quot;Render&nbsp;the&nbsp;markdown&nbsp;page&nbsp;specified&nbsp;in&nbsp;this&nbsp;request,&nbsp;if&nbsp;any.&nbsp;Probably&nbsp;undesirable,
</span><br/>
<span class="not-tracked" title="0 out of 0 forms covered">
100&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;should&nbsp;be&nbsp;removed.&quot;
</span><br/>
<span class="not-tracked" title="0 out of 0 forms covered">
101&nbsp;&nbsp;&nbsp;&nbsp;[request]
</span><br/>
<span class="not-covered" title="0 out of 6 forms covered">
102&nbsp;&nbsp;&nbsp;&nbsp;(let&nbsp;[params&nbsp;(keywordize-keys&nbsp;(:params&nbsp;request))
</span><br/>
<span class="not-covered" title="0 out of 8 forms covered">
103&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;content&nbsp;(or&nbsp;(:content&nbsp;params)&nbsp;&quot;missing.md&quot;)]
</span><br/>
<span class="not-covered" title="0 out of 3 forms covered">
104&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;(layout&#x2F;render&nbsp;&quot;trusted-content.html&quot;
</span><br/>
<span class="not-covered" title="0 out of 4 forms covered">
105&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;{:title&nbsp;&quot;Welcome&nbsp;to&nbsp;MicroWorld&quot;
</span><br/>
<span class="not-covered" title="0 out of 6 forms covered">
106&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;:content&nbsp;(util&#x2F;md-&gt;html&nbsp;(str&nbsp;&quot;&#x2F;md&#x2F;&quot;&nbsp;content))})))
</span><br/>
<span class="blank" title="0 out of 0 forms covered">
107&nbsp;&nbsp;
</span><br/>
<span class="partial" title="1 out of 2 forms covered">
108&nbsp;&nbsp;(defn&nbsp;world-page&nbsp;[]
</span><br/>
<span class="not-tracked" title="0 out of 0 forms covered">
109&nbsp;&nbsp;&nbsp;&nbsp;&quot;Render&nbsp;the&nbsp;world&nbsp;in&nbsp;the&nbsp;current&nbsp;session&nbsp;(or&nbsp;a&nbsp;default&nbsp;one&nbsp;if&nbsp;none).&quot;
</span><br/>
<span class="not-covered" title="0 out of 3 forms covered">
110&nbsp;&nbsp;&nbsp;&nbsp;(layout&#x2F;render&nbsp;&quot;trusted-content.html&quot;
</span><br/>
<span class="not-covered" title="0 out of 9 forms covered">
111&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;{:title&nbsp;&quot;Watch&nbsp;your&nbsp;world&nbsp;grow&quot;
</span><br/>
<span class="not-tracked" title="0 out of 0 forms covered">
112&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;:world-selected&nbsp;&quot;active&quot;
</span><br/>
<span class="not-covered" title="0 out of 6 forms covered">
113&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;:content&nbsp;(html&nbsp;(world&#x2F;render-world-table))
</span><br/>
<span class="not-covered" title="0 out of 8 forms covered">
114&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;:pause&nbsp;(or&nbsp;(session&#x2F;get&nbsp;:pause)&nbsp;5)
</span><br/>
<span class="not-tracked" title="0 out of 0 forms covered">
115&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;:maybe-refresh&nbsp;&quot;refresh&quot;}))
</span><br/>
<span class="blank" title="0 out of 0 forms covered">
116&nbsp;&nbsp;
</span><br/>
<span class="blank" title="0 out of 0 forms covered">
117&nbsp;&nbsp;
</span><br/>
<span class="covered" title="3 out of 3 forms covered">
118&nbsp;&nbsp;(defroutes&nbsp;home-routes
</span><br/>
<span class="covered" title="8 out of 8 forms covered">
119&nbsp;&nbsp;&nbsp;&nbsp;(GET&nbsp;&nbsp;&quot;&#x2F;&quot;&nbsp;[]&nbsp;(home-page))
</span><br/>
<span class="partial" title="5 out of 8 forms covered">
120&nbsp;&nbsp;&nbsp;&nbsp;(GET&nbsp;&nbsp;&quot;&#x2F;about&quot;&nbsp;[]&nbsp;(about-page))
</span><br/>
<span class="partial" title="5 out of 8 forms covered">
121&nbsp;&nbsp;&nbsp;&nbsp;(GET&nbsp;&nbsp;&quot;&#x2F;docs&quot;&nbsp;&nbsp;[]&nbsp;(docs-page))
</span><br/>
<span class="partial" title="5 out of 10 forms covered">
122&nbsp;&nbsp;&nbsp;&nbsp;(GET&nbsp;&nbsp;&quot;&#x2F;inspect&quot;&nbsp;request&nbsp;(inspect-page&nbsp;request))
</span><br/>
<span class="partial" title="5 out of 10 forms covered">
123&nbsp;&nbsp;&nbsp;&nbsp;(POST&nbsp;&quot;&#x2F;inspect&quot;&nbsp;request&nbsp;(inspect-page&nbsp;request))
</span><br/>
<span class="partial" title="5 out of 8 forms covered">
124&nbsp;&nbsp;&nbsp;&nbsp;(GET&nbsp;&nbsp;&quot;&#x2F;load&quot;&nbsp;[]&nbsp;(load&#x2F;load-page))
</span><br/>
<span class="partial" title="5 out of 10 forms covered">
125&nbsp;&nbsp;&nbsp;&nbsp;(POST&nbsp;&quot;&#x2F;load&quot;&nbsp;request&nbsp;(load&#x2F;load-page&nbsp;request))
</span><br/>
<span class="partial" title="5 out of 10 forms covered">
126&nbsp;&nbsp;&nbsp;&nbsp;(GET&nbsp;&nbsp;&quot;&#x2F;md&quot;&nbsp;request&nbsp;(md-page&nbsp;request))
</span><br/>
<span class="partial" title="5 out of 8 forms covered">
127&nbsp;&nbsp;&nbsp;&nbsp;(GET&nbsp;&nbsp;&quot;&#x2F;params&quot;&nbsp;[]&nbsp;(params&#x2F;params-page))
</span><br/>
<span class="partial" title="5 out of 10 forms covered">
128&nbsp;&nbsp;&nbsp;&nbsp;(POST&nbsp;&quot;&#x2F;params&quot;&nbsp;request&nbsp;(params&#x2F;params-page&nbsp;request))
</span><br/>
<span class="partial" title="5 out of 10 forms covered">
129&nbsp;&nbsp;&nbsp;&nbsp;(GET&nbsp;&nbsp;&quot;&#x2F;rules&quot;&nbsp;request&nbsp;(rules&#x2F;rules-page&nbsp;request))
</span><br/>
<span class="partial" title="5 out of 10 forms covered">
130&nbsp;&nbsp;&nbsp;&nbsp;(POST&nbsp;&quot;&#x2F;rules&quot;&nbsp;request&nbsp;(rules&#x2F;rules-page&nbsp;request))
</span><br/>
<span class="partial" title="5 out of 8 forms covered">
131&nbsp;&nbsp;&nbsp;&nbsp;(GET&nbsp;&nbsp;&quot;&#x2F;saved-map.mwm&quot;&nbsp;[]&nbsp;(save&#x2F;save-page))
</span><br/>
<span class="partial" title="5 out of 8 forms covered">
132&nbsp;&nbsp;&nbsp;&nbsp;(GET&nbsp;&nbsp;&quot;&#x2F;world&quot;&nbsp;&nbsp;[]&nbsp;(world-page))
</span><br/>
<span class="not-tracked" title="0 out of 0 forms covered">
133&nbsp;&nbsp;&nbsp;&nbsp;)
</span><br/>
</body>
</html>

View file

@ -1,194 +0,0 @@
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
<link rel="stylesheet" href="../../coverage.css"/> <title> mw_ui/routes/load.clj </title>
</head>
<body>
<span class="covered" title="1 out of 1 forms covered">
001&nbsp;&nbsp;(ns&nbsp;^{:doc&nbsp;&quot;Route&nbsp;which&nbsp;handles&nbsp;the&nbsp;upload&nbsp;of&nbsp;worlds&#x2F;rules&nbsp;from&nbsp;the&nbsp;client.&quot;
</span><br/>
<span class="not-tracked" title="0 out of 0 forms covered">
002&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;:author&nbsp;&quot;Simon&nbsp;Brooke&quot;}
</span><br/>
<span class="not-tracked" title="0 out of 0 forms covered">
003&nbsp;&nbsp;&nbsp;&nbsp;mw-ui.routes.load
</span><br/>
<span class="not-tracked" title="0 out of 0 forms covered">
004&nbsp;&nbsp;&nbsp;&nbsp;(:require&nbsp;[clojure.walk&nbsp;:refer&nbsp;[keywordize-keys]]
</span><br/>
<span class="not-tracked" title="0 out of 0 forms covered">
005&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;[noir.io&nbsp;:as&nbsp;io]
</span><br/>
<span class="not-tracked" title="0 out of 0 forms covered">
006&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;[noir.session&nbsp;:as&nbsp;session]
</span><br/>
<span class="not-tracked" title="0 out of 0 forms covered">
007&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;[mw-ui.layout&nbsp;:as&nbsp;layout]))
</span><br/>
<span class="blank" title="0 out of 0 forms covered">
008&nbsp;&nbsp;
</span><br/>
<span class="not-tracked" title="0 out of 0 forms covered">
009&nbsp;&nbsp;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
</span><br/>
<span class="not-tracked" title="0 out of 0 forms covered">
010&nbsp;&nbsp;;;;;
</span><br/>
<span class="not-tracked" title="0 out of 0 forms covered">
011&nbsp;&nbsp;;;;;&nbsp;mw-ui:&nbsp;a&nbsp;servlet&nbsp;user&#x2F;visualisation&nbsp;interface&nbsp;for&nbsp;MicroWorld.
</span><br/>
<span class="not-tracked" title="0 out of 0 forms covered">
012&nbsp;&nbsp;;;;;
</span><br/>
<span class="not-tracked" title="0 out of 0 forms covered">
013&nbsp;&nbsp;;;;;&nbsp;This&nbsp;program&nbsp;is&nbsp;free&nbsp;software;&nbsp;you&nbsp;can&nbsp;redistribute&nbsp;it&nbsp;and&#x2F;or
</span><br/>
<span class="not-tracked" title="0 out of 0 forms covered">
014&nbsp;&nbsp;;;;;&nbsp;modify&nbsp;it&nbsp;under&nbsp;the&nbsp;terms&nbsp;of&nbsp;the&nbsp;GNU&nbsp;General&nbsp;Public&nbsp;License
</span><br/>
<span class="not-tracked" title="0 out of 0 forms covered">
015&nbsp;&nbsp;;;;;&nbsp;as&nbsp;published&nbsp;by&nbsp;the&nbsp;Free&nbsp;Software&nbsp;Foundation;&nbsp;either&nbsp;version&nbsp;2
</span><br/>
<span class="not-tracked" title="0 out of 0 forms covered">
016&nbsp;&nbsp;;;;;&nbsp;of&nbsp;the&nbsp;License,&nbsp;or&nbsp;(at&nbsp;your&nbsp;option)&nbsp;any&nbsp;later&nbsp;version.
</span><br/>
<span class="not-tracked" title="0 out of 0 forms covered">
017&nbsp;&nbsp;;;;;
</span><br/>
<span class="not-tracked" title="0 out of 0 forms covered">
018&nbsp;&nbsp;;;;;&nbsp;This&nbsp;program&nbsp;is&nbsp;distributed&nbsp;in&nbsp;the&nbsp;hope&nbsp;that&nbsp;it&nbsp;will&nbsp;be&nbsp;useful,
</span><br/>
<span class="not-tracked" title="0 out of 0 forms covered">
019&nbsp;&nbsp;;;;;&nbsp;but&nbsp;WITHOUT&nbsp;ANY&nbsp;WARRANTY;&nbsp;without&nbsp;even&nbsp;the&nbsp;implied&nbsp;warranty&nbsp;of
</span><br/>
<span class="not-tracked" title="0 out of 0 forms covered">
020&nbsp;&nbsp;;;;;&nbsp;MERCHANTABILITY&nbsp;or&nbsp;FITNESS&nbsp;FOR&nbsp;A&nbsp;PARTICULAR&nbsp;PURPOSE.&nbsp;&nbsp;See&nbsp;the
</span><br/>
<span class="not-tracked" title="0 out of 0 forms covered">
021&nbsp;&nbsp;;;;;&nbsp;GNU&nbsp;General&nbsp;Public&nbsp;License&nbsp;for&nbsp;more&nbsp;details.
</span><br/>
<span class="not-tracked" title="0 out of 0 forms covered">
022&nbsp;&nbsp;;;;;
</span><br/>
<span class="not-tracked" title="0 out of 0 forms covered">
023&nbsp;&nbsp;;;;;&nbsp;You&nbsp;should&nbsp;have&nbsp;received&nbsp;a&nbsp;copy&nbsp;of&nbsp;the&nbsp;GNU&nbsp;General&nbsp;Public&nbsp;License
</span><br/>
<span class="not-tracked" title="0 out of 0 forms covered">
024&nbsp;&nbsp;;;;;&nbsp;along&nbsp;with&nbsp;this&nbsp;program;&nbsp;if&nbsp;not,&nbsp;write&nbsp;to&nbsp;the&nbsp;Free&nbsp;Software
</span><br/>
<span class="not-tracked" title="0 out of 0 forms covered">
025&nbsp;&nbsp;;;;;&nbsp;Foundation,&nbsp;Inc.,&nbsp;51&nbsp;Franklin&nbsp;Street,&nbsp;Fifth&nbsp;Floor,&nbsp;Boston,&nbsp;MA&nbsp;&nbsp;02110-1301,
</span><br/>
<span class="not-tracked" title="0 out of 0 forms covered">
026&nbsp;&nbsp;;;;;&nbsp;USA.
</span><br/>
<span class="not-tracked" title="0 out of 0 forms covered">
027&nbsp;&nbsp;;;;;
</span><br/>
<span class="not-tracked" title="0 out of 0 forms covered">
028&nbsp;&nbsp;;;;;&nbsp;Copyright&nbsp;(C)&nbsp;2014&nbsp;Simon&nbsp;Brooke
</span><br/>
<span class="not-tracked" title="0 out of 0 forms covered">
029&nbsp;&nbsp;;;;;
</span><br/>
<span class="not-tracked" title="0 out of 0 forms covered">
030&nbsp;&nbsp;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
</span><br/>
<span class="blank" title="0 out of 0 forms covered">
031&nbsp;&nbsp;
</span><br/>
<span class="blank" title="0 out of 0 forms covered">
032&nbsp;&nbsp;
</span><br/>
<span class="covered" title="1 out of 1 forms covered">
033&nbsp;&nbsp;(defn-&nbsp;upload&nbsp;[file]
</span><br/>
<span class="not-covered" title="0 out of 4 forms covered">
034&nbsp;&nbsp;&nbsp;&nbsp;(io&#x2F;upload-file&nbsp;&quot;&#x2F;tmp&#x2F;&quot;&nbsp;file)
</span><br/>
<span class="not-covered" title="0 out of 2 forms covered">
035&nbsp;&nbsp;&nbsp;&nbsp;(cond
</span><br/>
<span class="not-covered" title="0 out of 3 forms covered">
036&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;(session&#x2F;put!&nbsp;:world
</span><br/>
<span class="not-covered" title="0 out of 10 forms covered">
037&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;(with-open&nbsp;[_&nbsp;(java.io.FileReader.&nbsp;(:tempfile&nbsp;file))]&nbsp;(read)))
</span><br/>
<span class="not-covered" title="0 out of 6 forms covered">
038&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;(str&nbsp;&quot;Successfully&nbsp;loaded&nbsp;your&nbsp;world&nbsp;from&nbsp;&quot;&nbsp;(:filename&nbsp;file))))
</span><br/>
<span class="blank" title="0 out of 0 forms covered">
039&nbsp;&nbsp;
</span><br/>
<span class="blank" title="0 out of 0 forms covered">
040&nbsp;&nbsp;
</span><br/>
<span class="covered" title="1 out of 1 forms covered">
041&nbsp;&nbsp;(defn&nbsp;load-page
</span><br/>
<span class="not-tracked" title="0 out of 0 forms covered">
042&nbsp;&nbsp;&nbsp;&nbsp;&quot;If&nbsp;no&nbsp;args,&nbsp;show&nbsp;the&nbsp;load&nbsp;form;&nbsp;with&nbsp;args,&nbsp;load&nbsp;a&nbsp;world&nbsp;file&nbsp;from&nbsp;the&nbsp;client.
</span><br/>
<span class="blank" title="0 out of 0 forms covered">
043&nbsp;&nbsp;
</span><br/>
<span class="not-tracked" title="0 out of 0 forms covered">
044&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;*NOTE*&nbsp;that&nbsp;this&nbsp;reads&nbsp;a&nbsp;Clojure&nbsp;form&nbsp;from&nbsp;an&nbsp;untrusted&nbsp;client&nbsp;and&nbsp;should&nbsp;almost
</span><br/>
<span class="not-tracked" title="0 out of 0 forms covered">
045&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;certainly&nbsp;NOT&nbsp;be&nbsp;enabled&nbsp;on&nbsp;a&nbsp;public-facing&nbsp;site,&nbsp;especially&nbsp;not&nbsp;on&nbsp;the&nbsp;Internet.
</span><br/>
<span class="blank" title="0 out of 0 forms covered">
046&nbsp;&nbsp;
</span><br/>
<span class="not-tracked" title="0 out of 0 forms covered">
047&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;*TODO*&nbsp;doesn&#x27;t&nbsp;work&nbsp;yet.&quot;
</span><br/>
<span class="not-tracked" title="0 out of 0 forms covered">
048&nbsp;&nbsp;&nbsp;&nbsp;([]
</span><br/>
<span class="not-covered" title="0 out of 3 forms covered">
049&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;(load-page&nbsp;nil))
</span><br/>
<span class="not-tracked" title="0 out of 0 forms covered">
050&nbsp;&nbsp;&nbsp;&nbsp;([request]
</span><br/>
<span class="not-covered" title="0 out of 4 forms covered">
051&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;(let&nbsp;[file&nbsp;(:file&nbsp;request)]
</span><br/>
<span class="not-covered" title="0 out of 1 forms covered">
052&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;(try
</span><br/>
<span class="not-covered" title="0 out of 3 forms covered">
053&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;(layout&#x2F;render&nbsp;&quot;load.html&quot;
</span><br/>
<span class="not-covered" title="0 out of 4 forms covered">
054&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;{:title&nbsp;&quot;Load&nbsp;World&quot;
</span><br/>
<span class="not-covered" title="0 out of 3 forms covered">
055&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;:message&nbsp;(upload&nbsp;file)})
</span><br/>
<span class="blank" title="0 out of 0 forms covered">
056&nbsp;&nbsp;
</span><br/>
<span class="not-tracked" title="0 out of 0 forms covered">
057&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;(catch&nbsp;Exception&nbsp;any
</span><br/>
<span class="not-covered" title="0 out of 3 forms covered">
058&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;(layout&#x2F;render&nbsp;&quot;load.html&quot;
</span><br/>
<span class="not-covered" title="0 out of 6 forms covered">
059&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;{:title&nbsp;&quot;Load&nbsp;World&quot;
</span><br/>
<span class="not-tracked" title="0 out of 0 forms covered">
060&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;:message&nbsp;&quot;Failed&nbsp;to&nbsp;load&nbsp;your&nbsp;world&quot;
</span><br/>
<span class="not-covered" title="0 out of 6 forms covered">
061&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;:error&nbsp;(str&nbsp;(.getName&nbsp;(.getClass&nbsp;any))&nbsp;&quot;:&nbsp;&quot;&nbsp;(.getMessage&nbsp;any))}))))))
</span><br/>
<span class="blank" title="0 out of 0 forms covered">
062&nbsp;&nbsp;
</span><br/>
</body>
</html>

View file

@ -1,248 +0,0 @@
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
<link rel="stylesheet" href="../../coverage.css"/> <title> mw_ui/routes/params.clj </title>
</head>
<body>
<span class="covered" title="1 out of 1 forms covered">
001&nbsp;&nbsp;(ns&nbsp;^{:doc&nbsp;&quot;Route&nbsp;which&nbsp;serves&nbsp;and&nbsp;handles&nbsp;the&nbsp;parameters&nbsp;page.&quot;
</span><br/>
<span class="not-tracked" title="0 out of 0 forms covered">
002&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;:author&nbsp;&quot;Simon&nbsp;Brooke&quot;}
</span><br/>
<span class="not-tracked" title="0 out of 0 forms covered">
003&nbsp;&nbsp;&nbsp;&nbsp;mw-ui.routes.params
</span><br/>
<span class="not-tracked" title="0 out of 0 forms covered">
004&nbsp;&nbsp;&nbsp;&nbsp;(:require&nbsp;[clojure.walk&nbsp;:refer&nbsp;[keywordize-keys]]
</span><br/>
<span class="not-tracked" title="0 out of 0 forms covered">
005&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;[mw-engine.heightmap&nbsp;:as&nbsp;heightmap]
</span><br/>
<span class="not-tracked" title="0 out of 0 forms covered">
006&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;[mw-parser.bulk&nbsp;:as&nbsp;compiler]
</span><br/>
<span class="not-tracked" title="0 out of 0 forms covered">
007&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;[mw-ui.layout&nbsp;:as&nbsp;layout]
</span><br/>
<span class="not-tracked" title="0 out of 0 forms covered">
008&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;[mw-ui.util&nbsp;:as&nbsp;util]
</span><br/>
<span class="not-tracked" title="0 out of 0 forms covered">
009&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;[noir.io&nbsp;:as&nbsp;io]
</span><br/>
<span class="not-tracked" title="0 out of 0 forms covered">
010&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;[noir.session&nbsp;:as&nbsp;session]))
</span><br/>
<span class="blank" title="0 out of 0 forms covered">
011&nbsp;&nbsp;
</span><br/>
<span class="not-tracked" title="0 out of 0 forms covered">
012&nbsp;&nbsp;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
</span><br/>
<span class="not-tracked" title="0 out of 0 forms covered">
013&nbsp;&nbsp;;;;;
</span><br/>
<span class="not-tracked" title="0 out of 0 forms covered">
014&nbsp;&nbsp;;;;;&nbsp;mw-ui:&nbsp;a&nbsp;servlet&nbsp;user&#x2F;visualisation&nbsp;interface&nbsp;for&nbsp;MicroWorld.
</span><br/>
<span class="not-tracked" title="0 out of 0 forms covered">
015&nbsp;&nbsp;;;;;
</span><br/>
<span class="not-tracked" title="0 out of 0 forms covered">
016&nbsp;&nbsp;;;;;&nbsp;This&nbsp;program&nbsp;is&nbsp;free&nbsp;software;&nbsp;you&nbsp;can&nbsp;redistribute&nbsp;it&nbsp;and&#x2F;or
</span><br/>
<span class="not-tracked" title="0 out of 0 forms covered">
017&nbsp;&nbsp;;;;;&nbsp;modify&nbsp;it&nbsp;under&nbsp;the&nbsp;terms&nbsp;of&nbsp;the&nbsp;GNU&nbsp;General&nbsp;Public&nbsp;License
</span><br/>
<span class="not-tracked" title="0 out of 0 forms covered">
018&nbsp;&nbsp;;;;;&nbsp;as&nbsp;published&nbsp;by&nbsp;the&nbsp;Free&nbsp;Software&nbsp;Foundation;&nbsp;either&nbsp;version&nbsp;2
</span><br/>
<span class="not-tracked" title="0 out of 0 forms covered">
019&nbsp;&nbsp;;;;;&nbsp;of&nbsp;the&nbsp;License,&nbsp;or&nbsp;(at&nbsp;your&nbsp;option)&nbsp;any&nbsp;later&nbsp;version.
</span><br/>
<span class="not-tracked" title="0 out of 0 forms covered">
020&nbsp;&nbsp;;;;;
</span><br/>
<span class="not-tracked" title="0 out of 0 forms covered">
021&nbsp;&nbsp;;;;;&nbsp;This&nbsp;program&nbsp;is&nbsp;distributed&nbsp;in&nbsp;the&nbsp;hope&nbsp;that&nbsp;it&nbsp;will&nbsp;be&nbsp;useful,
</span><br/>
<span class="not-tracked" title="0 out of 0 forms covered">
022&nbsp;&nbsp;;;;;&nbsp;but&nbsp;WITHOUT&nbsp;ANY&nbsp;WARRANTY;&nbsp;without&nbsp;even&nbsp;the&nbsp;implied&nbsp;warranty&nbsp;of
</span><br/>
<span class="not-tracked" title="0 out of 0 forms covered">
023&nbsp;&nbsp;;;;;&nbsp;MERCHANTABILITY&nbsp;or&nbsp;FITNESS&nbsp;FOR&nbsp;A&nbsp;PARTICULAR&nbsp;PURPOSE.&nbsp;&nbsp;See&nbsp;the
</span><br/>
<span class="not-tracked" title="0 out of 0 forms covered">
024&nbsp;&nbsp;;;;;&nbsp;GNU&nbsp;General&nbsp;Public&nbsp;License&nbsp;for&nbsp;more&nbsp;details.
</span><br/>
<span class="not-tracked" title="0 out of 0 forms covered">
025&nbsp;&nbsp;;;;;
</span><br/>
<span class="not-tracked" title="0 out of 0 forms covered">
026&nbsp;&nbsp;;;;;&nbsp;You&nbsp;should&nbsp;have&nbsp;received&nbsp;a&nbsp;copy&nbsp;of&nbsp;the&nbsp;GNU&nbsp;General&nbsp;Public&nbsp;License
</span><br/>
<span class="not-tracked" title="0 out of 0 forms covered">
027&nbsp;&nbsp;;;;;&nbsp;along&nbsp;with&nbsp;this&nbsp;program;&nbsp;if&nbsp;not,&nbsp;write&nbsp;to&nbsp;the&nbsp;Free&nbsp;Software
</span><br/>
<span class="not-tracked" title="0 out of 0 forms covered">
028&nbsp;&nbsp;;;;;&nbsp;Foundation,&nbsp;Inc.,&nbsp;51&nbsp;Franklin&nbsp;Street,&nbsp;Fifth&nbsp;Floor,&nbsp;Boston,&nbsp;MA&nbsp;&nbsp;02110-1301,
</span><br/>
<span class="not-tracked" title="0 out of 0 forms covered">
029&nbsp;&nbsp;;;;;&nbsp;USA.
</span><br/>
<span class="not-tracked" title="0 out of 0 forms covered">
030&nbsp;&nbsp;;;;;
</span><br/>
<span class="not-tracked" title="0 out of 0 forms covered">
031&nbsp;&nbsp;;;;;&nbsp;Copyright&nbsp;(C)&nbsp;2014&nbsp;Simon&nbsp;Brooke
</span><br/>
<span class="not-tracked" title="0 out of 0 forms covered">
032&nbsp;&nbsp;;;;;
</span><br/>
<span class="not-tracked" title="0 out of 0 forms covered">
033&nbsp;&nbsp;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
</span><br/>
<span class="blank" title="0 out of 0 forms covered">
034&nbsp;&nbsp;
</span><br/>
<span class="blank" title="0 out of 0 forms covered">
035&nbsp;&nbsp;
</span><br/>
<span class="covered" title="1 out of 1 forms covered">
036&nbsp;&nbsp;(defn-&nbsp;send-params&nbsp;[]
</span><br/>
<span class="not-covered" title="0 out of 6 forms covered">
037&nbsp;&nbsp;&nbsp;&nbsp;{:title&nbsp;&quot;Choose&nbsp;your&nbsp;world&quot;
</span><br/>
<span class="not-covered" title="0 out of 4 forms covered">
038&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;:heightmaps&nbsp;(util&#x2F;list-resources&nbsp;&quot;&#x2F;img&#x2F;heightmaps&quot;&nbsp;#&quot;&#x2F;?([0-9a-z-_]+).png&quot;)
</span><br/>
<span class="not-covered" title="0 out of 8 forms covered">
039&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;:pause&nbsp;(or&nbsp;(session&#x2F;get&nbsp;:pause)&nbsp;5)
</span><br/>
<span class="not-covered" title="0 out of 4 forms covered">
040&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;:rulesets&nbsp;(util&#x2F;list-resources&nbsp;&quot;&#x2F;rulesets&quot;&nbsp;#&quot;&#x2F;?([0-9a-z-_]+).txt&quot;)
</span><br/>
<span class="not-tracked" title="0 out of 0 forms covered">
041&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;})
</span><br/>
<span class="blank" title="0 out of 0 forms covered">
042&nbsp;&nbsp;
</span><br/>
<span class="blank" title="0 out of 0 forms covered">
043&nbsp;&nbsp;
</span><br/>
<span class="covered" title="1 out of 1 forms covered">
044&nbsp;&nbsp;(defn&nbsp;params-page
</span><br/>
<span class="not-tracked" title="0 out of 0 forms covered">
045&nbsp;&nbsp;&nbsp;&nbsp;&quot;Handler&nbsp;for&nbsp;params&nbsp;request.&nbsp;If&nbsp;no&nbsp;`request`&nbsp;passed,&nbsp;show&nbsp;empty&nbsp;params&nbsp;form.
</span><br/>
<span class="not-tracked" title="0 out of 0 forms covered">
046&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;If&nbsp;`request`&nbsp;is&nbsp;passed,&nbsp;put&nbsp;parameters&nbsp;from&nbsp;request&nbsp;into&nbsp;session&nbsp;and&nbsp;show
</span><br/>
<span class="not-tracked" title="0 out of 0 forms covered">
047&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;the&nbsp;world&nbsp;page.&quot;
</span><br/>
<span class="not-tracked" title="0 out of 0 forms covered">
048&nbsp;&nbsp;&nbsp;&nbsp;([]
</span><br/>
<span class="not-covered" title="0 out of 5 forms covered">
049&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;(layout&#x2F;render&nbsp;&quot;params.html&quot;&nbsp;(send-params)))
</span><br/>
<span class="not-tracked" title="0 out of 0 forms covered">
050&nbsp;&nbsp;&nbsp;&nbsp;([request]
</span><br/>
<span class="not-covered" title="0 out of 1 forms covered">
051&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;(try
</span><br/>
<span class="not-covered" title="0 out of 6 forms covered">
052&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;(let&nbsp;[params&nbsp;(keywordize-keys&nbsp;(:form-params&nbsp;request))
</span><br/>
<span class="not-covered" title="0 out of 3 forms covered">
053&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;map&nbsp;(:heightmap&nbsp;params)
</span><br/>
<span class="not-covered" title="0 out of 3 forms covered">
054&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;pause&nbsp;(:pause&nbsp;params)
</span><br/>
<span class="not-covered" title="0 out of 3 forms covered">
055&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;rulefile&nbsp;(:ruleset&nbsp;params)
</span><br/>
<span class="not-covered" title="0 out of 5 forms covered">
056&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;rulepath&nbsp;(str&nbsp;&quot;&#x2F;rulesets&#x2F;&quot;&nbsp;rulefile&nbsp;&quot;.txt&quot;)]
</span><br/>
<span class="not-covered" title="0 out of 6 forms covered">
057&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;(when&nbsp;(not=&nbsp;map&nbsp;&quot;&quot;)
</span><br/>
<span class="not-covered" title="0 out of 3 forms covered">
058&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;(session&#x2F;put!&nbsp;:world
</span><br/>
<span class="not-covered" title="0 out of 2 forms covered">
059&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;(heightmap&#x2F;apply-heightmap
</span><br/>
<span class="not-covered" title="0 out of 7 forms covered">
060&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;(io&#x2F;get-resource&nbsp;(str&nbsp;&quot;&#x2F;img&#x2F;heightmaps&#x2F;&quot;&nbsp;map&nbsp;&quot;.png&quot;)))))
</span><br/>
<span class="not-covered" title="0 out of 6 forms covered">
061&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;(when&nbsp;(not=&nbsp;rulefile&nbsp;&quot;&quot;)
</span><br/>
<span class="not-covered" title="0 out of 6 forms covered">
062&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;(session&#x2F;put!&nbsp;:rule-text&nbsp;(io&#x2F;slurp-resource&nbsp;rulepath))
</span><br/>
<span class="not-covered" title="0 out of 8 forms covered">
063&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;(session&#x2F;put!&nbsp;:rules&nbsp;(compiler&#x2F;compile-file&nbsp;(io&#x2F;get-resource&nbsp;rulepath))))
</span><br/>
<span class="not-covered" title="0 out of 6 forms covered">
064&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;(when&nbsp;(not=&nbsp;pause&nbsp;&quot;&quot;)
</span><br/>
<span class="not-covered" title="0 out of 4 forms covered">
065&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;(session&#x2F;put!&nbsp;:pause&nbsp;pause))
</span><br/>
<span class="not-covered" title="0 out of 3 forms covered">
066&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;(layout&#x2F;render&nbsp;&quot;params.html&quot;
</span><br/>
<span class="not-covered" title="0 out of 4 forms covered">
067&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;(merge&nbsp;(send-params)
</span><br/>
<span class="not-covered" title="0 out of 6 forms covered">
068&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;{:r&nbsp;rulefile
</span><br/>
<span class="not-covered" title="0 out of 1 forms covered">
069&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;:h&nbsp;map
</span><br/>
<span class="not-tracked" title="0 out of 0 forms covered">
070&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;:message&nbsp;&quot;Your&nbsp;parameters&nbsp;are&nbsp;saved,&nbsp;now&nbsp;look&nbsp;at&nbsp;your&nbsp;world&quot;})))
</span><br/>
<span class="not-tracked" title="0 out of 0 forms covered">
071&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;(catch&nbsp;Exception&nbsp;e
</span><br/>
<span class="not-covered" title="0 out of 6 forms covered">
072&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;(let&nbsp;[params&nbsp;(keywordize-keys&nbsp;(:form-params&nbsp;request))]
</span><br/>
<span class="not-covered" title="0 out of 3 forms covered">
073&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;(layout&#x2F;render&nbsp;&quot;params.html&quot;
</span><br/>
<span class="not-covered" title="0 out of 4 forms covered">
074&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;(merge&nbsp;(send-params)
</span><br/>
<span class="not-covered" title="0 out of 8 forms covered">
075&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;{:title&nbsp;&quot;Choose&nbsp;your&nbsp;world&quot;
</span><br/>
<span class="not-covered" title="0 out of 3 forms covered">
076&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;:r&nbsp;(:ruleset&nbsp;params)
</span><br/>
<span class="not-covered" title="0 out of 3 forms covered">
077&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;:h&nbsp;(:heightmap&nbsp;params)
</span><br/>
<span class="not-tracked" title="0 out of 0 forms covered">
078&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;:message&nbsp;&quot;Your&nbsp;paramters&nbsp;are&nbsp;not&nbsp;saved&quot;
</span><br/>
<span class="not-covered" title="0 out of 8 forms covered">
079&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;:error&nbsp;(str&nbsp;(.getName&nbsp;(.getClass&nbsp;e))&nbsp;&quot;:&nbsp;&quot;&nbsp;(.getMessage&nbsp;e)&nbsp;&quot;;&nbsp;&quot;&nbsp;params)}
</span><br/>
<span class="not-tracked" title="0 out of 0 forms covered">
080&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;)))))))
</span><br/>
</body>
</html>

View file

@ -1,224 +0,0 @@
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
<link rel="stylesheet" href="../../coverage.css"/> <title> mw_ui/routes/rules.clj </title>
</head>
<body>
<span class="covered" title="1 out of 1 forms covered">
001&nbsp;&nbsp;(ns&nbsp;^{:doc&nbsp;&quot;Route&nbsp;which&nbsp;serves&nbsp;and&nbsp;handles&nbsp;the&nbsp;rules&nbsp;page.&quot;
</span><br/>
<span class="not-tracked" title="0 out of 0 forms covered">
002&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;:author&nbsp;&quot;Simon&nbsp;Brooke&quot;}
</span><br/>
<span class="not-tracked" title="0 out of 0 forms covered">
003&nbsp;&nbsp;&nbsp;&nbsp;mw-ui.routes.rules
</span><br/>
<span class="not-tracked" title="0 out of 0 forms covered">
004&nbsp;&nbsp;&nbsp;&nbsp;(:require&nbsp;[clojure.walk&nbsp;:refer&nbsp;[keywordize-keys]]
</span><br/>
<span class="not-tracked" title="0 out of 0 forms covered">
005&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;[mw-parser.bulk&nbsp;:as&nbsp;compiler]
</span><br/>
<span class="not-tracked" title="0 out of 0 forms covered">
006&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;[mw-ui.layout&nbsp;:as&nbsp;layout]
</span><br/>
<span class="not-tracked" title="0 out of 0 forms covered">
007&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;[noir.io&nbsp;:as&nbsp;io]
</span><br/>
<span class="not-tracked" title="0 out of 0 forms covered">
008&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;[noir.session&nbsp;:as&nbsp;session]))
</span><br/>
<span class="blank" title="0 out of 0 forms covered">
009&nbsp;&nbsp;
</span><br/>
<span class="not-tracked" title="0 out of 0 forms covered">
010&nbsp;&nbsp;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
</span><br/>
<span class="not-tracked" title="0 out of 0 forms covered">
011&nbsp;&nbsp;;;;;
</span><br/>
<span class="not-tracked" title="0 out of 0 forms covered">
012&nbsp;&nbsp;;;;;&nbsp;mw-ui:&nbsp;a&nbsp;servlet&nbsp;user&#x2F;visualisation&nbsp;interface&nbsp;for&nbsp;MicroWorld.
</span><br/>
<span class="not-tracked" title="0 out of 0 forms covered">
013&nbsp;&nbsp;;;;;
</span><br/>
<span class="not-tracked" title="0 out of 0 forms covered">
014&nbsp;&nbsp;;;;;&nbsp;This&nbsp;program&nbsp;is&nbsp;free&nbsp;software;&nbsp;you&nbsp;can&nbsp;redistribute&nbsp;it&nbsp;and&#x2F;or
</span><br/>
<span class="not-tracked" title="0 out of 0 forms covered">
015&nbsp;&nbsp;;;;;&nbsp;modify&nbsp;it&nbsp;under&nbsp;the&nbsp;terms&nbsp;of&nbsp;the&nbsp;GNU&nbsp;General&nbsp;Public&nbsp;License
</span><br/>
<span class="not-tracked" title="0 out of 0 forms covered">
016&nbsp;&nbsp;;;;;&nbsp;as&nbsp;published&nbsp;by&nbsp;the&nbsp;Free&nbsp;Software&nbsp;Foundation;&nbsp;either&nbsp;version&nbsp;2
</span><br/>
<span class="not-tracked" title="0 out of 0 forms covered">
017&nbsp;&nbsp;;;;;&nbsp;of&nbsp;the&nbsp;License,&nbsp;or&nbsp;(at&nbsp;your&nbsp;option)&nbsp;any&nbsp;later&nbsp;version.
</span><br/>
<span class="not-tracked" title="0 out of 0 forms covered">
018&nbsp;&nbsp;;;;;
</span><br/>
<span class="not-tracked" title="0 out of 0 forms covered">
019&nbsp;&nbsp;;;;;&nbsp;This&nbsp;program&nbsp;is&nbsp;distributed&nbsp;in&nbsp;the&nbsp;hope&nbsp;that&nbsp;it&nbsp;will&nbsp;be&nbsp;useful,
</span><br/>
<span class="not-tracked" title="0 out of 0 forms covered">
020&nbsp;&nbsp;;;;;&nbsp;but&nbsp;WITHOUT&nbsp;ANY&nbsp;WARRANTY;&nbsp;without&nbsp;even&nbsp;the&nbsp;implied&nbsp;warranty&nbsp;of
</span><br/>
<span class="not-tracked" title="0 out of 0 forms covered">
021&nbsp;&nbsp;;;;;&nbsp;MERCHANTABILITY&nbsp;or&nbsp;FITNESS&nbsp;FOR&nbsp;A&nbsp;PARTICULAR&nbsp;PURPOSE.&nbsp;&nbsp;See&nbsp;the
</span><br/>
<span class="not-tracked" title="0 out of 0 forms covered">
022&nbsp;&nbsp;;;;;&nbsp;GNU&nbsp;General&nbsp;Public&nbsp;License&nbsp;for&nbsp;more&nbsp;details.
</span><br/>
<span class="not-tracked" title="0 out of 0 forms covered">
023&nbsp;&nbsp;;;;;
</span><br/>
<span class="not-tracked" title="0 out of 0 forms covered">
024&nbsp;&nbsp;;;;;&nbsp;You&nbsp;should&nbsp;have&nbsp;received&nbsp;a&nbsp;copy&nbsp;of&nbsp;the&nbsp;GNU&nbsp;General&nbsp;Public&nbsp;License
</span><br/>
<span class="not-tracked" title="0 out of 0 forms covered">
025&nbsp;&nbsp;;;;;&nbsp;along&nbsp;with&nbsp;this&nbsp;program;&nbsp;if&nbsp;not,&nbsp;write&nbsp;to&nbsp;the&nbsp;Free&nbsp;Software
</span><br/>
<span class="not-tracked" title="0 out of 0 forms covered">
026&nbsp;&nbsp;;;;;&nbsp;Foundation,&nbsp;Inc.,&nbsp;51&nbsp;Franklin&nbsp;Street,&nbsp;Fifth&nbsp;Floor,&nbsp;Boston,&nbsp;MA&nbsp;&nbsp;02110-1301,
</span><br/>
<span class="not-tracked" title="0 out of 0 forms covered">
027&nbsp;&nbsp;;;;;&nbsp;USA.
</span><br/>
<span class="not-tracked" title="0 out of 0 forms covered">
028&nbsp;&nbsp;;;;;
</span><br/>
<span class="not-tracked" title="0 out of 0 forms covered">
029&nbsp;&nbsp;;;;;&nbsp;Copyright&nbsp;(C)&nbsp;2014&nbsp;Simon&nbsp;Brooke
</span><br/>
<span class="not-tracked" title="0 out of 0 forms covered">
030&nbsp;&nbsp;;;;;
</span><br/>
<span class="not-tracked" title="0 out of 0 forms covered">
031&nbsp;&nbsp;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
</span><br/>
<span class="blank" title="0 out of 0 forms covered">
032&nbsp;&nbsp;
</span><br/>
<span class="blank" title="0 out of 0 forms covered">
033&nbsp;&nbsp;
</span><br/>
<span class="covered" title="1 out of 1 forms covered">
034&nbsp;&nbsp;(defn&nbsp;process-rules-request
</span><br/>
<span class="not-tracked" title="0 out of 0 forms covered">
035&nbsp;&nbsp;&nbsp;&nbsp;[request]
</span><br/>
<span class="covered" title="8 out of 8 forms covered">
036&nbsp;&nbsp;&nbsp;&nbsp;(let&nbsp;[src&nbsp;(:src&nbsp;(keywordize-keys&nbsp;(:form-params&nbsp;request)))]
</span><br/>
<span class="covered" title="1 out of 1 forms covered">
037&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;(try
</span><br/>
<span class="partial" title="2 out of 3 forms covered">
038&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;(cond&nbsp;src
</span><br/>
<span class="covered" title="4 out of 4 forms covered">
039&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;(let&nbsp;[rules&nbsp;(compiler&#x2F;compile-string&nbsp;src)]
</span><br/>
<span class="covered" title="5 out of 5 forms covered">
040&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;{:rule-text&nbsp;src
</span><br/>
<span class="covered" title="1 out of 1 forms covered">
041&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;:rules&nbsp;rules
</span><br/>
<span class="covered" title="4 out of 4 forms covered">
042&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;:message&nbsp;(str&nbsp;&quot;Successfully&nbsp;compiled&nbsp;&quot;
</span><br/>
<span class="covered" title="2 out of 2 forms covered">
043&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;(count&nbsp;rules)
</span><br/>
<span class="not-tracked" title="0 out of 0 forms covered">
044&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&quot;&nbsp;rules&quot;)&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;})
</span><br/>
<span class="not-covered" title="0 out of 10 forms covered">
045&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;:else&nbsp;{:rule-text&nbsp;(or
</span><br/>
<span class="not-covered" title="0 out of 3 forms covered">
046&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;(session&#x2F;get&nbsp;:rule-text)
</span><br/>
<span class="not-covered" title="0 out of 1 forms covered">
047&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;(io&#x2F;slurp-resource&nbsp;&quot;&#x2F;rulesets&#x2F;basic.txt&quot;))
</span><br/>
<span class="not-tracked" title="0 out of 0 forms covered">
048&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;:message&nbsp;&quot;No&nbsp;rules&nbsp;found&nbsp;in&nbsp;request;&nbsp;loading&nbsp;defaults&quot;})
</span><br/>
<span class="not-tracked" title="0 out of 0 forms covered">
049&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;(catch&nbsp;Exception&nbsp;e
</span><br/>
<span class="not-covered" title="0 out of 6 forms covered">
050&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;{:rule-text&nbsp;src
</span><br/>
<span class="not-tracked" title="0 out of 0 forms covered">
051&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;:message&nbsp;&quot;An&nbsp;error&nbsp;occurred&nbsp;during&nbsp;compilation&quot;
</span><br/>
<span class="not-covered" title="0 out of 6 forms covered">
052&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;:error&nbsp;(str&nbsp;(.getName&nbsp;(.getClass&nbsp;e))&nbsp;&quot;:&nbsp;&quot;&nbsp;(.getMessage&nbsp;e))}))))
</span><br/>
<span class="blank" title="0 out of 0 forms covered">
053&nbsp;&nbsp;
</span><br/>
<span class="blank" title="0 out of 0 forms covered">
054&nbsp;&nbsp;
</span><br/>
<span class="covered" title="1 out of 1 forms covered">
055&nbsp;&nbsp;(defn&nbsp;rules-page
</span><br/>
<span class="not-tracked" title="0 out of 0 forms covered">
056&nbsp;&nbsp;&nbsp;&nbsp;&quot;Request&nbsp;handler&nbsp;for&nbsp;the&nbsp;`rules`&nbsp;request.&nbsp;If&nbsp;the&nbsp;`request`&nbsp;contains&nbsp;a&nbsp;value
</span><br/>
<span class="not-tracked" title="0 out of 0 forms covered">
057&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;for&nbsp;`:src`,&nbsp;treat&nbsp;that&nbsp;as&nbsp;rule&nbsp;source&nbsp;and&nbsp;try&nbsp;to&nbsp;compile&nbsp;it.&nbsp;If&nbsp;compilation
</span><br/>
<span class="not-tracked" title="0 out of 0 forms covered">
058&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;succeeds,&nbsp;stash&nbsp;the&nbsp;compiled&nbsp;rules&nbsp;and&nbsp;the&nbsp;rule&nbsp;text&nbsp;on&nbsp;the&nbsp;session,&nbsp;and
</span><br/>
<span class="not-tracked" title="0 out of 0 forms covered">
059&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;provide&nbsp;feedback;&nbsp;if&nbsp;not,&nbsp;provide&nbsp;feedback.
</span><br/>
<span class="blank" title="0 out of 0 forms covered">
060&nbsp;&nbsp;
</span><br/>
<span class="not-tracked" title="0 out of 0 forms covered">
061&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;If&nbsp;`request`&nbsp;doesn&#x27;t&nbsp;contain&nbsp;a&nbsp;value&nbsp;for&nbsp;`:src`,&nbsp;load&nbsp;basic&nbsp;rule&nbsp;source&nbsp;from
</span><br/>
<span class="not-tracked" title="0 out of 0 forms covered">
062&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;the&nbsp;session&nbsp;or&nbsp;from&nbsp;`resources&#x2F;rulesets&#x2F;basic.txt`&nbsp;and&nbsp;pass&nbsp;that&nbsp;back.&quot;
</span><br/>
<span class="not-tracked" title="0 out of 0 forms covered">
063&nbsp;&nbsp;&nbsp;&nbsp;([request]
</span><br/>
<span class="not-covered" title="0 out of 4 forms covered">
064&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;(let&nbsp;[processed&nbsp;(process-rules-request&nbsp;request)]
</span><br/>
<span class="not-covered" title="0 out of 5 forms covered">
065&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;(when&nbsp;(:rules&nbsp;processed)
</span><br/>
<span class="not-covered" title="0 out of 6 forms covered">
066&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;(session&#x2F;put!&nbsp;:rules&nbsp;(:rules&nbsp;processed)))
</span><br/>
<span class="not-covered" title="0 out of 5 forms covered">
067&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;(when&nbsp;(:rule-text&nbsp;processed)
</span><br/>
<span class="not-covered" title="0 out of 6 forms covered">
068&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;(session&#x2F;put!&nbsp;:rule-text&nbsp;(:rule-text&nbsp;processed)))
</span><br/>
<span class="not-covered" title="0 out of 3 forms covered">
069&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;(layout&#x2F;render&nbsp;&quot;rules.html&quot;
</span><br/>
<span class="not-covered" title="0 out of 6 forms covered">
070&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;(merge&nbsp;{:title&nbsp;&quot;Edit&nbsp;Rules&quot;}&nbsp;processed))))
</span><br/>
<span class="not-tracked" title="0 out of 0 forms covered">
071&nbsp;&nbsp;&nbsp;&nbsp;([]
</span><br/>
<span class="not-covered" title="0 out of 3 forms covered">
072&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;(rules-page&nbsp;nil)))
</span><br/>
</body>
</html>

View file

@ -1,131 +0,0 @@
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
<link rel="stylesheet" href="../../coverage.css"/> <title> mw_ui/routes/save.clj </title>
</head>
<body>
<span class="covered" title="1 out of 1 forms covered">
001&nbsp;&nbsp;(ns&nbsp;^{:doc&nbsp;&quot;Route&nbsp;which&nbsp;handles&nbsp;the&nbsp;saving&nbsp;of&nbsp;world&nbsp;state&nbsp;the&nbsp;client.&quot;
</span><br/>
<span class="not-tracked" title="0 out of 0 forms covered">
002&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;:author&nbsp;&quot;Simon&nbsp;Brooke&quot;}
</span><br/>
<span class="not-tracked" title="0 out of 0 forms covered">
003&nbsp;&nbsp;&nbsp;&nbsp;mw-ui.routes.save
</span><br/>
<span class="not-tracked" title="0 out of 0 forms covered">
004&nbsp;&nbsp;&nbsp;&nbsp;(:require&nbsp;[clojure.pprint&nbsp;:refer&nbsp;[pprint]]
</span><br/>
<span class="not-tracked" title="0 out of 0 forms covered">
005&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;[noir.session&nbsp;:as&nbsp;session]
</span><br/>
<span class="not-tracked" title="0 out of 0 forms covered">
006&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;[noir.response&nbsp;:as&nbsp;response]))
</span><br/>
<span class="blank" title="0 out of 0 forms covered">
007&nbsp;&nbsp;
</span><br/>
<span class="not-tracked" title="0 out of 0 forms covered">
008&nbsp;&nbsp;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
</span><br/>
<span class="not-tracked" title="0 out of 0 forms covered">
009&nbsp;&nbsp;;;;;
</span><br/>
<span class="not-tracked" title="0 out of 0 forms covered">
010&nbsp;&nbsp;;;;;&nbsp;mw-ui:&nbsp;a&nbsp;servlet&nbsp;user&#x2F;visualisation&nbsp;interface&nbsp;for&nbsp;MicroWorld.
</span><br/>
<span class="not-tracked" title="0 out of 0 forms covered">
011&nbsp;&nbsp;;;;;
</span><br/>
<span class="not-tracked" title="0 out of 0 forms covered">
012&nbsp;&nbsp;;;;;&nbsp;This&nbsp;program&nbsp;is&nbsp;free&nbsp;software;&nbsp;you&nbsp;can&nbsp;redistribute&nbsp;it&nbsp;and&#x2F;or
</span><br/>
<span class="not-tracked" title="0 out of 0 forms covered">
013&nbsp;&nbsp;;;;;&nbsp;modify&nbsp;it&nbsp;under&nbsp;the&nbsp;terms&nbsp;of&nbsp;the&nbsp;GNU&nbsp;General&nbsp;Public&nbsp;License
</span><br/>
<span class="not-tracked" title="0 out of 0 forms covered">
014&nbsp;&nbsp;;;;;&nbsp;as&nbsp;published&nbsp;by&nbsp;the&nbsp;Free&nbsp;Software&nbsp;Foundation;&nbsp;either&nbsp;version&nbsp;2
</span><br/>
<span class="not-tracked" title="0 out of 0 forms covered">
015&nbsp;&nbsp;;;;;&nbsp;of&nbsp;the&nbsp;License,&nbsp;or&nbsp;(at&nbsp;your&nbsp;option)&nbsp;any&nbsp;later&nbsp;version.
</span><br/>
<span class="not-tracked" title="0 out of 0 forms covered">
016&nbsp;&nbsp;;;;;
</span><br/>
<span class="not-tracked" title="0 out of 0 forms covered">
017&nbsp;&nbsp;;;;;&nbsp;This&nbsp;program&nbsp;is&nbsp;distributed&nbsp;in&nbsp;the&nbsp;hope&nbsp;that&nbsp;it&nbsp;will&nbsp;be&nbsp;useful,
</span><br/>
<span class="not-tracked" title="0 out of 0 forms covered">
018&nbsp;&nbsp;;;;;&nbsp;but&nbsp;WITHOUT&nbsp;ANY&nbsp;WARRANTY;&nbsp;without&nbsp;even&nbsp;the&nbsp;implied&nbsp;warranty&nbsp;of
</span><br/>
<span class="not-tracked" title="0 out of 0 forms covered">
019&nbsp;&nbsp;;;;;&nbsp;MERCHANTABILITY&nbsp;or&nbsp;FITNESS&nbsp;FOR&nbsp;A&nbsp;PARTICULAR&nbsp;PURPOSE.&nbsp;&nbsp;See&nbsp;the
</span><br/>
<span class="not-tracked" title="0 out of 0 forms covered">
020&nbsp;&nbsp;;;;;&nbsp;GNU&nbsp;General&nbsp;Public&nbsp;License&nbsp;for&nbsp;more&nbsp;details.
</span><br/>
<span class="not-tracked" title="0 out of 0 forms covered">
021&nbsp;&nbsp;;;;;
</span><br/>
<span class="not-tracked" title="0 out of 0 forms covered">
022&nbsp;&nbsp;;;;;&nbsp;You&nbsp;should&nbsp;have&nbsp;received&nbsp;a&nbsp;copy&nbsp;of&nbsp;the&nbsp;GNU&nbsp;General&nbsp;Public&nbsp;License
</span><br/>
<span class="not-tracked" title="0 out of 0 forms covered">
023&nbsp;&nbsp;;;;;&nbsp;along&nbsp;with&nbsp;this&nbsp;program;&nbsp;if&nbsp;not,&nbsp;write&nbsp;to&nbsp;the&nbsp;Free&nbsp;Software
</span><br/>
<span class="not-tracked" title="0 out of 0 forms covered">
024&nbsp;&nbsp;;;;;&nbsp;Foundation,&nbsp;Inc.,&nbsp;51&nbsp;Franklin&nbsp;Street,&nbsp;Fifth&nbsp;Floor,&nbsp;Boston,&nbsp;MA&nbsp;&nbsp;02110-1301,
</span><br/>
<span class="not-tracked" title="0 out of 0 forms covered">
025&nbsp;&nbsp;;;;;&nbsp;USA.
</span><br/>
<span class="not-tracked" title="0 out of 0 forms covered">
026&nbsp;&nbsp;;;;;
</span><br/>
<span class="not-tracked" title="0 out of 0 forms covered">
027&nbsp;&nbsp;;;;;&nbsp;Copyright&nbsp;(C)&nbsp;2014&nbsp;Simon&nbsp;Brooke
</span><br/>
<span class="not-tracked" title="0 out of 0 forms covered">
028&nbsp;&nbsp;;;;;
</span><br/>
<span class="not-tracked" title="0 out of 0 forms covered">
029&nbsp;&nbsp;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
</span><br/>
<span class="blank" title="0 out of 0 forms covered">
030&nbsp;&nbsp;
</span><br/>
<span class="blank" title="0 out of 0 forms covered">
031&nbsp;&nbsp;
</span><br/>
<span class="covered" title="1 out of 1 forms covered">
032&nbsp;&nbsp;(defn&nbsp;save-page&nbsp;
</span><br/>
<span class="not-tracked" title="0 out of 0 forms covered">
033&nbsp;&nbsp;&nbsp;&nbsp;&quot;Save&nbsp;the&nbsp;current&nbsp;world&nbsp;to&nbsp;the&nbsp;browser,&nbsp;using&nbsp;our&nbsp;own&nbsp;custom&nbsp;mime-type&nbsp;in
</span><br/>
<span class="not-tracked" title="0 out of 0 forms covered">
034&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;an&nbsp;attempt&nbsp;to&nbsp;prevent&nbsp;the&nbsp;browser&nbsp;trying&nbsp;to&nbsp;do&nbsp;anything&nbsp;clever&nbsp;with&nbsp;it.
</span><br/>
<span class="not-tracked" title="0 out of 0 forms covered">
035&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;Note&nbsp;that&nbsp;it&nbsp;is&nbsp;saved&nbsp;as&nbsp;a&nbsp;raw&nbsp;Clojure&nbsp;data&nbsp;structure,&nbsp;not&nbsp;as&nbsp;XML&nbsp;or
</span><br/>
<span class="not-tracked" title="0 out of 0 forms covered">
036&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;any&nbsp;proprietary&nbsp;format.&quot;
</span><br/>
<span class="not-tracked" title="0 out of 0 forms covered">
037&nbsp;&nbsp;&nbsp;&nbsp;[]
</span><br/>
<span class="not-covered" title="0 out of 3 forms covered">
038&nbsp;&nbsp;&nbsp;&nbsp;(response&#x2F;content-type
</span><br/>
<span class="not-tracked" title="0 out of 0 forms covered">
039&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&quot;application&#x2F;journeyman-mwm;&nbsp;charset=utf-8&quot;
</span><br/>
<span class="not-covered" title="0 out of 20 forms covered">
040&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;(with-out-str&nbsp;(pprint&nbsp;&nbsp;(session&#x2F;get&nbsp;:world)))))
</span><br/>
<span class="blank" title="0 out of 0 forms covered">
041&nbsp;&nbsp;
</span><br/>
</body>
</html>

View file

@ -1,281 +0,0 @@
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
<link rel="stylesheet" href="../coverage.css"/> <title> mw_ui/util.clj </title>
</head>
<body>
<span class="covered" title="1 out of 1 forms covered">
001&nbsp;&nbsp;(ns&nbsp;^{:doc&nbsp;&quot;Utility&nbsp;functions&nbsp;used&nbsp;by&nbsp;other&nbsp;namespaces&nbsp;in&nbsp;this&nbsp;package.&quot;
</span><br/>
<span class="not-tracked" title="0 out of 0 forms covered">
002&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;:author&nbsp;&quot;Simon&nbsp;Brooke&quot;}
</span><br/>
<span class="not-tracked" title="0 out of 0 forms covered">
003&nbsp;&nbsp;&nbsp;mw-ui.util
</span><br/>
<span class="not-tracked" title="0 out of 0 forms covered">
004&nbsp;&nbsp;&nbsp;&nbsp;(:require&nbsp;[clojure.java.io&nbsp;:refer&nbsp;[file]]
</span><br/>
<span class="not-tracked" title="0 out of 0 forms covered">
005&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;[clojure.string&nbsp;:refer&nbsp;[starts-with?]]
</span><br/>
<span class="not-tracked" title="0 out of 0 forms covered">
006&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;[markdown.core&nbsp;:as&nbsp;md]
</span><br/>
<span class="not-tracked" title="0 out of 0 forms covered">
007&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;[noir.io&nbsp;:as&nbsp;io]
</span><br/>
<span class="not-tracked" title="0 out of 0 forms covered">
008&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;[noir.session&nbsp;:as&nbsp;session]
</span><br/>
<span class="not-tracked" title="0 out of 0 forms covered">
009&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;[taoensso.timbre&nbsp;:as&nbsp;timbre]))
</span><br/>
<span class="blank" title="0 out of 0 forms covered">
010&nbsp;&nbsp;
</span><br/>
<span class="not-tracked" title="0 out of 0 forms covered">
011&nbsp;&nbsp;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
</span><br/>
<span class="not-tracked" title="0 out of 0 forms covered">
012&nbsp;&nbsp;;;;;
</span><br/>
<span class="not-tracked" title="0 out of 0 forms covered">
013&nbsp;&nbsp;;;;;&nbsp;mw-ui:&nbsp;a&nbsp;servlet&nbsp;user&#x2F;visualisation&nbsp;interface&nbsp;for&nbsp;MicroWorld.
</span><br/>
<span class="not-tracked" title="0 out of 0 forms covered">
014&nbsp;&nbsp;;;;;
</span><br/>
<span class="not-tracked" title="0 out of 0 forms covered">
015&nbsp;&nbsp;;;;;&nbsp;This&nbsp;program&nbsp;is&nbsp;free&nbsp;software;&nbsp;you&nbsp;can&nbsp;redistribute&nbsp;it&nbsp;and&#x2F;or
</span><br/>
<span class="not-tracked" title="0 out of 0 forms covered">
016&nbsp;&nbsp;;;;;&nbsp;modify&nbsp;it&nbsp;under&nbsp;the&nbsp;terms&nbsp;of&nbsp;the&nbsp;GNU&nbsp;General&nbsp;Public&nbsp;License
</span><br/>
<span class="not-tracked" title="0 out of 0 forms covered">
017&nbsp;&nbsp;;;;;&nbsp;as&nbsp;published&nbsp;by&nbsp;the&nbsp;Free&nbsp;Software&nbsp;Foundation;&nbsp;either&nbsp;version&nbsp;2
</span><br/>
<span class="not-tracked" title="0 out of 0 forms covered">
018&nbsp;&nbsp;;;;;&nbsp;of&nbsp;the&nbsp;License,&nbsp;or&nbsp;(at&nbsp;your&nbsp;option)&nbsp;any&nbsp;later&nbsp;version.
</span><br/>
<span class="not-tracked" title="0 out of 0 forms covered">
019&nbsp;&nbsp;;;;;
</span><br/>
<span class="not-tracked" title="0 out of 0 forms covered">
020&nbsp;&nbsp;;;;;&nbsp;This&nbsp;program&nbsp;is&nbsp;distributed&nbsp;in&nbsp;the&nbsp;hope&nbsp;that&nbsp;it&nbsp;will&nbsp;be&nbsp;useful,
</span><br/>
<span class="not-tracked" title="0 out of 0 forms covered">
021&nbsp;&nbsp;;;;;&nbsp;but&nbsp;WITHOUT&nbsp;ANY&nbsp;WARRANTY;&nbsp;without&nbsp;even&nbsp;the&nbsp;implied&nbsp;warranty&nbsp;of
</span><br/>
<span class="not-tracked" title="0 out of 0 forms covered">
022&nbsp;&nbsp;;;;;&nbsp;MERCHANTABILITY&nbsp;or&nbsp;FITNESS&nbsp;FOR&nbsp;A&nbsp;PARTICULAR&nbsp;PURPOSE.&nbsp;&nbsp;See&nbsp;the
</span><br/>
<span class="not-tracked" title="0 out of 0 forms covered">
023&nbsp;&nbsp;;;;;&nbsp;GNU&nbsp;General&nbsp;Public&nbsp;License&nbsp;for&nbsp;more&nbsp;details.
</span><br/>
<span class="not-tracked" title="0 out of 0 forms covered">
024&nbsp;&nbsp;;;;;
</span><br/>
<span class="not-tracked" title="0 out of 0 forms covered">
025&nbsp;&nbsp;;;;;&nbsp;You&nbsp;should&nbsp;have&nbsp;received&nbsp;a&nbsp;copy&nbsp;of&nbsp;the&nbsp;GNU&nbsp;General&nbsp;Public&nbsp;License
</span><br/>
<span class="not-tracked" title="0 out of 0 forms covered">
026&nbsp;&nbsp;;;;;&nbsp;along&nbsp;with&nbsp;this&nbsp;program;&nbsp;if&nbsp;not,&nbsp;write&nbsp;to&nbsp;the&nbsp;Free&nbsp;Software
</span><br/>
<span class="not-tracked" title="0 out of 0 forms covered">
027&nbsp;&nbsp;;;;;&nbsp;Foundation,&nbsp;Inc.,&nbsp;51&nbsp;Franklin&nbsp;Street,&nbsp;Fifth&nbsp;Floor,&nbsp;Boston,&nbsp;MA&nbsp;&nbsp;02110-1301,
</span><br/>
<span class="not-tracked" title="0 out of 0 forms covered">
028&nbsp;&nbsp;;;;;&nbsp;USA.
</span><br/>
<span class="not-tracked" title="0 out of 0 forms covered">
029&nbsp;&nbsp;;;;;
</span><br/>
<span class="not-tracked" title="0 out of 0 forms covered">
030&nbsp;&nbsp;;;;;&nbsp;Copyright&nbsp;(C)&nbsp;2014&nbsp;Simon&nbsp;Brooke
</span><br/>
<span class="not-tracked" title="0 out of 0 forms covered">
031&nbsp;&nbsp;;;;;
</span><br/>
<span class="not-tracked" title="0 out of 0 forms covered">
032&nbsp;&nbsp;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
</span><br/>
<span class="blank" title="0 out of 0 forms covered">
033&nbsp;&nbsp;
</span><br/>
<span class="covered" title="1 out of 1 forms covered">
034&nbsp;&nbsp;(def&nbsp;running-from-filesystem&nbsp;
</span><br/>
<span class="not-tracked" title="0 out of 0 forms covered">
035&nbsp;&nbsp;&nbsp;&nbsp;&quot;We&nbsp;assume&nbsp;we&#x27;re&nbsp;running&nbsp;from&nbsp;the&nbsp;filesystem&nbsp;unless&nbsp;we&nbsp;find&nbsp;we&#x27;re&nbsp;not.&quot;
</span><br/>
<span class="covered" title="3 out of 3 forms covered">
036&nbsp;&nbsp;&nbsp;&nbsp;(atom&nbsp;true))
</span><br/>
<span class="blank" title="0 out of 0 forms covered">
037&nbsp;&nbsp;
</span><br/>
<span class="blank" title="0 out of 0 forms covered">
038&nbsp;&nbsp;
</span><br/>
<span class="covered" title="1 out of 1 forms covered">
039&nbsp;&nbsp;(def&nbsp;compile-time-resources
</span><br/>
<span class="not-tracked" title="0 out of 0 forms covered">
040&nbsp;&nbsp;&nbsp;&nbsp;&quot;The&nbsp;resources&nbsp;which&nbsp;were&nbsp;visible&nbsp;at&nbsp;compile&nbsp;time.&nbsp;If&nbsp;we&nbsp;are&nbsp;running&nbsp;from
</span><br/>
<span class="not-tracked" title="0 out of 0 forms covered">
041&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;a&nbsp;JAR&nbsp;file,&nbsp;it&nbsp;is&nbsp;highly&nbsp;likely&nbsp;that&nbsp;these&nbsp;are&nbsp;all&nbsp;the&nbsp;resources&nbsp;available
</span><br/>
<span class="not-tracked" title="0 out of 0 forms covered">
042&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;at&nbsp;run&nbsp;time.&quot;
</span><br/>
<span class="covered" title="4 out of 4 forms covered">
043&nbsp;&nbsp;&nbsp;&nbsp;(let&nbsp;[f&nbsp;(file&nbsp;&quot;resources&#x2F;public&quot;)
</span><br/>
<span class="covered" title="2 out of 2 forms covered">
044&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;n&nbsp;(count&nbsp;(.getCanonicalPath&nbsp;f))]
</span><br/>
<span class="covered" title="3 out of 3 forms covered">
045&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;(remove&nbsp;nil?
</span><br/>
<span class="partial" title="3 out of 5 forms covered">
046&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;(map&nbsp;#(let&nbsp;[s&nbsp;(.getCanonicalPath&nbsp;%)]
</span><br/>
<span class="not-covered" title="0 out of 6 forms covered">
047&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;(when&nbsp;(&gt;&nbsp;(count&nbsp;s)&nbsp;n)
</span><br/>
<span class="not-covered" title="0 out of 4 forms covered">
048&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;(subs&nbsp;s&nbsp;n)))
</span><br/>
<span class="covered" title="3 out of 3 forms covered">
049&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;(file-seq&nbsp;f)))))
</span><br/>
<span class="blank" title="0 out of 0 forms covered">
050&nbsp;&nbsp;
</span><br/>
<span class="blank" title="0 out of 0 forms covered">
051&nbsp;&nbsp;
</span><br/>
<span class="covered" title="1 out of 1 forms covered">
052&nbsp;&nbsp;(defn&nbsp;md-&gt;html
</span><br/>
<span class="not-tracked" title="0 out of 0 forms covered">
053&nbsp;&nbsp;&nbsp;&nbsp;&quot;reads&nbsp;a&nbsp;markdown&nbsp;file&nbsp;from&nbsp;public&#x2F;md&nbsp;and&nbsp;returns&nbsp;an&nbsp;HTML&nbsp;string&quot;
</span><br/>
<span class="not-tracked" title="0 out of 0 forms covered">
054&nbsp;&nbsp;&nbsp;&nbsp;[filename]
</span><br/>
<span class="covered" title="1 out of 1 forms covered">
055&nbsp;&nbsp;&nbsp;&nbsp;(-&gt;&gt;
</span><br/>
<span class="covered" title="3 out of 3 forms covered">
056&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;(io&#x2F;slurp-resource&nbsp;filename)
</span><br/>
<span class="covered" title="1 out of 1 forms covered">
057&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;(md&#x2F;md-to-html-string)))
</span><br/>
<span class="blank" title="0 out of 0 forms covered">
058&nbsp;&nbsp;
</span><br/>
<span class="blank" title="0 out of 0 forms covered">
059&nbsp;&nbsp;
</span><br/>
<span class="covered" title="1 out of 1 forms covered">
060&nbsp;&nbsp;(defn&nbsp;cache-seq-match
</span><br/>
<span class="not-tracked" title="0 out of 0 forms covered">
061&nbsp;&nbsp;&nbsp;&nbsp;&quot;Do&nbsp;the&nbsp;same&nbsp;processing&nbsp;that&nbsp;list-resources&nbsp;does&nbsp;on&nbsp;names&nbsp;fetched&nbsp;from
</span><br/>
<span class="not-tracked" title="0 out of 0 forms covered">
062&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;the&nbsp;file&nbsp;system,&nbsp;except&nbsp;on&nbsp;the&nbsp;resource&nbsp;list&nbsp;cached&nbsp;at&nbsp;compile&nbsp;time.&quot;
</span><br/>
<span class="not-tracked" title="0 out of 0 forms covered">
063&nbsp;&nbsp;&nbsp;&nbsp;[path&nbsp;pattern]
</span><br/>
<span class="not-covered" title="0 out of 16 forms covered">
064&nbsp;&nbsp;&nbsp;&nbsp;(timbre&#x2F;info&nbsp;compile-time-resources)
</span><br/>
<span class="not-covered" title="0 out of 3 forms covered">
065&nbsp;&nbsp;&nbsp;&nbsp;(let&nbsp;[n&nbsp;(count&nbsp;path)]
</span><br/>
<span class="not-covered" title="0 out of 3 forms covered">
066&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;(remove&nbsp;nil?
</span><br/>
<span class="not-covered" title="0 out of 9 forms covered">
067&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;(map&nbsp;#(when&nbsp;(&gt;&nbsp;(count&nbsp;%)&nbsp;n)
</span><br/>
<span class="not-covered" title="0 out of 5 forms covered">
068&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;(let&nbsp;[name&nbsp;(subs&nbsp;%&nbsp;n)]
</span><br/>
<span class="not-covered" title="0 out of 6 forms covered">
069&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;(last&nbsp;(re-matches&nbsp;pattern&nbsp;name))))
</span><br/>
<span class="not-covered" title="0 out of 7 forms covered">
070&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;(filter&nbsp;#(starts-with?&nbsp;%&nbsp;path)&nbsp;
</span><br/>
<span class="not-covered" title="0 out of 1 forms covered">
071&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;compile-time-resources)))))
</span><br/>
<span class="blank" title="0 out of 0 forms covered">
072&nbsp;&nbsp;
</span><br/>
<span class="blank" title="0 out of 0 forms covered">
073&nbsp;&nbsp;
</span><br/>
<span class="covered" title="1 out of 1 forms covered">
074&nbsp;&nbsp;(defn&nbsp;list-resources
</span><br/>
<span class="not-tracked" title="0 out of 0 forms covered">
075&nbsp;&nbsp;&nbsp;&nbsp;&quot;List&nbsp;resource&nbsp;files&nbsp;matching&nbsp;`pattern`&nbsp;in&nbsp;`directory`.&quot;
</span><br/>
<span class="not-tracked" title="0 out of 0 forms covered">
076&nbsp;&nbsp;&nbsp;&nbsp;[directory&nbsp;pattern]
</span><br/>
<span class="not-covered" title="0 out of 1 forms covered">
077&nbsp;&nbsp;&nbsp;&nbsp;(let
</span><br/>
<span class="not-covered" title="0 out of 5 forms covered">
078&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;[path&nbsp;(str&nbsp;(io&#x2F;resource-path)&nbsp;directory)]
</span><br/>
<span class="not-covered" title="0 out of 4 forms covered">
079&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;(session&#x2F;put!&nbsp;:list-resources-path&nbsp;path)
</span><br/>
<span class="not-covered" title="0 out of 1 forms covered">
080&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;(try
</span><br/>
<span class="not-covered" title="0 out of 2 forms covered">
081&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;(sort
</span><br/>
<span class="not-covered" title="0 out of 3 forms covered">
082&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;(remove&nbsp;nil?
</span><br/>
<span class="not-covered" title="0 out of 4 forms covered">
083&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;(if&nbsp;@running-from-filesystem
</span><br/>
<span class="not-covered" title="0 out of 11 forms covered">
084&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;(map&nbsp;#(first&nbsp;(rest&nbsp;(re-matches&nbsp;pattern&nbsp;(.getName&nbsp;%))))
</span><br/>
<span class="not-covered" title="0 out of 5 forms covered">
085&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;(file-seq&nbsp;(file&nbsp;path)))
</span><br/>
<span class="not-covered" title="0 out of 4 forms covered">
086&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;(cache-seq-match&nbsp;directory&nbsp;pattern))))
</span><br/>
<span class="not-tracked" title="0 out of 0 forms covered">
087&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;(catch&nbsp;Exception&nbsp;any
</span><br/>
<span class="not-covered" title="0 out of 17 forms covered">
088&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;(timbre&#x2F;log&nbsp;(str&nbsp;&quot;Not&nbsp;running&nbsp;from&nbsp;filesystem?&quot;
</span><br/>
<span class="not-covered" title="0 out of 2 forms covered">
089&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;(.getName&nbsp;(.getClass&nbsp;any))))
</span><br/>
<span class="not-covered" title="0 out of 4 forms covered">
090&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;(reset!&nbsp;running-from-filesystem&nbsp;false)
</span><br/>
<span class="not-covered" title="0 out of 4 forms covered">
091&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;(cache-seq-match&nbsp;directory&nbsp;pattern)))))
</span><br/>
</body>
</html>

View file

@ -1,551 +0,0 @@
body {
font-family: Helvetica, Arial, sans-serif;
font-size: 15px;
}
pre, code {
font-family: Monaco, DejaVu Sans Mono, Consolas, monospace;
font-size: 9pt;
margin: 15px 0;
}
h1 {
font-weight: normal;
font-size: 29px;
margin: 10px 0 2px 0;
padding: 0;
}
h2 {
font-weight: normal;
font-size: 25px;
}
h5.license {
margin: 9px 0 22px 0;
color: #555;
font-weight: normal;
font-size: 12px;
font-style: italic;
}
.document h1, .namespace-index h1 {
font-size: 32px;
margin-top: 12px;
}
#header, #content, .sidebar {
position: fixed;
}
#header {
top: 0;
left: 0;
right: 0;
height: 22px;
color: #f5f5f5;
padding: 5px 7px;
}
#content {
top: 32px;
right: 0;
bottom: 0;
overflow: auto;
background: #fff;
color: #333;
padding: 0 18px;
}
.sidebar {
position: fixed;
top: 32px;
bottom: 0;
overflow: auto;
}
.sidebar.primary {
background: #e2e2e2;
border-right: solid 1px #cccccc;
left: 0;
width: 250px;
}
.sidebar.secondary {
background: #f2f2f2;
border-right: solid 1px #d7d7d7;
left: 251px;
width: 200px;
}
#content.namespace-index, #content.document {
left: 251px;
}
#content.namespace-docs {
left: 452px;
}
#content.document {
padding-bottom: 10%;
}
#header {
background: #3f3f3f;
box-shadow: 0 0 8px rgba(0, 0, 0, 0.4);
z-index: 100;
}
#header h1 {
margin: 0;
padding: 0;
font-size: 18px;
font-weight: lighter;
text-shadow: -1px -1px 0px #333;
}
#header h1 .project-version {
font-weight: normal;
}
.project-version {
padding-left: 0.15em;
}
#header a, .sidebar a {
display: block;
text-decoration: none;
}
#header a {
color: #f5f5f5;
}
.sidebar a {
color: #333;
}
#header h2 {
float: right;
font-size: 9pt;
font-weight: normal;
margin: 4px 3px;
padding: 0;
color: #bbb;
}
#header h2 a {
display: inline;
}
.sidebar h3 {
margin: 0;
padding: 10px 13px 0 13px;
font-size: 19px;
font-weight: lighter;
}
.sidebar h3 a {
color: #444;
}
.sidebar h3.no-link {
color: #636363;
}
.sidebar ul {
padding: 7px 0 6px 0;
margin: 0;
}
.sidebar ul.index-link {
padding-bottom: 4px;
}
.sidebar li {
display: block;
vertical-align: middle;
}
.sidebar li a, .sidebar li .no-link {
border-left: 3px solid transparent;
padding: 0 10px;
white-space: nowrap;
}
.sidebar li .no-link {
display: block;
color: #777;
font-style: italic;
}
.sidebar li .inner {
display: inline-block;
padding-top: 7px;
height: 24px;
}
.sidebar li a, .sidebar li .tree {
height: 31px;
}
.depth-1 .inner { padding-left: 2px; }
.depth-2 .inner { padding-left: 6px; }
.depth-3 .inner { padding-left: 20px; }
.depth-4 .inner { padding-left: 34px; }
.depth-5 .inner { padding-left: 48px; }
.depth-6 .inner { padding-left: 62px; }
.sidebar li .tree {
display: block;
float: left;
position: relative;
top: -10px;
margin: 0 4px 0 0;
padding: 0;
}
.sidebar li.depth-1 .tree {
display: none;
}
.sidebar li .tree .top, .sidebar li .tree .bottom {
display: block;
margin: 0;
padding: 0;
width: 7px;
}
.sidebar li .tree .top {
border-left: 1px solid #aaa;
border-bottom: 1px solid #aaa;
height: 19px;
}
.sidebar li .tree .bottom {
height: 22px;
}
.sidebar li.branch .tree .bottom {
border-left: 1px solid #aaa;
}
.sidebar.primary li.current a {
border-left: 3px solid #a33;
color: #a33;
}
.sidebar.secondary li.current a {
border-left: 3px solid #33a;
color: #33a;
}
.namespace-index h2 {
margin: 30px 0 0 0;
}
.namespace-index h3 {
font-size: 16px;
font-weight: bold;
margin-bottom: 0;
}
.namespace-index .topics {
padding-left: 30px;
margin: 11px 0 0 0;
}
.namespace-index .topics li {
padding: 5px 0;
}
.namespace-docs h3 {
font-size: 18px;
font-weight: bold;
}
.public h3 {
margin: 0;
float: left;
}
.usage {
clear: both;
}
.public {
margin: 0;
border-top: 1px solid #e0e0e0;
padding-top: 14px;
padding-bottom: 6px;
}
.public:last-child {
margin-bottom: 20%;
}
.members .public:last-child {
margin-bottom: 0;
}
.members {
margin: 15px 0;
}
.members h4 {
color: #555;
font-weight: normal;
font-variant: small-caps;
margin: 0 0 5px 0;
}
.members .inner {
padding-top: 5px;
padding-left: 12px;
margin-top: 2px;
margin-left: 7px;
border-left: 1px solid #bbb;
}
#content .members .inner h3 {
font-size: 12pt;
}
.members .public {
border-top: none;
margin-top: 0;
padding-top: 6px;
padding-bottom: 0;
}
.members .public:first-child {
padding-top: 0;
}
h4.type,
h4.dynamic,
h4.added,
h4.deprecated {
float: left;
margin: 3px 10px 15px 0;
font-size: 15px;
font-weight: bold;
font-variant: small-caps;
}
.public h4.type,
.public h4.dynamic,
.public h4.added,
.public h4.deprecated {
font-size: 13px;
font-weight: bold;
margin: 3px 0 0 10px;
}
.members h4.type,
.members h4.added,
.members h4.deprecated {
margin-top: 1px;
}
h4.type {
color: #717171;
}
h4.dynamic {
color: #9933aa;
}
h4.added {
color: #508820;
}
h4.deprecated {
color: #880000;
}
.namespace {
margin-bottom: 30px;
}
.namespace:last-child {
margin-bottom: 10%;
}
.index {
padding: 0;
font-size: 80%;
margin: 15px 0;
line-height: 16px;
}
.index * {
display: inline;
}
.index p {
padding-right: 3px;
}
.index li {
padding-right: 5px;
}
.index ul {
padding-left: 0;
}
.type-sig {
clear: both;
color: #088;
}
.type-sig pre {
padding-top: 10px;
margin: 0;
}
.usage code {
display: block;
color: #008;
margin: 2px 0;
}
.usage code:first-child {
padding-top: 10px;
}
p {
margin: 15px 0;
}
.public p:first-child, .public pre.plaintext {
margin-top: 12px;
}
.doc {
margin: 0 0 26px 0;
clear: both;
}
.public .doc {
margin: 0;
}
.namespace-index .doc {
margin-bottom: 20px;
}
.namespace-index .namespace .doc {
margin-bottom: 10px;
}
.markdown p, .markdown li, .markdown dt, .markdown dd, .markdown td {
line-height: 22px;
}
.markdown li {
padding: 2px 0;
}
.markdown h2 {
font-weight: normal;
font-size: 25px;
margin: 30px 0 10px 0;
}
.markdown h3 {
font-weight: normal;
font-size: 20px;
margin: 30px 0 0 0;
}
.markdown h4 {
font-size: 15px;
margin: 22px 0 -4px 0;
}
.doc, .public, .namespace .index {
max-width: 680px;
overflow-x: visible;
}
.markdown pre > code {
display: block;
padding: 10px;
}
.markdown pre > code, .src-link a {
border: 1px solid #e4e4e4;
border-radius: 2px;
}
.markdown code:not(.hljs), .src-link a {
background: #f6f6f6;
}
pre.deps {
display: inline-block;
margin: 0 10px;
border: 1px solid #e4e4e4;
border-radius: 2px;
padding: 10px;
background-color: #f6f6f6;
}
.markdown hr {
border-style: solid;
border-top: none;
color: #ccc;
}
.doc ul, .doc ol {
padding-left: 30px;
}
.doc table {
border-collapse: collapse;
margin: 0 10px;
}
.doc table td, .doc table th {
border: 1px solid #dddddd;
padding: 4px 6px;
}
.doc table th {
background: #f2f2f2;
}
.doc dl {
margin: 0 10px 20px 10px;
}
.doc dl dt {
font-weight: bold;
margin: 0;
padding: 3px 0;
border-bottom: 1px solid #ddd;
}
.doc dl dd {
padding: 5px 0;
margin: 0 0 5px 10px;
}
.doc abbr {
border-bottom: 1px dotted #333;
font-variant: none;
cursor: help;
}
.src-link {
margin-bottom: 15px;
}
.src-link a {
font-size: 70%;
padding: 1px 4px;
text-decoration: none;
color: #5555bb;
}

View file

@ -1,97 +0,0 @@
/*
github.com style (c) Vasily Polovnyov <vast@whiteants.net>
*/
.hljs {
display: block;
overflow-x: auto;
padding: 0.5em;
color: #333;
background: #f8f8f8;
}
.hljs-comment,
.hljs-quote {
color: #998;
font-style: italic;
}
.hljs-keyword,
.hljs-selector-tag,
.hljs-subst {
color: #333;
font-weight: bold;
}
.hljs-number,
.hljs-literal,
.hljs-variable,
.hljs-template-variable,
.hljs-tag .hljs-attr {
color: #008080;
}
.hljs-string,
.hljs-doctag {
color: #d14;
}
.hljs-title,
.hljs-section,
.hljs-selector-id {
color: #900;
font-weight: bold;
}
.hljs-subst {
font-weight: normal;
}
.hljs-type,
.hljs-class .hljs-title {
color: #458;
font-weight: bold;
}
.hljs-tag,
.hljs-name,
.hljs-attribute {
color: #000080;
font-weight: normal;
}
.hljs-regexp,
.hljs-link {
color: #009926;
}
.hljs-symbol,
.hljs-bullet {
color: #990073;
}
.hljs-built_in,
.hljs-builtin-name {
color: #0086b3;
}
.hljs-meta {
color: #999;
font-weight: bold;
}
.hljs-deletion {
background: #fdd;
}
.hljs-addition {
background: #dfd;
}
.hljs-emphasis {
font-style: italic;
}
.hljs-strong {
font-weight: bold;
}

View file

@ -1,14 +0,0 @@
<!DOCTYPE html PUBLIC ""
"">
<html><head><meta charset="UTF-8" /><title>Mw-ui 0.2.0-SNAPSHOT</title><link rel="stylesheet" type="text/css" href="css/default.css" /><link rel="stylesheet" type="text/css" href="css/highlight.css" /><script type="text/javascript" src="js/highlight.min.js"></script><script type="text/javascript" src="js/jquery.min.js"></script><script type="text/javascript" src="js/page_effects.js"></script><script>hljs.initHighlightingOnLoad();</script></head><body><div id="header"><h2>Generated by <a href="https://github.com/weavejester/codox">Codox</a></h2><h1><a href="index.html"><span class="project-title"><span class="project-name">Mw-ui</span> <span class="project-version">0.2.0-SNAPSHOT</span></span></a></h1></div><div class="sidebar primary"><h3 class="no-link"><span class="inner">Project</span></h3><ul class="index-link"><li class="depth-1 current"><a href="index.html"><div class="inner">Index</div></a></li></ul><h3 class="no-link"><span class="inner">Namespaces</span></h3><ul><li class="depth-1"><div class="no-link"><div class="inner"><span class="tree"><span class="top"></span><span class="bottom"></span></span><span>mw-ui</span></div></div></li><li class="depth-2 branch"><a href="mw-ui.handler.html"><div class="inner"><span class="tree"><span class="top"></span><span class="bottom"></span></span><span>handler</span></div></a></li><li class="depth-2 branch"><a href="mw-ui.layout.html"><div class="inner"><span class="tree"><span class="top"></span><span class="bottom"></span></span><span>layout</span></div></a></li><li class="depth-2 branch"><a href="mw-ui.middleware.html"><div class="inner"><span class="tree"><span class="top"></span><span class="bottom"></span></span><span>middleware</span></div></a></li><li class="depth-2 branch"><a href="mw-ui.render-world.html"><div class="inner"><span class="tree"><span class="top"></span><span class="bottom"></span></span><span>render-world</span></div></a></li><li class="depth-2 branch"><a href="mw-ui.repl.html"><div class="inner"><span class="tree"><span class="top"></span><span class="bottom"></span></span><span>repl</span></div></a></li><li class="depth-2"><div class="no-link"><div class="inner"><span class="tree"><span class="top"></span><span class="bottom"></span></span><span>routes</span></div></div></li><li class="depth-3 branch"><a href="mw-ui.routes.home.html"><div class="inner"><span class="tree"><span class="top"></span><span class="bottom"></span></span><span>home</span></div></a></li><li class="depth-3 branch"><a href="mw-ui.routes.load.html"><div class="inner"><span class="tree"><span class="top"></span><span class="bottom"></span></span><span>load</span></div></a></li><li class="depth-3 branch"><a href="mw-ui.routes.params.html"><div class="inner"><span class="tree"><span class="top"></span><span class="bottom"></span></span><span>params</span></div></a></li><li class="depth-3 branch"><a href="mw-ui.routes.rules.html"><div class="inner"><span class="tree"><span class="top"></span><span class="bottom"></span></span><span>rules</span></div></a></li><li class="depth-3"><a href="mw-ui.routes.save.html"><div class="inner"><span class="tree"><span class="top"></span><span class="bottom"></span></span><span>save</span></div></a></li><li class="depth-2"><a href="mw-ui.util.html"><div class="inner"><span class="tree" style="top: -176px;"><span class="top" style="height: 185px;"></span><span class="bottom"></span></span><span>util</span></div></a></li></ul></div><div class="namespace-index" id="content"><h1><span class="project-title"><span class="project-name">Mw-ui</span> <span class="project-version">0.2.0-SNAPSHOT</span></span></h1><div class="doc"><p>Web-based user interface for MicroWorld.</p></div><h2>Installation</h2><p>To install, add the following dependency to your project or build file:</p><pre class="deps">[mw-ui "0.2.0-SNAPSHOT"]</pre><h2>Namespaces</h2><div class="namespace"><h3><a href="mw-ui.handler.html">mw-ui.handler</a></h3><div class="doc"><div class="markdown"><p>Set up and tear down the request handler.</p>
</div></div><div class="index"><p>Public variables and functions:</p><ul><li> <a href="mw-ui.handler.html#var-app">app</a> </li><li> <a href="mw-ui.handler.html#var-app-routes">app-routes</a> </li><li> <a href="mw-ui.handler.html#var-destroy">destroy</a> </li><li> <a href="mw-ui.handler.html#var-init">init</a> </li></ul></div></div><div class="namespace"><h3><a href="mw-ui.layout.html">mw-ui.layout</a></h3><div class="doc"><div class="markdown"><p>Layout content as HTML.</p>
</div></div><div class="index"><p>Public variables and functions:</p><ul><li> <a href="mw-ui.layout.html#var-render">render</a> </li><li> <a href="mw-ui.layout.html#var-template-path">template-path</a> </li></ul></div></div><div class="namespace"><h3><a href="mw-ui.middleware.html">mw-ui.middleware</a></h3><div class="doc"><div class="markdown"><p>In truth, boilerplate from Luminus.</p>
</div></div><div class="index"><p>Public variables and functions:</p><ul><li> <a href="mw-ui.middleware.html#var-development-middleware">development-middleware</a> </li><li> <a href="mw-ui.middleware.html#var-load-middleware">load-middleware</a> </li><li> <a href="mw-ui.middleware.html#var-log-request">log-request</a> </li><li> <a href="mw-ui.middleware.html#var-production-middleware">production-middleware</a> </li></ul></div></div><div class="namespace"><h3><a href="mw-ui.render-world.html">mw-ui.render-world</a></h3><div class="doc"><div class="markdown"><p>Render the state of the world as an HTML table.</p>
</div></div><div class="index"><p>Public variables and functions:</p><ul><li> <a href="mw-ui.render-world.html#var-format-css-class">format-css-class</a> </li><li> <a href="mw-ui.render-world.html#var-format-image-path">format-image-path</a> </li><li> <a href="mw-ui.render-world.html#var-format-mouseover">format-mouseover</a> </li><li> <a href="mw-ui.render-world.html#var-render-cell">render-cell</a> </li><li> <a href="mw-ui.render-world.html#var-render-inspector">render-inspector</a> </li><li> <a href="mw-ui.render-world.html#var-render-world-row">render-world-row</a> </li><li> <a href="mw-ui.render-world.html#var-render-world-table">render-world-table</a> </li></ul></div></div><div class="namespace"><h3><a href="mw-ui.repl.html">mw-ui.repl</a></h3><div class="doc"><div class="markdown"><p>In truth, boilerplate from Luminus.</p>
</div></div><div class="index"><p>Public variables and functions:</p><ul><li> <a href="mw-ui.repl.html#var--main">-main</a> </li><li> <a href="mw-ui.repl.html#var-get-handler">get-handler</a> </li><li> <a href="mw-ui.repl.html#var-server">server</a> </li><li> <a href="mw-ui.repl.html#var-start-server">start-server</a> </li><li> <a href="mw-ui.repl.html#var-stop-server">stop-server</a> </li></ul></div></div><div class="namespace"><h3><a href="mw-ui.routes.home.html">mw-ui.routes.home</a></h3><div class="doc"><div class="markdown"><p>Routes which serve the main pages of the application.</p>
</div></div><div class="index"><p>Public variables and functions:</p><ul><li> <a href="mw-ui.routes.home.html#var-about-page">about-page</a> </li><li> <a href="mw-ui.routes.home.html#var-docs-page">docs-page</a> </li><li> <a href="mw-ui.routes.home.html#var-home-page">home-page</a> </li><li> <a href="mw-ui.routes.home.html#var-home-routes">home-routes</a> </li><li> <a href="mw-ui.routes.home.html#var-inspect-page">inspect-page</a> </li><li> <a href="mw-ui.routes.home.html#var-list-states">list-states</a> </li><li> <a href="mw-ui.routes.home.html#var-md-page">md-page</a> </li><li> <a href="mw-ui.routes.home.html#var-world-page">world-page</a> </li></ul></div></div><div class="namespace"><h3><a href="mw-ui.routes.load.html">mw-ui.routes.load</a></h3><div class="doc"><div class="markdown"><p>Route which handles the upload of worlds/rules from the client.</p>
</div></div><div class="index"><p>Public variables and functions:</p><ul><li> <a href="mw-ui.routes.load.html#var-load-page">load-page</a> </li></ul></div></div><div class="namespace"><h3><a href="mw-ui.routes.params.html">mw-ui.routes.params</a></h3><div class="doc"><div class="markdown"><p>Route which serves and handles the parameters page.</p>
</div></div><div class="index"><p>Public variables and functions:</p><ul><li> <a href="mw-ui.routes.params.html#var-params-page">params-page</a> </li></ul></div></div><div class="namespace"><h3><a href="mw-ui.routes.rules.html">mw-ui.routes.rules</a></h3><div class="doc"><div class="markdown"><p>Route which serves and handles the rules page.</p>
</div></div><div class="index"><p>Public variables and functions:</p><ul><li> <a href="mw-ui.routes.rules.html#var-process-rules-request">process-rules-request</a> </li><li> <a href="mw-ui.routes.rules.html#var-rules-page">rules-page</a> </li></ul></div></div><div class="namespace"><h3><a href="mw-ui.routes.save.html">mw-ui.routes.save</a></h3><div class="doc"><div class="markdown"><p>Route which handles the saving of world state the client.</p>
</div></div><div class="index"><p>Public variables and functions:</p><ul><li> <a href="mw-ui.routes.save.html#var-save-page">save-page</a> </li></ul></div></div><div class="namespace"><h3><a href="mw-ui.util.html">mw-ui.util</a></h3><div class="doc"><div class="markdown"><p>Utility functions used by other namespaces in this package.</p>
</div></div><div class="index"><p>Public variables and functions:</p><ul><li> <a href="mw-ui.util.html#var-cache-seq-match">cache-seq-match</a> </li><li> <a href="mw-ui.util.html#var-compile-time-resources">compile-time-resources</a> </li><li> <a href="mw-ui.util.html#var-list-resources">list-resources</a> </li><li> <a href="mw-ui.util.html#var-md-.3Ehtml">md-&gt;html</a> </li><li> <a href="mw-ui.util.html#var-running-from-filesystem">running-from-filesystem</a> </li></ul></div></div></div></body></html>

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

View file

@ -1,112 +0,0 @@
function visibleInParent(element) {
var position = $(element).position().top
return position > -50 && position < ($(element).offsetParent().height() - 50)
}
function hasFragment(link, fragment) {
return $(link).attr("href").indexOf("#" + fragment) != -1
}
function findLinkByFragment(elements, fragment) {
return $(elements).filter(function(i, e) { return hasFragment(e, fragment)}).first()
}
function scrollToCurrentVarLink(elements) {
var elements = $(elements);
var parent = elements.offsetParent();
if (elements.length == 0) return;
var top = elements.first().position().top;
var bottom = elements.last().position().top + elements.last().height();
if (top >= 0 && bottom <= parent.height()) return;
if (top < 0) {
parent.scrollTop(parent.scrollTop() + top);
}
else if (bottom > parent.height()) {
parent.scrollTop(parent.scrollTop() + bottom - parent.height());
}
}
function setCurrentVarLink() {
$('.secondary a').parent().removeClass('current')
$('.anchor').
filter(function(index) { return visibleInParent(this) }).
each(function(index, element) {
findLinkByFragment(".secondary a", element.id).
parent().
addClass('current')
});
scrollToCurrentVarLink('.secondary .current');
}
var hasStorage = (function() { try { return localStorage.getItem } catch(e) {} }())
function scrollPositionId(element) {
var directory = window.location.href.replace(/[^\/]+\.html$/, '')
return 'scroll::' + $(element).attr('id') + '::' + directory
}
function storeScrollPosition(element) {
if (!hasStorage) return;
localStorage.setItem(scrollPositionId(element) + "::x", $(element).scrollLeft())
localStorage.setItem(scrollPositionId(element) + "::y", $(element).scrollTop())
}
function recallScrollPosition(element) {
if (!hasStorage) return;
$(element).scrollLeft(localStorage.getItem(scrollPositionId(element) + "::x"))
$(element).scrollTop(localStorage.getItem(scrollPositionId(element) + "::y"))
}
function persistScrollPosition(element) {
recallScrollPosition(element)
$(element).scroll(function() { storeScrollPosition(element) })
}
function sidebarContentWidth(element) {
var widths = $(element).find('.inner').map(function() { return $(this).innerWidth() })
return Math.max.apply(Math, widths)
}
function calculateSize(width, snap, margin, minimum) {
if (width == 0) {
return 0
}
else {
return Math.max(minimum, (Math.ceil(width / snap) * snap) + (margin * 2))
}
}
function resizeSidebars() {
var primaryWidth = sidebarContentWidth('.primary')
var secondaryWidth = 0
if ($('.secondary').length != 0) {
secondaryWidth = sidebarContentWidth('.secondary')
}
// snap to grid
primaryWidth = calculateSize(primaryWidth, 32, 13, 160)
secondaryWidth = calculateSize(secondaryWidth, 32, 13, 160)
$('.primary').css('width', primaryWidth)
$('.secondary').css('width', secondaryWidth).css('left', primaryWidth + 1)
if (secondaryWidth > 0) {
$('#content').css('left', primaryWidth + secondaryWidth + 2)
}
else {
$('#content').css('left', primaryWidth + 1)
}
}
$(window).ready(resizeSidebars)
$(window).ready(setCurrentVarLink)
$(window).ready(function() { persistScrollPosition('.primary')})
$(window).ready(function() {
$('#content').scroll(setCurrentVarLink)
$(window).resize(setCurrentVarLink)
})

View file

@ -1,8 +0,0 @@
<!DOCTYPE html PUBLIC ""
"">
<html><head><meta charset="UTF-8" /><title>mw-ui.handler documentation</title><link rel="stylesheet" type="text/css" href="css/default.css" /><link rel="stylesheet" type="text/css" href="css/highlight.css" /><script type="text/javascript" src="js/highlight.min.js"></script><script type="text/javascript" src="js/jquery.min.js"></script><script type="text/javascript" src="js/page_effects.js"></script><script>hljs.initHighlightingOnLoad();</script></head><body><div id="header"><h2>Generated by <a href="https://github.com/weavejester/codox">Codox</a></h2><h1><a href="index.html"><span class="project-title"><span class="project-name">Mw-ui</span> <span class="project-version">0.2.0-SNAPSHOT</span></span></a></h1></div><div class="sidebar primary"><h3 class="no-link"><span class="inner">Project</span></h3><ul class="index-link"><li class="depth-1 "><a href="index.html"><div class="inner">Index</div></a></li></ul><h3 class="no-link"><span class="inner">Namespaces</span></h3><ul><li class="depth-1"><div class="no-link"><div class="inner"><span class="tree"><span class="top"></span><span class="bottom"></span></span><span>mw-ui</span></div></div></li><li class="depth-2 branch current"><a href="mw-ui.handler.html"><div class="inner"><span class="tree"><span class="top"></span><span class="bottom"></span></span><span>handler</span></div></a></li><li class="depth-2 branch"><a href="mw-ui.layout.html"><div class="inner"><span class="tree"><span class="top"></span><span class="bottom"></span></span><span>layout</span></div></a></li><li class="depth-2 branch"><a href="mw-ui.middleware.html"><div class="inner"><span class="tree"><span class="top"></span><span class="bottom"></span></span><span>middleware</span></div></a></li><li class="depth-2 branch"><a href="mw-ui.render-world.html"><div class="inner"><span class="tree"><span class="top"></span><span class="bottom"></span></span><span>render-world</span></div></a></li><li class="depth-2 branch"><a href="mw-ui.repl.html"><div class="inner"><span class="tree"><span class="top"></span><span class="bottom"></span></span><span>repl</span></div></a></li><li class="depth-2"><div class="no-link"><div class="inner"><span class="tree"><span class="top"></span><span class="bottom"></span></span><span>routes</span></div></div></li><li class="depth-3 branch"><a href="mw-ui.routes.home.html"><div class="inner"><span class="tree"><span class="top"></span><span class="bottom"></span></span><span>home</span></div></a></li><li class="depth-3 branch"><a href="mw-ui.routes.load.html"><div class="inner"><span class="tree"><span class="top"></span><span class="bottom"></span></span><span>load</span></div></a></li><li class="depth-3 branch"><a href="mw-ui.routes.params.html"><div class="inner"><span class="tree"><span class="top"></span><span class="bottom"></span></span><span>params</span></div></a></li><li class="depth-3 branch"><a href="mw-ui.routes.rules.html"><div class="inner"><span class="tree"><span class="top"></span><span class="bottom"></span></span><span>rules</span></div></a></li><li class="depth-3"><a href="mw-ui.routes.save.html"><div class="inner"><span class="tree"><span class="top"></span><span class="bottom"></span></span><span>save</span></div></a></li><li class="depth-2"><a href="mw-ui.util.html"><div class="inner"><span class="tree" style="top: -176px;"><span class="top" style="height: 185px;"></span><span class="bottom"></span></span><span>util</span></div></a></li></ul></div><div class="sidebar secondary"><h3><a href="#top"><span class="inner">Public Vars</span></a></h3><ul><li class="depth-1"><a href="mw-ui.handler.html#var-app"><div class="inner"><span>app</span></div></a></li><li class="depth-1"><a href="mw-ui.handler.html#var-app-routes"><div class="inner"><span>app-routes</span></div></a></li><li class="depth-1"><a href="mw-ui.handler.html#var-destroy"><div class="inner"><span>destroy</span></div></a></li><li class="depth-1"><a href="mw-ui.handler.html#var-init"><div class="inner"><span>init</span></div></a></li></ul></div><div class="namespace-docs" id="content"><h1 class="anchor" id="top">mw-ui.handler</h1><div class="doc"><div class="markdown"><p>Set up and tear down the request handler.</p>
</div></div><div class="public anchor" id="var-app"><h3>app</h3><div class="usage"></div><div class="doc"><div class="markdown"><p><strong>TODO</strong>: write docs</p>
</div></div><div class="src-link"><a href="https://github.com/simon-brooke/mw-ui/blob/master/src/mw_ui/handler.clj#L73">view source</a></div></div><div class="public anchor" id="var-app-routes"><h3>app-routes</h3><div class="usage"></div><div class="doc"><div class="markdown"><p><strong>TODO</strong>: write docs</p>
</div></div><div class="src-link"><a href="https://github.com/simon-brooke/mw-ui/blob/master/src/mw_ui/handler.clj#L38">view source</a></div></div><div class="public anchor" id="var-destroy"><h3>destroy</h3><div class="usage"><code>(destroy)</code></div><div class="doc"><div class="markdown"><p>destroy will be called when your application shuts down, put any clean up code here</p>
</div></div><div class="src-link"><a href="https://github.com/simon-brooke/mw-ui/blob/master/src/mw_ui/handler.clj#L66">view source</a></div></div><div class="public anchor" id="var-init"><h3>init</h3><div class="usage"><code>(init)</code></div><div class="doc"><div class="markdown"><p>init will be called once when app is deployed as a servlet on an app server such as Tomcat put any initialization code here</p>
</div></div><div class="src-link"><a href="https://github.com/simon-brooke/mw-ui/blob/master/src/mw_ui/handler.clj#L43">view source</a></div></div></div></body></html>

View file

@ -1,6 +0,0 @@
<!DOCTYPE html PUBLIC ""
"">
<html><head><meta charset="UTF-8" /><title>mw-ui.layout documentation</title><link rel="stylesheet" type="text/css" href="css/default.css" /><link rel="stylesheet" type="text/css" href="css/highlight.css" /><script type="text/javascript" src="js/highlight.min.js"></script><script type="text/javascript" src="js/jquery.min.js"></script><script type="text/javascript" src="js/page_effects.js"></script><script>hljs.initHighlightingOnLoad();</script></head><body><div id="header"><h2>Generated by <a href="https://github.com/weavejester/codox">Codox</a></h2><h1><a href="index.html"><span class="project-title"><span class="project-name">Mw-ui</span> <span class="project-version">0.2.0-SNAPSHOT</span></span></a></h1></div><div class="sidebar primary"><h3 class="no-link"><span class="inner">Project</span></h3><ul class="index-link"><li class="depth-1 "><a href="index.html"><div class="inner">Index</div></a></li></ul><h3 class="no-link"><span class="inner">Namespaces</span></h3><ul><li class="depth-1"><div class="no-link"><div class="inner"><span class="tree"><span class="top"></span><span class="bottom"></span></span><span>mw-ui</span></div></div></li><li class="depth-2 branch"><a href="mw-ui.handler.html"><div class="inner"><span class="tree"><span class="top"></span><span class="bottom"></span></span><span>handler</span></div></a></li><li class="depth-2 branch current"><a href="mw-ui.layout.html"><div class="inner"><span class="tree"><span class="top"></span><span class="bottom"></span></span><span>layout</span></div></a></li><li class="depth-2 branch"><a href="mw-ui.middleware.html"><div class="inner"><span class="tree"><span class="top"></span><span class="bottom"></span></span><span>middleware</span></div></a></li><li class="depth-2 branch"><a href="mw-ui.render-world.html"><div class="inner"><span class="tree"><span class="top"></span><span class="bottom"></span></span><span>render-world</span></div></a></li><li class="depth-2 branch"><a href="mw-ui.repl.html"><div class="inner"><span class="tree"><span class="top"></span><span class="bottom"></span></span><span>repl</span></div></a></li><li class="depth-2"><div class="no-link"><div class="inner"><span class="tree"><span class="top"></span><span class="bottom"></span></span><span>routes</span></div></div></li><li class="depth-3 branch"><a href="mw-ui.routes.home.html"><div class="inner"><span class="tree"><span class="top"></span><span class="bottom"></span></span><span>home</span></div></a></li><li class="depth-3 branch"><a href="mw-ui.routes.load.html"><div class="inner"><span class="tree"><span class="top"></span><span class="bottom"></span></span><span>load</span></div></a></li><li class="depth-3 branch"><a href="mw-ui.routes.params.html"><div class="inner"><span class="tree"><span class="top"></span><span class="bottom"></span></span><span>params</span></div></a></li><li class="depth-3 branch"><a href="mw-ui.routes.rules.html"><div class="inner"><span class="tree"><span class="top"></span><span class="bottom"></span></span><span>rules</span></div></a></li><li class="depth-3"><a href="mw-ui.routes.save.html"><div class="inner"><span class="tree"><span class="top"></span><span class="bottom"></span></span><span>save</span></div></a></li><li class="depth-2"><a href="mw-ui.util.html"><div class="inner"><span class="tree" style="top: -176px;"><span class="top" style="height: 185px;"></span><span class="bottom"></span></span><span>util</span></div></a></li></ul></div><div class="sidebar secondary"><h3><a href="#top"><span class="inner">Public Vars</span></a></h3><ul><li class="depth-1"><a href="mw-ui.layout.html#var-render"><div class="inner"><span>render</span></div></a></li><li class="depth-1"><a href="mw-ui.layout.html#var-template-path"><div class="inner"><span>template-path</span></div></a></li></ul></div><div class="namespace-docs" id="content"><h1 class="anchor" id="top">mw-ui.layout</h1><div class="doc"><div class="markdown"><p>Layout content as HTML.</p>
</div></div><div class="public anchor" id="var-render"><h3>render</h3><div class="usage"><code>(render template &amp; [params])</code></div><div class="doc"><div class="markdown"><p><strong>TODO</strong>: write docs</p>
</div></div><div class="src-link"><a href="https://github.com/simon-brooke/mw-ui/blob/master/src/mw_ui/layout.clj#L49">view source</a></div></div><div class="public anchor" id="var-template-path"><h3>template-path</h3><div class="usage"></div><div class="doc"><div class="markdown"><p><strong>TODO</strong>: write docs</p>
</div></div><div class="src-link"><a href="https://github.com/simon-brooke/mw-ui/blob/master/src/mw_ui/layout.clj#L33">view source</a></div></div></div></body></html>

View file

@ -1,8 +0,0 @@
<!DOCTYPE html PUBLIC ""
"">
<html><head><meta charset="UTF-8" /><title>mw-ui.middleware documentation</title><link rel="stylesheet" type="text/css" href="css/default.css" /><link rel="stylesheet" type="text/css" href="css/highlight.css" /><script type="text/javascript" src="js/highlight.min.js"></script><script type="text/javascript" src="js/jquery.min.js"></script><script type="text/javascript" src="js/page_effects.js"></script><script>hljs.initHighlightingOnLoad();</script></head><body><div id="header"><h2>Generated by <a href="https://github.com/weavejester/codox">Codox</a></h2><h1><a href="index.html"><span class="project-title"><span class="project-name">Mw-ui</span> <span class="project-version">0.2.0-SNAPSHOT</span></span></a></h1></div><div class="sidebar primary"><h3 class="no-link"><span class="inner">Project</span></h3><ul class="index-link"><li class="depth-1 "><a href="index.html"><div class="inner">Index</div></a></li></ul><h3 class="no-link"><span class="inner">Namespaces</span></h3><ul><li class="depth-1"><div class="no-link"><div class="inner"><span class="tree"><span class="top"></span><span class="bottom"></span></span><span>mw-ui</span></div></div></li><li class="depth-2 branch"><a href="mw-ui.handler.html"><div class="inner"><span class="tree"><span class="top"></span><span class="bottom"></span></span><span>handler</span></div></a></li><li class="depth-2 branch"><a href="mw-ui.layout.html"><div class="inner"><span class="tree"><span class="top"></span><span class="bottom"></span></span><span>layout</span></div></a></li><li class="depth-2 branch current"><a href="mw-ui.middleware.html"><div class="inner"><span class="tree"><span class="top"></span><span class="bottom"></span></span><span>middleware</span></div></a></li><li class="depth-2 branch"><a href="mw-ui.render-world.html"><div class="inner"><span class="tree"><span class="top"></span><span class="bottom"></span></span><span>render-world</span></div></a></li><li class="depth-2 branch"><a href="mw-ui.repl.html"><div class="inner"><span class="tree"><span class="top"></span><span class="bottom"></span></span><span>repl</span></div></a></li><li class="depth-2"><div class="no-link"><div class="inner"><span class="tree"><span class="top"></span><span class="bottom"></span></span><span>routes</span></div></div></li><li class="depth-3 branch"><a href="mw-ui.routes.home.html"><div class="inner"><span class="tree"><span class="top"></span><span class="bottom"></span></span><span>home</span></div></a></li><li class="depth-3 branch"><a href="mw-ui.routes.load.html"><div class="inner"><span class="tree"><span class="top"></span><span class="bottom"></span></span><span>load</span></div></a></li><li class="depth-3 branch"><a href="mw-ui.routes.params.html"><div class="inner"><span class="tree"><span class="top"></span><span class="bottom"></span></span><span>params</span></div></a></li><li class="depth-3 branch"><a href="mw-ui.routes.rules.html"><div class="inner"><span class="tree"><span class="top"></span><span class="bottom"></span></span><span>rules</span></div></a></li><li class="depth-3"><a href="mw-ui.routes.save.html"><div class="inner"><span class="tree"><span class="top"></span><span class="bottom"></span></span><span>save</span></div></a></li><li class="depth-2"><a href="mw-ui.util.html"><div class="inner"><span class="tree" style="top: -176px;"><span class="top" style="height: 185px;"></span><span class="bottom"></span></span><span>util</span></div></a></li></ul></div><div class="sidebar secondary"><h3><a href="#top"><span class="inner">Public Vars</span></a></h3><ul><li class="depth-1"><a href="mw-ui.middleware.html#var-development-middleware"><div class="inner"><span>development-middleware</span></div></a></li><li class="depth-1"><a href="mw-ui.middleware.html#var-load-middleware"><div class="inner"><span>load-middleware</span></div></a></li><li class="depth-1"><a href="mw-ui.middleware.html#var-log-request"><div class="inner"><span>log-request</span></div></a></li><li class="depth-1"><a href="mw-ui.middleware.html#var-production-middleware"><div class="inner"><span>production-middleware</span></div></a></li></ul></div><div class="namespace-docs" id="content"><h1 class="anchor" id="top">mw-ui.middleware</h1><div class="doc"><div class="markdown"><p>In truth, boilerplate from Luminus.</p>
</div></div><div class="public anchor" id="var-development-middleware"><h3>development-middleware</h3><div class="usage"></div><div class="doc"><div class="markdown"><p><strong>TODO</strong>: write docs</p>
</div></div><div class="src-link"><a href="https://github.com/simon-brooke/mw-ui/blob/master/src/mw_ui/middleware.clj#L40">view source</a></div></div><div class="public anchor" id="var-load-middleware"><h3>load-middleware</h3><div class="usage"><code>(load-middleware)</code></div><div class="doc"><div class="markdown"><p><strong>TODO</strong>: write docs</p>
</div></div><div class="src-link"><a href="https://github.com/simon-brooke/mw-ui/blob/master/src/mw_ui/middleware.clj#L50">view source</a></div></div><div class="public anchor" id="var-log-request"><h3>log-request</h3><div class="usage"><code>(log-request handler)</code></div><div class="doc"><div class="markdown"><p><strong>TODO</strong>: write docs</p>
</div></div><div class="src-link"><a href="https://github.com/simon-brooke/mw-ui/blob/master/src/mw_ui/middleware.clj#L34">view source</a></div></div><div class="public anchor" id="var-production-middleware"><h3>production-middleware</h3><div class="usage"></div><div class="doc"><div class="markdown"><p><strong>TODO</strong>: write docs</p>
</div></div><div class="src-link"><a href="https://github.com/simon-brooke/mw-ui/blob/master/src/mw_ui/middleware.clj#L46">view source</a></div></div></div></body></html>

View file

@ -1,11 +0,0 @@
<!DOCTYPE html PUBLIC ""
"">
<html><head><meta charset="UTF-8" /><title>mw-ui.render-world documentation</title><link rel="stylesheet" type="text/css" href="css/default.css" /><link rel="stylesheet" type="text/css" href="css/highlight.css" /><script type="text/javascript" src="js/highlight.min.js"></script><script type="text/javascript" src="js/jquery.min.js"></script><script type="text/javascript" src="js/page_effects.js"></script><script>hljs.initHighlightingOnLoad();</script></head><body><div id="header"><h2>Generated by <a href="https://github.com/weavejester/codox">Codox</a></h2><h1><a href="index.html"><span class="project-title"><span class="project-name">Mw-ui</span> <span class="project-version">0.2.0-SNAPSHOT</span></span></a></h1></div><div class="sidebar primary"><h3 class="no-link"><span class="inner">Project</span></h3><ul class="index-link"><li class="depth-1 "><a href="index.html"><div class="inner">Index</div></a></li></ul><h3 class="no-link"><span class="inner">Namespaces</span></h3><ul><li class="depth-1"><div class="no-link"><div class="inner"><span class="tree"><span class="top"></span><span class="bottom"></span></span><span>mw-ui</span></div></div></li><li class="depth-2 branch"><a href="mw-ui.handler.html"><div class="inner"><span class="tree"><span class="top"></span><span class="bottom"></span></span><span>handler</span></div></a></li><li class="depth-2 branch"><a href="mw-ui.layout.html"><div class="inner"><span class="tree"><span class="top"></span><span class="bottom"></span></span><span>layout</span></div></a></li><li class="depth-2 branch"><a href="mw-ui.middleware.html"><div class="inner"><span class="tree"><span class="top"></span><span class="bottom"></span></span><span>middleware</span></div></a></li><li class="depth-2 branch current"><a href="mw-ui.render-world.html"><div class="inner"><span class="tree"><span class="top"></span><span class="bottom"></span></span><span>render-world</span></div></a></li><li class="depth-2 branch"><a href="mw-ui.repl.html"><div class="inner"><span class="tree"><span class="top"></span><span class="bottom"></span></span><span>repl</span></div></a></li><li class="depth-2"><div class="no-link"><div class="inner"><span class="tree"><span class="top"></span><span class="bottom"></span></span><span>routes</span></div></div></li><li class="depth-3 branch"><a href="mw-ui.routes.home.html"><div class="inner"><span class="tree"><span class="top"></span><span class="bottom"></span></span><span>home</span></div></a></li><li class="depth-3 branch"><a href="mw-ui.routes.load.html"><div class="inner"><span class="tree"><span class="top"></span><span class="bottom"></span></span><span>load</span></div></a></li><li class="depth-3 branch"><a href="mw-ui.routes.params.html"><div class="inner"><span class="tree"><span class="top"></span><span class="bottom"></span></span><span>params</span></div></a></li><li class="depth-3 branch"><a href="mw-ui.routes.rules.html"><div class="inner"><span class="tree"><span class="top"></span><span class="bottom"></span></span><span>rules</span></div></a></li><li class="depth-3"><a href="mw-ui.routes.save.html"><div class="inner"><span class="tree"><span class="top"></span><span class="bottom"></span></span><span>save</span></div></a></li><li class="depth-2"><a href="mw-ui.util.html"><div class="inner"><span class="tree" style="top: -176px;"><span class="top" style="height: 185px;"></span><span class="bottom"></span></span><span>util</span></div></a></li></ul></div><div class="sidebar secondary"><h3><a href="#top"><span class="inner">Public Vars</span></a></h3><ul><li class="depth-1"><a href="mw-ui.render-world.html#var-format-css-class"><div class="inner"><span>format-css-class</span></div></a></li><li class="depth-1"><a href="mw-ui.render-world.html#var-format-image-path"><div class="inner"><span>format-image-path</span></div></a></li><li class="depth-1"><a href="mw-ui.render-world.html#var-format-mouseover"><div class="inner"><span>format-mouseover</span></div></a></li><li class="depth-1"><a href="mw-ui.render-world.html#var-render-cell"><div class="inner"><span>render-cell</span></div></a></li><li class="depth-1"><a href="mw-ui.render-world.html#var-render-inspector"><div class="inner"><span>render-inspector</span></div></a></li><li class="depth-1"><a href="mw-ui.render-world.html#var-render-world-row"><div class="inner"><span>render-world-row</span></div></a></li><li class="depth-1"><a href="mw-ui.render-world.html#var-render-world-table"><div class="inner"><span>render-world-table</span></div></a></li></ul></div><div class="namespace-docs" id="content"><h1 class="anchor" id="top">mw-ui.render-world</h1><div class="doc"><div class="markdown"><p>Render the state of the world as an HTML table.</p>
</div></div><div class="public anchor" id="var-format-css-class"><h3>format-css-class</h3><div class="usage"><code>(format-css-class statekey)</code></div><div class="doc"><div class="markdown"><p>Format this statekey, assumed to be a keyword indicating a state in the world, into a CSS class</p>
</div></div><div class="src-link"><a href="https://github.com/simon-brooke/mw-ui/blob/master/src/mw_ui/render_world.clj#L34">view source</a></div></div><div class="public anchor" id="var-format-image-path"><h3>format-image-path</h3><div class="usage"><code>(format-image-path statekey)</code></div><div class="doc"><div class="markdown"><p>Render this statekey, assumed to be a keyword indicating a state in the world, into a path which should recover the corresponding image file.</p>
</div></div><div class="src-link"><a href="https://github.com/simon-brooke/mw-ui/blob/master/src/mw_ui/render_world.clj#L41">view source</a></div></div><div class="public anchor" id="var-format-mouseover"><h3>format-mouseover</h3><div class="usage"><code>(format-mouseover cell)</code></div><div class="doc"><div class="markdown"><p><strong>TODO</strong>: write docs</p>
</div></div><div class="src-link"><a href="https://github.com/simon-brooke/mw-ui/blob/master/src/mw_ui/render_world.clj#L48">view source</a></div></div><div class="public anchor" id="var-render-cell"><h3>render-cell</h3><div class="usage"><code>(render-cell cell)</code></div><div class="doc"><div class="markdown"><p>Render this world cell as a Hiccup table cell.</p>
</div></div><div class="src-link"><a href="https://github.com/simon-brooke/mw-ui/blob/master/src/mw_ui/render_world.clj#L52">view source</a></div></div><div class="public anchor" id="var-render-inspector"><h3>render-inspector</h3><div class="usage"><code>(render-inspector cell _)</code><code>(render-inspector cell)</code></div><div class="doc"><div class="markdown"><p>Render in Hiccup format the HTML content of an inspector on this cell.</p>
</div></div><div class="src-link"><a href="https://github.com/simon-brooke/mw-ui/blob/master/src/mw_ui/render_world.clj#L91">view source</a></div></div><div class="public anchor" id="var-render-world-row"><h3>render-world-row</h3><div class="usage"><code>(render-world-row row)</code></div><div class="doc"><div class="markdown"><p>Render this world row as a Hiccup table row.</p>
</div></div><div class="src-link"><a href="https://github.com/simon-brooke/mw-ui/blob/master/src/mw_ui/render_world.clj#L61">view source</a></div></div><div class="public anchor" id="var-render-world-table"><h3>render-world-table</h3><div class="usage"><code>(render-world-table)</code></div><div class="doc"><div class="markdown"><p>Render the world implied by the current session as a complete HTML table in a DIV.</p>
</div></div><div class="src-link"><a href="https://github.com/simon-brooke/mw-ui/blob/master/src/mw_ui/render_world.clj#L67">view source</a></div></div></div></body></html>

View file

@ -1,9 +0,0 @@
<!DOCTYPE html PUBLIC ""
"">
<html><head><meta charset="UTF-8" /><title>mw-ui.repl documentation</title><link rel="stylesheet" type="text/css" href="css/default.css" /><link rel="stylesheet" type="text/css" href="css/highlight.css" /><script type="text/javascript" src="js/highlight.min.js"></script><script type="text/javascript" src="js/jquery.min.js"></script><script type="text/javascript" src="js/page_effects.js"></script><script>hljs.initHighlightingOnLoad();</script></head><body><div id="header"><h2>Generated by <a href="https://github.com/weavejester/codox">Codox</a></h2><h1><a href="index.html"><span class="project-title"><span class="project-name">Mw-ui</span> <span class="project-version">0.2.0-SNAPSHOT</span></span></a></h1></div><div class="sidebar primary"><h3 class="no-link"><span class="inner">Project</span></h3><ul class="index-link"><li class="depth-1 "><a href="index.html"><div class="inner">Index</div></a></li></ul><h3 class="no-link"><span class="inner">Namespaces</span></h3><ul><li class="depth-1"><div class="no-link"><div class="inner"><span class="tree"><span class="top"></span><span class="bottom"></span></span><span>mw-ui</span></div></div></li><li class="depth-2 branch"><a href="mw-ui.handler.html"><div class="inner"><span class="tree"><span class="top"></span><span class="bottom"></span></span><span>handler</span></div></a></li><li class="depth-2 branch"><a href="mw-ui.layout.html"><div class="inner"><span class="tree"><span class="top"></span><span class="bottom"></span></span><span>layout</span></div></a></li><li class="depth-2 branch"><a href="mw-ui.middleware.html"><div class="inner"><span class="tree"><span class="top"></span><span class="bottom"></span></span><span>middleware</span></div></a></li><li class="depth-2 branch"><a href="mw-ui.render-world.html"><div class="inner"><span class="tree"><span class="top"></span><span class="bottom"></span></span><span>render-world</span></div></a></li><li class="depth-2 branch current"><a href="mw-ui.repl.html"><div class="inner"><span class="tree"><span class="top"></span><span class="bottom"></span></span><span>repl</span></div></a></li><li class="depth-2"><div class="no-link"><div class="inner"><span class="tree"><span class="top"></span><span class="bottom"></span></span><span>routes</span></div></div></li><li class="depth-3 branch"><a href="mw-ui.routes.home.html"><div class="inner"><span class="tree"><span class="top"></span><span class="bottom"></span></span><span>home</span></div></a></li><li class="depth-3 branch"><a href="mw-ui.routes.load.html"><div class="inner"><span class="tree"><span class="top"></span><span class="bottom"></span></span><span>load</span></div></a></li><li class="depth-3 branch"><a href="mw-ui.routes.params.html"><div class="inner"><span class="tree"><span class="top"></span><span class="bottom"></span></span><span>params</span></div></a></li><li class="depth-3 branch"><a href="mw-ui.routes.rules.html"><div class="inner"><span class="tree"><span class="top"></span><span class="bottom"></span></span><span>rules</span></div></a></li><li class="depth-3"><a href="mw-ui.routes.save.html"><div class="inner"><span class="tree"><span class="top"></span><span class="bottom"></span></span><span>save</span></div></a></li><li class="depth-2"><a href="mw-ui.util.html"><div class="inner"><span class="tree" style="top: -176px;"><span class="top" style="height: 185px;"></span><span class="bottom"></span></span><span>util</span></div></a></li></ul></div><div class="sidebar secondary"><h3><a href="#top"><span class="inner">Public Vars</span></a></h3><ul><li class="depth-1"><a href="mw-ui.repl.html#var--main"><div class="inner"><span>-main</span></div></a></li><li class="depth-1"><a href="mw-ui.repl.html#var-get-handler"><div class="inner"><span>get-handler</span></div></a></li><li class="depth-1"><a href="mw-ui.repl.html#var-server"><div class="inner"><span>server</span></div></a></li><li class="depth-1"><a href="mw-ui.repl.html#var-start-server"><div class="inner"><span>start-server</span></div></a></li><li class="depth-1"><a href="mw-ui.repl.html#var-stop-server"><div class="inner"><span>stop-server</span></div></a></li></ul></div><div class="namespace-docs" id="content"><h1 class="anchor" id="top">mw-ui.repl</h1><div class="doc"><div class="markdown"><p>In truth, boilerplate from Luminus.</p>
</div></div><div class="public anchor" id="var--main"><h3>-main</h3><div class="usage"><code>(-main)</code></div><div class="doc"><div class="markdown"><p><strong>TODO</strong>: write docs</p>
</div></div><div class="src-link"><a href="https://github.com/simon-brooke/mw-ui/blob/master/src/mw_ui/repl.clj#L64">view source</a></div></div><div class="public anchor" id="var-get-handler"><h3>get-handler</h3><div class="usage"><code>(get-handler)</code></div><div class="doc"><div class="markdown"><p><strong>TODO</strong>: write docs</p>
</div></div><div class="src-link"><a href="https://github.com/simon-brooke/mw-ui/blob/master/src/mw_ui/repl.clj#L36">view source</a></div></div><div class="public anchor" id="var-server"><h3>server</h3><div class="usage"></div><div class="doc"><div class="markdown"><p><strong>TODO</strong>: write docs</p>
</div></div><div class="src-link"><a href="https://github.com/simon-brooke/mw-ui/blob/master/src/mw_ui/repl.clj#L34">view source</a></div></div><div class="public anchor" id="var-start-server"><h3>start-server</h3><div class="usage"><code>(start-server &amp; [port])</code></div><div class="doc"><div class="markdown"><p>used for starting the server in development mode from REPL</p>
</div></div><div class="src-link"><a href="https://github.com/simon-brooke/mw-ui/blob/master/src/mw_ui/repl.clj#L47">view source</a></div></div><div class="public anchor" id="var-stop-server"><h3>stop-server</h3><div class="usage"><code>(stop-server)</code></div><div class="doc"><div class="markdown"><p><strong>TODO</strong>: write docs</p>
</div></div><div class="src-link"><a href="https://github.com/simon-brooke/mw-ui/blob/master/src/mw_ui/repl.clj#L60">view source</a></div></div></div></body></html>

View file

@ -1,12 +0,0 @@
<!DOCTYPE html PUBLIC ""
"">
<html><head><meta charset="UTF-8" /><title>mw-ui.routes.home documentation</title><link rel="stylesheet" type="text/css" href="css/default.css" /><link rel="stylesheet" type="text/css" href="css/highlight.css" /><script type="text/javascript" src="js/highlight.min.js"></script><script type="text/javascript" src="js/jquery.min.js"></script><script type="text/javascript" src="js/page_effects.js"></script><script>hljs.initHighlightingOnLoad();</script></head><body><div id="header"><h2>Generated by <a href="https://github.com/weavejester/codox">Codox</a></h2><h1><a href="index.html"><span class="project-title"><span class="project-name">Mw-ui</span> <span class="project-version">0.2.0-SNAPSHOT</span></span></a></h1></div><div class="sidebar primary"><h3 class="no-link"><span class="inner">Project</span></h3><ul class="index-link"><li class="depth-1 "><a href="index.html"><div class="inner">Index</div></a></li></ul><h3 class="no-link"><span class="inner">Namespaces</span></h3><ul><li class="depth-1"><div class="no-link"><div class="inner"><span class="tree"><span class="top"></span><span class="bottom"></span></span><span>mw-ui</span></div></div></li><li class="depth-2 branch"><a href="mw-ui.handler.html"><div class="inner"><span class="tree"><span class="top"></span><span class="bottom"></span></span><span>handler</span></div></a></li><li class="depth-2 branch"><a href="mw-ui.layout.html"><div class="inner"><span class="tree"><span class="top"></span><span class="bottom"></span></span><span>layout</span></div></a></li><li class="depth-2 branch"><a href="mw-ui.middleware.html"><div class="inner"><span class="tree"><span class="top"></span><span class="bottom"></span></span><span>middleware</span></div></a></li><li class="depth-2 branch"><a href="mw-ui.render-world.html"><div class="inner"><span class="tree"><span class="top"></span><span class="bottom"></span></span><span>render-world</span></div></a></li><li class="depth-2 branch"><a href="mw-ui.repl.html"><div class="inner"><span class="tree"><span class="top"></span><span class="bottom"></span></span><span>repl</span></div></a></li><li class="depth-2"><div class="no-link"><div class="inner"><span class="tree"><span class="top"></span><span class="bottom"></span></span><span>routes</span></div></div></li><li class="depth-3 branch current"><a href="mw-ui.routes.home.html"><div class="inner"><span class="tree"><span class="top"></span><span class="bottom"></span></span><span>home</span></div></a></li><li class="depth-3 branch"><a href="mw-ui.routes.load.html"><div class="inner"><span class="tree"><span class="top"></span><span class="bottom"></span></span><span>load</span></div></a></li><li class="depth-3 branch"><a href="mw-ui.routes.params.html"><div class="inner"><span class="tree"><span class="top"></span><span class="bottom"></span></span><span>params</span></div></a></li><li class="depth-3 branch"><a href="mw-ui.routes.rules.html"><div class="inner"><span class="tree"><span class="top"></span><span class="bottom"></span></span><span>rules</span></div></a></li><li class="depth-3"><a href="mw-ui.routes.save.html"><div class="inner"><span class="tree"><span class="top"></span><span class="bottom"></span></span><span>save</span></div></a></li><li class="depth-2"><a href="mw-ui.util.html"><div class="inner"><span class="tree" style="top: -176px;"><span class="top" style="height: 185px;"></span><span class="bottom"></span></span><span>util</span></div></a></li></ul></div><div class="sidebar secondary"><h3><a href="#top"><span class="inner">Public Vars</span></a></h3><ul><li class="depth-1"><a href="mw-ui.routes.home.html#var-about-page"><div class="inner"><span>about-page</span></div></a></li><li class="depth-1"><a href="mw-ui.routes.home.html#var-docs-page"><div class="inner"><span>docs-page</span></div></a></li><li class="depth-1"><a href="mw-ui.routes.home.html#var-home-page"><div class="inner"><span>home-page</span></div></a></li><li class="depth-1"><a href="mw-ui.routes.home.html#var-home-routes"><div class="inner"><span>home-routes</span></div></a></li><li class="depth-1"><a href="mw-ui.routes.home.html#var-inspect-page"><div class="inner"><span>inspect-page</span></div></a></li><li class="depth-1"><a href="mw-ui.routes.home.html#var-list-states"><div class="inner"><span>list-states</span></div></a></li><li class="depth-1"><a href="mw-ui.routes.home.html#var-md-page"><div class="inner"><span>md-page</span></div></a></li><li class="depth-1"><a href="mw-ui.routes.home.html#var-world-page"><div class="inner"><span>world-page</span></div></a></li></ul></div><div class="namespace-docs" id="content"><h1 class="anchor" id="top">mw-ui.routes.home</h1><div class="doc"><div class="markdown"><p>Routes which serve the main pages of the application.</p>
</div></div><div class="public anchor" id="var-about-page"><h3>about-page</h3><div class="usage"><code>(about-page)</code></div><div class="doc"><div class="markdown"><p><strong>TODO</strong>: write docs</p>
</div></div><div class="src-link"><a href="https://github.com/simon-brooke/mw-ui/blob/master/src/mw_ui/routes/home.clj#L51">view source</a></div></div><div class="public anchor" id="var-docs-page"><h3>docs-page</h3><div class="usage"><code>(docs-page)</code></div><div class="doc"><div class="markdown"><p><strong>TODO</strong>: write docs</p>
</div></div><div class="src-link"><a href="https://github.com/simon-brooke/mw-ui/blob/master/src/mw_ui/routes/home.clj#L58">view source</a></div></div><div class="public anchor" id="var-home-page"><h3>home-page</h3><div class="usage"><code>(home-page)</code></div><div class="doc"><div class="markdown"><p>Render the home page.</p>
</div></div><div class="src-link"><a href="https://github.com/simon-brooke/mw-ui/blob/master/src/mw_ui/routes/home.clj#L66">view source</a></div></div><div class="public anchor" id="var-home-routes"><h3>home-routes</h3><div class="usage"></div><div class="doc"><div class="markdown"><p><strong>TODO</strong>: write docs</p>
</div></div><div class="src-link"><a href="https://github.com/simon-brooke/mw-ui/blob/master/src/mw_ui/routes/home.clj#L118">view source</a></div></div><div class="public anchor" id="var-inspect-page"><h3>inspect-page</h3><div class="usage"><code>(inspect-page request)</code></div><div class="doc"><div class="markdown"><p>Open an inspector on the cell at the co-ordinates specified in this request</p>
</div></div><div class="src-link"><a href="https://github.com/simon-brooke/mw-ui/blob/master/src/mw_ui/routes/home.clj#L73">view source</a></div></div><div class="public anchor" id="var-list-states"><h3>list-states</h3><div class="usage"><code>(list-states)</code></div><div class="doc"><div class="markdown"><p><strong>TODO</strong>: write docs</p>
</div></div><div class="src-link"><a href="https://github.com/simon-brooke/mw-ui/blob/master/src/mw_ui/routes/home.clj#L43">view source</a></div></div><div class="public anchor" id="var-md-page"><h3>md-page</h3><div class="usage"><code>(md-page request)</code></div><div class="doc"><div class="markdown"><p>Render the markdown page specified in this request, if any. Probably undesirable, should be removed.</p>
</div></div><div class="src-link"><a href="https://github.com/simon-brooke/mw-ui/blob/master/src/mw_ui/routes/home.clj#L98">view source</a></div></div><div class="public anchor" id="var-world-page"><h3>world-page</h3><div class="usage"><code>(world-page)</code></div><div class="doc"><div class="markdown"><p><strong>TODO</strong>: write docs</p>
</div></div><div class="src-link"><a href="https://github.com/simon-brooke/mw-ui/blob/master/src/mw_ui/routes/home.clj#L108">view source</a></div></div></div></body></html>

View file

@ -1,7 +0,0 @@
<!DOCTYPE html PUBLIC ""
"">
<html><head><meta charset="UTF-8" /><title>mw-ui.routes.load documentation</title><link rel="stylesheet" type="text/css" href="css/default.css" /><link rel="stylesheet" type="text/css" href="css/highlight.css" /><script type="text/javascript" src="js/highlight.min.js"></script><script type="text/javascript" src="js/jquery.min.js"></script><script type="text/javascript" src="js/page_effects.js"></script><script>hljs.initHighlightingOnLoad();</script></head><body><div id="header"><h2>Generated by <a href="https://github.com/weavejester/codox">Codox</a></h2><h1><a href="index.html"><span class="project-title"><span class="project-name">Mw-ui</span> <span class="project-version">0.2.0-SNAPSHOT</span></span></a></h1></div><div class="sidebar primary"><h3 class="no-link"><span class="inner">Project</span></h3><ul class="index-link"><li class="depth-1 "><a href="index.html"><div class="inner">Index</div></a></li></ul><h3 class="no-link"><span class="inner">Namespaces</span></h3><ul><li class="depth-1"><div class="no-link"><div class="inner"><span class="tree"><span class="top"></span><span class="bottom"></span></span><span>mw-ui</span></div></div></li><li class="depth-2 branch"><a href="mw-ui.handler.html"><div class="inner"><span class="tree"><span class="top"></span><span class="bottom"></span></span><span>handler</span></div></a></li><li class="depth-2 branch"><a href="mw-ui.layout.html"><div class="inner"><span class="tree"><span class="top"></span><span class="bottom"></span></span><span>layout</span></div></a></li><li class="depth-2 branch"><a href="mw-ui.middleware.html"><div class="inner"><span class="tree"><span class="top"></span><span class="bottom"></span></span><span>middleware</span></div></a></li><li class="depth-2 branch"><a href="mw-ui.render-world.html"><div class="inner"><span class="tree"><span class="top"></span><span class="bottom"></span></span><span>render-world</span></div></a></li><li class="depth-2 branch"><a href="mw-ui.repl.html"><div class="inner"><span class="tree"><span class="top"></span><span class="bottom"></span></span><span>repl</span></div></a></li><li class="depth-2"><div class="no-link"><div class="inner"><span class="tree"><span class="top"></span><span class="bottom"></span></span><span>routes</span></div></div></li><li class="depth-3 branch"><a href="mw-ui.routes.home.html"><div class="inner"><span class="tree"><span class="top"></span><span class="bottom"></span></span><span>home</span></div></a></li><li class="depth-3 branch current"><a href="mw-ui.routes.load.html"><div class="inner"><span class="tree"><span class="top"></span><span class="bottom"></span></span><span>load</span></div></a></li><li class="depth-3 branch"><a href="mw-ui.routes.params.html"><div class="inner"><span class="tree"><span class="top"></span><span class="bottom"></span></span><span>params</span></div></a></li><li class="depth-3 branch"><a href="mw-ui.routes.rules.html"><div class="inner"><span class="tree"><span class="top"></span><span class="bottom"></span></span><span>rules</span></div></a></li><li class="depth-3"><a href="mw-ui.routes.save.html"><div class="inner"><span class="tree"><span class="top"></span><span class="bottom"></span></span><span>save</span></div></a></li><li class="depth-2"><a href="mw-ui.util.html"><div class="inner"><span class="tree" style="top: -176px;"><span class="top" style="height: 185px;"></span><span class="bottom"></span></span><span>util</span></div></a></li></ul></div><div class="sidebar secondary"><h3><a href="#top"><span class="inner">Public Vars</span></a></h3><ul><li class="depth-1"><a href="mw-ui.routes.load.html#var-load-page"><div class="inner"><span>load-page</span></div></a></li></ul></div><div class="namespace-docs" id="content"><h1 class="anchor" id="top">mw-ui.routes.load</h1><div class="doc"><div class="markdown"><p>Route which handles the upload of worlds/rules from the client.</p>
</div></div><div class="public anchor" id="var-load-page"><h3>load-page</h3><div class="usage"><code>(load-page)</code><code>(load-page request)</code></div><div class="doc"><div class="markdown"><p>If no args, show the load form; with args, load a world file from the client.</p>
<p><em>NOTE</em> that this reads a Clojure form from an untrusted client and should almost certainly NOT be enabled on a public-facing site, especially not on the Internet.</p>
<p><em>TODO</em> doesnt work yet.</p>
</div></div><div class="src-link"><a href="https://github.com/simon-brooke/mw-ui/blob/master/src/mw_ui/routes/load.clj#L41">view source</a></div></div></div></body></html>

View file

@ -1,5 +0,0 @@
<!DOCTYPE html PUBLIC ""
"">
<html><head><meta charset="UTF-8" /><title>mw-ui.routes.params documentation</title><link rel="stylesheet" type="text/css" href="css/default.css" /><link rel="stylesheet" type="text/css" href="css/highlight.css" /><script type="text/javascript" src="js/highlight.min.js"></script><script type="text/javascript" src="js/jquery.min.js"></script><script type="text/javascript" src="js/page_effects.js"></script><script>hljs.initHighlightingOnLoad();</script></head><body><div id="header"><h2>Generated by <a href="https://github.com/weavejester/codox">Codox</a></h2><h1><a href="index.html"><span class="project-title"><span class="project-name">Mw-ui</span> <span class="project-version">0.2.0-SNAPSHOT</span></span></a></h1></div><div class="sidebar primary"><h3 class="no-link"><span class="inner">Project</span></h3><ul class="index-link"><li class="depth-1 "><a href="index.html"><div class="inner">Index</div></a></li></ul><h3 class="no-link"><span class="inner">Namespaces</span></h3><ul><li class="depth-1"><div class="no-link"><div class="inner"><span class="tree"><span class="top"></span><span class="bottom"></span></span><span>mw-ui</span></div></div></li><li class="depth-2 branch"><a href="mw-ui.handler.html"><div class="inner"><span class="tree"><span class="top"></span><span class="bottom"></span></span><span>handler</span></div></a></li><li class="depth-2 branch"><a href="mw-ui.layout.html"><div class="inner"><span class="tree"><span class="top"></span><span class="bottom"></span></span><span>layout</span></div></a></li><li class="depth-2 branch"><a href="mw-ui.middleware.html"><div class="inner"><span class="tree"><span class="top"></span><span class="bottom"></span></span><span>middleware</span></div></a></li><li class="depth-2 branch"><a href="mw-ui.render-world.html"><div class="inner"><span class="tree"><span class="top"></span><span class="bottom"></span></span><span>render-world</span></div></a></li><li class="depth-2 branch"><a href="mw-ui.repl.html"><div class="inner"><span class="tree"><span class="top"></span><span class="bottom"></span></span><span>repl</span></div></a></li><li class="depth-2"><div class="no-link"><div class="inner"><span class="tree"><span class="top"></span><span class="bottom"></span></span><span>routes</span></div></div></li><li class="depth-3 branch"><a href="mw-ui.routes.home.html"><div class="inner"><span class="tree"><span class="top"></span><span class="bottom"></span></span><span>home</span></div></a></li><li class="depth-3 branch"><a href="mw-ui.routes.load.html"><div class="inner"><span class="tree"><span class="top"></span><span class="bottom"></span></span><span>load</span></div></a></li><li class="depth-3 branch current"><a href="mw-ui.routes.params.html"><div class="inner"><span class="tree"><span class="top"></span><span class="bottom"></span></span><span>params</span></div></a></li><li class="depth-3 branch"><a href="mw-ui.routes.rules.html"><div class="inner"><span class="tree"><span class="top"></span><span class="bottom"></span></span><span>rules</span></div></a></li><li class="depth-3"><a href="mw-ui.routes.save.html"><div class="inner"><span class="tree"><span class="top"></span><span class="bottom"></span></span><span>save</span></div></a></li><li class="depth-2"><a href="mw-ui.util.html"><div class="inner"><span class="tree" style="top: -176px;"><span class="top" style="height: 185px;"></span><span class="bottom"></span></span><span>util</span></div></a></li></ul></div><div class="sidebar secondary"><h3><a href="#top"><span class="inner">Public Vars</span></a></h3><ul><li class="depth-1"><a href="mw-ui.routes.params.html#var-params-page"><div class="inner"><span>params-page</span></div></a></li></ul></div><div class="namespace-docs" id="content"><h1 class="anchor" id="top">mw-ui.routes.params</h1><div class="doc"><div class="markdown"><p>Route which serves and handles the parameters page.</p>
</div></div><div class="public anchor" id="var-params-page"><h3>params-page</h3><div class="usage"><code>(params-page)</code><code>(params-page request)</code></div><div class="doc"><div class="markdown"><p>Handler for params request. If no <code>request</code> passed, show empty params form. If <code>request</code> is passed, put parameters from request into session and show the world page.</p>
</div></div><div class="src-link"><a href="https://github.com/simon-brooke/mw-ui/blob/master/src/mw_ui/routes/params.clj#L44">view source</a></div></div></div></body></html>

View file

@ -1,7 +0,0 @@
<!DOCTYPE html PUBLIC ""
"">
<html><head><meta charset="UTF-8" /><title>mw-ui.routes.rules documentation</title><link rel="stylesheet" type="text/css" href="css/default.css" /><link rel="stylesheet" type="text/css" href="css/highlight.css" /><script type="text/javascript" src="js/highlight.min.js"></script><script type="text/javascript" src="js/jquery.min.js"></script><script type="text/javascript" src="js/page_effects.js"></script><script>hljs.initHighlightingOnLoad();</script></head><body><div id="header"><h2>Generated by <a href="https://github.com/weavejester/codox">Codox</a></h2><h1><a href="index.html"><span class="project-title"><span class="project-name">Mw-ui</span> <span class="project-version">0.2.0-SNAPSHOT</span></span></a></h1></div><div class="sidebar primary"><h3 class="no-link"><span class="inner">Project</span></h3><ul class="index-link"><li class="depth-1 "><a href="index.html"><div class="inner">Index</div></a></li></ul><h3 class="no-link"><span class="inner">Namespaces</span></h3><ul><li class="depth-1"><div class="no-link"><div class="inner"><span class="tree"><span class="top"></span><span class="bottom"></span></span><span>mw-ui</span></div></div></li><li class="depth-2 branch"><a href="mw-ui.handler.html"><div class="inner"><span class="tree"><span class="top"></span><span class="bottom"></span></span><span>handler</span></div></a></li><li class="depth-2 branch"><a href="mw-ui.layout.html"><div class="inner"><span class="tree"><span class="top"></span><span class="bottom"></span></span><span>layout</span></div></a></li><li class="depth-2 branch"><a href="mw-ui.middleware.html"><div class="inner"><span class="tree"><span class="top"></span><span class="bottom"></span></span><span>middleware</span></div></a></li><li class="depth-2 branch"><a href="mw-ui.render-world.html"><div class="inner"><span class="tree"><span class="top"></span><span class="bottom"></span></span><span>render-world</span></div></a></li><li class="depth-2 branch"><a href="mw-ui.repl.html"><div class="inner"><span class="tree"><span class="top"></span><span class="bottom"></span></span><span>repl</span></div></a></li><li class="depth-2"><div class="no-link"><div class="inner"><span class="tree"><span class="top"></span><span class="bottom"></span></span><span>routes</span></div></div></li><li class="depth-3 branch"><a href="mw-ui.routes.home.html"><div class="inner"><span class="tree"><span class="top"></span><span class="bottom"></span></span><span>home</span></div></a></li><li class="depth-3 branch"><a href="mw-ui.routes.load.html"><div class="inner"><span class="tree"><span class="top"></span><span class="bottom"></span></span><span>load</span></div></a></li><li class="depth-3 branch"><a href="mw-ui.routes.params.html"><div class="inner"><span class="tree"><span class="top"></span><span class="bottom"></span></span><span>params</span></div></a></li><li class="depth-3 branch current"><a href="mw-ui.routes.rules.html"><div class="inner"><span class="tree"><span class="top"></span><span class="bottom"></span></span><span>rules</span></div></a></li><li class="depth-3"><a href="mw-ui.routes.save.html"><div class="inner"><span class="tree"><span class="top"></span><span class="bottom"></span></span><span>save</span></div></a></li><li class="depth-2"><a href="mw-ui.util.html"><div class="inner"><span class="tree" style="top: -176px;"><span class="top" style="height: 185px;"></span><span class="bottom"></span></span><span>util</span></div></a></li></ul></div><div class="sidebar secondary"><h3><a href="#top"><span class="inner">Public Vars</span></a></h3><ul><li class="depth-1"><a href="mw-ui.routes.rules.html#var-process-rules-request"><div class="inner"><span>process-rules-request</span></div></a></li><li class="depth-1"><a href="mw-ui.routes.rules.html#var-rules-page"><div class="inner"><span>rules-page</span></div></a></li></ul></div><div class="namespace-docs" id="content"><h1 class="anchor" id="top">mw-ui.routes.rules</h1><div class="doc"><div class="markdown"><p>Route which serves and handles the rules page.</p>
</div></div><div class="public anchor" id="var-process-rules-request"><h3>process-rules-request</h3><div class="usage"><code>(process-rules-request request)</code></div><div class="doc"><div class="markdown"><p><strong>TODO</strong>: write docs</p>
</div></div><div class="src-link"><a href="https://github.com/simon-brooke/mw-ui/blob/master/src/mw_ui/routes/rules.clj#L34">view source</a></div></div><div class="public anchor" id="var-rules-page"><h3>rules-page</h3><div class="usage"><code>(rules-page request)</code><code>(rules-page)</code></div><div class="doc"><div class="markdown"><p>Request handler for the <code>rules</code> request. If the <code>request</code> contains a value for <code>:src</code>, treat that as rule source and try to compile it. If compilation succeeds, stash the compiled rules and the rule text on the session, and provide feedback; if not, provide feedback.</p>
<p>If <code>request</code> doesnt contain a value for <code>:src</code>, load basic rule source from the session or from <code>resources/rulesets/basic.txt</code> and pass that back.</p>
</div></div><div class="src-link"><a href="https://github.com/simon-brooke/mw-ui/blob/master/src/mw_ui/routes/rules.clj#L55">view source</a></div></div></div></body></html>

View file

@ -1,5 +0,0 @@
<!DOCTYPE html PUBLIC ""
"">
<html><head><meta charset="UTF-8" /><title>mw-ui.routes.save documentation</title><link rel="stylesheet" type="text/css" href="css/default.css" /><link rel="stylesheet" type="text/css" href="css/highlight.css" /><script type="text/javascript" src="js/highlight.min.js"></script><script type="text/javascript" src="js/jquery.min.js"></script><script type="text/javascript" src="js/page_effects.js"></script><script>hljs.initHighlightingOnLoad();</script></head><body><div id="header"><h2>Generated by <a href="https://github.com/weavejester/codox">Codox</a></h2><h1><a href="index.html"><span class="project-title"><span class="project-name">Mw-ui</span> <span class="project-version">0.2.0-SNAPSHOT</span></span></a></h1></div><div class="sidebar primary"><h3 class="no-link"><span class="inner">Project</span></h3><ul class="index-link"><li class="depth-1 "><a href="index.html"><div class="inner">Index</div></a></li></ul><h3 class="no-link"><span class="inner">Namespaces</span></h3><ul><li class="depth-1"><div class="no-link"><div class="inner"><span class="tree"><span class="top"></span><span class="bottom"></span></span><span>mw-ui</span></div></div></li><li class="depth-2 branch"><a href="mw-ui.handler.html"><div class="inner"><span class="tree"><span class="top"></span><span class="bottom"></span></span><span>handler</span></div></a></li><li class="depth-2 branch"><a href="mw-ui.layout.html"><div class="inner"><span class="tree"><span class="top"></span><span class="bottom"></span></span><span>layout</span></div></a></li><li class="depth-2 branch"><a href="mw-ui.middleware.html"><div class="inner"><span class="tree"><span class="top"></span><span class="bottom"></span></span><span>middleware</span></div></a></li><li class="depth-2 branch"><a href="mw-ui.render-world.html"><div class="inner"><span class="tree"><span class="top"></span><span class="bottom"></span></span><span>render-world</span></div></a></li><li class="depth-2 branch"><a href="mw-ui.repl.html"><div class="inner"><span class="tree"><span class="top"></span><span class="bottom"></span></span><span>repl</span></div></a></li><li class="depth-2"><div class="no-link"><div class="inner"><span class="tree"><span class="top"></span><span class="bottom"></span></span><span>routes</span></div></div></li><li class="depth-3 branch"><a href="mw-ui.routes.home.html"><div class="inner"><span class="tree"><span class="top"></span><span class="bottom"></span></span><span>home</span></div></a></li><li class="depth-3 branch"><a href="mw-ui.routes.load.html"><div class="inner"><span class="tree"><span class="top"></span><span class="bottom"></span></span><span>load</span></div></a></li><li class="depth-3 branch"><a href="mw-ui.routes.params.html"><div class="inner"><span class="tree"><span class="top"></span><span class="bottom"></span></span><span>params</span></div></a></li><li class="depth-3 branch"><a href="mw-ui.routes.rules.html"><div class="inner"><span class="tree"><span class="top"></span><span class="bottom"></span></span><span>rules</span></div></a></li><li class="depth-3 current"><a href="mw-ui.routes.save.html"><div class="inner"><span class="tree"><span class="top"></span><span class="bottom"></span></span><span>save</span></div></a></li><li class="depth-2"><a href="mw-ui.util.html"><div class="inner"><span class="tree" style="top: -176px;"><span class="top" style="height: 185px;"></span><span class="bottom"></span></span><span>util</span></div></a></li></ul></div><div class="sidebar secondary"><h3><a href="#top"><span class="inner">Public Vars</span></a></h3><ul><li class="depth-1"><a href="mw-ui.routes.save.html#var-save-page"><div class="inner"><span>save-page</span></div></a></li></ul></div><div class="namespace-docs" id="content"><h1 class="anchor" id="top">mw-ui.routes.save</h1><div class="doc"><div class="markdown"><p>Route which handles the saving of world state the client.</p>
</div></div><div class="public anchor" id="var-save-page"><h3>save-page</h3><div class="usage"><code>(save-page)</code></div><div class="doc"><div class="markdown"><p>Save the current world to the browser, using our own custom mime-type in an attempt to prevent the browser trying to do anything clever with it. Note that it is saved as a raw Clojure data structure, not as XML or any proprietary format.</p>
</div></div><div class="src-link"><a href="https://github.com/simon-brooke/mw-ui/blob/master/src/mw_ui/routes/save.clj#L32">view source</a></div></div></div></body></html>

View file

@ -1,9 +0,0 @@
<!DOCTYPE html PUBLIC ""
"">
<html><head><meta charset="UTF-8" /><title>mw-ui.util documentation</title><link rel="stylesheet" type="text/css" href="css/default.css" /><link rel="stylesheet" type="text/css" href="css/highlight.css" /><script type="text/javascript" src="js/highlight.min.js"></script><script type="text/javascript" src="js/jquery.min.js"></script><script type="text/javascript" src="js/page_effects.js"></script><script>hljs.initHighlightingOnLoad();</script></head><body><div id="header"><h2>Generated by <a href="https://github.com/weavejester/codox">Codox</a></h2><h1><a href="index.html"><span class="project-title"><span class="project-name">Mw-ui</span> <span class="project-version">0.2.0-SNAPSHOT</span></span></a></h1></div><div class="sidebar primary"><h3 class="no-link"><span class="inner">Project</span></h3><ul class="index-link"><li class="depth-1 "><a href="index.html"><div class="inner">Index</div></a></li></ul><h3 class="no-link"><span class="inner">Namespaces</span></h3><ul><li class="depth-1"><div class="no-link"><div class="inner"><span class="tree"><span class="top"></span><span class="bottom"></span></span><span>mw-ui</span></div></div></li><li class="depth-2 branch"><a href="mw-ui.handler.html"><div class="inner"><span class="tree"><span class="top"></span><span class="bottom"></span></span><span>handler</span></div></a></li><li class="depth-2 branch"><a href="mw-ui.layout.html"><div class="inner"><span class="tree"><span class="top"></span><span class="bottom"></span></span><span>layout</span></div></a></li><li class="depth-2 branch"><a href="mw-ui.middleware.html"><div class="inner"><span class="tree"><span class="top"></span><span class="bottom"></span></span><span>middleware</span></div></a></li><li class="depth-2 branch"><a href="mw-ui.render-world.html"><div class="inner"><span class="tree"><span class="top"></span><span class="bottom"></span></span><span>render-world</span></div></a></li><li class="depth-2 branch"><a href="mw-ui.repl.html"><div class="inner"><span class="tree"><span class="top"></span><span class="bottom"></span></span><span>repl</span></div></a></li><li class="depth-2"><div class="no-link"><div class="inner"><span class="tree"><span class="top"></span><span class="bottom"></span></span><span>routes</span></div></div></li><li class="depth-3 branch"><a href="mw-ui.routes.home.html"><div class="inner"><span class="tree"><span class="top"></span><span class="bottom"></span></span><span>home</span></div></a></li><li class="depth-3 branch"><a href="mw-ui.routes.load.html"><div class="inner"><span class="tree"><span class="top"></span><span class="bottom"></span></span><span>load</span></div></a></li><li class="depth-3 branch"><a href="mw-ui.routes.params.html"><div class="inner"><span class="tree"><span class="top"></span><span class="bottom"></span></span><span>params</span></div></a></li><li class="depth-3 branch"><a href="mw-ui.routes.rules.html"><div class="inner"><span class="tree"><span class="top"></span><span class="bottom"></span></span><span>rules</span></div></a></li><li class="depth-3"><a href="mw-ui.routes.save.html"><div class="inner"><span class="tree"><span class="top"></span><span class="bottom"></span></span><span>save</span></div></a></li><li class="depth-2 current"><a href="mw-ui.util.html"><div class="inner"><span class="tree" style="top: -176px;"><span class="top" style="height: 185px;"></span><span class="bottom"></span></span><span>util</span></div></a></li></ul></div><div class="sidebar secondary"><h3><a href="#top"><span class="inner">Public Vars</span></a></h3><ul><li class="depth-1"><a href="mw-ui.util.html#var-cache-seq-match"><div class="inner"><span>cache-seq-match</span></div></a></li><li class="depth-1"><a href="mw-ui.util.html#var-compile-time-resources"><div class="inner"><span>compile-time-resources</span></div></a></li><li class="depth-1"><a href="mw-ui.util.html#var-list-resources"><div class="inner"><span>list-resources</span></div></a></li><li class="depth-1"><a href="mw-ui.util.html#var-md-.3Ehtml"><div class="inner"><span>md-&gt;html</span></div></a></li><li class="depth-1"><a href="mw-ui.util.html#var-running-from-filesystem"><div class="inner"><span>running-from-filesystem</span></div></a></li></ul></div><div class="namespace-docs" id="content"><h1 class="anchor" id="top">mw-ui.util</h1><div class="doc"><div class="markdown"><p>Utility functions used by other namespaces in this package.</p>
</div></div><div class="public anchor" id="var-cache-seq-match"><h3>cache-seq-match</h3><div class="usage"><code>(cache-seq-match path pattern)</code></div><div class="doc"><div class="markdown"><p>Do the same processing that list-resources does on names fetched from the file system, except on the resource list cached at compile time.</p>
</div></div><div class="src-link"><a href="https://github.com/simon-brooke/mw-ui/blob/master/src/mw_ui/util.clj#L60">view source</a></div></div><div class="public anchor" id="var-compile-time-resources"><h3>compile-time-resources</h3><div class="usage"></div><div class="doc"><div class="markdown"><p>The resources which were visible at compile time. If we are running from a JAR file, it is highly likely that these are all the resources available at run time.</p>
</div></div><div class="src-link"><a href="https://github.com/simon-brooke/mw-ui/blob/master/src/mw_ui/util.clj#L39">view source</a></div></div><div class="public anchor" id="var-list-resources"><h3>list-resources</h3><div class="usage"><code>(list-resources directory pattern)</code></div><div class="doc"><div class="markdown"><p>List resource files matching <code>pattern</code> in <code>directory</code>.</p>
</div></div><div class="src-link"><a href="https://github.com/simon-brooke/mw-ui/blob/master/src/mw_ui/util.clj#L74">view source</a></div></div><div class="public anchor" id="var-md-.3Ehtml"><h3>md-&gt;html</h3><div class="usage"><code>(md-&gt;html filename)</code></div><div class="doc"><div class="markdown"><p>reads a markdown file from public/md and returns an HTML string</p>
</div></div><div class="src-link"><a href="https://github.com/simon-brooke/mw-ui/blob/master/src/mw_ui/util.clj#L52">view source</a></div></div><div class="public anchor" id="var-running-from-filesystem"><h3>running-from-filesystem</h3><div class="usage"></div><div class="doc"><div class="markdown"><p>We assume were running from the filesystem unless we find were not.</p>
</div></div><div class="src-link"><a href="https://github.com/simon-brooke/mw-ui/blob/master/src/mw_ui/util.clj#L34">view source</a></div></div></div></body></html>

File diff suppressed because one or more lines are too long

View file

@ -1,57 +1,45 @@
(defproject mw-ui "0.2.0-SNAPSHOT"
:cloverage {:output "docs/cloverage"}
:codox {:metadata {:doc "**TODO**: write docs"
:doc/format :markdown}
:output-path "docs/codox"
:source-uri "https://github.com/simon-brooke/mw-ui/blob/master/{filepath}#L{line}"}
:dependencies [[org.clojure/clojure "1.11.1"]
[clj-time "0.15.2"] ;; this is a hack. Something in libnoir requires
;; JodaTime, but doesn't request it. clj-time does.
[mw-engine "0.2.0-SNAPSHOT"]
[mw-parser "0.2.0-SNAPSHOT"]
[lib-noir "0.9.9"]
[ring-server "0.5.0"]
[selmer "1.12.59"]
[hiccup "1.0.5"]
[com.taoensso/timbre "6.2.1"]
[com.taoensso/tower "3.0.2"]
[markdown-clj "1.11.4"]
[environ "1.2.0"]
[noir-exception "0.2.5"]]
(defproject mw-ui "0.1.5-SNAPSHOT"
:description "Web-based user interface for MicroWorld"
:docker {:image-name "simonbrooke/microworld"
:dockerfile "Dockerfile"}
:main mw-ui.repl
:manifest {"build-signature-version" "0.1.6-SNAPSHOT"
"build-signature-user" "Simon Brooke"
:url "http://www.journeyman.cc/microworld"
:manifest {
"build-signature-version" "unset"
"build-signature-user" "unset"
"build-signature-email" "unset"
"build-signature-timestamp" "2021-05-17 13:31:22+01:00"
"Implementation-Version" "0.1.6-SNAPSHOT built by Simon Brooke on 2021-05-17 13:31:22+01:00"}
:min-lein-version "2.0.0"
"build-signature-timestamp" "unset"
"Implementation-Version" "unset"
}
:dependencies [[org.clojure/clojure "1.6.0"]
[mw-engine "0.1.5-SNAPSHOT"]
[mw-parser "0.1.5-SNAPSHOT"]
[lib-noir "0.8.4"]
[ring-server "0.3.1"]
[selmer "0.6.8"]
[com.taoensso/timbre "3.2.1"]
[com.taoensso/tower "2.0.2"]
[markdown-clj "0.9.44"]
[environ "0.5.0"]
[noir-exception "0.2.2"]]
:plugins [[lein-ring "0.12.6"]
[lein-cloverage "1.2.2"]
[lein-codox "0.10.8"]
[lein-environ "1.2.0"]
[lein-marginalia "0.9.1"]
[gorillalabs/lein-docker "1.6.0"]]
:repl-options {:init-ns mw-ui.repl}
:plugins [[lein-ring "0.8.11"]
[lein-environ "0.5.0"]
[lein-marginalia "0.7.1"]]
:ring {:handler mw-ui.handler/app
:init mw-ui.handler/init
:destroy mw-ui.handler/destroy
:resources-path "resources"
:war-resources-path "war-resources"
:uberwar-name "microworld.war"
}
:profiles
{:uberjar {:aot :all}
:production {:ring {:open-browser? false
:stacktraces? false
:auto-reload? false}}
:dev {:dependencies [[ring-mock "0.1.5"]
[ring/ring-devel "1.10.0"]
[pjstadig/humane-test-output "0.11.0"]]
[ring/ring-devel "1.3.0"]
[pjstadig/humane-test-output "0.6.0"]]
:injections [(require 'pjstadig.humane-test-output)
(pjstadig.humane-test-output/activate!)]
:env {:dev true}}}
:repl-options {:init-ns mw-ui.repl}
:ring {:handler mw-ui.handler/app
:init mw-ui.handler/init
:destroy mw-ui.handler/destroy
:resources-path "resources"
:war-resources-path "war-resources"
:uberwar-name "microworld.war"}
:url "http://www.journeyman.cc/microworld")
:min-lein-version "2.0.0")

View file

@ -1 +0,0 @@
../../../../mw-engine/docs

View file

@ -1 +0,0 @@
../../../../mw-parser/docs

View file

@ -1 +0,0 @@
../../../../mw-ui/docs

Binary file not shown.

Before

Width:  |  Height:  |  Size: 31 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 4.1 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 27 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 719 B

View file

@ -1,4 +0,0 @@
;; 'run once' ruleset to be run after (e.g.) settlement to establish harbours
;; Doesn't work yet, need to find out why and fix it!
if state is water and more than four neighbours are not water and some neighbours are house then state should be harbour

View file

@ -45,9 +45,7 @@
{% endif %}
{% if error %}
<div id="error">
<pre class="error">
{{error}}
</pre>
<p class="error">{{error}}</p>
</div>
{% endif %}
@ -59,8 +57,7 @@
Built with <a href="http://www.luminusweb.net/">LuminusWeb</a> ||
<img height="16" width="16" align="top" src="img/clojure-icon.gif" alt="&lambda;"> Powered by <a href="http://clojure.org">Clojure</a> ||
Engineering and hosting by <a href="http://www.journeyman.cc">Journeyman</a> ||
World generated using <a href="http://git.journeyman.cc/?p=mw-engine;a=summary">MicroWorld Engine</a> ||
Version {{version}}
World generated using <a href="http://git.journeyman.cc/?p=mw-engine;a=summary">MicroWorld Engine</a>
</div>
</div>
</body>

View file

@ -1,6 +1,4 @@
(ns ^{:doc "Set up and tear down the request handler."
:author "Simon Brooke"}
mw-ui.handler
(ns mw-ui.handler
(:require [compojure.core :refer [defroutes]]
[mw-ui.routes.home :refer [home-routes]]
[mw-ui.middleware :refer [load-middleware]]
@ -8,61 +6,35 @@
[noir.util.middleware :refer [app-handler]]
[compojure.route :as route]
[taoensso.timbre :as timbre]
;; [taoensso.timbre.appenders.rotor :as rotor]
[taoensso.timbre.appenders.rotor :as rotor]
[selmer.parser :as parser]
[environ.core :refer [env]]))
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
;;;;
;;;; mw-ui: a servlet user/visualisation interface for MicroWorld.
;;;;
;;;; This program is free software; you can redistribute it and/or
;;;; modify it under the terms of the GNU General Public License
;;;; as published by the Free Software Foundation; either version 2
;;;; of the License, or (at your option) any later version.
;;;;
;;;; This program is distributed in the hope that it will be useful,
;;;; but WITHOUT ANY WARRANTY; without even the implied warranty of
;;;; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
;;;; GNU General Public License for more details.
;;;;
;;;; You should have received a copy of the GNU General Public License
;;;; along with this program; if not, write to the Free Software
;;;; Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301,
;;;; USA.
;;;;
;;;; Copyright (C) 2014 Simon Brooke
;;;;
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
(defroutes app-routes
(route/resources "/")
(route/not-found "Not Found"))
(defn init
"init will be called once when
app is deployed as a servlet on
an app server such as Tomcat
put any initialization code here"
[]
;; TODO fix timbre config!
;; (timbre/set-config!
;; [:appenders :rotor]
;; {:min-level :info
;; :enabled? true
;; :async? false ; should be always false for rotor
;; :max-message-per-msecs nil
;; :fn rotor/appender-fn})
;; (timbre/set-config!
;; [:shared-appender-config :rotor]
;; {:path "mw_ui.log" :max-size (* 512 1024) :backlog 10})
(timbre/set-config!
[:appenders :rotor]
{:min-level :info
:enabled? true
:async? false ; should be always false for rotor
:max-message-per-msecs nil
:fn rotor/appender-fn})
(timbre/set-config!
[:shared-appender-config :rotor]
{:path "mw_ui.log" :max-size (* 512 1024) :backlog 10})
(when (env :dev) (parser/cache-off!))
(if (env :dev) (parser/cache-off!))
(timbre/info "mw-ui started successfully"))
(defn destroy
"destroy will be called when your application
shuts down, put any clean up code here"
@ -70,6 +42,7 @@
(timbre/info "mw-ui is shutting down..."))
(def app (app-handler
;; add your application routes here
[home-routes app-routes]

View file

@ -1,51 +1,24 @@
(ns ^{:doc "Layout content as HTML."
:author "Simon Brooke"}
mw-ui.layout
(ns mw-ui.layout
(:require [selmer.parser :as parser]
[clojure.string :as s]
[ring.util.response :refer [content-type response]]
[compojure.response :refer [Renderable]]))
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
;;;;
;;;; mw-ui: a servlet user/visualisation interface for MicroWorld.
;;;;
;;;; This program is free software; you can redistribute it and/or
;;;; modify it under the terms of the GNU General Public License
;;;; as published by the Free Software Foundation; either version 2
;;;; of the License, or (at your option) any later version.
;;;;
;;;; This program is distributed in the hope that it will be useful,
;;;; but WITHOUT ANY WARRANTY; without even the implied warranty of
;;;; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
;;;; GNU General Public License for more details.
;;;;
;;;; You should have received a copy of the GNU General Public License
;;;; along with this program; if not, write to the Free Software
;;;; Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301,
;;;; USA.
;;;;
;;;; Copyright (C) 2014 Simon Brooke
;;;;
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
(def template-path "templates/")
(deftype RenderableTemplate [template params]
Renderable
(render [_ request]
(render [this request]
(content-type
(->> (assoc (merge params {:version (System/getProperty "mw-ui.version")})
(->> (assoc params
(keyword (s/replace template #".html" "-selected")) "active"
:servlet-context
(when-let [context (:servlet-context request)]
(if-let [context (:servlet-context request)]
(.getContextPath context)))
(parser/render-file (str template-path template))
response)
"text/html; charset=utf-8")))
(defn render [template & [params]]
(RenderableTemplate. template params))

View file

@ -1,52 +1,24 @@
(ns ^{:doc "In truth, boilerplate from Luminus."
:author "Simon Brooke"}
mw-ui.middleware
(ns mw-ui.middleware
(:require [taoensso.timbre :as timbre]
[selmer.parser :as parser]
[environ.core :refer [env]]
[selmer.middleware :refer [wrap-error-page]]
[noir-exception.core
:refer [wrap-internal-error wrap-exceptions]]))
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
;;;;
;;;; mw-ui: a servlet user/visualisation interface for MicroWorld.
;;;;
;;;; This program is free software; you can redistribute it and/or
;;;; modify it under the terms of the GNU General Public License
;;;; as published by the Free Software Foundation; either version 2
;;;; of the License, or (at your option) any later version.
;;;;
;;;; This program is distributed in the hope that it will be useful,
;;;; but WITHOUT ANY WARRANTY; without even the implied warranty of
;;;; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
;;;; GNU General Public License for more details.
;;;;
;;;; You should have received a copy of the GNU General Public License
;;;; along with this program; if not, write to the Free Software
;;;; Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301,
;;;; USA.
;;;;
;;;; Copyright (C) 2014 Simon Brooke
;;;;
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
:refer [wrap-internal-error wrap-exceptions]]))
(defn log-request [handler]
(fn [req]
(timbre/debug req)
(handler req)))
(def development-middleware
[log-request
wrap-error-page
wrap-exceptions])
(def production-middleware
[#(wrap-internal-error % :log (fn [e] (timbre/error e)))])
(defn load-middleware []
(concat (when (env :dev) development-middleware)
production-middleware))

View file

@ -1,54 +1,28 @@
(ns ^{:doc "Render the state of the world as an HTML table."
:author "Simon Brooke"}
mw-ui.render-world
(:require [mw-engine.core :as engine]
(ns mw-ui.render-world
(:require [clojure.java.io :as jio]
[mw-engine.core :as engine]
[mw-engine.world :as world]
[mw-engine.heightmap :as heightmap]
[mw-parser.bulk :as compiler]
[hiccup.core :refer [html]]
[noir.io :as io]
[noir.session :as session]))
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
;;;;
;;;; mw-ui: a servlet user/visualisation interface for MicroWorld.
;;;;
;;;; This program is free software; you can redistribute it and/or
;;;; modify it under the terms of the GNU General Public License
;;;; as published by the Free Software Foundation; either version 2
;;;; of the License, or (at your option) any later version.
;;;;
;;;; This program is distributed in the hope that it will be useful,
;;;; but WITHOUT ANY WARRANTY; without even the implied warranty of
;;;; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
;;;; GNU General Public License for more details.
;;;;
;;;; You should have received a copy of the GNU General Public License
;;;; along with this program; if not, write to the Free Software
;;;; Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301,
;;;; USA.
;;;;
;;;; Copyright (C) 2014 Simon Brooke
;;;;
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
(defn format-css-class
(defn format-css-class [statekey]
"Format this statekey, assumed to be a keyword indicating a state in the
world, into a CSS class"
[statekey]
(subs (str statekey) 1))
(defn format-image-path
"Render this statekey, assumed to be a keyword indicating a state in the
world, into a path which should recover the corresponding image file."
[statekey]
(format "img/tiles/%s.png" (format-css-class statekey)))
(defn format-mouseover [cell]
(str cell))
(defn render-cell
"Render this world cell as a Hiccup table cell."
[cell]
@ -57,13 +31,11 @@
[:a {:href (format "inspect?x=%d&y=%d" (:x cell) (:y cell))}
[:img {:alt (:state cell) :src (format-image-path state)}]]]))
(defn render-world-row
"Render this world row as a Hiccup table row."
[row]
(apply vector (cons :tr (map render-cell row))))
(defn render-world-table
"Render the world implied by the current session as a complete HTML table in a DIV."
[]
@ -87,11 +59,9 @@
[:p
(str "Generation " generation)]]))
(defn render-inspector
"Render in Hiccup format the HTML content of an inspector on this cell."
([cell _] (render-inspector cell))
([cell]
[cell table]
[:table {:class "music-ruled"}
[:tr
[:td {:colspan 2 :style "text-align: center;"}
@ -99,6 +69,6 @@
:width 64
:height 64}]]]
[:tr [:th "Key"][:th "Value"]]
(map #(vector :tr (vector :th %)(vector :td (cell %))) (keys cell))]))
(map #(vector :tr (vector :th %)(vector :td (cell %))) (keys cell))])

View file

@ -1,35 +1,9 @@
(ns ^{:doc "In truth, boilerplate from Luminus."
:author "Simon Brooke"}
mw-ui.repl
(:require [mw-ui.handler :as handler]
[ring.server.standalone :refer [serve]]
[ring.middleware.file :refer [wrap-file]]
[ring.middleware.file-info :refer [wrap-file-info]])
(:gen-class))
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
;;;;
;;;; mw-ui: a servlet user/visualisation interface for MicroWorld.
;;;;
;;;; This program is free software; you can redistribute it and/or
;;;; modify it under the terms of the GNU General Public License
;;;; as published by the Free Software Foundation; either version 2
;;;; of the License, or (at your option) any later version.
;;;;
;;;; This program is distributed in the hope that it will be useful,
;;;; but WITHOUT ANY WARRANTY; without even the implied warranty of
;;;; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
;;;; GNU General Public License for more details.
;;;;
;;;; You should have received a copy of the GNU General Public License
;;;; along with this program; if not, write to the Free Software
;;;; Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301,
;;;; USA.
;;;;
;;;; Copyright (C) 2014 Simon Brooke
;;;;
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
(ns mw-ui.repl
(:use mw-ui.handler
ring.server.standalone
[ring.middleware file-info file])
(:gen-class)
)
(defonce server (atom nil))
@ -38,7 +12,7 @@
;; the server is forced to re-resolve the symbol in the var
;; rather than having its own copy. When the root binding
;; changes, the server picks it up without having to restart.
(-> #'handler/app
(-> #'app
; Makes static assets in $PROJECT_DIR/resources/public/ available.
(wrap-file "resources")
; Content-Type, Content-Length, and Last Modified headers for files in body
@ -51,9 +25,9 @@
(reset! server
(serve (get-handler)
{:port port
:init handler/init
:init init
:auto-reload? true
:destroy handler/destroy
:destroy destroy
:join? false}))
(println (str "You can view the site at http://localhost:" port))))
@ -63,4 +37,3 @@
(defn -main []
(start-server))

View file

@ -1,9 +1,7 @@
(ns ^{:doc "Routes which serve the main pages of the application."
:author "Simon Brooke"}
mw-ui.routes.home
(:require [clojure.java.io :refer [file]]
[clojure.walk :refer [keywordize-keys]]
[compojure.core :refer [defroutes GET POST]]
(ns mw-ui.routes.home
(:use clojure.walk
compojure.core)
(:require [clojure.pprint :only [pprint]]
[hiccup.core :refer [html]]
[mw-engine.utils :as engine-utils]
[mw-ui.layout :as layout]
@ -13,66 +11,38 @@
[mw-ui.routes.params :as params]
[mw-ui.routes.save :as save]
[mw-ui.util :as util]
[noir.io :as io]
[noir.session :as session]
[ring.util.response :as response]))
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
;;;;
;;;; mw-ui: a servlet user/visualisation interface for MicroWorld.
;;;;
;;;; This program is free software; you can redistribute it and/or
;;;; modify it under the terms of the GNU General Public License
;;;; as published by the Free Software Foundation; either version 2
;;;; of the License, or (at your option) any later version.
;;;;
;;;; This program is distributed in the hope that it will be useful,
;;;; but WITHOUT ANY WARRANTY; without even the implied warranty of
;;;; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
;;;; GNU General Public License for more details.
;;;;
;;;; You should have received a copy of the GNU General Public License
;;;; along with this program; if not, write to the Free Software
;;;; Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301,
;;;; USA.
;;;;
;;;; Copyright (C) 2014 Simon Brooke
;;;;
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
(defn list-states []
(sort
(filter #(not (nil? %))
(map #(first (rest (re-matches #"([0-9a-z-]+).png" (.getName %))))
;; TODO: this will not work when running from jar; see utils.clj
(file-seq (file "resources/public/img/tiles"))))))
(file-seq (clojure.java.io/file "resources/public/img/tiles"))))))
(defn about-page []
(layout/render "trusted-content.html"
{:title "About MicroWorld"
:about-selected "active"
:content (util/md->html "/md/about.md")
:version (System/getProperty "mw-ui.version")}))
:content (util/md->html "/md/about.md")}))
(defn docs-page []
(layout/render "docs.html" {:title "Documentation"
:parser (util/md->html "/md/mw-parser.md" )
:states (util/list-resources "/img/tiles" #"([0-9a-z-_]+).png")
:lessons (util/list-resources "/md/lesson-plans" #"([0-9a-z-_]+).md")
:components ["mw-engine" "mw-parser" "mw-ui"]
:version (System/getProperty "mw-ui.version")}))
:components ["mw-engine" "mw-parser" "mw-ui"]}))
(defn home-page
(defn home-page []
"Render the home page."
[]
(layout/render "trusted-content.html" {:title "Welcome to MicroWorld"
:content (util/md->html "/md/mw-ui.md")
:version (System/getProperty "mw-ui.version")}))
:content (util/md->html "/md/mw-ui.md")}))
(defn inspect-page
(defn inspect-page [request]
"Open an inspector on the cell at the co-ordinates specified in this request"
[request]
(let [params (keywordize-keys (:params request))
xs (:x params)
ys (:y params)
@ -88,7 +58,7 @@
true
(layout/render "inspector.html"
{:title (format "Inspect cell at %d, %d" x y)
:content (html (world/render-inspector cell))
:content (html (world/render-inspector cell world))
:cell cell
:x (:x cell)
:y (:y cell)

View file

@ -1,43 +1,21 @@
(ns ^{:doc "Route which handles the upload of worlds/rules from the client."
:author "Simon Brooke"}
mw-ui.routes.load
(:require [clojure.walk :refer [keywordize-keys]]
(ns mw-ui.routes.load
(:use clojure.walk
compojure.core)
(:require [hiccup.core :refer [html]]
[noir.io :as io]
[noir.session :as session]
[mw-ui.layout :as layout]))
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
;;;;
;;;; mw-ui: a servlet user/visualisation interface for MicroWorld.
;;;;
;;;; This program is free software; you can redistribute it and/or
;;;; modify it under the terms of the GNU General Public License
;;;; as published by the Free Software Foundation; either version 2
;;;; of the License, or (at your option) any later version.
;;;;
;;;; This program is distributed in the hope that it will be useful,
;;;; but WITHOUT ANY WARRANTY; without even the implied warranty of
;;;; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
;;;; GNU General Public License for more details.
;;;;
;;;; You should have received a copy of the GNU General Public License
;;;; along with this program; if not, write to the Free Software
;;;; Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301,
;;;; USA.
;;;;
;;;; Copyright (C) 2014 Simon Brooke
;;;;
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
[ring.util.response :as response]
[mw-ui.layout :as layout]
))
(defn- upload [file]
(io/upload-file "/tmp/" file)
(cond
(session/put! :world
(with-open [_ (java.io.FileReader. (:tempfile file))] (read)))
(with-open [eddi (java.io.FileReader. (:tempfile file))] (read)))
(str "Successfully loaded your world from " (:filename file))))
(defn load-page
"If no args, show the load form; with args, load a world file from the client.
@ -48,7 +26,8 @@
([]
(load-page nil))
([request]
(let [file (:file request)]
(let [params (keywordize-keys (:params request))
file (:file request)]
(try
(layout/render "load.html"
{:title "Load World"

View file

@ -1,47 +1,24 @@
(ns ^{:doc "Route which serves and handles the parameters page."
:author "Simon Brooke"}
mw-ui.routes.params
(:require [clojure.walk :refer [keywordize-keys]]
(ns mw-ui.routes.params
(:use clojure.walk
clojure.java.io
compojure.core)
(:require [hiccup.core :refer [html]]
[mw-engine.heightmap :as heightmap]
[mw-parser.bulk :as compiler]
[mw-ui.layout :as layout]
[mw-ui.util :as util]
[mw-ui.render-world :as world]
[noir.io :as io]
[noir.session :as session]))
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
;;;;
;;;; mw-ui: a servlet user/visualisation interface for MicroWorld.
;;;;
;;;; This program is free software; you can redistribute it and/or
;;;; modify it under the terms of the GNU General Public License
;;;; as published by the Free Software Foundation; either version 2
;;;; of the License, or (at your option) any later version.
;;;;
;;;; This program is distributed in the hope that it will be useful,
;;;; but WITHOUT ANY WARRANTY; without even the implied warranty of
;;;; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
;;;; GNU General Public License for more details.
;;;;
;;;; You should have received a copy of the GNU General Public License
;;;; along with this program; if not, write to the Free Software
;;;; Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301,
;;;; USA.
;;;;
;;;; Copyright (C) 2014 Simon Brooke
;;;;
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
(defn- send-params []
{:title "Choose your world"
:heightmaps (util/list-resources "/img/heightmaps" #"/?([0-9a-z-_]+).png")
:heightmaps (util/list-resources "/img/heightmaps" #"([0-9a-z-_]+).png")
:pause (or (session/get :pause) 5)
:rulesets (util/list-resources "/rulesets" #"/?([0-9a-z-_]+).txt")
:rulesets (util/list-resources "/rulesets" #"([0-9a-z-_]+).txt")
})
(defn params-page
(defn params-page
"Handler for params request. If no `request` passed, show empty params form.
If `request` is passed, put parameters from request into session and show
the world page."
@ -54,25 +31,25 @@
pause (:pause params)
rulefile (:ruleset params)
rulepath (str "/rulesets/" rulefile ".txt")]
(when (not= map "")
(session/put! :world
(heightmap/apply-heightmap
(if (not= map "")
(session/put! :world
(heightmap/apply-heightmap
(io/get-resource (str "/img/heightmaps/" map ".png")))))
(when (not= rulefile "")
(session/put! :rule-text (io/slurp-resource rulepath))
(session/put! :rules (compiler/compile-file (io/get-resource rulepath))))
(when (not= pause "")
(if (not= pause "")
(session/put! :pause pause))
(layout/render "params.html"
(merge (send-params)
(layout/render "params.html"
(merge (send-params)
{:r rulefile
:h map
:message "Your parameters are saved, now look at your world"})))
(catch Exception e
(let [params (keywordize-keys (:form-params request))]
(layout/render "params.html"
(layout/render "params.html"
(merge (send-params)
{:title "Choose your world"
{:title "Choose your world"
:r (:ruleset params)
:h (:heightmap params)
:message "Your paramters are not saved"

View file

@ -1,72 +1,50 @@
(ns ^{:doc "Route which serves and handles the rules page."
:author "Simon Brooke"}
mw-ui.routes.rules
(:require [clojure.walk :refer [keywordize-keys]]
(ns mw-ui.routes.rules
(:use clojure.walk
compojure.core)
(:require [hiccup.core :refer [html]]
[mw-parser.bulk :as compiler]
[mw-ui.layout :as layout]
[mw-ui.util :as util]
[mw-ui.render-world :as world]
[noir.io :as io]
[noir.session :as session]))
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
;;;;
;;;; mw-ui: a servlet user/visualisation interface for MicroWorld.
;;;;
;;;; This program is free software; you can redistribute it and/or
;;;; modify it under the terms of the GNU General Public License
;;;; as published by the Free Software Foundation; either version 2
;;;; of the License, or (at your option) any later version.
;;;;
;;;; This program is distributed in the hope that it will be useful,
;;;; but WITHOUT ANY WARRANTY; without even the implied warranty of
;;;; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
;;;; GNU General Public License for more details.
;;;;
;;;; You should have received a copy of the GNU General Public License
;;;; along with this program; if not, write to the Free Software
;;;; Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301,
;;;; USA.
;;;;
;;;; Copyright (C) 2014 Simon Brooke
;;;;
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
[noir.session :as session]
[ring.util.response :as response]))
(defn process-rules-request
[request]
(let [src (:src (keywordize-keys (:form-params request)))]
(try
(cond src
(try
(cond src
(let [rules (compiler/compile-string src)]
{:rule-text src
:rules rules
:message (str "Successfully compiled "
(count rules)
:message (str "Successfully compiled "
(count rules)
" rules") })
:else {:rule-text (or
(session/get :rule-text)
true {:rule-text (or
(session/get :rule-text)
(io/slurp-resource "/rulesets/basic.txt"))
:message "No rules found in request; loading defaults"})
(catch Exception e
(catch Exception e
{:rule-text src
:message "An error occurred during compilation"
:error (str (.getName (.getClass e)) ": " (.getMessage e))}))))
(defn rules-page
(defn rules-page
"Request handler for the `rules` request. If the `request` contains a value
for `:src`, treat that as rule source and try to compile it. If compilation
succeeds, stash the compiled rules and the rule text on the session, and
provide feedback; if not, provide feedback.
for `:src`, treat that as rule source and try to compile it. If compilation
succeeds, stash the compiled rules and the rule text on the session, and
provide feedback; if not, provide feedback.
If `request` doesn't contain a value for `:src`, load basic rule source from
the session or from `resources/rulesets/basic.txt` and pass that back."
([request]
(let [processed (process-rules-request request)]
(when (:rules processed)
(if (:rules processed)
(session/put! :rules (:rules processed)))
(when (:rule-text processed)
(if (:rule-text processed)
(session/put! :rule-text (:rule-text processed)))
(layout/render "rules.html"
(layout/render "rules.html"
(merge {:title "Edit Rules"} processed))))
([]
(rules-page nil)))

View file

@ -1,41 +1,15 @@
(ns ^{:doc "Route which handles the saving of world state the client."
:author "Simon Brooke"}
mw-ui.routes.save
(:require [clojure.pprint :refer [pprint]]
(ns mw-ui.routes.save
(:require [clojure.pprint :as pretty :only [pprint]]
[noir.session :as session]
[noir.response :as response]))
[ring.util.response :as response]))
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
;;;;
;;;; mw-ui: a servlet user/visualisation interface for MicroWorld.
;;;;
;;;; This program is free software; you can redistribute it and/or
;;;; modify it under the terms of the GNU General Public License
;;;; as published by the Free Software Foundation; either version 2
;;;; of the License, or (at your option) any later version.
;;;;
;;;; This program is distributed in the hope that it will be useful,
;;;; but WITHOUT ANY WARRANTY; without even the implied warranty of
;;;; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
;;;; GNU General Public License for more details.
;;;;
;;;; You should have received a copy of the GNU General Public License
;;;; along with this program; if not, write to the Free Software
;;;; Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301,
;;;; USA.
;;;;
;;;; Copyright (C) 2014 Simon Brooke
;;;;
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
(defn save-page
(defn save-page []
"Save the current world to the browser, using our own custom mime-type in
an attempt to prevent the browser trying to do anything clever with it.
Note that it is saved as a raw Clojure data structure, not as XML or
any proprietary format."
[]
(response/content-type
"application/journeyman-mwm; charset=utf-8"
(with-out-str (pprint (session/get :world)))))
(response/header
(response/response
(with-out-str (pretty/pprint (session/get :world))))
"Content-Type" "application/journeyman-mwm; charset=utf-8"))

View file

@ -1,91 +1,21 @@
(ns ^{:doc "Utility functions used by other namespaces in this package."
:author "Simon Brooke"}
mw-ui.util
(:require [clojure.java.io :refer [file]]
[clojure.string :refer [starts-with?]]
[markdown.core :as md]
[noir.io :as io]
(ns mw-ui.util
(:require [noir.io :as io]
[noir.session :as session]
[taoensso.timbre :as timbre]))
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
;;;;
;;;; mw-ui: a servlet user/visualisation interface for MicroWorld.
;;;;
;;;; This program is free software; you can redistribute it and/or
;;;; modify it under the terms of the GNU General Public License
;;;; as published by the Free Software Foundation; either version 2
;;;; of the License, or (at your option) any later version.
;;;;
;;;; This program is distributed in the hope that it will be useful,
;;;; but WITHOUT ANY WARRANTY; without even the implied warranty of
;;;; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
;;;; GNU General Public License for more details.
;;;;
;;;; You should have received a copy of the GNU General Public License
;;;; along with this program; if not, write to the Free Software
;;;; Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301,
;;;; USA.
;;;;
;;;; Copyright (C) 2014 Simon Brooke
;;;;
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
(def running-from-filesystem
"We assume we're running from the filesystem unless we find we're not."
(atom true))
(def compile-time-resources
"The resources which were visible at compile time. If we are running from
a JAR file, it is highly likely that these are all the resources available
at run time."
(let [f (file "resources/public")
n (count (.getCanonicalPath f))]
(remove nil?
(map #(let [s (.getCanonicalPath %)]
(when (> (count s) n)
(subs s n)))
(file-seq f)))))
[markdown.core :as md]))
(defn md->html
"reads a markdown file from public/md and returns an HTML string"
[filename]
(->>
(io/slurp-resource filename)
(md/md-to-html-string)))
(io/slurp-resource filename)
(md/md-to-html-string)))
(defn cache-seq-match
"Do the same processing that list-resources does on names fetched from
the file system, except on the resource list cached at compile time."
[path pattern]
(timbre/info compile-time-resources)
(let [n (count path)]
(remove nil?
(map #(when (> (count %) n)
(let [name (subs % n)]
(last (re-matches pattern name))))
(filter #(starts-with? % path)
compile-time-resources)))))
(defn list-resources
(defn list-resources [directory pattern]
"List resource files matching `pattern` in `directory`."
[directory pattern]
(let
[path (str (io/resource-path) directory)]
(let
[path (str (io/resource-path) directory)]
(session/put! :list-resources-path path)
(try
(sort
(remove nil?
(if @running-from-filesystem
(map #(first (rest (re-matches pattern (.getName %))))
(file-seq (file path)))
(cache-seq-match directory pattern))))
(catch Exception any
(timbre/log (str "Not running from filesystem?"
(.getName (.getClass any))))
(reset! running-from-filesystem false)
(cache-seq-match directory pattern)))))
(sort
(remove nil?
(map #(first (rest (re-matches pattern (.getName %))))
(file-seq (clojure.java.io/file path)))))))