UNPKG

39.7 kBJavaScriptView Raw
1;(function(){var require = function (file, cwd) {
2 var resolved = require.resolve(file, cwd || '/');
3 var mod = require.modules[resolved];
4 if (!mod) throw new Error(
5 'Failed to resolve module ' + file + ', tried ' + resolved
6 );
7 var res = mod._cached ? mod._cached : mod();
8 return res;
9}
10var __require = require;
11
12require.paths = [];
13require.modules = {};
14require.extensions = [".js",".coffee"];
15
16require._core = {
17 'assert': true,
18 'events': true,
19 'fs': true,
20 'path': true,
21 'vm': true
22};
23
24require.resolve = (function () {
25 return function (x, cwd) {
26 if (!cwd) cwd = '/';
27
28 if (require._core[x]) return x;
29 var path = require.modules.path();
30 var y = cwd || '.';
31
32 if (x.match(/^(?:\.\.?\/|\/)/)) {
33 var m = loadAsFileSync(path.resolve(y, x))
34 || loadAsDirectorySync(path.resolve(y, x));
35 if (m) return m;
36 }
37
38 var n = loadNodeModulesSync(x, y);
39 if (n) return n;
40
41 throw new Error("Cannot find module '" + x + "'");
42
43 function loadAsFileSync (x) {
44 if (require.modules[x]) {
45 return x;
46 }
47
48 for (var i = 0; i < require.extensions.length; i++) {
49 var ext = require.extensions[i];
50 if (require.modules[x + ext]) return x + ext;
51 }
52 }
53
54 function loadAsDirectorySync (x) {
55 x = x.replace(/\/+$/, '');
56 var pkgfile = x + '/package.json';
57 if (require.modules[pkgfile]) {
58 var pkg = require.modules[pkgfile]();
59 var b = pkg.browserify;
60 if (typeof b === 'object' && b.main) {
61 var m = loadAsFileSync(path.resolve(x, b.main));
62 if (m) return m;
63 }
64 else if (typeof b === 'string') {
65 var m = loadAsFileSync(path.resolve(x, b));
66 if (m) return m;
67 }
68 else if (pkg.main) {
69 var m = loadAsFileSync(path.resolve(x, pkg.main));
70 if (m) return m;
71 }
72 }
73
74 return loadAsFileSync(x + '/index');
75 }
76
77 function loadNodeModulesSync (x, start) {
78 var dirs = nodeModulesPathsSync(start);
79 for (var i = 0; i < dirs.length; i++) {
80 var dir = dirs[i];
81 var m = loadAsFileSync(dir + '/' + x);
82 if (m) return m;
83 var n = loadAsDirectorySync(dir + '/' + x);
84 if (n) return n;
85 }
86
87 var m = loadAsFileSync(x);
88 if (m) return m;
89 }
90
91 function nodeModulesPathsSync (start) {
92 var parts;
93 if (start === '/') parts = [ '' ];
94 else parts = path.normalize(start).split('/');
95
96 var dirs = [];
97 for (var i = parts.length - 1; i >= 0; i--) {
98 if (parts[i] === 'node_modules') continue;
99 var dir = parts.slice(0, i + 1).join('/') + '/node_modules';
100 dirs.push(dir);
101 }
102
103 return dirs;
104 }
105 };
106})();
107
108require.alias = function (from, to) {
109 var path = require.modules.path();
110 var res = null;
111 try {
112 res = require.resolve(from + '/package.json', '/');
113 }
114 catch (err) {
115 res = require.resolve(from, '/');
116 }
117 var basedir = path.dirname(res);
118
119 var keys = Object_keys(require.modules);
120
121 for (var i = 0; i < keys.length; i++) {
122 var key = keys[i];
123 if (key.slice(0, basedir.length + 1) === basedir + '/') {
124 var f = key.slice(basedir.length);
125 require.modules[to + f] = require.modules[basedir + f];
126 }
127 else if (key === basedir) {
128 require.modules[to] = require.modules[basedir];
129 }
130 }
131};
132
133require.define = function (filename, fn) {
134 var dirname = require._core[filename]
135 ? ''
136 : require.modules.path().dirname(filename)
137 ;
138
139 var require_ = function (file) { return require(file, dirname) };
140 require_.resolve = function (name) {
141 return require.resolve(name, dirname);
142 };
143 require_.modules = require.modules;
144 var module_ = { exports : {} };
145
146 require.modules[filename] = function () {
147 fn.call(
148 module_.exports,
149 require_,
150 module_,
151 module_.exports,
152 dirname,
153 filename
154 );
155 require.modules[filename]._cached = module_.exports;
156 return module_.exports;
157 };
158};
159
160var Object_keys = Object.keys || function (obj) {
161 var res = [];
162 for (var key in obj) res.push(key)
163 return res;
164};
165
166if (typeof process === 'undefined') process = {};
167
168if (!process.nextTick) process.nextTick = function (fn) {
169 setTimeout(fn, 0);
170};
171
172if (!process.title) process.title = 'browser';
173
174if (!process.binding) process.binding = function (name) {
175 if (name === 'evals') return require('vm')
176 else throw new Error('No such module')
177};
178
179if (!process.cwd) process.cwd = function () { return '.' };
180
181require.define("path", function (require, module, exports, __dirname, __filename) {
182 function filter (xs, fn) {
183 var res = [];
184 for (var i = 0; i < xs.length; i++) {
185 if (fn(xs[i], i, xs)) res.push(xs[i]);
186 }
187 return res;
188}
189
190// resolves . and .. elements in a path array with directory names there
191// must be no slashes, empty elements, or device names (c:\) in the array
192// (so also no leading and trailing slashes - it does not distinguish
193// relative and absolute paths)
194function normalizeArray(parts, allowAboveRoot) {
195 // if the path tries to go above the root, `up` ends up > 0
196 var up = 0;
197 for (var i = parts.length; i >= 0; i--) {
198 var last = parts[i];
199 if (last == '.') {
200 parts.splice(i, 1);
201 } else if (last === '..') {
202 parts.splice(i, 1);
203 up++;
204 } else if (up) {
205 parts.splice(i, 1);
206 up--;
207 }
208 }
209
210 // if the path is allowed to go above the root, restore leading ..s
211 if (allowAboveRoot) {
212 for (; up--; up) {
213 parts.unshift('..');
214 }
215 }
216
217 return parts;
218}
219
220// Regex to split a filename into [*, dir, basename, ext]
221// posix version
222var splitPathRe = /^(.+\/(?!$)|\/)?((?:.+?)?(\.[^.]*)?)$/;
223
224// path.resolve([from ...], to)
225// posix version
226exports.resolve = function() {
227var resolvedPath = '',
228 resolvedAbsolute = false;
229
230for (var i = arguments.length; i >= -1 && !resolvedAbsolute; i--) {
231 var path = (i >= 0)
232 ? arguments[i]
233 : process.cwd();
234
235 // Skip empty and invalid entries
236 if (typeof path !== 'string' || !path) {
237 continue;
238 }
239
240 resolvedPath = path + '/' + resolvedPath;
241 resolvedAbsolute = path.charAt(0) === '/';
242}
243
244// At this point the path should be resolved to a full absolute path, but
245// handle relative paths to be safe (might happen when process.cwd() fails)
246
247// Normalize the path
248resolvedPath = normalizeArray(filter(resolvedPath.split('/'), function(p) {
249 return !!p;
250 }), !resolvedAbsolute).join('/');
251
252 return ((resolvedAbsolute ? '/' : '') + resolvedPath) || '.';
253};
254
255// path.normalize(path)
256// posix version
257exports.normalize = function(path) {
258var isAbsolute = path.charAt(0) === '/',
259 trailingSlash = path.slice(-1) === '/';
260
261// Normalize the path
262path = normalizeArray(filter(path.split('/'), function(p) {
263 return !!p;
264 }), !isAbsolute).join('/');
265
266 if (!path && !isAbsolute) {
267 path = '.';
268 }
269 if (path && trailingSlash) {
270 path += '/';
271 }
272
273 return (isAbsolute ? '/' : '') + path;
274};
275
276
277// posix version
278exports.join = function() {
279 var paths = Array.prototype.slice.call(arguments, 0);
280 return exports.normalize(filter(paths, function(p, index) {
281 return p && typeof p === 'string';
282 }).join('/'));
283};
284
285
286exports.dirname = function(path) {
287 var dir = splitPathRe.exec(path)[1] || '';
288 var isWindows = false;
289 if (!dir) {
290 // No dirname
291 return '.';
292 } else if (dir.length === 1 ||
293 (isWindows && dir.length <= 3 && dir.charAt(1) === ':')) {
294 // It is just a slash or a drive letter with a slash
295 return dir;
296 } else {
297 // It is a full dirname, strip trailing slash
298 return dir.substring(0, dir.length - 1);
299 }
300};
301
302
303exports.basename = function(path, ext) {
304 var f = splitPathRe.exec(path)[2] || '';
305 // TODO: make this comparison case-insensitive on windows?
306 if (ext && f.substr(-1 * ext.length) === ext) {
307 f = f.substr(0, f.length - ext.length);
308 }
309 return f;
310};
311
312
313exports.extname = function(path) {
314 return splitPathRe.exec(path)[3] || '';
315};
316
317});
318
319require.define("/list.js", function (require, module, exports, __dirname, __filename) {
320 (function() {
321 var JQueryAdapter, JQueryListAdapter, List, Order, _ref, _ref2;
322 var __hasProp = Object.prototype.hasOwnProperty, __extends = function(child, parent) { for (var key in parent) { if (__hasProp.call(parent, key)) child[key] = parent[key]; } function ctor() { this.constructor = child; } ctor.prototype = parent.prototype; child.prototype = new ctor; child.__super__ = parent.prototype; return child; };
323
324 Order = require('order').Order;
325
326 JQueryAdapter = ((_ref = typeof require === "function" ? require('dt-jquery') : void 0) != null ? _ref : typeof window !== "undefined" && window !== null ? (_ref2 = window.dynamictemplate) != null ? _ref2.jqueryify : void 0 : void 0).Adapter;
327
328 /*
329
330 insert
331 append
332 remove
333 move
334 */
335
336 List = (function() {
337
338 __extends(List, Order);
339
340 function List() {
341 List.__super__.constructor.apply(this, arguments);
342 }
343
344 return List;
345
346 })();
347
348 if (JQueryAdapter) {
349 JQueryListAdapter = (function() {
350
351 __extends(JQueryListAdapter, JQueryAdapter);
352
353 function JQueryListAdapter() {
354 JQueryListAdapter.__super__.constructor.apply(this, arguments);
355 }
356
357 JQueryListAdapter.prototype.onadd = function(parent, el) {
358 var after, before, idx, list, _ref3;
359 var _this = this;
360 if (!el._list) {
361 return JQueryListAdapter.__super__.onadd.apply(this, arguments);
362 }
363 _ref3 = el._list, idx = _ref3.idx, before = _ref3.before, after = _ref3.after, list = _ref3.list;
364 return delay.call(parent, function() {
365 if (parent === _this.builder) {
366 parent._jquery = parent._jquery.add(el._jquery);
367 if (typeof el._jquery_ready === "function") el._jquery_ready();
368 return el._jquery_ready = true;
369 } else {
370 return _this.animation.push(function() {
371 el = list[idx]._jquery;
372 if (before !== -1) {
373 list[before]._jquery.after(el);
374 } else if (after !== -1) {
375 list[after]._jquery.before(el);
376 } else {
377 root._jquery.append(el);
378 }
379 if (typeof el._jquery_ready === "function") el._jquery_ready();
380 return el._jquery_ready = true;
381 });
382 }
383 });
384 };
385
386 return JQueryListAdapter;
387
388 })();
389 }
390
391 List.mark = function(_arg) {
392 var after, before, idx;
393 idx = _arg.idx, before = _arg.before, after = _arg.after;
394 return this[idx]._list = {
395 idx: idx,
396 before: before,
397 after: after,
398 list: this
399 };
400 };
401
402 List.jqueryify = function(tpl, opts) {
403 new JQueryListAdapter(tpl, opts);
404 return tpl;
405 };
406
407 List.List = List;
408
409 module.exports = List;
410
411 if (process.title === 'browser') {
412 (function() {
413 if (this.dynamictemplate != null) {
414 return this.dynamictemplate.List = List;
415 } else {
416 return this.dynamictemplate = {
417 List: List
418 };
419 }
420 }).call(window);
421 }
422
423 /*
424 test = ->
425 new Template ->
426 ul = @$ul()
427 list = new List List.jqueryify(ul)
428 view.on 'entry', (value) ->
429 list.push (done) ->
430 new Tag('li', "#{value}").ready(done).end() # w00t the foock!!
431 */
432
433}).call(this);
434
435});
436
437require.define("/node_modules/order/package.json", function (require, module, exports, __dirname, __filename) {
438 module.exports = {"name":"order","description":"handle ordered async lists","version":"0.0.1","homepage":"https://github.com/dodo/node-order","author":"dodo (https://github.com/dodo)","repository":{"type":"git","url":"git://github.com/dodo/node-order.git"},"main":"order.js","engines":{"node":">= 0.4.x"},"keywords":["order","list","array","collection","sequence","async","control","flow"],"scripts":{"test":"cake build && nodeunit test","prepublish":"cake build"},"devDependencies":{"nodeunit":">= 0.5.4","muffin":">= 0.2.6","coffee-script":">= 1.1.3"}}
439});
440
441require.define("/node_modules/order/order.js", function (require, module, exports, __dirname, __filename) {
442
443module.exports = require('./lib/order')
444
445});
446
447require.define("/node_modules/order/lib/order.js", function (require, module, exports, __dirname, __filename) {
448 (function() {
449 var Order, delay, mark, ready, release;
450 var __slice = Array.prototype.slice, __bind = function(fn, me){ return function(){ return fn.apply(me, arguments); }; }, __hasProp = Object.prototype.hasOwnProperty, __extends = function(child, parent) { for (var key in parent) { if (__hasProp.call(parent, key)) child[key] = parent[key]; } function ctor() { this.constructor = child; } ctor.prototype = parent.prototype; child.prototype = new ctor; child.__super__ = parent.prototype; return child; };
451
452 mark = function(list) {
453 list._sync = true;
454 return list;
455 };
456
457 release = function(list, result) {
458 if (typeof list._sync === "function") list._sync();
459 delete list._sync;
460 return result;
461 };
462
463 delay = function(list, callback) {
464 if (list._sync) {
465 return list._sync = callback;
466 } else {
467 return callback();
468 }
469 };
470
471 ready = function() {
472 var after, args, before, i, _arg;
473 var _this = this;
474 _arg = arguments[0], args = 2 <= arguments.length ? __slice.call(arguments, 1) : [];
475 i = _arg.i;
476 if (isNaN(i)) return;
477 if (this.done[i]) return;
478 this.done[i] = true;
479 after = i + 1;
480 while (this.done[after] === false) {
481 after++;
482 }
483 if (this.done[after] === void 0) after = -1;
484 before = i - 1;
485 while (this.done[before] === false) {
486 before--;
487 }
488 if (this.done[before] === void 0) before = -1;
489 return delay(this, function() {
490 var _ref;
491 return (_ref = _this.callback) != null ? _ref.call.apply(_ref, [_this, {
492 idx: i,
493 before: before,
494 after: after
495 }].concat(__slice.call(args))) : void 0;
496 });
497 };
498
499 Order = (function() {
500
501 __extends(Order, Array);
502
503 function Order(callback) {
504 this.callback = callback;
505 this.remove = __bind(this.remove, this);
506 this.insert = __bind(this.insert, this);
507 this.shift = __bind(this.shift, this);
508 this.pop = __bind(this.pop, this);
509 this.unshift = __bind(this.unshift, this);
510 this.push = __bind(this.push, this);
511 this.keys = [];
512 this.done = [];
513 Order.__super__.constructor.apply(this, arguments);
514 }
515
516 Order.prototype.push = function(entry) {
517 var idx;
518 if (entry == null) return;
519 idx = {
520 i: this.length
521 };
522 this.done.push(false);
523 this.keys.push(idx);
524 return release(this, Order.__super__.push.call(this, entry(ready.bind(mark(this), idx))));
525 };
526
527 Order.prototype.unshift = function(entry) {
528 var e, idx, _i, _len, _ref;
529 if (entry == null) return;
530 idx = {
531 i: 0
532 };
533 _ref = this.keys;
534 for (_i = 0, _len = _ref.length; _i < _len; _i++) {
535 e = _ref[_i];
536 e.i++;
537 }
538 this.done.unshift(false);
539 this.keys.unshift(idx);
540 return release(this, Order.__super__.unshift.call(this, entry(ready.bind(mark(this), idx))));
541 };
542
543 Order.prototype.pop = function() {
544 this.keys[this.keys.length - 1].i = NaN;
545 this.done.pop();
546 this.keys.pop();
547 return Order.__super__.pop.apply(this, arguments);
548 };
549
550 Order.prototype.shift = function() {
551 var e, _i, _len, _ref;
552 this.keys[0].i = NaN;
553 this.done.shift();
554 this.keys.shift();
555 _ref = this.keys;
556 for (_i = 0, _len = _ref.length; _i < _len; _i++) {
557 e = _ref[_i];
558 e.i--;
559 }
560 return Order.__super__.shift.apply(this, arguments);
561 };
562
563 Order.prototype.insert = function(i, entry) {
564 var e, idx, _i, _len, _ref;
565 idx = {
566 i: i
567 };
568 _ref = this.keys.slice(i);
569 for (_i = 0, _len = _ref.length; _i < _len; _i++) {
570 e = _ref[_i];
571 e.i++;
572 }
573 this.keys.splice(i, 0, idx);
574 this.done.splice(i, 0, false);
575 return release(this, this.splice(i, 0, entry(ready.bind(mark(this), idx))));
576 };
577
578 Order.prototype.remove = function(i) {
579 var e, _i, _len, _ref;
580 this.keys[i].i = NaN;
581 this.done.splice(i, 1);
582 this.keys.splice(i, 1);
583 _ref = this.keys.slice(i);
584 for (_i = 0, _len = _ref.length; _i < _len; _i++) {
585 e = _ref[_i];
586 e.i--;
587 }
588 return this.splice(i, 1);
589 };
590
591 return Order;
592
593 })();
594
595 Order.Order = Order;
596
597 module.exports = Order;
598
599}).call(this);
600
601});
602
603require.define("/node_modules/dt-jquery/package.json", function (require, module, exports, __dirname, __filename) {
604 module.exports = {"name":"dt-jquery","description":"Δt jquery adapter - async & dynamic templating engine","version":"0.2.6","homepage":"https://github.com/dodo/node-dt-jquery","author":"dodo (https://github.com/dodo)","repository":{"type":"git","url":"git://github.com/dodo/node-dt-jquery.git"},"main":"dt-jquery.js","engines":{"node":">= 0.4.x"},"keywords":["dt","async","dynamic","event","template","generation","stream","browser","jquery"],"scripts":{"prepublish":"cake build"},"dependencies":{"animation":">= 0.0.2"},"devDependencies":{"browserify":"1.6.1","scopify":">= 0.2.1","muffin":">= 0.2.6","coffee-script":">= 1.1.3"},"licenses":[{"type":"MIT","url":"http://github.com/dodo/node-dt-jquery/raw/master/LICENSE"}]}
605});
606
607require.define("/node_modules/dt-jquery/dt-jquery.js", function (require, module, exports, __dirname, __filename) {
608
609module.exports = require('./lib/dt-jquery')
610
611});
612
613require.define("/node_modules/dt-jquery/lib/dt-jquery.js", function (require, module, exports, __dirname, __filename) {
614 (function() {
615 var Animation, EVENTS, JQueryAdapter, defineJQueryAPI, delay, jqueryify, release, removed;
616 var __slice = Array.prototype.slice;
617
618 Animation = require('animation').Animation;
619
620 EVENTS = ['add', 'close', 'end', 'show', 'hide', 'attr', 'text', 'raw', 'remove', 'replace'];
621
622 defineJQueryAPI = function(el) {
623 el.__defineGetter__('selector', function() {
624 return el._jquery.selector;
625 });
626 return el.__defineGetter__('context', function() {
627 return el._jquery.context;
628 });
629 };
630
631 removed = function(el) {
632 return el.closed === "removed";
633 };
634
635 delay = function(job) {
636 var _ref;
637 if (removed(this)) return;
638 if (this._jquery != null) {
639 return job();
640 } else {
641 if ((_ref = this._jquery_delay) == null) this._jquery_delay = [];
642 return this._jquery_delay.push(job);
643 }
644 };
645
646 release = function() {
647 var job, _i, _len, _ref;
648 if (this._jquery_delay != null) {
649 _ref = this._jquery_delay;
650 for (_i = 0, _len = _ref.length; _i < _len; _i++) {
651 job = _ref[_i];
652 job();
653 }
654 return delete this._jquery_delay;
655 }
656 };
657
658 JQueryAdapter = (function() {
659
660 function JQueryAdapter(template, opts) {
661 var _ref, _ref2, _ref3, _ref4, _ref5;
662 this.template = template;
663 if (opts == null) opts = {};
664 this.builder = (_ref = this.template.xml) != null ? _ref : this.template;
665 if ((_ref2 = opts.timeoutexecution) == null) opts.timeoutexecution = '20ms';
666 if ((_ref3 = opts.execution) == null) opts.execution = '4ms';
667 if ((_ref4 = opts.timeout) == null) opts.timeout = '120ms';
668 if ((_ref5 = opts.toggle) == null) opts.toggle = true;
669 this.animation = new Animation(opts);
670 this.animation.start();
671 this.initialize();
672 }
673
674 JQueryAdapter.prototype.initialize = function() {
675 var old_query;
676 this.listen();
677 old_query = this.builder.query;
678 this.builder.query = function(type, tag, key) {
679 if (tag._jquery == null) return old_query.call(this, type, tag, key);
680 if (type === 'attr') {
681 return tag._jquery.attr(key);
682 } else if (type === 'text') {
683 return tag._jquery.text();
684 } else if (type === 'tag') {
685 if (key._jquery != null) {
686 return key;
687 } else {
688 return {
689 _jquery: key
690 };
691 }
692 }
693 };
694 return this.template.register('ready', function(tag, next) {
695 if (tag._jquery_ready === true) {
696 return next(tag);
697 } else {
698 return tag._jquery_ready = function() {
699 return next(tag);
700 };
701 }
702 });
703 };
704
705 JQueryAdapter.prototype.listen = function() {
706 var _this = this;
707 return EVENTS.forEach(function(event) {
708 return _this.template.on(event, _this["on" + event].bind(_this));
709 });
710 };
711
712 JQueryAdapter.prototype.onadd = function(parent, el) {
713 var _this = this;
714 return delay.call(parent, function() {
715 if (parent === _this.builder) {
716 parent._jquery = parent._jquery.add(el._jquery);
717 if (typeof el._jquery_ready === "function") el._jquery_ready();
718 return el._jquery_ready = true;
719 } else {
720 return _this.animation.push(function() {
721 var _ref;
722 if ((_ref = parent._jquery) != null) _ref.append(el._jquery);
723 if (typeof el._jquery_ready === "function") el._jquery_ready();
724 return el._jquery_ready = true;
725 });
726 }
727 });
728 };
729
730 JQueryAdapter.prototype.onclose = function(el) {
731 var _ref;
732 if ((_ref = el._jquery) == null) el._jquery = $(el.toString());
733 defineJQueryAPI(el);
734 release.call(el);
735 return el.on('newListener', function(type) {
736 var _ref2, _ref3;
737 if ((_ref2 = el._events) != null ? (_ref3 = _ref2[type]) != null ? _ref3.length : void 0 : void 0) {
738 return;
739 }
740 return el._jquery.bind(type, function() {
741 el.emit.apply(el, [type, this].concat(__slice.call(arguments)));
742 });
743 });
744 };
745
746 JQueryAdapter.prototype.ontext = function(el, text) {
747 return delay.call(el, function() {
748 return el._jquery.text(text);
749 });
750 };
751
752 JQueryAdapter.prototype.onraw = function(el, html) {
753 var _this = this;
754 return delay.call(el, function() {
755 return _this.animation.push(function() {
756 var _ref;
757 return (_ref = el._jquery) != null ? _ref.html(html) : void 0;
758 });
759 });
760 };
761
762 JQueryAdapter.prototype.onshow = function(el) {
763 return delay.call(el, function() {
764 return el._jquery.show();
765 });
766 };
767
768 JQueryAdapter.prototype.onhide = function(el) {
769 return delay.call(el, function() {
770 return el._jquery.hide();
771 });
772 };
773
774 JQueryAdapter.prototype.onattr = function(el, key, value) {
775 return delay.call(el, function() {
776 if (value === void 0) {
777 return el._jquery.removeAttr(key);
778 } else {
779 return el._jquery.attr(key, value);
780 }
781 });
782 };
783
784 JQueryAdapter.prototype.onreplace = function(el, tag) {
785 var _this = this;
786 return delay.call(el, function() {
787 return _this.animation.push(function() {
788 var _jquery, _ref;
789 if (removed(el)) return;
790 _jquery = (_ref = tag._jquery) != null ? _ref : tag;
791 if (!((_jquery != null ? _jquery.length : void 0) > 0)) return;
792 el._jquery.replaceWith(_jquery);
793 el._jquery = _jquery;
794 if (el === _this.builder) return el.jquery = _jquery;
795 });
796 });
797 };
798
799 JQueryAdapter.prototype.onremove = function(el) {
800 return delay.call(el.parent, function() {
801 var _ref;
802 if ((_ref = el._jquery) != null) _ref.remove();
803 return delete el._jquery;
804 });
805 };
806
807 JQueryAdapter.prototype.onend = function() {
808 this.builder._jquery = $();
809 release.call(this.builder);
810 this.template.jquery = this.template._jquery = this.builder._jquery;
811 return defineJQueryAPI(this.template);
812 };
813
814 return JQueryAdapter;
815
816 })();
817
818 jqueryify = function(tpl, opts) {
819 new JQueryAdapter(tpl, opts);
820 return tpl;
821 };
822
823 jqueryify.Adapter = JQueryAdapter;
824
825 module.exports = jqueryify;
826
827 if (process.title === 'browser') {
828 (function() {
829 if (this.dynamictemplate != null) {
830 return this.dynamictemplate.jqueryify = jqueryify;
831 } else {
832 return this.dynamictemplate = {
833 jqueryify: jqueryify
834 };
835 }
836 }).call(window);
837 }
838
839}).call(this);
840
841});
842
843require.define("/node_modules/dt-jquery/node_modules/animation/package.json", function (require, module, exports, __dirname, __filename) {
844 module.exports = {"name":"animation","description":"animation timing & handling","version":"0.1.0","homepage":"https://github.com/dodo/node-animation","author":"dodo (https://github.com/dodo)","repository":{"type":"git","url":"git://github.com/dodo/node-animation.git"},"main":"animation.js","engines":{"node":">= 0.4.x"},"keywords":["request","animation","frame","interval","node","browser"],"scripts":{"prepublish":"cake build"},"dependencies":{"ms":">= 0.1.0","request-animation-frame":">= 0.1.0"},"devDependencies":{"muffin":">= 0.2.6","coffee-script":">= 1.1.2"}}
845});
846
847require.define("/node_modules/dt-jquery/node_modules/animation/animation.js", function (require, module, exports, __dirname, __filename) {
848
849module.exports = require('./lib/animation')
850
851});
852
853require.define("/node_modules/dt-jquery/node_modules/animation/lib/animation.js", function (require, module, exports, __dirname, __filename) {
854 (function() {
855 var EventEmitter, cancelAnimationFrame, ms, now, requestAnimationFrame, _ref;
856 var __bind = function(fn, me){ return function(){ return fn.apply(me, arguments); }; }, __hasProp = Object.prototype.hasOwnProperty, __extends = function(child, parent) { for (var key in parent) { if (__hasProp.call(parent, key)) child[key] = parent[key]; } function ctor() { this.constructor = child; } ctor.prototype = parent.prototype; child.prototype = new ctor; child.__super__ = parent.prototype; return child; };
857
858 EventEmitter = require('events').EventEmitter;
859
860 _ref = require('request-animation-frame'), requestAnimationFrame = _ref.requestAnimationFrame, cancelAnimationFrame = _ref.cancelAnimationFrame;
861
862 ms = require('ms');
863
864 now = function() {
865 return new Date().getTime();
866 };
867
868 this.Animation = (function() {
869
870 __extends(Animation, EventEmitter);
871
872 function Animation(opts) {
873 var _ref2, _ref3, _ref4;
874 if (opts == null) opts = {};
875 this.nextTick = __bind(this.nextTick, this);
876 this.timoutexecutiontime = ms((_ref2 = opts.timeoutexecution) != null ? _ref2 : 20);
877 this.executiontime = ms((_ref3 = opts.execution) != null ? _ref3 : 5);
878 this.timeouttime = opts.timeout;
879 if (this.timeouttime != null) this.timeouttime = ms(this.timeouttime);
880 this.autotoggle = (_ref4 = opts.toggle) != null ? _ref4 : false;
881 this.frametime = opts.frame;
882 if (this.frametime != null) this.frametime = ms(this.frametime);
883 this.queue = [];
884 this.running = false;
885 this.paused = false;
886 Animation.__super__.constructor.apply(this, arguments);
887 }
888
889 Animation.prototype.work_queue = function(started, dt, executiontime) {
890 var t, _base, _results;
891 t = now();
892 _results = [];
893 while (this.queue.length && t - started < executiontime) {
894 if (typeof (_base = this.queue.shift()) === "function") _base();
895 _results.push(t = now());
896 }
897 return _results;
898 };
899
900 Animation.prototype.push = function(callback) {
901 this.queue.push(callback);
902 if (this.running && this.autotoggle) return this.resume();
903 };
904
905 Animation.prototype.nextTick = function(callback) {
906 var request, t, tick, timeout, _ref2;
907 _ref2 = [null, null], timeout = _ref2[0], request = _ref2[1];
908 t = now();
909 tick = function(success) {
910 var dt, executiontime, started;
911 started = now();
912 dt = started - t;
913 if (success) {
914 executiontime = this.executiontime;
915 } else {
916 executiontime = this.timoutexecutiontime;
917 }
918 if (success) {
919 clearTimeout(timeout);
920 } else {
921 cancelAnimationFrame(request);
922 }
923 this.emit('tick', dt);
924 if (typeof callback === "function") callback(dt);
925 this.work_queue(started, dt, executiontime);
926 if (this.running && !this.paused) {
927 if (this.queue.length) {
928 return this.nextTick();
929 } else {
930 if (this.autotoggle) {
931 return this.pause();
932 } else {
933 return this.nextTick();
934 }
935 }
936 }
937 };
938 request = requestAnimationFrame(tick.bind(this, true), this.frametime);
939 if (this.timeouttime != null) {
940 return timeout = setTimeout(tick.bind(this, false), this.timeouttime);
941 }
942 };
943
944 Animation.prototype.start = function() {
945 if (this.running) return;
946 this.running = true;
947 this.emit('start');
948 if (!this.paused) {
949 if (this.autotoggle) {
950 if (this.queue.length) {
951 return this.nextTick();
952 } else {
953 return this.pause();
954 }
955 } else {
956 return this.nextTick();
957 }
958 }
959 };
960
961 Animation.prototype.stop = function() {
962 if (!this.running) return;
963 this.running = false;
964 return this.emit('stop');
965 };
966
967 Animation.prototype.pause = function() {
968 if (this.paused) return;
969 this.paused = true;
970 return this.emit('pause');
971 };
972
973 Animation.prototype.resume = function() {
974 if (!this.paused) return;
975 this.paused = false;
976 this.emit('resume');
977 if (this.running && (!this.autotoggle || this.queue.length === 1)) {
978 return this.nextTick();
979 }
980 };
981
982 return Animation;
983
984 })();
985
986}).call(this);
987
988});
989
990require.define("events", function (require, module, exports, __dirname, __filename) {
991 if (!process.EventEmitter) process.EventEmitter = function () {};
992
993var EventEmitter = exports.EventEmitter = process.EventEmitter;
994var isArray = typeof Array.isArray === 'function'
995 ? Array.isArray
996 : function (xs) {
997 return Object.toString.call(xs) === '[object Array]'
998 }
999;
1000
1001// By default EventEmitters will print a warning if more than
1002// 10 listeners are added to it. This is a useful default which
1003// helps finding memory leaks.
1004//
1005// Obviously not all Emitters should be limited to 10. This function allows
1006// that to be increased. Set to zero for unlimited.
1007var defaultMaxListeners = 10;
1008EventEmitter.prototype.setMaxListeners = function(n) {
1009 if (!this._events) this._events = {};
1010 this._events.maxListeners = n;
1011};
1012
1013
1014EventEmitter.prototype.emit = function(type) {
1015 // If there is no 'error' event listener then throw.
1016 if (type === 'error') {
1017 if (!this._events || !this._events.error ||
1018 (isArray(this._events.error) && !this._events.error.length))
1019 {
1020 if (arguments[1] instanceof Error) {
1021 throw arguments[1]; // Unhandled 'error' event
1022 } else {
1023 throw new Error("Uncaught, unspecified 'error' event.");
1024 }
1025 return false;
1026 }
1027 }
1028
1029 if (!this._events) return false;
1030 var handler = this._events[type];
1031 if (!handler) return false;
1032
1033 if (typeof handler == 'function') {
1034 switch (arguments.length) {
1035 // fast cases
1036 case 1:
1037 handler.call(this);
1038 break;
1039 case 2:
1040 handler.call(this, arguments[1]);
1041 break;
1042 case 3:
1043 handler.call(this, arguments[1], arguments[2]);
1044 break;
1045 // slower
1046 default:
1047 var args = Array.prototype.slice.call(arguments, 1);
1048 handler.apply(this, args);
1049 }
1050 return true;
1051
1052 } else if (isArray(handler)) {
1053 var args = Array.prototype.slice.call(arguments, 1);
1054
1055 var listeners = handler.slice();
1056 for (var i = 0, l = listeners.length; i < l; i++) {
1057 listeners[i].apply(this, args);
1058 }
1059 return true;
1060
1061 } else {
1062 return false;
1063 }
1064};
1065
1066// EventEmitter is defined in src/node_events.cc
1067// EventEmitter.prototype.emit() is also defined there.
1068EventEmitter.prototype.addListener = function(type, listener) {
1069 if ('function' !== typeof listener) {
1070 throw new Error('addListener only takes instances of Function');
1071 }
1072
1073 if (!this._events) this._events = {};
1074
1075 // To avoid recursion in the case that type == "newListeners"! Before
1076 // adding it to the listeners, first emit "newListeners".
1077 this.emit('newListener', type, listener);
1078
1079 if (!this._events[type]) {
1080 // Optimize the case of one listener. Don't need the extra array object.
1081 this._events[type] = listener;
1082 } else if (isArray(this._events[type])) {
1083
1084 // Check for listener leak
1085 if (!this._events[type].warned) {
1086 var m;
1087 if (this._events.maxListeners !== undefined) {
1088 m = this._events.maxListeners;
1089 } else {
1090 m = defaultMaxListeners;
1091 }
1092
1093 if (m && m > 0 && this._events[type].length > m) {
1094 this._events[type].warned = true;
1095 console.error('(node) warning: possible EventEmitter memory ' +
1096 'leak detected. %d listeners added. ' +
1097 'Use emitter.setMaxListeners() to increase limit.',
1098 this._events[type].length);
1099 console.trace();
1100 }
1101 }
1102
1103 // If we've already got an array, just append.
1104 this._events[type].push(listener);
1105 } else {
1106 // Adding the second element, need to change to array.
1107 this._events[type] = [this._events[type], listener];
1108 }
1109
1110 return this;
1111};
1112
1113EventEmitter.prototype.on = EventEmitter.prototype.addListener;
1114
1115EventEmitter.prototype.once = function(type, listener) {
1116 var self = this;
1117 self.on(type, function g() {
1118 self.removeListener(type, g);
1119 listener.apply(this, arguments);
1120 });
1121
1122 return this;
1123};
1124
1125EventEmitter.prototype.removeListener = function(type, listener) {
1126 if ('function' !== typeof listener) {
1127 throw new Error('removeListener only takes instances of Function');
1128 }
1129
1130 // does not use listeners(), so no side effect of creating _events[type]
1131 if (!this._events || !this._events[type]) return this;
1132
1133 var list = this._events[type];
1134
1135 if (isArray(list)) {
1136 var i = list.indexOf(listener);
1137 if (i < 0) return this;
1138 list.splice(i, 1);
1139 if (list.length == 0)
1140 delete this._events[type];
1141 } else if (this._events[type] === listener) {
1142 delete this._events[type];
1143 }
1144
1145 return this;
1146};
1147
1148EventEmitter.prototype.removeAllListeners = function(type) {
1149 // does not use listeners(), so no side effect of creating _events[type]
1150 if (type && this._events && this._events[type]) this._events[type] = null;
1151 return this;
1152};
1153
1154EventEmitter.prototype.listeners = function(type) {
1155 if (!this._events) this._events = {};
1156 if (!this._events[type]) this._events[type] = [];
1157 if (!isArray(this._events[type])) {
1158 this._events[type] = [this._events[type]];
1159 }
1160 return this._events[type];
1161};
1162
1163});
1164
1165require.define("/node_modules/dt-jquery/node_modules/animation/node_modules/request-animation-frame/package.json", function (require, module, exports, __dirname, __filename) {
1166 module.exports = {"name":"request-animation-frame","description":"requestAnimationFrame shim","version":"0.1.0","homepage":"https://github.com/dodo/requestAnimationFrame.js","author":"dodo (https://github.com/dodo)","repository":{"type":"git","url":"git://github.com/dodo/requestAnimationFrame.js.git"},"main":"shim.js","engines":{"node":">= 0.4.x"},"keywords":["request","animation","frame","shim","browser","polyfill"],"scripts":{"prepublish":"cake build"},"devDependencies":{"muffin":">= 0.2.6","coffee-script":">= 1.1.2"}}
1167});
1168
1169require.define("/node_modules/dt-jquery/node_modules/animation/node_modules/request-animation-frame/shim.js", function (require, module, exports, __dirname, __filename) {
1170
1171module.exports = require('./lib/shim')
1172
1173});
1174
1175require.define("/node_modules/dt-jquery/node_modules/animation/node_modules/request-animation-frame/lib/shim.js", function (require, module, exports, __dirname, __filename) {
1176 (function() {
1177 var _ref;
1178
1179 _ref = (function() {
1180 var cancel, isNative, last, request, vendor, _i, _len, _ref;
1181 last = 0;
1182 request = typeof window !== "undefined" && window !== null ? window.requestAnimationFrame : void 0;
1183 cancel = typeof window !== "undefined" && window !== null ? window.cancelAnimationFrame : void 0;
1184 _ref = ["webkit", "moz", "o", "ms"];
1185 for (_i = 0, _len = _ref.length; _i < _len; _i++) {
1186 vendor = _ref[_i];
1187 if (cancel == null) {
1188 cancel = (typeof window !== "undefined" && window !== null ? window["" + vendor + "cancelAnimationFrame"] : void 0) || (typeof window !== "undefined" && window !== null ? window["" + vendor + "cancelRequestAnimationFrame"] : void 0);
1189 }
1190 if ((request != null ? request : request = typeof window !== "undefined" && window !== null ? window["" + vendor + "RequestAnimationFrame"] : void 0)) {
1191 break;
1192 }
1193 }
1194 isNative = request != null;
1195 request = request != null ? request : function(callback, timeout) {
1196 var cur, id, time;
1197 if (timeout == null) timeout = 16;
1198 cur = new Date().getTime();
1199 time = Math.max(0, timeout + last - cur);
1200 id = setTimeout(function() {
1201 return typeof callback === "function" ? callback(cur + time) : void 0;
1202 }, time);
1203 last = cur + time;
1204 return id;
1205 };
1206 request.isNative = isNative;
1207 isNative = cancel != null;
1208 cancel = cancel != null ? cancel : function(id) {
1209 return clearTimeout(id);
1210 };
1211 cancel.isNative = isNative;
1212 return [request, cancel];
1213 })(), this.requestAnimationFrame = _ref[0], this.cancelAnimationFrame = _ref[1];
1214
1215}).call(this);
1216
1217});
1218
1219require.define("/node_modules/dt-jquery/node_modules/animation/node_modules/ms/package.json", function (require, module, exports, __dirname, __filename) {
1220 module.exports = {"name":"ms","version":"0.1.0","description":"Tiny ms conversion utility","main":"./ms","devDependencies":{"mocha":"*","expect.js":"*","serve":"*"}}
1221});
1222
1223require.define("/node_modules/dt-jquery/node_modules/animation/node_modules/ms/ms.js", function (require, module, exports, __dirname, __filename) {
1224 /**
1225
1226# ms.js
1227
1228No more painful `setTimeout(fn, 60 * 4 * 3 * 2 * 1 * Infinity * NaN * '☃')`.
1229
1230 ms('2d') // 172800000
1231 ms('1.5h') // 5400000
1232 ms('1h') // 3600000
1233 ms('1m') // 60000
1234 ms('5s') // 5000
1235 ms('500ms') // 500
1236 ms('100') // '100'
1237 ms(100) // 100
1238
1239**/
1240
1241(function (g) {
1242 var r = /(\d*.?\d+)([mshd]+)/
1243 , _ = {}
1244
1245 _.ms = 1;
1246 _.s = 1000;
1247 _.m = _.s * 60;
1248 _.h = _.m * 60;
1249 _.d = _.h * 24;
1250
1251 function ms (s) {
1252 if (s == Number(s)) return Number(s);
1253 r.exec(s.toLowerCase());
1254 return RegExp.$1 * _[RegExp.$2];
1255 }
1256
1257 g.top ? g.ms = ms : module.exports = ms;
1258})(this);
1259
1260});
1261;require('./list');}).call(this);
\No newline at end of file