xonecas.io
818
Du

dustymarkdown / commit 96326de

initial commit, proof of idea

xonecas2011-04-28 96326de8b3d0b37da97b0791b6344c48f9d28d55

16 files changed

This diff is too big to show in full. The first 1000 lines are below, and every file is listed with its counts.

README+1−0
@@ -0,0 +1 @@
1+# Still a work in progress, documentation will come when nothing else is left to develop
build.js+148−0
@@ -0,0 +1,148 @@
1+
2+// compile markdown and create static files
3+
4+var fs = require('fs'),
5+ dust = require('dust'),
6+ markdown = require("node-markdown").Markdown;
7+
8+//debug
9+var ins = require('util').inspect;
10+function log (data) { console.log(ins(data)); };
11+
12+/*
13+var index = fs.readFileSync('./templates/index.dust', 'utf8');
14+var compiledIndex = dust.compile(index, 'index');
15+dust.loadSource(compiledIndex);
16+*/
17+
18+// get all my templates and compile them
19+function readTemplates (callback) {
20+ fs.readdir('./templates', function (err, templates) {
21+ if (err) throw err;
22+
23+ var len = templates.length, dir = "./templates/";
24+
25+ // asynchronous loop
26+ (function loop (i) {
27+ if (i < len) {
28+ var template = templates[i];
29+ if (/\.dust$/.test(template)) {
30+ fs.readFile(dir+template, 'utf8', function (err, file) {
31+ if (err) throw err;
32+
33+ template = template.replace('.dust', '');
34+ var compiled = dust.compile(file, template);
35+ dust.loadSource(compiled);
36+
37+ loop(i+1);
38+ });
39+ } else {
40+ loop(i+1);
41+ }
42+ }
43+ else {
44+ callback(templates);
45+ }
46+ }) (0);
47+ });
48+};
49+
50+// get all markdown files and parse them
51+function readMarkdown (callback) {
52+ fs.readdir('./markdown', function (err, files) {
53+ if (err) throw err;
54+
55+ var len = files.length, html = {};
56+
57+ (function reader (i) {
58+ if (i < len) {
59+ var filename = files[i];
60+ if (filename.match(/\.md$/)) {
61+ fs.readFile('./markdown/'+filename, 'utf8', function (err2, file) {
62+ if (err2) throw err2;
63+
64+ if (filename.match(/.+\_.+/)) {
65+ var split = filename.split('_'),
66+ section = split[0];
67+ filename = split[1];
68+
69+ html[section] = html[section] || [];
70+ html[section].push(markdown(file));
71+ } else {
72+ filename = filename.replace('.', '_');
73+ html[filename] = markdown(file);
74+ }
75+
76+ reader(i+1);
77+ });
78+ }
79+ else {
80+ reader(i+1);
81+ }
82+ }
83+ else
84+ callback(html);
85+ }) (0);
86+ });
87+};
88+
89+function writeFiles (tmpls, html) {
90+ var len = tmpls.length;
91+
92+ (function writer (i) {
93+ if (i < len) {
94+ var filename = tmpls[i].replace('.dust', '.html');
95+ dust.render(filename.replace('.html',''), html, function (err, htmlFile) {
96+ fs.writeFile('./htdocs/'+filename, htmlFile, function (err) {
97+ if (err) throw err;
98+
99+ console.log('+++ Wrote: '+filename);
100+ writer(i+1);
101+ });
102+ });
103+ }
104+ }) (0);
105+};
106+
107+readTemplates(function (tmpls) {
108+ readMarkdown(function (html) {
109+ writeFiles(tmpls, html);
110+ });
111+});
112+
113+/*
114+fs.readdir('./markdown', function (err, files) {
115+ if (err) throw err;
116+
117+ log(files);
118+
119+ var html = {}, len = files.length;
120+
121+ function writer (html) {
122+ log(html);
123+ dust.render("index", html, function (err, indexHtml) {
124+ log (indexHtml);
125+ fs.writeFile('./htdocs/index.html', indexHtml, function (err2) {
126+ console.log("+++ wrote index");
127+ });
128+ });
129+ }
130+
131+ (function reader (i) {
132+ var filename = files[i];
133+ if (i < len && filename.match(/\.md$/)) {
134+ fs.readFile('./markdown/'+filename, 'utf8', function (err2, file) {
135+ if (err2) throw err2;
136+ filename = filename.replace('.', '_');
137+ html[filename] = markdown(file);
138+ reader(i+1);
139+ });
140+ }
141+ else if (i < len)
142+ reader(i+1);
143+ else
144+ writer(html);
145+ }) (0);
146+});
147+*/
148+
htdocs/about.html+3−0
@@ -0,0 +1,3 @@
1+<!doctype html><!-- paulirish.com/2008/conditional-stylesheets-vs-css-hacks-answer-neither/ --><!--[if lt IE 7]> <html class="no-js ie6" lang="en"> <![endif]--><!--[if IE 7]> <html class="no-js ie7" lang="en"> <![endif]--><!--[if IE 8]> <html class="no-js ie8" lang="en"> <![endif]--><!--[if gt IE 8]><!--> <html class="no-js" lang="en"> <!--<![endif]--><head><meta charset="utf-8"><title></title><meta name="description" content=""><meta name="author" content=""><!-- Mobile viewport optimized …
2+
3+<p>Don't be alarmed, this is just a test :-)</p><!-- JavaScript at the bottom for fast page loading --><script src="js/libs/ender.js"></script><!-- scripts concatenated and minified via ant build script--><script src="js/script.js"></script><!-- end scripts--><!-- simple uniques and page requests tracker, see server.js --><script>Modernizr.localstorage || document.write('<script src="js/libs/storage.js">\x3C/script>')</script><script>var s = localStorage, key = s.getItem('key');if (key === null) …
htdocs/css/style.css+262−0
@@ -0,0 +1,262 @@
1+/**
2+ * HTML5 ✰ Boilerplate
3+ *
4+ * style.css contains a reset, font normalization and some base styles.
5+ *
6+ * Credit is left where credit is due.
7+ * Much inspiration was taken from these projects:
8+ * - yui.yahooapis.com/2.8.1/build/base/base.css
9+ * - camendesign.com/design/
10+ * - praegnanz.de/weblog/htmlcssjs-kickstart
11+ */
12+
13+
14+/**
15+ * html5doctor.com Reset Stylesheet (Eric Meyer's Reset Reloaded + HTML5 baseline)
16+ * v1.6.1 2010-09-17 | Authors: Eric Meyer & Richard Clark
17+ * html5doctor.com/html-5-reset-stylesheet/
18+ */
19+
20+html, body, div, span, object, iframe,
21+h1, h2, h3, h4, h5, h6, p, blockquote, pre,
22+abbr, address, cite, code, del, dfn, em, img, ins, kbd, q, samp,
23+small, strong, sub, sup, var, b, i, dl, dt, dd, ol, ul, li,
24+fieldset, form, label, legend,
25+table, caption, tbody, tfoot, thead, tr, th, td,
26+article, aside, canvas, details, figcaption, figure,
27+footer, header, hgroup, menu, nav, section, summary,
28+time, mark, audio, video {
29+ margin: 0;
30+ padding: 0;
31+ border: 0;
32+ font-size: 100%;
33+ font: inherit;
34+ vertical-align: baseline;
35+}
36+
37+article, aside, details, figcaption, figure,
38+footer, header, hgroup, menu, nav, section {
39+ display: block;
40+}
41+
42+blockquote, q { quotes: none; }
43+
44+blockquote:before, blockquote:after,
45+q:before, q:after { content: ""; content: none; }
46+
47+ins { background-color: #ff9; color: #000; text-decoration: none; }
48+
49+mark { background-color: #ff9; color: #000; font-style: italic; font-weight: bold; }
50+
51+del { text-decoration: line-through; }
52+
53+abbr[title], dfn[title] { border-bottom: 1px dotted; cursor: help; }
54+
55+table { border-collapse: collapse; border-spacing: 0; }
56+
57+hr { display: block; height: 1px; border: 0; border-top: 1px solid #ccc; margin: 1em 0; padding: 0; }
58+
59+input, select { vertical-align: middle; }
60+
61+
62+/**
63+ * Font normalization inspired by YUI Library's fonts.css: developer.yahoo.com/yui/
64+ */
65+
66+body { font:13px/1.231 sans-serif; *font-size:small; } /* Hack retained to preserve specificity */
67+select, input, textarea, button { font:99% sans-serif; }
68+
69+/* Normalize monospace sizing:
70+ en.wikipedia.org/wiki/MediaWiki_talk:Common.css/Archive_11#Teletype_style_fix_for_Chrome */
71+pre, code, kbd, samp { font-family: monospace, sans-serif; }
72+
73+
74+/**
75+ * Minimal base styles.
76+ */
77+
78+/* Always force a scrollbar in non-IE */
79+html { overflow-y: scroll; }
80+
81+/* j.mp/webkit-tap-highlight-color */
82+a:link { -webkit-tap-highlight-color: #FF5E99; }
83+
84+/* Accessible focus treatment: people.opera.com/patrickl/experiments/keyboard/test */
85+a:hover, a:active { outline: none; }
86+
87+a, a:active, a:visited { color: #607890; }
88+a:hover { color: #036; }
89+
90+ul, ol { margin-left: 2em; }
91+ol { list-style-type: decimal; }
92+
93+/* Remove margins for navigation lists */
94+nav ul, nav li { margin: 0; list-style:none; list-style-image: none; }
95+
96+small { font-size: 85%; }
97+strong, th { font-weight: bold; }
98+
99+td { vertical-align: top; }
100+
101+/* Set sub, sup without affecting line-height: gist.github.com/413930 */
102+sub, sup { font-size: 75%; line-height: 0; position: relative; }
103+sup { top: -0.5em; }
104+sub { bottom: -0.25em; }
105+
106+pre {
107+ /* www.pathf.com/blogs/2008/05/formatting-quoted-code-in-blog-posts-css21-white-space-pre-wrap/ */
108+ white-space: pre; white-space: pre-wrap; word-wrap: break-word;
109+ padding: 15px;
110+}
111+
112+.ie6 legend, .ie7 legend { margin-left: -7px; }
113+
114+/* Align checkboxes, radios, text inputs with their label by: Thierry Koblentz tjkdesign.com/ez-css/css/base.css */
115+input[type="radio"] { vertical-align: text-bottom; }
116+input[type="checkbox"] { vertical-align: bottom; }
117+.ie7 input[type="checkbox"] { vertical-align: baseline; }
118+.ie6 input { vertical-align: text-bottom; }
119+
120+/* Hand cursor on clickable input elements */
121+label, input[type="button"], input[type="submit"], input[type="image"], button { cursor: pointer; }
122+
123+/* 1) Make inputs and buttons play nice in IE: www.viget.com/inspire/styling-the-button-element-in-internet-explorer/
124+ 2) WebKit browsers add a 2px margin outside the chrome of form elements.
125+ Firefox adds a 1px margin above and below textareas */
126+button, input, select, textarea { width: auto; overflow: visible; margin: 0; }
127+
128+textarea { overflow: auto; } /* www.sitepoint.com/blogs/2010/08/20/ie-remove-textarea-scrollbars/ */
129+
130+/* Remove extra padding and inner border in Firefox */
131+input::-moz-focus-inner,
132+button::-moz-focus-inner { border: 0; padding: 0; }
133+
134+/* Colors for form validity */
135+input:valid, textarea:valid { }
136+input:invalid, textarea:invalid {
137+ border-radius: 1px; -moz-box-shadow: 0px 0px 5px red; -webkit-box-shadow: 0px 0px 5px red; box-shadow: 0px 0px 5px red;
138+}
139+.no-boxshadow input:invalid, .no-boxshadow textarea:invalid { background-color: #f0dddd; }
140+
141+/* These selection declarations have to be separate
142+ No text-shadow: twitter.com/miketaylr/status/12228805301
143+ Also: hot pink! */
144+::-moz-selection{ background: #FF5E99; color:#fff; text-shadow: none; }
145+::selection { background:#FF5E99; color:#fff; text-shadow: none; }
146+
147+/* Bicubic resizing for non-native sized IMG:
148+ code.flickr.com/blog/2008/11/12/on-ui-quality-the-little-things-client-side-image-resizing/ */
149+.ie7 img { -ms-interpolation-mode: bicubic; }
150+
151+
152+/**
153+ * You might tweak these..
154+ */
155+
156+body, select, input, textarea {
157+ /* #444 looks better than black: twitter.com/H_FJ/statuses/11800719859 */
158+ color: #444;
159+ /* Set your base font here, to apply evenly */
160+ /* font-family: Georgia, serif; */
161+}
162+
163+/* Headers (h1, h2, etc) have no default font-size or margin; define those yourself */
164+h1, h2, h3, h4, h5, h6 { font-weight: bold; }
165+
166+
167+/**
168+ * Primary styles
169+ *
170+ * Author:
171+ */
172+
173+
174+
175+
176+
177+
178+
179+
180+
181+
182+
183+
184+
185+
186+
187+
188+/**
189+ * Non-semantic helper classes: please define your styles before this section.
190+ */
191+
192+/* For image replacement */
193+.ir { display: block; text-indent: -999em; overflow: hidden; background-repeat: no-repeat; text-align: left; direction: ltr; }
194+
195+/* Hide for both screenreaders and browsers:
196+ css-discuss.incutio.com/wiki/Screenreader_Visibility */
197+.hidden { display: none; visibility: hidden; }
198+
199+/* Hide only visually, but have it available for screenreaders: by Jon Neal.
200+ www.webaim.org/techniques/css/invisiblecontent/ & j.mp/visuallyhidden */
201+.visuallyhidden { border: 0; clip: rect(0 0 0 0); height: 1px; margin: -1px; overflow: hidden; padding: 0; position: absolute; width: 1px; }
202+/* Extends the .visuallyhidden class to allow the element to be focusable when navigated to via the keyboard: drupal.org/node/897638 */
203+.visuallyhidden.focusable:active,
204+.visuallyhidden.focusable:focus { clip: auto; height: auto; margin: 0; overflow: visible; position: static; width: auto; }
205+
206+/* Hide visually and from screenreaders, but maintain layout */
207+.invisible { visibility: hidden; }
208+
209+/* The Magnificent Clearfix: Updated to prevent margin-collapsing on child elements in most situations.
210+ nicolasgallagher.com/micro-clearfix-hack/ */
211+.clearfix:before, .clearfix:after { content: ""; display: table; }
212+.clearfix:after { clear: both; }
213+.clearfix { zoom: 1; }
214+
215+
216+
217+/**
218+ * Media queries for responsive design.
219+ *
220+ * These follow after primary styles so they will successfully override.
221+ */
222+
223+@media all and (orientation:portrait) {
224+ /* Style adjustments for portrait mode goes here */
225+
226+}
227+
228+@media all and (orientation:landscape) {
229+ /* Style adjustments for landscape mode goes here */
230+
231+}
232+
233+/* Grade-A Mobile Browsers (Opera Mobile, Mobile Safari, Android Chrome)
234+ consider this: www.cloudfour.com/css-media-query-for-mobile-is-fools-gold/ */
235+@media screen and (max-device-width: 480px) {
236+
237+
238+ /* Uncomment if you don't want iOS and WinMobile to mobile-optimize the text for you: j.mp/textsizeadjust */
239+ /* html { -webkit-text-size-adjust:none; -ms-text-size-adjust:none; } */
240+}
241+
242+
243+/**
244+ * Print styles.
245+ *
246+ * Inlined to avoid required HTTP connection: www.phpied.com/delay-loading-your-print-css/
247+ */
248+@media print {
249+ * { background: transparent !important; color: black !important; text-shadow: none !important; filter:none !important;
250+ -ms-filter: none !important; } /* Black prints faster: sanbeiji.com/archives/953 */
251+ a, a:visited { color: #444 !important; text-decoration: underline; }
252+ a[href]:after { content: " (" attr(href) ")"; }
253+ abbr[title]:after { content: " (" attr(title) ")"; }
254+ .ir a:after, a[href^="javascript:"]:after, a[href^="#"]:after { content: ""; } /* Don't show links for images, or javascript/internal links */
255+ pre, blockquote { border: 1px solid #999; page-break-inside: avoid; }
256+ thead { display: table-header-group; } /* css-discuss.incutio.com/wiki/Printing_Tables */
257+ tr, img { page-break-inside: avoid; }
258+ img { max-width: 100% !important; }
259+ @page { margin: 0.5cm; }
260+ p, h2, h3 { orphans: 3; widows: 3; }
261+ h2, h3{ page-break-after: avoid; }
262+}
htdocs/index.html+21−0
@@ -0,0 +1,21 @@
1+<!doctype html><!-- paulirish.com/2008/conditional-stylesheets-vs-css-hacks-answer-neither/ --><!--[if lt IE 7]> <html class="no-js ie6" lang="en"> <![endif]--><!--[if IE 7]> <html class="no-js ie7" lang="en"> <![endif]--><!--[if IE 8]> <html class="no-js ie8" lang="en"> <![endif]--><!--[if gt IE 8]><!--> <html class="no-js" lang="en"> <!--<![endif]--><head><meta charset="utf-8"><title></title><meta name="description" content=""><meta name="author" content=""><!-- Mobile viewport optimized …
2+
3+<p>this is a test paragraph</p>
4+
5+<h2>here is a list</h2>
6+
7+<ol>
8+<li>Hello</li>
9+<li>World</li>
10+</ol>
11+
12+<blockquote>
13+ <p>He said something
14+ Yep he did.</p>
15+</blockquote><h2>check out new code!!</h2>
16+
17+<p><code>this + that</code></p> <h2>HI!</h2>
18+
19+<blockquote>
20+ <p>This is a quote</p>
21+</blockquote> <!-- JavaScript at the bottom for fast page loading --><script src="js/libs/ender.js"></script><!-- scripts concatenated and minified via ant build script--><script src="js/script.js"></script><!-- end scripts--><!-- simple uniques and page requests tracker, see server.js --><script>Modernizr.localstorage || document.write('<script src="js/libs/storage.js">\x3C/script>')</script><script>var s = localStorage, key = s.getItem('key');if (key === null) { key = +new Date(); s.setItem('k …
htdocs/js/libs/ender.js+1058−0
@@ -0,0 +1,1058 @@
1+/*!
2+ * Ender: open module JavaScript framework
3+ * copyright Dustin Diaz & Jacob Thornton 2011 (@ded @fat)
4+ * https://github.com/ender-js/ender
5+ * License MIT
6+ * Build: ender just bonzo qwery reqwest
7+ */
8+!function (context) {
9+
10+ function aug(o, o2) {
11+ for (var k in o2) {
12+ k != 'noConflict' && (o[k] = o2[k]);
13+ }
14+ }
15+
16+ function _$(s, r) {
17+ this.elements = typeof s !== 'string' && !s.nodeType && typeof s.length !== 'undefined' ? s : $._select(s, r);
18+ this.length = this.elements.length;
19+ for (var i = 0; i < this.length; i++) {
20+ this[i] = this.elements[i];
21+ }
22+ }
23+
24+ function $(s, r) {
25+ return new _$(s, r);
26+ }
27+
28+ aug($, {
29+ ender: function (o, proto) {
30+ aug(proto ? _$.prototype : $, o);
31+ },
32+ _select: function () {
33+ return [];
34+ }
35+ });
36+
37+ var old = context.$;
38+ $.noConflict = function () {
39+ context.$ = old;
40+ return this;
41+ };
42+
43+ (typeof module !== 'undefined') && module.exports ?
44+ (module.exports = $) :
45+ (context.$ = $);
46+
47+}(this);
48+/*!
49+ * bonzo.js - copyright @dedfat 2011
50+ * https://github.com/ded/bonzo
51+ * Follow our software http://twitter.com/dedfat
52+ * MIT License
53+ */
54+!function (context) {
55+
56+ var doc = document,
57+ html = doc.documentElement,
58+ specialAttributes = /^checked|value|selected$/,
59+ stateAttributes = /^checked|selected$/,
60+ ie = /msie/.test(navigator.userAgent),
61+ uidList = [],
62+ uuids = 0;
63+
64+ function classReg(c) {
65+ return new RegExp("(^|\\s+)" + c + "(\\s+|$)");
66+ }
67+
68+ function each(ar, fn) {
69+ for (i = 0, len = ar.length; i < len; i++) {
70+ fn(ar[i]);
71+ }
72+ }
73+
74+ function trim(s) {
75+ return s.replace(/(^\s*|\s*$)/g, '');
76+ }
77+
78+ function camelize(s) {
79+ return s.replace(/-(.)/g, function (m, m1) {
80+ return m1.toUpperCase();
81+ });
82+ }
83+
84+ function is(node) {
85+ return node && node.nodeName && node.nodeType == 1;
86+ }
87+
88+ function some(ar, fn, scope) {
89+ for (var i = 0, j = ar.length; i < j; ++i) {
90+ if (fn.call(scope, ar[i], i, ar)) {
91+ return true;
92+ }
93+ }
94+ return false;
95+ }
96+
97+ function sucks(o) {
98+ for (var k in o) {
99+ switch (k) {
100+ case 'opacity':
101+ o.filter = 'alpha(opacity=' + (o[k] * 100) + ')';
102+ delete o[k];
103+ break;
104+ case '':
105+ break;
106+ }
107+ }
108+ }
109+
110+ function _bonzo(elements) {
111+ this.elements = [];
112+ this.length = 0;
113+ if (elements) {
114+ this.elements = typeof elements !== 'string' && !elements.nodeType && typeof elements.length !== 'undefined' ? elements : [elements];
115+ this.length = this.elements.length;
116+ for (var i = 0; i < this.length; i++) {
117+ this[i] = this.elements[i];
118+ }
119+ }
120+ }
121+
122+ _bonzo.prototype = {
123+
124+ each: function (fn) {
125+ for (var i = 0, l = this.length; i < l; i++) {
126+ fn.call(this, this[i], i);
127+ }
128+ return this;
129+ },
130+
131+ map: function (fn, reject) {
132+ var m = [], n;
133+ for (var i = 0; i < this.length; i++) {
134+ n = fn.call(this, this[i]);
135+ reject ? (reject(n) && m.push(n)) : m.push(n);
136+ }
137+ return m;
138+ },
139+
140+ first: function () {
141+ return bonzo(this[0]);
142+ },
143+
144+ last: function () {
145+ return bonzo(this[this.length - 1]);
146+ },
147+
148+ html: function (html) {
149+ return typeof html !== 'undefined' ?
150+ this.each(function (el) {
151+ el.innerHTML = html;
152+ }) :
153+ this.elements[0] ? this.elements[0].innerHTML : '';
154+ },
155+
156+ addClass: function (c) {
157+ return this.each(function (el) {
158+ this.hasClass(el, c) || (el.className = trim(el.className + ' ' + c));
159+ });
160+ },
161+
162+ removeClass: function (c) {
163+ return this.each(function (el) {
164+ this.hasClass(el, c) && (el.className = trim(el.className.replace(classReg(c), ' ')));
165+ });
166+ },
167+
168+ hasClass: function (el, c) {
169+ return typeof c == 'undefined' ?
170+ some(this.elements, function (i) {
171+ return classReg(el).test(i.className);
172+ }) :
173+ classReg(c).test(el.className);
174+ },
175+
176+ toggleClass: function (c, condition) {
177+ if (typeof condition !== 'undefined' && !condition) {
178+ return this;
179+ }
180+ return this.each(function (el) {
181+ this.hasClass(el, c) ?
182+ (el.className = trim(el.className.replace(classReg(c), ' '))) :
183+ (el.className = trim(el.className + ' ' + c));
184+ });
185+ },
186+
187+ show: function (elements) {
188+ return this.each(function (el) {
189+ el.style.display = '';
190+ });
191+ },
192+
193+ hide: function (elements) {
194+ return this.each(function (el) {
195+ el.style.display = 'none';
196+ });
197+ },
198+
199+ append: function (node) {
200+ return this.each(function (el) {
201+ each(normalize(node), function (i) {
202+ el.appendChild(i);
203+ });
204+ });
205+ },
206+
207+ prepend: function (node) {
208+ return this.each(function (el) {
209+ var first = el.firstChild;
210+ each(normalize(node), function (i) {
211+ el.insertBefore(i, first);
212+ });
213+ });
214+ },
215+
216+ appendTo: function (target) {
217+ return this.each(function (el) {
218+ target.appendChild(el);
219+ });
220+ },
221+
222+ next: function () {
223+ return this.related('nextSibling');
224+ },
225+
226+ previous: function () {
227+ return this.related('previousSibling');
228+ },
229+
230+ related: function (method) {
231+ return this.map(
232+ function (el) {
233+ el = el[method];
234+ while (el && el.nodeType !== 1) {
235+ el = el[method];
236+ }
237+ return el || 0;
238+ },
239+ function (el) {
240+ return el;
241+ }
242+ );
243+ },
244+
245+ prependTo: function (target) {
246+ return this.each(function (el) {
247+ target.insertBefore(el, bonzo.firstChild(target));
248+ });
249+ },
250+
251+ before: function (node) {
252+ return this.each(function (el) {
253+ each(bonzo.create(node), function (i) {
254+ el.parentNode.insertBefore(i, el);
255+ });
256+ });
257+ },
258+
259+ insertBefore: function (node) {
260+ return this.each(function (el) {
261+ each(normalize(node), function (n) {
262+ n.parentNode.insertBefore(el, n);
263+ });
264+ });
265+ },
266+
267+ insertAfter: function (node) {
268+ return this.each(function (el) {
269+ each(normalize(node), function (n) {
270+ n.parentNode.insertBefore(el, (n.nextSibling || n));
271+ });
272+ });
273+ },
274+
275+ after: function (node) {
276+ return this.each(function (el) {
277+ each(bonzo.create(node), function (i) {
278+ el.parentNode.insertBefore(i, el.nextSibling);
279+ });
280+ });
281+ },
282+
283+ css: function (o, v) {
284+ if (v === undefined && typeof o == 'string') {
285+ return this[0].style[camelize(o)];
286+ }
287+ var iter = o;
288+ if (typeof o == 'string') {
289+ iter = {};
290+ iter[o] = v;
291+ }
292+ ie && sucks(iter);
293+ var fn = function (el) {
294+ for (var k in iter) {
295+ iter.hasOwnProperty(k) && (el.style[camelize(k)] = iter[k]);
296+ }
297+ };
298+ return this.each(fn);
299+ },
300+
301+ offset: function () {
302+ var el = this.elements[0];
303+ var width = el.offsetWidth;
304+ var height = el.offsetHeight;
305+ var top = el.offsetTop;
306+ var left = el.offsetLeft;
307+ while (el = el.offsetParent) {
308+ top = top + el.offsetTop;
309+ left = left + el.offsetLeft;
310+ }
311+
312+ return {
313+ top: top,
314+ left: left,
315+ height: height,
316+ width: width
317+ };
318+ },
319+
320+ attr: function (k, v) {
321+ var el = this.elements[0];
322+ return typeof v == 'undefined' ?
323+ specialAttributes.test(k) ?
324+ stateAttributes.test(k) && typeof el[k] == 'string' ?
325+ true : el[k] : el.getAttribute(k) :
326+ this.each(function (el) {
327+ el.setAttribute(k, v);
328+ });
329+ },
330+
331+ removeAttr: function (k) {
332+ return this.each(function (el) {
333+ el.removeAttribute(k);
334+ });
335+ },
336+
337+ data: function (k, v) {
338+ var el = this.elements[0];
339+ if (typeof v === 'undefined') {
340+ el.getAttribute('data-node-uid') || el.setAttribute('data-node-uid', ++uuids);
341+ var uid = el.getAttribute('data-node-uid');
342+ uidList[uid] || (uidList[uid] = {});
343+ return uidList[uid][k];
344+ } else {
345+ return this.each(function (el) {
346+ el.getAttribute('data-node-uid') || el.setAttribute('data-node-uid', ++uuids);
347+ var uid = el.getAttribute('data-node-uid');
348+ var o = {};
349+ o[k] = v;
350+ uidList[uid] = o;
351+ });
352+ }
353+ },
354+
355+ remove: function () {
356+ return this.each(function (el) {
357+ el.parentNode && el.parentNode.removeChild(el);
358+ });
359+ },
360+
361+ empty: function () {
362+ return this.each(function (el) {
363+ while (el.firstChild) {
364+ el.removeChild(el.firstChild);
365+ }
366+ });
367+ },
368+
369+ detach: function () {
370+ return this.map(function (el) {
371+ return el.parentNode.removeChild(el);
372+ });
373+ },
374+
375+ scrollTop: function (y) {
376+ return scroll.call(this, null, y, 'y');
377+ },
378+
379+ scrollLeft: function (x) {
380+ return scroll.call(this, x, null, 'x');
381+ },
382+
383+ serialize: function () {
384+ var form = this[0],
385+ inputs = form.getElementsByTagName('input'),
386+ selects = form.getElementsByTagName('select'),
387+ texts = form.getElementsByTagName('textarea');
388+ return (bonzo(inputs).map(serial).join('') +
389+ bonzo(selects).map(serial).join('') +
390+ bonzo(texts).map(serial).join('')).replace(/&$/, '');
391+ },
392+
393+ serializeArray: function () {
394+ for (var pairs = this.serialize().split('&'), i = 0, l = pairs.length, r = [], o; i < l; i++) {
395+ pairs[i] && (o = pairs[i].split('=')) && r.push({name: o[0], value: o[1]});
396+ }
397+ return r;
398+ }
399+ };
400+
401+ function enc(v) {
402+ return encodeURIComponent(v);
403+ }
404+
405+ function serial(el) {
406+ var n = el.name;
407+ // don't serialize elements that are disabled or without a name
408+ if (el.disabled || !n) {
409+ return '';
410+ }
411+ n = enc(n);
412+ switch (el.tagName.toLowerCase()) {
413+ case 'input':
414+ switch (el.type) {
415+ case 'reset':
416+ case 'button':
417+ case 'image':
418+ case 'file':
419+ return '';
420+ case 'checkbox':
421+ case 'radio':
422+ return el.checked ? n + '=' + (el.value ? enc(el.value) : true) + '&' : '';
423+ default: // text hidden password submit
424+ return n + '=' + (el.value ? enc(el.value) : true) + '&';
425+ }
426+ break;
427+ case 'textarea':
428+ return n + '=' + enc(el.value) + '&';
429+ case 'select':
430+ // @todo refactor beyond basic single selected value case
431+ return n + '=' + enc(el.options[el.selectedIndex].value) + '&';
432+ }
433+ return '';
434+ }
435+
436+ function normalize(node) {
437+ return typeof node == 'string' ? bonzo.create(node) : is(node) ? [node] : node;
438+ }
439+
440+ function scroll(x, y, type) {
441+ var el = this.elements[0];
442+ if (x == null && y == null) {
443+ return (isBody(el) ? getWindowScroll() : { x: el.scrollLeft, y: el.scrollTop })[type];
444+ }
445+ if (isBody(el)) {
446+ window.scrollTo(x, y);
447+ } else {
448+ x != null && (el.scrollLeft = x);
449+ y != null && (el.scrollTop = y);
450+ }
451+ return this;
452+ }
453+
454+ function isBody(element) {
455+ return element === window || (/^(?:body|html)$/i).test(element.tagName);
456+ }
457+
458+ function getWindowScroll() {
459+ return { x: window.pageXOffset || html.scrollLeft, y: window.pageYOffset || html.scrollTop };
460+ }
461+
462+ function bonzo(els) {
463+ return new _bonzo(els);
464+ }
465+
466+ bonzo.aug = function (o, target) {
467+ for (var k in o) {
468+ o.hasOwnProperty(k) && ((target || _bonzo.prototype)[k] = o[k]);
469+ }
470+ };
471+
472+ bonzo.create = function (node) {
473+ return typeof node == 'string' ?
474+ function () {
475+ var el = doc.createElement('div'), els = [];
476+ el.innerHTML = node;
477+ var nodes = el.childNodes;
478+ el = el.firstChild;
479+ els.push(el);
480+ while (el = el.nextSibling) {
481+ (el.nodeType == 1) && els.push(el);
482+ }
483+ return els;
484+
485+ }() : is(node) ? [node.cloneNode(true)] : [];
486+ };
487+
488+ bonzo.doc = function () {
489+ var w = html.scrollWidth,
490+ h = html.scrollHeight,
491+ vp = this.viewport();
492+ return {
493+ width: Math.max(w, vp.width),
494+ height: Math.max(h, vp.height)
495+ };
496+ };
497+
498+ bonzo.firstChild = function (el) {
499+ for (var c = el.childNodes, i = 0, j = (c && c.length) || 0, e; i < j; i++) {
500+ if (c[i].nodeType === 1) {
501+ e = c[j = i];
502+ }
503+ }
504+ return e;
505+ };
506+
507+ bonzo.viewport = function () {
508+ var h = self.innerHeight,
509+ w = self.innerWidth;
510+ ie && (h = html.clientHeight) && (w = html.clientWidth);
511+ return {
512+ width: w,
513+ height: h
514+ };
515+ };
516+
517+ bonzo.isAncestor = 'compareDocumentPosition' in html ?
518+ function (container, element) {
519+ return (container.compareDocumentPosition(element) & 16) == 16;
520+ } : 'contains' in html ?
521+ function (container, element) {
522+ return container !== element && container.contains(element);
523+ } :
524+ function (container, element) {
525+ while (element = element.parentNode) {
526+ if (element === container) {
527+ return true;
528+ }
529+ }
530+ return false;
531+ };
532+
533+ var old = context.bonzo;
534+ bonzo.noConflict = function () {
535+ context.bonzo = old;
536+ return this;
537+ };
538+ context.bonzo = bonzo;
539+
540+}(this);!function () {
541+ var b = bonzo.noConflict();
542+ $.ender(b);
543+ $.ender(b(), true);
544+ $.ender({
545+ create: function (node) {
546+ return $(b.create(node));
547+ }
548+ });
549+
550+ function indexOf(ar, val) {
551+ for (var i = 0; i < ar.length; i++) {
552+ if ( ar[i] === val ) {
553+ return i;
554+ }
555+ }
556+ return -1;
557+ }
558+
559+ function uniq(ar) {
Cut short: this commit's diff is over 1000 lines.
htdocs/js/libs/modernizr.js+1048−0
Cut short: this commit's diff is over 1000 lines.
htdocs/js/libs/storage.js+99−0
Cut short: this commit's diff is over 1000 lines.
htdocs/js/script.js+0−0
markdown/about.md+14−0
Cut short: this commit's diff is over 1000 lines.
markdown/blabla.md+3−0
Cut short: this commit's diff is over 1000 lines.
markdown/posts_code.md+3−0
Cut short: this commit's diff is over 1000 lines.
markdown/posts_hello.md+3−0
Cut short: this commit's diff is over 1000 lines.
server.js+130−0
Cut short: this commit's diff is over 1000 lines.
templates/about.dust+47−0
Cut short: this commit's diff is over 1000 lines.
templates/index.dust+49−0
Cut short: this commit's diff is over 1000 lines.