-
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
6 changed files
with
1,829 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,3 @@ | ||
{ | ||
"presets": ["@babel/env", "@babel/stage-2"] | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -57,3 +57,5 @@ typings/ | |
# dotenv environment variables file | ||
.env | ||
|
||
# Misc | ||
.DS_Store |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,43 @@ | ||
"use strict"; | ||
|
||
Object.defineProperty(exports, "__esModule", { | ||
value: true | ||
}); | ||
exports.addListener = exports.multiple = exports.single = exports.byID = void 0; | ||
|
||
function _toConsumableArray(arr) { return _arrayWithoutHoles(arr) || _iterableToArray(arr) || _nonIterableSpread(); } | ||
|
||
function _nonIterableSpread() { throw new TypeError("Invalid attempt to spread non-iterable instance"); } | ||
|
||
function _iterableToArray(iter) { if (Symbol.iterator in Object(iter) || Object.prototype.toString.call(iter) === "[object Arguments]") return Array.from(iter); } | ||
|
||
function _arrayWithoutHoles(arr) { if (Array.isArray(arr)) { for (var i = 0, arr2 = new Array(arr.length); i < arr.length; i++) { arr2[i] = arr[i]; } return arr2; } } | ||
|
||
var doc = document; | ||
var win = window; | ||
|
||
var byID = function byID(id) { | ||
return doc.getElementById(id); | ||
}; | ||
|
||
exports.byID = byID; | ||
|
||
var single = function single(selector) { | ||
return doc.querySelector(selector); | ||
}; | ||
|
||
exports.single = single; | ||
|
||
var multiple = function multiple(selector) { | ||
return _toConsumableArray(doc.querySelectorAll(selector)); | ||
}; | ||
|
||
exports.multiple = multiple; | ||
|
||
var addListener = function addListener(element, eventType, callback, shouldBubble) { | ||
element.addEventListener(eventType, function (event) { | ||
callback(event); | ||
}, shouldBubble); | ||
}; | ||
|
||
exports.addListener = addListener; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,47 @@ | ||
{ | ||
"name": "@three11/dom-helpers", | ||
"version": "0.1.0", | ||
"description": "Helper functions for faster DOM scripting", | ||
"main": "dist/index.js", | ||
"scripts": { | ||
"build": "babel src -d dist" | ||
}, | ||
"repository": { | ||
"type": "git", | ||
"url": "git+https://github.com/three11/dom-helpers.git" | ||
}, | ||
"keywords": [ | ||
"DOM", | ||
"Helpers", | ||
"JavaScript", | ||
"ES2017" | ||
], | ||
"authors": [ | ||
{ | ||
"name": "Three 11 Ltd", | ||
"email": "[email protected]", | ||
"role": "Developer" | ||
}, | ||
{ | ||
"name": "Alexander Panayotov", | ||
"email": "[email protected]", | ||
"role": "Developer" | ||
}, | ||
{ | ||
"name": "Atanas Atanasov", | ||
"email": "[email protected]", | ||
"role": "Developer" | ||
} | ||
], | ||
"license": "GPL-3.0", | ||
"bugs": { | ||
"url": "https://github.com/three11/dom-helpers/issues" | ||
}, | ||
"homepage": "https://github.com/three11/dom-helpers#readme", | ||
"devDependencies": { | ||
"@babel/cli": "^7.0.0-beta.42", | ||
"@babel/core": "^7.0.0-beta.42", | ||
"@babel/preset-env": "^7.0.0-beta.42", | ||
"@babel/preset-stage-2": "^7.0.0-beta.42" | ||
} | ||
} |
File renamed without changes.
Oops, something went wrong.