UNPKG

36.2 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("/dt-jquery.js", function (require, module, exports, __dirname, __filename) {
320 (function() {
321 var Animation, EVENTS, JQueryAdapter, cancelable_and_retrivable_callbacks, deferred_callbacks, defineJQueryAPI, jqueryify, removed, singlton_callback, _ref;
322
323 Animation = require('animation').Animation;
324
325 _ref = require('./util'), singlton_callback = _ref.singlton_callback, deferred_callbacks = _ref.deferred_callbacks, cancelable_and_retrivable_callbacks = _ref.cancelable_and_retrivable_callbacks, removed = _ref.removed;
326
327 EVENTS = ['add', 'end', 'show', 'hide', 'attr', 'text', 'raw', 'remove', 'replace'];
328
329 defineJQueryAPI = function(el) {
330 el.__defineGetter__('selector', function() {
331 return el._jquery.selector;
332 });
333 return el.__defineGetter__('context', function() {
334 return el._jquery.context;
335 });
336 };
337
338 JQueryAdapter = (function() {
339
340 function JQueryAdapter(template, opts) {
341 var _ref2, _ref3, _ref4, _ref5, _ref6;
342 this.template = template;
343 if (opts == null) opts = {};
344 this.fn = this.fn();
345 this.builder = (_ref2 = this.template.xml) != null ? _ref2 : this.template;
346 if ((_ref3 = opts.timeoutexecution) == null) opts.timeoutexecution = '20ms';
347 if ((_ref4 = opts.execution) == null) opts.execution = '4ms';
348 if ((_ref5 = opts.timeout) == null) opts.timeout = '120ms';
349 if ((_ref6 = opts.toggle) == null) opts.toggle = true;
350 this.animation = new Animation(opts);
351 this.animation.start();
352 this.initialize();
353 }
354
355 JQueryAdapter.prototype.initialize = function() {
356 var old_query;
357 this.listen();
358 this.builder._jquery = $([]);
359 this.builder._jquery_done = deferred_callbacks();
360 this.builder._jquery_done.callback()();
361 old_query = this.builder.query;
362 this.builder.query = function(type, tag, key) {
363 var attr, attrs, domel, _i, _len, _ref2;
364 if (tag._jquery == null) return old_query.call(this, type, tag, key);
365 if (type === 'attr') {
366 return tag._jquery.attr(key);
367 } else if (type === 'text') {
368 return tag._jquery.text();
369 } else if (type === 'tag') {
370 if (key._jquery != null) {
371 return key;
372 } else {
373 if ((domel = key[0]) != null) {
374 attrs = {};
375 _ref2 = domel.attributes;
376 for (_i = 0, _len = _ref2.length; _i < _len; _i++) {
377 attr = _ref2[_i];
378 attrs[attr.name] = attr.value;
379 }
380 return new this.builder.Tag(domel.nodeName.toLowerCase(), attrs, function() {
381 this._jquery = key;
382 return this.end();
383 });
384 } else {
385 return old_query.call(this, type, tag, key);
386 }
387 }
388 }
389 };
390 return this.template.register('ready', function(tag, next) {
391 if (tag._jquery_ready === true) {
392 return next(tag);
393 } else {
394 return tag._jquery_ready = function() {
395 return next(tag);
396 };
397 }
398 });
399 };
400
401 JQueryAdapter.prototype.listen = function() {
402 var _this = this;
403 return EVENTS.forEach(function(event) {
404 return _this.template.on(event, _this["on" + event].bind(_this));
405 });
406 };
407
408 JQueryAdapter.prototype.fn = function() {
409 var _this = this;
410 return {
411 add: function(parent, el) {
412 var jq, notindom, _ref2, _ref3, _ref4, _ref5;
413 if (parent === parent.builder) {
414 notindom = ((_ref2 = (_ref3 = parent._jquery) != null ? _ref3.parents().length : void 0) != null ? _ref2 : 0) === 0;
415 jq = parent._jquery;
416 jq = jq.add(el._jquery);
417 parent.jquery = jq;
418 parent._jquery = jq;
419 parent.template.jquery = jq;
420 parent.template._jquery = jq;
421 if (notindom) {} else {
422 return (_ref4 = parent._jquery) != null ? _ref4.append(el._jquery) : void 0;
423 }
424 } else {
425 return (_ref5 = parent._jquery) != null ? _ref5.append(el._jquery) : void 0;
426 }
427 },
428 replace: function(oldtag, newtag) {
429 var _jquery, _ref2;
430 if (removed(newag)) return;
431 _jquery = (_ref2 = newtag._jquery) != null ? _ref2 : newtag;
432 oldtag._jquery.replaceWith(_jquery);
433 newtag._jquery = _jquery;
434 if (newtag === newtag.builder) return newtag.jquery = _jquery;
435 },
436 text: function(el, text) {
437 return el._jquery.text(text);
438 },
439 raw: function(el, html) {
440 return el._jquery.html(html);
441 },
442 attr: function(el, key, value) {
443 if (value === void 0) {
444 return el._jquery.removeAttr(key);
445 } else {
446 return el._jquery.attr(key, value);
447 }
448 },
449 show: function(el) {
450 return el._jquery.show();
451 },
452 hide: function(el) {
453 return el._jquery.hide();
454 },
455 remove: function(el) {
456 return el._jquery.remove();
457 }
458 };
459 };
460
461 JQueryAdapter.prototype.onadd = function(parent, el) {
462 var cb, tag, that, _base, _base2, _i, _len, _ref10, _ref2, _ref3, _ref4, _ref5, _ref6, _ref7, _ref8, _ref9;
463 if (removed(el)) return;
464 if (el === el.builder) {
465 if ((_ref2 = el._jquery) == null) {
466 el._jquery = $([], (_ref3 = el.parent) != null ? _ref3._jquery : void 0);
467 }
468 } else {
469 if ((_ref4 = el._jquery) == null) {
470 el._jquery = $(el.toString(), el.parent._jquery);
471 }
472 }
473 defineJQueryAPI(el);
474 that = this;
475 if ((_ref5 = el._jquery_manip) == null) {
476 el._jquery_manip = cancelable_and_retrivable_callbacks();
477 }
478 if ((_ref6 = el._jquery_done) == null) {
479 el._jquery_done = deferred_callbacks();
480 }
481 if ((_ref7 = parent._jquery_done) == null) {
482 parent._jquery_done = deferred_callbacks();
483 }
484 _ref8 = [parent, el];
485 for (_i = 0, _len = _ref8.length; _i < _len; _i++) {
486 tag = _ref8[_i];
487 cb = tag._jquery_done.callback();
488 if (tag === that.builder) {
489 cb();
490 } else {
491 tag.ready(cb);
492 }
493 }
494 if ((_ref9 = el._jquery_insert) == null) {
495 el._jquery_insert = singlton_callback(el, function() {
496 that.fn.add(this.parent, this);
497 if (typeof this._jquery_ready === "function") this._jquery_ready();
498 this._jquery_ready = true;
499 return this._jquery_insert = true;
500 });
501 }
502 if (typeof (_base = el._jquery_insert).replace === "function") {
503 _base.replace(el);
504 }
505 if ((_ref10 = el._jquery_parent_done) == null) {
506 el._jquery_parent_done = singlton_callback(el, function() {
507 if (removed(this)) return;
508 if (this.parent === that.builder) {
509 if (this.parent._jquery_insert === true) {
510 return that.animation.push(this._jquery_insert);
511 } else {
512 return typeof this._jquery_insert === "function" ? this._jquery_insert() : void 0;
513 }
514 } else {
515 return that.animation.push(this._jquery_insert);
516 }
517 });
518 }
519 if (typeof (_base2 = el._jquery_parent_done).replace === "function") {
520 _base2.replace(el);
521 }
522 return parent._jquery_done(el._jquery_parent_done);
523 };
524
525 JQueryAdapter.prototype.onreplace = function(oldtag, newtag) {
526 var cb, noreplacerequest, that, _base, _ref2, _ref3, _ref4, _ref5, _ref6, _ref7;
527 if ((_ref2 = newtag._jquery_parent_done) == null) {
528 newtag._jquery_parent_done = oldtag._jquery_parent_done;
529 }
530 if ((_ref3 = newtag._jquery_insert) == null) {
531 newtag._jquery_insert = oldtag._jquery_insert;
532 }
533 if ((_ref4 = newtag._jquery_done) == null) {
534 newtag._jquery_done = oldtag._jquery_done;
535 }
536 oldtag._jquery_parent_done = null;
537 oldtag._jquery_insert = null;
538 oldtag._jquery_done = null;
539 this.onadd(oldtag.parent, newtag);
540 if ((_ref5 = oldtag._jquery_manip) != null) {
541 if (typeof _ref5.cancel === "function") _ref5.cancel();
542 }
543 newtag._jquery_manip.reset();
544 while ((cb = newtag._jquery_manip.callbacks.shift()) != null) {
545 this.animation.push(cb);
546 }
547 if (newtag._jquery_insert === true) {
548 that = this;
549 if ((_ref6 = newtag._jquery_replace) == null) {
550 newtag._jquery_replace = oldtag._jquery_replace;
551 }
552 noreplacerequest = newtag._jquery_replace != null;
553 if ((_ref7 = newtag._jquery_replace) == null) {
554 newtag._jquery_replace = singlton_callback(newtag, function() {
555 return that.fn.replace(oldtag, this);
556 });
557 }
558 if (typeof (_base = newtag._jquery_replace).replace === "function") {
559 _base.replace(newtag);
560 }
561 oldtag._jquery_replace = null;
562 if (noreplacerequest) return this.animation.push(newtag._jquery_replace);
563 }
564 };
565
566 JQueryAdapter.prototype.ontext = function(el, text) {
567 var _this = this;
568 return this.animation.push(el._jquery_manip(function() {
569 return _this.fn.text(el, text);
570 }));
571 };
572
573 JQueryAdapter.prototype.onraw = function(el, html) {
574 var _this = this;
575 return this.animation.push(el._jquery_manip(function() {
576 return _this.fn.raw(el, html);
577 }));
578 };
579
580 JQueryAdapter.prototype.onattr = function(el, key, value) {
581 var _this = this;
582 return this.animation.push(el._jquery_manip(function() {
583 return _this.fn.attr(el, key, value);
584 }));
585 };
586
587 JQueryAdapter.prototype.onshow = function(el) {
588 return this.fn.show(el);
589 };
590
591 JQueryAdapter.prototype.onhide = function(el) {
592 return this.fn.hide(el);
593 };
594
595 JQueryAdapter.prototype.onremove = function(el) {
596 var _ref2;
597 if (el._jquery == null) return;
598 this.fn.remove(el);
599 el._jquery_done.reset();
600 if ((_ref2 = el._jquery_manip) != null) _ref2.cancel();
601 delete el._jquery_manip;
602 delete el._jquery_done;
603 return delete el._jquery;
604 };
605
606 JQueryAdapter.prototype.onend = function() {
607 this.template.jquery = this.template._jquery = this.builder._jquery;
608 return defineJQueryAPI(this.template);
609 };
610
611 return JQueryAdapter;
612
613 })();
614
615 jqueryify = function(tpl, opts) {
616 new JQueryAdapter(tpl, opts);
617 return tpl;
618 };
619
620 jqueryify.Adapter = JQueryAdapter;
621
622 module.exports = jqueryify;
623
624 if (process.title === 'browser') {
625 (function() {
626 if (this.dynamictemplate != null) {
627 return this.dynamictemplate.jqueryify = jqueryify;
628 } else {
629 return this.dynamictemplate = {
630 jqueryify: jqueryify
631 };
632 }
633 }).call(window);
634 }
635
636}).call(this);
637
638});
639
640require.define("/node_modules/animation/package.json", function (require, module, exports, __dirname, __filename) {
641 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"}}
642});
643
644require.define("/node_modules/animation/animation.js", function (require, module, exports, __dirname, __filename) {
645
646module.exports = require('./lib/animation')
647
648});
649
650require.define("/node_modules/animation/lib/animation.js", function (require, module, exports, __dirname, __filename) {
651 (function() {
652 var EventEmitter, cancelAnimationFrame, ms, now, requestAnimationFrame, _ref;
653 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; };
654
655 EventEmitter = require('events').EventEmitter;
656
657 _ref = require('request-animation-frame'), requestAnimationFrame = _ref.requestAnimationFrame, cancelAnimationFrame = _ref.cancelAnimationFrame;
658
659 ms = require('ms');
660
661 now = function() {
662 return new Date().getTime();
663 };
664
665 this.Animation = (function() {
666
667 __extends(Animation, EventEmitter);
668
669 function Animation(opts) {
670 var _ref2, _ref3, _ref4;
671 if (opts == null) opts = {};
672 this.nextTick = __bind(this.nextTick, this);
673 this.timoutexecutiontime = ms((_ref2 = opts.timeoutexecution) != null ? _ref2 : 20);
674 this.executiontime = ms((_ref3 = opts.execution) != null ? _ref3 : 5);
675 this.timeouttime = opts.timeout;
676 if (this.timeouttime != null) this.timeouttime = ms(this.timeouttime);
677 this.autotoggle = (_ref4 = opts.toggle) != null ? _ref4 : false;
678 this.frametime = opts.frame;
679 if (this.frametime != null) this.frametime = ms(this.frametime);
680 this.queue = [];
681 this.running = false;
682 this.paused = false;
683 Animation.__super__.constructor.apply(this, arguments);
684 }
685
686 Animation.prototype.work_queue = function(started, dt, executiontime) {
687 var t, _base, _results;
688 t = now();
689 _results = [];
690 while (this.queue.length && t - started < executiontime) {
691 if (typeof (_base = this.queue.shift()) === "function") _base();
692 _results.push(t = now());
693 }
694 return _results;
695 };
696
697 Animation.prototype.push = function(callback) {
698 this.queue.push(callback);
699 if (this.running && this.autotoggle) return this.resume();
700 };
701
702 Animation.prototype.nextTick = function(callback) {
703 var request, t, tick, timeout, _ref2;
704 _ref2 = [null, null], timeout = _ref2[0], request = _ref2[1];
705 t = now();
706 tick = function(success) {
707 var dt, executiontime, started;
708 started = now();
709 dt = started - t;
710 if (success) {
711 executiontime = this.executiontime;
712 } else {
713 executiontime = this.timoutexecutiontime;
714 }
715 if (success) {
716 clearTimeout(timeout);
717 } else {
718 cancelAnimationFrame(request);
719 }
720 this.emit('tick', dt);
721 if (typeof callback === "function") callback(dt);
722 this.work_queue(started, dt, executiontime);
723 if (this.running && !this.paused) {
724 if (this.queue.length) {
725 return this.nextTick();
726 } else {
727 if (this.autotoggle) {
728 return this.pause();
729 } else {
730 return this.nextTick();
731 }
732 }
733 }
734 };
735 request = requestAnimationFrame(tick.bind(this, true), this.frametime);
736 if (this.timeouttime != null) {
737 return timeout = setTimeout(tick.bind(this, false), this.timeouttime);
738 }
739 };
740
741 Animation.prototype.start = function() {
742 if (this.running) return;
743 this.running = true;
744 this.emit('start');
745 if (!this.paused) {
746 if (this.autotoggle) {
747 if (this.queue.length) {
748 return this.nextTick();
749 } else {
750 return this.pause();
751 }
752 } else {
753 return this.nextTick();
754 }
755 }
756 };
757
758 Animation.prototype.stop = function() {
759 if (!this.running) return;
760 this.running = false;
761 return this.emit('stop');
762 };
763
764 Animation.prototype.pause = function() {
765 if (this.paused) return;
766 this.paused = true;
767 return this.emit('pause');
768 };
769
770 Animation.prototype.resume = function() {
771 if (!this.paused) return;
772 this.paused = false;
773 this.emit('resume');
774 if (this.running && (!this.autotoggle || this.queue.length === 1)) {
775 return this.nextTick();
776 }
777 };
778
779 return Animation;
780
781 })();
782
783}).call(this);
784
785});
786
787require.define("events", function (require, module, exports, __dirname, __filename) {
788 if (!process.EventEmitter) process.EventEmitter = function () {};
789
790var EventEmitter = exports.EventEmitter = process.EventEmitter;
791var isArray = typeof Array.isArray === 'function'
792 ? Array.isArray
793 : function (xs) {
794 return Object.toString.call(xs) === '[object Array]'
795 }
796;
797
798// By default EventEmitters will print a warning if more than
799// 10 listeners are added to it. This is a useful default which
800// helps finding memory leaks.
801//
802// Obviously not all Emitters should be limited to 10. This function allows
803// that to be increased. Set to zero for unlimited.
804var defaultMaxListeners = 10;
805EventEmitter.prototype.setMaxListeners = function(n) {
806 if (!this._events) this._events = {};
807 this._events.maxListeners = n;
808};
809
810
811EventEmitter.prototype.emit = function(type) {
812 // If there is no 'error' event listener then throw.
813 if (type === 'error') {
814 if (!this._events || !this._events.error ||
815 (isArray(this._events.error) && !this._events.error.length))
816 {
817 if (arguments[1] instanceof Error) {
818 throw arguments[1]; // Unhandled 'error' event
819 } else {
820 throw new Error("Uncaught, unspecified 'error' event.");
821 }
822 return false;
823 }
824 }
825
826 if (!this._events) return false;
827 var handler = this._events[type];
828 if (!handler) return false;
829
830 if (typeof handler == 'function') {
831 switch (arguments.length) {
832 // fast cases
833 case 1:
834 handler.call(this);
835 break;
836 case 2:
837 handler.call(this, arguments[1]);
838 break;
839 case 3:
840 handler.call(this, arguments[1], arguments[2]);
841 break;
842 // slower
843 default:
844 var args = Array.prototype.slice.call(arguments, 1);
845 handler.apply(this, args);
846 }
847 return true;
848
849 } else if (isArray(handler)) {
850 var args = Array.prototype.slice.call(arguments, 1);
851
852 var listeners = handler.slice();
853 for (var i = 0, l = listeners.length; i < l; i++) {
854 listeners[i].apply(this, args);
855 }
856 return true;
857
858 } else {
859 return false;
860 }
861};
862
863// EventEmitter is defined in src/node_events.cc
864// EventEmitter.prototype.emit() is also defined there.
865EventEmitter.prototype.addListener = function(type, listener) {
866 if ('function' !== typeof listener) {
867 throw new Error('addListener only takes instances of Function');
868 }
869
870 if (!this._events) this._events = {};
871
872 // To avoid recursion in the case that type == "newListeners"! Before
873 // adding it to the listeners, first emit "newListeners".
874 this.emit('newListener', type, listener);
875
876 if (!this._events[type]) {
877 // Optimize the case of one listener. Don't need the extra array object.
878 this._events[type] = listener;
879 } else if (isArray(this._events[type])) {
880
881 // Check for listener leak
882 if (!this._events[type].warned) {
883 var m;
884 if (this._events.maxListeners !== undefined) {
885 m = this._events.maxListeners;
886 } else {
887 m = defaultMaxListeners;
888 }
889
890 if (m && m > 0 && this._events[type].length > m) {
891 this._events[type].warned = true;
892 console.error('(node) warning: possible EventEmitter memory ' +
893 'leak detected. %d listeners added. ' +
894 'Use emitter.setMaxListeners() to increase limit.',
895 this._events[type].length);
896 console.trace();
897 }
898 }
899
900 // If we've already got an array, just append.
901 this._events[type].push(listener);
902 } else {
903 // Adding the second element, need to change to array.
904 this._events[type] = [this._events[type], listener];
905 }
906
907 return this;
908};
909
910EventEmitter.prototype.on = EventEmitter.prototype.addListener;
911
912EventEmitter.prototype.once = function(type, listener) {
913 var self = this;
914 self.on(type, function g() {
915 self.removeListener(type, g);
916 listener.apply(this, arguments);
917 });
918
919 return this;
920};
921
922EventEmitter.prototype.removeListener = function(type, listener) {
923 if ('function' !== typeof listener) {
924 throw new Error('removeListener only takes instances of Function');
925 }
926
927 // does not use listeners(), so no side effect of creating _events[type]
928 if (!this._events || !this._events[type]) return this;
929
930 var list = this._events[type];
931
932 if (isArray(list)) {
933 var i = list.indexOf(listener);
934 if (i < 0) return this;
935 list.splice(i, 1);
936 if (list.length == 0)
937 delete this._events[type];
938 } else if (this._events[type] === listener) {
939 delete this._events[type];
940 }
941
942 return this;
943};
944
945EventEmitter.prototype.removeAllListeners = function(type) {
946 // does not use listeners(), so no side effect of creating _events[type]
947 if (type && this._events && this._events[type]) this._events[type] = null;
948 return this;
949};
950
951EventEmitter.prototype.listeners = function(type) {
952 if (!this._events) this._events = {};
953 if (!this._events[type]) this._events[type] = [];
954 if (!isArray(this._events[type])) {
955 this._events[type] = [this._events[type]];
956 }
957 return this._events[type];
958};
959
960});
961
962require.define("/node_modules/animation/node_modules/request-animation-frame/package.json", function (require, module, exports, __dirname, __filename) {
963 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"}}
964});
965
966require.define("/node_modules/animation/node_modules/request-animation-frame/shim.js", function (require, module, exports, __dirname, __filename) {
967
968module.exports = require('./lib/shim')
969
970});
971
972require.define("/node_modules/animation/node_modules/request-animation-frame/lib/shim.js", function (require, module, exports, __dirname, __filename) {
973 (function() {
974 var _ref;
975
976 _ref = (function() {
977 var cancel, isNative, last, request, vendor, _i, _len, _ref;
978 last = 0;
979 request = typeof window !== "undefined" && window !== null ? window.requestAnimationFrame : void 0;
980 cancel = typeof window !== "undefined" && window !== null ? window.cancelAnimationFrame : void 0;
981 _ref = ["webkit", "moz", "o", "ms"];
982 for (_i = 0, _len = _ref.length; _i < _len; _i++) {
983 vendor = _ref[_i];
984 if (cancel == null) {
985 cancel = (typeof window !== "undefined" && window !== null ? window["" + vendor + "cancelAnimationFrame"] : void 0) || (typeof window !== "undefined" && window !== null ? window["" + vendor + "cancelRequestAnimationFrame"] : void 0);
986 }
987 if ((request != null ? request : request = typeof window !== "undefined" && window !== null ? window["" + vendor + "RequestAnimationFrame"] : void 0)) {
988 break;
989 }
990 }
991 isNative = request != null;
992 request = request != null ? request : function(callback, timeout) {
993 var cur, id, time;
994 if (timeout == null) timeout = 16;
995 cur = new Date().getTime();
996 time = Math.max(0, timeout + last - cur);
997 id = setTimeout(function() {
998 return typeof callback === "function" ? callback(cur + time) : void 0;
999 }, time);
1000 last = cur + time;
1001 return id;
1002 };
1003 request.isNative = isNative;
1004 isNative = cancel != null;
1005 cancel = cancel != null ? cancel : function(id) {
1006 return clearTimeout(id);
1007 };
1008 cancel.isNative = isNative;
1009 return [request, cancel];
1010 })(), this.requestAnimationFrame = _ref[0], this.cancelAnimationFrame = _ref[1];
1011
1012}).call(this);
1013
1014});
1015
1016require.define("/node_modules/animation/node_modules/ms/package.json", function (require, module, exports, __dirname, __filename) {
1017 module.exports = {"name":"ms","version":"0.1.0","description":"Tiny ms conversion utility","main":"./ms","devDependencies":{"mocha":"*","expect.js":"*","serve":"*"}}
1018});
1019
1020require.define("/node_modules/animation/node_modules/ms/ms.js", function (require, module, exports, __dirname, __filename) {
1021 /**
1022
1023# ms.js
1024
1025No more painful `setTimeout(fn, 60 * 4 * 3 * 2 * 1 * Infinity * NaN * '☃')`.
1026
1027 ms('2d') // 172800000
1028 ms('1.5h') // 5400000
1029 ms('1h') // 3600000
1030 ms('1m') // 60000
1031 ms('5s') // 5000
1032 ms('500ms') // 500
1033 ms('100') // '100'
1034 ms(100) // 100
1035
1036**/
1037
1038(function (g) {
1039 var r = /(\d*.?\d+)([mshd]+)/
1040 , _ = {}
1041
1042 _.ms = 1;
1043 _.s = 1000;
1044 _.m = _.s * 60;
1045 _.h = _.m * 60;
1046 _.d = _.h * 24;
1047
1048 function ms (s) {
1049 if (s == Number(s)) return Number(s);
1050 r.exec(s.toLowerCase());
1051 return RegExp.$1 * _[RegExp.$2];
1052 }
1053
1054 g.top ? g.ms = ms : module.exports = ms;
1055})(this);
1056
1057});
1058
1059require.define("/util.js", function (require, module, exports, __dirname, __filename) {
1060 (function() {
1061 var cancelable_and_retrivable_callbacks, deferred_callbacks, removed, singlton_callback;
1062
1063 singlton_callback = function(that, callback) {
1064 var req;
1065 req = function() {
1066 return callback != null ? callback.apply(that, arguments) : void 0;
1067 };
1068 req.replace = function(replacement) {
1069 return that = replacement;
1070 };
1071 return req;
1072 };
1073
1074 deferred_callbacks = function() {
1075 var allowed, callbacks, done, res;
1076 done = false;
1077 callbacks = [];
1078 res = function(cb) {
1079 if (done) return typeof cb === "function" ? cb() : void 0;
1080 return callbacks.push(cb);
1081 };
1082 allowed = null;
1083 res.callback = function() {
1084 var callback;
1085 if (done) return (function() {});
1086 callback = function() {
1087 var cb;
1088 if (callback === allowed) {
1089 while ((cb = callbacks.shift()) != null) {
1090 if (typeof cb === "function") cb.apply(null, arguments);
1091 }
1092 callbacks = null;
1093 allowed = null;
1094 return done = true;
1095 }
1096 };
1097 allowed = callback;
1098 return callback;
1099 };
1100 res.reset = function() {
1101 allowed = null;
1102 callbacks = [];
1103 return done = false;
1104 };
1105 return res;
1106 };
1107
1108 cancelable_and_retrivable_callbacks = function() {
1109 var canceled, res;
1110 canceled = false;
1111 res = function(cb) {
1112 return function() {
1113 if (canceled) {
1114 return res.callbacks.push(cb);
1115 } else {
1116 return typeof cb === "function" ? cb.apply(null, arguments) : void 0;
1117 }
1118 };
1119 };
1120 res.cancel = function() {
1121 return canceled = true;
1122 };
1123 res.reset = function() {
1124 return canceled = false;
1125 };
1126 res.callbacks = [];
1127 return res;
1128 };
1129
1130 removed = function(el) {
1131 return el.closed === "removed";
1132 };
1133
1134 module.exports = {
1135 singlton_callback: singlton_callback,
1136 deferred_callbacks: deferred_callbacks,
1137 cancelable_and_retrivable_callbacks: cancelable_and_retrivable_callbacks,
1138 removed: removed
1139 };
1140
1141}).call(this);
1142
1143});
1144;require('./dt-jquery');}).call(this);
\No newline at end of file