Socket
Socket
Sign inDemoInstall

dom-delegate

Package Overview
Dependencies
0
Maintainers
2
Versions
24
Alerts
File Explorer

Advanced tools

Install Socket

Detect and block malicious and high-risk dependencies

Install

Comparing version 1.0.2 to 1.0.3

2

bower.json

@@ -5,4 +5,4 @@ {

"main": "lib/delegate.js",
"ignore": ["test", "GruntFile.js", ".npmignore", ".gitignore", "README.md", "component.json", "package.json"]
"ignore": ["test", "GruntFile.js", ".npmignore", ".gitignore", "README.md", "component.json", "package.json"],
"license": "MIT"
}
(function(e){if("function"==typeof bootstrap)bootstrap("delegate",e);else if("object"==typeof exports)module.exports=e();else if("function"==typeof define&&define.amd)define(e);else if("undefined"!=typeof ses){if(!ses.ok())return;ses.makeDelegate=e}else"undefined"!=typeof window?window.Delegate=e():global.Delegate=e()})(function(){var define,ses,bootstrap,module,exports;
return (function(e,t,n){function i(n,s){if(!t[n]){if(!e[n]){var o=typeof require=="function"&&require;if(!s&&o)return o(n,!0);if(r)return r(n,!0);throw new Error("Cannot find module '"+n+"'")}var u=t[n]={exports:{}};e[n][0].call(u.exports,function(t){var r=e[n][1][t];return i(r?r:t)},u,u.exports)}return t[n].exports}var r=typeof require=="function"&&require;for(var s=0;s<n.length;s++)i(n[s]);return i})({1:[function(require,module,exports){
/*jshint browser:true, node:true*/
(function(){/*jshint browser:true, node:true*/
/*HACK:MA:20140428 Event currently not a browser global in JSHint - https://github.com/jshint/jshint/pull/1645 */
/*global Event*/
'use strict';

@@ -448,4 +451,5 @@

})()
},{}]},{},[1])(1)
});
;

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

