Skip to content

Commit 0d8c269

Browse files
committed
Tidy for Edify.
See #175.
1 parent e471b77 commit 0d8c269

10 files changed

+1735
-23
lines changed

Diff for: Cakefile

-23
This file was deleted.

Diff for: css/reactor.less

+135
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,135 @@
1+
@import "response";
2+
3+
@colorish: #6495ed;
4+
@logo-text: #000000;
5+
@body-text: lighten(#000000, 10%);
6+
@welcome-font: "ABeeZee";
7+
@heading-font: "Inconsolata";
8+
@body-font: "Karla";
9+
@code-font: "Oxygen Mono";
10+
11+
html {
12+
background: darken(#ffffff, 3%);
13+
font-size: 100%;
14+
color: @body-text;
15+
}
16+
17+
body {
18+
font-family: Helvetica;
19+
margin: 0 auto;
20+
padding: 0 0;
21+
}
22+
23+
img {
24+
max-width: 100%;
25+
}
26+
27+
.container {
28+
/* Whatever you want. They’re your oats. */
29+
max-width: 60em;
30+
margin: 0 auto;
31+
padding: 0 0;
32+
}
33+
34+
.unit.welcome {
35+
.span-grid;
36+
h1 {
37+
font-family: @welcome-font, "Georgia", sans-serif;
38+
/*font-size: 48pt;*/
39+
font-weight: normal;
40+
font-size: 72pt;
41+
margin-top: 0.5em;
42+
margin-bottom: 0.25em;
43+
}
44+
}
45+
46+
.unit {
47+
padding: 0 36px;
48+
}
49+
50+
.unit.value-proposition {
51+
.span-grid;
52+
p {
53+
margin: 1em 0;
54+
}
55+
}
56+
57+
.unit.description {
58+
font-family: @body-font, "Raleway", "Merriweather", "Maven Pro", "Helvetica", serif;
59+
p {
60+
font-size: 1.45em;
61+
margin: 1em 0;
62+
/* todo: not working in chrome */
63+
font-weight: 100;
64+
strong {
65+
font-weight: 700;
66+
}
67+
}
68+
ul {
69+
font-size: 1.45em;
70+
margin: 1em 0;
71+
padding-left: 2em;
72+
}
73+
h2 {
74+
font-family: @heading-font;
75+
font-weight: normal;
76+
font-size: 2em;
77+
font-style: italic;
78+
margin: 1em 0;
79+
}
80+
h3 {
81+
font-family: @heading-font;
82+
font-weight: normal;
83+
font-size: 1.5em;
84+
}
85+
a {
86+
color: #4682b4;
87+
}
88+
a:visited {
89+
color: #9370db;
90+
}
91+
p code {
92+
font-family: @code-font;
93+
font-size: 0.85em;
94+
background: white;
95+
padding: 0 0.25em;
96+
border: 1px dotted #ccc;
97+
}
98+
}
99+
100+
.unit.benefit {
101+
padding: 1em;
102+
.one-of-three;
103+
h2 {
104+
text-align: center;
105+
font-size: 1em;
106+
margin-bottom: 1em;
107+
}
108+
}
109+
110+
.unit.verbiage {
111+
.span-grid;
112+
h2 {
113+
font-size: 1em;
114+
margin-bottom: 1em;
115+
}
116+
p {
117+
margin-bottom: 1em;
118+
}
119+
}
120+
121+
.unit.description {
122+
.span-grid;
123+
.highlight > pre {
124+
margin: 2em 0;
125+
padding: 1em;
126+
font-size: 1.15em;
127+
font-family: @code-font, 'Monaco', 'Cutive Mono', 'Oxygen Mono', monospace;
128+
}
129+
}
130+
131+
.unit.sidebar {
132+
.one-of-four;
133+
}
134+
135+
/* vim: set ts=4 sw=4: */

Diff for: css/response.less

+45
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,45 @@
1+
/*-----------------------------------*\
2+
$GRID
3+
\*-----------------------------------*/
4+
* {
5+
margin: 0;
6+
padding: 0;
7+
position: relative;
8+
-webkit-box-sizing: border-box; /* border-box is new to me, AG */
9+
-moz-box-sizing: border-box; /* https://pinboard.in/u:alan/t:border/t:box */
10+
box-sizing: border-box;
11+
}
12+
13+
.container {
14+
}
15+
16+
.grid {
17+
max-width: 100%;
18+
}
19+
20+
.unit {
21+
display: inline-block;
22+
*display: inline;
23+
*zoom: 1;
24+
vertical-align: top;
25+
/* Clearfix */
26+
overflow: hidden;
27+
*overflow: visible;
28+
}
29+
30+
.span-grid { width: 100%; }
31+
32+
.one-of-two { width: 50%; }
33+
34+
.one-of-three { width: 33.333333333%; }
35+
.two-of-three { width: 66.666666666%; }
36+
37+
.one-of-four { width: 25%; }
38+
.three-of-four { width: 75%; }
39+
40+
.one-of-five { width: 20%; }
41+
.two-of-five { width: 40%; }
42+
.three-of-five { width: 60%; }
43+
.four-of-five { width: 80%; }
44+
45+
/* vim: set ts=4 sw=4: */

Diff for: dnd.js

+47
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,47 @@
1+
// http://www.html5rocks.com/en/tutorials/file/dndfiles/
2+
d3.select('svg')
3+
.on('dragover', handleDragOver)
4+
.on('drop', handleFileSelect)
5+
;
6+
7+
function handleFileSelect() {
8+
var event = d3.event
9+
, files = event.dataTransfer.files // FileList object
10+
, about = []
11+
, shape = null;
12+
event.stopPropagation();
13+
event.preventDefault();
14+
15+
for (var i = 0, file; file = files[i]; i++) {
16+
// f.name, f.size, f.type (doesn't grok "json"), f.lastModifiedDate
17+
readGeojson(file, draw);
18+
}
19+
}
20+
21+
function readGeojson(file, cb) {
22+
var reader = new FileReader;
23+
reader.onload = function(e) {
24+
cb(e.target.result, file);
25+
};
26+
reader.readAsText(file);
27+
}
28+
29+
function handleDragOver() {
30+
var ev = d3.event;
31+
ev.stopPropagation();
32+
ev.preventDefault();
33+
ev.dataTransfer.dropEffect = 'copy'; // Explicitly show this is a copy.
34+
}
35+
36+
function draw(content, file) {
37+
var json = JSON.parse(content)
38+
, what = json.features;
39+
feature.data(countries.features = countries.features.concat(what))
40+
.enter().append('svg:path')
41+
.attr('id', function(d) { return d.id; })
42+
.attr('d', clip)
43+
.append('svg:title')
44+
.text(function(d) { return d.properties.name; });
45+
feature = svg.selectAll('path');
46+
refresh();
47+
}

Diff for: pages/index.html

+129
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,129 @@
1+
<!DOCTYPE html>
2+
<html>
3+
<meta charset="utf-8">
4+
<title>Reactor</title>
5+
<link href="http://fonts.googleapis.com/css?family=ABeeZee|Inconsolata|Karla:400,700|Oxygen+Mono" rel="stylesheet" type="text/css">
6+
<link href="http://fonts.googleapis.com/css?family=Sorts+Mill+Goudy">
7+
<link rel="stylesheet" type="text/css" href="css/syntax.css">
8+
<link rel="stylesheet" type="text/css" href="css/reactor.css">
9+
<body><a href="https://github.com/bigeasy/reactor/"><img style="position: absolute; top: 0; left: 0; border: 0;" src="https://s3.amazonaws.com/github/ribbons/forkme_left_gray_6d6d6d.png" alt="Fork me on GitHub"></a><div class="container">
10+
11+
<div class="unit welcome">
12+
<h1>Reactor</h1>
13+
</div>
14+
15+
<div class="unit description markdown">
16+
Zero dependency routing for the browser and Node.js.
17+
18+
## Route Callbacks
19+
20+
When you declare a route, you provide a callback function that the reactor will
21+
invoke if the route matches. Route callbacks always receive parameters extracted
22+
from the path as their first argument.
23+
24+
## Route Patterns
25+
26+
Simple parameterized routes provide a parameter object as a first argument.
27+
28+
```javascript
29+
reactor.get("/photos/:user", function (params, req, res) {
30+
console.log(JSON.stringify(params));
31+
});
32+
reactor.react("GET", "/photos/alan", req, res);
33+
```
34+
35+
The above script will print `{ user: "alan" }` on the console.
36+
37+
Static routes still provide a parameter object for consistency, but it is always
38+
empty.
39+
40+
```javascript
41+
reactor.get("/hello", function (params, req, res) {
42+
console.log(JSON.stringify(params));
43+
});
44+
reactor.react("GET", "/hello", req, res);
45+
```
46+
47+
The above script will print `{}` to the console.
48+
49+
Parameterized routes can match one or more parts in a path. To match multiple
50+
parts use a double star before the parameter name.
51+
52+
```javascript
53+
reactor.get("/files/**:pathInfo", function (params, req, res) {
54+
console.log(JSON.stringify(params));
55+
});
56+
reactor.react("GET", "/files/cats/lol.jpg", req, res);
57+
```
58+
59+
The above script will print `{ pathInfo: "cats/lol.jpg" }` to the console.
60+
61+
## Change Log
62+
63+
Changes for each release.
64+
65+
### Version 0.0.7
66+
67+
Mon Jul 22 04:18:54 UTC 2013
68+
69+
* Fix bad match when file is smaller than suffix. #23.
70+
* Return definition in match. #24.
71+
72+
### Version 0.0.6
73+
74+
Sat Jul 20 01:42:36 UTC 2013
75+
76+
* Remove callbacks. Just a list of matches. #21.
77+
* Update source code style.
78+
* Upgrade to Proof 0.0.32.
79+
* Coverage with Istanbul and Coveralls. #18.
80+
81+
### Version 0.0.5
82+
83+
Thu Mar 21 23:41:09 UTC 2013
84+
85+
* Parameterize the `find.js` file suffix. #15.
86+
* Rename `routify.js` to `find.js`.
87+
* Move `routify.js` over from the Register project. #14.
88+
* Add a contribution guide and a license.
89+
* POSIX shell compatible test helpers.
90+
* Upgrade Proof to 0.0.27.
91+
92+
### Version 0.0.4
93+
94+
Sun Dec 9 17:56:25 UTC 2012
95+
96+
* Pass parameters to callback as first argument. #12.
97+
* Match sub-paths. #11.
98+
* Implement parameterized routes. #10.
99+
* Add `.js` suffix to test programs. #9.
100+
* Clean up AMD/CommonJS invocation switch. #8.
101+
102+
### Version 0.0.3
103+
104+
Mon Aug 13 01:55:31 UTC 2012
105+
106+
* Remove echo of method and url. #7.
107+
* Add `homepage` to `package.json`. #4.
108+
* Convert `t/sizes.t` to work on OS X. #6.
109+
* Case-insensitive request method match. #5.
110+
111+
### Version 0.0.2
112+
113+
Thu Jul 19 08:14:30 UTC 2012
114+
115+
* Build on Travis CI. #3.
116+
* Create basic router. #1.
117+
</div>
118+
119+
</div></body>
120+
<script>
121+
(function(i,s,o,g,r,a,m){i['GoogleAnalyticsObject']=r;i[r]=i[r]||function(){
122+
(i[r].q=i[r].q||[]).push(arguments)},i[r].l=1*new Date();a=s.createElement(o),
123+
m=s.getElementsByTagName(o)[0];a.async=1;a.src=g;m.parentNode.insertBefore(a,m)
124+
})(window,document,'script','//www.google-analytics.com/analytics.js','ga');
125+
126+
ga('create', 'UA-20388260-3', 'bigeasy.github.io');
127+
ga('send', 'pageview');
128+
</script>
129+
</html>

0 commit comments

Comments
 (0)