Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Browse files

Ignoring node_modules

  • Loading branch information...
commit 91ddda1cfe9d8079b2e9dc791391e3e2a7fdd6ac 1 parent a723194
@jpdery authored
View
1  .gitignore
@@ -0,0 +1 @@
+/node_modules
View
1  node_modules/event-util/.npmignore
@@ -1 +0,0 @@
-/node_modules/
View
9 node_modules/event-util/Makefile
@@ -1,9 +0,0 @@
-all: build build-compress
-
-build:
- @wrup -r event-util ./ > event-util.js
- @echo "File written to 'event-util.js'"
-
-build-compress:
- @wrup -r event-util ./ > event-util.min.js --compress
- @echo "File written to 'event-util.min.js'"
View
1  node_modules/event-util/README.md
@@ -1 +0,0 @@
-TODO
View
373 node_modules/event-util/event-util.js
@@ -1,373 +0,0 @@
-(function(modules) {
- var cache = {}, require = function(id) {
- var module = cache[id];
- if (!module) {
- module = cache[id] = {};
- var exports = module.exports = {};
- modules[id].call(exports, require, module, exports, window);
- }
- return module.exports;
- };
- window["event-util"] = require("0");
-})({
- "0": function(require, module, exports, global) {
- "use strict";
- require("1");
- require("3");
- require("4");
- },
- "1": function(require, module, exports, global) {
- "use strict";
- var storage = require("2").createStorage();
- var customs = {};
- var dispatchEvent = Element.prototype.dispatchEvent;
- var addEventListener = Element.prototype.addEventListener;
- var removeEventListener = Element.prototype.removeEventListener;
- Element.prototype.dispatchEvent = function(event, data) {
- var custom = customs[event];
- if (custom) {
- var name = event;
- event = document.createEvent("CustomEvent");
- event.initCustomEvent(name, custom.bubbleable, custom.cancelable);
- custom.onDispatch.call(this, event, data || {});
- }
- return dispatchEvent.call(this, event);
- };
- Element.prototype.addEventListener = function(type, listener, capture) {
- var custom = customs[type];
- if (custom) {
- custom.onAdd.call(this);
- listener = validate(this, type, listener);
- var name = root(custom);
- if (name) addEventListener.call(this, name, dispatch(this, type, listener), capture);
- }
- return addEventListener.call(this, type, listener, capture);
- };
- Element.prototype.removeEventListener = function(type, listener, capture) {
- var custom = customs[type];
- if (custom) {
- custom.onRemove.call(this);
- listener = validate(this, type, listener);
- var name = root(custom);
- if (name) removeEventListener.call(this, name, dispatch(this, type, listener), capture);
- detach(this, type, listener);
- }
- return removeEventListener.call(this, type, listener, capture);
- };
- var defineCustomEvent = function(name, custom) {
- custom.base = "base" in custom ? custom.base : null;
- custom.condition = "condition" in custom ? custom.condition : true;
- custom.bubbleable = "bubbleable" in custom ? custom.bubbleable : true;
- custom.cancelable = "cancelable" in custom ? custom.cancelable : true;
- custom.onAdd = custom.onAdd || function() {};
- custom.onRemove = custom.onRemove || function() {};
- custom.onDispatch = custom.onDispatch || function() {};
- var base = customs[custom.base];
- customs[name] = base ? {
- base: base.base,
- condition: custom.condition,
- bubbleable: custom.bubbleable,
- cancelable: custom.cancelable,
- onAdd: inherit(custom, base, "onAdd"),
- onRemove: inherit(custom, base, "onRemove"),
- onDispatch: inherit(custom, base, "onDispatch")
- } : custom;
- };
- var inherit = function(custom, base, method) {
- return function() {
- base[method].apply(this, arguments);
- custom[method].apply(this, arguments);
- };
- };
- var root = function(custom) {
- var base = custom.base;
- if (base === null) return null;
- var parent = customs[base];
- if (parent) return root(parent);
- return base;
- };
- var passes = function(element, custom, e) {
- var condition = custom.condition;
- var succeeded = condition;
- if (typeof condition === "function") succeeded = condition.call(element, e);
- var base = customs[custom.base];
- if (base) return succeeded && passes(element, base, e);
- return succeeded;
- };
- var handler = function(element, type, listener) {
- var events = storage(element);
- if (events[type] === undefined) {
- events[type] = [];
- }
- events = events[type];
- for (var i = 0, l = events.length; i < l; i++) {
- var event = events[i];
- if (event.listener === listener) return event;
- }
- event = events[events.length] = {
- dispatch: null,
- validate: null,
- listener: listener
- };
- return event;
- };
- var detach = function(element, type, listener) {
- var events = storage(element);
- if (events[type] === undefined) return;
- events = events[type];
- for (var i = 0, l = events.length; i < l; i++) {
- var event = events[i];
- if (event.listener === listener) {
- events.splice(i, 1);
- }
- }
- return event;
- };
- var dispatch = function(element, type, listener) {
- var event = handler(element, type, listener);
- if (event.dispatch === null) {
- event.dispatch = function(e) {
- if (passes(element, customs[type], e)) element.dispatchEvent(type, e);
- };
- }
- return event.dispatch;
- };
- var validate = function(element, type, listener) {
- var event = handler(element, type, listener);
- if (event.validate === null) {
- event.validate = function(e) {
- if (e instanceof CustomEvent) listener.call(this, e);
- };
- }
- return event.validate;
- };
- module.exports = global.defineCustomEvent = defineCustomEvent;
- },
- "2": function(require, module, exports, global) {
- void function(global, undefined_, undefined) {
- var getProps = Object.getOwnPropertyNames, defProp = Object.defineProperty, toSource = Function.prototype.toString, create = Object.create, hasOwn = Object.prototype.hasOwnProperty, funcName = /^\n?function\s?(\w*)?_?\(/;
- function define(object, key, value) {
- if (typeof key === "function") {
- value = key;
- key = nameOf(value).replace(/_$/, "");
- }
- return defProp(object, key, {
- configurable: true,
- writable: true,
- value: value
- });
- }
- function nameOf(func) {
- return typeof func !== "function" ? "" : "name" in func ? func.name : toSource.call(func).match(funcName)[1];
- }
- var Data = function() {
- var dataDesc = {
- value: {
- writable: true,
- value: undefined
- }
- }, datalock = "return function(k){if(k===s)return l}", uids = create(null), createUID = function() {
- var key = Math.random().toString(36).slice(2);
- return key in uids ? createUID() : uids[key] = key;
- }, globalID = createUID(), storage = function(obj) {
- if (hasOwn.call(obj, globalID)) return obj[globalID];
- if (!Object.isExtensible(obj)) throw new TypeError("Object must be extensible");
- var store = create(null);
- defProp(obj, globalID, {
- value: store
- });
- return store;
- };
- define(Object, function getOwnPropertyNames(obj) {
- var props = getProps(obj);
- if (hasOwn.call(obj, globalID)) props.splice(props.indexOf(globalID), 1);
- return props;
- });
- function Data() {
- var puid = createUID(), secret = {};
- this.unlock = function(obj) {
- var store = storage(obj);
- if (hasOwn.call(store, puid)) return store[puid](secret);
- var data = create(null, dataDesc);
- defProp(store, puid, {
- value: (new Function("s", "l", datalock))(secret, data)
- });
- return data;
- };
- }
- define(Data.prototype, function get(o) {
- return this.unlock(o).value;
- });
- define(Data.prototype, function set(o, v) {
- this.unlock(o).value = v;
- });
- return Data;
- }();
- var WM = function(data) {
- var validate = function(key) {
- if (key == null || typeof key !== "object" && typeof key !== "function") throw new TypeError("Invalid WeakMap key");
- };
- var wrap = function(collection, value) {
- var store = data.unlock(collection);
- if (store.value) throw new TypeError("Object is already a WeakMap");
- store.value = value;
- };
- var unwrap = function(collection) {
- var storage = data.unlock(collection).value;
- if (!storage) throw new TypeError("WeakMap is not generic");
- return storage;
- };
- var initialize = function(weakmap, iterable) {
- if (iterable !== null && typeof iterable === "object" && typeof iterable.forEach === "function") {
- iterable.forEach(function(item, i) {
- if (item instanceof Array && item.length === 2) set.call(weakmap, iterable[i][0], iterable[i][1]);
- });
- }
- };
- function WeakMap(iterable) {
- if (this === global || this == null || this === WeakMap.prototype) return new WeakMap(iterable);
- wrap(this, new Data);
- initialize(this, iterable);
- }
- function get(key) {
- validate(key);
- var value = unwrap(this).get(key);
- return value === undefined_ ? undefined : value;
- }
- function set(key, value) {
- validate(key);
- unwrap(this).set(key, value === undefined ? undefined_ : value);
- }
- function has(key) {
- validate(key);
- return unwrap(this).get(key) !== undefined;
- }
- function delete_(key) {
- validate(key);
- var data = unwrap(this), had = data.get(key) !== undefined;
- data.set(key, undefined);
- return had;
- }
- function toString() {
- unwrap(this);
- return "[object WeakMap]";
- }
- try {
- var src = ("return " + delete_).replace("e_", "\\u0065"), del = (new Function("unwrap", "validate", src))(unwrap, validate);
- } catch (e) {
- var del = delete_;
- }
- var src = ("" + Object).split("Object");
- var stringifier = function toString() {
- return src[0] + nameOf(this) + src[1];
- };
- define(stringifier, stringifier);
- var prep = {
- __proto__: []
- } instanceof Array ? function(f) {
- f.__proto__ = stringifier;
- } : function(f) {
- define(f, stringifier);
- };
- prep(WeakMap);
- [ toString, get, set, has, del ].forEach(function(method) {
- define(WeakMap.prototype, method);
- prep(method);
- });
- return WeakMap;
- }(new Data);
- var defaultCreator = Object.create ? function() {
- return Object.create(null);
- } : function() {
- return {};
- };
- function createStorage(creator) {
- var weakmap = new WM;
- creator || (creator = defaultCreator);
- function storage(object, value) {
- if (value || arguments.length === 2) {
- weakmap.set(object, value);
- } else {
- value = weakmap.get(object);
- if (value === undefined) {
- value = creator(object);
- weakmap.set(object, value);
- }
- }
- return value;
- }
- return storage;
- }
- if (typeof module !== "undefined") {
- module.exports = WM;
- } else if (typeof exports !== "undefined") {
- exports.WeakMap = WM;
- } else if (!("WeakMap" in global)) {
- global.WeakMap = WM;
- }
- WM.createStorage = createStorage;
- if (global.WeakMap) global.WeakMap.createStorage = createStorage;
- }((0, eval)("this"));
- },
- "3": function(require, module, exports, global) {
- "use strict";
- var defineCustomEvent = require("1");
- var elem = document.createElement("div");
- var base = null;
- var keys = {
- WebkitTransition: "webkitTransitionEnd",
- MozTransition: "transitionend",
- OTransition: "oTransitionEnd",
- msTransition: "MSTransitionEnd",
- transition: "transitionend"
- };
- for (var key in keys) {
- if (key in elem.style) base = keys[key];
- }
- var onDispatch = function(custom, data) {
- custom.propertyName = data.propertyName;
- custom.elapsedTime = data.elapsedTime;
- custom.pseudoElement = data.pseudoElement;
- };
- defineCustomEvent("transitionend", {
- base: base,
- onDispatch: onDispatch
- });
- defineCustomEvent("owntransitionend", {
- base: "transitionend",
- condition: function(e) {
- return e.target === this;
- }
- });
- },
- "4": function(require, module, exports, global) {
- "use strict";
- var defineCustomEvent = require("1");
- var elem = document.createElement("div");
- var base = null;
- var keys = {
- WebkitAnimation: "webkitAnimationEnd",
- MozAnimation: "animationend",
- OAnimation: "oAnimationEnd",
- msAnimation: "MSAnimationEnd",
- animation: "animationend"
- };
- for (var key in keys) {
- if (key in elem.style) base = keys[key];
- }
- var onDispatch = function(custom, data) {
- custom.animationName = data.animationName;
- custom.elapsedTime = data.elapsedTime;
- };
- defineCustomEvent("transitionend", {
- base: base,
- onDispatch: onDispatch
- });
- defineCustomEvent("ownanimationend", {
- base: "animation",
- condition: function(e) {
- return e.target === this;
- }
- });
- }
-});
View
1  node_modules/event-util/event-util.min.js
@@ -1 +0,0 @@
-(function(a){var b={},c=function(d){var e=b[d];if(!e){e=b[d]={};var f=e.exports={};a[d].call(f,c,e,f,window)}return e.exports};window["event-util"]=c("0")})({0:function(a,b,c,d){"use strict",a("1"),a("3"),a("4")},1:function(a,b,c,d){"use strict";var e=a("2").createStorage(),f={},g=Element.prototype.dispatchEvent,h=Element.prototype.addEventListener,i=Element.prototype.removeEventListener;Element.prototype.dispatchEvent=function(a,b){var c=f[a];if(c){var d=a;a=document.createEvent("CustomEvent"),a.initCustomEvent(d,c.bubbleable,c.cancelable),c.onDispatch.call(this,a,b||{})}return g.call(this,a)},Element.prototype.addEventListener=function(a,b,c){var d=f[a];if(d){d.onAdd.call(this),b=q(this,a,b);var e=l(d);e&&h.call(this,e,p(this,a,b),c)}return h.call(this,a,b,c)},Element.prototype.removeEventListener=function(a,b,c){var d=f[a];if(d){d.onRemove.call(this),b=q(this,a,b);var e=l(d);e&&i.call(this,e,p(this,a,b),c),o(this,a,b)}return i.call(this,a,b,c)};var j=function(a,b){b.base="base"in b?b.base:null,b.condition="condition"in b?b.condition:!0,b.bubbleable="bubbleable"in b?b.bubbleable:!0,b.cancelable="cancelable"in b?b.cancelable:!0,b.onAdd=b.onAdd||function(){},b.onRemove=b.onRemove||function(){},b.onDispatch=b.onDispatch||function(){};var c=f[b.base];f[a]=c?{base:c.base,condition:b.condition,bubbleable:b.bubbleable,cancelable:b.cancelable,onAdd:k(b,c,"onAdd"),onRemove:k(b,c,"onRemove"),onDispatch:k(b,c,"onDispatch")}:b},k=function(a,b,c){return function(){b[c].apply(this,arguments),a[c].apply(this,arguments)}},l=function(a){var b=a.base;if(b===null)return null;var c=f[b];return c?l(c):b},m=function(a,b,c){var d=b.condition,e=d;typeof d=="function"&&(e=d.call(a,c));var g=f[b.base];return g?e&&m(a,g,c):e},n=function(a,b,c){var d=e(a);d[b]===undefined&&(d[b]=[]),d=d[b];for(var f=0,g=d.length;f<g;f++){var h=d[f];if(h.listener===c)return h}return h=d[d.length]={dispatch:null,validate:null,listener:c},h},o=function(a,b,c){var d=e(a);if(d[b]===undefined)return;d=d[b];for(var f=0,g=d.length;f<g;f++){var h=d[f];h.listener===c&&d.splice(f,1)}return h},p=function(a,b,c){var d=n(a,b,c);return d.dispatch===null&&(d.dispatch=function(c){m(a,f[b],c)&&a.dispatchEvent(b,c)}),d.dispatch},q=function(a,b,c){var d=n(a,b,c);return d.validate===null&&(d.validate=function(a){a instanceof CustomEvent&&c.call(this,a)}),d.validate};b.exports=d.defineCustomEvent=j},2:function(require,module,exports,global){void function(a,b,c){function j(a,b,c){return typeof b=="function"&&(c=b,b=k(c).replace(/_$/,"")),e(a,b,{configurable:!0,writable:!0,value:c})}function k(a){return typeof a!="function"?"":"name"in a?a.name:f.call(a).match(i)[1]}function o(a){function d(d,e){return e||arguments.length===2?b.set(d,e):(e=b.get(d),e===c&&(e=a(d),b.set(d,e))),e}var b=new m;return a||(a=n),d}var d=Object.getOwnPropertyNames,e=Object.defineProperty,f=Function.prototype.toString,g=Object.create,h=Object.prototype.hasOwnProperty,i=/^\n?function\s?(\w*)?_?\(/,l=function(){function m(){var c=i(),d={};this.unlock=function(f){var i=l(f);if(h.call(i,c))return i[c](d);var j=g(null,a);return e(i,c,{value:(new Function("s","l",b))(d,j)}),j}}var a={value:{writable:!0,value:c}},b="return function(k){if(k===s)return l}",f=g(null),i=function(){var a=Math.random().toString(36).slice(2);return a in f?i():f[a]=a},k=i(),l=function(a){if(h.call(a,k))return a[k];if(!Object.isExtensible(a))throw new TypeError("Object must be extensible");var b=g(null);return e(a,k,{value:b}),b};return j(Object,function(b){var c=d(b);return h.call(b,k)&&c.splice(c.indexOf(k),1),c}),j(m.prototype,function(b){return this.unlock(b).value}),j(m.prototype,function(b,c){this.unlock(b).value=c}),m}(),m=function(d){function i(b){if(this===a||this==null||this===i.prototype)return new i(b);f(this,new l),h(this,b)}function m(a){e(a);var d=g(this).get(a);return d===b?c:d}function n(a,d){e(a),g(this).set(a,d===c?b:d)}function o(a){return e(a),g(this).get(a)!==c}function p(a){e(a);var b=g(this),d=b.get(a)!==c;return b.set(a,c),d}function q(){return g(this),"[object WeakMap]"}var e=function(a){if(a==null||typeof a!="object"&&typeof a!="function")throw new TypeError("Invalid WeakMap key")},f=function(a,b){var c=d.unlock(a);if(c.value)throw new TypeError("Object is already a WeakMap");c.value=b},g=function(a){var b=d.unlock(a).value;if(!b)throw new TypeError("WeakMap is not generic");return b},h=function(a,b){b!==null&&typeof b=="object"&&typeof b.forEach=="function"&&b.forEach(function(c,d){c instanceof Array&&c.length===2&&n.call(a,b[d][0],b[d][1])})};try{var r=("return "+p).replace("e_","\\u0065"),s=(new Function("unwrap","validate",r))(g,e)}catch(t){var s=p}var r=(""+Object).split("Object"),u=function w(){return r[0]+k(this)+r[1]};j(u,u);var v={__proto__:[]}instanceof Array?function(a){a.__proto__=u}:function(a){j(a,u)};return v(i),[q,m,n,o,s].forEach(function(a){j(i.prototype,a),v(a)}),i}(new l),n=Object.create?function(){return Object.create(null)}:function(){return{}};typeof module!="undefined"?module.exports=m:typeof exports!="undefined"?exports.WeakMap=m:"WeakMap"in a||(a.WeakMap=m),m.createStorage=o,a.WeakMap&&(a.WeakMap.createStorage=o)}((0,eval)("this"))},3:function(a,b,c,d){"use strict";var e=a("1"),f=document.createElement("div"),g=null,h={WebkitTransition:"webkitTransitionEnd",MozTransition:"transitionend",OTransition:"oTransitionEnd",msTransition:"MSTransitionEnd",transition:"transitionend"};for(var i in h)i in f.style&&(g=h[i]);var j=function(a,b){a.propertyName=b.propertyName,a.elapsedTime=b.elapsedTime,a.pseudoElement=b.pseudoElement};e("transitionend",{base:g,onDispatch:j}),e("owntransitionend",{base:"transitionend",condition:function(a){return a.target===this}})},4:function(a,b,c,d){"use strict";var e=a("1"),f=document.createElement("div"),g=null,h={WebkitAnimation:"webkitAnimationEnd",MozAnimation:"animationend",OAnimation:"oAnimationEnd",msAnimation:"MSAnimationEnd",animation:"animationend"};for(var i in h)i in f.style&&(g=h[i]);var j=function(a,b){a.animationName=b.animationName,a.elapsedTime=b.elapsedTime};e("transitionend",{base:g,onDispatch:j}),e("ownanimationend",{base:"animation",condition:function(a){return a.target===this}})}})
View
33 node_modules/event-util/lib/css-animation.js
@@ -1,33 +0,0 @@
-"use strict"
-
-var defineCustomEvent = require('./define-custom-event')
-
-var elem = document.createElement('div')
-var base = null
-var keys = {
- 'WebkitAnimation' : 'webkitAnimationEnd',
- 'MozAnimation' : 'animationend',
- 'OAnimation' : 'oAnimationEnd',
- 'msAnimation' : 'MSAnimationEnd',
- 'animation' : 'animationend'
-}
-
-for (var key in keys) {
- if (key in elem.style) base = keys[key];
-}
-
-var onDispatch = function(custom, data) {
- custom.animationName = data.animationName
- custom.elapsedTime = data.elapsedTime
-}
-
-defineCustomEvent('transitionend', {
- base: base,
- onDispatch: onDispatch
-})
-
-defineCustomEvent('ownanimationend', {
- base: 'animation',
- condition: function(e) { return e.target === this }
-})
-
View
33 node_modules/event-util/lib/css-transition.js
@@ -1,33 +0,0 @@
-"use strict"
-
-var defineCustomEvent = require('./define-custom-event')
-
-var elem = document.createElement('div')
-var base = null
-var keys = {
- 'WebkitTransition' : 'webkitTransitionEnd',
- 'MozTransition' : 'transitionend',
- 'OTransition' : 'oTransitionEnd',
- 'msTransition' : 'MSTransitionEnd',
- 'transition' : 'transitionend'
-}
-
-for (var key in keys) {
- if (key in elem.style) base = keys[key];
-}
-
-var onDispatch = function(custom, data) {
- custom.propertyName = data.propertyName
- custom.elapsedTime = data.elapsedTime
- custom.pseudoElement = data.pseudoElement
-}
-
-defineCustomEvent('transitionend', {
- base: base,
- onDispatch: onDispatch
-})
-
-defineCustomEvent('owntransitionend', {
- base: 'transitionend',
- condition: function(e) { return e.target === this }
-})
View
150 node_modules/event-util/lib/define-custom-event.js
@@ -1,150 +0,0 @@
-"use strict"
-
-var storage = require('WeakMap').createStorage()
-
-var customs = {}
-
-var dispatchEvent = Element.prototype.dispatchEvent
-var addEventListener = Element.prototype.addEventListener
-var removeEventListener = Element.prototype.removeEventListener
-
-Element.prototype.dispatchEvent = function(event, data) {
-
- var custom = customs[event]
- if (custom) {
- var name = event
- event = document.createEvent('CustomEvent')
- event.initCustomEvent(name, custom.bubbleable, custom.cancelable)
- custom.onDispatch.call(this, event, data || {})
- }
-
- return dispatchEvent.call(this, event)
-}
-
-Element.prototype.addEventListener = function(type, listener, capture) {
-
- var custom = customs[type]
- if (custom) {
- custom.onAdd.call(this)
- listener = validate(this, type, listener)
- var name = root(custom)
- if (name) addEventListener.call(this, name, dispatch(this, type, listener), capture)
- }
-
- return addEventListener.call(this, type, listener, capture)
-}
-
-Element.prototype.removeEventListener = function(type, listener, capture) {
-
- var custom = customs[type]
- if (custom) {
- custom.onRemove.call(this)
- listener = validate(this, type, listener)
- var name = root(custom)
- if (name) removeEventListener.call(this, name, dispatch(this, type, listener), capture)
- detach(this, type, listener)
- }
-
- return removeEventListener.call(this, type, listener, capture)
-}
-
-var defineCustomEvent = function(name, custom) {
-
- custom.base = 'base' in custom ? custom.base : null
- custom.condition = 'condition' in custom ? custom.condition : true
- custom.bubbleable = 'bubbleable' in custom ? custom.bubbleable : true
- custom.cancelable = 'cancelable' in custom ? custom.cancelable : true
-
- custom.onAdd = custom.onAdd || function(){}
- custom.onRemove = custom.onRemove || function(){}
- custom.onDispatch = custom.onDispatch || function(){}
-
- var base = customs[custom.base]
-
- customs[name] = base ? {
- base: base.base,
- condition: custom.condition,
- bubbleable: custom.bubbleable,
- cancelable: custom.cancelable,
- onAdd: inherit(custom, base, 'onAdd'),
- onRemove: inherit(custom, base, 'onRemove'),
- onDispatch: inherit(custom, base, 'onDispatch')
- } : custom
-}
-
-var inherit = function(custom, base, method) {
- return function() {
- base[method].apply(this, arguments)
- custom[method].apply(this, arguments)
- }
-}
-
-var root = function(custom) {
- var base = custom.base
- if (base === null) return null
- var parent = customs[base]
- if (parent) return root(parent)
- return base;
-}
-
-var passes = function(element, custom, e) {
- var condition = custom.condition
- var succeeded = condition
- if (typeof condition === 'function') succeeded = condition.call(element, e)
- var base = customs[custom.base]
- if (base) return succeeded && passes(element, base, e)
- return succeeded
-}
-
-var handler = function(element, type, listener) {
- var events = storage(element)
- if (events[type] === undefined) {
- events[type] = []
- }
- events = events[type]
- for (var i = 0, l = events.length; i < l; i++) {
- var event = events[i]
- if (event.listener === listener) return event
- }
- event = events[events.length] = {
- dispatch: null,
- validate: null,
- listener: listener
- }
- return event
-}
-
-var detach = function(element, type, listener) {
- var events = storage(element)
- if (events[type] === undefined) return
- events = events[type]
- for (var i = 0, l = events.length; i < l; i++) {
- var event = events[i]
- if (event.listener === listener) {
- events.splice(i, 1)
- }
- }
- return event
-}
-
-var dispatch = function(element, type, listener) {
- var event = handler(element, type, listener)
- if (event.dispatch === null) {
- event.dispatch = function(e) {
- if (passes(element, customs[type], e)) element.dispatchEvent(type, e)
- }
- }
- return event.dispatch
-}
-
-var validate = function(element, type, listener) {
- var event = handler(element, type, listener)
- if (event.validate === null) {
- event.validate = function(e) {
- if (e instanceof CustomEvent) listener.call(this, e)
- }
- }
- return event.validate
-}
-
-module.exports = global.defineCustomEvent = defineCustomEvent
View
4 node_modules/event-util/lib/index.js
@@ -1,4 +0,0 @@
-"use strict"
-require('./define-custom-event')
-require('./css-transition')
-require('./css-animation')
View
94 node_modules/event-util/node_modules/weakmap/README.md
@@ -1,94 +0,0 @@
-# WeakMap Shim
-This is a standalone shim for WeakMap, separated out from the full Harmony Collections shim at https://github.com/Benvie/harmony-collections. WeakMap is by far the most useful new addition. If you only need to use objects as keys then uou can use this much more compact library that doesn't have to implement three other classes.
-
-## Compatability
-
-Works with IE9+, Chrome, Firefox, Safari, untested in Opera.
-
-## Install/Use
-
-If using node, install via:
-
- npm install weakmap
-
-In the browser, include __weakmap.js__ or __weakmap.min.js__ and WeakMap will be exposed on the window.
-
-## Overview
-
-WeakMaps provide a new core weapon to your JS arsenal: objects as keys. This allows you to do the following awesome things: store private data "on" public objects, private properties, secretly "tag" objects, namespace properties, access controlled properties, check object uniqueness in `O(1)` time complexity.
-
-### WeakMap Garbage Collection Semantics
-
-A benefit of using WeakMaps is enhanced garbage collection. In a WeakMap, the only reference created is key -> value, so it's possible for a key/value in a WeakMap to be garbage collected while the WeakMap they're in still exists! Compare this to an Array, where all items in the Array will not be garbage collected as long as the Array isn't. This forces either explicit management of object lifespans or, more commonly, simply results in memory leaks.
-
-For example, data stored using jQuery.data can never be garbage collected unless explicitly nulled out, because it is stored in a container that strongly references the items held inside. Using a WeakMap, it's possible to associate data with an element and have the data destroyed when the element is -- without memory leaking the element; i.e. `weakmap.set(element, { myData: 'gc safe!' })`. jQuery.data (every library has similar functionality) prevents the *element* from memory leaking by using a numeric id, but this does nothing for the __data__ that is stored.
-
-## Example
-
-```javascript
-// reusable storage creator
-function createStorage(){
- var store = new WeakMap;
- return function(o){
- var v = store.get(o);
- if (!v) store.set(o, v = {});
- return v;
- };
-}
-
-// allows private/namespaced properties for the objects
-var _ = createStorage();
-
-functioon Wrapper(element){
- var _element = _(element);
- if (_element.wrapper)
- return _element.wrapper;
-
- _element.wrapper = this;
- _(this).element = element;
-}
-
-Wrapper.prototype = {
- get classes(){
- return [].slice.call(_(this).element.classList);
- },
- set classes(v){
- _(this).element.className = [].concat(v).join(' ');
- }
-};
-```
-
-
-## API Reference
-
-* WeakMaps may be inherited from. Initialize objects via `WeakMap.call(obj)`.
-
-### WeakMap
-
-__Non-primitives__ are valid keys. Objects, functions, DOM nodes, etc.
-
-WeakMaps require the use of objects as keys; primitives are not valid keys. WeakMaps have no way to enumerate their keys or values. Because of this, the only way to retrieve a value from a WeakMap is to have access to both the WeakMap itself as well as an object used as a key.
-
-* `new WeakMap(iterable)` Create a new WeakMap populated with the iterable. Accepts *[[Key, Value]...]*, *Array*, *Iterable*.
-* `WeakMap#set(key, value)` Key must be non-primitive. Returns undefined.
-* `WeakMap#get(key)` Returns the value that key corresponds to the key or undefined.
-* `WeakMap#has(key)` Returns boolean.
-* `WeakMap#delete(key)` Removes the value from the collection and returns boolean indicating if there was a value to delete.
-
-
-## License
-
-(The MIT License)
-Copyright (c) 2012 Brandon Benvie <http://bbenvie.com>
-
-Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files
-(the 'Software'), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge,
-publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so,
-subject to the following conditions:
-
-The above copyright notice and this permission notice shall be included with all copies or substantial portions of the Software.
-
-THE SOFTWARE IS PROVIDED 'AS IS', WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
-MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE
-FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH
-THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
View
30 node_modules/event-util/node_modules/weakmap/package.json
@@ -1,30 +0,0 @@
-{
- "author": {
- "name": "Brandon Benvie",
- "email": "http://bbenvie.com"
- },
- "name": "weakmap",
- "description": "Shim for WeakMap with non-leaky O(1) lookup time",
- "keywords": [
- "harmony",
- "collection",
- "weakmap",
- "ecmascript",
- "es6",
- "shim",
- "garbage collection",
- "gc"
- ],
- "version": "0.0.6",
- "homepage": "http://benvie.github.com/WeakMap",
- "repository": {
- "type": "git",
- "url": "https://github.com/Benvie/WeakMap"
- },
- "main": "weakmap.js",
- "license": "MIT",
- "readme": "# WeakMap Shim\nThis is a standalone shim for WeakMap, separated out from the full Harmony Collections shim at https://github.com/Benvie/harmony-collections. WeakMap is by far the most useful new addition. If you only need to use objects as keys then uou can use this much more compact library that doesn't have to implement three other classes.\n\n## Compatability\n\nWorks with IE9+, Chrome, Firefox, Safari, untested in Opera.\n\n## Install/Use\n\nIf using node, install via:\n\n npm install weakmap\n\nIn the browser, include __weakmap.js__ or __weakmap.min.js__ and WeakMap will be exposed on the window.\n\n## Overview\n\nWeakMaps provide a new core weapon to your JS arsenal: objects as keys. This allows you to do the following awesome things: store private data \"on\" public objects, private properties, secretly \"tag\" objects, namespace properties, access controlled properties, check object uniqueness in `O(1)` time complexity.\n\n### WeakMap Garbage Collection Semantics\n\nA benefit of using WeakMaps is enhanced garbage collection. In a WeakMap, the only reference created is key -> value, so it's possible for a key/value in a WeakMap to be garbage collected while the WeakMap they're in still exists! Compare this to an Array, where all items in the Array will not be garbage collected as long as the Array isn't. This forces either explicit management of object lifespans or, more commonly, simply results in memory leaks.\n\nFor example, data stored using jQuery.data can never be garbage collected unless explicitly nulled out, because it is stored in a container that strongly references the items held inside. Using a WeakMap, it's possible to associate data with an element and have the data destroyed when the element is -- without memory leaking the element; i.e. `weakmap.set(element, { myData: 'gc safe!' })`. jQuery.data (every library has similar functionality) prevents the *element* from memory leaking by using a numeric id, but this does nothing for the __data__ that is stored.\n\n## Example\n\n```javascript\n// reusable storage creator\nfunction createStorage(){\n var store = new WeakMap;\n return function(o){\n var v = store.get(o);\n if (!v) store.set(o, v = {});\n return v;\n };\n}\n\n// allows private/namespaced properties for the objects\nvar _ = createStorage();\n\nfunctioon Wrapper(element){\n var _element = _(element);\n if (_element.wrapper)\n return _element.wrapper;\n\n _element.wrapper = this;\n _(this).element = element;\n}\n\nWrapper.prototype = {\n get classes(){\n return [].slice.call(_(this).element.classList);\n },\n set classes(v){\n _(this).element.className = [].concat(v).join(' ');\n }\n};\n```\n\n\n## API Reference\n\n* WeakMaps may be inherited from. Initialize objects via `WeakMap.call(obj)`.\n\n### WeakMap\n\n__Non-primitives__ are valid keys. Objects, functions, DOM nodes, etc.\n\nWeakMaps require the use of objects as keys; primitives are not valid keys. WeakMaps have no way to enumerate their keys or values. Because of this, the only way to retrieve a value from a WeakMap is to have access to both the WeakMap itself as well as an object used as a key.\n\n* `new WeakMap(iterable)` Create a new WeakMap populated with the iterable. Accepts *[[Key, Value]...]*, *Array*, *Iterable*.\n* `WeakMap#set(key, value)` Key must be non-primitive. Returns undefined.\n* `WeakMap#get(key)` Returns the value that key corresponds to the key or undefined.\n* `WeakMap#has(key)` Returns boolean.\n* `WeakMap#delete(key)` Removes the value from the collection and returns boolean indicating if there was a value to delete.\n\n\n## License\n\n(The MIT License)\nCopyright (c) 2012 Brandon Benvie <http://bbenvie.com>\n\nPermission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files\n(the 'Software'), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge,\npublish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so,\nsubject to the following conditions:\n\nThe above copyright notice and this permission notice shall be included with all copies or substantial portions of the Software.\n\nTHE SOFTWARE IS PROVIDED 'AS IS', WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF\nMERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE\nFOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH\nTHE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.\n",
- "readmeFilename": "README.md",
- "_id": "weakmap@0.0.6",
- "_from": "weakmap@0.0.6"
-}
View
240 node_modules/event-util/node_modules/weakmap/weakmap.js
@@ -1,240 +0,0 @@
-/* (The MIT License)
- *
- * Copyright (c) 2012 Brandon Benvie <http://bbenvie.com>
- *
- * Permission is hereby granted, free of charge, to any person obtaining a copy of this software and
- * associated documentation files (the 'Software'), to deal in the Software without restriction,
- * including without limitation the rights to use, copy, modify, merge, publish, distribute,
- * sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is
- * furnished to do so, subject to the following conditions:
- *
- * The above copyright notice and this permission notice shall be included with all copies or
- * substantial portions of the Software.
- *
- * THE SOFTWARE IS PROVIDED 'AS IS', WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING
- * BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
- * NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM,
- * DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
- * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
- */
-
-// Original WeakMap implementation by Gozala @ https://gist.github.com/1269991
-// Updated and bugfixed by Raynos @ https://gist.github.com/1638059
-// Expanded by Benvie @ https://github.com/Benvie/harmony-collections
-
-void function(global, undefined_, undefined){
- var getProps = Object.getOwnPropertyNames,
- defProp = Object.defineProperty,
- toSource = Function.prototype.toString,
- create = Object.create,
- hasOwn = Object.prototype.hasOwnProperty,
- funcName = /^\n?function\s?(\w*)?_?\(/;
-
-
- function define(object, key, value){
- if (typeof key === 'function') {
- value = key;
- key = nameOf(value).replace(/_$/, '');
- }
- return defProp(object, key, { configurable: true, writable: true, value: value });
- }
-
- function nameOf(func){
- return typeof func !== 'function'
- ? '' : 'name' in func
- ? func.name : toSource.call(func).match(funcName)[1];
- }
-
- // ############
- // ### Data ###
- // ############
-
- var Data = (function(){
- var dataDesc = { value: { writable: true, value: undefined } },
- datalock = 'return function(k){if(k===s)return l}',
- uids = create(null),
-
- createUID = function(){
- var key = Math.random().toString(36).slice(2);
- return key in uids ? createUID() : uids[key] = key;
- },
-
- globalID = createUID(),
-
- storage = function(obj){
- if (hasOwn.call(obj, globalID))
- return obj[globalID];
-
- if (!Object.isExtensible(obj))
- throw new TypeError("Object must be extensible");
-
- var store = create(null);
- defProp(obj, globalID, { value: store });
- return store;
- };
-
- // common per-object storage area made visible by patching getOwnPropertyNames'
- define(Object, function getOwnPropertyNames(obj){
- var props = getProps(obj);
- if (hasOwn.call(obj, globalID))
- props.splice(props.indexOf(globalID), 1);
- return props;
- });
-
- function Data(){
- var puid = createUID(),
- secret = {};
-
- this.unlock = function(obj){
- var store = storage(obj);
- if (hasOwn.call(store, puid))
- return store[puid](secret);
-
- var data = create(null, dataDesc);
- defProp(store, puid, {
- value: new Function('s', 'l', datalock)(secret, data)
- });
- return data;
- }
- }
-
- define(Data.prototype, function get(o){ return this.unlock(o).value });
- define(Data.prototype, function set(o, v){ this.unlock(o).value = v });
-
- return Data;
- }());
-
-
- var WM = (function(data){
- var validate = function(key){
- if (key == null || typeof key !== 'object' && typeof key !== 'function')
- throw new TypeError("Invalid WeakMap key");
- }
-
- var wrap = function(collection, value){
- var store = data.unlock(collection);
- if (store.value)
- throw new TypeError("Object is already a WeakMap");
- store.value = value;
- }
-
- var unwrap = function(collection){
- var storage = data.unlock(collection).value;
- if (!storage)
- throw new TypeError("WeakMap is not generic");
- return storage;
- }
-
- var initialize = function(weakmap, iterable){
- if (iterable !== null && typeof iterable === 'object' && typeof iterable.forEach === 'function') {
- iterable.forEach(function(item, i){
- if (item instanceof Array && item.length === 2)
- set.call(weakmap, iterable[i][0], iterable[i][1]);
- });
- }
- }
-
-
- function WeakMap(iterable){
- if (this === global || this == null || this === WeakMap.prototype)
- return new WeakMap(iterable);
-
- wrap(this, new Data);
- initialize(this, iterable);
- }
-
- function get(key){
- validate(key);
- var value = unwrap(this).get(key);
- return value === undefined_ ? undefined : value;
- }
-
- function set(key, value){
- validate(key);
- // store a token for explicit undefined so that "has" works correctly
- unwrap(this).set(key, value === undefined ? undefined_ : value);
- }
-
- function has(key){
- validate(key);
- return unwrap(this).get(key) !== undefined;
- }
-
- function delete_(key){
- validate(key);
- var data = unwrap(this),
- had = data.get(key) !== undefined;
- data.set(key, undefined);
- return had;
- }
-
- function toString(){
- unwrap(this);
- return '[object WeakMap]';
- }
-
- try {
- var src = ('return '+delete_).replace('e_', '\\u0065'),
- del = new Function('unwrap', 'validate', src)(unwrap, validate);
- } catch (e) {
- var del = delete_;
- }
-
- var src = (''+Object).split('Object');
- var stringifier = function toString(){
- return src[0] + nameOf(this) + src[1];
- };
-
- define(stringifier, stringifier);
-
- var prep = { __proto__: [] } instanceof Array
- ? function(f){ f.__proto__ = stringifier }
- : function(f){ define(f, stringifier) };
-
- prep(WeakMap);
-
- [toString, get, set, has, del].forEach(function(method){
- define(WeakMap.prototype, method);
- prep(method);
- });
-
- return WeakMap;
- }(new Data));
-
- var defaultCreator = Object.create
- ? function(){ return Object.create(null) }
- : function(){ return {} };
-
- function createStorage(creator){
- var weakmap = new WM;
- creator || (creator = defaultCreator);
-
- function storage(object, value){
- if (value || arguments.length === 2) {
- weakmap.set(object, value);
- } else {
- value = weakmap.get(object);
- if (value === undefined) {
- value = creator(object);
- weakmap.set(object, value);
- }
- }
- return value;
- }
-
- return storage;
- }
-
-
- if (typeof module !== 'undefined') {
- module.exports = WM;
- } else if (typeof exports !== 'undefined') {
- exports.WeakMap = WM;
- } else if (!('WeakMap' in global)) {
- global.WeakMap = WM;
- }
-
- WM.createStorage = createStorage;
- if (global.WeakMap)
- global.WeakMap.createStorage = createStorage;
-}((0, eval)('this'));
View
6 node_modules/event-util/node_modules/weakmap/weakmap.min.js
@@ -1,6 +0,0 @@
-/* (The MIT License)
- *
- * Copyright (c) 2012 Brandon Benvie <http://bbenvie.com>
- */
-
-void function(c,h,a){function define(c,a,b){return typeof a==='function'&&(b=a,a=nameOf(b).replace(/_$/,'')),e(c,a,{configurable:!0,writable:!0,value:b})}function nameOf(a){return typeof a!=='function'?'':'name'in a?a.name:i.call(a).match(j)[1]}function createStorage(b){function storage(e,d){return d||arguments.length===2?c.set(e,d):(d=c.get(e),d===a&&(d=b(e),c.set(e,d))),d}var c=new WeakMap;return b||(b=k),storage}var l=Object.getOwnPropertyNames,e=Object.defineProperty,i=Function.prototype.toString,f=Object.create,g=Object.prototype.hasOwnProperty,j=/^\n?function\s?(\w*)?_?\(/;var b=function(){function b(){var a=d(),c={};this.unlock=function(h){var b=k(h);if(g.call(b,a))return b[a](c);var d=f(null,i);return e(b,a,{value:new Function('s','l',j)(c,d)}),d}}var i={value:{writable:!0,value:a}},j='return function(k){if(k===s)return l}',h=f(null),d=function(){var a=Math.random().toString(36).slice(2);return a in h?d():h[a]=a},c=d(),k=function(a){if(g.call(a,c))return a[c];if(!Object.isExtensible(a))throw new TypeError('Object must be extensible');var b=f(null);return e(a,c,{value:b}),b};return define(Object,function getOwnPropertyNames(b){var a=l(b);return g.call(b,c)&&a.splice(a.indexOf(c),1),a}),define(b.prototype,function get(a){return this.unlock(a).value}),define(b.prototype,function set(a,b){this.unlock(a).value=b}),b}();var d=function(i){function WeakMap(a){if(this===c||this==null||this===WeakMap.prototype)return new WeakMap(a);l(this,new b),m(this,a)}function get(b){e(b);var c=d(this).get(b);return c===h?a:c}function set(b,c){e(b),d(this).set(b,c===a?h:c)}function has(b){return e(b),d(this).get(b)!==a}function delete_(b){e(b);var c=d(this),f=c.get(b)!==a;return c.set(b,a),f}function toString(){return d(this),'[object WeakMap]'}var e=function(a){if(a==null||typeof a!=='object'&&typeof a!=='function')throw new TypeError('Invalid WeakMap key')};var l=function(b,c){var a=i.unlock(b);if(a.value)throw new TypeError('Object is already a WeakMap');a.value=c};var d=function(b){var a=i.unlock(b).value;if(!a)throw new TypeError('WeakMap is not generic');return a};var m=function(b,a){a!==null&&typeof a==='object'&&typeof a.forEach==='function'&&a.forEach(function(c,d){c instanceof Array&&c.length===2&&set.call(b,a[d][0],a[d][1])})};try{var f=('return '+delete_).replace('e_','\\u0065'),j=new Function('unwrap','validate',f)(d,e)}catch(a){var j=delete_}var f=(''+Object).split('Object');var g=function toString(){return f[0]+nameOf(this)+f[1]};define(g,g);var k={__proto__:[]}instanceof Array?function(a){a.__proto__=g}:function(a){define(a,g)};return k(WeakMap),[toString,get,set,has,j].forEach(function(a){define(WeakMap.prototype,a),k(a)}),WeakMap}(new b);var k=Object.create?function(){return Object.create(null)}:function(){return{}};typeof module!=='undefined'?module.exports=d:typeof exports!=='undefined'?exports.WeakMap=d:!('WeakMap'in c)&&(c.WeakMap=d),d.createStorage=createStorage,c.WeakMap&&(c.WeakMap.createStorage=createStorage)}((0,eval)('this'))
View
38 node_modules/event-util/package.json
@@ -1,38 +0,0 @@
-{
- "name": "event-util",
- "description": "Utilities to create custom events. Inspired by @cpojer's Element.defineCustomEvent",
- "version": "0.0.1",
- "main": "lib/index.js",
- "license": "MIT",
- "keywords": [
- "event",
- "custom-events",
- "pseudo-events"
- ],
- "author": {
- "name": "Jean-Philippe Dery",
- "email": "jeanphilippe.dery@gmail.com"
- },
- "bugs": "https://github.com/jpdery/event-util/issues",
- "repository": {
- "type": "git",
- "url": "https://github.com/jpdery/event-util.git"
- },
- "dependencies": {
- "weakmap": "0.0.6"
- },
- "devDependencies": {
- "mocha": "1.6",
- "expect.js": "0.1"
- },
- "engines": {
- "node": "*"
- },
- "readme": "TODO",
- "readmeFilename": "README.md",
- "_id": "event-util@0.0.1",
- "dist": {
- "shasum": "bb1084c5f175731b204fd555f4b743894a028ae5"
- },
- "_from": "event-util@git://github.com/jpdery/event-util.git"
-}
Please sign in to comment.
Something went wrong with that request. Please try again.