first commit

This commit is contained in:
aschwarz
2023-03-14 14:47:50 +01:00
commit 062b2dfae8
4752 changed files with 505842 additions and 0 deletions

2
bootstrap/node_modules/event-component/.npmignore generated vendored Normal file
View File

@ -0,0 +1,2 @@
components
build

5
bootstrap/node_modules/event-component/History.md generated vendored Normal file
View File

@ -0,0 +1,5 @@
0.1.0 / 2012-12-18
==================
* add returning of the callback function

11
bootstrap/node_modules/event-component/Makefile generated vendored Normal file
View File

@ -0,0 +1,11 @@
build: components index.js
@component build
components: component.json
@component install --dev
clean:
rm -fr build components
.PHONY: clean

39
bootstrap/node_modules/event-component/Readme.md generated vendored Normal file
View File

@ -0,0 +1,39 @@
# event
Element event binding component.
## Installation
$ component install component/event
## Example
```js
var events = require('event');
var a = document.querySelector('a');
function onclick(e) {
e.preventDefault();
console.log(e.target);
events.unbind(a, 'click', onclick);
}
events.bind(a, 'click', onclick);
```
## API
### .bind(el, type, callback, [capture])
Bind to `el`'s event `type` with `callback`,
returns the `callback` passed.
### .unbind(el, type, callback, [capture])
Unbind `el`'s event `type` `callback`,
returns the `callback` passed.
## License
MIT

10
bootstrap/node_modules/event-component/component.json generated vendored Normal file
View File

@ -0,0 +1,10 @@
{
"name": "event",
"repo": "component/event",
"description": "Event binding component",
"version": "0.1.0",
"keywords": ["event", "events"],
"scripts": [
"index.js"
]
}

40
bootstrap/node_modules/event-component/index.js generated vendored Normal file
View File

@ -0,0 +1,40 @@
/**
* Bind `el` event `type` to `fn`.
*
* @param {Element} el
* @param {String} type
* @param {Function} fn
* @param {Boolean} capture
* @return {Function}
* @api public
*/
exports.bind = function(el, type, fn, capture){
if (el.addEventListener) {
el.addEventListener(type, fn, capture);
} else {
el.attachEvent('on' + type, fn);
}
return fn;
};
/**
* Unbind `el` event `type`'s callback `fn`.
*
* @param {Element} el
* @param {String} type
* @param {Function} fn
* @param {Boolean} capture
* @return {Function}
* @api public
*/
exports.unbind = function(el, type, fn, capture){
if (el.removeEventListener) {
el.removeEventListener(type, fn, capture);
} else {
el.detachEvent('on' + type, fn);
}
return fn;
};

12
bootstrap/node_modules/event-component/package.json generated vendored Normal file
View File

@ -0,0 +1,12 @@
{
"name": "event-component",
"repo": "component/event",
"description": "Event binding component",
"version": "0.1.0",
"keywords": ["event", "events"],
"component": {
"scripts": {
"event/index.js": "index.js"
}
}
}

24
bootstrap/node_modules/event-component/test/index.html generated vendored Normal file
View File

@ -0,0 +1,24 @@
<html>
<head>
<title>Event</title>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
</head>
<body>
<a href="/something">link</a>
<script src="../build/build.js"></script>
<script>
var events = require('event');
var a = document.querySelector('a');
function onclick(e) {
e.preventDefault();
console.log(e.target);
events.unbind(a, 'click', onclick);
}
events.bind(a, 'click', onclick);
</script>
</body>
</html>