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 1.2.1 to 1.3.0

src/browser.frame

2

bower.json
{
"name": "eventi",
"version": "1.2.1",
"version": "1.3.0",
"homepage": "https://github.com/esha/Eventi",

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

{
"name": "eventi",
"repo": "esha/Eventi",
"version": "1.2.1",
"version": "1.3.0",
"keywords": [

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

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

/*! Eventi - v1.2.1 - 2014-04-22
/*! Eventi - v1.3.0 - 2014-04-24
* https://github.com/esha/Eventi
* Copyright (c) 2014 ESHA Research; Licensed MIT */
!function(){var a=Eventi._,b=console.log.bind(console);a.debug=function(c,d,e,f){var g=c[a._key],h=[];if(g)for(var i=0,j=d.length;j>i;i++){var k={};if(d[i])a.parse(k.text=d[i],k.event={},k.handler={}),"function"!=typeof e&&(f=e,e=void 0),k.data=f,k.handlers=a.debug.handlers(k.event.type,k,g);else{k=[];var l={event:{},handler:{}};for(var m in g.s)k.push.apply(k,a.debug.handlers(m,l,g))}h.push(k)}return e||(e=b),h.forEach(function(b){b.text?e(a.debug.target(c),b.text,b.event,b.handler,b.handlers):b.forEach(function(b){e(a.debug.target(b.target),b.text,b)})}),h.length>1?h:h[0]},a.debug.target=function(a){return a===window?"":a},a.debug.handlers=function(b,c,d){var e=d.s[b],f=[];if(e)for(var g=0,h=e.length;h>g;g++)a.debug.match(e[g],c)&&f.push(e[g]);return f},a.debug.match=function(b,c){return a.matches(b.event,c.event)&&a.matches(b,c.handler)&&(!b.important||c.handler.important&&a.matches(c.event,b.event))&&(!c.fn||c.fn===b.fn)},a.fn("debug",3),b("Eventi, version "+a.version),Eventi.debug()}();

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

/*! Eventi - v1.2.1 - 2014-04-22
/*! Eventi - v1.3.0 - 2014-04-24
* https://github.com/esha/Eventi

@@ -9,6 +9,6 @@ * Copyright (c) 2014 ESHA Research; Licensed MIT */

try {
new global.CustomEvent('test');
new CustomEvent('test');
} catch (err) {
// polyfill CustomEvent constructor
global.CustomEvent = document ? function CustomEvent(type, args) {
global.CustomEvent = function CustomEvent(type, args) {
args = args || {};

@@ -18,14 +18,21 @@ var e = document.createEvent('CustomEvent');

return e;
} : function CustomEvent(type, args) {
args = args || {};
this.type = type;
this.bubbles = !!args.bubbles;
this.detail = args.detail;
this.timestamp = Date.now();
};
if (!global.Event){ global.Event = global.CustomEvent; }
}
function Eventi(){ return _.create.apply(this, arguments); }
var _ = {
function Eventi(text){
if (typeof text === "string") {
return _.create.apply(_, arguments);
}
return Eventi.fy(this);
}
Eventi.toString = Eventi.prototype.toString = function(){ return 'Eventi, v'+_.version; };
Eventi.fy = function fy(o) {
for (var p in _.fns) {
Object.defineProperty(o, p, {value:Eventi[p], writable:true, configurable:true});
}
return o;
};
var _ = Eventi._ = {
version: "1.3.0",
global: new Function('return this')(),

@@ -101,3 +108,3 @@ noop: function(){},

var args = _.slice(arguments);
if (!target || typeof target === "string" || target instanceof global.Event) {// ensure target
if (!target || typeof target === "string" || target instanceof Event) {// ensure target
args.unshift(target = !this || this === Eventi ? _.global : this);

@@ -165,10 +172,2 @@ }

};
Eventi.toString = function(){ return 'Eventi, v'+_.version; };
Eventi._ = _;
Eventi.fy = function fy(o) {
for (var p in _.fns) {
Object.defineProperty(o, p, {value:Eventi[p], writable:true, configurable:true});
}
return o;
};

@@ -817,3 +816,3 @@ _.parsers.unshift([/^(\W*)\//, function(event, handler, other) {

if (!this.unfired.join('')) {
var event = new Eventi('combo:'+this.event.type);
var event = _.create('combo:'+this.event.type);
event.events = this.events;

@@ -842,6 +841,5 @@ event.text = this.text;

});
_.version = "1.2.1";
var sP = (global.Event && Event.prototype.stopPropagation) || _.noop,
sIP = (global.Event && Event.prototype.stopImmediatePropagation) || _.noop;
var sP = Event.prototype.stopPropagation || _.noop,
sIP = Event.prototype.stopImmediatePropagation || _.noop;
CustomEvent.prototype.stopPropagation = function() {

@@ -848,0 +846,0 @@ this.propagationStopped = true;

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

/*! Eventi - v1.2.1 - 2014-04-22
/*! Eventi - v1.3.0 - 2014-04-24
* https://github.com/esha/Eventi
* Copyright (c) 2014 ESHA Research; Licensed MIT */
!function(global,document){"use strict";function Eventi(){return _.create.apply(this,arguments)}try{new global.CustomEvent("test")}catch(err){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()},global.Event||(global.Event=global.CustomEvent)}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("object"==typeof a)for(c in a)a.hasOwnProperty(c)&&(b[c]=a[c])},async:global.setImmediate&&setImmediate.bind(global)||function(a){return setTimeout(a,0)},resolveRE:/^([\w\$]+)?((\.[\w\$]+)|\[(\d+|'(\\'|[^'])+'|"(\\"|[^"])+")\])*$/,resolve:function(reference,context,tested){if(tested||_.resolveRE.test(reference)){context=context||global;try{return eval("context"+("["!==reference.charAt(0)?"."+reference:reference))}catch(e){}}},create:function(a,b){var c={text:a+""};a=_.parse(c.text,c,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,c){return _.parsers.forEach(function(d){a=a.replace(d[0],function(){var a=_.slice(arguments,1);return a.unshift(b,c),d[1].apply(b,a)||""})}),a?b.type=a:a},parsers:[[/^(\W*)_/,function(a,b,c){return a.bubbles=!1,c}],[/\((.*)\)/,function(a,b,c){try{a.detail=_.resolve(c)||JSON.parse(c)}catch(d){a.detail=c}}],[/#(\w+)/g,function(a,b,c){(a.tags||(a.tags=[])).push(c),a[c]=!0}],[/^(\w+):/,function(a,b,c){a.category=c}]],fn:function(a,b){Eventi[a]=_.fns[a]=function(c){var d=_.slice(arguments);(!c||"string"==typeof c||c instanceof global.Event)&&d.unshift(c=this&&this!==Eventi?this:_.global),d.length>b&&(d[b]=d.slice(b),d=d.slice(0,b+1)),d[1]&&"string"!=typeof d[1]||(d[1]=_.split.ter(d[1]));var e,f=_[a];if("length"in c&&c!==_.global)for(var g=0,h=c.length;h>g;g++)e=f.apply(d[0]=c[g],d);else e=f.apply(c,d);return void 0===e?this:e}},fns:{},split:{guard:{"(":")"},ter:function(a,b){var c,d=[],e="";if(a){b=_.slice(arguments,1),b.unshift(" ");for(var f=0,g=a.length;g>f;f++){var h=a.charAt(f);!c&&b.indexOf(h)>=0?(e&&d.push(e),e=""):(e+=h,c?c===h&&("\\"===e.charAt(e.length-2)?e=e.replace("\\"+h,h):c=null):c=_.split.guard[h])}e&&d.push(e)}else d.push("");return d}}};Eventi.toString=function(){return"Eventi, v"+_.version},Eventi._=_,Eventi.fy=function(a){for(var b in _.fns)Object.defineProperty(a,b,{value:Eventi[b],writable:!0,configurable:!0});return a},_.parsers.unshift([/^(\W*)\//,function(a,b,c){return b.global=!0,c}]),_.fire=function(a,b,c){return b instanceof Event?(b.data=c,_.dispatch(a,b),b):_.fireAll(a,b,{data: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){b.global&&(a=_.global),(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)},_.fn("fire",2),_.parsers.unshift([/^(\W*)\!/,function(a,b,c){return b.important=!0,c}]),_.on=function(a,b,c,d){if(a!==_.global&&1===b.length&&""===b[0]&&(b=a,a=_.global),Array.isArray(b))for(var e=0,f=b.length;f>e;e++)_.handler(a,b[e],c,d);else{void 0!==c&&(d=d?d.unshift(c)&&d:[c]);for(var g in b)_.handler(a,g,b[g],d)}},_.handler=function(a,b,c,d){var e={target:a,fn:c,data:d,text:b,event:{}};return _.parse(b,e.event,e),delete e.event.tags,a!==_&&Eventi.fire(_,"on:handler",e),e.fn!==_.noop&&(a=e.global===!0?_.global:e.target,_.handlers(a,e.event.type).push(e)),e},_.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=0;d<b.length&&(!_.matches(a,(c=b[d]).event)||(_.execute(a,c),!a.immediatePropagationStopped));d++);},_.execute=function(a,b){var c=[a],d=b.fn,e={target:b.target,args:c};if(a.data&&c.push.apply(c,a.data),b.data&&c.push.apply(c,b.data),b.filters)for(var f=0,g=b.filters.length;g>f&&e.target;f++)b.filters[f].call(e,a,b);if(e.target){try{d.apply(e.target,e.args)}catch(h){_.async(function(){throw h})}b.end&&b.end.apply(e.target,e.args)&&_.unhandle(b)}},_.filter=function(a,b){a.filters=a.filters||[],a.filters.push(b)},_.unhandle=function(a){a.fn=_.noop},_.matches=function(a,b){for(var c in b)if(b[c]!==a[c])return!1;return!0},_.fn("on",3),_.parsers.unshift([/=>(\w+)$/,function(a,b,c){b.alias=c,b!==a&&(b.data=b.data||[],b.data.push(c))}]),_.alias=function(a,b,c){return function(a){var d=_.slice(arguments),e="object"!=typeof a||!a.dispatchEvent&&!a[_key]?0:1;return d.splice(e,0,b),this.apply(c,d)}},Eventi.alias=function(a,b){"string"==typeof a&&(b=a,a=Eventi);var c,d=_.split.ter(b);for(var e in _.fns)for(var f=0,g=d.length;g>f;f++)c={},_.parse(d[f],c,c),c.alias=c.alias||c.type,a[e][c.alias]=_.alias(c.alias,d[f],a);return c},_.split.guard["<"]=">",_.parsers.unshift([/<(.+)>/,function(a,b,c){b.selector=c,_.delegate&&a!==b&&_.filter(b,_.delegate)}]),global.Element){_.delegate=function(a,b){this.target=_.closest(a.target,b.selector)},_.closest=function(a,b){for(;a&&a.matches;){if(a.matches(b))return a;a=a.parentNode}};var Ep=Element.prototype,aS="atchesSelector";Ep.matches||Object.defineProperty(Ep,"matches",{value:Ep["webkitM"+aS]||Ep["mozM"+aS]||Ep["msM"+aS]})}document&&(_.init=function(){for(var a=document.querySelectorAll("[eventi],[data-eventi]"),b=0,c=a.length;c>b;b++){var d=a[b],e=d.getAttribute("data-eventi")||d.getAttribute("eventi");e!==d.eventi&&(_.off&&d.eventi&&Eventi.off(d,d.eventi,_.declared),d.eventi=e,_.declare(d,e))}(a.length||document.querySelectorAll("[click],[data-click]").length)&&Eventi.on("click keyup",_.check)},_.declare=function(a,b){for(var c=_.split.ter(b),d=0,e=c.length;e>d;d++)Eventi.on(a,c[d],_.declared)},_.declared=function(a,b){b="string"==typeof b?b:a.type;for(var c=_.declarers(this,b,a.target),d=0,e=c.length;e>d;d++)_.respond(c[d],b,a)},_.declarers=function(a,b,c){for(var d="["+b+"],[data-"+b+"]",e=[],f=!1;c&&c.matches;){if(c.matches(d)&&e.push(c),c===a){f=!0;break}c=c.parentNode}return f?e:a.querySelectorAll(d)},_.respond=function(a,b,c){var d=a.getAttribute("data-"+b)||a.getAttribute(b)||b;if(d){var e=_.resolve(d,a)||_.resolve(d);"function"==typeof e?e.call(a,c):Eventi.fire(a,d,c)}},_.check=function(a){var b=a.target.getAttribute&&("click"===a.type&&_.click(a.target)||13===a.keyCode&&_.click(a.target,!0));b&&(_.declared.call(document.documentElement,a,"click"),"noDefault"!==b||_.allowDefault(a.target)||a.preventDefault())},_.allowDefault=function(a){return"radio"===a.type||"checkbox"===a.type},_.click=function(a,b){var c=a.getAttribute("click");if(c&&"false"!==c)return"noDefault";if(!a.isContentEditable){var d=a.nodeName.toLowerCase();return"textarea"!==d&&("select"!==d||b)&&(b?!("a"===d&&a.getAttribute("href")||"button"===d||"input"===d&&_.buttonRE.test(a.type)):"input"!==d||_.buttonRE.test(a.type))}},_.buttonRE=/^(submit|button|reset)$/,Eventi.on("DOMContentLoaded",_.init)),_.split.guard["["]="]",_.parsers.push([/\[([^ ]+)\]/,function(a,b,c){for(var d;(d=c.indexOf("-"))>0;)a[c.substring(0,d)+"Key"]=!0,c=c.substring(d+1);c&&(a.keyCode=_.codes[c]||parseInt(c,10)||c)}]),_.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,";":186,"=":187,",":188,"-":189,".":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;if("abcdefghijklmnopqrstuvwxyz 0123456789".split("").forEach(function(a){_.codes[a]=a.toUpperCase().charCodeAt(0)}),Eventi.on(_,"on:handler",function(a,b){b.event.keyCode&&!b.event.type&&(b.event.type="keyup")}),_.split.guard["@"]="@",_.parsers.unshift([/@([^@]+)(@|$)/,function(a,b,c){b.location=c,_.location&&a!==b&&_.locationHandler(c,b)}]),global.history&&global.location){var current;_.pushState=history.pushState,history.pushState=function(){var a=_.pushState.apply(this,arguments);return _.dispatch(_.global,new CustomEvent("pushstate")),a},_.location=function(a,b){return b=b||decodeURI(location.pathname+location.search+location.hash),b!==current&&_.dispatch(_.global,new Eventi("location",{oldLocation:current,location:current=b,srcEvent:a})),current},_.setLocation=function(a,b,c){if("string"!=typeof b&&(c=b,b=a.location),b){var d=_.keys(b);d&&(b=d.reduce(function(a,b){return a.replace(new RegExp("\\{"+b+"\\}","g"),c[b]||location[b]||"")},b)),b!==current&&history.pushState(null,null,encodeURI(b))}},_.keys=function(a){var b=a.match(/\{\w+\}/g);return b&&b.map(function(a){return a.substring(1,a.length-1)})},_.locationHandler=function(a,b){var c=a;"`"===a.charAt(0)?c=c.substring(1,c.length-1):(c=c.replace(/([.*+?^=!:$(|\[\/\\])/g,"\\$1"),(b.keys=_.keys(c))?c=c.replace(/\{\w+\}/g,"([^/?#]+)"):c.replace(/\{/g,"\\{")),b.uriRE=new RegExp(c),_.filter(b,_.locationFilter)},_.locationFilter=function(a,b){var c=(a.location||current).match(b.uriRE);c?(this.args.splice.apply(this.args,[1,0].concat(c)),b.keys&&(this.args[1]=b.keys.reduce(function(a,b){return a[b]=c.shift(),a},{match:c.shift()}))):this.target=void 0},Eventi.on("!popstate !hashchange !pushstate",_.location).on("!location",_.setLocation).on(_,"on:handler",function(a,b){b.location&&!b.event.type&&(b.event.type="location"),"location"===b.event.type&&(b.global=!0,current||_.location(),_.execute(new Eventi("location",{location:current,srcEvent:a}),b))})}_.off=function(a,b,c){var d=a[_key];if(d){for(var e=0,f=b.length;f>e;e++){var g={event:{},handler:{},fn:c,text:b[e]};if(_.parse(b[e],g.event,g.handler),delete g.event.tags,delete g.handler.filters,delete g.handler.end,a!==_&&Eventi.fire(_,"off:filter",g),g.event.type)_.clean(g.event.type,g,d,a);else for(var 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)},_.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(_,"off:cleaned",h),g--}e.length||(d.removeEventListener&&d.removeEventListener(a,c),delete c.s[a])}},_.cleans=function(a,b){return _.matches(a.event,b.event)&&_.matches(a,b.handler)&&(!a.important||b.handler.important&&_.matches(b.event,a.event))&&(!b.fn||b.fn===a.fn)},_.fn("off",3),_.parsers.unshift([/^(\W*)\^/,function(a,b,c){return b.singleton=!0,a!==b&&_.filter(b,_.before),c}]),_.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)},_.before=function(a,b){_.unhandle(b),b.fn=_.noop,a[_skey]||_.remember(this.target,a)},Eventi.on(_,"on:handler",function(a,b){if(b.singleton)for(var c=b.target[_skey]||[],d=0,e=c.length;e>d;d++){var f=c[d];if(_.matches(f,b.event)){_.execute(f,b);break}}}),document&&Eventi.on("DOMContentLoaded",function(a){Eventi.fire(document.documentElement,"^ready",a)}),_.parsers.unshift([/\$(\!?\w+(\.\w+)*)/,function(a,b,c){b.endtest=c,b.end=_.endTest(c)}]),_.endTest=function(a){var b=parseInt(a,10);if(b)return function(){return!--b};var c="!"===a.charAt(0);return c&&(a=a.substring(1)),a&&_.resolveRE.test(a)?function(){var b=_.resolve(a,this,!0);return void 0===b&&(b=_.resolve(a,!0)),"function"==typeof b&&(b=b.apply(this,arguments)),c?!b:b}:void 0},_.fireAll=function(a,b,c,d){for(var e,f,g=0;g<b.length;g++){f=c.sequence=_.split.ter(b[g],"+",",");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.join(",")],b,a||b.index+1))},a.pauseSequence=function(a){return d!==!1?(d=!0,a&&a.then(this.resumeSequence)):void 0},a.isSequencePaused=function(){return!!d}},_.combo={convert:function(a,b,c){a.event=_.combo.event(b),a.data&&"number"==typeof a.data[0]&&(a.timeout=a.data.shift()),delete a.singleton,delete a.selector,delete a.location,delete a.filters,delete a.endtest,delete a.end,a.texts=c,a.ordered=c.ordered,a.reset=_.combo.reset.bind(a),a.handlers=c.map(function(b,c){return _.handler(a.target,b,_.combo.eventFn.bind(a,c))}),a.reset()},event:function(a){return _.combo[a]||(_.combo[a]={category:"combo",type:"_"+ ++_.combo.count})},split:function(a){var b=_.split.ter(a,"+");return b.length>1?b.ordered=!1:(b=_.split.ter(a,","),b.length>1&&(b.ordered=!0)),b},count:0,reset:function(){this.clear&&clearTimeout(this.clear),this.unfired=this.texts.slice(),this.events=[]},eventFn:function(a,b){if(this.timeout&&!this.clear&&(this.clear=setTimeout(this.reset,this.timeout)),this.events.indexOf(b)<0&&(!this.ordered||a-1===this.unfired.lastIndexOf(""))&&(this.unfired[a]="",this.events.push(b),!this.unfired.join(""))){var c=new Eventi("combo:"+this.event.type);c.events=this.events,c.text=this.text,_.dispatch(this.target,c),this.reset()}}},Eventi.on(_,"on:handler",function(a,b){var c=b.text,d=_.combo.split(c);d.length>1&&_.combo.convert(b,c,d)}).on(_,"off:filter",function(a,b){_.combo.split(b.text).length>1&&(b.event=_.combo.event(b.text))}).on(_,"off:cleaned",function(a,b){b.handlers&&b.handlers.forEach(_.unhandle)}),_.version="1.2.1";var sP=global.Event&&Event.prototype.stopPropagation||_.noop,sIP=global.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(a){return"string"==typeof a?_.create.apply(_,arguments):Eventi.fy(this)}try{new CustomEvent("test")}catch(err){global.CustomEvent=function(a,b){b=b||{};var c=document.createEvent("CustomEvent");return c.initCustomEvent(a,!!b.bubbles,!!b.cancelable,b.detail),c}}Eventi.toString=Eventi.prototype.toString=function(){return"Eventi, v"+_.version},Eventi.fy=function(a){for(var b in _.fns)Object.defineProperty(a,b,{value:Eventi[b],writable:!0,configurable:!0});return a};var _=Eventi._={version:"1.3.0",global:new Function("return this")(),noop:function(){},slice:function(a,b){return Array.prototype.slice.call(a,b)},copy:function(a,b,c){if("object"==typeof a)for(c in a)a.hasOwnProperty(c)&&(b[c]=a[c])},async:global.setImmediate&&setImmediate.bind(global)||function(a){return setTimeout(a,0)},resolveRE:/^([\w\$]+)?((\.[\w\$]+)|\[(\d+|'(\\'|[^'])+'|"(\\"|[^"])+")\])*$/,resolve:function(reference,context,tested){if(tested||_.resolveRE.test(reference)){context=context||global;try{return eval("context"+("["!==reference.charAt(0)?"."+reference:reference))}catch(e){}}},create:function(a,b){var c={text:a+""};a=_.parse(c.text,c,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,c){return _.parsers.forEach(function(d){a=a.replace(d[0],function(){var a=_.slice(arguments,1);return a.unshift(b,c),d[1].apply(b,a)||""})}),a?b.type=a:a},parsers:[[/^(\W*)_/,function(a,b,c){return a.bubbles=!1,c}],[/\((.*)\)/,function(a,b,c){try{a.detail=_.resolve(c)||JSON.parse(c)}catch(d){a.detail=c}}],[/#(\w+)/g,function(a,b,c){(a.tags||(a.tags=[])).push(c),a[c]=!0}],[/^(\w+):/,function(a,b,c){a.category=c}]],fn:function(a,b){Eventi[a]=_.fns[a]=function(c){var d=_.slice(arguments);(!c||"string"==typeof c||c instanceof Event)&&d.unshift(c=this&&this!==Eventi?this:_.global),d.length>b&&(d[b]=d.slice(b),d=d.slice(0,b+1)),d[1]&&"string"!=typeof d[1]||(d[1]=_.split.ter(d[1]));var e,f=_[a];if("length"in c&&c!==_.global)for(var g=0,h=c.length;h>g;g++)e=f.apply(d[0]=c[g],d);else e=f.apply(c,d);return void 0===e?this:e}},fns:{},split:{guard:{"(":")"},ter:function(a,b){var c,d=[],e="";if(a){b=_.slice(arguments,1),b.unshift(" ");for(var f=0,g=a.length;g>f;f++){var h=a.charAt(f);!c&&b.indexOf(h)>=0?(e&&d.push(e),e=""):(e+=h,c?c===h&&("\\"===e.charAt(e.length-2)?e=e.replace("\\"+h,h):c=null):c=_.split.guard[h])}e&&d.push(e)}else d.push("");return d}}};_.parsers.unshift([/^(\W*)\//,function(a,b,c){return b.global=!0,c}]),_.fire=function(a,b,c){return b instanceof Event?(b.data=c,_.dispatch(a,b),b):_.fireAll(a,b,{data: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){b.global&&(a=_.global),(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)},_.fn("fire",2),_.parsers.unshift([/^(\W*)\!/,function(a,b,c){return b.important=!0,c}]),_.on=function(a,b,c,d){if(a!==_.global&&1===b.length&&""===b[0]&&(b=a,a=_.global),Array.isArray(b))for(var e=0,f=b.length;f>e;e++)_.handler(a,b[e],c,d);else{void 0!==c&&(d=d?d.unshift(c)&&d:[c]);for(var g in b)_.handler(a,g,b[g],d)}},_.handler=function(a,b,c,d){var e={target:a,fn:c,data:d,text:b,event:{}};return _.parse(b,e.event,e),delete e.event.tags,a!==_&&Eventi.fire(_,"on:handler",e),e.fn!==_.noop&&(a=e.global===!0?_.global:e.target,_.handlers(a,e.event.type).push(e)),e},_.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=0;d<b.length&&(!_.matches(a,(c=b[d]).event)||(_.execute(a,c),!a.immediatePropagationStopped));d++);},_.execute=function(a,b){var c=[a],d=b.fn,e={target:b.target,args:c};if(a.data&&c.push.apply(c,a.data),b.data&&c.push.apply(c,b.data),b.filters)for(var f=0,g=b.filters.length;g>f&&e.target;f++)b.filters[f].call(e,a,b);if(e.target){try{d.apply(e.target,e.args)}catch(h){_.async(function(){throw h})}b.end&&b.end.apply(e.target,e.args)&&_.unhandle(b)}},_.filter=function(a,b){a.filters=a.filters||[],a.filters.push(b)},_.unhandle=function(a){a.fn=_.noop},_.matches=function(a,b){for(var c in b)if(b[c]!==a[c])return!1;return!0},_.fn("on",3),_.parsers.unshift([/=>(\w+)$/,function(a,b,c){b.alias=c,b!==a&&(b.data=b.data||[],b.data.push(c))}]),_.alias=function(a,b,c){return function(a){var d=_.slice(arguments),e="object"!=typeof a||!a.dispatchEvent&&!a[_key]?0:1;return d.splice(e,0,b),this.apply(c,d)}},Eventi.alias=function(a,b){"string"==typeof a&&(b=a,a=Eventi);var c,d=_.split.ter(b);for(var e in _.fns)for(var f=0,g=d.length;g>f;f++)c={},_.parse(d[f],c,c),c.alias=c.alias||c.type,a[e][c.alias]=_.alias(c.alias,d[f],a);return c},_.split.guard["<"]=">",_.parsers.unshift([/<(.+)>/,function(a,b,c){b.selector=c,_.delegate&&a!==b&&_.filter(b,_.delegate)}]),global.Element){_.delegate=function(a,b){this.target=_.closest(a.target,b.selector)},_.closest=function(a,b){for(;a&&a.matches;){if(a.matches(b))return a;a=a.parentNode}};var Ep=Element.prototype,aS="atchesSelector";Ep.matches||Object.defineProperty(Ep,"matches",{value:Ep["webkitM"+aS]||Ep["mozM"+aS]||Ep["msM"+aS]})}document&&(_.init=function(){for(var a=document.querySelectorAll("[eventi],[data-eventi]"),b=0,c=a.length;c>b;b++){var d=a[b],e=d.getAttribute("data-eventi")||d.getAttribute("eventi");e!==d.eventi&&(_.off&&d.eventi&&Eventi.off(d,d.eventi,_.declared),d.eventi=e,_.declare(d,e))}(a.length||document.querySelectorAll("[click],[data-click]").length)&&Eventi.on("click keyup",_.check)},_.declare=function(a,b){for(var c=_.split.ter(b),d=0,e=c.length;e>d;d++)Eventi.on(a,c[d],_.declared)},_.declared=function(a,b){b="string"==typeof b?b:a.type;for(var c=_.declarers(this,b,a.target),d=0,e=c.length;e>d;d++)_.respond(c[d],b,a)},_.declarers=function(a,b,c){for(var d="["+b+"],[data-"+b+"]",e=[],f=!1;c&&c.matches;){if(c.matches(d)&&e.push(c),c===a){f=!0;break}c=c.parentNode}return f?e:a.querySelectorAll(d)},_.respond=function(a,b,c){var d=a.getAttribute("data-"+b)||a.getAttribute(b)||b;if(d){var e=_.resolve(d,a)||_.resolve(d);"function"==typeof e?e.call(a,c):Eventi.fire(a,d,c)}},_.check=function(a){var b=a.target.getAttribute&&("click"===a.type&&_.click(a.target)||13===a.keyCode&&_.click(a.target,!0));b&&(_.declared.call(document.documentElement,a,"click"),"noDefault"!==b||_.allowDefault(a.target)||a.preventDefault())},_.allowDefault=function(a){return"radio"===a.type||"checkbox"===a.type},_.click=function(a,b){var c=a.getAttribute("click");if(c&&"false"!==c)return"noDefault";if(!a.isContentEditable){var d=a.nodeName.toLowerCase();return"textarea"!==d&&("select"!==d||b)&&(b?!("a"===d&&a.getAttribute("href")||"button"===d||"input"===d&&_.buttonRE.test(a.type)):"input"!==d||_.buttonRE.test(a.type))}},_.buttonRE=/^(submit|button|reset)$/,Eventi.on("DOMContentLoaded",_.init)),_.split.guard["["]="]",_.parsers.push([/\[([^ ]+)\]/,function(a,b,c){for(var d;(d=c.indexOf("-"))>0;)a[c.substring(0,d)+"Key"]=!0,c=c.substring(d+1);c&&(a.keyCode=_.codes[c]||parseInt(c,10)||c)}]),_.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,";":186,"=":187,",":188,"-":189,".":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;if("abcdefghijklmnopqrstuvwxyz 0123456789".split("").forEach(function(a){_.codes[a]=a.toUpperCase().charCodeAt(0)}),Eventi.on(_,"on:handler",function(a,b){b.event.keyCode&&!b.event.type&&(b.event.type="keyup")}),_.split.guard["@"]="@",_.parsers.unshift([/@([^@]+)(@|$)/,function(a,b,c){b.location=c,_.location&&a!==b&&_.locationHandler(c,b)}]),global.history&&global.location){var current;_.pushState=history.pushState,history.pushState=function(){var a=_.pushState.apply(this,arguments);return _.dispatch(_.global,new CustomEvent("pushstate")),a},_.location=function(a,b){return b=b||decodeURI(location.pathname+location.search+location.hash),b!==current&&_.dispatch(_.global,new Eventi("location",{oldLocation:current,location:current=b,srcEvent:a})),current},_.setLocation=function(a,b,c){if("string"!=typeof b&&(c=b,b=a.location),b){var d=_.keys(b);d&&(b=d.reduce(function(a,b){return a.replace(new RegExp("\\{"+b+"\\}","g"),c[b]||location[b]||"")},b)),b!==current&&history.pushState(null,null,encodeURI(b))}},_.keys=function(a){var b=a.match(/\{\w+\}/g);return b&&b.map(function(a){return a.substring(1,a.length-1)})},_.locationHandler=function(a,b){var c=a;"`"===a.charAt(0)?c=c.substring(1,c.length-1):(c=c.replace(/([.*+?^=!:$(|\[\/\\])/g,"\\$1"),(b.keys=_.keys(c))?c=c.replace(/\{\w+\}/g,"([^/?#]+)"):c.replace(/\{/g,"\\{")),b.uriRE=new RegExp(c),_.filter(b,_.locationFilter)},_.locationFilter=function(a,b){var c=(a.location||current).match(b.uriRE);c?(this.args.splice.apply(this.args,[1,0].concat(c)),b.keys&&(this.args[1]=b.keys.reduce(function(a,b){return a[b]=c.shift(),a},{match:c.shift()}))):this.target=void 0},Eventi.on("!popstate !hashchange !pushstate",_.location).on("!location",_.setLocation).on(_,"on:handler",function(a,b){b.location&&!b.event.type&&(b.event.type="location"),"location"===b.event.type&&(b.global=!0,current||_.location(),_.execute(new Eventi("location",{location:current,srcEvent:a}),b))})}_.off=function(a,b,c){var d=a[_key];if(d){for(var e=0,f=b.length;f>e;e++){var g={event:{},handler:{},fn:c,text:b[e]};if(_.parse(b[e],g.event,g.handler),delete g.event.tags,delete g.handler.filters,delete g.handler.end,a!==_&&Eventi.fire(_,"off:filter",g),g.event.type)_.clean(g.event.type,g,d,a);else for(var 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)},_.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(_,"off:cleaned",h),g--}e.length||(d.removeEventListener&&d.removeEventListener(a,c),delete c.s[a])}},_.cleans=function(a,b){return _.matches(a.event,b.event)&&_.matches(a,b.handler)&&(!a.important||b.handler.important&&_.matches(b.event,a.event))&&(!b.fn||b.fn===a.fn)},_.fn("off",3),_.parsers.unshift([/^(\W*)\^/,function(a,b,c){return b.singleton=!0,a!==b&&_.filter(b,_.before),c}]),_.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)},_.before=function(a,b){_.unhandle(b),b.fn=_.noop,a[_skey]||_.remember(this.target,a)},Eventi.on(_,"on:handler",function(a,b){if(b.singleton)for(var c=b.target[_skey]||[],d=0,e=c.length;e>d;d++){var f=c[d];if(_.matches(f,b.event)){_.execute(f,b);break}}}),document&&Eventi.on("DOMContentLoaded",function(a){Eventi.fire(document.documentElement,"^ready",a)}),_.parsers.unshift([/\$(\!?\w+(\.\w+)*)/,function(a,b,c){b.endtest=c,b.end=_.endTest(c)}]),_.endTest=function(a){var b=parseInt(a,10);if(b)return function(){return!--b};var c="!"===a.charAt(0);return c&&(a=a.substring(1)),a&&_.resolveRE.test(a)?function(){var b=_.resolve(a,this,!0);return void 0===b&&(b=_.resolve(a,!0)),"function"==typeof b&&(b=b.apply(this,arguments)),c?!b:b}:void 0},_.fireAll=function(a,b,c,d){for(var e,f,g=0;g<b.length;g++){f=c.sequence=_.split.ter(b[g],"+",",");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.join(",")],b,a||b.index+1))},a.pauseSequence=function(a){return d!==!1?(d=!0,a&&a.then(this.resumeSequence)):void 0},a.isSequencePaused=function(){return!!d}},_.combo={convert:function(a,b,c){a.event=_.combo.event(b),a.data&&"number"==typeof a.data[0]&&(a.timeout=a.data.shift()),delete a.singleton,delete a.selector,delete a.location,delete a.filters,delete a.endtest,delete a.end,a.texts=c,a.ordered=c.ordered,a.reset=_.combo.reset.bind(a),a.handlers=c.map(function(b,c){return _.handler(a.target,b,_.combo.eventFn.bind(a,c))}),a.reset()},event:function(a){return _.combo[a]||(_.combo[a]={category:"combo",type:"_"+ ++_.combo.count})},split:function(a){var b=_.split.ter(a,"+");return b.length>1?b.ordered=!1:(b=_.split.ter(a,","),b.length>1&&(b.ordered=!0)),b},count:0,reset:function(){this.clear&&clearTimeout(this.clear),this.unfired=this.texts.slice(),this.events=[]},eventFn:function(a,b){if(this.timeout&&!this.clear&&(this.clear=setTimeout(this.reset,this.timeout)),this.events.indexOf(b)<0&&(!this.ordered||a-1===this.unfired.lastIndexOf(""))&&(this.unfired[a]="",this.events.push(b),!this.unfired.join(""))){var c=_.create("combo:"+this.event.type);c.events=this.events,c.text=this.text,_.dispatch(this.target,c),this.reset()}}},Eventi.on(_,"on:handler",function(a,b){var c=b.text,d=_.combo.split(c);d.length>1&&_.combo.convert(b,c,d)}).on(_,"off:filter",function(a,b){_.combo.split(b.text).length>1&&(b.event=_.combo.event(b.text))}).on(_,"off:cleaned",function(a,b){b.handlers&&b.handlers.forEach(_.unhandle)});var sP=Event.prototype.stopPropagation||_.noop,sIP=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,29 +0,40 @@

/*! Eventi - v1.2.1 - 2014-04-22
/*! Eventi - v1.3.0 - 2014-04-24
* https://github.com/esha/Eventi
* Copyright (c) 2014 ESHA Research; Licensed MIT */
(function(global, document) {
(function(global, exports, document) {
"use strict";
try {
new global.CustomEvent('test');
} catch (err) {
// polyfill CustomEvent constructor
global.CustomEvent = document ? function CustomEvent(type, args) {
args = args || {};
var e = document.createEvent('CustomEvent');
e.initCustomEvent(type, !!args.bubbles, !!args.cancelable, args.detail);
return e;
} : function CustomEvent(type, args) {
args = args || {};
this.type = type;
this.bubbles = !!args.bubbles;
this.detail = args.detail;
this.timestamp = Date.now();
};
if (!global.Event){ global.Event = global.CustomEvent; }
var Event = exports.Event = function Event(type, args) {
args = args || {};
this.type = type;
this.bubbles = !!args.bubbles;
this.detail = args.detail;
this.timeStamp = Date.now();
},
CustomEvent = Event;// no difference for server
Event.prototype.stopPropagation = function() {
this.propagationStopped = true;
};
Event.prototype.stopImmediatePropagation = function() {
this.immediatePropagationStopped = true;
};
function Eventi(text){
if (typeof text === "string") {
return _.create.apply(_, arguments);
}
return Eventi.fy(this);
}
Eventi.toString = Eventi.prototype.toString = function(){ return 'Eventi, v'+_.version; };
Eventi.fy = function fy(o) {
for (var p in _.fns) {
Object.defineProperty(o, p, {value:Eventi[p], writable:true, configurable:true});
}
return o;
};
function Eventi(){ return _.create.apply(this, arguments); }
var _ = {
var _ = Eventi._ = {
version: "1.3.0",
global: new Function('return this')(),

@@ -99,3 +110,3 @@ noop: function(){},

var args = _.slice(arguments);
if (!target || typeof target === "string" || target instanceof global.Event) {// ensure target
if (!target || typeof target === "string" || target instanceof Event) {// ensure target
args.unshift(target = !this || this === Eventi ? _.global : this);

@@ -163,10 +174,2 @@ }

};
Eventi.toString = function(){ return 'Eventi, v'+_.version; };
Eventi._ = _;
Eventi.fy = function fy(o) {
for (var p in _.fns) {
Object.defineProperty(o, p, {value:Eventi[p], writable:true, configurable:true});
}
return o;
};

@@ -564,3 +567,3 @@ _.parsers.unshift([/^(\W*)\//, function(event, handler, other) {

if (!this.unfired.join('')) {
var event = new Eventi('combo:'+this.event.type);
var event = _.create('combo:'+this.event.type);
event.events = this.events;

@@ -589,19 +592,5 @@ event.text = this.text;

});
_.version = "1.2.1";
var sP = (global.Event && Event.prototype.stopPropagation) || _.noop,
sIP = (global.Event && Event.prototype.stopImmediatePropagation) || _.noop;
CustomEvent.prototype.stopPropagation = function() {
this.propagationStopped = true;
sP.call(this);
};
CustomEvent.prototype.stopImmediatePropagation = function() {
this.immediatePropagationStopped = true;
sIP.call(this);
};
exports.Eventi = Eventi;
// export Eventi (AMD, commonjs, or window/env)
var define = global.define || _.noop;
define((global.exports||global).Eventi = Eventi);
})(this, this.document);
})(global, exports, global.document);

@@ -18,7 +18,7 @@ module.exports = function(grunt) {

frame: {
options: {
frame: 'src/Eventi.frame'
},
dist: {
dest: 'dist/<%= pkg.name %>.js',
options: {
frame: 'src/browser.frame'
},
src: ['src/core.js','src/fire.js','src/on.js', 'src/alias.js',

@@ -29,2 +29,5 @@ 'src/delegate.js', 'src/declare.js', 'src/key.js', 'src/location.js',

server: {
options: {
frame: 'src/server.frame'
},
dest: 'dist/<%= pkg.name %>.server.js',

@@ -60,2 +63,5 @@ src: ['src/core.js','src/fire.js','src/on.js', 'src/alias.js',

},
nodeunit: {
server: ['test/server/*.js']
},
jshint: {

@@ -84,4 +90,10 @@ gruntfile: {

},
src: ['test/**/*.js']
src: ['test/*.js']
},
nodetest: {
options: {
jshintrc: 'test/server/.jshintrc'
},
src: ['test/server/*.js']
}
},

@@ -112,6 +124,7 @@ watch: {

grunt.loadNpmTasks('grunt-contrib-compress');
grunt.loadNpmTasks('grunt-contrib-nodeunit');
// Default task.
grunt.registerTask('default', ['jshint:src', 'clean', 'frame', 'jshint:dist', 'jshint:test', 'qunit', 'uglify', 'compress']);
grunt.registerTask('default', ['jshint:src', 'clean', 'frame', 'jshint:dist', 'jshint:test', 'qunit', 'nodeunit', 'uglify', 'compress']);
};
{
"name": "eventi",
"title": "Eventi",
"version": "1.2.1",
"version": "1.3.0",
"homepage": "https://github.com/esha/Eventi",

@@ -38,3 +38,4 @@ "author": {

"grunt-cli": "^0.1",
"grunt": "~0.4.1"
"grunt": "~0.4.1",
"grunt-contrib-nodeunit": "~0.3.3"
},

@@ -63,2 +64,2 @@ "keywords": [

]
}
}

@@ -436,2 +436,3 @@ # Eventi

* 2014-04-22 [v1.2.1][] (beta - docs, shorthand type for [key] and @location)
* 2014-04-24 [v1.3.0][] (beta - server fixes, nodeunit tests, dual Eventi ctor)

@@ -445,1 +446,2 @@ [v0.5.0]: https://github.com/esha/Eventi/tree/0.5.0

[v1.2.1]: https://github.com/esha/Eventi/tree/1.2.1
[v1.3.0]: https://github.com/esha/Eventi/tree/1.3.0

@@ -55,3 +55,3 @@ _.combo = {

if (!this.unfired.join('')) {
var event = new Eventi('combo:'+this.event.type);
var event = _.create('combo:'+this.event.type);
event.events = this.events;

@@ -58,0 +58,0 @@ event.text = this.text;

@@ -1,3 +0,17 @@

function Eventi(){ return _.create.apply(this, arguments); }
var _ = {
function Eventi(text){
if (typeof text === "string") {
return _.create.apply(_, arguments);
}
return Eventi.fy(this);
}
Eventi.toString = Eventi.prototype.toString = function(){ return 'Eventi, v'+_.version; };
Eventi.fy = function fy(o) {
for (var p in _.fns) {
Object.defineProperty(o, p, {value:Eventi[p], writable:true, configurable:true});
}
return o;
};
var _ = Eventi._ = {
version: "<%= pkg.version %>",
global: new Function('return this')(),

@@ -73,3 +87,3 @@ noop: function(){},

var args = _.slice(arguments);
if (!target || typeof target === "string" || target instanceof global.Event) {// ensure target
if (!target || typeof target === "string" || target instanceof Event) {// ensure target
args.unshift(target = !this || this === Eventi ? _.global : this);

@@ -137,9 +151,1 @@ }

};
Eventi.toString = function(){ return 'Eventi, v'+_.version; };
Eventi._ = _;
Eventi.fy = function fy(o) {
for (var p in _.fns) {
Object.defineProperty(o, p, {value:Eventi[p], writable:true, configurable:true});
}
return o;
};

@@ -30,4 +30,4 @@ (function() {

test('no Eventi.fy({}).alias', function() {
ok(!Eventi.fy({}).alias, 'should not get alias()');
test('no new Eventi().alias', function() {
ok(!new Eventi().alias, 'should not get alias()');
});

@@ -42,5 +42,5 @@

test('Eventi.alias(Eventi.fy({}), "local signal") API additions', function() {
test('Eventi.alias(new Eventi(), "local signal") API additions', function() {
expect(7);
var o = Eventi.fy({});
var o = new Eventi();
equal(o.fire.signal, undefined, 'should not have signal yet');

@@ -47,0 +47,0 @@ Eventi.alias(o, 'local /test:signal=>alias');

@@ -31,4 +31,4 @@ (function() {

test('Eventi.fy({}).fire', function() {
equal(Eventi.fy({}).fire, Eventi.fire, 'should get fire()');
test('new Eventi().fire', function() {
equal(new Eventi().fire, Eventi.fire, 'should get fire()');
});

@@ -35,0 +35,0 @@

(function() {
var _ = Eventi._;
module('Eventi frame');

@@ -17,6 +16,2 @@

test('internal api presence', function() {
ok(_.version, "_.version");
});
}());

@@ -30,4 +30,4 @@ (function() {

test('Eventi.fy({}).off', function() {
equal(Eventi.fy({}).off, Eventi.off, 'should get off()');
test('new Eventi().off', function() {
equal(new Eventi().off, Eventi.off, 'should get off()');
});

@@ -34,0 +34,0 @@

@@ -30,4 +30,4 @@ (function() {

test('Eventi.fy({}).on', function() {
equal(Eventi.fy({}).on, Eventi.on, 'should get on()');
test('new Eventi().on', function() {
equal(new Eventi().on, Eventi.on, 'should get on()');
});

@@ -34,0 +34,0 @@

@@ -37,3 +37,3 @@ (function() {

expect(5);
var target = Eventi.fy({});
var target = new Eventi();
target.on('^once', function(e) {// early listener

@@ -40,0 +40,0 @@ equal(e.type, 'once');

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