Skip to content

Commit

Permalink
Add package.json and get ready to make NPM package.
Browse files Browse the repository at this point in the history
  • Loading branch information
hperrin committed Feb 13, 2018
1 parent 656bc4c commit 227a6c7
Show file tree
Hide file tree
Showing 5 changed files with 52 additions and 38 deletions.
2 changes: 1 addition & 1 deletion NonBlock.css
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
/**
* NonBlock.js styles.
*
* Copyright (c) 2017 Hunter Perrin
* Copyright (c) 2017-2018 Hunter Perrin
*
* @author Hunter Perrin <hperrin@gmail.com>
*/
Expand Down
33 changes: 0 additions & 33 deletions NonBlock.js
Original file line number Diff line number Diff line change
Expand Up @@ -173,15 +173,6 @@ document.addEventListener('DOMContentLoaded', () => {
text = range.startContainer.textContent.replace(/[\s\n]+$/g, '');
}

console.log('range:', range);
console.log('textNode:', textNode);
console.log('range.startContainer.textContent:', range.startContainer.textContent);
console.log('whitespaceBefore:', whitespaceBefore);
console.log('whitespaceBefore.length:', whitespaceBefore.length);
console.log('text:', text);
console.log('text.length:', text.length);
console.log('offset:', offset);

elem.classList.remove('nonblock-hide');
let cursorStyle = getCursor(elBelow);
isOverTextNode = false;
Expand Down Expand Up @@ -226,28 +217,4 @@ document.addEventListener('DOMContentLoaded', () => {
// Remember the latest element the mouse was over.
nonBlockLastElem = elBelow;
};
/*
const els = document.getElementsByClassName('nonblock');
Array.prototype.forEach.call(els, (el) => {
el.addEventListener('mouseenter', (ev) => {
ev.target.style.opacity = '.2';
}, true);
el.addEventListener('mouseleave', (ev) => {
ev.target.style.opacity = '1';
}, true);
});
const doTheThing = () => {
const els = document.getElementsByClassName('nonblock');
Array.prototype.forEach.call(els, (el) => {
el.style.display = 'none';
});
window.requestAnimationFrame(() => {
Array.prototype.forEach.call(els, (el) => {
el.style.display = 'block';
});
setTimeout(doTheThing, 0);
});
}
setTimeout(doTheThing, 0);
*/
});
24 changes: 20 additions & 4 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,9 +1,25 @@
# NonBlock.js

Nonblocking UI elements in JavaScript.

# Usage
* Include NonBlock.css and NonBlock.js.
* Add the class "nonblock" to any element you want nonblocking enabled for.
## Installation

Install via NPM with:

```sh
npm install --save nonblockjs
```

Include `NonBlock.css` and `NonBlock.js` in your page.

## Usage

Add the class `nonblock` to any element you want to make nonblocking.

## Demos

https://sciactive.github.io/nonblockjs/

## Author

# Author
NonBlock.js was written by Hunter Perrin as part of [PNotify](https://github.com/sciactive/pnotify).
5 changes: 5 additions & 0 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

26 changes: 26 additions & 0 deletions package.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,26 @@
{
"name": "nonblockjs",
"version": "1.0.0",
"description": "Nonblocking UI elements in JavaScript.",
"keywords": [
"non blocking",
"nonblocking",
"unintrusive"
],
"homepage": "https://github.com/sciactive/nonblockjs",
"bugs": {
"url": "https://github.com/sciactive/nonblockjs/issues"
},
"license": "Apache-2.0",
"author": "Hunter Perrin",
"files": [
"NonBlock.css",
"NonBlock.js"
],
"main": "NonBlock.js",
"repository": {
"type": "git",
"url": "https://github.com/sciactive/nonblockjs.git"
},
"dependencies": {}
}

0 comments on commit 227a6c7

Please sign in to comment.