(function(e){if("function"==typeof bootstrap)bootstrap("delegate",e);else if("object"==typeof exports)module.exports=e();else if("function"==typeof define&&define.amd)define(e);else if("undefined"!=typeof ses){if(!ses.ok())return;ses.makeDelegate=e}else"undefined"!=typeof window?window.Delegate=e():global.Delegate=e()})(function(){return function(e,t,r){function n(r,i){if(!t[r]){if(!e[r]){var s="function"==typeof require&&require;if(!i&&s)return s(r,!0);if(o)return o(r,!0);throw Error("Cannot find module '"+r+"'")}var a=t[r]={exports:{}};e[r][0].call(a.exports,function(t){var o=e[r][1][t];return n(o?o:t)},a,a.exports)}return t[r].exports}for(var o="function"==typeof require&&require,i=0;r.length>i;i++)n(r[i]);return n}({1:[function(e,t){"use strict";function r(e){this.listenerMap=[{},{}],e&&this.root(e),this.handle=r.prototype.handle.bind(this)}t.exports=r,r.tagsCaseSensitive=null,r.prototype.root=function(e){var t,r=this.listenerMap;if("string"==typeof e&&(e=document.querySelector(e)),this.rootElement){for(t in r[1])r[1].hasOwnProperty(t)&&this.rootElement.removeEventListener(t,this.handle,!0);for(t in r[0])r[0].hasOwnProperty(t)&&this.rootElement.removeEventListener(t,this.handle,!1)}if(!e||!e.addEventListener)return this.rootElement&&delete this.rootElement,this;this.rootElement=e;for(t in r[1])r[1].hasOwnProperty(t)&&this.rootElement.addEventListener(t,this.handle,!0);for(t in r[0])r[0].hasOwnProperty(t)&&this.rootElement.addEventListener(t,this.handle,!1);return this},r.prototype.captureForType=function(e){return-1!==["error","blur","focus","scroll"].indexOf(e)},r.prototype.on=function(e,t,n,o){var i,s,a,h;if(!e)throw new TypeError("Invalid event type: "+e);if("function"==typeof t&&(o=n,n=t,t=null),void 0===o&&(o=this.captureForType(e)),"function"!=typeof n)throw new TypeError("Handler must be a type of Function");return i=this.rootElement,s=this.listenerMap[o?1:0],s[e]||(i&&i.addEventListener(e,this.handle,o),s[e]=[]),t?/^[a-z]+$/i.test(t)?(null===r.tagsCaseSensitive&&(r.tagsCaseSensitive="i"===document.createElement("i").tagName),h=r.tagsCaseSensitive?t:t.toUpperCase(),a=this.matchesTag):/^#[a-z0-9\-_]+$/i.test(t)?(h=t.slice(1),a=this.matchesId):(h=t,a=this.matches):(h=null,a=this.matchesRoot.bind(this)),s[e].push({selector:t,handler:n,matcher:a,matcherParam:h}),this},r.prototype.off=function(e,t,r,n){var o,i,s,a,h;if("function"==typeof t&&(n=r,r=t,t=null),void 0===n)return this.off(e,t,r,!0),this.off(e,t,r,!1),this;if(s=this.listenerMap[n?1:0],!e){for(h in s)s.hasOwnProperty(h)&&this.off(h,t,r);return this}if(a=s[e],!a||!a.length)return this;for(o=a.length-1;o>=0;o--)i=a[o],t&&t!==i.selector||r&&r!==i.handler||a.splice(o,1);return a.length||(delete s[e],this.rootElement&&this.rootElement.removeEventListener(e,this.handle,n)),this},r.prototype.handle=function(e){var t,r,n,o,i,s,a=e.type,h=[],l="ftLabsDelegateIgnore";if(e[l]!==!0){switch(s=e.target,s.nodeType===Node.TEXT_NODE&&(s=s.parentNode),n=this.rootElement,e.eventPhase){case Event.CAPTURING_PHASE:h=this.listenerMap[1][a];break;case Event.AT_TARGET:this.listenerMap[0]&&this.listenerMap[0][a]&&(h=h.concat(this.listenerMap[0][a])),this.listenerMap[1]&&this.listenerMap[1][a]&&(h=h.concat(this.listenerMap[1][a]));break;case Event.BUBBLING_PHASE:h=this.listenerMap[0][a]}for(r=h.length;s&&r;){for(t=0;r>t&&(o=h[t],o);t++)if(o.matcher.call(s,o.matcherParam,s)&&(i=this.fire(e,s,o)),i===!1)return e[l]=!0,e.preventDefault(),void 0;if(s===n)break;r=h.length,s=s.parentElement}}},r.prototype.fire=function(e,t,r){return r.handler.call(t,e,t)},r.prototype.matches=function(e){if(e){var t=e.prototype;return t.matchesSelector||t.webkitMatchesSelector||t.mozMatchesSelector||t.msMatchesSelector||t.oMatchesSelector}}(HTMLElement),r.prototype.matchesTag=function(e,t){return e===t.tagName},r.prototype.matchesRoot=function(e,t){return this.rootElement===window?t===document:this.rootElement===t},r.prototype.matchesId=function(e,t){return e===t.id},r.prototype.destroy=function(){this.off(),this.root()}},{}]},{},[1])(1)});
(function(e){if("function"==typeof bootstrap)bootstrap("delegate",e);else if("object"==typeof exports)module.exports=e();else if("function"==typeof define&&define.amd)define(e);else if("undefined"!=typeof ses){if(!ses.ok())return;ses.makeDelegate=e}else"undefined"!=typeof window?window.Delegate=e():global.Delegate=e()})(function(){return function(e,t,r){function n(r,i){if(!t[r]){if(!e[r]){var s="function"==typeof require&&require;if(!i&&s)return s(r,!0);if(o)return o(r,!0);throw Error("Cannot find module '"+r+"'")}var a=t[r]={exports:{}};e[r][0].call(a.exports,function(t){var o=e[r][1][t];return n(o?o:t)},a,a.exports)}return t[r].exports}for(var o="function"==typeof require&&require,i=0;r.length>i;i++)n(r[i]);return n}({1:[function(e,t){(function(){"use strict";function e(t){this.listenerMap=[{},{}],t&&this.root(t),this.handle=e.prototype.handle.bind(this)}t.exports=e,e.tagsCaseSensitive=null,e.prototype.root=function(e){var t,r=this.listenerMap;if("string"==typeof e&&(e=document.querySelector(e)),this.rootElement){for(t in r[1])r[1].hasOwnProperty(t)&&this.rootElement.removeEventListener(t,this.handle,!0);for(t in r[0])r[0].hasOwnProperty(t)&&this.rootElement.removeEventListener(t,this.handle,!1)}if(!e||!e.addEventListener)return this.rootElement&&delete this.rootElement,this;this.rootElement=e;for(t in r[1])r[1].hasOwnProperty(t)&&this.rootElement.addEventListener(t,this.handle,!0);for(t in r[0])r[0].hasOwnProperty(t)&&this.rootElement.addEventListener(t,this.handle,!1);return this},e.prototype.captureForType=function(e){return-1!==["error","blur","focus","scroll"].indexOf(e)},e.prototype.on=function(t,r,n,o){var i,s,a,h;if(!t)throw new TypeError("Invalid event type: "+t);if("function"==typeof r&&(o=n,n=r,r=null),void 0===o&&(o=this.captureForType(t)),"function"!=typeof n)throw new TypeError("Handler must be a type of Function");return i=this.rootElement,s=this.listenerMap[o?1:0],s[t]||(i&&i.addEventListener(t,this.handle,o),s[t]=[]),r?/^[a-z]+$/i.test(r)?(null===e.tagsCaseSensitive&&(e.tagsCaseSensitive="i"===document.createElement("i").tagName),h=e.tagsCaseSensitive?r:r.toUpperCase(),a=this.matchesTag):/^#[a-z0-9\-_]+$/i.test(r)?(h=r.slice(1),a=this.matchesId):(h=r,a=this.matches):(h=null,a=this.matchesRoot.bind(this)),s[t].push({selector:r,handler:n,matcher:a,matcherParam:h}),this},e.prototype.off=function(e,t,r,n){var o,i,s,a,h;if("function"==typeof t&&(n=r,r=t,t=null),void 0===n)return this.off(e,t,r,!0),this.off(e,t,r,!1),this;if(s=this.listenerMap[n?1:0],!e){for(h in s)s.hasOwnProperty(h)&&this.off(h,t,r);return this}if(a=s[e],!a||!a.length)return this;for(o=a.length-1;o>=0;o--)i=a[o],t&&t!==i.selector||r&&r!==i.handler||a.splice(o,1);return a.length||(delete s[e],this.rootElement&&this.rootElement.removeEventListener(e,this.handle,n)),this},e.prototype.handle=function(e){var t,r,n,o,i,s,a=e.type,h=[],l="ftLabsDelegateIgnore";if(e[l]!==!0){switch(s=e.target,s.nodeType===Node.TEXT_NODE&&(s=s.parentNode),n=this.rootElement,e.eventPhase){case Event.CAPTURING_PHASE:h=this.listenerMap[1][a];break;case Event.AT_TARGET:this.listenerMap[0]&&this.listenerMap[0][a]&&(h=h.concat(this.listenerMap[0][a])),this.listenerMap[1]&&this.listenerMap[1][a]&&(h=h.concat(this.listenerMap[1][a]));break;case Event.BUBBLING_PHASE:h=this.listenerMap[0][a]}for(r=h.length;s&&r;){for(t=0;r>t&&(o=h[t],o);t++)if(o.matcher.call(s,o.matcherParam,s)&&(i=this.fire(e,s,o)),i===!1)return e[l]=!0,e.preventDefault(),void 0;if(s===n)break;r=h.length,s=s.parentElement}}},e.prototype.fire=function(e,t,r){return r.handler.call(t,e,t)},e.prototype.matches=function(e){if(e){var t=e.prototype;return t.matchesSelector||t.webkitMatchesSelector||t.mozMatchesSelector||t.msMatchesSelector||t.oMatchesSelector}}(HTMLElement),e.prototype.matchesTag=function(e,t){return e===t.tagName},e.prototype.matchesRoot=function(e,t){return this.rootElement===window?t===document:this.rootElement===t},e.prototype.matchesId=function(e,t){return e===t.id},e.prototype.destroy=function(){this.off(),this.root()}})()},{}]},{},[1])(1)});

@@ -24,4 +24,15 @@ module.exports = function(grunt) {

}
}
},
jshint: {
all: [
'Gruntfile.js',
'lib/**/*.js',
'test/*.js',
'test/**/*.js',
'bower.json',
'package.json'
]
}
});

@@ -32,5 +43,6 @@

grunt.loadNpmTasks('grunt-contrib-uglify');
grunt.loadNpmTasks('grunt-contrib-jshint');
// Default task.
grunt.registerTask('default', ['browserify', 'uglify']);
grunt.registerTask('default', ['browserify', 'uglify', 'jshint']);
};
/*jshint browser:true, node:true*/
/*HACK:MA:20140428 Event currently not a browser global in JSHint - https://github.com/jshint/jshint/pull/1645 */
/*global Event*/
'use strict';

@@ -4,0 +7,0 @@

{
"name": "dom-delegate",
"version": "1.0.2",
"version": "1.0.3",
"author": "FT Labs <enquiries@labs.ft.com> (http://labs.ft.com/)",

@@ -35,3 +35,4 @@ "description": "Create and manage a DOM event delegator.",

"istanbul": "*",
"buster-istanbul": "*"
"buster-istanbul": "*",
"grunt-contrib-jshint": "~0.10.0"
},

@@ -38,0 +39,0 @@ "license": "MIT",

SocketSocket SOC 2 Logo

Product

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

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc