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

remove electron-in-page-search

This commit is contained in:
s2
2019-06-06 15:44:24 +02:00
parent e2a57318a7
commit c5f9b551ab
92637 changed files with 636010 additions and 15 deletions

1181
app/node_modules/pnotify/src/PNotify.html generated vendored Normal file

File diff suppressed because it is too large Load Diff

150
app/node_modules/pnotify/src/PNotifyAnimate.html generated vendored Normal file
View File

@@ -0,0 +1,150 @@
<script>
import PNotify from './PNotify.html';
export default {
setup (Component) {
Component.key = 'Animate';
Component.defaults = {
// Use animate.css to animate the notice.
animate: false,
// The class to use to animate the notice in.
inClass: '',
// The class to use to animate the notice out.
outClass: ''
};
Component.init = (notice) => {
notice.attention = (aniClass, callback) => {
const cb = () => {
notice.refs.container.removeEventListener('webkitAnimationEnd', cb);
notice.refs.container.removeEventListener('mozAnimationEnd', cb);
notice.refs.container.removeEventListener('MSAnimationEnd', cb);
notice.refs.container.removeEventListener('oanimationend', cb);
notice.refs.container.removeEventListener('animationend', cb);
notice.refs.container.classList.remove(aniClass);
if (callback) {
callback.call(notice);
}
};
notice.refs.container.addEventListener('webkitAnimationEnd', cb);
notice.refs.container.addEventListener('mozAnimationEnd', cb);
notice.refs.container.addEventListener('MSAnimationEnd', cb);
notice.refs.container.addEventListener('oanimationend', cb);
notice.refs.container.addEventListener('animationend', cb);
notice.refs.container.classList.add('animated');
notice.refs.container.classList.add(aniClass);
};
return new Component({ target: document.body });
};
// Register the module with PNotify.
PNotify.modules.Animate = Component;
},
data () {
return Object.assign({
'_notice': null, // The PNotify notice.
'_options': {} // The options for the notice.
}, PNotify.modules.Animate.defaults);
},
methods: {
initModule (options) {
this.set(options);
this.setUpAnimations();
},
update () {
this.setUpAnimations();
},
setUpAnimations () {
const { _notice, _options, animate } = this.get();
if (animate) {
_notice.set({ 'animation': 'none' });
if (!_notice._animateIn) {
_notice._animateIn = _notice.animateIn;
}
if (!_notice._animateOut) {
_notice._animateOut = _notice.animateOut;
}
_notice.animateIn = this.animateIn.bind(this);
_notice.animateOut = this.animateOut.bind(this);
var animSpeed = 250;
if (_options.animateSpeed === 'slow') {
animSpeed = 400;
} else if (_options.animateSpeed === 'fast') {
animSpeed = 100;
} else if (_options.animateSpeed > 0) {
animSpeed = _options.animateSpeed;
}
animSpeed = animSpeed / 1000;
_notice.refs.elem.style.WebkitAnimationDuration = animSpeed + 's';
_notice.refs.elem.style.MozAnimationDuration = animSpeed + 's';
_notice.refs.elem.style.animationDuration = animSpeed + 's';
} else if (_notice._animateIn && _notice._animateOut) {
_notice.animateIn = _notice._animateIn;
delete _notice._animateIn;
_notice.animateOut = _notice._animateOut;
delete _notice._animateOut;
}
},
animateIn (callback) {
const { _notice } = this.get();
// Declare that the notice is animating in.
_notice.set({ '_animating': 'in' });
const finished = () => {
_notice.refs.elem.removeEventListener('webkitAnimationEnd', finished);
_notice.refs.elem.removeEventListener('mozAnimationEnd', finished);
_notice.refs.elem.removeEventListener('MSAnimationEnd', finished);
_notice.refs.elem.removeEventListener('oanimationend', finished);
_notice.refs.elem.removeEventListener('animationend', finished);
_notice.set({ '_animatingClass': 'ui-pnotify-in animated' });
if (callback) {
callback.call();
}
// Declare that the notice has completed animating.
_notice.set({ '_animating': false });
};
_notice.refs.elem.addEventListener('webkitAnimationEnd', finished);
_notice.refs.elem.addEventListener('mozAnimationEnd', finished);
_notice.refs.elem.addEventListener('MSAnimationEnd', finished);
_notice.refs.elem.addEventListener('oanimationend', finished);
_notice.refs.elem.addEventListener('animationend', finished);
_notice.set({ '_animatingClass': 'ui-pnotify-in animated ' + this.get().inClass });
},
animateOut (callback) {
const { _notice } = this.get();
// Declare that the notice is animating out.
_notice.set({ '_animating': 'out' });
const finished = () => {
_notice.refs.elem.removeEventListener('webkitAnimationEnd', finished);
_notice.refs.elem.removeEventListener('mozAnimationEnd', finished);
_notice.refs.elem.removeEventListener('MSAnimationEnd', finished);
_notice.refs.elem.removeEventListener('oanimationend', finished);
_notice.refs.elem.removeEventListener('animationend', finished);
_notice.set({ '_animatingClass': 'animated' });
if (callback) {
callback.call();
}
// Declare that the notice has completed animating.
_notice.set({ '_animating': false });
};
_notice.refs.elem.addEventListener('webkitAnimationEnd', finished);
_notice.refs.elem.addEventListener('mozAnimationEnd', finished);
_notice.refs.elem.addEventListener('MSAnimationEnd', finished);
_notice.refs.elem.addEventListener('oanimationend', finished);
_notice.refs.elem.addEventListener('animationend', finished);
_notice.set({ '_animatingClass': 'ui-pnotify-in animated ' + this.get().outClass });
}
}
};
</script>

186
app/node_modules/pnotify/src/PNotifyBrightTheme.css generated vendored Normal file
View File

@@ -0,0 +1,186 @@
/*
Color Scheme: http://paletton.com/palette.php?uid=c1T3n2J040kpEKzpEKzbEPSOEyiNk9W
*/
[ui-pnotify].ui-pnotify .brighttheme {
-webkit-border-radius: 0;
-moz-border-radius: 0;
border-radius: 0;
}
[ui-pnotify].ui-pnotify .brighttheme.ui-pnotify-container {
padding: 1.3rem;
}
[ui-pnotify].ui-pnotify-with-icon .brighttheme .ui-pnotify-title,
[ui-pnotify].ui-pnotify-with-icon .brighttheme .ui-pnotify-text,
[ui-pnotify].ui-pnotify-with-icon .brighttheme .ui-pnotify-confirm {
margin-left: 1.8rem;
}
[dir=rtl] [ui-pnotify].ui-pnotify-with-icon .brighttheme .ui-pnotify-title,
[dir=rtl] [ui-pnotify].ui-pnotify-with-icon .brighttheme .ui-pnotify-text,
[dir=rtl] [ui-pnotify].ui-pnotify-with-icon .brighttheme .ui-pnotify-confirm {
margin-right: 1.8rem;
margin-left: 0;
}
[ui-pnotify].ui-pnotify .brighttheme .ui-pnotify-title {
font-size: 1.2rem;
line-height: 1.4rem;
margin-top: -.2rem;
margin-bottom: 1rem;
}
[ui-pnotify].ui-pnotify .brighttheme .ui-pnotify-text {
font-size: 1rem;
line-height: 1.2rem;
margin-top: 0;
}
[ui-pnotify].ui-pnotify .brighttheme .ui-pnotify-icon {
line-height: 1;
}
[ui-pnotify].ui-pnotify .brighttheme-notice {
background-color: #FFFFA2;
border: 0 solid #FFFF00;
}
[ui-pnotify].ui-pnotify .brighttheme-notice h4,
[ui-pnotify].ui-pnotify .brighttheme-notice div {
color: #4F4F00;
}
[ui-pnotify].ui-pnotify .brighttheme-info {
background-color: #8FCEDD;
border: 0 solid #0286A5;
}
[ui-pnotify].ui-pnotify .brighttheme-info h4,
[ui-pnotify].ui-pnotify .brighttheme-info div {
color: #012831;
}
[ui-pnotify].ui-pnotify .brighttheme-success {
background-color: #AFF29A;
border: 0 solid #35DB00;
}
[ui-pnotify].ui-pnotify .brighttheme-success h4,
[ui-pnotify].ui-pnotify .brighttheme-success div {
color: #104300;
}
[ui-pnotify].ui-pnotify .brighttheme-error {
background-color: #FFABA2;
background-image: repeating-linear-gradient(135deg, transparent, transparent 35px, rgba(255,255,255,.3) 35px, rgba(255,255,255,.3) 70px);
border: 0 solid #FF1800;
}
[ui-pnotify].ui-pnotify .brighttheme-error h4,
[ui-pnotify].ui-pnotify .brighttheme-error div {
color: #4F0800;
}
[ui-pnotify].ui-pnotify .brighttheme .ui-pnotify-closer,
[ui-pnotify].ui-pnotify .brighttheme .ui-pnotify-sticker {
font-size: 1rem;
line-height: 1.2rem;
}
[ui-pnotify].ui-pnotify .brighttheme-icon-notice,
[ui-pnotify].ui-pnotify .brighttheme-icon-info,
[ui-pnotify].ui-pnotify .brighttheme-icon-success,
[ui-pnotify].ui-pnotify .brighttheme-icon-error,
[ui-pnotify].ui-pnotify .brighttheme-icon-closer,
[ui-pnotify].ui-pnotify .brighttheme-icon-sticker {
position: relative;
width: 1rem;
height: 1rem;
font-size: 1rem;
font-weight: bold;
line-height: 1rem;
font-family: "Courier New",Courier,monospace;
border-radius: 50%;
}
[ui-pnotify].ui-pnotify .brighttheme-icon-notice:after,
[ui-pnotify].ui-pnotify .brighttheme-icon-info:after,
[ui-pnotify].ui-pnotify .brighttheme-icon-success:after,
[ui-pnotify].ui-pnotify .brighttheme-icon-closer:after,
[ui-pnotify].ui-pnotify .brighttheme-icon-sticker:after {
position: absolute;
top: 0;
left: .2rem;
}
[ui-pnotify].ui-pnotify .brighttheme-icon-notice {
background-color: #2E2E00;
color: #FFFFA2;
}
[ui-pnotify].ui-pnotify .brighttheme-icon-notice:after {
content: "!";
}
[ui-pnotify].ui-pnotify .brighttheme-icon-info {
background-color: #012831;
color: #8FCEDD;
}
[ui-pnotify].ui-pnotify .brighttheme-icon-info:after {
content: "i";
}
[ui-pnotify].ui-pnotify .brighttheme-icon-success {
background-color: #104300;
color: #AFF29A;
}
[ui-pnotify].ui-pnotify .brighttheme-icon-success:after {
content: "\002713";
}
[ui-pnotify].ui-pnotify .brighttheme-icon-error {
width: 0;
height: 0;
font-size: 0;
line-height: 0;
border-radius: 0;
border-left: .6rem solid transparent;
border-right: .6rem solid transparent;
border-bottom: 1.2rem solid #2E0400;
color: #FFABA2;
}
[ui-pnotify].ui-pnotify .brighttheme-icon-error:after {
position: absolute;
top: .1rem;
left: -0.25rem;
font-size: .9rem;
font-weight: bold;
line-height: 1.4rem;
font-family: "Courier New",Courier,monospace;
content: "!";
}
[ui-pnotify].ui-pnotify .brighttheme-icon-closer,
[ui-pnotify].ui-pnotify .brighttheme-icon-sticker {
display: inline-block;
}
[ui-pnotify].ui-pnotify .brighttheme-icon-closer:after {
content: "\002715";
}
[ui-pnotify].ui-pnotify .brighttheme-icon-sticker:after {
top: -1px;
content: "\002016";
}
[ui-pnotify].ui-pnotify .brighttheme-icon-sticker.brighttheme-icon-stuck:after {
content: "\00003E";
}
[ui-pnotify].ui-pnotify .brighttheme .ui-pnotify-confirm {
margin-top: 1rem;
}
[ui-pnotify].ui-pnotify .brighttheme .ui-pnotify-prompt-bar {
margin-bottom: 1rem;
}
[ui-pnotify].ui-pnotify .brighttheme .ui-pnotify-action-button {
text-transform: uppercase;
font-weight: bold;
padding: .4rem 1rem;
border: none;
background: transparent;
cursor: pointer;
}
[ui-pnotify].ui-pnotify .brighttheme-notice .ui-pnotify-action-button.brighttheme-primary {
background-color: #FFFF00;
color: #4F4F00;
}
[ui-pnotify].ui-pnotify .brighttheme-info .ui-pnotify-action-button.brighttheme-primary {
background-color: #0286A5;
color: #012831;
}
[ui-pnotify].ui-pnotify .brighttheme-success .ui-pnotify-action-button.brighttheme-primary {
background-color: #35DB00;
color: #104300;
}
[ui-pnotify].ui-pnotify .brighttheme-error .ui-pnotify-action-button.brighttheme-primary {
background-color: #FF1800;
color: #4F0800;
}

164
app/node_modules/pnotify/src/PNotifyButtons.html generated vendored Normal file
View File

@@ -0,0 +1,164 @@
{#if _showCloser}
<div
class="ui-pnotify-closer {(!closerHover || _mouseIsIn) ? '' : 'ui-pnotify-buttons-hidden'}"
role="button"
tabindex="0"
title="{labels.close}"
on:click="handleCloserClick()">
<span class="{_closerClass}"></span>
</div>
{/if}
{#if _showSticker}
<div
class="ui-pnotify-sticker {(!stickerHover || _mouseIsIn) ? '' : 'ui-pnotify-buttons-hidden'}"
role="button"
aria-pressed="{_options.hide}"
tabindex="0"
title="{_options.hide ? labels.stick : labels.unstick}"
on:click="handleStickerClick()">
<span class="{_options.hide ? _pinUpClass : _pinDownClass}"></span>
</div>
{/if}
<script>
import PNotify from './PNotify.html';
export default {
setup (Component) {
Component.key = 'Buttons';
Component.defaults = {
// Provide a button for the user to manually close the notice.
closer: true,
// Only show the closer button on hover.
closerHover: true,
// Provide a button for the user to manually stick the notice.
sticker: true,
// Only show the sticker button on hover.
stickerHover: true,
// The various displayed text, helps facilitating internationalization.
labels: {
close: 'Close',
stick: 'Stick',
unstick: 'Unstick'
},
// The classes to use for button icons. Leave them null to use the classes from the styling you're using.
classes: {
closer: null,
pinUp: null,
pinDown: null
}
};
// Register the module with PNotify.
PNotify.modules.Buttons = Component;
// Prepend this module to the container.
PNotify.modulesPrependContainer.push(Component);
// Add button icons to icons objects.
Object.assign(PNotify.icons.brighttheme, {
closer: 'brighttheme-icon-closer',
pinUp: 'brighttheme-icon-sticker',
pinDown: 'brighttheme-icon-sticker brighttheme-icon-stuck'
});
Object.assign(PNotify.icons.bootstrap3, {
closer: 'glyphicon glyphicon-remove',
pinUp: 'glyphicon glyphicon-pause',
pinDown: 'glyphicon glyphicon-play'
});
Object.assign(PNotify.icons.fontawesome4, {
closer: 'fa fa-times',
pinUp: 'fa fa-pause',
pinDown: 'fa fa-play'
});
Object.assign(PNotify.icons.fontawesome5, {
closer: 'fas fa-times',
pinUp: 'fas fa-pause',
pinDown: 'fas fa-play'
});
},
oncreate () {
this.fire('init', { module: this });
},
data () {
return Object.assign({
'_notice': null, // The PNotify notice.
'_options': {}, // The options for the notice.
'_mouseIsIn': false
}, PNotify.modules.Buttons.defaults);
},
computed: {
// Whether to show the sticker icon.
_showSticker: ({ sticker, _notice }) => sticker && !(_notice && _notice.refs.elem.classList.contains('nonblock')),
// Whether to show the closer icon.
_showCloser: ({ closer, _notice }) => closer && !(_notice && _notice.refs.elem.classList.contains('nonblock')),
// These are button icon classes.
_pinUpClass: ({ classes, _notice }) => _notice ? (classes.pinUp === null ? _notice.get()._icons.pinUp : classes.pinUp) : '',
_pinDownClass: ({ classes, _notice }) => _notice ? (classes.pinDown === null ? _notice.get()._icons.pinDown : classes.pinDown) : '',
_closerClass: ({ classes, _notice }) => _notice ? (classes.closer === null ? _notice.get()._icons.closer : classes.closer) : ''
},
methods: {
initModule (options) {
this.set(options);
const { _notice } = this.get();
_notice.on('mouseenter', () => this.set({ '_mouseIsIn': true }));
_notice.on('mouseleave', () => this.set({ '_mouseIsIn': false }));
_notice.on('state', ({ changed, current }) => {
if (!changed.hide) {
return;
}
const { sticker } = this.get();
if (!sticker) {
return;
}
// Font Awesome 5 replaces our lovely element with a gross SVG. In
// order to make it play nice with Svelte, we have to clear the
// element and make it again.
const icon = current.hide ? this.get().classes.pinUp : this.get().classes.pinDown;
if (
(this.get()._notice.get().icons === 'fontawesome5') ||
(typeof icon === 'string' && icon.match(/(^| )fa[srlb]($| )/))
) {
this.set({ 'sticker': false });
this.set({ 'sticker': true });
}
});
},
handleStickerClick () {
const { _notice } = this.get();
_notice.update({ hide: !_notice.get().hide });
},
handleCloserClick () {
this.get()._notice.close(false);
this.set({ '_mouseIsIn': false });
}
}
};
</script>
<style>
.ui-pnotify-closer,
.ui-pnotify-sticker {
float: right;
margin-left: .5em;
cursor: pointer;
}
:global([dir=rtl]) .ui-pnotify-closer,
:global([dir=rtl]) .ui-pnotify-sticker {
float: left;
margin-right: .5em;
margin-left: 0;
}
.ui-pnotify-buttons-hidden {
visibility: hidden;
}
</style>

68
app/node_modules/pnotify/src/PNotifyCallbacks.html generated vendored Normal file
View File

@@ -0,0 +1,68 @@
<script>
import PNotify from './PNotify.html';
let _open = PNotify.prototype.open;
let _close = PNotify.prototype.close;
const callbacks = (notice, options, name) => {
let modules = notice ? notice.get().modules : options.modules;
let cbs = (modules && modules.Callbacks) ? modules.Callbacks : {};
return cbs[name] ? cbs[name] : () => true;
};
PNotify.prototype.open = function (...args) {
let ret = callbacks(this, null, 'beforeOpen')(this);
if (ret !== false) {
_open.apply(this, args);
callbacks(this, null, 'afterOpen')(this);
}
};
PNotify.prototype.close = function (timerHide, ...args) {
let ret = callbacks(this, null, 'beforeClose')(this, timerHide);
if (ret !== false) {
_close.apply(this, [timerHide, ...args]);
callbacks(this, null, 'afterClose')(this, timerHide);
}
};
export default {
setup (Component) {
Component.key = 'Callbacks';
Component.getCallbacks = callbacks;
let _alert = PNotify.alert;
let _notice = PNotify.notice;
let _info = PNotify.info;
let _success = PNotify.success;
let _error = PNotify.error;
let init = (original, options) => {
callbacks(null, options, 'beforeInit')(options);
let notice = original(options);
callbacks(notice, null, 'afterInit')(notice);
return notice;
};
PNotify.alert = (options) => {
return init(_alert, options);
};
PNotify.notice = (options) => {
return init(_notice, options);
};
PNotify.info = (options) => {
return init(_info, options);
};
PNotify.success = (options) => {
return init(_success, options);
};
PNotify.error = (options) => {
return init(_error, options);
};
// Register the module with PNotify.
PNotify.modules.Callbacks = Component;
}
};
</script>

225
app/node_modules/pnotify/src/PNotifyCompat.js generated vendored Normal file
View File

@@ -0,0 +1,225 @@
import PNotify from './PNotify.html';
// Translate v3 options to v4 options.
const translateOptions = (options, module, moduleName) => {
// Merge the classic default options.
const newOptions = module ? Object.assign({}, moduleName ? PNotifyCompat.prototype.options[moduleName] : {}, options) : Object.assign({}, PNotifyCompat.prototype.options, options);
const translateName = (badName) => {
let goodName = badName;
let underscoreIndex;
while ((underscoreIndex = goodName.indexOf('_')) !== -1) {
goodName = goodName.slice(0, underscoreIndex) + goodName.slice(underscoreIndex + 1, underscoreIndex + 2).toUpperCase() + goodName.slice(underscoreIndex + 2);
}
return goodName;
};
// Translate all options to the new style.
for (let name in newOptions) {
if (newOptions.hasOwnProperty(name) && name.indexOf('_') !== -1) {
const goodName = translateName(name);
newOptions[goodName] = newOptions[name];
delete newOptions[name];
}
}
if (!module) {
// Options that have changed.
if (newOptions.hasOwnProperty('addclass')) {
newOptions.addClass = newOptions.addclass;
delete newOptions.addclass;
}
if (newOptions.hasOwnProperty('cornerclass')) {
newOptions.cornerClass = newOptions.cornerclass;
delete newOptions.cornerClass;
}
if (newOptions.hasOwnProperty('textEscape')) {
newOptions.textTrusted = !newOptions.textEscape;
delete newOptions.textEscape;
}
if (newOptions.hasOwnProperty('titleEscape')) {
newOptions.titleTrusted = !newOptions.titleEscape;
delete newOptions.titleEscape;
}
// Styling and icons.
if (newOptions.hasOwnProperty('styling')) {
if (newOptions.styling === 'bootstrap3') {
newOptions.icons = 'bootstrap3';
} else if (newOptions.styling === 'fontawesome') {
newOptions.styling = 'bootstrap3';
newOptions.icons = 'fontawesome4';
}
}
// Stacks.
if (newOptions.hasOwnProperty('stack')) {
if (newOptions.stack.overlay_close) {
newOptions.stack.overlayClose = newOptions.stack.overlay_close;
}
}
// Translate module options.
newOptions.modules = {};
if (newOptions.hasOwnProperty('animate')) {
newOptions.modules.Animate = translateOptions(newOptions.animate, true, 'animate');
delete newOptions.animate;
}
if (newOptions.hasOwnProperty('buttons')) {
newOptions.modules.Buttons = translateOptions(newOptions.buttons, true, 'buttons');
delete newOptions.buttons;
if (newOptions.modules.Buttons.classes) {
newOptions.modules.Buttons.classes = translateOptions(newOptions.modules.Buttons.classes, true);
}
}
if (newOptions.hasOwnProperty('confirm')) {
newOptions.modules.Confirm = translateOptions(newOptions.confirm, true, 'confirm');
if (newOptions.modules.Confirm.promptDefault) {
newOptions.modules.Confirm.promptValue = newOptions.modules.Confirm.promptDefault;
delete newOptions.modules.Confirm.promptDefault;
}
delete newOptions.confirm;
}
if (newOptions.hasOwnProperty('desktop')) {
newOptions.modules.Desktop = translateOptions(newOptions.desktop, true, 'desktop');
delete newOptions.desktop;
}
if (newOptions.hasOwnProperty('history')) {
newOptions.modules.History = translateOptions(newOptions.history, true, 'history');
delete newOptions.history;
}
if (newOptions.hasOwnProperty('mobile')) {
newOptions.modules.Mobile = translateOptions(newOptions.mobile, true, 'mobile');
delete newOptions.mobile;
}
if (newOptions.hasOwnProperty('nonblock')) {
newOptions.modules.NonBlock = translateOptions(newOptions.nonblock, true, 'nonblock');
delete newOptions.nonblock;
}
if (newOptions.hasOwnProperty('reference')) {
newOptions.modules.Reference = translateOptions(newOptions.reference, true, 'reference');
delete newOptions.reference;
}
if (newOptions.hasOwnProperty('beforeInit')) {
if (!newOptions.modules.Callbacks) {
newOptions.modules.Callbacks = {};
}
newOptions.modules.Callbacks.beforeInit = newOptions.beforeInit;
delete newOptions.beforeInit;
}
if (newOptions.hasOwnProperty('afterInit')) {
if (!newOptions.modules.Callbacks) {
newOptions.modules.Callbacks = {};
}
newOptions.modules.Callbacks.afterInit = newOptions.afterInit;
delete newOptions.afterInit;
}
if (newOptions.hasOwnProperty('beforeOpen')) {
if (!newOptions.modules.Callbacks) {
newOptions.modules.Callbacks = {};
}
newOptions.modules.Callbacks.beforeOpen = newOptions.beforeOpen;
delete newOptions.beforeOpen;
}
if (newOptions.hasOwnProperty('afterOpen')) {
if (!newOptions.modules.Callbacks) {
newOptions.modules.Callbacks = {};
}
newOptions.modules.Callbacks.afterOpen = newOptions.afterOpen;
delete newOptions.afterOpen;
}
if (newOptions.hasOwnProperty('beforeClose')) {
if (!newOptions.modules.Callbacks) {
newOptions.modules.Callbacks = {};
}
newOptions.modules.Callbacks.beforeClose = newOptions.beforeClose;
delete newOptions.beforeClose;
}
if (newOptions.hasOwnProperty('afterClose')) {
if (!newOptions.modules.Callbacks) {
newOptions.modules.Callbacks = {};
}
newOptions.modules.Callbacks.afterClose = newOptions.afterClose;
delete newOptions.afterClose;
}
}
return newOptions;
};
// The compatibility class.
class PNotifyCompat extends PNotify {
constructor (options) {
if (typeof options !== 'object') {
options = { 'text': options };
}
// These need to be called directly, since we're not using PNotify.alert().
if (PNotify.modules.Callbacks && options.before_init) {
options.before_init(options);
}
options = translateOptions(options);
super({ target: document.body, data: options });
// Override the get function to return the element like it did in v3.
const _get = this.get;
this.get = function (option) {
if (option === undefined) {
return Object.assign(window.jQuery ? window.jQuery(this.refs.elem) : this.refs.elem, _get.call(this));
}
return _get.call(this, option);
};
// Confirm module events.
this.on('pnotify.confirm', (e) => {
if (window.jQuery) {
window.jQuery(this.refs.elem).trigger('pnotify.confirm', [this, e.value]);
}
});
this.on('pnotify.cancel', (e) => {
if (window.jQuery) {
window.jQuery(this.refs.elem).trigger('pnotify.cancel', this);
}
});
if (PNotify.modules.Callbacks) {
PNotify.modules.Callbacks.getCallbacks(this, null, 'afterInit')(this);
}
}
update (options) {
options = translateOptions(options);
return super.update(options);
}
}
// Lets you change defaults the old way.
PNotifyCompat.prototype.options = {
text_escape: false,
title_escape: false
};
// Forward static functions.
PNotifyCompat.reload = () => PNotifyCompat;
PNotifyCompat.removeAll = () => PNotify.removeAll();
PNotifyCompat.removeStack = (stack) => PNotify.removeStack(stack);
PNotifyCompat.positionAll = (animate) => PNotify.positionAll(animate);
// Desktop module permission method.
PNotifyCompat.desktop = {
permission: () => {
PNotify.modules.Desktop.permission();
}
};
// Old style showLast() in History module.
if (window.jQuery) {
window.jQuery(() => {
window.jQuery(document.body).on('pnotify.history-last', function () {
PNotify.modules.History.showLast();
});
});
}
export default PNotifyCompat;

234
app/node_modules/pnotify/src/PNotifyConfirm.html generated vendored Normal file
View File

@@ -0,0 +1,234 @@
{#if confirm || prompt}
<div class="ui-pnotify-confirm">
{#if prompt}
<div
class="
ui-pnotify-prompt-bar
{_notice.get()._styles.promptBar ? _notice.get()._styles.promptBar : ''}
{_notice.get()._styles.text ? _notice.get()._styles.text : ''}
">
{#if promptMultiLine}
<textarea
rows="5"
on:keypress="handleKeyPress(event)"
ref:promptMulti
class="
ui-pnotify-prompt-input
{_notice.get()._styles.input ? _notice.get()._styles.input : ''}
{promptClass}
"
bind:value="promptValue"></textarea>
{:else}
<input
type="text"
on:keypress="handleKeyPress(event)"
ref:promptSingle
class="
ui-pnotify-prompt-input
{_notice.get()._styles.input ? _notice.get()._styles.input : ''}
{promptClass}
"
bind:value="promptValue" />
{/if}
</div>
{/if}
<div
class="
ui-pnotify-action-bar
{_notice.get()._styles.actionBar ? _notice.get()._styles.actionBar : ''}
{_notice.get()._styles.text ? _notice.get()._styles.text : ''}
"
style="justify-content: {align};"
ref:buttons>
{#each buttons as button}
<button
type="button"
on:click="handleClick(button, event)"
class="
ui-pnotify-action-button
{button.primary ? (_notice.get()._styles.btnPrimary ? _notice.get()._styles.btnPrimary : '') : (_notice.get()._styles.btn ? _notice.get()._styles.btn : '')}
{button.addClass ? button.addClass : ''}
">{#if button.textTrusted}{@html button.text}{:else}{button.text}{/if}</button>
{/each}
</div>
</div>
{/if}
<script>
import PNotify from './PNotify.html';
export default {
setup (Component) {
Component.key = 'Confirm';
Component.defaults = {
// Make a confirmation box.
confirm: false,
// Make a prompt.
prompt: false,
// Classes to add to the input element of the prompt.
promptClass: '',
// The value of the prompt.
promptValue: '',
// Whether the prompt should accept multiple lines of text.
promptMultiLine: false,
// For confirmation boxes, true means the first button or the button with promptTrigger will be focused, and null means focus will change only for modal notices. For prompts, true or null means focus the prompt. When false, focus will not change.
focus: null,
// Where to align the buttons. (flex-start, center, flex-end, space-around, space-between)
align: 'flex-end',
// The buttons to display, and their callbacks.
buttons: [
{
text: 'Ok',
textTrusted: false,
addClass: '',
primary: true,
// Whether to trigger this button when the user hits enter in a single line prompt. Also, focus the button if it is a modal prompt.
promptTrigger: true,
click: (notice, value) => {
notice.close();
notice.fire('pnotify.confirm', { notice, value });
}
},
{
text: 'Cancel',
textTrusted: false,
addClass: '',
click: (notice) => {
notice.close();
notice.fire('pnotify.cancel', { notice });
}
}
]
};
// Register the module with PNotify.
PNotify.modules.Confirm = Component;
// Append this module to the container.
PNotify.modulesAppendContainer.push(Component);
// Add button styles to styling objects.
Object.assign(PNotify.styling.brighttheme, {
actionBar: '',
promptBar: '',
btn: '',
btnPrimary: 'brighttheme-primary',
input: ''
});
Object.assign(PNotify.styling.bootstrap3, {
actionBar: 'ui-pnotify-confirm-ml',
promptBar: 'ui-pnotify-confirm-ml',
btn: 'btn btn-default ui-pnotify-confirm-mx-1',
btnPrimary: 'btn btn-default ui-pnotify-confirm-mx-1 btn-primary',
input: 'form-control'
});
Object.assign(PNotify.styling.bootstrap4, {
actionBar: 'ui-pnotify-confirm-ml',
promptBar: 'ui-pnotify-confirm-ml',
btn: 'btn btn-secondary mx-1',
btnPrimary: 'btn btn-primary mx-1',
input: 'form-control'
});
if (!PNotify.styling.material) {
PNotify.styling.material = {};
}
Object.assign(PNotify.styling.material, {
actionBar: '',
promptBar: '',
btn: '',
btnPrimary: 'ui-pnotify-material-primary',
input: ''
});
},
oncreate () {
this.fire('init', { module: this });
},
data () {
return Object.assign({
'_notice': null, // The PNotify notice.
'_options': {} // The options for the notice.
}, PNotify.modules.Confirm.defaults);
},
methods: {
initModule (options) {
this.set(options);
},
afterOpen () {
if (this.get().prompt && this.get().focus !== false) {
if (this.get().promptMultiLine) {
this.refs.promptMulti.focus();
} else {
this.refs.promptSingle.focus();
}
} else if (this.get().confirm &&
(
this.get().focus === true ||
(this.get().focus === null && this.get()._options.stack.modal)
)
) {
const buttons = this.get().buttons;
if (buttons.length) {
let i = buttons.length - 1;
while (i >= 0) {
if (buttons[i].promptTrigger) {
break;
}
i--;
}
this.refs.buttons.children[i].focus();
}
}
},
handleClick (button, event) {
if (button.click) {
button.click(this.get()._notice, this.get().prompt ? this.get().promptValue : null, event);
}
},
handleKeyPress (event) {
if (event.keyCode === 13 && !event.shiftKey) {
event.preventDefault();
const { buttons } = this.get();
for (let i = 0; i < buttons.length; i++) {
if (buttons[i].promptTrigger && buttons[i].click) {
buttons[i].click(this.get()._notice, this.get().prompt ? this.get().promptValue : null, event);
}
}
}
}
}
};
</script>
<style>
.ui-pnotify-action-bar,
.ui-pnotify-prompt-bar {
margin-top: 5px;
clear: both;
}
.ui-pnotify-action-bar {
display: flex;
flex-wrap: wrap;
justify-content: flex-end;
}
.ui-pnotify-prompt-input {
margin-bottom: 5px;
display: block;
width: 100%;
}
.ui-pnotify-confirm-mx-1 {
margin: 0 5px;
}
:global(.ui-pnotify.ui-pnotify-with-icon) .ui-pnotify-confirm-ml {
margin-left: 24px;
}
:global([dir=rtl] .ui-pnotify.ui-pnotify-with-icon) .ui-pnotify-confirm-ml {
margin-right: 24px;
margin-left: 0;
}
</style>

273
app/node_modules/pnotify/src/PNotifyDesktop.html generated vendored Normal file
View File

@@ -0,0 +1,273 @@
<script>
import PNotify from './PNotify.html';
let permission;
const Notification = window.Notification;
let notify = (title, options, onclick, onclose) => {
// Memoize based on feature detection.
if ('Notification' in window) {
notify = (title, options, onclick, onclose) => {
const notice = new Notification(title, options);
if ('NotificationEvent' in window) {
notice.addEventListener('notificationclick', onclick);
notice.addEventListener('close', onclose);
} else if ('addEventListener' in notice) {
notice.addEventListener('click', onclick);
notice.addEventListener('close', onclose);
} else {
notice.onclick = onclick;
notice.onclose = onclose;
}
return notice;
};
} else if ('mozNotification' in navigator) {
notify = (title, options, onclick, onclose) => {
// Gecko < 22
const notice = navigator.mozNotification
.createNotification(title, options.body, options.icon)
.show();
notice.onclick = onclick;
notice.onclose = onclose;
return notice;
};
} else if ('webkitNotifications' in window) {
notify = (title, options, onclick, onclose) => {
const notice = window.webkitNotifications.createNotification(
options.icon,
title,
options.body
);
notice.onclick = onclick;
notice.onclose = onclose;
return notice;
};
} else {
notify = (title, options, onclick, onclose) => {
return null;
};
}
return notify(title, options, onclick, onclose);
};
export default {
setup (Component) {
Component.key = 'Desktop';
Component.defaults = {
// Display the notification as a desktop notification.
desktop: false,
// If desktop notifications are not supported or allowed, fall back to a regular notice.
fallback: true,
// The URL of the icon to display. If false, no icon will show. If null, a default icon will show.
icon: null,
// Using a tag lets you update an existing notice, or keep from duplicating notices between tabs.
// If you leave tag null, one will be generated, facilitating the 'update' function.
// see: http://www.w3.org/TR/notifications/#tags-example
tag: null,
// Optionally display a different title for the desktop.
title: null,
// Optionally display different text for the desktop.
text: null,
// Any additional options to be passed to the Notification constructor.
options: {}
};
Component.init = (notice) => {
return new Component({ target: document.body });
};
Component.permission = () => {
if (typeof Notification !== 'undefined' && 'requestPermission' in Notification) {
Notification.requestPermission();
} else if ('webkitNotifications' in window) {
window.webkitNotifications.requestPermission();
}
};
Component.checkPermission = () => {
if (typeof Notification !== 'undefined' && 'permission' in Notification) {
return (Notification.permission === 'granted' ? 0 : 1);
} else if ('webkitNotifications' in window) {
return window.webkitNotifications.checkPermission() == 0 ? 0 : 1; // eslint-disable-line eqeqeq
} else {
return 1;
}
};
permission = Component.checkPermission();
// Register the module with PNotify.
PNotify.modules.Desktop = Component;
},
data () {
return Object.assign({
'_notice': null, // The PNotify notice.
'_options': {} // The options for the notice.
}, PNotify.modules.Desktop.defaults);
},
methods: {
initModule (options) {
this.set(options);
const { _notice } = this.get();
// Animation should always be 'none' for desktop notices, but remember
// the old animation so it can be recovered.
this.set({ '_oldAnimation': _notice.get().animation });
_notice.on('state', ({ changed, current, previous }) => {
if (changed.animation) {
if (
previous.animation === undefined ||
current.animation !== 'none' ||
(
previous.animation === 'none' &&
current.animation !== this.get()._oldAnimation
)
) {
this.set({ '_oldAnimation': current.animation });
}
}
// This is necessary so desktop notices don't cause spacing problems
// when positioning.
if (changed._animatingClass) {
if (!(current._animatingClass === '' || (permission !== 0 && this.get().fallback) || !this.get().desktop)) {
_notice.set({ '_animatingClass': '' });
}
}
});
if (!this.get().desktop) {
return;
}
permission = PNotify.modules.Desktop.checkPermission();
if (permission !== 0) {
// Keep the notice from opening if fallback is false.
if (!this.get().fallback) {
_notice.set({ 'autoDisplay': false });
}
return;
}
_notice.set({ 'animation': 'none' });
_notice.addModuleClass('ui-pnotify-desktop-hide');
this.genNotice();
},
update () {
const { _notice } = this.get();
if ((permission !== 0 && this.get().fallback) || !this.get().desktop) {
_notice.set({ 'animation': this.get()._oldAnimation });
_notice.removeModuleClass('ui-pnotify-desktop-hide');
return;
} else {
_notice.set({ 'animation': 'none' });
_notice.addModuleClass('ui-pnotify-desktop-hide');
}
this.genNotice();
},
beforeOpen () {
if (this.get().desktop && permission !== 0) {
PNotify.modules.Desktop.permission();
}
if ((permission !== 0 && this.get().fallback) || !this.get().desktop) {
return;
}
const { _desktop } = this.get();
if (_desktop && 'show' in _desktop) {
this.get()._notice.set({ '_moduleIsNoticeOpen': true });
_desktop.show();
}
},
beforeClose () {
if ((permission !== 0 && this.get().fallback) || !this.get().desktop) {
return;
}
const { _desktop } = this.get();
if (_desktop && 'close' in _desktop) {
_desktop.close();
this.get()._notice.set({ '_moduleIsNoticeOpen': false });
}
},
genNotice () {
const { _notice, icon } = this.get();
if (icon === null) {
switch (_notice.get().type) {
case 'error':
this.set({ '_icon': 'data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAACAAAAAgCAYAAABzenr0AAAABmJLR0QA/wD/AP+gvaeTAAAACXBIWXMAAAsTAAALEwEAmpwYAAAAB3RJTUUH3gQJATQg7e6HvQAAAB1pVFh0Q29tbWVudAAAAAAAQ3JlYXRlZCB3aXRoIEdJTVBkLmUHAAABr0lEQVRYw8WXu0oDQRSGv7hRSFYrLTTWKihaqUgUJO+gphBLL1jYpPSCVcAggpWthYhC7Ows9An0IbSPkMRCw8ZmFuI6yczs9cAPuzNz5v92brtrESxGARtokkCcAg2hk7jNl4G2R/m4zFPAiwTgWdRFHnmJuaulOAAaPQDqUZvv9DB3tR0lwIcGwHtU5uca5q4qYZvngJbHpAZ8CtU8dS1gLEyAisegBGTFKWiL65KnzVlY5uOSId6VtNuTtMupOu/TAHiQlNmSskHNXCOAGWBeUp7VhFoApoMAXAOWJoCszBJ9+ALY6vL0JiPgjsKmKUAaOOoBZwIAcNxlJLsCrAOTIQJMAWu62y4LOIqT7lGS96TIcYCMDkBZ46h1gB+PHI28ssq8X/G6DaqG8Piz2DrjVjGXbtSBy46F5QAHwJAizwZugKKscs7gSaqS/KpB/qxsFxwafhf6Odb/eblJi8BGwJdW26BtURxQpMU83hmaDQsNiPtvYMSwj3tgAqDgYzU7wJdHjo9+CgBvEW47lV5Tgj5DMtG0xIfESkIAF+522gdWxTzGEX3i9+6KpOMXF5UBt0NKJCAAAAAASUVORK5CYII=' });
break;
case 'success':
this.set({ '_icon': 'data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAACAAAAAgCAYAAABzenr0AAAABmJLR0QA/wD/AP+gvaeTAAAACXBIWXMAAAsTAAALEwEAmpwYAAAAB3RJTUUH3gQJATQPRj+65AAAAdBJREFUWMPtlzsvRFEQx3+7HmEjoiYKolVJJDRqnS8ggvVIVEQhCIUsEYJGCEH2E4h4FPREaLTbEo1IEJXHrmY2GTf33nPuY7ud5OTenTMz//89Z86ZWShLWf5LB3AOfACFiOMF2AkC3qOc88BXxFEAxlX8ftGdaNCEen8H6oFHYBR4FocwkpTngzzHgF01fwL0aYcp9fVtMW/rsMcWXWijK1Hexgye9smRT6CxaHgjytMYwccNSXqoja9FeVbiZS+OVaeDiUBLAPAJA/i2m5MXgRSQk7llC/DBMOBeBGqAe0eAjQhfvurH3EmgQk6EW6CVEHt+ZFo6J4EU8OoTcF35jhnAl2wSx20LFgyB1yyOWtY2c72ScMAAkPeZy6g4zUBdGAIAcyEq4Z7y7xbdTFgCACMBwPVJqVDHeNqvaplkH5i0sNuUwmaNkQxww20ZSOy7gFvX7SAk0i76jPQQlJoAwAEwq35ngfmwVatSdUMArZZ+K9JQ1Bp6iGqgSt7f/AIOqSzujLEn6AV+JG6zm4HuCZ+AJuAbWAQu5aIJu7JDck0ngDugC/j1c2qPqR13jpxuvWyS8liY/kQcean/lX6ACQ99DdAQYe+Lf0zylMUgf7qDKgzv284QAAAAAElFTkSuQmCC' });
break;
case 'info':
this.set({ '_icon': 'data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAACAAAAAgCAYAAABzenr0AAAABmJLR0QA/wD/AP+gvaeTAAAACXBIWXMAAAsTAAALEwEAmpwYAAAAB3RJTUUH3gQJATQ09zRTwAAAAdxJREFUWMPtl88rRFEUxz8zBolRCgsrpOym8TMSO2WplLKwUrKi/B0W7JSFmhVLNlhSlLKx8CtRGpEsJpofpZk3Nkc9b968e++8mdlw6vTeu/edc773nl/3wl+ngOH/zUAf0AN0AmEgB7wCD8AtcFMJoM3ADpAHLHk62RIwL8B0uQwHgXVRnDfkS2DSj/EW4K0Ew05eLMV4O/CuUJwEUvJUgdgwMd4IpBUKl13kVG6aL+ZjJ20DDQqQXy5jKYVMDBhVrb5f069LLrKfGnInqh040HRTvsTAHgei9oGQ7X0YaNNUNCdFKChgQvKtQ1vAkNvEahlSToez9oXad2BCA30ceHZxRxMQMShuvZLmv+hOA32/h+KUwS7MugVhqwb6Go+5nEEwht0ABDUEzyXdFsrQYwqMJjTbdxio9Qkg6QbgvkpnkLw0uQIAZ1UCYNkXawdw4qPCmVBcuADAMZCpAoCVYr3AKtYyHZSWauakjMx50TWwrzJw6lFARjQOt3se8jM6W9TloSCqIb9bRHbN5Fg+KkEZcow/Ak+KFBsD6h3jR8CUabAMlqn7xfxEbAdwWKLhhO3sGPCbOsNSvSyF0Z/5TaCuEleziLhmAOiWG1NWrmZXwIVU1A/+SZO+AcgLC4wt0zD3AAAAAElFTkSuQmCC' });
break;
case 'notice':
default:
this.set({ '_icon': 'data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAACAAAAAgCAYAAABzenr0AAAABmJLR0QA/wD/AP+gvaeTAAAACXBIWXMAAAsTAAALEwEAmpwYAAAAB3RJTUUH3gQJATM4scOJLAAAAcxJREFUWMPtljtLA0EQx3+J0QRfnYqCiCA+MERBrIwgFtoFbMTOR61i5QcQBdEihZWNoEWwsNAvkMJeBLHRQtHC0iIP4utOmw2cx97d7l2SRgcGbufmv/Pf2dmdhb8uIR+YJqAPaBff30AeeAHuxLgqMgRkgS/AAEybGuLfEdBcycCTwKVYmY5mgO6gwdd8BLaqAST9Bs8EDG7VTd3gex4TbgEjwKjQOHDugZlRDb7sMZEJpCS4bYVMJOygsG1cB+wqHN0Gib1RYXFpLwL74nx7Sb3EFlXATQNjTgRagA3FbZIRiCliT5wITGgUaRACA0CPjMC4xtUcDUAgDAzLCCQ0MhALQCAE9MoIdGkQCJIBgE4ZgWiNMvDL10qgUMMMFGQEnjQmkLXbVg38s8y4qtFcTCAnHiJ5oKiJnSoHjVgIXAmHkGIl5yy+YcWruIy9dvqpupIDCfZWEXvh1gsWFVfxIbG9a3RbRwJnYiuqJYfAqxsBgBWFiQyJzfTAlIB1uzEicbwBFoBTl8lSwINoSuXKjrv4F4FBh61zlKUKvgn7/e5ZEngMEDgLdFSieHaAT42LpgTMVbqC24B54Bi4twV9E6cnDcw6PFj+RSo/l6rlSlldhx4AAAAASUVORK5CYII=' });
break;
}
} else if (icon === false) {
this.set({ '_icon': null });
} else {
this.set({ '_icon': icon });
}
let { tag } = this.get();
if (!this.get()._tag || tag !== null) {
this.set({
'_tag': tag === null ? 'PNotify-' + Math.round(Math.random() * 1000000) : tag
});
}
const options = {
body: this.get().text || _notice.get().text,
tag: this.get()._tag
};
if (!_notice.get().hide) {
options.requireInteraction = true;
}
if (this.get()._icon !== null) {
options.icon = this.get()._icon;
}
Object.apply(options, this.get().options);
const _desktop = notify(
this.get().title || _notice.get().title,
options,
() => {
_notice.fire('click', { target: _desktop });
},
() => {
_notice.close();
}
);
_notice.set({ '_moduleIsNoticeOpen': true });
this.set({ _desktop });
if (!('close' in _desktop) && ('cancel' in _desktop)) {
_desktop.close = () => {
_desktop.cancel();
};
}
}
}
};
</script>
<style>
:global([ui-pnotify].ui-pnotify-desktop-hide.ui-pnotify) {
left: -10000px !important;
display: none !important;
}
</style>

136
app/node_modules/pnotify/src/PNotifyHistory.html generated vendored Normal file
View File

@@ -0,0 +1,136 @@
<script>
import PNotify from './PNotify.html';
export default {
setup (Component) {
Component.key = 'History';
Component.defaults = {
// Place the notice in the history.
history: true,
// Maximum number of notices to have open in its stack.
maxInStack: Infinity
};
Component.init = (notice) => {
return new Component({ target: document.body });
};
Component.showLast = (stack) => {
if (stack === undefined) {
stack = PNotify.defaultStack;
}
if (stack === false) {
return;
}
const top = (stack.push === 'top');
// Look up the last history notice, and display it.
let i = (top ? 0 : PNotify.notices.length - 1);
let notice;
do {
notice = PNotify.notices[i];
if (!notice) {
return;
}
i += (top ? 1 : -1);
} while (
notice.get().stack !== stack ||
!notice.get()._modules.History.get().history ||
notice.get()._state === 'opening' ||
notice.get()._state === 'open'
);
notice.open();
};
Component.showAll = (stack) => {
if (stack === undefined) {
stack = PNotify.defaultStack;
}
if (stack === false) {
return;
}
// Display all notices. (Disregarding non-history notices.)
for (let i = 0; i < PNotify.notices.length; i++) {
const notice = PNotify.notices[i];
if (
(
stack === true ||
notice.get().stack === stack
) &&
notice.get()._modules.History.get().history
) {
notice.open();
}
}
};
// Register the module with PNotify.
PNotify.modules.History = Component;
},
data () {
return Object.assign({
'_notice': null, // The PNotify notice.
'_options': {} // The options for the notice.
}, PNotify.modules.History.defaults);
},
methods: {
initModule (options) {
this.set(options);
if (this.get().history) {
// Don't destroy notices that are in history.
const { _notice } = this.get();
if (_notice.get().destroy) {
_notice.set({ 'destroy': false });
}
}
},
beforeOpen () {
const { maxInStack, _options } = this.get();
if (maxInStack === Infinity) {
return;
}
const stack = _options.stack;
if (stack === false) {
return;
}
// Remove oldest notifications leaving only maxInStack from the stack.
if (PNotify.notices && (PNotify.notices.length > maxInStack)) {
// Oldest are normally in front of array, or if stack.push=='top' then
// they are at the end of the array!
const top = stack.push === 'top';
const forRemoval = [];
let currentOpen = 0;
for (let i = (top ? 0 : PNotify.notices.length - 1); (top ? i < PNotify.notices.length : i >= 0); (top ? i++ : i--)) {
if (
['opening', 'open'].indexOf(PNotify.notices[i].get()._state) !== -1 &&
PNotify.notices[i].get().stack === stack
) {
if (currentOpen >= maxInStack) {
forRemoval.push(PNotify.notices[i]);
} else {
currentOpen++;
}
}
}
for (let i = 0; i < forRemoval.length; i++) {
forRemoval[i].close(false);
}
}
}
}
};
</script>

303
app/node_modules/pnotify/src/PNotifyMobile.html generated vendored Normal file
View File

@@ -0,0 +1,303 @@
<script>
import PNotify from './PNotify.html';
export default {
setup (Component) {
Component.key = 'Mobile';
Component.defaults = {
// Let the user swipe the notice away.
swipeDismiss: true,
// Styles the notice to look good on mobile.
styling: true
};
Component.init = (notice) => {
return new Component({ target: document.body });
};
// Register the module with PNotify.
PNotify.modules.Mobile = Component;
},
oncreate () {
this.set({ '_doMobileStylingBound': this.doMobileStyling.bind(this) });
},
data () {
return Object.assign({
'_notice': null, // The PNotify notice.
'_options': {} // The options for the notice.
}, PNotify.modules.Mobile.defaults);
},
methods: {
initModule (options) {
this.set(options);
const { _notice } = this.get();
let origXY = null;
let diffXY = null;
let noticeWidthHeight = null;
let noticeOpacity = null;
let csspos = 'left';
let direction = 'X';
let span = 'Width';
_notice.on('touchstart', (e) => {
if (!this.get().swipeDismiss) {
return;
}
const { stack } = _notice.get();
if (stack !== false) {
switch (stack.dir1) {
case 'up':
case 'down':
csspos = 'left';
direction = 'X';
span = 'Width';
break;
case 'left':
case 'right':
csspos = 'top';
direction = 'Y';
span = 'Height';
break;
}
}
origXY = e.touches[0]['screen' + direction];
noticeWidthHeight = _notice.refs.elem['scroll' + span];
noticeOpacity = window.getComputedStyle(_notice.refs.elem)['opacity'];
_notice.refs.container.style[csspos] = 0;
});
_notice.on('touchmove', (e) => {
if (!origXY || !this.get().swipeDismiss) {
return;
}
const curXY = e.touches[0]['screen' + direction];
diffXY = curXY - origXY;
const opacity = (1 - (Math.abs(diffXY) / noticeWidthHeight)) * noticeOpacity;
_notice.refs.elem.style.opacity = opacity;
_notice.refs.container.style[csspos] = diffXY + 'px';
});
_notice.on('touchend', () => {
if (!origXY || !this.get().swipeDismiss) {
return;
}
_notice.refs.container.classList.add('ui-pnotify-mobile-animate-left');
if (Math.abs(diffXY) > 40) {
const goLeft = (diffXY < 0) ? noticeWidthHeight * -2 : noticeWidthHeight * 2;
_notice.refs.elem.style.opacity = 0;
_notice.refs.container.style[csspos] = goLeft + 'px';
_notice.close();
} else {
_notice.refs.elem.style.removeProperty('opacity');
_notice.refs.container.style.removeProperty(csspos);
}
origXY = null;
diffXY = null;
noticeWidthHeight = null;
noticeOpacity = null;
});
_notice.on('touchcancel', () => {
if (!origXY || !this.get().swipeDismiss) {
return;
}
_notice.refs.elem.style.removeProperty('opacity');
_notice.refs.container.style.removeProperty(csspos);
origXY = null;
diffXY = null;
noticeWidthHeight = null;
noticeOpacity = null;
});
this.doMobileStyling();
},
update () {
this.doMobileStyling();
},
beforeOpen () {
// Add an event listener to watch the window resizes.
window.addEventListener('resize', this.get()._doMobileStylingBound);
},
afterClose () {
// Remove the event listener.
window.removeEventListener('resize', this.get()._doMobileStylingBound);
// Remove any styling we added to close it.
if (!this.get().swipeDismiss) {
return;
}
const { _notice } = this.get();
_notice.refs.elem.style.removeProperty('opacity');
_notice.refs.container.style.removeProperty('left');
_notice.refs.container.style.removeProperty('top');
},
doMobileStyling () {
const { _notice } = this.get();
const { stack } = _notice.get();
if (this.get().styling) {
if (stack !== false) {
if (window.innerWidth <= 480) {
if (!stack.mobileOrigSpacing1) {
stack.mobileOrigSpacing1 = stack.spacing1;
}
stack.spacing1 = 0;
if (!stack.mobileOrigFirstpos1) {
stack.mobileOrigFirstpos1 = stack.firstpos1;
}
stack.firstpos1 = 0;
if (!stack.mobileOrigSpacing2) {
stack.mobileOrigSpacing2 = stack.spacing2;
}
stack.spacing2 = 0;
if (!stack.mobileOrigFirstpos2) {
stack.mobileOrigFirstpos2 = stack.firstpos2;
}
stack.firstpos2 = 0;
} else {
if (stack.mobileOrigSpacing1) {
stack.spacing1 = stack.mobileOrigSpacing1;
delete stack.mobileOrigSpacing1;
}
if (stack.mobileOrigFirstpos1) {
stack.firstpos1 = stack.mobileOrigFirstpos1;
delete stack.mobileOrigFirstpos1;
}
if (stack.mobileOrigSpacing2) {
stack.spacing2 = stack.mobileOrigSpacing2;
delete stack.mobileOrigSpacing2;
}
if (stack.mobileOrigFirstpos2) {
stack.firstpos2 = stack.mobileOrigFirstpos2;
delete stack.mobileOrigFirstpos2;
}
}
switch (stack.dir1) {
case 'down':
_notice.addModuleClass('ui-pnotify-mobile-top');
break;
case 'up':
_notice.addModuleClass('ui-pnotify-mobile-bottom');
break;
case 'left':
_notice.addModuleClass('ui-pnotify-mobile-right');
break;
case 'right':
_notice.addModuleClass('ui-pnotify-mobile-left');
break;
}
}
_notice.addModuleClass('ui-pnotify-mobile-able');
} else {
_notice.removeModuleClass(
'ui-pnotify-mobile-able',
'ui-pnotify-mobile-top',
'ui-pnotify-mobile-bottom',
'ui-pnotify-mobile-right',
'ui-pnotify-mobile-left'
);
if (stack !== false) {
if (stack.mobileOrigSpacing1) {
stack.spacing1 = stack.mobileOrigSpacing1;
delete stack.mobileOrigSpacing1;
}
if (stack.mobileOrigFirstpos1) {
stack.firstpos1 = stack.mobileOrigFirstpos1;
delete stack.mobileOrigFirstpos1;
}
if (stack.mobileOrigSpacing2) {
stack.spacing2 = stack.mobileOrigSpacing2;
delete stack.mobileOrigSpacing2;
}
if (stack.mobileOrigFirstpos2) {
stack.firstpos2 = stack.mobileOrigFirstpos2;
delete stack.mobileOrigFirstpos2;
}
}
}
}
}
};
</script>
<style>
:global([ui-pnotify] .ui-pnotify-container) {
position: relative;
}
:global([ui-pnotify] .ui-pnotify-mobile-animate-left) {
transition: left .1s ease;
}
:global([ui-pnotify] .ui-pnotify-mobile-animate-top) {
transition: top .1s ease;
}
@media (max-width: 480px) {
/* -- Notice */
:global([ui-pnotify].ui-pnotify.ui-pnotify-mobile-able) {
font-size: 1.2em;
-webkit-font-smoothing: antialiased;
-moz-font-smoothing: antialiased;
-ms-font-smoothing: antialiased;
font-smoothing: antialiased;
}
:global(body > [ui-pnotify].ui-pnotify.ui-pnotify-mobile-able) {
position: fixed;
}
:global([ui-pnotify].ui-pnotify.ui-pnotify-mobile-able.ui-pnotify-mobile-top),
:global([ui-pnotify].ui-pnotify.ui-pnotify-mobile-able.ui-pnotify-mobile-bottom) {
width: 100% !important;
}
:global([ui-pnotify].ui-pnotify.ui-pnotify-mobile-able.ui-pnotify-mobile-left),
:global([ui-pnotify].ui-pnotify.ui-pnotify-mobile-able.ui-pnotify-mobile-right) {
height: 100% !important;
}
:global([ui-pnotify].ui-pnotify.ui-pnotify-mobile-able .ui-pnotify-shadow) {
-webkit-box-shadow: none;
-moz-box-shadow: none;
box-shadow: none;
}
:global([ui-pnotify].ui-pnotify.ui-pnotify-mobile-able.ui-pnotify-mobile-top .ui-pnotify-shadow) {
border-bottom-width: 5px;
}
:global([ui-pnotify].ui-pnotify.ui-pnotify-mobile-able.ui-pnotify-mobile-bottom .ui-pnotify-shadow) {
border-top-width: 5px;
}
:global([ui-pnotify].ui-pnotify.ui-pnotify-mobile-able.ui-pnotify-mobile-left .ui-pnotify-shadow) {
border-right-width: 5px;
}
:global([ui-pnotify].ui-pnotify.ui-pnotify-mobile-able.ui-pnotify-mobile-right .ui-pnotify-shadow) {
border-left-width: 5px;
}
:global([ui-pnotify].ui-pnotify.ui-pnotify-mobile-able .ui-pnotify-container) {
-webkit-border-radius: 0;
-moz-border-radius: 0;
border-radius: 0;
}
:global([ui-pnotify].ui-pnotify.ui-pnotify-mobile-able.ui-pnotify-mobile-top .ui-pnotify-container),
:global([ui-pnotify].ui-pnotify.ui-pnotify-mobile-able.ui-pnotify-mobile-bottom .ui-pnotify-container) {
width: auto !important;
}
:global([ui-pnotify].ui-pnotify.ui-pnotify-mobile-able.ui-pnotify-mobile-left .ui-pnotify-container),
:global([ui-pnotify].ui-pnotify.ui-pnotify-mobile-able.ui-pnotify-mobile-right .ui-pnotify-container) {
height: 100% !important;
}
}
</style>

50
app/node_modules/pnotify/src/PNotifyNonBlock.html generated vendored Normal file
View File

@@ -0,0 +1,50 @@
<script>
import PNotify from './PNotify.html';
export default {
setup (Component) {
Component.key = 'NonBlock';
Component.defaults = {
// Use NonBlock.js to create a non-blocking notice. It lets the user click elements underneath it.
nonblock: false
};
Component.init = (notice) => {
return new Component({ target: document.body,
data: {
'_notice': notice
} });
};
// Register the module with PNotify.
PNotify.modules.NonBlock = Component;
},
data () {
return Object.assign({
'_notice': null, // The PNotify notice.
'_options': {} // The options for the notice.
}, PNotify.modules.NonBlock.defaults);
},
methods: {
initModule (options) {
this.set(options);
this.doNonBlockClass();
},
update () {
this.doNonBlockClass();
},
doNonBlockClass () {
if (this.get().nonblock) {
this.get()._notice.addModuleClass('nonblock');
} else {
this.get()._notice.removeModuleClass('nonblock');
}
}
}
};
</script>

147
app/node_modules/pnotify/src/PNotifyReference.html generated vendored Normal file
View File

@@ -0,0 +1,147 @@
<!-- This file is for referencing while you are making a PNotify module. -->
{#if putThing} <!-- We want to check to make sure the notice should include our thing. -->
<!--
We're going to create a button that will be appended to the notice.
It will be disabled by default, so we can enable it on mouseover.
-->
<button
ref:thingElem
class="ui-pnotify-reference-button btn btn-default"
type="button"
disabled="{!_mouseIsIn}"
on:click="doSomething()">
<i class="{_notice.get()._icons.athing}" />&nbsp;{labels.text}
</button>
<!-- Since our button is floated, we have to add a clearing div. -->
<div class="ui-pnotify-reference-clearing" />
{/if}
<script>
import PNotify from './PNotify.html';
export default {
setup (Component) {
// This is the key you use for registering your module with PNotify.
Component.key = 'Reference';
// This if the default values of your options.
Component.defaults = {
// Provide a thing for stuff. Turned off by default.
putThing: false,
// If you are displaying any text, you should use a labels options to
// support internationalization.
labels: {
text: 'Spin Around'
}
};
// This is the first way to init a module. If you aren't placing any
// markup in the template, you would do this.
// Component.init = (_notice) => {
// return new Component({target: document.body, data: {_notice}});
// };
// Register the module with PNotify.
PNotify.modules.Reference = Component;
// Append our markup to the container.
PNotify.modulesAppendContainer.push(Component);
// This is where you would add any styling or icons classes you are using in your code.
Object.assign(PNotify.icons.brighttheme, {
athing: 'bt-icon bt-icon-refresh'
});
Object.assign(PNotify.icons.bootstrap3, {
athing: 'glyphicon glyphicon-refresh'
});
Object.assign(PNotify.icons.fontawesome4, {
athing: 'fa fa-refresh'
});
Object.assign(PNotify.icons.fontawesome5, {
athing: 'fas fa-sync'
});
if (!PNotify.icons.material) {
PNotify.icons.material = {};
}
Object.assign(PNotify.icons.material, {
athing: 'material-icons pnotify-material-icon-refresh'
});
},
oncreate () {
// This is the second way to init a module. Because we put markup in the
// template, we have to fire this event to tell the core that we are ready
// to receive our options.
this.fire('init', { module: this });
},
data () {
return Object.assign({
'_notice': null, // The PNotify notice.
'_options': {}, // The options for the notice.
'_mouseIsIn': false
}, PNotify.modules.Reference.defaults);
},
methods: {
// This method is called from the core to give us our actual options.
// Until it is called, our options will just be the defaults.
initModule (options) {
// Set our options.
this.set(options);
// Now that the notice is available to us, we can listen to events fired
// from it.
const { _notice } = this.get();
_notice.on('mouseenter', () => this.set({ '_mouseIsIn': true }));
_notice.on('mouseleave', () => this.set({ '_mouseIsIn': false }));
},
doSomething () {
// Spin the notice around.
let curAngle = 0;
const { _notice } = this.get();
const timer = setInterval(() => {
curAngle += 10;
if (curAngle === 360) {
curAngle = 0;
clearInterval(timer);
}
_notice.refs.elem.style.transform = 'rotate(' + curAngle + 'deg)';
}, 20);
},
// I have nothing to put in these, just showing you that they exist. You
// won't need to include them if you aren't using them.
update () {
// Called when the notice is updating its options.
},
beforeOpen () {
// Called before the notice is opened.
},
afterOpen () {
// Called after the notice is opened.
},
beforeClose () {
// Called before the notice is closed.
},
afterClose () {
// Called after the notice is closed.
},
beforeDestroy () {
// Called before the notice is destroyed.
},
afterDestroy () {
// Called after the notice is destroyed.
}
}
};
</script>
<style>
.ui-pnotify-reference-button {
float: right;
}
.ui-pnotify-reference-clearing {
clear: right;
line-height: 0;
}
</style>

258
app/node_modules/pnotify/src/PNotifyStyleMaterial.html generated vendored Normal file
View File

@@ -0,0 +1,258 @@
<script>
import PNotify from './PNotify.html';
export default {
setup (Component) {
Component.key = 'StyleMaterial';
// Register the module with PNotify.
PNotify.modules.StyleMaterial = Component;
// Prepend this module to the container.
PNotify.modulesPrependContainer.push(Component);
if (!PNotify.styling.material) {
PNotify.styling.material = {};
}
PNotify.styling.material = Object.assign(PNotify.styling.material, {
container: 'pnotify-material',
notice: 'pnotify-material-notice',
info: 'pnotify-material-info',
success: 'pnotify-material-success',
error: 'pnotify-material-error'
});
if (!PNotify.icons.material) {
PNotify.icons.material = {};
}
PNotify.icons.material = Object.assign(PNotify.icons.material, {
notice: 'material-icons pnotify-material-icon-notice',
info: 'material-icons pnotify-material-icon-info',
success: 'material-icons pnotify-material-icon-success',
error: 'material-icons pnotify-material-icon-error',
closer: 'material-icons pnotify-material-icon-closer',
pinUp: 'material-icons pnotify-material-icon-sticker',
pinDown: 'material-icons pnotify-material-icon-sticker pnotify-material-icon-stuck'
});
}
};
</script>
<style>
/*
Color Scheme: https://www.google.com/design/spec/style/color.html#color-color-palette
Requires stylesheet to work: https://fonts.googleapis.com/css?family=Material+Icons
*/
:global([ui-pnotify] .pnotify-material) {
-webkit-border-radius: 0;
-moz-border-radius: 0;
border-radius: 0;
font-size: 14px;
}
:global([ui-pnotify] .pnotify-material.ui-pnotify-shadow) {
-webkit-box-shadow: 0px 6px 24px 0px rgba(0,0,0,0.2);
-moz-box-shadow: 0px 6px 24px 0px rgba(0,0,0,0.2);
box-shadow: 0px 6px 24px 0px rgba(0,0,0,0.2);
}
:global([ui-pnotify] .pnotify-material.ui-pnotify-container) {
padding: 24px;
}
:global([ui-pnotify] .pnotify-material .ui-pnotify-title) {
font-size: 20px;
margin-bottom: 20px;
line-height: 24px;
}
:global([ui-pnotify] .pnotify-material .ui-pnotify-title:last-child) {
margin-bottom: 0;
}
:global([ui-pnotify] .pnotify-material .ui-pnotify-text) {
font-size: 16px;
line-height: 24px;
}
:global([ui-pnotify].ui-pnotify-with-icon .pnotify-material .ui-pnotify-title),
:global([ui-pnotify].ui-pnotify-with-icon .pnotify-material .ui-pnotify-text),
:global([ui-pnotify].ui-pnotify-with-icon .pnotify-material .ui-pnotify-confirm) {
margin-left: 32px;
}
:global([dir=rtl] [ui-pnotify].ui-pnotify-with-icon .pnotify-material .ui-pnotify-title),
:global([dir=rtl] [ui-pnotify].ui-pnotify-with-icon .pnotify-material .ui-pnotify-text),
:global([dir=rtl] [ui-pnotify].ui-pnotify-with-icon .pnotify-material .ui-pnotify-confirm) {
margin-right: 32px;
margin-left: 0;
}
:global([ui-pnotify] .pnotify-material .ui-pnotify-action-bar) {
margin-top: 20px;
margin-right: -16px;
margin-bottom: -16px;
}
:global([dir=rtl] [ui-pnotify] .pnotify-material .ui-pnotify-action-bar) {
margin-left: -16px;
margin-right: 0;
}
:global([ui-pnotify] .pnotify-material-notice) {
/* https://material.io/color/#!/?view.left=0&view.right=0&primary.color=FFEE58 */
background-color: #FFEE58;
border: none;
color: #000;
}
:global([ui-pnotify] .pnotify-material-info) {
/* https://material.io/color/#!/?view.left=0&view.right=0&primary.color=26C6DA */
background-color: #26C6DA;
border: none;
color: #000;
}
:global([ui-pnotify] .pnotify-material-success) {
/* https://material.io/color/#!/?view.left=0&view.right=0&primary.color=66BB6A */
background-color: #66BB6A;
border: none;
color: #fff;
}
:global([ui-pnotify] .pnotify-material-error) {
/* https://material.io/color/#!/?view.left=0&view.right=0&primary.color=EF5350 */
background-color: #EF5350;
border: none;
color: #fff;
}
:global([ui-pnotify] .pnotify-material-icon-notice),
:global([ui-pnotify] .pnotify-material-icon-info),
:global([ui-pnotify] .pnotify-material-icon-success),
:global([ui-pnotify] .pnotify-material-icon-error),
:global([ui-pnotify] .pnotify-material-icon-closer),
:global([ui-pnotify] .pnotify-material-icon-sticker) {
position: relative;
}
:global([ui-pnotify] .pnotify-material-icon-closer),
:global([ui-pnotify] .pnotify-material-icon-sticker) {
height: 20px;
width: 20px;
font-size: 20px;
line-height: 20px;
position: relative;
}
:global([ui-pnotify] .pnotify-material-icon-notice:after),
:global([ui-pnotify] .pnotify-material-icon-info:after),
:global([ui-pnotify] .pnotify-material-icon-success:after),
:global([ui-pnotify] .pnotify-material-icon-error:after),
:global([ui-pnotify] .pnotify-material-icon-closer:after),
:global([ui-pnotify] .pnotify-material-icon-sticker:after) {
font-family: 'Material Icons';
}
:global([ui-pnotify] .pnotify-material-icon-notice:after) {
content: "announcement";
}
:global([ui-pnotify] .pnotify-material-icon-info:after) {
content: "info";
}
:global([ui-pnotify] .pnotify-material-icon-success:after) {
content: "check_circle";
}
:global([ui-pnotify] .pnotify-material-icon-error:after) {
content: "error";
}
:global([ui-pnotify] .pnotify-material-icon-closer),
:global([ui-pnotify] .pnotify-material-icon-sticker) {
display: inline-block;
}
:global([ui-pnotify] .pnotify-material-icon-closer:after) {
top: -4px;
content: "close";
}
:global([ui-pnotify] .pnotify-material-icon-sticker:after) {
top: -5px;
content: "pause";
}
:global([ui-pnotify] .pnotify-material-icon-sticker.pnotify-material-icon-stuck:after) {
content: "play_arrow";
}
:global([ui-pnotify].ui-pnotify .pnotify-material .ui-pnotify-prompt-input) {
display: block;
width: 100%;
margin-bottom: 8px;
padding: 15px 0 8px;
background-color: transparent;
color: inherit;
border-radius: 0;
border-top: none;
border-left: none;
border-right: none;
border-bottom-style: solid;
border-bottom-color: inherit;
border-bottom-width: 1px;
}
:global([ui-pnotify].ui-pnotify .pnotify-material .ui-pnotify-prompt-input:focus) {
outline: none;
border-bottom-color: #3F51B5;
border-bottom-width: 2px;
}
/* CSS Material Buttons from https://codepen.io/sebj54/pen/oxluI */
:global([ui-pnotify].ui-pnotify .pnotify-material .ui-pnotify-action-button) {
position: relative;
padding: 0 16px;
overflow: hidden;
border-width: 0;
outline: none;
border-radius: 2px;
background-color: transparent;
color: inherit;
transition: background-color .3s;
text-transform: uppercase;
height: 36px;
margin: 6px;
min-width: 64px;
font-weight: bold;
}
:global([ui-pnotify].ui-pnotify .pnotify-material .ui-pnotify-action-button.ui-pnotify-material-primary) {
/* background-color: #3F51B5; */
/* color: #ecf0f1; */
color: #3F51B5;
/* box-shadow: 0 1px 4px rgba(0, 0, 0, .6); */
}
:global([ui-pnotify].ui-pnotify .pnotify-material .ui-pnotify-action-button:hover),
:global([ui-pnotify].ui-pnotify .pnotify-material .ui-pnotify-action-button:focus) {
background-color: rgba(0, 0, 0, .12);
color: inherit;
}
:global([ui-pnotify].ui-pnotify .pnotify-material .ui-pnotify-action-button.ui-pnotify-material-primary:hover),
:global([ui-pnotify].ui-pnotify .pnotify-material .ui-pnotify-action-button.ui-pnotify-material-primary:focus) {
/* background-color: #303F9F; */
/* color: #ecf0f1; */
color: #303F9F;
}
:global([ui-pnotify].ui-pnotify .pnotify-material .ui-pnotify-action-button:before) {
content: "";
position: absolute;
top: 50%;
left: 50%;
display: block;
width: 0;
padding-top: 0;
border-radius: 100%;
background-color: rgba(153, 153, 153, .4);
-webkit-transform: translate(-50%, -50%);
-moz-transform: translate(-50%, -50%);
-ms-transform: translate(-50%, -50%);
-o-transform: translate(-50%, -50%);
transform: translate(-50%, -50%);
}
:global([ui-pnotify].ui-pnotify .pnotify-material .ui-pnotify-action-button:active:before) {
width: 120%;
padding-top: 120%;
transition: width .2s ease-out, padding-top .2s ease-out;
}
</style>