New Case Study:See how Anthropic automated 95% of dependency reviews with Socket.Learn More
Socket
Sign inDemoInstall
Socket

eventi

Package Overview
Dependencies
Maintainers
1
Versions
23
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

eventi - npm Package Compare versions

Comparing version 0.6.0 to 0.6.1

2

bower.json
{
"name": "eventi",
"version": "0.6.0",
"version": "0.6.1",
"homepage": "https://github.com/nbubna/Eventi",

@@ -5,0 +5,0 @@ "bugs": "https://github.com/nbubna/nbubna/issues",

{
"name": "eventi",
"repo": "nbubna/Eventi",
"version": "0.6.0",
"version": "0.6.1",
"keywords": [

@@ -6,0 +6,0 @@ "event",

@@ -1,2 +0,2 @@

/*! Eventi - v0.6.0 - 2014-03-04
/*! Eventi - v0.6.0 - 2014-03-06
* https://github.com/nbubna/Eventi

@@ -271,3 +271,5 @@ * Copyright (c) 2014 ESHA Research; Licensed MIT */

aS = 'atchesSelector';
Object.defineProperty(Ep, 'matches', {value:Ep['webkitM'+aS]||Ep['mozM'+aS]||Ep['msM'+aS]});
if (!Ep['matches']) {
Object.defineProperty(Ep, 'matches', {value:Ep['webkitM'+aS]||Ep['mozM'+aS]||Ep['msM'+aS]});
}
}

@@ -452,3 +454,4 @@

});
var h = global.history;
var h = global.history,
l = global.location;
_.pushState = h.pushState;

@@ -461,3 +464,2 @@ h.pushState = function() {

Eventi.on('!popstate !hashchange !pushstate', _.at = function(e, uri) {
var l = global.location;
uri = uri || decodeURI(l.pathname + l.search + l.hash);

@@ -482,5 +484,8 @@ if (uri !== _.uri) {

}
e.uri = uri;
if (uri !== _.uri) {
h.pushState(null,null, encodeURI(uri));
}
} else if (!e.uri) {
e.uri = _.uri;
}

@@ -490,22 +495,26 @@ })

if (handler.match.type === "location") {
// overloading on.js' selector argument with uri template/regex
var re = handler.selector;
delete handler.selector;
if (typeof re === "string") {
re = re.replace(/([.*+?^=!:$(|\[\/\\])/g, "\\$1");
if (handler.keys = _.keys(re)) {
re = re.replace(/\{\w+\}/g, "([^\/?#]+)");
} else {
re.replace(/\{/g, '\\{');
// always listen on window, but save given target to use as context
handler._target = handler.target;
handler.target = _.global;
if (handler.selector) {
// overloading on.js' selector argument with uri template/regex
var re = handler.selector;
delete handler.selector;
if (typeof re === "string") {
re = re.replace(/([.*+?^=!:$(|\[\/\\])/g, "\\$1");
if (handler.keys = _.keys(re)) {
re = re.replace(/\{\w+\}/g, "([^\/?#]+)");
} else {
re.replace(/\{/g, '\\{');
}
re = new RegExp(re);
}
re = new RegExp(re);
handler.regexp = re;
} else {
handler.regexp = /.+/;
}
handler.regexp = re;
// always listen on window, but use given target as context
handler._target = handler.target;
handler.target = _.global;
handler._fn = handler.fn;
handler.fn = function(e){ _.location(e.uri, handler, arguments); };
// try for current uri match immediately
_.execute(null, new Eventi('location',{uri:_.uri}), handler);
_.execute(null, new Eventi('location',{uri:_.uri||_.at()}), handler);
}

@@ -520,3 +529,3 @@ });

_.location = function(uri, handler, args) {
var matches = uri.match(handler.regexp);
var matches = (uri||_.uri).match(handler.regexp);
if (matches) {

@@ -523,0 +532,0 @@ args = _.slice(args);

@@ -1,4 +0,4 @@

/*! Eventi - v0.6.0 - 2014-03-04
/*! Eventi - v0.6.0 - 2014-03-06
* https://github.com/nbubna/Eventi
* Copyright (c) 2014 ESHA Research; Licensed MIT */
!function(global,document){"use strict";function Eventi(){return _.create.apply(this,arguments)}global.CustomEvent||(global.CustomEvent=document?function(a,b){b=b||{};var c=document.createEvent("CustomEvent");return c.initCustomEvent(a,!!b.bubbles,!!b.cancelable,b.detail),c}:function(a,b){b=b||{},this.type=a,this.bubbles=!!b.bubbles,this.detail=b.detail,this.timestamp=Date.now()});var _={global:new Function("return this")(),noop:function(){},slice:function(a,b){return Array.prototype.slice.call(a,b)},copy:function(a,b,c){if(a)for(c in a)a.hasOwnProperty(c)&&(b[c]=a[c])},async:global.setImmediate||function(a){return setTimeout(a,0)},resolveRE:/^([\w\$]+)?((\.[\w\$]+)|\[(\d+|'(\\'|[^'])+'|"(\\"|[^"])+")\])*$/,resolve:function(reference,context){return _.resolveRE.test(reference)?(context=context||global,eval("context"+("["!==reference.charAt(0)?"."+reference:reference))):void 0},create:function(a,b){var c={text:a+""};a=_.parse(c.text,c),_.copy(b,c),"bubbles"in c||(c.bubbles=!0);var d=new CustomEvent(a,c);for(var e in c)_.skip.indexOf(e)<0&&(d[_.prop(e)]=c[e]);return d},skip:"bubbles cancelable detail type".split(" "),prop:function(a){return a},parse:function(a,b){return _.properties.forEach(function(c){a=a.replace(c[0],function(){return c[1].apply(b,arguments)||""})}),a?b.type=a:a},properties:[[/^_/,function(){this.bubbles=!1}],[/^\!/,function(){this._protect=!0}],[/\((.*)\)/,function(a,b){try{this.detail=_.resolve(b)||JSON.parse(b)}catch(c){this.detail=b}}],[/#(\w+)/g,function(a,b){(this.tags||(this.tags=[])).push(b),this[b]=!0}],[/^(\w+):/,function(a,b){this.category=b}]],splitRE:/ (?![^\(\)]*\))+/g,wrap:function(a,b,c){c=c||1;var d=function(d){var e=_.slice(arguments);d&&"string"!=typeof d||(d=this&&this!==Eventi?this:_.global,e.unshift(d)),e[c]=e[c]?(e[c]+"").split(_.splitRE):[""],e.length>b&&(e[b]=e.slice(b),e=e.slice(0,b+1));var f,g=_[a];if("length"in d&&d!==_.global)for(var h=0,i=d.length;i>h;h++)f=g.apply(e[0]=d[h],e);else f=g.apply(d,e);return void 0===f?this:f};return d.index=c,d}};Eventi._=_,(Eventi.fy=function(a){for(var b in Eventi){var c=Eventi[b];"function"!=typeof c||c.utility||Object.defineProperty(a,b,{value:c,writable:!0,configurable:!0})}return a}).utility=!0,_.fire=function(a,b,c,d){return"object"!=typeof c||c instanceof Event||!("bubbles"in c||"detail"in c||"cancelable"in c)?(void 0!==c&&(d=d?d.unshift(c)&&d:[c]),c={data:d}):c.data=d,_.fireAll(a,b,c)},_.fireAll=function(a,b,c){for(var d,e=0;e<b.length;e++)d=_.create(b[e],c),_.dispatch(a,d);return d},_.dispatch=function(a,b,c){(a.dispatchEvent||a[_key]||_.noop).call(a,b),a.parentObject&&b.bubbles&&!b.propagationStopped&&_.dispatch(a.parentObject,b,!0),!c&&b._singleton&&_.singleton(a,b)},Eventi.fire=_.wrap("fire",3),_.on=function(a,b,c,d,e){"function"==typeof c&&(void 0!==d&&(e=e?e.unshift(d)&&e:[d]),d=c,c=null);for(var f=0,g=b.length;g>f;f++)_.handler(a,b[f],c,d,e)},_.handler=function(a,b,c,d,e){var f={target:a,selector:c,fn:d,data:e,text:b,match:{}};return _.parse(b,f.match),delete f.match.tags,a!==_&&Eventi.fire(_,"handler#new",f),f.fn!==_.noop&&_.handlers(f.target,f.match.type).push(f),f},_.handlers=function(a,b){var c=_.listener(a),d=c.s[b];return d||(d=c.s[b]=[],a.addEventListener&&a.addEventListener(b,c)),d};var _key=_._key="_eventi"+Date.now();if(_.listener=function(a){var b=a[_key];return b||(b=function(a){var c=b.s[a.type];c&&_.handle(a,c)},b.s={},Object.defineProperty(a,_key,{value:b,writeable:!1,configurable:!0})),b},_.handle=function(a,b){for(var c,d,e=0;e<b.length&&!(_.matches(a,(c=b[e]).match)&&(d=_.target(c,a.target))&&(_.execute(d,a,c),a.immediatePropagationStopped));e++);},_.execute=function(a,b,c){var d=[b];b.data&&d.push.apply(d,b.data),c.data&&d.push.apply(d,c.data);try{c.fn.apply(a,d)}catch(e){_.async(function(){throw e})}},_.unhandle=function(a){a.fn=_.noop},_.matches=function(a,b,c){for(var d in b)if(b[d]!==a[d]&&(c||"_"!==d.charAt(0)))return!1;if(c)for(d in a)if("_"===d.charAt(0)&&a[d]!==b[d])return!1;return!0},_.target=function(a,b){return a.selector?_.closest(b,a.selector):a.target},_.closest=function(a,b){for(;a&&a.matches;){if(a.matches(b))return a;a=a.parentNode}},global.Element){var Ep=Element.prototype,aS="atchesSelector";Object.defineProperty(Ep,"matches",{value:Ep["webkitM"+aS]||Ep["mozM"+aS]||Ep["msM"+aS]})}Eventi.on=_.wrap("on",4),document&&(_.init=function(){for(var a=document.querySelectorAll("[data-eventi]"),b=0,c=a.length;c>b;b++){var d=a[b],e=d.getAttribute("data-eventi");e&&_.declare(e,d)}(a.length||document.querySelectorAll("[click]").length)&&Eventi.on("click keyup",_.check)},_.declare=function(a,b){for(var c=a.split(_.splitRE),d=0,e=c.length;e>d;d++){var f=c[d],g=f.lastIndexOf("="),h=g>0?f.substring(g+1):void 0,i="/"===f.charAt(0),j=i?_.global:b;b=b||document,h&&(f=f.substring(0,g)),i&&(f=f.substring(1)),Eventi.on(j,f,_.mapped,b,h)}},_.mapped=function(a,b,c){for(var d=c||a.type,e=_.declarers(b,d,this!==_.global&&a.target),f=0,g=e.length;g>f;f++)_.declared(e[f],d,a)},_.declarers=function(a,b,c){var d="["+b+"]";if(c){for(var e=[];c&&c.matches&&c!==a.parentNode;)c.matches(d)&&e.push(c),c=c.parentNode;return e}return a.querySelectorAll(d)},_.declared=function(a,b,c){var d=a.getAttribute(b);d&&(d=_.resolve(d,a)||_.resolve(d)||d,"function"==typeof d?d.call(a,c):Eventi.fire(a,d,c))},_.check=function(a){("click"===a.type&&_.click(a.target)||13===a.keyCode&&_.click(a.target,!0))&&(_.mapped(a,document.documentElement,"click"),_.allowDefault(a)||a.preventDefault())},_.allowDefault=function(a){var b=a.target.type;return b&&("radio"===b||"checkbox"===b)},_.click=function(a,b){var c=a.getAttribute("click");if(c&&"false"!==c)return!0;if(!a.isContentEditable){var d=a.nodeName.toLowerCase();if("textarea"!==d&&d!==(b?"button":"select")){var e=_.buttonRE.test(a.type);return b?!(e||"a"===d&&a.getAttribute("href")):e||"input"!==d}}},_.buttonRE=/^(submit|button|reset)$/,Eventi.on("DOMContentLoaded",_.init)),_.properties.unshift([/^\^/,function(){this._singleton=!0}]),_.singleton=function(a,b){_.remember(a,b),b.bubbles&&!b.propagationStopped&&a!==_.global&&_.singleton(a.parentNode||a.parentObject||_.global,b)};var _skey=_._skey="^"+_key;_.remember=function(a,b){var c=a[_skey]||[];c.length||Object.defineProperty(a,_skey,{value:c,configurable:!0}),b[_skey]=!0,c.push(b)},Eventi.on(_,"handler#new",function(a,b){if(b.match._singleton){var c=b._fn=b.fn;b.fn=function(a){_.unhandle(b),a[_skey]||_.remember(b.target,a),c.apply(this,arguments)};for(var d=b.target[_skey]||[],e=0,f=d.length;f>e;e++){var g=d[e];if(_.matches(g,b.match)){var h=_.target(b,g.target);if(h){_.execute(h,g,b),b.fn=_.noop;break}}}}}),document&&Eventi.on("DOMContentLoaded",function(a){_.fire(document.documentElement,["^ready"],void 0,[a])}),_.keyRE=/\[([a-z-0-9,\.\/\[\`\\\]\']+)\]/,_.properties.push([_.keyRE,function(a,b){for(var c,d;(c=b.indexOf("-"))>0;)d=b.substring(0,c),b=b.substring(c+1),this[(_.special[d]||d)+"Key"]=!0;this.keyCode=_.codes[b]||parseInt(b,10)||0}]),_.special={command:"meta",apple:"meta"},_.codes={backspace:8,tab:9,enter:13,shift:16,ctrl:17,alt:18,capsLock:20,escape:27,start:91,command:224,pageUp:33,pageDown:34,end:35,home:36,left:37,up:38,right:39,down:40,insert:45,"delete":46,multiply:106,plus:107,minus:109,point:110,divide:111,numLock:144,",":188,".":190,"/":191,"`":192,"[":219,"\\":220,"]":221,"'":222,space:32};for(var n=0;10>n;n++)_.codes["num"+n]=96+n;for(var f=1;13>f;f++)_.codes["f"+f]=111+f;"abcdefghijklmnopqrstuvwxyz 0123456789".split("").forEach(function(a){_.codes[a]=a.toUpperCase().charCodeAt(0)});var h=global.history;_.pushState=h.pushState,h.pushState=function(){var a=_.pushState.apply(this,arguments);return _.dispatch(_.global,new Eventi("pushstate",{uri:arguments[2]})),a},Eventi.on("!popstate !hashchange !pushstate",_.at=function(a,b){var c=global.location;return b=b||decodeURI(c.pathname+c.search+c.hash),b!==_.uri&&_.dispatch(_.global,new Eventi("location",{oldURI:_.uri,uri:_.uri=b,srcEvent:a})),b}).on("!location",function(a,b,c){if("string"==typeof b){var d=_.keys(b);d&&(b=d.reduce(function(a,b){return a.replace(new RegExp("\\{"+b+"\\}","g"),c[b]||global.location[b]||"")},b)),b!==_.uri&&h.pushState(null,null,encodeURI(b))}}).on(_,"handler#new",function(a,b){if("location"===b.match.type){var c=b.selector;delete b.selector,"string"==typeof c&&(c=c.replace(/([.*+?^=!:$(|\[\/\\])/g,"\\$1"),(b.keys=_.keys(c))?c=c.replace(/\{\w+\}/g,"([^/?#]+)"):c.replace(/\{/g,"\\{"),c=new RegExp(c)),b.regexp=c,b._target=b.target,b.target=_.global,b._fn=b.fn,b.fn=function(a){_.location(a.uri,b,arguments)},_.execute(null,new Eventi("location",{uri:_.uri}),b)}}),_.keys=function(a){var b=a.match(/\{\w+\}/g);return b&&b.map(function(a){return a.substring(1,a.length-1)})},_.location=function(a,b,c){var d=a.match(b.regexp);d&&(c=_.slice(c),c.splice.apply(c,[1,0].concat(d)),b.keys&&(c[1]=b.keys.reduce(function(a,b){return a[b]=d.shift(),a},{match:d.shift()})),b._fn.apply(b._target,c))},_.version="0.6.0";var sP=Event&&Event.prototype.stopPropagation||_.noop,sIP=Event&&Event.prototype.stopImmediatePropagation||_.noop;CustomEvent.prototype.stopPropagation=function(){this.propagationStopped=!0,sP.call(this)},CustomEvent.prototype.stopImmediatePropagation=function(){this.immediatePropagationStopped=!0,sIP.call(this)};var define=global.define||_.noop;define((global.exports||global).Eventi=Eventi)}(this,this.document);
!function(global,document){"use strict";function Eventi(){return _.create.apply(this,arguments)}global.CustomEvent||(global.CustomEvent=document?function(a,b){b=b||{};var c=document.createEvent("CustomEvent");return c.initCustomEvent(a,!!b.bubbles,!!b.cancelable,b.detail),c}:function(a,b){b=b||{},this.type=a,this.bubbles=!!b.bubbles,this.detail=b.detail,this.timestamp=Date.now()});var _={global:new Function("return this")(),noop:function(){},slice:function(a,b){return Array.prototype.slice.call(a,b)},copy:function(a,b,c){if(a)for(c in a)a.hasOwnProperty(c)&&(b[c]=a[c])},async:global.setImmediate||function(a){return setTimeout(a,0)},resolveRE:/^([\w\$]+)?((\.[\w\$]+)|\[(\d+|'(\\'|[^'])+'|"(\\"|[^"])+")\])*$/,resolve:function(reference,context){return _.resolveRE.test(reference)?(context=context||global,eval("context"+("["!==reference.charAt(0)?"."+reference:reference))):void 0},create:function(a,b){var c={text:a+""};a=_.parse(c.text,c),_.copy(b,c),"bubbles"in c||(c.bubbles=!0);var d=new CustomEvent(a,c);for(var e in c)_.skip.indexOf(e)<0&&(d[_.prop(e)]=c[e]);return d},skip:"bubbles cancelable detail type".split(" "),prop:function(a){return a},parse:function(a,b){return _.properties.forEach(function(c){a=a.replace(c[0],function(){return c[1].apply(b,arguments)||""})}),a?b.type=a:a},properties:[[/^_/,function(){this.bubbles=!1}],[/^\!/,function(){this._protect=!0}],[/\((.*)\)/,function(a,b){try{this.detail=_.resolve(b)||JSON.parse(b)}catch(c){this.detail=b}}],[/#(\w+)/g,function(a,b){(this.tags||(this.tags=[])).push(b),this[b]=!0}],[/^(\w+):/,function(a,b){this.category=b}]],splitRE:/ (?![^\(\)]*\))+/g,wrap:function(a,b,c){c=c||1;var d=function(d){var e=_.slice(arguments);d&&"string"!=typeof d||(d=this&&this!==Eventi?this:_.global,e.unshift(d)),e[c]=e[c]?(e[c]+"").split(_.splitRE):[""],e.length>b&&(e[b]=e.slice(b),e=e.slice(0,b+1));var f,g=_[a];if("length"in d&&d!==_.global)for(var h=0,i=d.length;i>h;h++)f=g.apply(e[0]=d[h],e);else f=g.apply(d,e);return void 0===f?this:f};return d.index=c,d}};Eventi._=_,(Eventi.fy=function(a){for(var b in Eventi){var c=Eventi[b];"function"!=typeof c||c.utility||Object.defineProperty(a,b,{value:c,writable:!0,configurable:!0})}return a}).utility=!0,_.fire=function(a,b,c,d){return"object"!=typeof c||c instanceof Event||!("bubbles"in c||"detail"in c||"cancelable"in c)?(void 0!==c&&(d=d?d.unshift(c)&&d:[c]),c={data:d}):c.data=d,_.fireAll(a,b,c)},_.fireAll=function(a,b,c){for(var d,e=0;e<b.length;e++)d=_.create(b[e],c),_.dispatch(a,d);return d},_.dispatch=function(a,b,c){(a.dispatchEvent||a[_key]||_.noop).call(a,b),a.parentObject&&b.bubbles&&!b.propagationStopped&&_.dispatch(a.parentObject,b,!0),!c&&b._singleton&&_.singleton(a,b)},Eventi.fire=_.wrap("fire",3),_.on=function(a,b,c,d,e){"function"==typeof c&&(void 0!==d&&(e=e?e.unshift(d)&&e:[d]),d=c,c=null);for(var f=0,g=b.length;g>f;f++)_.handler(a,b[f],c,d,e)},_.handler=function(a,b,c,d,e){var f={target:a,selector:c,fn:d,data:e,text:b,match:{}};return _.parse(b,f.match),delete f.match.tags,a!==_&&Eventi.fire(_,"handler#new",f),f.fn!==_.noop&&_.handlers(f.target,f.match.type).push(f),f},_.handlers=function(a,b){var c=_.listener(a),d=c.s[b];return d||(d=c.s[b]=[],a.addEventListener&&a.addEventListener(b,c)),d};var _key=_._key="_eventi"+Date.now();if(_.listener=function(a){var b=a[_key];return b||(b=function(a){var c=b.s[a.type];c&&_.handle(a,c)},b.s={},Object.defineProperty(a,_key,{value:b,writeable:!1,configurable:!0})),b},_.handle=function(a,b){for(var c,d,e=0;e<b.length&&!(_.matches(a,(c=b[e]).match)&&(d=_.target(c,a.target))&&(_.execute(d,a,c),a.immediatePropagationStopped));e++);},_.execute=function(a,b,c){var d=[b];b.data&&d.push.apply(d,b.data),c.data&&d.push.apply(d,c.data);try{c.fn.apply(a,d)}catch(e){_.async(function(){throw e})}},_.unhandle=function(a){a.fn=_.noop},_.matches=function(a,b,c){for(var d in b)if(b[d]!==a[d]&&(c||"_"!==d.charAt(0)))return!1;if(c)for(d in a)if("_"===d.charAt(0)&&a[d]!==b[d])return!1;return!0},_.target=function(a,b){return a.selector?_.closest(b,a.selector):a.target},_.closest=function(a,b){for(;a&&a.matches;){if(a.matches(b))return a;a=a.parentNode}},global.Element){var Ep=Element.prototype,aS="atchesSelector";Ep.matches||Object.defineProperty(Ep,"matches",{value:Ep["webkitM"+aS]||Ep["mozM"+aS]||Ep["msM"+aS]})}Eventi.on=_.wrap("on",4),document&&(_.init=function(){for(var a=document.querySelectorAll("[data-eventi]"),b=0,c=a.length;c>b;b++){var d=a[b],e=d.getAttribute("data-eventi");e&&_.declare(e,d)}(a.length||document.querySelectorAll("[click]").length)&&Eventi.on("click keyup",_.check)},_.declare=function(a,b){for(var c=a.split(_.splitRE),d=0,e=c.length;e>d;d++){var f=c[d],g=f.lastIndexOf("="),h=g>0?f.substring(g+1):void 0,i="/"===f.charAt(0),j=i?_.global:b;b=b||document,h&&(f=f.substring(0,g)),i&&(f=f.substring(1)),Eventi.on(j,f,_.mapped,b,h)}},_.mapped=function(a,b,c){for(var d=c||a.type,e=_.declarers(b,d,this!==_.global&&a.target),f=0,g=e.length;g>f;f++)_.declared(e[f],d,a)},_.declarers=function(a,b,c){var d="["+b+"]";if(c){for(var e=[];c&&c.matches&&c!==a.parentNode;)c.matches(d)&&e.push(c),c=c.parentNode;return e}return a.querySelectorAll(d)},_.declared=function(a,b,c){var d=a.getAttribute(b);d&&(d=_.resolve(d,a)||_.resolve(d)||d,"function"==typeof d?d.call(a,c):Eventi.fire(a,d,c))},_.check=function(a){("click"===a.type&&_.click(a.target)||13===a.keyCode&&_.click(a.target,!0))&&(_.mapped(a,document.documentElement,"click"),_.allowDefault(a)||a.preventDefault())},_.allowDefault=function(a){var b=a.target.type;return b&&("radio"===b||"checkbox"===b)},_.click=function(a,b){var c=a.getAttribute("click");if(c&&"false"!==c)return!0;if(!a.isContentEditable){var d=a.nodeName.toLowerCase();if("textarea"!==d&&d!==(b?"button":"select")){var e=_.buttonRE.test(a.type);return b?!(e||"a"===d&&a.getAttribute("href")):e||"input"!==d}}},_.buttonRE=/^(submit|button|reset)$/,Eventi.on("DOMContentLoaded",_.init)),_.properties.unshift([/^\^/,function(){this._singleton=!0}]),_.singleton=function(a,b){_.remember(a,b),b.bubbles&&!b.propagationStopped&&a!==_.global&&_.singleton(a.parentNode||a.parentObject||_.global,b)};var _skey=_._skey="^"+_key;_.remember=function(a,b){var c=a[_skey]||[];c.length||Object.defineProperty(a,_skey,{value:c,configurable:!0}),b[_skey]=!0,c.push(b)},Eventi.on(_,"handler#new",function(a,b){if(b.match._singleton){var c=b._fn=b.fn;b.fn=function(a){_.unhandle(b),a[_skey]||_.remember(b.target,a),c.apply(this,arguments)};for(var d=b.target[_skey]||[],e=0,f=d.length;f>e;e++){var g=d[e];if(_.matches(g,b.match)){var h=_.target(b,g.target);if(h){_.execute(h,g,b),b.fn=_.noop;break}}}}}),document&&Eventi.on("DOMContentLoaded",function(a){_.fire(document.documentElement,["^ready"],void 0,[a])}),_.keyRE=/\[([a-z-0-9,\.\/\[\`\\\]\']+)\]/,_.properties.push([_.keyRE,function(a,b){for(var c,d;(c=b.indexOf("-"))>0;)d=b.substring(0,c),b=b.substring(c+1),this[(_.special[d]||d)+"Key"]=!0;this.keyCode=_.codes[b]||parseInt(b,10)||0}]),_.special={command:"meta",apple:"meta"},_.codes={backspace:8,tab:9,enter:13,shift:16,ctrl:17,alt:18,capsLock:20,escape:27,start:91,command:224,pageUp:33,pageDown:34,end:35,home:36,left:37,up:38,right:39,down:40,insert:45,"delete":46,multiply:106,plus:107,minus:109,point:110,divide:111,numLock:144,",":188,".":190,"/":191,"`":192,"[":219,"\\":220,"]":221,"'":222,space:32};for(var n=0;10>n;n++)_.codes["num"+n]=96+n;for(var f=1;13>f;f++)_.codes["f"+f]=111+f;"abcdefghijklmnopqrstuvwxyz 0123456789".split("").forEach(function(a){_.codes[a]=a.toUpperCase().charCodeAt(0)});var h=global.history,l=global.location;_.pushState=h.pushState,h.pushState=function(){var a=_.pushState.apply(this,arguments);return _.dispatch(_.global,new Eventi("pushstate",{uri:arguments[2]})),a},Eventi.on("!popstate !hashchange !pushstate",_.at=function(a,b){return b=b||decodeURI(l.pathname+l.search+l.hash),b!==_.uri&&_.dispatch(_.global,new Eventi("location",{oldURI:_.uri,uri:_.uri=b,srcEvent:a})),b}).on("!location",function(a,b,c){if("string"==typeof b){var d=_.keys(b);d&&(b=d.reduce(function(a,b){return a.replace(new RegExp("\\{"+b+"\\}","g"),c[b]||global.location[b]||"")},b)),a.uri=b,b!==_.uri&&h.pushState(null,null,encodeURI(b))}else a.uri||(a.uri=_.uri)}).on(_,"handler#new",function(a,b){if("location"===b.match.type){if(b._target=b.target,b.target=_.global,b.selector){var c=b.selector;delete b.selector,"string"==typeof c&&(c=c.replace(/([.*+?^=!:$(|\[\/\\])/g,"\\$1"),(b.keys=_.keys(c))?c=c.replace(/\{\w+\}/g,"([^/?#]+)"):c.replace(/\{/g,"\\{"),c=new RegExp(c)),b.regexp=c}else b.regexp=/.+/;b._fn=b.fn,b.fn=function(a){_.location(a.uri,b,arguments)},_.execute(null,new Eventi("location",{uri:_.uri||_.at()}),b)}}),_.keys=function(a){var b=a.match(/\{\w+\}/g);return b&&b.map(function(a){return a.substring(1,a.length-1)})},_.location=function(a,b,c){var d=(a||_.uri).match(b.regexp);d&&(c=_.slice(c),c.splice.apply(c,[1,0].concat(d)),b.keys&&(c[1]=b.keys.reduce(function(a,b){return a[b]=d.shift(),a},{match:d.shift()})),b._fn.apply(b._target,c))},_.version="0.6.0";var sP=Event&&Event.prototype.stopPropagation||_.noop,sIP=Event&&Event.prototype.stopImmediatePropagation||_.noop;CustomEvent.prototype.stopPropagation=function(){this.propagationStopped=!0,sP.call(this)},CustomEvent.prototype.stopImmediatePropagation=function(){this.immediatePropagationStopped=!0,sIP.call(this)};var define=global.define||_.noop;define((global.exports||global).Eventi=Eventi)}(this,this.document);

@@ -1,2 +0,2 @@

/*! Eventi - v0.6.0 - 2014-03-04
/*! Eventi - v0.6.0 - 2014-03-06
* https://github.com/nbubna/Eventi

@@ -271,3 +271,5 @@ * Copyright (c) 2014 ESHA Research; Licensed MIT */

aS = 'atchesSelector';
Object.defineProperty(Ep, 'matches', {value:Ep['webkitM'+aS]||Ep['mozM'+aS]||Ep['msM'+aS]});
if (!Ep['matches']) {
Object.defineProperty(Ep, 'matches', {value:Ep['webkitM'+aS]||Ep['mozM'+aS]||Ep['msM'+aS]});
}
}

@@ -452,3 +454,4 @@

});
var h = global.history;
var h = global.history,
l = global.location;
_.pushState = h.pushState;

@@ -461,3 +464,2 @@ h.pushState = function() {

Eventi.on('!popstate !hashchange !pushstate', _.at = function(e, uri) {
var l = global.location;
uri = uri || decodeURI(l.pathname + l.search + l.hash);

@@ -482,5 +484,8 @@ if (uri !== _.uri) {

}
e.uri = uri;
if (uri !== _.uri) {
h.pushState(null,null, encodeURI(uri));
}
} else if (!e.uri) {
e.uri = _.uri;
}

@@ -490,22 +495,26 @@ })

if (handler.match.type === "location") {
// overloading on.js' selector argument with uri template/regex
var re = handler.selector;
delete handler.selector;
if (typeof re === "string") {
re = re.replace(/([.*+?^=!:$(|\[\/\\])/g, "\\$1");
if (handler.keys = _.keys(re)) {
re = re.replace(/\{\w+\}/g, "([^\/?#]+)");
} else {
re.replace(/\{/g, '\\{');
// always listen on window, but save given target to use as context
handler._target = handler.target;
handler.target = _.global;
if (handler.selector) {
// overloading on.js' selector argument with uri template/regex
var re = handler.selector;
delete handler.selector;
if (typeof re === "string") {
re = re.replace(/([.*+?^=!:$(|\[\/\\])/g, "\\$1");
if (handler.keys = _.keys(re)) {
re = re.replace(/\{\w+\}/g, "([^\/?#]+)");
} else {
re.replace(/\{/g, '\\{');
}
re = new RegExp(re);
}
re = new RegExp(re);
handler.regexp = re;
} else {
handler.regexp = /.+/;
}
handler.regexp = re;
// always listen on window, but use given target as context
handler._target = handler.target;
handler.target = _.global;
handler._fn = handler.fn;
handler.fn = function(e){ _.location(e.uri, handler, arguments); };
// try for current uri match immediately
_.execute(null, new Eventi('location',{uri:_.uri}), handler);
_.execute(null, new Eventi('location',{uri:_.uri||_.at()}), handler);
}

@@ -520,3 +529,3 @@ });

_.location = function(uri, handler, args) {
var matches = uri.match(handler.regexp);
var matches = (uri||_.uri).match(handler.regexp);
if (matches) {

@@ -523,0 +532,0 @@ args = _.slice(args);

@@ -1,4 +0,4 @@

/*! Eventi - v0.6.0 - 2014-03-04
/*! Eventi - v0.6.0 - 2014-03-06
* https://github.com/nbubna/Eventi
* Copyright (c) 2014 ESHA Research; Licensed MIT */
!function(global,document){"use strict";function Eventi(){return _.create.apply(this,arguments)}global.CustomEvent||(global.CustomEvent=document?function(a,b){b=b||{};var c=document.createEvent("CustomEvent");return c.initCustomEvent(a,!!b.bubbles,!!b.cancelable,b.detail),c}:function(a,b){b=b||{},this.type=a,this.bubbles=!!b.bubbles,this.detail=b.detail,this.timestamp=Date.now()});var _={global:new Function("return this")(),noop:function(){},slice:function(a,b){return Array.prototype.slice.call(a,b)},copy:function(a,b,c){if(a)for(c in a)a.hasOwnProperty(c)&&(b[c]=a[c])},async:global.setImmediate||function(a){return setTimeout(a,0)},resolveRE:/^([\w\$]+)?((\.[\w\$]+)|\[(\d+|'(\\'|[^'])+'|"(\\"|[^"])+")\])*$/,resolve:function(reference,context){return _.resolveRE.test(reference)?(context=context||global,eval("context"+("["!==reference.charAt(0)?"."+reference:reference))):void 0},create:function(a,b){var c={text:a+""};a=_.parse(c.text,c),_.copy(b,c),"bubbles"in c||(c.bubbles=!0);var d=new CustomEvent(a,c);for(var e in c)_.skip.indexOf(e)<0&&(d[_.prop(e)]=c[e]);return d},skip:"bubbles cancelable detail type".split(" "),prop:function(a){return a},parse:function(a,b){return _.properties.forEach(function(c){a=a.replace(c[0],function(){return c[1].apply(b,arguments)||""})}),a?b.type=a:a},properties:[[/^_/,function(){this.bubbles=!1}],[/^\!/,function(){this._protect=!0}],[/\((.*)\)/,function(a,b){try{this.detail=_.resolve(b)||JSON.parse(b)}catch(c){this.detail=b}}],[/#(\w+)/g,function(a,b){(this.tags||(this.tags=[])).push(b),this[b]=!0}],[/^(\w+):/,function(a,b){this.category=b}]],splitRE:/ (?![^\(\)]*\))+/g,wrap:function(a,b,c){c=c||1;var d=function(d){var e=_.slice(arguments);d&&"string"!=typeof d||(d=this&&this!==Eventi?this:_.global,e.unshift(d)),e[c]=e[c]?(e[c]+"").split(_.splitRE):[""],e.length>b&&(e[b]=e.slice(b),e=e.slice(0,b+1));var f,g=_[a];if("length"in d&&d!==_.global)for(var h=0,i=d.length;i>h;h++)f=g.apply(e[0]=d[h],e);else f=g.apply(d,e);return void 0===f?this:f};return d.index=c,d}};Eventi._=_,(Eventi.fy=function(a){for(var b in Eventi){var c=Eventi[b];"function"!=typeof c||c.utility||Object.defineProperty(a,b,{value:c,writable:!0,configurable:!0})}return a}).utility=!0,_.fire=function(a,b,c,d){return"object"!=typeof c||c instanceof Event||!("bubbles"in c||"detail"in c||"cancelable"in c)?(void 0!==c&&(d=d?d.unshift(c)&&d:[c]),c={data:d}):c.data=d,_.fireAll(a,b,c)},_.fireAll=function(a,b,c){for(var d,e=0;e<b.length;e++)d=_.create(b[e],c),_.dispatch(a,d);return d},_.dispatch=function(a,b,c){(a.dispatchEvent||a[_key]||_.noop).call(a,b),a.parentObject&&b.bubbles&&!b.propagationStopped&&_.dispatch(a.parentObject,b,!0),!c&&b._singleton&&_.singleton(a,b)},Eventi.fire=_.wrap("fire",3),_.on=function(a,b,c,d,e){"function"==typeof c&&(void 0!==d&&(e=e?e.unshift(d)&&e:[d]),d=c,c=null);for(var f=0,g=b.length;g>f;f++)_.handler(a,b[f],c,d,e)},_.handler=function(a,b,c,d,e){var f={target:a,selector:c,fn:d,data:e,text:b,match:{}};return _.parse(b,f.match),delete f.match.tags,a!==_&&Eventi.fire(_,"handler#new",f),f.fn!==_.noop&&_.handlers(f.target,f.match.type).push(f),f},_.handlers=function(a,b){var c=_.listener(a),d=c.s[b];return d||(d=c.s[b]=[],a.addEventListener&&a.addEventListener(b,c)),d};var _key=_._key="_eventi"+Date.now();if(_.listener=function(a){var b=a[_key];return b||(b=function(a){var c=b.s[a.type];c&&_.handle(a,c)},b.s={},Object.defineProperty(a,_key,{value:b,writeable:!1,configurable:!0})),b},_.handle=function(a,b){for(var c,d,e=0;e<b.length&&!(_.matches(a,(c=b[e]).match)&&(d=_.target(c,a.target))&&(_.execute(d,a,c),a.immediatePropagationStopped));e++);},_.execute=function(a,b,c){var d=[b];b.data&&d.push.apply(d,b.data),c.data&&d.push.apply(d,c.data);try{c.fn.apply(a,d)}catch(e){_.async(function(){throw e})}},_.unhandle=function(a){a.fn=_.noop},_.matches=function(a,b,c){for(var d in b)if(b[d]!==a[d]&&(c||"_"!==d.charAt(0)))return!1;if(c)for(d in a)if("_"===d.charAt(0)&&a[d]!==b[d])return!1;return!0},_.target=function(a,b){return a.selector?_.closest(b,a.selector):a.target},_.closest=function(a,b){for(;a&&a.matches;){if(a.matches(b))return a;a=a.parentNode}},global.Element){var Ep=Element.prototype,aS="atchesSelector";Object.defineProperty(Ep,"matches",{value:Ep["webkitM"+aS]||Ep["mozM"+aS]||Ep["msM"+aS]})}Eventi.on=_.wrap("on",4),document&&(_.init=function(){for(var a=document.querySelectorAll("[data-eventi]"),b=0,c=a.length;c>b;b++){var d=a[b],e=d.getAttribute("data-eventi");e&&_.declare(e,d)}(a.length||document.querySelectorAll("[click]").length)&&Eventi.on("click keyup",_.check)},_.declare=function(a,b){for(var c=a.split(_.splitRE),d=0,e=c.length;e>d;d++){var f=c[d],g=f.lastIndexOf("="),h=g>0?f.substring(g+1):void 0,i="/"===f.charAt(0),j=i?_.global:b;b=b||document,h&&(f=f.substring(0,g)),i&&(f=f.substring(1)),Eventi.on(j,f,_.mapped,b,h)}},_.mapped=function(a,b,c){for(var d=c||a.type,e=_.declarers(b,d,this!==_.global&&a.target),f=0,g=e.length;g>f;f++)_.declared(e[f],d,a)},_.declarers=function(a,b,c){var d="["+b+"]";if(c){for(var e=[];c&&c.matches&&c!==a.parentNode;)c.matches(d)&&e.push(c),c=c.parentNode;return e}return a.querySelectorAll(d)},_.declared=function(a,b,c){var d=a.getAttribute(b);d&&(d=_.resolve(d,a)||_.resolve(d)||d,"function"==typeof d?d.call(a,c):Eventi.fire(a,d,c))},_.check=function(a){("click"===a.type&&_.click(a.target)||13===a.keyCode&&_.click(a.target,!0))&&(_.mapped(a,document.documentElement,"click"),_.allowDefault(a)||a.preventDefault())},_.allowDefault=function(a){var b=a.target.type;return b&&("radio"===b||"checkbox"===b)},_.click=function(a,b){var c=a.getAttribute("click");if(c&&"false"!==c)return!0;if(!a.isContentEditable){var d=a.nodeName.toLowerCase();if("textarea"!==d&&d!==(b?"button":"select")){var e=_.buttonRE.test(a.type);return b?!(e||"a"===d&&a.getAttribute("href")):e||"input"!==d}}},_.buttonRE=/^(submit|button|reset)$/,Eventi.on("DOMContentLoaded",_.init)),_.properties.unshift([/^\^/,function(){this._singleton=!0}]),_.singleton=function(a,b){_.remember(a,b),b.bubbles&&!b.propagationStopped&&a!==_.global&&_.singleton(a.parentNode||a.parentObject||_.global,b)};var _skey=_._skey="^"+_key;_.remember=function(a,b){var c=a[_skey]||[];c.length||Object.defineProperty(a,_skey,{value:c,configurable:!0}),b[_skey]=!0,c.push(b)},Eventi.on(_,"handler#new",function(a,b){if(b.match._singleton){var c=b._fn=b.fn;b.fn=function(a){_.unhandle(b),a[_skey]||_.remember(b.target,a),c.apply(this,arguments)};for(var d=b.target[_skey]||[],e=0,f=d.length;f>e;e++){var g=d[e];if(_.matches(g,b.match)){var h=_.target(b,g.target);if(h){_.execute(h,g,b),b.fn=_.noop;break}}}}}),document&&Eventi.on("DOMContentLoaded",function(a){_.fire(document.documentElement,["^ready"],void 0,[a])}),_.keyRE=/\[([a-z-0-9,\.\/\[\`\\\]\']+)\]/,_.properties.push([_.keyRE,function(a,b){for(var c,d;(c=b.indexOf("-"))>0;)d=b.substring(0,c),b=b.substring(c+1),this[(_.special[d]||d)+"Key"]=!0;this.keyCode=_.codes[b]||parseInt(b,10)||0}]),_.special={command:"meta",apple:"meta"},_.codes={backspace:8,tab:9,enter:13,shift:16,ctrl:17,alt:18,capsLock:20,escape:27,start:91,command:224,pageUp:33,pageDown:34,end:35,home:36,left:37,up:38,right:39,down:40,insert:45,"delete":46,multiply:106,plus:107,minus:109,point:110,divide:111,numLock:144,",":188,".":190,"/":191,"`":192,"[":219,"\\":220,"]":221,"'":222,space:32};for(var n=0;10>n;n++)_.codes["num"+n]=96+n;for(var f=1;13>f;f++)_.codes["f"+f]=111+f;"abcdefghijklmnopqrstuvwxyz 0123456789".split("").forEach(function(a){_.codes[a]=a.toUpperCase().charCodeAt(0)});var h=global.history;_.pushState=h.pushState,h.pushState=function(){var a=_.pushState.apply(this,arguments);return _.dispatch(_.global,new Eventi("pushstate",{uri:arguments[2]})),a},Eventi.on("!popstate !hashchange !pushstate",_.at=function(a,b){var c=global.location;return b=b||decodeURI(c.pathname+c.search+c.hash),b!==_.uri&&_.dispatch(_.global,new Eventi("location",{oldURI:_.uri,uri:_.uri=b,srcEvent:a})),b}).on("!location",function(a,b,c){if("string"==typeof b){var d=_.keys(b);d&&(b=d.reduce(function(a,b){return a.replace(new RegExp("\\{"+b+"\\}","g"),c[b]||global.location[b]||"")},b)),b!==_.uri&&h.pushState(null,null,encodeURI(b))}}).on(_,"handler#new",function(a,b){if("location"===b.match.type){var c=b.selector;delete b.selector,"string"==typeof c&&(c=c.replace(/([.*+?^=!:$(|\[\/\\])/g,"\\$1"),(b.keys=_.keys(c))?c=c.replace(/\{\w+\}/g,"([^/?#]+)"):c.replace(/\{/g,"\\{"),c=new RegExp(c)),b.regexp=c,b._target=b.target,b.target=_.global,b._fn=b.fn,b.fn=function(a){_.location(a.uri,b,arguments)},_.execute(null,new Eventi("location",{uri:_.uri}),b)}}),_.keys=function(a){var b=a.match(/\{\w+\}/g);return b&&b.map(function(a){return a.substring(1,a.length-1)})},_.location=function(a,b,c){var d=a.match(b.regexp);d&&(c=_.slice(c),c.splice.apply(c,[1,0].concat(d)),b.keys&&(c[1]=b.keys.reduce(function(a,b){return a[b]=d.shift(),a},{match:d.shift()})),b._fn.apply(b._target,c))},_.off=function(a,b,c){var d=a[_key];if(d){for(var e=0,f=b.length;f>e;e++){var g={fn:c,match:{}},h=_.parse(b[e],g.match);if(delete g.match.tags,h)_.clean(h,g,d,a);else for(h in d.s)_.clean(h,g,d,a)}_.empty(d.s)&&delete a[_key]}},_.unhandle=function(a){_.off(a.target,[a.text],a._fn||a.fn)},_.empty=function(a){for(var b in a)return!b;return!0},_.clean=function(a,b,c,d){var e=c.s[a];if(e){for(var f=0,g=e.length;g>f;f++)if(_.cleans(e[f],b)){var h=e.splice(f--,1)[0];d!==_&&Eventi.fire(_,"handler#off",h),g--}e.length||(d.removeEventListener&&d.removeEventListener(a,c),delete c.s[a])}},_.cleans=function(a,b){return _.matches(a.match,b.match,!0)&&(!b.fn||b.fn===(a._fn||a.fn))},Eventi.off=_.wrap("off",3),_.until=function(a,b,c,d,e,f){"string"!=typeof d&&(void 0!==e&&(f=f?f.unshift(e)&&f:[e]),e=d);for(var g=0,h=c.length;h>g;g++){var i=_.handler(a,c[g],d,e,f);_.untilAfter(i,b)}},_.untilAfter=function(a,b){var c=_.untilFn(a,b),d=a._fn=a.fn;a.fn=function(){d.apply(this,arguments),c()&&_.unhandle(a)}},_.untilFn=function(a,b){switch(typeof b){case"undefined":case"function":return b;case"number":return function(){return!--b};case"string":var c="!"===b.charAt(0);return c&&(b=b.substring(1)),function(){var d=_.resolve(b,a.target);return void 0===d&&(d=_.resolve(b)),c?!d:d}}},Eventi.until=_.wrap("until",5,2),_.comboRE=/\+|>/,_.fireAll=function(a,b,c,d){for(var e,f,g=0;g<b.length;g++){f=c.sequence=b[g].split(_.comboRE);for(var h=d||0;h<f.length&&(!e||!e.isSequencePaused());h++)f[h]?(c.index=h,e=c.previousEvent=_.create(f[h],c),_.sequence(e,c,a),_.dispatch(a,e)):f.splice(h--,1)}return e},_.sequence=function(a,b,c,d){a.resumeSequence=function(a){d&&(d=!1,_.fireAll(c,b.sequence,b,a||b.index))},a.pauseSequence=function(a){return d!==!1?(d=!0,a&&a.then(this.resumeSequence)):void 0},a.isSequencePaused=function(){return!!d}},Eventi.on(_,"handler#new",function(a,b){var c=b.text,d=c.match(_.comboRE);if(d){for(var e=c.split(d[0]),f=b.comboFn=_.comboFn(">"===d[0],e,c),g=0,h=e.length;h>g;g++)e[g]=_.handler(b.target,e[g],b.selector,f).type;f.reset()}}),_.comboTimeout=1e3,_.comboFn=function(a,b,c){var d,e,f=function(){e&&clearTimeout(e),d=b.slice()},g=function(b){e||(e=setTimeout(f,_.comboTimeout));var g=d.indexOf(b.type);(a?0===g:g>=0)&&(d.splice(g,1),d.length||(_.fire(b.target,c),f()))};return g.reset=f,g},Eventi.on(_,"handler#off",function(a,b){b.comboFn&&_.off(b.target,"",b.comboFn)}),_.signal=function(a){return _.signal[a]||(_.signal[a]=function(b){var c=_.slice(arguments),d=this.index||1;return("object"!=typeof b||!b.dispatchEvent&&!b[_key])&&d--,c.splice(d,0,a),this.apply(null,c)})},_.bind=function(a,b){var c=function(){return b.apply(a,arguments)};return c.index=b.index,c},(Eventi.signal=function(a){var b=_.slice(arguments);"string"==typeof a&&(a=Eventi);for(var c in Eventi){var d=a[c];if("function"==typeof d&&!d.utility){a!==Eventi&&d===Eventi[c]&&(d=a[c]=_.bind(a,d));for(var e=0,f=b.length;f>e;e++){var g=b[e];d[g]=_.signal(g)}}}}).utility=!0,_.version="0.6.0";var sP=Event&&Event.prototype.stopPropagation||_.noop,sIP=Event&&Event.prototype.stopImmediatePropagation||_.noop;CustomEvent.prototype.stopPropagation=function(){this.propagationStopped=!0,sP.call(this)},CustomEvent.prototype.stopImmediatePropagation=function(){this.immediatePropagationStopped=!0,sIP.call(this)};var define=global.define||_.noop;define((global.exports||global).Eventi=Eventi)}(this,this.document);
!function(global,document){"use strict";function Eventi(){return _.create.apply(this,arguments)}global.CustomEvent||(global.CustomEvent=document?function(a,b){b=b||{};var c=document.createEvent("CustomEvent");return c.initCustomEvent(a,!!b.bubbles,!!b.cancelable,b.detail),c}:function(a,b){b=b||{},this.type=a,this.bubbles=!!b.bubbles,this.detail=b.detail,this.timestamp=Date.now()});var _={global:new Function("return this")(),noop:function(){},slice:function(a,b){return Array.prototype.slice.call(a,b)},copy:function(a,b,c){if(a)for(c in a)a.hasOwnProperty(c)&&(b[c]=a[c])},async:global.setImmediate||function(a){return setTimeout(a,0)},resolveRE:/^([\w\$]+)?((\.[\w\$]+)|\[(\d+|'(\\'|[^'])+'|"(\\"|[^"])+")\])*$/,resolve:function(reference,context){return _.resolveRE.test(reference)?(context=context||global,eval("context"+("["!==reference.charAt(0)?"."+reference:reference))):void 0},create:function(a,b){var c={text:a+""};a=_.parse(c.text,c),_.copy(b,c),"bubbles"in c||(c.bubbles=!0);var d=new CustomEvent(a,c);for(var e in c)_.skip.indexOf(e)<0&&(d[_.prop(e)]=c[e]);return d},skip:"bubbles cancelable detail type".split(" "),prop:function(a){return a},parse:function(a,b){return _.properties.forEach(function(c){a=a.replace(c[0],function(){return c[1].apply(b,arguments)||""})}),a?b.type=a:a},properties:[[/^_/,function(){this.bubbles=!1}],[/^\!/,function(){this._protect=!0}],[/\((.*)\)/,function(a,b){try{this.detail=_.resolve(b)||JSON.parse(b)}catch(c){this.detail=b}}],[/#(\w+)/g,function(a,b){(this.tags||(this.tags=[])).push(b),this[b]=!0}],[/^(\w+):/,function(a,b){this.category=b}]],splitRE:/ (?![^\(\)]*\))+/g,wrap:function(a,b,c){c=c||1;var d=function(d){var e=_.slice(arguments);d&&"string"!=typeof d||(d=this&&this!==Eventi?this:_.global,e.unshift(d)),e[c]=e[c]?(e[c]+"").split(_.splitRE):[""],e.length>b&&(e[b]=e.slice(b),e=e.slice(0,b+1));var f,g=_[a];if("length"in d&&d!==_.global)for(var h=0,i=d.length;i>h;h++)f=g.apply(e[0]=d[h],e);else f=g.apply(d,e);return void 0===f?this:f};return d.index=c,d}};Eventi._=_,(Eventi.fy=function(a){for(var b in Eventi){var c=Eventi[b];"function"!=typeof c||c.utility||Object.defineProperty(a,b,{value:c,writable:!0,configurable:!0})}return a}).utility=!0,_.fire=function(a,b,c,d){return"object"!=typeof c||c instanceof Event||!("bubbles"in c||"detail"in c||"cancelable"in c)?(void 0!==c&&(d=d?d.unshift(c)&&d:[c]),c={data:d}):c.data=d,_.fireAll(a,b,c)},_.fireAll=function(a,b,c){for(var d,e=0;e<b.length;e++)d=_.create(b[e],c),_.dispatch(a,d);return d},_.dispatch=function(a,b,c){(a.dispatchEvent||a[_key]||_.noop).call(a,b),a.parentObject&&b.bubbles&&!b.propagationStopped&&_.dispatch(a.parentObject,b,!0),!c&&b._singleton&&_.singleton(a,b)},Eventi.fire=_.wrap("fire",3),_.on=function(a,b,c,d,e){"function"==typeof c&&(void 0!==d&&(e=e?e.unshift(d)&&e:[d]),d=c,c=null);for(var f=0,g=b.length;g>f;f++)_.handler(a,b[f],c,d,e)},_.handler=function(a,b,c,d,e){var f={target:a,selector:c,fn:d,data:e,text:b,match:{}};return _.parse(b,f.match),delete f.match.tags,a!==_&&Eventi.fire(_,"handler#new",f),f.fn!==_.noop&&_.handlers(f.target,f.match.type).push(f),f},_.handlers=function(a,b){var c=_.listener(a),d=c.s[b];return d||(d=c.s[b]=[],a.addEventListener&&a.addEventListener(b,c)),d};var _key=_._key="_eventi"+Date.now();if(_.listener=function(a){var b=a[_key];return b||(b=function(a){var c=b.s[a.type];c&&_.handle(a,c)},b.s={},Object.defineProperty(a,_key,{value:b,writeable:!1,configurable:!0})),b},_.handle=function(a,b){for(var c,d,e=0;e<b.length&&!(_.matches(a,(c=b[e]).match)&&(d=_.target(c,a.target))&&(_.execute(d,a,c),a.immediatePropagationStopped));e++);},_.execute=function(a,b,c){var d=[b];b.data&&d.push.apply(d,b.data),c.data&&d.push.apply(d,c.data);try{c.fn.apply(a,d)}catch(e){_.async(function(){throw e})}},_.unhandle=function(a){a.fn=_.noop},_.matches=function(a,b,c){for(var d in b)if(b[d]!==a[d]&&(c||"_"!==d.charAt(0)))return!1;if(c)for(d in a)if("_"===d.charAt(0)&&a[d]!==b[d])return!1;return!0},_.target=function(a,b){return a.selector?_.closest(b,a.selector):a.target},_.closest=function(a,b){for(;a&&a.matches;){if(a.matches(b))return a;a=a.parentNode}},global.Element){var Ep=Element.prototype,aS="atchesSelector";Ep.matches||Object.defineProperty(Ep,"matches",{value:Ep["webkitM"+aS]||Ep["mozM"+aS]||Ep["msM"+aS]})}Eventi.on=_.wrap("on",4),document&&(_.init=function(){for(var a=document.querySelectorAll("[data-eventi]"),b=0,c=a.length;c>b;b++){var d=a[b],e=d.getAttribute("data-eventi");e&&_.declare(e,d)}(a.length||document.querySelectorAll("[click]").length)&&Eventi.on("click keyup",_.check)},_.declare=function(a,b){for(var c=a.split(_.splitRE),d=0,e=c.length;e>d;d++){var f=c[d],g=f.lastIndexOf("="),h=g>0?f.substring(g+1):void 0,i="/"===f.charAt(0),j=i?_.global:b;b=b||document,h&&(f=f.substring(0,g)),i&&(f=f.substring(1)),Eventi.on(j,f,_.mapped,b,h)}},_.mapped=function(a,b,c){for(var d=c||a.type,e=_.declarers(b,d,this!==_.global&&a.target),f=0,g=e.length;g>f;f++)_.declared(e[f],d,a)},_.declarers=function(a,b,c){var d="["+b+"]";if(c){for(var e=[];c&&c.matches&&c!==a.parentNode;)c.matches(d)&&e.push(c),c=c.parentNode;return e}return a.querySelectorAll(d)},_.declared=function(a,b,c){var d=a.getAttribute(b);d&&(d=_.resolve(d,a)||_.resolve(d)||d,"function"==typeof d?d.call(a,c):Eventi.fire(a,d,c))},_.check=function(a){("click"===a.type&&_.click(a.target)||13===a.keyCode&&_.click(a.target,!0))&&(_.mapped(a,document.documentElement,"click"),_.allowDefault(a)||a.preventDefault())},_.allowDefault=function(a){var b=a.target.type;return b&&("radio"===b||"checkbox"===b)},_.click=function(a,b){var c=a.getAttribute("click");if(c&&"false"!==c)return!0;if(!a.isContentEditable){var d=a.nodeName.toLowerCase();if("textarea"!==d&&d!==(b?"button":"select")){var e=_.buttonRE.test(a.type);return b?!(e||"a"===d&&a.getAttribute("href")):e||"input"!==d}}},_.buttonRE=/^(submit|button|reset)$/,Eventi.on("DOMContentLoaded",_.init)),_.properties.unshift([/^\^/,function(){this._singleton=!0}]),_.singleton=function(a,b){_.remember(a,b),b.bubbles&&!b.propagationStopped&&a!==_.global&&_.singleton(a.parentNode||a.parentObject||_.global,b)};var _skey=_._skey="^"+_key;_.remember=function(a,b){var c=a[_skey]||[];c.length||Object.defineProperty(a,_skey,{value:c,configurable:!0}),b[_skey]=!0,c.push(b)},Eventi.on(_,"handler#new",function(a,b){if(b.match._singleton){var c=b._fn=b.fn;b.fn=function(a){_.unhandle(b),a[_skey]||_.remember(b.target,a),c.apply(this,arguments)};for(var d=b.target[_skey]||[],e=0,f=d.length;f>e;e++){var g=d[e];if(_.matches(g,b.match)){var h=_.target(b,g.target);if(h){_.execute(h,g,b),b.fn=_.noop;break}}}}}),document&&Eventi.on("DOMContentLoaded",function(a){_.fire(document.documentElement,["^ready"],void 0,[a])}),_.keyRE=/\[([a-z-0-9,\.\/\[\`\\\]\']+)\]/,_.properties.push([_.keyRE,function(a,b){for(var c,d;(c=b.indexOf("-"))>0;)d=b.substring(0,c),b=b.substring(c+1),this[(_.special[d]||d)+"Key"]=!0;this.keyCode=_.codes[b]||parseInt(b,10)||0}]),_.special={command:"meta",apple:"meta"},_.codes={backspace:8,tab:9,enter:13,shift:16,ctrl:17,alt:18,capsLock:20,escape:27,start:91,command:224,pageUp:33,pageDown:34,end:35,home:36,left:37,up:38,right:39,down:40,insert:45,"delete":46,multiply:106,plus:107,minus:109,point:110,divide:111,numLock:144,",":188,".":190,"/":191,"`":192,"[":219,"\\":220,"]":221,"'":222,space:32};for(var n=0;10>n;n++)_.codes["num"+n]=96+n;for(var f=1;13>f;f++)_.codes["f"+f]=111+f;"abcdefghijklmnopqrstuvwxyz 0123456789".split("").forEach(function(a){_.codes[a]=a.toUpperCase().charCodeAt(0)});var h=global.history,l=global.location;_.pushState=h.pushState,h.pushState=function(){var a=_.pushState.apply(this,arguments);return _.dispatch(_.global,new Eventi("pushstate",{uri:arguments[2]})),a},Eventi.on("!popstate !hashchange !pushstate",_.at=function(a,b){return b=b||decodeURI(l.pathname+l.search+l.hash),b!==_.uri&&_.dispatch(_.global,new Eventi("location",{oldURI:_.uri,uri:_.uri=b,srcEvent:a})),b}).on("!location",function(a,b,c){if("string"==typeof b){var d=_.keys(b);d&&(b=d.reduce(function(a,b){return a.replace(new RegExp("\\{"+b+"\\}","g"),c[b]||global.location[b]||"")},b)),a.uri=b,b!==_.uri&&h.pushState(null,null,encodeURI(b))}else a.uri||(a.uri=_.uri)}).on(_,"handler#new",function(a,b){if("location"===b.match.type){if(b._target=b.target,b.target=_.global,b.selector){var c=b.selector;delete b.selector,"string"==typeof c&&(c=c.replace(/([.*+?^=!:$(|\[\/\\])/g,"\\$1"),(b.keys=_.keys(c))?c=c.replace(/\{\w+\}/g,"([^/?#]+)"):c.replace(/\{/g,"\\{"),c=new RegExp(c)),b.regexp=c}else b.regexp=/.+/;b._fn=b.fn,b.fn=function(a){_.location(a.uri,b,arguments)},_.execute(null,new Eventi("location",{uri:_.uri||_.at()}),b)}}),_.keys=function(a){var b=a.match(/\{\w+\}/g);return b&&b.map(function(a){return a.substring(1,a.length-1)})},_.location=function(a,b,c){var d=(a||_.uri).match(b.regexp);d&&(c=_.slice(c),c.splice.apply(c,[1,0].concat(d)),b.keys&&(c[1]=b.keys.reduce(function(a,b){return a[b]=d.shift(),a},{match:d.shift()})),b._fn.apply(b._target,c))},_.off=function(a,b,c){var d=a[_key];if(d){for(var e=0,f=b.length;f>e;e++){var g={fn:c,match:{}},h=_.parse(b[e],g.match);if(delete g.match.tags,h)_.clean(h,g,d,a);else for(h in d.s)_.clean(h,g,d,a)}_.empty(d.s)&&delete a[_key]}},_.unhandle=function(a){_.off(a.target,[a.text],a._fn||a.fn)},_.empty=function(a){for(var b in a)return!b;return!0},_.clean=function(a,b,c,d){var e=c.s[a];if(e){for(var f=0,g=e.length;g>f;f++)if(_.cleans(e[f],b)){var h=e.splice(f--,1)[0];d!==_&&Eventi.fire(_,"handler#off",h),g--}e.length||(d.removeEventListener&&d.removeEventListener(a,c),delete c.s[a])}},_.cleans=function(a,b){return _.matches(a.match,b.match,!0)&&(!b.fn||b.fn===(a._fn||a.fn))},Eventi.off=_.wrap("off",3),_.until=function(a,b,c,d,e,f){"string"!=typeof d&&(void 0!==e&&(f=f?f.unshift(e)&&f:[e]),e=d);for(var g=0,h=c.length;h>g;g++){var i=_.handler(a,c[g],d,e,f);_.untilAfter(i,b)}},_.untilAfter=function(a,b){var c=_.untilFn(a,b),d=a._fn=a.fn;a.fn=function(){d.apply(this,arguments),c()&&_.unhandle(a)}},_.untilFn=function(a,b){switch(typeof b){case"undefined":case"function":return b;case"number":return function(){return!--b};case"string":var c="!"===b.charAt(0);return c&&(b=b.substring(1)),function(){var d=_.resolve(b,a.target);return void 0===d&&(d=_.resolve(b)),c?!d:d}}},Eventi.until=_.wrap("until",5,2),_.comboRE=/\+|>/,_.fireAll=function(a,b,c,d){for(var e,f,g=0;g<b.length;g++){f=c.sequence=b[g].split(_.comboRE);for(var h=d||0;h<f.length&&(!e||!e.isSequencePaused());h++)f[h]?(c.index=h,e=c.previousEvent=_.create(f[h],c),_.sequence(e,c,a),_.dispatch(a,e)):f.splice(h--,1)}return e},_.sequence=function(a,b,c,d){a.resumeSequence=function(a){d&&(d=!1,_.fireAll(c,b.sequence,b,a||b.index))},a.pauseSequence=function(a){return d!==!1?(d=!0,a&&a.then(this.resumeSequence)):void 0},a.isSequencePaused=function(){return!!d}},Eventi.on(_,"handler#new",function(a,b){var c=b.text,d=c.match(_.comboRE);if(d){for(var e=c.split(d[0]),f=b.comboFn=_.comboFn(">"===d[0],e,c),g=0,h=e.length;h>g;g++)e[g]=_.handler(b.target,e[g],b.selector,f).type;f.reset()}}),_.comboTimeout=1e3,_.comboFn=function(a,b,c){var d,e,f=function(){e&&clearTimeout(e),d=b.slice()},g=function(b){e||(e=setTimeout(f,_.comboTimeout));var g=d.indexOf(b.type);(a?0===g:g>=0)&&(d.splice(g,1),d.length||(_.fire(b.target,c),f()))};return g.reset=f,g},Eventi.on(_,"handler#off",function(a,b){b.comboFn&&_.off(b.target,"",b.comboFn)}),_.signal=function(a){return _.signal[a]||(_.signal[a]=function(b){var c=_.slice(arguments),d=this.index||1;return("object"!=typeof b||!b.dispatchEvent&&!b[_key])&&d--,c.splice(d,0,a),this.apply(null,c)})},_.bind=function(a,b){var c=function(){return b.apply(a,arguments)};return c.index=b.index,c},(Eventi.signal=function(a){var b=_.slice(arguments);"string"==typeof a&&(a=Eventi);for(var c in Eventi){var d=a[c];if("function"==typeof d&&!d.utility){a!==Eventi&&d===Eventi[c]&&(d=a[c]=_.bind(a,d));for(var e=0,f=b.length;f>e;e++){var g=b[e];d[g]=_.signal(g)}}}}).utility=!0,_.version="0.6.0";var sP=Event&&Event.prototype.stopPropagation||_.noop,sIP=Event&&Event.prototype.stopImmediatePropagation||_.noop;CustomEvent.prototype.stopPropagation=function(){this.propagationStopped=!0,sP.call(this)},CustomEvent.prototype.stopImmediatePropagation=function(){this.immediatePropagationStopped=!0,sIP.call(this)};var define=global.define||_.noop;define((global.exports||global).Eventi=Eventi)}(this,this.document);

@@ -1,2 +0,2 @@

/*! Eventi - v0.6.0 - 2014-03-04
/*! Eventi - v0.6.0 - 2014-03-06
* https://github.com/nbubna/Eventi

@@ -271,3 +271,5 @@ * Copyright (c) 2014 ESHA Research; Licensed MIT */

aS = 'atchesSelector';
Object.defineProperty(Ep, 'matches', {value:Ep['webkitM'+aS]||Ep['mozM'+aS]||Ep['msM'+aS]});
if (!Ep['matches']) {
Object.defineProperty(Ep, 'matches', {value:Ep['webkitM'+aS]||Ep['mozM'+aS]||Ep['msM'+aS]});
}
}

@@ -274,0 +276,0 @@

@@ -1,4 +0,4 @@

/*! Eventi - v0.6.0 - 2014-03-04
/*! Eventi - v0.6.0 - 2014-03-06
* https://github.com/nbubna/Eventi
* Copyright (c) 2014 ESHA Research; Licensed MIT */
!function(global,document){"use strict";function Eventi(){return _.create.apply(this,arguments)}global.CustomEvent||(global.CustomEvent=document?function(a,b){b=b||{};var c=document.createEvent("CustomEvent");return c.initCustomEvent(a,!!b.bubbles,!!b.cancelable,b.detail),c}:function(a,b){b=b||{},this.type=a,this.bubbles=!!b.bubbles,this.detail=b.detail,this.timestamp=Date.now()});var _={global:new Function("return this")(),noop:function(){},slice:function(a,b){return Array.prototype.slice.call(a,b)},copy:function(a,b,c){if(a)for(c in a)a.hasOwnProperty(c)&&(b[c]=a[c])},async:global.setImmediate||function(a){return setTimeout(a,0)},resolveRE:/^([\w\$]+)?((\.[\w\$]+)|\[(\d+|'(\\'|[^'])+'|"(\\"|[^"])+")\])*$/,resolve:function(reference,context){return _.resolveRE.test(reference)?(context=context||global,eval("context"+("["!==reference.charAt(0)?"."+reference:reference))):void 0},create:function(a,b){var c={text:a+""};a=_.parse(c.text,c),_.copy(b,c),"bubbles"in c||(c.bubbles=!0);var d=new CustomEvent(a,c);for(var e in c)_.skip.indexOf(e)<0&&(d[_.prop(e)]=c[e]);return d},skip:"bubbles cancelable detail type".split(" "),prop:function(a){return a},parse:function(a,b){return _.properties.forEach(function(c){a=a.replace(c[0],function(){return c[1].apply(b,arguments)||""})}),a?b.type=a:a},properties:[[/^_/,function(){this.bubbles=!1}],[/^\!/,function(){this._protect=!0}],[/\((.*)\)/,function(a,b){try{this.detail=_.resolve(b)||JSON.parse(b)}catch(c){this.detail=b}}],[/#(\w+)/g,function(a,b){(this.tags||(this.tags=[])).push(b),this[b]=!0}],[/^(\w+):/,function(a,b){this.category=b}]],splitRE:/ (?![^\(\)]*\))+/g,wrap:function(a,b,c){c=c||1;var d=function(d){var e=_.slice(arguments);d&&"string"!=typeof d||(d=this&&this!==Eventi?this:_.global,e.unshift(d)),e[c]=e[c]?(e[c]+"").split(_.splitRE):[""],e.length>b&&(e[b]=e.slice(b),e=e.slice(0,b+1));var f,g=_[a];if("length"in d&&d!==_.global)for(var h=0,i=d.length;i>h;h++)f=g.apply(e[0]=d[h],e);else f=g.apply(d,e);return void 0===f?this:f};return d.index=c,d}};Eventi._=_,(Eventi.fy=function(a){for(var b in Eventi){var c=Eventi[b];"function"!=typeof c||c.utility||Object.defineProperty(a,b,{value:c,writable:!0,configurable:!0})}return a}).utility=!0,_.fire=function(a,b,c,d){return"object"!=typeof c||c instanceof Event||!("bubbles"in c||"detail"in c||"cancelable"in c)?(void 0!==c&&(d=d?d.unshift(c)&&d:[c]),c={data:d}):c.data=d,_.fireAll(a,b,c)},_.fireAll=function(a,b,c){for(var d,e=0;e<b.length;e++)d=_.create(b[e],c),_.dispatch(a,d);return d},_.dispatch=function(a,b,c){(a.dispatchEvent||a[_key]||_.noop).call(a,b),a.parentObject&&b.bubbles&&!b.propagationStopped&&_.dispatch(a.parentObject,b,!0),!c&&b._singleton&&_.singleton(a,b)},Eventi.fire=_.wrap("fire",3),_.on=function(a,b,c,d,e){"function"==typeof c&&(void 0!==d&&(e=e?e.unshift(d)&&e:[d]),d=c,c=null);for(var f=0,g=b.length;g>f;f++)_.handler(a,b[f],c,d,e)},_.handler=function(a,b,c,d,e){var f={target:a,selector:c,fn:d,data:e,text:b,match:{}};return _.parse(b,f.match),delete f.match.tags,a!==_&&Eventi.fire(_,"handler#new",f),f.fn!==_.noop&&_.handlers(f.target,f.match.type).push(f),f},_.handlers=function(a,b){var c=_.listener(a),d=c.s[b];return d||(d=c.s[b]=[],a.addEventListener&&a.addEventListener(b,c)),d};var _key=_._key="_eventi"+Date.now();if(_.listener=function(a){var b=a[_key];return b||(b=function(a){var c=b.s[a.type];c&&_.handle(a,c)},b.s={},Object.defineProperty(a,_key,{value:b,writeable:!1,configurable:!0})),b},_.handle=function(a,b){for(var c,d,e=0;e<b.length&&!(_.matches(a,(c=b[e]).match)&&(d=_.target(c,a.target))&&(_.execute(d,a,c),a.immediatePropagationStopped));e++);},_.execute=function(a,b,c){var d=[b];b.data&&d.push.apply(d,b.data),c.data&&d.push.apply(d,c.data);try{c.fn.apply(a,d)}catch(e){_.async(function(){throw e})}},_.unhandle=function(a){a.fn=_.noop},_.matches=function(a,b,c){for(var d in b)if(b[d]!==a[d]&&(c||"_"!==d.charAt(0)))return!1;if(c)for(d in a)if("_"===d.charAt(0)&&a[d]!==b[d])return!1;return!0},_.target=function(a,b){return a.selector?_.closest(b,a.selector):a.target},_.closest=function(a,b){for(;a&&a.matches;){if(a.matches(b))return a;a=a.parentNode}},global.Element){var Ep=Element.prototype,aS="atchesSelector";Object.defineProperty(Ep,"matches",{value:Ep["webkitM"+aS]||Ep["mozM"+aS]||Ep["msM"+aS]})}Eventi.on=_.wrap("on",4),_.version="0.6.0";var sP=Event&&Event.prototype.stopPropagation||_.noop,sIP=Event&&Event.prototype.stopImmediatePropagation||_.noop;CustomEvent.prototype.stopPropagation=function(){this.propagationStopped=!0,sP.call(this)},CustomEvent.prototype.stopImmediatePropagation=function(){this.immediatePropagationStopped=!0,sIP.call(this)};var define=global.define||_.noop;define((global.exports||global).Eventi=Eventi)}(this,this.document);
!function(global,document){"use strict";function Eventi(){return _.create.apply(this,arguments)}global.CustomEvent||(global.CustomEvent=document?function(a,b){b=b||{};var c=document.createEvent("CustomEvent");return c.initCustomEvent(a,!!b.bubbles,!!b.cancelable,b.detail),c}:function(a,b){b=b||{},this.type=a,this.bubbles=!!b.bubbles,this.detail=b.detail,this.timestamp=Date.now()});var _={global:new Function("return this")(),noop:function(){},slice:function(a,b){return Array.prototype.slice.call(a,b)},copy:function(a,b,c){if(a)for(c in a)a.hasOwnProperty(c)&&(b[c]=a[c])},async:global.setImmediate||function(a){return setTimeout(a,0)},resolveRE:/^([\w\$]+)?((\.[\w\$]+)|\[(\d+|'(\\'|[^'])+'|"(\\"|[^"])+")\])*$/,resolve:function(reference,context){return _.resolveRE.test(reference)?(context=context||global,eval("context"+("["!==reference.charAt(0)?"."+reference:reference))):void 0},create:function(a,b){var c={text:a+""};a=_.parse(c.text,c),_.copy(b,c),"bubbles"in c||(c.bubbles=!0);var d=new CustomEvent(a,c);for(var e in c)_.skip.indexOf(e)<0&&(d[_.prop(e)]=c[e]);return d},skip:"bubbles cancelable detail type".split(" "),prop:function(a){return a},parse:function(a,b){return _.properties.forEach(function(c){a=a.replace(c[0],function(){return c[1].apply(b,arguments)||""})}),a?b.type=a:a},properties:[[/^_/,function(){this.bubbles=!1}],[/^\!/,function(){this._protect=!0}],[/\((.*)\)/,function(a,b){try{this.detail=_.resolve(b)||JSON.parse(b)}catch(c){this.detail=b}}],[/#(\w+)/g,function(a,b){(this.tags||(this.tags=[])).push(b),this[b]=!0}],[/^(\w+):/,function(a,b){this.category=b}]],splitRE:/ (?![^\(\)]*\))+/g,wrap:function(a,b,c){c=c||1;var d=function(d){var e=_.slice(arguments);d&&"string"!=typeof d||(d=this&&this!==Eventi?this:_.global,e.unshift(d)),e[c]=e[c]?(e[c]+"").split(_.splitRE):[""],e.length>b&&(e[b]=e.slice(b),e=e.slice(0,b+1));var f,g=_[a];if("length"in d&&d!==_.global)for(var h=0,i=d.length;i>h;h++)f=g.apply(e[0]=d[h],e);else f=g.apply(d,e);return void 0===f?this:f};return d.index=c,d}};Eventi._=_,(Eventi.fy=function(a){for(var b in Eventi){var c=Eventi[b];"function"!=typeof c||c.utility||Object.defineProperty(a,b,{value:c,writable:!0,configurable:!0})}return a}).utility=!0,_.fire=function(a,b,c,d){return"object"!=typeof c||c instanceof Event||!("bubbles"in c||"detail"in c||"cancelable"in c)?(void 0!==c&&(d=d?d.unshift(c)&&d:[c]),c={data:d}):c.data=d,_.fireAll(a,b,c)},_.fireAll=function(a,b,c){for(var d,e=0;e<b.length;e++)d=_.create(b[e],c),_.dispatch(a,d);return d},_.dispatch=function(a,b,c){(a.dispatchEvent||a[_key]||_.noop).call(a,b),a.parentObject&&b.bubbles&&!b.propagationStopped&&_.dispatch(a.parentObject,b,!0),!c&&b._singleton&&_.singleton(a,b)},Eventi.fire=_.wrap("fire",3),_.on=function(a,b,c,d,e){"function"==typeof c&&(void 0!==d&&(e=e?e.unshift(d)&&e:[d]),d=c,c=null);for(var f=0,g=b.length;g>f;f++)_.handler(a,b[f],c,d,e)},_.handler=function(a,b,c,d,e){var f={target:a,selector:c,fn:d,data:e,text:b,match:{}};return _.parse(b,f.match),delete f.match.tags,a!==_&&Eventi.fire(_,"handler#new",f),f.fn!==_.noop&&_.handlers(f.target,f.match.type).push(f),f},_.handlers=function(a,b){var c=_.listener(a),d=c.s[b];return d||(d=c.s[b]=[],a.addEventListener&&a.addEventListener(b,c)),d};var _key=_._key="_eventi"+Date.now();if(_.listener=function(a){var b=a[_key];return b||(b=function(a){var c=b.s[a.type];c&&_.handle(a,c)},b.s={},Object.defineProperty(a,_key,{value:b,writeable:!1,configurable:!0})),b},_.handle=function(a,b){for(var c,d,e=0;e<b.length&&!(_.matches(a,(c=b[e]).match)&&(d=_.target(c,a.target))&&(_.execute(d,a,c),a.immediatePropagationStopped));e++);},_.execute=function(a,b,c){var d=[b];b.data&&d.push.apply(d,b.data),c.data&&d.push.apply(d,c.data);try{c.fn.apply(a,d)}catch(e){_.async(function(){throw e})}},_.unhandle=function(a){a.fn=_.noop},_.matches=function(a,b,c){for(var d in b)if(b[d]!==a[d]&&(c||"_"!==d.charAt(0)))return!1;if(c)for(d in a)if("_"===d.charAt(0)&&a[d]!==b[d])return!1;return!0},_.target=function(a,b){return a.selector?_.closest(b,a.selector):a.target},_.closest=function(a,b){for(;a&&a.matches;){if(a.matches(b))return a;a=a.parentNode}},global.Element){var Ep=Element.prototype,aS="atchesSelector";Ep.matches||Object.defineProperty(Ep,"matches",{value:Ep["webkitM"+aS]||Ep["mozM"+aS]||Ep["msM"+aS]})}Eventi.on=_.wrap("on",4),_.version="0.6.0";var sP=Event&&Event.prototype.stopPropagation||_.noop,sIP=Event&&Event.prototype.stopImmediatePropagation||_.noop;CustomEvent.prototype.stopPropagation=function(){this.propagationStopped=!0,sP.call(this)},CustomEvent.prototype.stopImmediatePropagation=function(){this.immediatePropagationStopped=!0,sIP.call(this)};var define=global.define||_.noop;define((global.exports||global).Eventi=Eventi)}(this,this.document);
{
"name": "eventi",
"title": "Eventi",
"version": "0.6.0",
"version": "0.6.1",
"homepage": "https://github.com/nbubna/Eventi",

@@ -6,0 +6,0 @@ "author": {

@@ -93,4 +93,5 @@ # Eventi

#### location.js (requires on.js and fire.js)
* Eventi.on('location', '?view={view}'||regex, function(e, url, params){ console.log(params.view); })
* Eventi.fire('location', '?view={0}', ['foo'])
* event-based routing: `Eventi.on('location', '?view={view}'||regex, function(e, url, params){ console.log(params.view); })`
* event-based history.pushState: `Eventi.fire('location', '?view={0}', ['foo'])`
* consistent event for all popstate/hashchange/pushstate changes: `Eventi.on('location', function(e){ console.log(e.uri, e.oldURI, e.srcEvent); })`

@@ -136,4 +137,6 @@

* 2014-02-11 [v0.5.0][] (first public release)
* 2014-03-06 [v0.6.1][] (location events, many fixes)
[v0.5.0]: https://github.com/nbubna/Eventi/tree/0.5.0
[v0.6.1]: https://github.com/nbubna/Eventi/tree/0.6.1

@@ -140,0 +143,0 @@

@@ -1,2 +0,3 @@

var h = global.history;
var h = global.history,
l = global.location;
_.pushState = h.pushState;

@@ -9,3 +10,2 @@ h.pushState = function() {

Eventi.on('!popstate !hashchange !pushstate', _.at = function(e, uri) {
var l = global.location;
uri = uri || decodeURI(l.pathname + l.search + l.hash);

@@ -30,5 +30,8 @@ if (uri !== _.uri) {

}
e.uri = uri;
if (uri !== _.uri) {
h.pushState(null,null, encodeURI(uri));
}
} else if (!e.uri) {
e.uri = _.uri;
}

@@ -38,22 +41,26 @@ })

if (handler.match.type === "location") {
// overloading on.js' selector argument with uri template/regex
var re = handler.selector;
delete handler.selector;
if (typeof re === "string") {
re = re.replace(/([.*+?^=!:$(|\[\/\\])/g, "\\$1");
if (handler.keys = _.keys(re)) {
re = re.replace(/\{\w+\}/g, "([^\/?#]+)");
} else {
re.replace(/\{/g, '\\{');
// always listen on window, but save given target to use as context
handler._target = handler.target;
handler.target = _.global;
if (handler.selector) {
// overloading on.js' selector argument with uri template/regex
var re = handler.selector;
delete handler.selector;
if (typeof re === "string") {
re = re.replace(/([.*+?^=!:$(|\[\/\\])/g, "\\$1");
if (handler.keys = _.keys(re)) {
re = re.replace(/\{\w+\}/g, "([^\/?#]+)");
} else {
re.replace(/\{/g, '\\{');
}
re = new RegExp(re);
}
re = new RegExp(re);
handler.regexp = re;
} else {
handler.regexp = /.+/;
}
handler.regexp = re;
// always listen on window, but use given target as context
handler._target = handler.target;
handler.target = _.global;
handler._fn = handler.fn;
handler.fn = function(e){ _.location(e.uri, handler, arguments); };
// try for current uri match immediately
_.execute(null, new Eventi('location',{uri:_.uri}), handler);
_.execute(null, new Eventi('location',{uri:_.uri||_.at()}), handler);
}

@@ -68,3 +75,3 @@ });

_.location = function(uri, handler, args) {
var matches = uri.match(handler.regexp);
var matches = (uri||_.uri).match(handler.regexp);
if (matches) {

@@ -71,0 +78,0 @@ args = _.slice(args);

@@ -107,5 +107,7 @@ _.on = function(target, events, selector, fn, data) {

aS = 'atchesSelector';
Object.defineProperty(Ep, 'matches', {value:Ep['webkitM'+aS]||Ep['mozM'+aS]||Ep['msM'+aS]});
if (!Ep['matches']) {
Object.defineProperty(Ep, 'matches', {value:Ep['webkitM'+aS]||Ep['mozM'+aS]||Ep['msM'+aS]});
}
}
Eventi.on = _.wrap('on', 4);

@@ -27,3 +27,8 @@ (function() {

module('Eventi location');
module('Eventi location', {
teardown: function() {
Eventi.off('location');
history.pushState(null,'teardown',home);
}
});

@@ -98,7 +103,16 @@ test('location Eventi.html', function() {

test('all location listener', function() {
expect(1);
Eventi.on('location#all', function(e) {
equal(e.uri, _.uri, 'should have current uri');
Eventi.off('location#all');
});
});
test('location pushstate', function() {
expect(2);
expect(3);
Eventi.on('location', '?search', function(e) {
Eventi.off('location');
ok(e.srcEvent, 'should have srcEvent');
equal(e.srcEvent.type, 'pushstate','should be pushstate source');
equal(e.uri, location.pathname+'?search', 'should have correct e.uri');

@@ -140,2 +154,12 @@ history.pushState(null,null,home);

test('alternate target', function() {
var target = {};
Eventi.on(target, 'location', '#target', function() {
equal(this, target, 'should have target context');
Eventi.off('location');
history.pushState(null,null,home);
});
history.pushState(null,'target', '#target');
});
module('Eventi location internals');

@@ -142,0 +166,0 @@

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc