1
0
mirror of https://github.com/S2-/gitlit synced 2025-08-03 04:40:05 +02:00

update dependencies

This commit is contained in:
s2
2018-10-10 15:11:12 +02:00
parent da4083f574
commit 5c55c54b71
90877 changed files with 339776 additions and 33677 deletions

201
app/node_modules/nonblockjs/LICENSE generated vendored Normal file
View File

@@ -0,0 +1,201 @@
Apache License
Version 2.0, January 2004
http://www.apache.org/licenses/
TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION
1. Definitions.
"License" shall mean the terms and conditions for use, reproduction,
and distribution as defined by Sections 1 through 9 of this document.
"Licensor" shall mean the copyright owner or entity authorized by
the copyright owner that is granting the License.
"Legal Entity" shall mean the union of the acting entity and all
other entities that control, are controlled by, or are under common
control with that entity. For the purposes of this definition,
"control" means (i) the power, direct or indirect, to cause the
direction or management of such entity, whether by contract or
otherwise, or (ii) ownership of fifty percent (50%) or more of the
outstanding shares, or (iii) beneficial ownership of such entity.
"You" (or "Your") shall mean an individual or Legal Entity
exercising permissions granted by this License.
"Source" form shall mean the preferred form for making modifications,
including but not limited to software source code, documentation
source, and configuration files.
"Object" form shall mean any form resulting from mechanical
transformation or translation of a Source form, including but
not limited to compiled object code, generated documentation,
and conversions to other media types.
"Work" shall mean the work of authorship, whether in Source or
Object form, made available under the License, as indicated by a
copyright notice that is included in or attached to the work
(an example is provided in the Appendix below).
"Derivative Works" shall mean any work, whether in Source or Object
form, that is based on (or derived from) the Work and for which the
editorial revisions, annotations, elaborations, or other modifications
represent, as a whole, an original work of authorship. For the purposes
of this License, Derivative Works shall not include works that remain
separable from, or merely link (or bind by name) to the interfaces of,
the Work and Derivative Works thereof.
"Contribution" shall mean any work of authorship, including
the original version of the Work and any modifications or additions
to that Work or Derivative Works thereof, that is intentionally
submitted to Licensor for inclusion in the Work by the copyright owner
or by an individual or Legal Entity authorized to submit on behalf of
the copyright owner. For the purposes of this definition, "submitted"
means any form of electronic, verbal, or written communication sent
to the Licensor or its representatives, including but not limited to
communication on electronic mailing lists, source code control systems,
and issue tracking systems that are managed by, or on behalf of, the
Licensor for the purpose of discussing and improving the Work, but
excluding communication that is conspicuously marked or otherwise
designated in writing by the copyright owner as "Not a Contribution."
"Contributor" shall mean Licensor and any individual or Legal Entity
on behalf of whom a Contribution has been received by Licensor and
subsequently incorporated within the Work.
2. Grant of Copyright License. Subject to the terms and conditions of
this License, each Contributor hereby grants to You a perpetual,
worldwide, non-exclusive, no-charge, royalty-free, irrevocable
copyright license to reproduce, prepare Derivative Works of,
publicly display, publicly perform, sublicense, and distribute the
Work and such Derivative Works in Source or Object form.
3. Grant of Patent License. Subject to the terms and conditions of
this License, each Contributor hereby grants to You a perpetual,
worldwide, non-exclusive, no-charge, royalty-free, irrevocable
(except as stated in this section) patent license to make, have made,
use, offer to sell, sell, import, and otherwise transfer the Work,
where such license applies only to those patent claims licensable
by such Contributor that are necessarily infringed by their
Contribution(s) alone or by combination of their Contribution(s)
with the Work to which such Contribution(s) was submitted. If You
institute patent litigation against any entity (including a
cross-claim or counterclaim in a lawsuit) alleging that the Work
or a Contribution incorporated within the Work constitutes direct
or contributory patent infringement, then any patent licenses
granted to You under this License for that Work shall terminate
as of the date such litigation is filed.
4. Redistribution. You may reproduce and distribute copies of the
Work or Derivative Works thereof in any medium, with or without
modifications, and in Source or Object form, provided that You
meet the following conditions:
(a) You must give any other recipients of the Work or
Derivative Works a copy of this License; and
(b) You must cause any modified files to carry prominent notices
stating that You changed the files; and
(c) You must retain, in the Source form of any Derivative Works
that You distribute, all copyright, patent, trademark, and
attribution notices from the Source form of the Work,
excluding those notices that do not pertain to any part of
the Derivative Works; and
(d) If the Work includes a "NOTICE" text file as part of its
distribution, then any Derivative Works that You distribute must
include a readable copy of the attribution notices contained
within such NOTICE file, excluding those notices that do not
pertain to any part of the Derivative Works, in at least one
of the following places: within a NOTICE text file distributed
as part of the Derivative Works; within the Source form or
documentation, if provided along with the Derivative Works; or,
within a display generated by the Derivative Works, if and
wherever such third-party notices normally appear. The contents
of the NOTICE file are for informational purposes only and
do not modify the License. You may add Your own attribution
notices within Derivative Works that You distribute, alongside
or as an addendum to the NOTICE text from the Work, provided
that such additional attribution notices cannot be construed
as modifying the License.
You may add Your own copyright statement to Your modifications and
may provide additional or different license terms and conditions
for use, reproduction, or distribution of Your modifications, or
for any such Derivative Works as a whole, provided Your use,
reproduction, and distribution of the Work otherwise complies with
the conditions stated in this License.
5. Submission of Contributions. Unless You explicitly state otherwise,
any Contribution intentionally submitted for inclusion in the Work
by You to the Licensor shall be under the terms and conditions of
this License, without any additional terms or conditions.
Notwithstanding the above, nothing herein shall supersede or modify
the terms of any separate license agreement you may have executed
with Licensor regarding such Contributions.
6. Trademarks. This License does not grant permission to use the trade
names, trademarks, service marks, or product names of the Licensor,
except as required for reasonable and customary use in describing the
origin of the Work and reproducing the content of the NOTICE file.
7. Disclaimer of Warranty. Unless required by applicable law or
agreed to in writing, Licensor provides the Work (and each
Contributor provides its Contributions) on an "AS IS" BASIS,
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or
implied, including, without limitation, any warranties or conditions
of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A
PARTICULAR PURPOSE. You are solely responsible for determining the
appropriateness of using or redistributing the Work and assume any
risks associated with Your exercise of permissions under this License.
8. Limitation of Liability. In no event and under no legal theory,
whether in tort (including negligence), contract, or otherwise,
unless required by applicable law (such as deliberate and grossly
negligent acts) or agreed to in writing, shall any Contributor be
liable to You for damages, including any direct, indirect, special,
incidental, or consequential damages of any character arising as a
result of this License or out of the use or inability to use the
Work (including but not limited to damages for loss of goodwill,
work stoppage, computer failure or malfunction, or any and all
other commercial damages or losses), even if such Contributor
has been advised of the possibility of such damages.
9. Accepting Warranty or Additional Liability. While redistributing
the Work or Derivative Works thereof, You may choose to offer,
and charge a fee for, acceptance of support, warranty, indemnity,
or other liability obligations and/or rights consistent with this
License. However, in accepting such obligations, You may act only
on Your own behalf and on Your sole responsibility, not on behalf
of any other Contributor, and only if You agree to indemnify,
defend, and hold each Contributor harmless for any liability
incurred by, or claims asserted against, such Contributor by reason
of your accepting any such warranty or additional liability.
END OF TERMS AND CONDITIONS
APPENDIX: How to apply the Apache License to your work.
To apply the Apache License to your work, attach the following
boilerplate notice, with the fields enclosed by brackets "{}"
replaced with your own identifying information. (Don't include
the brackets!) The text should be enclosed in the appropriate
comment syntax for the file format. We also recommend that a
file or class name and description of purpose be included on the
same "printed page" as the copyright notice for easier
identification within third-party archives.
Copyright {yyyy} {name of copyright owner}
Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in writing, software
distributed under the License is distributed on an "AS IS" BASIS,
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
See the License for the specific language governing permissions and
limitations under the License.

544
app/node_modules/nonblockjs/NonBlock.es5.js generated vendored Normal file
View File

@@ -0,0 +1,544 @@
;
(function () {
/**
* NonBlock.js
*
* Copyright (c) 2017-2018 Hunter Perrin
*
* @author Hunter Perrin <hperrin@gmail.com>
*/
'use strict';
function _toConsumableArray(arr) {
if (Array.isArray(arr)) {
for (var i = 0, arr2 = Array(arr.length); i < arr.length; i++) {
arr2[i] = arr[i];
}
return arr2;
} else {
return Array.from(arr);
}
}
function _classCallCheck(instance, Constructor) {
if (!(instance instanceof Constructor)) {
throw new TypeError("Cannot call a class as a function");
}
}
var _createClass = function () {
function defineProperties(target, props) {
for (var i = 0; i < props.length; i++) {
var descriptor = props[i];
descriptor.enumerable = descriptor.enumerable || false;
descriptor.configurable = true;
if ("value" in descriptor) descriptor.writable = true;
Object.defineProperty(target, descriptor.key, descriptor);
}
}
return function (Constructor, protoProps, staticProps) {
if (protoProps) defineProperties(Constructor.prototype, protoProps);
if (staticProps) defineProperties(Constructor, staticProps);
return Constructor;
};
}();
(function (NonBlock) {
window.NonBlockJs = {
NonBlock: NonBlock
};
if (document.body) {
window.NonBlockJs.nonBlock = new NonBlock(document.body);
} else {
document.addEventListener('DOMContentLoaded', function () {
window.NonBlockJs.nonBlock = new NonBlock(document.body);
});
}
})(function () {
var NonBlock = function () {
function NonBlock(root, mode) {
_classCallCheck(this, NonBlock);
this.root = root;
// Detect if we can use "pointer-events".
// Can't use document.documentElement.style because IE9/IE10 report true,
// but only support it on SVG elements, not HTML elements.
var windowStyle = window.getComputedStyle(document.body);
this.pointerEventsSupport = windowStyle.pointerEvents && windowStyle.pointerEvents === 'auto';
// Some useful regexes.
this.regexOn = /^on/;
this.regexMouseEvents = /^(dbl)?click$|^mouse(move|down|up|over|out|enter|leave)$|^contextmenu$/;
this.regexUiEvents = /^(focus|blur|select|change|reset)$|^key(press|down|up)$/;
this.regexHtmlEvents = /^(scroll|resize|(un)?load|abort|error)$/;
// Whether to use event constructors.
this.useEventConstructors = true;
try {
var e = new MouseEvent('click');
} catch (e) {
this.useEventConstructors = false;
}
// If mode is not provided, use PointerEvents, if it's supported.
if (typeof mode === 'undefined') {
this.mode = this.pointerEventsSupport ? 'PointerEvents' : 'EventForwarding';
} else {
this.mode = mode;
}
// Init the current mode.
if (this['init' + this.mode]) {
this['init' + this.mode]();
}
}
_createClass(NonBlock, [{
key: 'initPointerEvents',
value: function initPointerEvents() {
var _this = this;
// Using pointer-events, we can just detect whether an element is being
// hovered over. No event forwarding necessary.
this.addCSS('.nonblock{transition:opacity .3s ease; pointer-events: none;}.nonblock:hover,.nonblock-hover{opacity:.1 !important;}');
this.onmousemove = function (ev) {
var nonblocks = document.querySelectorAll('.nonblock');
var _iteratorNormalCompletion = true;
var _didIteratorError = false;
var _iteratorError = undefined;
try {
for (var _iterator = nonblocks[Symbol.iterator](), _step; !(_iteratorNormalCompletion = (_step = _iterator.next()).done); _iteratorNormalCompletion = true) {
var nonblock = _step.value;
var rect = nonblock.getBoundingClientRect();
if (ev.clientX >= rect.left && ev.clientX <= rect.right && ev.clientY >= rect.top && ev.clientY <= rect.bottom) {
if (!nonblock.classList.contains('nonblock-hover')) {
nonblock.classList.add('nonblock-hover');
if (_this.isSimulateMouse(nonblock) && ev.isTrusted) {
_this.domEvent(nonblock, 'onmouseenter', ev, false);
_this.domEvent(nonblock, 'onmouseover', ev, true);
}
} else if (_this.isSimulateMouse(nonblock) && ev.isTrusted) {
_this.domEvent(nonblock, 'onmousemove', ev, true);
}
} else {
if (nonblock.classList.contains('nonblock-hover')) {
if (_this.isSimulateMouse(nonblock) && ev.isTrusted) {
_this.domEvent(nonblock, 'onmouseout', ev, true);
_this.domEvent(nonblock, 'onmouseleave', ev, false);
}
nonblock.classList.remove('nonblock-hover');
}
}
}
} catch (err) {
_didIteratorError = true;
_iteratorError = err;
} finally {
try {
if (!_iteratorNormalCompletion && _iterator.return) {
_iterator.return();
}
} finally {
if (_didIteratorError) {
throw _iteratorError;
}
}
}
};
this.root.addEventListener('mousemove', this.onmousemove);
}
}, {
key: 'initEventForwarding',
value: function initEventForwarding() {
var _this2 = this;
// No pointer-events means we have to fall back to using event forwarding.
this.addCSS('.nonblock{transition:opacity .3s ease;}\n.nonblock:hover{opacity:.1 !important;}\n.nonblock-hide{position:absolute !important;left:-10000000px !important;right:10000000px !important;}\n.nonblock-cursor-auto{cursor:auto !important;}\n.nonblock-cursor-default{cursor:default !important;}\n.nonblock-cursor-none{cursor:none !important;}\n.nonblock-cursor-context-menu{cursor:context-menu !important;}\n.nonblock-cursor-help{cursor:help !important;}\n.nonblock-cursor-pointer{cursor:pointer !important;}\n.nonblock-cursor-progress{cursor:progress !important;}\n.nonblock-cursor-wait{cursor:wait !important;}\n.nonblock-cursor-cell{cursor:cell !important;}\n.nonblock-cursor-crosshair{cursor:crosshair !important;}\n.nonblock-cursor-text{cursor:text !important;}\n.nonblock-cursor-vertical-text{cursor:vertical-text !important;}\n.nonblock-cursor-alias{cursor:alias !important;}\n.nonblock-cursor-copy{cursor:copy !important;}\n.nonblock-cursor-move{cursor:move !important;}\n.nonblock-cursor-no-drop{cursor:no-drop !important;}\n.nonblock-cursor-not-allowed{cursor:not-allowed !important;}\n.nonblock-cursor-all-scroll{cursor:all-scroll !important;}\n.nonblock-cursor-col-resize{cursor:col-resize !important;}\n.nonblock-cursor-row-resize{cursor:row-resize !important;}\n.nonblock-cursor-n-resize{cursor:n-resize !important;}\n.nonblock-cursor-e-resize{cursor:e-resize !important;}\n.nonblock-cursor-s-resize{cursor:s-resize !important;}\n.nonblock-cursor-w-resize{cursor:w-resize !important;}\n.nonblock-cursor-ne-resize{cursor:ne-resize !important;}\n.nonblock-cursor-nw-resize{cursor:nw-resize !important;}\n.nonblock-cursor-se-resize{cursor:se-resize !important;}\n.nonblock-cursor-sw-resize{cursor:sw-resize !important;}\n.nonblock-cursor-ew-resize{cursor:ew-resize !important;}\n.nonblock-cursor-ns-resize{cursor:ns-resize !important;}\n.nonblock-cursor-nesw-resize{cursor:nesw-resize !important;}\n.nonblock-cursor-nwse-resize{cursor:nwse-resize !important;}\n.nonblock-cursor-zoom-in{cursor:zoom-in !important;}\n.nonblock-cursor-zoom-out{cursor:zoom-out !important;}\n.nonblock-cursor-grab{cursor:grab !important;}\n.nonblock-cursor-grabbing{cursor:grabbing !important;}');
// This keeps track of the last element the mouse was over, so
// mouseleave, mouseenter, etc can be called.
this.nonBlockLastElem = null;
// These are used for selecting text under a nonblock element.
this.isOverTextNode = false;
this.selectingText = false;
this.onmouseenter = function (ev) {
var nonblock = void 0;
if (ev.isTrusted && (nonblock = _this2.getNonBlocking(ev.target))) {
_this2.nonBlockLastElem = false;
if (!_this2.isPropagating(nonblock)) {
ev.stopPropagation();
}
}
};
this.onmouseleave = function (ev) {
var nonblock = void 0;
if (ev.isTrusted && (nonblock = _this2.getNonBlocking(ev.target))) {
_this2.remCursor(nonblock);
_this2.nonBlockLastElem = null;
_this2.selectingText = false;
if (!_this2.isPropagating(nonblock)) {
ev.stopPropagation();
}
}
};
this.onmouseover = function (ev) {
var nonblock = void 0;
if (ev.isTrusted && (nonblock = _this2.getNonBlocking(ev.target)) && !_this2.isPropagating(nonblock)) {
ev.stopPropagation();
}
};
this.onmouseout = function (ev) {
var nonblock = void 0;
if (ev.isTrusted && (nonblock = _this2.getNonBlocking(ev.target)) && !_this2.isPropagating(nonblock)) {
ev.stopPropagation();
}
};
this.onmousemove = function (ev) {
var nonblock = void 0;
if (ev.isTrusted && (nonblock = _this2.getNonBlocking(ev.target))) {
_this2.nonblockPass(nonblock, ev, 'onmousemove');
// If the user just clicks somewhere, we don't want to select text, so this
// detects that the user moved their mouse.
if (_this2.selectingText === null) {
window.getSelection().removeAllRanges();
_this2.selectingText = true;
} else if (_this2.selectingText) {
// Stop the default action, which would be selecting text.
ev.preventDefault();
}
if (!_this2.isPropagating(nonblock)) {
ev.stopPropagation();
}
}
};
this.onmousedown = function (ev) {
var nonblock = void 0;
if (ev.isTrusted && (nonblock = _this2.getNonBlocking(ev.target))) {
_this2.nonblockPass(nonblock, ev, 'onmousedown');
_this2.selectingText = null;
if (!_this2.isFocusable(nonblock)) {
// Stop the default action, which would focus the element.
ev.preventDefault();
}
if (!_this2.isPropagating(nonblock) || !_this2.isActionPropagating(nonblock)) {
ev.stopPropagation();
}
}
};
this.onmouseup = function (ev) {
var nonblock = void 0;
if (ev.isTrusted && (nonblock = _this2.getNonBlocking(ev.target))) {
_this2.nonblockPass(nonblock, ev, 'onmouseup');
if (_this2.selectingText === null) {
window.getSelection().removeAllRanges();
}
_this2.selectingText = false;
if (!_this2.isPropagating(nonblock) || !_this2.isActionPropagating(nonblock)) {
ev.stopPropagation();
}
}
};
this.onclick = function (ev) {
var nonblock = void 0;
if (ev.isTrusted && (nonblock = _this2.getNonBlocking(ev.target))) {
_this2.nonblockPass(nonblock, ev, 'onclick');
if (!_this2.isPropagating(nonblock) || !_this2.isActionPropagating(nonblock)) {
ev.stopPropagation();
}
}
};
this.ondblclick = function (ev) {
var nonblock = void 0;
if (ev.isTrusted && (nonblock = _this2.getNonBlocking(ev.target))) {
_this2.nonblockPass(nonblock, ev, 'ondblclick');
if (!_this2.isPropagating(nonblock) || !_this2.isActionPropagating(nonblock)) {
ev.stopPropagation();
}
}
};
this.root.addEventListener('mouseenter', this.onmouseenter, true);
this.root.addEventListener('mouseleave', this.onmouseleave, true);
this.root.addEventListener('mouseover', this.onmouseover, true);
this.root.addEventListener('mouseout', this.onmouseout, true);
this.root.addEventListener('mousemove', this.onmousemove, true);
this.root.addEventListener('mousedown', this.onmousedown, true);
this.root.addEventListener('mouseup', this.onmouseup, true);
this.root.addEventListener('click', this.onclick, true);
this.root.addEventListener('dblclick', this.ondblclick, true);
}
}, {
key: 'destroy',
value: function destroy() {
var _arr = ['mouseenter', 'mouseleave', 'mouseover', 'mouseout', 'mousemove', 'mousedown', 'mouseup', 'click', 'dblclick'];
for (var _i = 0; _i < _arr.length; _i++) {
var event = _arr[_i];
if (this['on' + event]) {
this.root.removeEventListener(event, this['on' + event], true);
delete this['on' + event];
}
}
this.styling.parentNode.removeChild(this.styling);
delete this.styling;
}
}, {
key: 'addCSS',
value: function addCSS(css) {
this.styling = document.createElement('style');
this.styling.setAttribute('type', 'text/css');
if (this.styling.styleSheet) {
this.styling.styleSheet.cssText = css; // IE
} else {
this.styling.appendChild(document.createTextNode(css));
}
document.getElementsByTagName('head')[0].appendChild(this.styling);
}
}, {
key: 'domEvent',
value: function domEvent(elem, event, origEvent, bubbles) {
var eventObject = void 0;
event = event.toLowerCase();
if (this.useEventConstructors) {
// New browsers
event = event.replace(this.regexOn, '');
if (event.match(this.regexMouseEvents)) {
eventObject = new MouseEvent(event, {
screenX: origEvent.screenX,
screenY: origEvent.screenY,
clientX: origEvent.clientX,
clientY: origEvent.clientY,
ctrlKey: origEvent.ctrlKey,
shiftKey: origEvent.shiftKey,
altKey: origEvent.altKey,
metaKey: origEvent.metaKey,
button: origEvent.button,
buttons: origEvent.buttons,
relatedTarget: origEvent.relatedTarget,
region: origEvent.region,
detail: origEvent.detail,
view: origEvent.view,
bubbles: bubbles === undefined ? origEvent.bubbles : bubbles,
cancelable: origEvent.cancelable,
composed: origEvent.composed
});
} else if (event.match(this.regexUiEvents)) {
eventObject = new UIEvent(event, {
detail: origEvent.detail,
view: origEvent.view,
bubbles: bubbles === undefined ? origEvent.bubbles : bubbles,
cancelable: origEvent.cancelable,
composed: origEvent.composed
});
} else if (event.match(this.regexHtmlEvents)) {
eventObject = new Event(event, {
bubbles: bubbles === undefined ? origEvent.bubbles : bubbles,
cancelable: origEvent.cancelable,
composed: origEvent.composed
});
}
if (!eventObject) {
return;
}
elem.dispatchEvent(eventObject);
} else if (document.createEvent && elem.dispatchEvent) {
// Old method for FireFox, Opera, Safari, Chrome
event = event.replace(this.regexOn, '');
if (event.match(this.regexMouseEvents)) {
// This allows the click event to fire on the notice. There is
// probably a much better way to do it.
elem.getBoundingClientRect();
eventObject = document.createEvent("MouseEvents");
eventObject.initMouseEvent(event, bubbles === undefined ? origEvent.bubbles : bubbles, origEvent.cancelable, origEvent.view, origEvent.detail, origEvent.screenX, origEvent.screenY, origEvent.clientX, origEvent.clientY, origEvent.ctrlKey, origEvent.altKey, origEvent.shiftKey, origEvent.metaKey, origEvent.button, origEvent.relatedTarget);
} else if (event.match(this.regexUiEvents)) {
eventObject = document.createEvent("UIEvents");
eventObject.initUIEvent(event, bubbles === undefined ? origEvent.bubbles : bubbles, origEvent.cancelable, origEvent.view, origEvent.detail);
} else if (event.match(this.regexHtmlEvents)) {
eventObject = document.createEvent("HTMLEvents");
eventObject.initEvent(event, bubbles === undefined ? origEvent.bubbles : bubbles, origEvent.cancelable);
}
if (!eventObject) {
return;
}
elem.dispatchEvent(eventObject);
} else {
// Internet Explorer
if (!event.match(this.regexOn)) {
event = "on" + event;
};
eventObject = document.createEventObject(origEvent);
elem.fireEvent(event, eventObject);
}
}
}, {
key: 'nonblockPass',
value: function nonblockPass(elem, event, eventName) {
elem.classList.add('nonblock-hide');
var elBelow = document.elementFromPoint(event.clientX, event.clientY);
if (this.nonBlockLastElem === false) {
this.nonBlockLastElem = elBelow;
}
var range = void 0,
textNode = void 0,
whitespaceBefore = void 0,
text = void 0,
offset = void 0;
if (document.caretPositionFromPoint) {
range = document.caretPositionFromPoint(event.clientX, event.clientY);
textNode = range ? range.offsetNode : null;
offset = range ? range.offset : null;
} else if (document.caretRangeFromPoint) {
range = document.caretRangeFromPoint(event.clientX, event.clientY);
textNode = range ? range.endContainer : null;
offset = range ? range.endOffset : null;
}
if (range) {
whitespaceBefore = range.startContainer.textContent.match(/^[\s\n]*/)[0];
text = range.startContainer.textContent.replace(/[\s\n]+$/g, '');
}
elem.classList.remove('nonblock-hide');
var cursorStyle = this.getCursor(elBelow);
this.isOverTextNode = false;
if (cursorStyle === 'auto' && elBelow.tagName === 'A') {
cursorStyle = 'pointer';
} else if (range && (!whitespaceBefore.length || offset > whitespaceBefore.length) && offset < text.length) {
if (cursorStyle === 'auto') {
cursorStyle = 'text';
}
this.isOverTextNode = true;
}
if (range && this.selectingText && offset > 0) {
var selection = window.getSelection();
var selectionRange = void 0;
if (selection.rangeCount === 0) {
this.selectingText = {
originContainer: range.startContainer ? range.startContainer : textNode,
originOffset: offset - 1
};
selectionRange = document.createRange();
selection.addRange(selectionRange);
} else {
selectionRange = selection.getRangeAt(0);
}
if (textNode === this.selectingText.originContainer && offset < this.selectingText.originOffset || textNode.compareDocumentPosition(this.selectingText.originContainer) & Node.DOCUMENT_POSITION_FOLLOWING) {
selectionRange.setEnd(this.selectingText.originContainer, this.selectingText.originOffset);
selectionRange.setStart(textNode, offset);
} else {
selectionRange.setStart(this.selectingText.originContainer, this.selectingText.originOffset);
selectionRange.setEnd(textNode, offset);
}
}
this.setCursor(elem, cursorStyle !== 'auto' ? cursorStyle : 'default');
// If the element changed, call mouseenter, mouseleave, etc.
if (!this.nonBlockLastElem || this.nonBlockLastElem !== elBelow) {
if (this.nonBlockLastElem) {
var lastElem = this.nonBlockLastElem;
if (!lastElem.contains(elBelow)) {
this.domEvent(lastElem, 'mouseleave', event, false);
}
this.domEvent(lastElem, 'mouseout', event, true);
if (!elBelow.contains(lastElem)) {
this.domEvent(elBelow, 'mouseenter', event, false);
}
} else if (!elBelow.contains(elem)) {
this.domEvent(elBelow, 'mouseenter', event, false);
}
this.domEvent(elBelow, 'mouseover', event, true);
}
// If the event is mousedown, then we need to focus the element.
if (eventName === 'onmousedown') {
document.activeElement && document.activeElement.blur();
elBelow.focus({ preventScroll: true });
}
// Forward the event.
this.domEvent(elBelow, eventName, event);
// Remember the latest element the mouse was over.
this.nonBlockLastElem = elBelow;
}
}, {
key: 'getNonBlocking',
value: function getNonBlocking(el) {
var nonblock = el;
while (nonblock) {
if (nonblock.classList && nonblock.classList.contains('nonblock')) {
return nonblock;
}
nonblock = nonblock.parentNode;
}
return false;
}
}, {
key: 'isPropagating',
value: function isPropagating(el) {
return !el.classList.contains('nonblock-stop-propagation');
}
}, {
key: 'isActionPropagating',
value: function isActionPropagating(el) {
return el.classList.contains('nonblock-allow-action-propagation');
}
}, {
key: 'isFocusable',
value: function isFocusable(el) {
return el.classList.contains('nonblock-allow-focus');
}
}, {
key: 'isSimulateMouse',
value: function isSimulateMouse(el) {
return !el.classList.contains('nonblock-stop-mouse-simulation');
}
}, {
key: 'getCursor',
value: function getCursor(el) {
var style = window.getComputedStyle(el);
return style.getPropertyValue('cursor');
}
}, {
key: 'setCursor',
value: function setCursor(el, value) {
if (el.classList.contains('nonblock-cursor-' + value)) {
return;
}
this.remCursor(el);
el.classList.add('nonblock-cursor-' + value);
}
}, {
key: 'remCursor',
value: function remCursor(el) {
var values = Object.keys(el.classList).map(function (e) {
return el.classList[e];
});
[].concat(_toConsumableArray(values)).forEach(function (className) {
if (className.indexOf('nonblock-cursor-') === 0) {
el.classList.remove(className);
}
});
}
}]);
return NonBlock;
}();
return NonBlock;
}());
})();

493
app/node_modules/nonblockjs/NonBlock.js generated vendored Normal file
View File

@@ -0,0 +1,493 @@
/**
* NonBlock.js
*
* Copyright (c) 2017-2018 Hunter Perrin
*
* @author Hunter Perrin <hperrin@gmail.com>
*/
'use strict';
((NonBlock) => {
window.NonBlockJs = {
NonBlock
};
if (document.body) {
window.NonBlockJs.nonBlock = new NonBlock(document.body);
} else {
document.addEventListener('DOMContentLoaded', () => {
window.NonBlockJs.nonBlock = new NonBlock(document.body);
});
}
})((() => {
class NonBlock {
constructor(root, mode) {
this.root = root;
// Detect if we can use "pointer-events".
// Can't use document.documentElement.style because IE9/IE10 report true,
// but only support it on SVG elements, not HTML elements.
const windowStyle = window.getComputedStyle(document.body);
this.pointerEventsSupport = (windowStyle.pointerEvents && windowStyle.pointerEvents === 'auto');
// Some useful regexes.
this.regexOn = /^on/;
this.regexMouseEvents = /^(dbl)?click$|^mouse(move|down|up|over|out|enter|leave)$|^contextmenu$/;
this.regexUiEvents = /^(focus|blur|select|change|reset)$|^key(press|down|up)$/;
this.regexHtmlEvents = /^(scroll|resize|(un)?load|abort|error)$/;
// Whether to use event constructors.
this.useEventConstructors = true;
try {
const e = new MouseEvent('click');
} catch (e) {
this.useEventConstructors = false;
}
// If mode is not provided, use PointerEvents, if it's supported.
if (typeof mode === 'undefined') {
this.mode = this.pointerEventsSupport ? 'PointerEvents' : 'EventForwarding';
} else {
this.mode = mode;
}
// Init the current mode.
if (this['init'+this.mode]) {
this['init'+this.mode]();
}
}
initPointerEvents() {
// Using pointer-events, we can just detect whether an element is being
// hovered over. No event forwarding necessary.
this.addCSS(`.nonblock{transition:opacity .3s ease; pointer-events: none;}.nonblock:hover,.nonblock-hover{opacity:.1 !important;}`);
this.onmousemove = (ev) => {
const nonblocks = document.querySelectorAll('.nonblock');
for (let nonblock of nonblocks) {
const rect = nonblock.getBoundingClientRect();
if (ev.clientX >= rect.left && ev.clientX <= rect.right && ev.clientY >= rect.top && ev.clientY <= rect.bottom) {
if (!nonblock.classList.contains('nonblock-hover')) {
nonblock.classList.add('nonblock-hover');
if (this.isSimulateMouse(nonblock) && ev.isTrusted) {
this.domEvent(nonblock, 'onmouseenter', ev, false);
this.domEvent(nonblock, 'onmouseover', ev, true);
}
} else if (this.isSimulateMouse(nonblock) && ev.isTrusted) {
this.domEvent(nonblock, 'onmousemove', ev, true);
}
} else {
if (nonblock.classList.contains('nonblock-hover')) {
if (this.isSimulateMouse(nonblock) && ev.isTrusted) {
this.domEvent(nonblock, 'onmouseout', ev, true);
this.domEvent(nonblock, 'onmouseleave', ev, false);
}
nonblock.classList.remove('nonblock-hover');
}
}
}
};
this.root.addEventListener('mousemove', this.onmousemove);
}
initEventForwarding() {
// No pointer-events means we have to fall back to using event forwarding.
this.addCSS(`.nonblock{transition:opacity .3s ease;}
.nonblock:hover{opacity:.1 !important;}
.nonblock-hide{position:absolute !important;left:-10000000px !important;right:10000000px !important;}
.nonblock-cursor-auto{cursor:auto !important;}
.nonblock-cursor-default{cursor:default !important;}
.nonblock-cursor-none{cursor:none !important;}
.nonblock-cursor-context-menu{cursor:context-menu !important;}
.nonblock-cursor-help{cursor:help !important;}
.nonblock-cursor-pointer{cursor:pointer !important;}
.nonblock-cursor-progress{cursor:progress !important;}
.nonblock-cursor-wait{cursor:wait !important;}
.nonblock-cursor-cell{cursor:cell !important;}
.nonblock-cursor-crosshair{cursor:crosshair !important;}
.nonblock-cursor-text{cursor:text !important;}
.nonblock-cursor-vertical-text{cursor:vertical-text !important;}
.nonblock-cursor-alias{cursor:alias !important;}
.nonblock-cursor-copy{cursor:copy !important;}
.nonblock-cursor-move{cursor:move !important;}
.nonblock-cursor-no-drop{cursor:no-drop !important;}
.nonblock-cursor-not-allowed{cursor:not-allowed !important;}
.nonblock-cursor-all-scroll{cursor:all-scroll !important;}
.nonblock-cursor-col-resize{cursor:col-resize !important;}
.nonblock-cursor-row-resize{cursor:row-resize !important;}
.nonblock-cursor-n-resize{cursor:n-resize !important;}
.nonblock-cursor-e-resize{cursor:e-resize !important;}
.nonblock-cursor-s-resize{cursor:s-resize !important;}
.nonblock-cursor-w-resize{cursor:w-resize !important;}
.nonblock-cursor-ne-resize{cursor:ne-resize !important;}
.nonblock-cursor-nw-resize{cursor:nw-resize !important;}
.nonblock-cursor-se-resize{cursor:se-resize !important;}
.nonblock-cursor-sw-resize{cursor:sw-resize !important;}
.nonblock-cursor-ew-resize{cursor:ew-resize !important;}
.nonblock-cursor-ns-resize{cursor:ns-resize !important;}
.nonblock-cursor-nesw-resize{cursor:nesw-resize !important;}
.nonblock-cursor-nwse-resize{cursor:nwse-resize !important;}
.nonblock-cursor-zoom-in{cursor:zoom-in !important;}
.nonblock-cursor-zoom-out{cursor:zoom-out !important;}
.nonblock-cursor-grab{cursor:grab !important;}
.nonblock-cursor-grabbing{cursor:grabbing !important;}`);
// This keeps track of the last element the mouse was over, so
// mouseleave, mouseenter, etc can be called.
this.nonBlockLastElem = null;
// These are used for selecting text under a nonblock element.
this.isOverTextNode = false;
this.selectingText = false;
this.onmouseenter = (ev) => {
let nonblock;
if (ev.isTrusted && (nonblock = this.getNonBlocking(ev.target))) {
this.nonBlockLastElem = false;
if (!this.isPropagating(nonblock)) {
ev.stopPropagation();
}
}
};
this.onmouseleave = (ev) => {
let nonblock;
if (ev.isTrusted && (nonblock = this.getNonBlocking(ev.target))) {
this.remCursor(nonblock);
this.nonBlockLastElem = null;
this.selectingText = false;
if (!this.isPropagating(nonblock)) {
ev.stopPropagation();
}
}
};
this.onmouseover = (ev) => {
let nonblock;
if (ev.isTrusted && (nonblock = this.getNonBlocking(ev.target)) && !this.isPropagating(nonblock)) {
ev.stopPropagation();
}
};
this.onmouseout = (ev) => {
let nonblock;
if (ev.isTrusted && (nonblock = this.getNonBlocking(ev.target)) && !this.isPropagating(nonblock)) {
ev.stopPropagation();
}
};
this.onmousemove = (ev) => {
let nonblock;
if (ev.isTrusted && (nonblock = this.getNonBlocking(ev.target))) {
this.nonblockPass(nonblock, ev, 'onmousemove');
// If the user just clicks somewhere, we don't want to select text, so this
// detects that the user moved their mouse.
if (this.selectingText === null) {
window.getSelection().removeAllRanges();
this.selectingText = true;
} else if (this.selectingText) {
// Stop the default action, which would be selecting text.
ev.preventDefault();
}
if (!this.isPropagating(nonblock)) {
ev.stopPropagation();
}
}
};
this.onmousedown = (ev) => {
let nonblock;
if (ev.isTrusted && (nonblock = this.getNonBlocking(ev.target))) {
this.nonblockPass(nonblock, ev, 'onmousedown');
this.selectingText = null;
if (!this.isFocusable(nonblock)) {
// Stop the default action, which would focus the element.
ev.preventDefault();
}
if (!this.isPropagating(nonblock) || !this.isActionPropagating(nonblock)) {
ev.stopPropagation();
}
}
};
this.onmouseup = (ev) => {
let nonblock;
if (ev.isTrusted && (nonblock = this.getNonBlocking(ev.target))) {
this.nonblockPass(nonblock, ev, 'onmouseup');
if (this.selectingText === null) {
window.getSelection().removeAllRanges();
}
this.selectingText = false;
if (!this.isPropagating(nonblock) || !this.isActionPropagating(nonblock)) {
ev.stopPropagation();
}
}
};
this.onclick = (ev) => {
let nonblock;
if (ev.isTrusted && (nonblock = this.getNonBlocking(ev.target))) {
this.nonblockPass(nonblock, ev, 'onclick');
if (!this.isPropagating(nonblock) || !this.isActionPropagating(nonblock)) {
ev.stopPropagation();
}
}
};
this.ondblclick = (ev) => {
let nonblock;
if (ev.isTrusted && (nonblock = this.getNonBlocking(ev.target))) {
this.nonblockPass(nonblock, ev, 'ondblclick');
if (!this.isPropagating(nonblock) || !this.isActionPropagating(nonblock)) {
ev.stopPropagation();
}
}
};
this.root.addEventListener('mouseenter', this.onmouseenter, true);
this.root.addEventListener('mouseleave', this.onmouseleave, true);
this.root.addEventListener('mouseover', this.onmouseover, true);
this.root.addEventListener('mouseout', this.onmouseout, true);
this.root.addEventListener('mousemove', this.onmousemove, true);
this.root.addEventListener('mousedown', this.onmousedown, true);
this.root.addEventListener('mouseup', this.onmouseup, true);
this.root.addEventListener('click', this.onclick, true);
this.root.addEventListener('dblclick', this.ondblclick, true);
}
destroy() {
for (let event of ['mouseenter', 'mouseleave', 'mouseover', 'mouseout', 'mousemove', 'mousedown', 'mouseup', 'click', 'dblclick']) {
if (this['on'+event]) {
this.root.removeEventListener(event, this['on'+event], true);
delete this['on'+event];
}
}
this.styling.parentNode.removeChild(this.styling);
delete this.styling;
}
addCSS(css) {
this.styling = document.createElement('style');
this.styling.setAttribute('type', 'text/css');
if (this.styling.styleSheet) {
this.styling.styleSheet.cssText = css; // IE
} else {
this.styling.appendChild(document.createTextNode(css));
}
document.getElementsByTagName('head')[0].appendChild(this.styling);
}
// Fire a DOM event.
domEvent(elem, event, origEvent, bubbles) {
let eventObject;
event = event.toLowerCase();
if (this.useEventConstructors) {
// New browsers
event = event.replace(this.regexOn, '');
if (event.match(this.regexMouseEvents)) {
eventObject = new MouseEvent(event, {
screenX: origEvent.screenX,
screenY: origEvent.screenY,
clientX: origEvent.clientX,
clientY: origEvent.clientY,
ctrlKey: origEvent.ctrlKey,
shiftKey: origEvent.shiftKey,
altKey: origEvent.altKey,
metaKey: origEvent.metaKey,
button: origEvent.button,
buttons: origEvent.buttons,
relatedTarget: origEvent.relatedTarget,
region: origEvent.region,
detail: origEvent.detail,
view: origEvent.view,
bubbles: bubbles === undefined ? origEvent.bubbles : bubbles,
cancelable: origEvent.cancelable,
composed: origEvent.composed
});
} else if (event.match(this.regexUiEvents)) {
eventObject = new UIEvent(event, {
detail: origEvent.detail,
view: origEvent.view,
bubbles: bubbles === undefined ? origEvent.bubbles : bubbles,
cancelable: origEvent.cancelable,
composed: origEvent.composed
});
} else if (event.match(this.regexHtmlEvents)) {
eventObject = new Event(event, {
bubbles: bubbles === undefined ? origEvent.bubbles : bubbles,
cancelable: origEvent.cancelable,
composed: origEvent.composed
});
}
if (!eventObject) {
return;
}
elem.dispatchEvent(eventObject);
} else if (document.createEvent && elem.dispatchEvent) {
// Old method for FireFox, Opera, Safari, Chrome
event = event.replace(this.regexOn, '');
if (event.match(this.regexMouseEvents)) {
// This allows the click event to fire on the notice. There is
// probably a much better way to do it.
elem.getBoundingClientRect();
eventObject = document.createEvent("MouseEvents");
eventObject.initMouseEvent(event, bubbles === undefined ? origEvent.bubbles : bubbles, origEvent.cancelable, origEvent.view, origEvent.detail, origEvent.screenX, origEvent.screenY, origEvent.clientX, origEvent.clientY, origEvent.ctrlKey, origEvent.altKey, origEvent.shiftKey, origEvent.metaKey, origEvent.button, origEvent.relatedTarget);
} else if (event.match(this.regexUiEvents)) {
eventObject = document.createEvent("UIEvents");
eventObject.initUIEvent(event, bubbles === undefined ? origEvent.bubbles : bubbles, origEvent.cancelable, origEvent.view, origEvent.detail);
} else if (event.match(this.regexHtmlEvents)) {
eventObject = document.createEvent("HTMLEvents");
eventObject.initEvent(event, bubbles === undefined ? origEvent.bubbles : bubbles, origEvent.cancelable);
}
if (!eventObject) {
return;
}
elem.dispatchEvent(eventObject);
} else {
// Internet Explorer
if (!event.match(this.regexOn)) {
event = "on"+event
};
eventObject = document.createEventObject(origEvent);
elem.fireEvent(event, eventObject);
}
}
// This is used to pass events through the el if it is nonblocking.
nonblockPass(elem, event, eventName) {
elem.classList.add('nonblock-hide');
const elBelow = document.elementFromPoint(event.clientX, event.clientY);
if (this.nonBlockLastElem === false) {
this.nonBlockLastElem = elBelow;
}
let range, textNode, whitespaceBefore, text, offset;
if (document.caretPositionFromPoint) {
range = document.caretPositionFromPoint(event.clientX, event.clientY);
textNode = range ? range.offsetNode : null;
offset = range ? range.offset : null;
} else if (document.caretRangeFromPoint) {
range = document.caretRangeFromPoint(event.clientX, event.clientY);
textNode = range ? range.endContainer : null;
offset = range ? range.endOffset : null;
}
if (range) {
whitespaceBefore = range.startContainer.textContent.match(/^[\s\n]*/)[0];
text = range.startContainer.textContent.replace(/[\s\n]+$/g, '');
}
elem.classList.remove('nonblock-hide');
let cursorStyle = this.getCursor(elBelow);
this.isOverTextNode = false;
if (cursorStyle === 'auto' && elBelow.tagName === 'A') {
cursorStyle = 'pointer';
} else if (range && (!whitespaceBefore.length || offset > whitespaceBefore.length) && offset < text.length) {
if (cursorStyle === 'auto') {
cursorStyle = 'text';
}
this.isOverTextNode = true;
}
if (range && this.selectingText && offset > 0) {
const selection = window.getSelection();
let selectionRange;
if (selection.rangeCount === 0) {
this.selectingText = {
originContainer: range.startContainer ? range.startContainer : textNode,
originOffset: offset - 1
};
selectionRange = document.createRange();
selection.addRange(selectionRange);
} else {
selectionRange = selection.getRangeAt(0);
}
if (
(textNode === this.selectingText.originContainer && offset < this.selectingText.originOffset)
|| (textNode.compareDocumentPosition(this.selectingText.originContainer) & Node.DOCUMENT_POSITION_FOLLOWING)
) {
selectionRange.setEnd(this.selectingText.originContainer, this.selectingText.originOffset);
selectionRange.setStart(textNode, offset);
} else {
selectionRange.setStart(this.selectingText.originContainer, this.selectingText.originOffset);
selectionRange.setEnd(textNode, offset);
}
}
this.setCursor(elem, cursorStyle !== 'auto' ? cursorStyle : 'default');
// If the element changed, call mouseenter, mouseleave, etc.
if (!this.nonBlockLastElem || this.nonBlockLastElem !== elBelow) {
if (this.nonBlockLastElem) {
const lastElem = this.nonBlockLastElem;
if (!lastElem.contains(elBelow)) {
this.domEvent(lastElem, 'mouseleave', event, false);
}
this.domEvent(lastElem, 'mouseout', event, true);
if (!elBelow.contains(lastElem)) {
this.domEvent(elBelow, 'mouseenter', event, false);
}
} else if (!elBelow.contains(elem)) {
this.domEvent(elBelow, 'mouseenter', event, false);
}
this.domEvent(elBelow, 'mouseover', event, true);
}
// If the event is mousedown, then we need to focus the element.
if (eventName === 'onmousedown') {
document.activeElement && document.activeElement.blur();
elBelow.focus({preventScroll: true});
}
// Forward the event.
this.domEvent(elBelow, eventName, event);
// Remember the latest element the mouse was over.
this.nonBlockLastElem = elBelow;
}
getNonBlocking(el) {
let nonblock = el;
while (nonblock) {
if (nonblock.classList && nonblock.classList.contains('nonblock')) {
return nonblock;
}
nonblock = nonblock.parentNode;
}
return false;
}
isPropagating(el) {
return !el.classList.contains('nonblock-stop-propagation');
}
isActionPropagating(el) {
return el.classList.contains('nonblock-allow-action-propagation');
}
isFocusable(el) {
return el.classList.contains('nonblock-allow-focus');
}
isSimulateMouse(el) {
return !el.classList.contains('nonblock-stop-mouse-simulation');
}
getCursor(el) {
const style = window.getComputedStyle(el);
return style.getPropertyValue('cursor');
}
setCursor(el, value) {
if (el.classList.contains('nonblock-cursor-' + value)) {
return;
}
this.remCursor(el);
el.classList.add('nonblock-cursor-' + value);
}
remCursor(el) {
const values = Object.keys(el.classList).map(e => el.classList[e]);
[...values].forEach((className) => {
if (className.indexOf('nonblock-cursor-') === 0) {
el.classList.remove(className);
}
});
}
}
return NonBlock;
})());

73
app/node_modules/nonblockjs/README.md generated vendored Normal file
View File

@@ -0,0 +1,73 @@
# NonBlock.js
Unobtrusive (click through) UI elements in JavaScript.
NonBlock.js lets you provide unobstrusive UI elements. They will fade when a user hovers over them, and let the user click, select, and interact with elements under them.
## Demos
https://sciactive.github.io/nonblockjs/
## Installation
### Install via NPM with:
```sh
npm install --save nonblockjs
```
```html
<script src="node_modules/nonblockjs/NonBlock.es5.js" type="text/javascript"></script>
```
### Or use jsDelivr:
```html
<script src="https://cdn.jsdelivr.net/npm/nonblockjs@1/NonBlock.es5.js" type="text/javascript"></script>
```
## Usage
Add the class `nonblock` to any element you want to make nonblocking.
## How Does it Work?
There are two modes that NonBlock.js can use, "PointerEvents" and "EventForwarding".
* "PointerEvents" is used for newer browsers, and allows *all* features of below elements to work.
* "EventForwarding" is used for browsers that don't support the CSS "pointer-events" property (IE9 and IE10), and allows *most* features of below elements to work.
NonBlock.js detects whether the browser supports "pointer-events" and selects the mode automatically. If you want to force NonBlock.js into a specific mode, like "EventForwarding", you can do this:
```js
window.NonBlockJs.nonBlock.destroy();
window.NonBlockJs.nonBlock = new window.NonBlockJs.NonBlock(document.body, "EventForwarding");
```
### PointerEvents Mode
Nonblocking elements are given the `pointer-events: none;` style, so that the cursor does not interact with them. NonBlock.js will listen to `mousemove` events on the document body and will detect when the cursor passes over a nonblocking element. It applies the `nonblock-hover` class to fade the element.
#### Mouse Events in PointerEvents Mode
Normally, an element with the `pointer-events: none;` style will not receive any events related to mouse movement/interaction. In order to let you listen for these events, NonBlock.js will fire simulated `mouseover`, `mouseenter`, `mousemove`, `mouseout`, and `mouseleave` events on the nonblocking element. You can add the class `nonblock-stop-mouse-simulation` to prevent this behavior. (It is worth noting that only the element with `nonblock` receives these events. None of its children receive any events.)
### EventForwarding Mode
Nonblocking elements have a `:hover` pseudoclass applied to them that will fade them. NonBlock.js will listen for mouse events on document.body and detect when a mouse event is fired on a nonblocking element. It will detect what element is below the nonblocking element and forward the event to that element. It will detect the cursor that applies to that element and apply the same cursor to the nonblocking element. It also watches mousedown and mousemove and attempts to allow the user to select text.
All of this means that *most* features of the below elements will work in EventForwarding mode, with the notable exception of `:hover` styles, since those cannot be programmatically activated.
#### Event Propagation and Default Actions in EventForwarding Mode
By default in EventForwarding mode, NonBlock.js will propagate mouse events that are unrelated to clicking the mouse. It will also stop the default action of mousedown events, preventing nonblocking elements from being focused with the mouse (which allows elements underneath to gain focus).
Add the class `nonblock-allow-focus` to keep NonBlock.js from preventing the default action of mousedown events.
Add the class `nonblock-stop-propagation` if you want NonBlock.js to stop event propagation for all mouse events, effectively disguising it from its ancestors.
Add the class `nonblock-allow-action-propagation` if you want NonBlock.js to allow event propagation for action events (related to clicking the mouse). This may cause components that are designed to open on mouse clicks (like dropdown menus) to detect the click on the nonblocking element and mistakenly assume the user has clicked elsewhere and make the component inaccessible (close the menu).
## Author
NonBlock.js was written by Hunter Perrin as part of [PNotify](https://github.com/sciactive/pnotify).

69
app/node_modules/nonblockjs/package.json generated vendored Normal file
View File

@@ -0,0 +1,69 @@
{
"_from": "nonblockjs@1.0.8",
"_id": "nonblockjs@1.0.8",
"_inBundle": false,
"_integrity": "sha512-9TV8Ub+5/yts4TYPlVVL3KwOdU3VKW9agHRmkTJVTOGjNVx+P7b7NzqVBMSJMA0zY1vwfnNQXzZwYwDzb0R9OA==",
"_location": "/nonblockjs",
"_phantomChildren": {},
"_requested": {
"type": "version",
"registry": true,
"raw": "nonblockjs@1.0.8",
"name": "nonblockjs",
"escapedName": "nonblockjs",
"rawSpec": "1.0.8",
"saveSpec": null,
"fetchSpec": "1.0.8"
},
"_requiredBy": [
"#USER",
"/"
],
"_resolved": "https://registry.npmjs.org/nonblockjs/-/nonblockjs-1.0.8.tgz",
"_shasum": "54aa8d1b590c93e57c167d5f0433db7ae73aafa1",
"_spec": "nonblockjs@1.0.8",
"_where": "E:\\projects\\p\\gitlit\\app",
"author": {
"name": "Hunter Perrin"
},
"bugs": {
"url": "https://github.com/sciactive/nonblockjs/issues"
},
"bundleDependencies": false,
"dependencies": {},
"deprecated": false,
"description": "Unobtrusive (click through) UI elements in JavaScript.",
"devDependencies": {
"babel-cli": "^6.26.0",
"babel-plugin-iife-wrap": "^1.1.0",
"babel-preset-env": "^1.6.1",
"babel-preset-stage-3": "^6.24.1"
},
"files": [
"NonBlock.es5.js",
"NonBlock.js"
],
"homepage": "https://github.com/sciactive/nonblockjs",
"keywords": [
"non blocking",
"nonblocking",
"nonblock",
"ui",
"unobtrusive",
"click through"
],
"license": "Apache-2.0",
"main": "NonBlock.js",
"name": "nonblockjs",
"repository": {
"type": "git",
"url": "git+https://github.com/sciactive/nonblockjs.git"
},
"scripts": {
"build": "babel -o NonBlock.es5.js NonBlock.js",
"prepare": "npm run build",
"test": "echo \"Error: no test specified\" && exit 1",
"watch": "babel --watch -o NonBlock.es5.js NonBlock.js"
},
"version": "1.0.8"
}