This commit is contained in:
2025-07-02 21:55:07 +09:00
commit fa63330e69
855 changed files with 432271 additions and 0 deletions

File diff suppressed because it is too large Load Diff

File diff suppressed because one or more lines are too long

Binary file not shown.

View File

@@ -0,0 +1,968 @@
/**
* alertifyjs 1.14.0 http://alertifyjs.com
* AlertifyJS is a javascript framework for developing pretty browser dialogs and notifications.
* Copyright 2024 Mohammad Younes <Mohammad@alertifyjs.com> (http://alertifyjs.com)
* Licensed under GPL 3 <https://opensource.org/licenses/gpl-3.0>*/
.alertify .ajs-dimmer {
position: fixed;
z-index: 1981;
top: 0;
right: 0;
bottom: 0;
left: 0;
padding: 0;
margin: 0;
background-color: #252525;
opacity: 0.5;
}
.alertify .ajs-modal {
position: fixed;
top: 0;
right: 0;
left: 0;
bottom: 0;
padding: 0;
overflow-y: auto;
z-index: 1981;
}
.alertify .ajs-dialog {
position: relative;
margin: 5% auto;
min-height: 110px;
max-width: 500px;
padding: 24px 24px 0 24px;
outline: 0;
background-color: #fff;
}
.alertify .ajs-dialog.ajs-capture:before {
content: '';
position: absolute;
top: 0;
right: 0;
bottom: 0;
left: 0;
display: block;
z-index: 1;
}
.alertify .ajs-reset {
position: absolute !important;
display: inline !important;
width: 0 !important;
height: 0 !important;
opacity: 0 !important;
}
.alertify .ajs-commands {
position: absolute;
right: 4px;
margin: -14px 24px 0 0;
z-index: 2;
}
.alertify .ajs-commands button {
display: none;
width: 10px;
height: 10px;
margin-left: 10px;
padding: 10px;
border: 0;
background-color: transparent;
background-repeat: no-repeat;
background-position: center;
cursor: pointer;
}
.alertify .ajs-commands button.ajs-close {
background-image: url(data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAAoAAAAKCAYAAACNMs+9AAAABHNCSVQICAgIfAhkiAAAAAlwSFlzAAALEgAACxIB0t1+/AAAABZ0RVh0Q3JlYXRpb24gVGltZQAwNy8xMy8xNOrZqugAAAAcdEVYdFNvZnR3YXJlAEFkb2JlIEZpcmV3b3JrcyBDUzbovLKMAAAAh0lEQVQYlY2QsQ0EIQwEB9cBAR1CJUaI/gigDnwR6NBL/7/xWLNrZ2b8EwGotVpr7eOitWa1VjugiNB7R1UPrKrWe0dEAHBbXUqxMQbeewDmnHjvyTm7C3zDwAUd9c63YQdUVdu6EAJzzquz7HXvTiklt+H9DQFYaxFjvDqllFyMkbXWvfpXHjJrWFgdBq/hAAAAAElFTkSuQmCC);
}
.alertify .ajs-commands button.ajs-maximize {
background-image: url(data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAAoAAAAKCAYAAACNMs+9AAAABHNCSVQICAgIfAhkiAAAAAlwSFlzAAALEgAACxIB0t1+/AAAABZ0RVh0Q3JlYXRpb24gVGltZQAwNy8xMy8xNOrZqugAAAAcdEVYdFNvZnR3YXJlAEFkb2JlIEZpcmV3b3JrcyBDUzbovLKMAAAAOUlEQVQYlWP8//8/AzGAhYGBgaG4uBiv6t7eXkYmooxjYGAgWiELsvHYFMCcRX2rSXcjoSBiJDbAAeD+EGu+8BZcAAAAAElFTkSuQmCC);
}
.alertify .ajs-header {
margin: -24px;
margin-bottom: 0;
padding: 16px 24px;
background-color: #fff;
}
.alertify .ajs-body {
min-height: 56px;
}
.alertify .ajs-body .ajs-content {
padding: 16px 24px 16px 16px;
}
.alertify .ajs-footer {
padding: 4px;
margin-left: -24px;
margin-right: -24px;
min-height: 43px;
background-color: #fff;
}
.alertify .ajs-footer .ajs-buttons.ajs-primary {
text-align: right;
}
.alertify .ajs-footer .ajs-buttons.ajs-primary .ajs-button {
margin: 4px;
}
.alertify .ajs-footer .ajs-buttons.ajs-auxiliary {
float: left;
clear: none;
text-align: left;
}
.alertify .ajs-footer .ajs-buttons.ajs-auxiliary .ajs-button {
margin: 4px;
}
.alertify .ajs-footer .ajs-buttons .ajs-button {
min-width: 88px;
min-height: 35px;
}
.alertify .ajs-handle {
position: absolute;
display: none;
width: 10px;
height: 10px;
right: 0;
bottom: 0;
z-index: 1;
background-image: url(data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAAoAAAAKCAYAAACNMs+9AAAABHNCSVQICAgIfAhkiAAAAAlwSFlzAAALEgAACxIB0t1+/AAAABZ0RVh0Q3JlYXRpb24gVGltZQAwNy8xMS8xNEDQYmMAAAAcdEVYdFNvZnR3YXJlAEFkb2JlIEZpcmV3b3JrcyBDUzbovLKMAAAAQ0lEQVQYlaXNMQoAIAxD0dT7H657l0KX3iJuUlBUNOsPPCGJm7VDp6ryeMxMuDsAQH7owW3pyn3RS26iKxERMLN3ugOaAkaL3sWVigAAAABJRU5ErkJggg==);
-webkit-transform: scaleX(1) /*rtl:scaleX(-1)*/;
transform: scaleX(1) /*rtl:scaleX(-1)*/;
cursor: se-resize;
}
.alertify.ajs-no-overflow .ajs-body .ajs-content {
overflow: hidden !important;
}
.alertify.ajs-no-padding.ajs-maximized .ajs-body .ajs-content {
left: 0;
right: 0;
padding: 0;
}
.alertify.ajs-no-padding:not(.ajs-maximized) .ajs-body {
margin-left: -24px;
margin-right: -24px;
}
.alertify.ajs-no-padding:not(.ajs-maximized) .ajs-body .ajs-content {
padding: 0;
}
.alertify.ajs-no-padding.ajs-resizable .ajs-body .ajs-content {
left: 0;
right: 0;
}
.alertify.ajs-maximizable .ajs-commands button.ajs-maximize,
.alertify.ajs-maximizable .ajs-commands button.ajs-restore {
display: inline-block;
}
.alertify.ajs-closable .ajs-commands button.ajs-close {
display: inline-block;
}
.alertify.ajs-maximized .ajs-dialog {
width: 100% !important;
height: 100% !important;
max-width: none !important;
margin: 0 auto !important;
top: 0 !important;
left: 0 !important;
}
.alertify.ajs-maximized.ajs-modeless .ajs-modal {
position: fixed !important;
min-height: 100% !important;
max-height: none !important;
margin: 0 !important;
}
.alertify.ajs-maximized .ajs-commands button.ajs-maximize {
background-image: url(data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAAoAAAAKCAYAAACNMs+9AAAABHNCSVQICAgIfAhkiAAAAAlwSFlzAAALEgAACxIB0t1+/AAAABZ0RVh0Q3JlYXRpb24gVGltZQAwNy8xMy8xNOrZqugAAAAcdEVYdFNvZnR3YXJlAEFkb2JlIEZpcmV3b3JrcyBDUzbovLKMAAAASklEQVQYlZWQ0QkAMQhDtXRincOZX78KVtrDCwgqJNEoIB3MPLj7lRUROlpyVXGzby6zWuY+kz6tj5sBMTMAyVV3/595RbOh3cAXsww1raeiOcoAAAAASUVORK5CYII=);
}
.alertify.ajs-resizable .ajs-dialog,
.alertify.ajs-maximized .ajs-dialog {
padding: 0;
}
.alertify.ajs-resizable .ajs-commands,
.alertify.ajs-maximized .ajs-commands {
margin: 14px 24px 0 0;
}
.alertify.ajs-resizable .ajs-header,
.alertify.ajs-maximized .ajs-header {
position: absolute;
top: 0;
left: 0;
right: 0;
margin: 0;
padding: 16px 24px;
}
.alertify.ajs-resizable .ajs-body,
.alertify.ajs-maximized .ajs-body {
min-height: 224px;
display: inline-block;
}
.alertify.ajs-resizable .ajs-body .ajs-content,
.alertify.ajs-maximized .ajs-body .ajs-content {
position: absolute;
top: 50px;
right: 24px;
bottom: 50px;
left: 24px;
overflow: auto;
}
.alertify.ajs-resizable .ajs-footer,
.alertify.ajs-maximized .ajs-footer {
position: absolute;
left: 0;
right: 0;
bottom: 0;
margin: 0;
}
.alertify.ajs-resizable:not(.ajs-maximized) .ajs-dialog {
min-width: 548px;
}
.alertify.ajs-resizable:not(.ajs-maximized) .ajs-handle {
display: block;
}
.alertify.ajs-movable:not(.ajs-maximized) .ajs-header {
cursor: move;
}
.alertify.ajs-modeless .ajs-dimmer,
.alertify.ajs-modeless .ajs-reset {
display: none;
}
.alertify.ajs-modeless .ajs-modal {
overflow: visible;
max-width: none;
max-height: 0;
}
.alertify.ajs-modeless.ajs-pinnable .ajs-commands button.ajs-pin {
display: inline-block;
background-image: url(data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAAoAAAAKCAYAAACNMs+9AAAABHNCSVQICAgIfAhkiAAAAAlwSFlzAAALEgAACxIB0t1+/AAAABZ0RVh0Q3JlYXRpb24gVGltZQAwNy8xMy8xNOrZqugAAAAcdEVYdFNvZnR3YXJlAEFkb2JlIEZpcmV3b3JrcyBDUzbovLKMAAAAQklEQVQYlcWPMQ4AIAwCqU9u38GbcbHRWN1MvKQDhQFMEpKImGJA0gCgnYw0V0rwxseg5erT4oSkQVI5d9f+e9+xA0NbLpWfitPXAAAAAElFTkSuQmCC);
}
.alertify.ajs-modeless.ajs-unpinned .ajs-modal {
position: absolute;
}
.alertify.ajs-modeless.ajs-unpinned .ajs-commands button.ajs-pin {
background-image: url(data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAAoAAAAKCAYAAACNMs+9AAAABHNCSVQICAgIfAhkiAAAAAlwSFlzAAALEgAACxIB0t1+/AAAABZ0RVh0Q3JlYXRpb24gVGltZQAwNy8xMy8xNOrZqugAAAAcdEVYdFNvZnR3YXJlAEFkb2JlIEZpcmV3b3JrcyBDUzbovLKMAAAAO0lEQVQYlWP8//8/AzGAiShV6AqLi4txGs+CLoBLMYbC3t5eRmyaWfBZhwwYkX2NTxPRvibKjRhW4wMAhxkYGbLu3pEAAAAASUVORK5CYII=);
}
.alertify.ajs-modeless:not(.ajs-unpinned) .ajs-body {
max-height: 500px;
overflow: auto;
}
.alertify.ajs-basic .ajs-header {
opacity: 0;
}
.alertify.ajs-basic .ajs-footer {
visibility: hidden;
}
.alertify.ajs-frameless .ajs-header {
position: absolute;
top: 0;
left: 0;
right: 0;
min-height: 60px;
margin: 0;
padding: 0;
opacity: 0;
z-index: 1;
}
.alertify.ajs-frameless .ajs-footer {
display: none;
}
.alertify.ajs-frameless .ajs-body .ajs-content {
position: absolute;
top: 0;
right: 0;
bottom: 0;
left: 0;
}
.alertify.ajs-frameless:not(.ajs-resizable) .ajs-dialog {
padding-top: 0;
}
.alertify.ajs-frameless:not(.ajs-resizable) .ajs-dialog .ajs-commands {
margin-top: 0;
}
.ajs-no-overflow {
overflow: hidden !important;
outline: none;
}
.ajs-no-overflow.ajs-fixed {
position: fixed;
top: 0;
right: 0;
bottom: 0;
left: 0;
overflow-y: scroll!important;
}
.ajs-no-selection,
.ajs-no-selection * {
-webkit-user-select: none;
-moz-user-select: none;
-ms-user-select: none;
user-select: none;
}
@media screen and (max-width: 568px) {
.alertify .ajs-dialog {
min-width: 150px;
}
.alertify:not(.ajs-maximized) .ajs-modal {
padding: 0 5%;
}
.alertify:not(.ajs-maximized).ajs-resizable .ajs-dialog {
min-width: initial;
min-width: auto /*IE fallback*/;
}
}
@-moz-document url-prefix() {
.alertify button:focus {
outline: 1px dotted #3593D2;
}
}
.alertify .ajs-dimmer,
.alertify .ajs-modal {
-webkit-transform: translate3d(0, 0, 0);
transform: translate3d(0, 0, 0);
-webkit-transition-property: opacity, visibility;
transition-property: opacity, visibility;
-webkit-transition-timing-function: linear;
transition-timing-function: linear;
-webkit-transition-duration: 250ms;
transition-duration: 250ms;
}
.alertify.ajs-hidden .ajs-dimmer,
.alertify.ajs-hidden .ajs-modal {
visibility: hidden;
opacity: 0;
}
.alertify.ajs-in:not(.ajs-hidden) .ajs-dialog {
-webkit-animation-duration: 500ms;
animation-duration: 500ms;
}
.alertify.ajs-out.ajs-hidden .ajs-dialog {
-webkit-animation-duration: 250ms;
animation-duration: 250ms;
}
.alertify .ajs-dialog.ajs-shake {
-webkit-animation-name: ajs-shake;
animation-name: ajs-shake;
-webkit-animation-duration: 0.1s;
animation-duration: 0.1s;
-webkit-animation-fill-mode: both;
animation-fill-mode: both;
}
@-webkit-keyframes ajs-shake {
0%,
100% {
-webkit-transform: translate3d(0, 0, 0);
transform: translate3d(0, 0, 0);
}
10%,
30%,
50%,
70%,
90% {
-webkit-transform: translate3d(-10px, 0, 0);
transform: translate3d(-10px, 0, 0);
}
20%,
40%,
60%,
80% {
-webkit-transform: translate3d(10px, 0, 0);
transform: translate3d(10px, 0, 0);
}
}
@keyframes ajs-shake {
0%,
100% {
-webkit-transform: translate3d(0, 0, 0);
transform: translate3d(0, 0, 0);
}
10%,
30%,
50%,
70%,
90% {
-webkit-transform: translate3d(-10px, 0, 0);
transform: translate3d(-10px, 0, 0);
}
20%,
40%,
60%,
80% {
-webkit-transform: translate3d(10px, 0, 0);
transform: translate3d(10px, 0, 0);
}
}
.alertify.ajs-slide.ajs-in:not(.ajs-hidden) .ajs-dialog {
-webkit-animation-name: ajs-slideIn;
animation-name: ajs-slideIn;
-webkit-animation-timing-function: cubic-bezier(0.175, 0.885, 0.32, 1.275);
animation-timing-function: cubic-bezier(0.175, 0.885, 0.32, 1.275);
}
.alertify.ajs-slide.ajs-out.ajs-hidden .ajs-dialog {
-webkit-animation-name: ajs-slideOut;
animation-name: ajs-slideOut;
-webkit-animation-timing-function: cubic-bezier(0.6, -0.28, 0.735, 0.045);
animation-timing-function: cubic-bezier(0.6, -0.28, 0.735, 0.045);
}
.alertify.ajs-zoom.ajs-in:not(.ajs-hidden) .ajs-dialog {
-webkit-animation-name: ajs-zoomIn;
animation-name: ajs-zoomIn;
}
.alertify.ajs-zoom.ajs-out.ajs-hidden .ajs-dialog {
-webkit-animation-name: ajs-zoomOut;
animation-name: ajs-zoomOut;
}
.alertify.ajs-fade.ajs-in:not(.ajs-hidden) .ajs-dialog {
-webkit-animation-name: ajs-fadeIn;
animation-name: ajs-fadeIn;
}
.alertify.ajs-fade.ajs-out.ajs-hidden .ajs-dialog {
-webkit-animation-name: ajs-fadeOut;
animation-name: ajs-fadeOut;
}
.alertify.ajs-pulse.ajs-in:not(.ajs-hidden) .ajs-dialog {
-webkit-animation-name: ajs-pulseIn;
animation-name: ajs-pulseIn;
}
.alertify.ajs-pulse.ajs-out.ajs-hidden .ajs-dialog {
-webkit-animation-name: ajs-pulseOut;
animation-name: ajs-pulseOut;
}
.alertify.ajs-flipx.ajs-in:not(.ajs-hidden) .ajs-dialog {
-webkit-animation-name: ajs-flipInX;
animation-name: ajs-flipInX;
}
.alertify.ajs-flipx.ajs-out.ajs-hidden .ajs-dialog {
-webkit-animation-name: ajs-flipOutX;
animation-name: ajs-flipOutX;
}
.alertify.ajs-flipy.ajs-in:not(.ajs-hidden) .ajs-dialog {
-webkit-animation-name: ajs-flipInY;
animation-name: ajs-flipInY;
}
.alertify.ajs-flipy.ajs-out.ajs-hidden .ajs-dialog {
-webkit-animation-name: ajs-flipOutY;
animation-name: ajs-flipOutY;
}
@-webkit-keyframes ajs-pulseIn {
0%,
20%,
40%,
60%,
80%,
100% {
-webkit-transition-timing-function: cubic-bezier(0.215, 0.61, 0.355, 1);
transition-timing-function: cubic-bezier(0.215, 0.61, 0.355, 1);
}
0% {
opacity: 0;
-webkit-transform: scale3d(0.3, 0.3, 0.3);
transform: scale3d(0.3, 0.3, 0.3);
}
20% {
-webkit-transform: scale3d(1.1, 1.1, 1.1);
transform: scale3d(1.1, 1.1, 1.1);
}
40% {
-webkit-transform: scale3d(0.9, 0.9, 0.9);
transform: scale3d(0.9, 0.9, 0.9);
}
60% {
opacity: 1;
-webkit-transform: scale3d(1.03, 1.03, 1.03);
transform: scale3d(1.03, 1.03, 1.03);
}
80% {
-webkit-transform: scale3d(0.97, 0.97, 0.97);
transform: scale3d(0.97, 0.97, 0.97);
}
100% {
opacity: 1;
-webkit-transform: scale3d(1, 1, 1);
transform: scale3d(1, 1, 1);
}
}
@keyframes ajs-pulseIn {
0%,
20%,
40%,
60%,
80%,
100% {
-webkit-transition-timing-function: cubic-bezier(0.215, 0.61, 0.355, 1);
transition-timing-function: cubic-bezier(0.215, 0.61, 0.355, 1);
}
0% {
opacity: 0;
-webkit-transform: scale3d(0.3, 0.3, 0.3);
transform: scale3d(0.3, 0.3, 0.3);
}
20% {
-webkit-transform: scale3d(1.1, 1.1, 1.1);
transform: scale3d(1.1, 1.1, 1.1);
}
40% {
-webkit-transform: scale3d(0.9, 0.9, 0.9);
transform: scale3d(0.9, 0.9, 0.9);
}
60% {
opacity: 1;
-webkit-transform: scale3d(1.03, 1.03, 1.03);
transform: scale3d(1.03, 1.03, 1.03);
}
80% {
-webkit-transform: scale3d(0.97, 0.97, 0.97);
transform: scale3d(0.97, 0.97, 0.97);
}
100% {
opacity: 1;
-webkit-transform: scale3d(1, 1, 1);
transform: scale3d(1, 1, 1);
}
}
@-webkit-keyframes ajs-pulseOut {
20% {
-webkit-transform: scale3d(0.9, 0.9, 0.9);
transform: scale3d(0.9, 0.9, 0.9);
}
50%,
55% {
opacity: 1;
-webkit-transform: scale3d(1.1, 1.1, 1.1);
transform: scale3d(1.1, 1.1, 1.1);
}
100% {
opacity: 0;
-webkit-transform: scale3d(0.3, 0.3, 0.3);
transform: scale3d(0.3, 0.3, 0.3);
}
}
@keyframes ajs-pulseOut {
20% {
-webkit-transform: scale3d(0.9, 0.9, 0.9);
transform: scale3d(0.9, 0.9, 0.9);
}
50%,
55% {
opacity: 1;
-webkit-transform: scale3d(1.1, 1.1, 1.1);
transform: scale3d(1.1, 1.1, 1.1);
}
100% {
opacity: 0;
-webkit-transform: scale3d(0.3, 0.3, 0.3);
transform: scale3d(0.3, 0.3, 0.3);
}
}
@-webkit-keyframes ajs-zoomIn {
0% {
opacity: 0;
-webkit-transform: scale3d(0.25, 0.25, 0.25);
transform: scale3d(0.25, 0.25, 0.25);
}
100% {
opacity: 1;
-webkit-transform: scale3d(1, 1, 1);
transform: scale3d(1, 1, 1);
}
}
@keyframes ajs-zoomIn {
0% {
opacity: 0;
-webkit-transform: scale3d(0.25, 0.25, 0.25);
transform: scale3d(0.25, 0.25, 0.25);
}
100% {
opacity: 1;
-webkit-transform: scale3d(1, 1, 1);
transform: scale3d(1, 1, 1);
}
}
@-webkit-keyframes ajs-zoomOut {
0% {
opacity: 1;
-webkit-transform: scale3d(1, 1, 1);
transform: scale3d(1, 1, 1);
}
100% {
opacity: 0;
-webkit-transform: scale3d(0.25, 0.25, 0.25);
transform: scale3d(0.25, 0.25, 0.25);
}
}
@keyframes ajs-zoomOut {
0% {
opacity: 1;
-webkit-transform: scale3d(1, 1, 1);
transform: scale3d(1, 1, 1);
}
100% {
opacity: 0;
-webkit-transform: scale3d(0.25, 0.25, 0.25);
transform: scale3d(0.25, 0.25, 0.25);
}
}
@-webkit-keyframes ajs-fadeIn {
0% {
opacity: 0;
}
100% {
opacity: 1;
}
}
@keyframes ajs-fadeIn {
0% {
opacity: 0;
}
100% {
opacity: 1;
}
}
@-webkit-keyframes ajs-fadeOut {
0% {
opacity: 1;
}
100% {
opacity: 0;
}
}
@keyframes ajs-fadeOut {
0% {
opacity: 1;
}
100% {
opacity: 0;
}
}
@-webkit-keyframes ajs-flipInX {
0% {
-webkit-transform: perspective(400px) rotate3d(1, 0, 0, 90deg);
transform: perspective(400px) rotate3d(1, 0, 0, 90deg);
-webkit-transition-timing-function: ease-in;
transition-timing-function: ease-in;
opacity: 0;
}
40% {
-webkit-transform: perspective(400px) rotate3d(1, 0, 0, -20deg);
transform: perspective(400px) rotate3d(1, 0, 0, -20deg);
-webkit-transition-timing-function: ease-in;
transition-timing-function: ease-in;
}
60% {
-webkit-transform: perspective(400px) rotate3d(1, 0, 0, 10deg);
transform: perspective(400px) rotate3d(1, 0, 0, 10deg);
opacity: 1;
}
80% {
-webkit-transform: perspective(400px) rotate3d(1, 0, 0, -5deg);
transform: perspective(400px) rotate3d(1, 0, 0, -5deg);
}
100% {
-webkit-transform: perspective(400px);
transform: perspective(400px);
}
}
@keyframes ajs-flipInX {
0% {
-webkit-transform: perspective(400px) rotate3d(1, 0, 0, 90deg);
transform: perspective(400px) rotate3d(1, 0, 0, 90deg);
-webkit-transition-timing-function: ease-in;
transition-timing-function: ease-in;
opacity: 0;
}
40% {
-webkit-transform: perspective(400px) rotate3d(1, 0, 0, -20deg);
transform: perspective(400px) rotate3d(1, 0, 0, -20deg);
-webkit-transition-timing-function: ease-in;
transition-timing-function: ease-in;
}
60% {
-webkit-transform: perspective(400px) rotate3d(1, 0, 0, 10deg);
transform: perspective(400px) rotate3d(1, 0, 0, 10deg);
opacity: 1;
}
80% {
-webkit-transform: perspective(400px) rotate3d(1, 0, 0, -5deg);
transform: perspective(400px) rotate3d(1, 0, 0, -5deg);
}
100% {
-webkit-transform: perspective(400px);
transform: perspective(400px);
}
}
@-webkit-keyframes ajs-flipOutX {
0% {
-webkit-transform: perspective(400px);
transform: perspective(400px);
}
30% {
-webkit-transform: perspective(400px) rotate3d(1, 0, 0, -20deg);
transform: perspective(400px) rotate3d(1, 0, 0, -20deg);
opacity: 1;
}
100% {
-webkit-transform: perspective(400px) rotate3d(1, 0, 0, 90deg);
transform: perspective(400px) rotate3d(1, 0, 0, 90deg);
opacity: 0;
}
}
@keyframes ajs-flipOutX {
0% {
-webkit-transform: perspective(400px);
transform: perspective(400px);
}
30% {
-webkit-transform: perspective(400px) rotate3d(1, 0, 0, -20deg);
transform: perspective(400px) rotate3d(1, 0, 0, -20deg);
opacity: 1;
}
100% {
-webkit-transform: perspective(400px) rotate3d(1, 0, 0, 90deg);
transform: perspective(400px) rotate3d(1, 0, 0, 90deg);
opacity: 0;
}
}
@-webkit-keyframes ajs-flipInY {
0% {
-webkit-transform: perspective(400px) rotate3d(0, 1, 0, 90deg);
transform: perspective(400px) rotate3d(0, 1, 0, 90deg);
-webkit-transition-timing-function: ease-in;
transition-timing-function: ease-in;
opacity: 0;
}
40% {
-webkit-transform: perspective(400px) rotate3d(0, 1, 0, -20deg);
transform: perspective(400px) rotate3d(0, 1, 0, -20deg);
-webkit-transition-timing-function: ease-in;
transition-timing-function: ease-in;
}
60% {
-webkit-transform: perspective(400px) rotate3d(0, 1, 0, 10deg);
transform: perspective(400px) rotate3d(0, 1, 0, 10deg);
opacity: 1;
}
80% {
-webkit-transform: perspective(400px) rotate3d(0, 1, 0, -5deg);
transform: perspective(400px) rotate3d(0, 1, 0, -5deg);
}
100% {
-webkit-transform: perspective(400px);
transform: perspective(400px);
}
}
@keyframes ajs-flipInY {
0% {
-webkit-transform: perspective(400px) rotate3d(0, 1, 0, 90deg);
transform: perspective(400px) rotate3d(0, 1, 0, 90deg);
-webkit-transition-timing-function: ease-in;
transition-timing-function: ease-in;
opacity: 0;
}
40% {
-webkit-transform: perspective(400px) rotate3d(0, 1, 0, -20deg);
transform: perspective(400px) rotate3d(0, 1, 0, -20deg);
-webkit-transition-timing-function: ease-in;
transition-timing-function: ease-in;
}
60% {
-webkit-transform: perspective(400px) rotate3d(0, 1, 0, 10deg);
transform: perspective(400px) rotate3d(0, 1, 0, 10deg);
opacity: 1;
}
80% {
-webkit-transform: perspective(400px) rotate3d(0, 1, 0, -5deg);
transform: perspective(400px) rotate3d(0, 1, 0, -5deg);
}
100% {
-webkit-transform: perspective(400px);
transform: perspective(400px);
}
}
@-webkit-keyframes ajs-flipOutY {
0% {
-webkit-transform: perspective(400px);
transform: perspective(400px);
}
30% {
-webkit-transform: perspective(400px) rotate3d(0, 1, 0, -15deg);
transform: perspective(400px) rotate3d(0, 1, 0, -15deg);
opacity: 1;
}
100% {
-webkit-transform: perspective(400px) rotate3d(0, 1, 0, 90deg);
transform: perspective(400px) rotate3d(0, 1, 0, 90deg);
opacity: 0;
}
}
@keyframes ajs-flipOutY {
0% {
-webkit-transform: perspective(400px);
transform: perspective(400px);
}
30% {
-webkit-transform: perspective(400px) rotate3d(0, 1, 0, -15deg);
transform: perspective(400px) rotate3d(0, 1, 0, -15deg);
opacity: 1;
}
100% {
-webkit-transform: perspective(400px) rotate3d(0, 1, 0, 90deg);
transform: perspective(400px) rotate3d(0, 1, 0, 90deg);
opacity: 0;
}
}
@-webkit-keyframes ajs-slideIn {
0% {
margin-top: -100%;
}
100% {
margin-top: 5%;
}
}
@keyframes ajs-slideIn {
0% {
margin-top: -100%;
}
100% {
margin-top: 5%;
}
}
@-webkit-keyframes ajs-slideOut {
0% {
margin-top: 5%;
}
100% {
margin-top: -100%;
}
}
@keyframes ajs-slideOut {
0% {
margin-top: 5%;
}
100% {
margin-top: -100%;
}
}
.alertify-notifier {
position: fixed;
width: 0;
overflow: visible;
z-index: 1982;
-webkit-transform: translate3d(0, 0, 0);
transform: translate3d(0, 0, 0);
}
.alertify-notifier .ajs-message {
position: relative;
width: 260px;
max-height: 0;
padding: 0;
opacity: 0;
margin: 0;
-webkit-transform: translate3d(0, 0, 0);
transform: translate3d(0, 0, 0);
-webkit-transition-duration: 250ms;
transition-duration: 250ms;
-webkit-transition-timing-function: linear;
transition-timing-function: linear;
}
.alertify-notifier .ajs-message.ajs-visible {
-webkit-transition-duration: 500ms;
transition-duration: 500ms;
-webkit-transition-timing-function: cubic-bezier(0.175, 0.885, 0.32, 1.275);
transition-timing-function: cubic-bezier(0.175, 0.885, 0.32, 1.275);
opacity: 1;
max-height: 100%;
padding: 15px;
margin-top: 10px;
}
.alertify-notifier .ajs-message.ajs-success {
background: rgba(91, 189, 114, 0.95);
}
.alertify-notifier .ajs-message.ajs-error {
background: rgba(217, 92, 92, 0.95);
}
.alertify-notifier .ajs-message.ajs-warning {
background: rgba(252, 248, 215, 0.95);
}
.alertify-notifier .ajs-message .ajs-close {
position: absolute;
top: 0;
right: 0;
width: 16px;
height: 16px;
cursor: pointer;
background-image: url(data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAAgAAAAICAYAAADED76LAAAABGdBTUEAALGPC/xhBQAAAFBJREFUGBl1j0EKADEIA+ve/P9f9bh1hEihNBfjVCO1v7RKVqJK4h8gM5cAPR42AkQEpSXPwMTyoi13n5N9YqJehm3Fnr7nL1D0ZEbD5OubGyC7a9gx+9eNAAAAAElFTkSuQmCC);
background-repeat: no-repeat;
background-position: center center;
background-color: rgba(0, 0, 0, 0.5);
border-top-right-radius: 2px;
}
.alertify-notifier.ajs-top {
top: 10px;
}
.alertify-notifier.ajs-bottom {
bottom: 10px;
}
.alertify-notifier.ajs-right {
right: 10px;
}
.alertify-notifier.ajs-right .ajs-message {
right: -320px;
}
.alertify-notifier.ajs-right .ajs-message.ajs-visible {
right: 290px;
}
.alertify-notifier.ajs-left {
left: 10px;
}
.alertify-notifier.ajs-left .ajs-message {
left: -300px;
}
.alertify-notifier.ajs-left .ajs-message.ajs-visible {
left: 0;
}
.alertify-notifier.ajs-center {
left: 50%;
}
.alertify-notifier.ajs-center .ajs-message {
-webkit-transform: translateX(-50%);
transform: translateX(-50%);
}
.alertify-notifier.ajs-center .ajs-message.ajs-visible {
left: 50%;
-webkit-transition-timing-function: cubic-bezier(0.57, 0.43, 0.1, 0.65);
transition-timing-function: cubic-bezier(0.57, 0.43, 0.1, 0.65);
}
.alertify-notifier.ajs-center.ajs-top .ajs-message {
top: -300px;
}
.alertify-notifier.ajs-center.ajs-top .ajs-message.ajs-visible {
top: 0;
}
.alertify-notifier.ajs-center.ajs-bottom .ajs-message {
bottom: -300px;
}
.alertify-notifier.ajs-center.ajs-bottom .ajs-message.ajs-visible {
bottom: 0;
}
.ajs-no-transition.alertify .ajs-dimmer,
.ajs-no-transition.alertify .ajs-modal,
.ajs-no-transition.alertify .ajs-dialog {
-webkit-transition: none!important;
transition: none!important;
-webkit-animation: none!important;
animation: none!important;
}
.ajs-no-transition.alertify-notifier .ajs-message {
-webkit-transition: none!important;
transition: none!important;
-webkit-animation: none!important;
animation: none!important;
}
@media (prefers-reduced-motion: reduce) {
.alertify .ajs-dimmer,
.alertify .ajs-modal,
.alertify .ajs-dialog {
-webkit-transition: none!important;
transition: none!important;
-webkit-animation: none!important;
animation: none!important;
}
.alertify-notifier .ajs-message {
-webkit-transition: none!important;
transition: none!important;
-webkit-animation: none!important;
animation: none!important;
}
}

File diff suppressed because one or more lines are too long

View File

@@ -0,0 +1,968 @@
/**
* alertifyjs 1.14.0 http://alertifyjs.com
* AlertifyJS is a javascript framework for developing pretty browser dialogs and notifications.
* Copyright 2024 Mohammad Younes <Mohammad@alertifyjs.com> (http://alertifyjs.com)
* Licensed under GPL 3 <https://opensource.org/licenses/gpl-3.0>*/
.alertify .ajs-dimmer {
position: fixed;
z-index: 1981;
top: 0;
left: 0;
bottom: 0;
right: 0;
padding: 0;
margin: 0;
background-color: #252525;
opacity: 0.5;
}
.alertify .ajs-modal {
position: fixed;
top: 0;
left: 0;
right: 0;
bottom: 0;
padding: 0;
overflow-y: auto;
z-index: 1981;
}
.alertify .ajs-dialog {
position: relative;
margin: 5% auto;
min-height: 110px;
max-width: 500px;
padding: 24px 24px 0 24px;
outline: 0;
background-color: #fff;
}
.alertify .ajs-dialog.ajs-capture:before {
content: '';
position: absolute;
top: 0;
left: 0;
bottom: 0;
right: 0;
display: block;
z-index: 1;
}
.alertify .ajs-reset {
position: absolute !important;
display: inline !important;
width: 0 !important;
height: 0 !important;
opacity: 0 !important;
}
.alertify .ajs-commands {
position: absolute;
left: 4px;
margin: -14px 0 0 24px;
z-index: 2;
}
.alertify .ajs-commands button {
display: none;
width: 10px;
height: 10px;
margin-right: 10px;
padding: 10px;
border: 0;
background-color: transparent;
background-repeat: no-repeat;
background-position: center;
cursor: pointer;
}
.alertify .ajs-commands button.ajs-close {
background-image: url(data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAAoAAAAKCAYAAACNMs+9AAAABHNCSVQICAgIfAhkiAAAAAlwSFlzAAALEgAACxIB0t1+/AAAABZ0RVh0Q3JlYXRpb24gVGltZQAwNy8xMy8xNOrZqugAAAAcdEVYdFNvZnR3YXJlAEFkb2JlIEZpcmV3b3JrcyBDUzbovLKMAAAAh0lEQVQYlY2QsQ0EIQwEB9cBAR1CJUaI/gigDnwR6NBL/7/xWLNrZ2b8EwGotVpr7eOitWa1VjugiNB7R1UPrKrWe0dEAHBbXUqxMQbeewDmnHjvyTm7C3zDwAUd9c63YQdUVdu6EAJzzquz7HXvTiklt+H9DQFYaxFjvDqllFyMkbXWvfpXHjJrWFgdBq/hAAAAAElFTkSuQmCC);
}
.alertify .ajs-commands button.ajs-maximize {
background-image: url(data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAAoAAAAKCAYAAACNMs+9AAAABHNCSVQICAgIfAhkiAAAAAlwSFlzAAALEgAACxIB0t1+/AAAABZ0RVh0Q3JlYXRpb24gVGltZQAwNy8xMy8xNOrZqugAAAAcdEVYdFNvZnR3YXJlAEFkb2JlIEZpcmV3b3JrcyBDUzbovLKMAAAAOUlEQVQYlWP8//8/AzGAhYGBgaG4uBiv6t7eXkYmooxjYGAgWiELsvHYFMCcRX2rSXcjoSBiJDbAAeD+EGu+8BZcAAAAAElFTkSuQmCC);
}
.alertify .ajs-header {
margin: -24px;
margin-bottom: 0;
padding: 16px 24px;
background-color: #fff;
}
.alertify .ajs-body {
min-height: 56px;
}
.alertify .ajs-body .ajs-content {
padding: 16px 16px 16px 24px;
}
.alertify .ajs-footer {
padding: 4px;
margin-right: -24px;
margin-left: -24px;
min-height: 43px;
background-color: #fff;
}
.alertify .ajs-footer .ajs-buttons.ajs-primary {
text-align: left;
}
.alertify .ajs-footer .ajs-buttons.ajs-primary .ajs-button {
margin: 4px;
}
.alertify .ajs-footer .ajs-buttons.ajs-auxiliary {
float: right;
clear: none;
text-align: right;
}
.alertify .ajs-footer .ajs-buttons.ajs-auxiliary .ajs-button {
margin: 4px;
}
.alertify .ajs-footer .ajs-buttons .ajs-button {
min-width: 88px;
min-height: 35px;
}
.alertify .ajs-handle {
position: absolute;
display: none;
width: 10px;
height: 10px;
left: 0;
bottom: 0;
z-index: 1;
background-image: url(data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAAoAAAAKCAYAAACNMs+9AAAABHNCSVQICAgIfAhkiAAAAAlwSFlzAAALEgAACxIB0t1+/AAAABZ0RVh0Q3JlYXRpb24gVGltZQAwNy8xMS8xNEDQYmMAAAAcdEVYdFNvZnR3YXJlAEFkb2JlIEZpcmV3b3JrcyBDUzbovLKMAAAAQ0lEQVQYlaXNMQoAIAxD0dT7H657l0KX3iJuUlBUNOsPPCGJm7VDp6ryeMxMuDsAQH7owW3pyn3RS26iKxERMLN3ugOaAkaL3sWVigAAAABJRU5ErkJggg==);
-webkit-transform: scaleX(-1);
transform: scaleX(-1);
cursor: sw-resize;
}
.alertify.ajs-no-overflow .ajs-body .ajs-content {
overflow: hidden !important;
}
.alertify.ajs-no-padding.ajs-maximized .ajs-body .ajs-content {
right: 0;
left: 0;
padding: 0;
}
.alertify.ajs-no-padding:not(.ajs-maximized) .ajs-body {
margin-right: -24px;
margin-left: -24px;
}
.alertify.ajs-no-padding:not(.ajs-maximized) .ajs-body .ajs-content {
padding: 0;
}
.alertify.ajs-no-padding.ajs-resizable .ajs-body .ajs-content {
right: 0;
left: 0;
}
.alertify.ajs-maximizable .ajs-commands button.ajs-maximize,
.alertify.ajs-maximizable .ajs-commands button.ajs-restore {
display: inline-block;
}
.alertify.ajs-closable .ajs-commands button.ajs-close {
display: inline-block;
}
.alertify.ajs-maximized .ajs-dialog {
width: 100% !important;
height: 100% !important;
max-width: none !important;
margin: 0 auto !important;
top: 0 !important;
right: 0 !important;
}
.alertify.ajs-maximized.ajs-modeless .ajs-modal {
position: fixed !important;
min-height: 100% !important;
max-height: none !important;
margin: 0 !important;
}
.alertify.ajs-maximized .ajs-commands button.ajs-maximize {
background-image: url(data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAAoAAAAKCAYAAACNMs+9AAAABHNCSVQICAgIfAhkiAAAAAlwSFlzAAALEgAACxIB0t1+/AAAABZ0RVh0Q3JlYXRpb24gVGltZQAwNy8xMy8xNOrZqugAAAAcdEVYdFNvZnR3YXJlAEFkb2JlIEZpcmV3b3JrcyBDUzbovLKMAAAASklEQVQYlZWQ0QkAMQhDtXRincOZX78KVtrDCwgqJNEoIB3MPLj7lRUROlpyVXGzby6zWuY+kz6tj5sBMTMAyVV3/595RbOh3cAXsww1raeiOcoAAAAASUVORK5CYII=);
}
.alertify.ajs-resizable .ajs-dialog,
.alertify.ajs-maximized .ajs-dialog {
padding: 0;
}
.alertify.ajs-resizable .ajs-commands,
.alertify.ajs-maximized .ajs-commands {
margin: 14px 0 0 24px;
}
.alertify.ajs-resizable .ajs-header,
.alertify.ajs-maximized .ajs-header {
position: absolute;
top: 0;
right: 0;
left: 0;
margin: 0;
padding: 16px 24px;
}
.alertify.ajs-resizable .ajs-body,
.alertify.ajs-maximized .ajs-body {
min-height: 224px;
display: inline-block;
}
.alertify.ajs-resizable .ajs-body .ajs-content,
.alertify.ajs-maximized .ajs-body .ajs-content {
position: absolute;
top: 50px;
left: 24px;
bottom: 50px;
right: 24px;
overflow: auto;
}
.alertify.ajs-resizable .ajs-footer,
.alertify.ajs-maximized .ajs-footer {
position: absolute;
right: 0;
left: 0;
bottom: 0;
margin: 0;
}
.alertify.ajs-resizable:not(.ajs-maximized) .ajs-dialog {
min-width: 548px;
}
.alertify.ajs-resizable:not(.ajs-maximized) .ajs-handle {
display: block;
}
.alertify.ajs-movable:not(.ajs-maximized) .ajs-header {
cursor: move;
}
.alertify.ajs-modeless .ajs-dimmer,
.alertify.ajs-modeless .ajs-reset {
display: none;
}
.alertify.ajs-modeless .ajs-modal {
overflow: visible;
max-width: none;
max-height: 0;
}
.alertify.ajs-modeless.ajs-pinnable .ajs-commands button.ajs-pin {
display: inline-block;
background-image: url(data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAAoAAAAKCAYAAACNMs+9AAAABHNCSVQICAgIfAhkiAAAAAlwSFlzAAALEgAACxIB0t1+/AAAABZ0RVh0Q3JlYXRpb24gVGltZQAwNy8xMy8xNOrZqugAAAAcdEVYdFNvZnR3YXJlAEFkb2JlIEZpcmV3b3JrcyBDUzbovLKMAAAAQklEQVQYlcWPMQ4AIAwCqU9u38GbcbHRWN1MvKQDhQFMEpKImGJA0gCgnYw0V0rwxseg5erT4oSkQVI5d9f+e9+xA0NbLpWfitPXAAAAAElFTkSuQmCC);
}
.alertify.ajs-modeless.ajs-unpinned .ajs-modal {
position: absolute;
}
.alertify.ajs-modeless.ajs-unpinned .ajs-commands button.ajs-pin {
background-image: url(data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAAoAAAAKCAYAAACNMs+9AAAABHNCSVQICAgIfAhkiAAAAAlwSFlzAAALEgAACxIB0t1+/AAAABZ0RVh0Q3JlYXRpb24gVGltZQAwNy8xMy8xNOrZqugAAAAcdEVYdFNvZnR3YXJlAEFkb2JlIEZpcmV3b3JrcyBDUzbovLKMAAAAO0lEQVQYlWP8//8/AzGAiShV6AqLi4txGs+CLoBLMYbC3t5eRmyaWfBZhwwYkX2NTxPRvibKjRhW4wMAhxkYGbLu3pEAAAAASUVORK5CYII=);
}
.alertify.ajs-modeless:not(.ajs-unpinned) .ajs-body {
max-height: 500px;
overflow: auto;
}
.alertify.ajs-basic .ajs-header {
opacity: 0;
}
.alertify.ajs-basic .ajs-footer {
visibility: hidden;
}
.alertify.ajs-frameless .ajs-header {
position: absolute;
top: 0;
right: 0;
left: 0;
min-height: 60px;
margin: 0;
padding: 0;
opacity: 0;
z-index: 1;
}
.alertify.ajs-frameless .ajs-footer {
display: none;
}
.alertify.ajs-frameless .ajs-body .ajs-content {
position: absolute;
top: 0;
left: 0;
bottom: 0;
right: 0;
}
.alertify.ajs-frameless:not(.ajs-resizable) .ajs-dialog {
padding-top: 0;
}
.alertify.ajs-frameless:not(.ajs-resizable) .ajs-dialog .ajs-commands {
margin-top: 0;
}
.ajs-no-overflow {
overflow: hidden !important;
outline: none;
}
.ajs-no-overflow.ajs-fixed {
position: fixed;
top: 0;
left: 0;
bottom: 0;
right: 0;
overflow-y: scroll!important;
}
.ajs-no-selection,
.ajs-no-selection * {
-webkit-user-select: none;
-moz-user-select: none;
-ms-user-select: none;
user-select: none;
}
@media screen and (max-width: 568px) {
.alertify .ajs-dialog {
min-width: 150px;
}
.alertify:not(.ajs-maximized) .ajs-modal {
padding: 0 5%;
}
.alertify:not(.ajs-maximized).ajs-resizable .ajs-dialog {
min-width: initial;
min-width: auto /*IE fallback*/;
}
}
@-moz-document url-prefix() {
.alertify button:focus {
outline: 1px dotted #3593D2;
}
}
.alertify .ajs-dimmer,
.alertify .ajs-modal {
-webkit-transform: translate3d(0, 0, 0);
transform: translate3d(0, 0, 0);
-webkit-transition-property: opacity, visibility;
transition-property: opacity, visibility;
-webkit-transition-timing-function: linear;
transition-timing-function: linear;
-webkit-transition-duration: 250ms;
transition-duration: 250ms;
}
.alertify.ajs-hidden .ajs-dimmer,
.alertify.ajs-hidden .ajs-modal {
visibility: hidden;
opacity: 0;
}
.alertify.ajs-in:not(.ajs-hidden) .ajs-dialog {
-webkit-animation-duration: 500ms;
animation-duration: 500ms;
}
.alertify.ajs-out.ajs-hidden .ajs-dialog {
-webkit-animation-duration: 250ms;
animation-duration: 250ms;
}
.alertify .ajs-dialog.ajs-shake {
-webkit-animation-name: ajs-shake;
animation-name: ajs-shake;
-webkit-animation-duration: 0.1s;
animation-duration: 0.1s;
-webkit-animation-fill-mode: both;
animation-fill-mode: both;
}
@-webkit-keyframes ajs-shake {
0%,
100% {
-webkit-transform: translate3d(0, 0, 0);
transform: translate3d(0, 0, 0);
}
10%,
30%,
50%,
70%,
90% {
-webkit-transform: translate3d(10px, 0, 0);
transform: translate3d(10px, 0, 0);
}
20%,
40%,
60%,
80% {
-webkit-transform: translate3d(-10px, 0, 0);
transform: translate3d(-10px, 0, 0);
}
}
@keyframes ajs-shake {
0%,
100% {
-webkit-transform: translate3d(0, 0, 0);
transform: translate3d(0, 0, 0);
}
10%,
30%,
50%,
70%,
90% {
-webkit-transform: translate3d(10px, 0, 0);
transform: translate3d(10px, 0, 0);
}
20%,
40%,
60%,
80% {
-webkit-transform: translate3d(-10px, 0, 0);
transform: translate3d(-10px, 0, 0);
}
}
.alertify.ajs-slide.ajs-in:not(.ajs-hidden) .ajs-dialog {
-webkit-animation-name: ajs-slideIn;
animation-name: ajs-slideIn;
-webkit-animation-timing-function: cubic-bezier(0.175, 0.885, 0.32, 1.275);
animation-timing-function: cubic-bezier(0.175, 0.885, 0.32, 1.275);
}
.alertify.ajs-slide.ajs-out.ajs-hidden .ajs-dialog {
-webkit-animation-name: ajs-slideOut;
animation-name: ajs-slideOut;
-webkit-animation-timing-function: cubic-bezier(0.6, -0.28, 0.735, 0.045);
animation-timing-function: cubic-bezier(0.6, -0.28, 0.735, 0.045);
}
.alertify.ajs-zoom.ajs-in:not(.ajs-hidden) .ajs-dialog {
-webkit-animation-name: ajs-zoomIn;
animation-name: ajs-zoomIn;
}
.alertify.ajs-zoom.ajs-out.ajs-hidden .ajs-dialog {
-webkit-animation-name: ajs-zoomOut;
animation-name: ajs-zoomOut;
}
.alertify.ajs-fade.ajs-in:not(.ajs-hidden) .ajs-dialog {
-webkit-animation-name: ajs-fadeIn;
animation-name: ajs-fadeIn;
}
.alertify.ajs-fade.ajs-out.ajs-hidden .ajs-dialog {
-webkit-animation-name: ajs-fadeOut;
animation-name: ajs-fadeOut;
}
.alertify.ajs-pulse.ajs-in:not(.ajs-hidden) .ajs-dialog {
-webkit-animation-name: ajs-pulseIn;
animation-name: ajs-pulseIn;
}
.alertify.ajs-pulse.ajs-out.ajs-hidden .ajs-dialog {
-webkit-animation-name: ajs-pulseOut;
animation-name: ajs-pulseOut;
}
.alertify.ajs-flipx.ajs-in:not(.ajs-hidden) .ajs-dialog {
-webkit-animation-name: ajs-flipInX;
animation-name: ajs-flipInX;
}
.alertify.ajs-flipx.ajs-out.ajs-hidden .ajs-dialog {
-webkit-animation-name: ajs-flipOutX;
animation-name: ajs-flipOutX;
}
.alertify.ajs-flipy.ajs-in:not(.ajs-hidden) .ajs-dialog {
-webkit-animation-name: ajs-flipInY;
animation-name: ajs-flipInY;
}
.alertify.ajs-flipy.ajs-out.ajs-hidden .ajs-dialog {
-webkit-animation-name: ajs-flipOutY;
animation-name: ajs-flipOutY;
}
@-webkit-keyframes ajs-pulseIn {
0%,
20%,
40%,
60%,
80%,
100% {
-webkit-transition-timing-function: cubic-bezier(0.215, 0.61, 0.355, 1);
transition-timing-function: cubic-bezier(0.215, 0.61, 0.355, 1);
}
0% {
opacity: 0;
-webkit-transform: scale3d(0.3, 0.3, 0.3);
transform: scale3d(0.3, 0.3, 0.3);
}
20% {
-webkit-transform: scale3d(1.1, 1.1, 1.1);
transform: scale3d(1.1, 1.1, 1.1);
}
40% {
-webkit-transform: scale3d(0.9, 0.9, 0.9);
transform: scale3d(0.9, 0.9, 0.9);
}
60% {
opacity: 1;
-webkit-transform: scale3d(1.03, 1.03, 1.03);
transform: scale3d(1.03, 1.03, 1.03);
}
80% {
-webkit-transform: scale3d(0.97, 0.97, 0.97);
transform: scale3d(0.97, 0.97, 0.97);
}
100% {
opacity: 1;
-webkit-transform: scale3d(1, 1, 1);
transform: scale3d(1, 1, 1);
}
}
@keyframes ajs-pulseIn {
0%,
20%,
40%,
60%,
80%,
100% {
-webkit-transition-timing-function: cubic-bezier(0.215, 0.61, 0.355, 1);
transition-timing-function: cubic-bezier(0.215, 0.61, 0.355, 1);
}
0% {
opacity: 0;
-webkit-transform: scale3d(0.3, 0.3, 0.3);
transform: scale3d(0.3, 0.3, 0.3);
}
20% {
-webkit-transform: scale3d(1.1, 1.1, 1.1);
transform: scale3d(1.1, 1.1, 1.1);
}
40% {
-webkit-transform: scale3d(0.9, 0.9, 0.9);
transform: scale3d(0.9, 0.9, 0.9);
}
60% {
opacity: 1;
-webkit-transform: scale3d(1.03, 1.03, 1.03);
transform: scale3d(1.03, 1.03, 1.03);
}
80% {
-webkit-transform: scale3d(0.97, 0.97, 0.97);
transform: scale3d(0.97, 0.97, 0.97);
}
100% {
opacity: 1;
-webkit-transform: scale3d(1, 1, 1);
transform: scale3d(1, 1, 1);
}
}
@-webkit-keyframes ajs-pulseOut {
20% {
-webkit-transform: scale3d(0.9, 0.9, 0.9);
transform: scale3d(0.9, 0.9, 0.9);
}
50%,
55% {
opacity: 1;
-webkit-transform: scale3d(1.1, 1.1, 1.1);
transform: scale3d(1.1, 1.1, 1.1);
}
100% {
opacity: 0;
-webkit-transform: scale3d(0.3, 0.3, 0.3);
transform: scale3d(0.3, 0.3, 0.3);
}
}
@keyframes ajs-pulseOut {
20% {
-webkit-transform: scale3d(0.9, 0.9, 0.9);
transform: scale3d(0.9, 0.9, 0.9);
}
50%,
55% {
opacity: 1;
-webkit-transform: scale3d(1.1, 1.1, 1.1);
transform: scale3d(1.1, 1.1, 1.1);
}
100% {
opacity: 0;
-webkit-transform: scale3d(0.3, 0.3, 0.3);
transform: scale3d(0.3, 0.3, 0.3);
}
}
@-webkit-keyframes ajs-zoomIn {
0% {
opacity: 0;
-webkit-transform: scale3d(0.25, 0.25, 0.25);
transform: scale3d(0.25, 0.25, 0.25);
}
100% {
opacity: 1;
-webkit-transform: scale3d(1, 1, 1);
transform: scale3d(1, 1, 1);
}
}
@keyframes ajs-zoomIn {
0% {
opacity: 0;
-webkit-transform: scale3d(0.25, 0.25, 0.25);
transform: scale3d(0.25, 0.25, 0.25);
}
100% {
opacity: 1;
-webkit-transform: scale3d(1, 1, 1);
transform: scale3d(1, 1, 1);
}
}
@-webkit-keyframes ajs-zoomOut {
0% {
opacity: 1;
-webkit-transform: scale3d(1, 1, 1);
transform: scale3d(1, 1, 1);
}
100% {
opacity: 0;
-webkit-transform: scale3d(0.25, 0.25, 0.25);
transform: scale3d(0.25, 0.25, 0.25);
}
}
@keyframes ajs-zoomOut {
0% {
opacity: 1;
-webkit-transform: scale3d(1, 1, 1);
transform: scale3d(1, 1, 1);
}
100% {
opacity: 0;
-webkit-transform: scale3d(0.25, 0.25, 0.25);
transform: scale3d(0.25, 0.25, 0.25);
}
}
@-webkit-keyframes ajs-fadeIn {
0% {
opacity: 0;
}
100% {
opacity: 1;
}
}
@keyframes ajs-fadeIn {
0% {
opacity: 0;
}
100% {
opacity: 1;
}
}
@-webkit-keyframes ajs-fadeOut {
0% {
opacity: 1;
}
100% {
opacity: 0;
}
}
@keyframes ajs-fadeOut {
0% {
opacity: 1;
}
100% {
opacity: 0;
}
}
@-webkit-keyframes ajs-flipInX {
0% {
-webkit-transform: perspective(400px) rotate3d(1, 0, 0, -90deg);
transform: perspective(400px) rotate3d(1, 0, 0, -90deg);
-webkit-transition-timing-function: ease-in;
transition-timing-function: ease-in;
opacity: 0;
}
40% {
-webkit-transform: perspective(400px) rotate3d(1, 0, 0, 20deg);
transform: perspective(400px) rotate3d(1, 0, 0, 20deg);
-webkit-transition-timing-function: ease-in;
transition-timing-function: ease-in;
}
60% {
-webkit-transform: perspective(400px) rotate3d(1, 0, 0, -10deg);
transform: perspective(400px) rotate3d(1, 0, 0, -10deg);
opacity: 1;
}
80% {
-webkit-transform: perspective(400px) rotate3d(1, 0, 0, 5deg);
transform: perspective(400px) rotate3d(1, 0, 0, 5deg);
}
100% {
-webkit-transform: perspective(400px);
transform: perspective(400px);
}
}
@keyframes ajs-flipInX {
0% {
-webkit-transform: perspective(400px) rotate3d(1, 0, 0, -90deg);
transform: perspective(400px) rotate3d(1, 0, 0, -90deg);
-webkit-transition-timing-function: ease-in;
transition-timing-function: ease-in;
opacity: 0;
}
40% {
-webkit-transform: perspective(400px) rotate3d(1, 0, 0, 20deg);
transform: perspective(400px) rotate3d(1, 0, 0, 20deg);
-webkit-transition-timing-function: ease-in;
transition-timing-function: ease-in;
}
60% {
-webkit-transform: perspective(400px) rotate3d(1, 0, 0, -10deg);
transform: perspective(400px) rotate3d(1, 0, 0, -10deg);
opacity: 1;
}
80% {
-webkit-transform: perspective(400px) rotate3d(1, 0, 0, 5deg);
transform: perspective(400px) rotate3d(1, 0, 0, 5deg);
}
100% {
-webkit-transform: perspective(400px);
transform: perspective(400px);
}
}
@-webkit-keyframes ajs-flipOutX {
0% {
-webkit-transform: perspective(400px);
transform: perspective(400px);
}
30% {
-webkit-transform: perspective(400px) rotate3d(1, 0, 0, 20deg);
transform: perspective(400px) rotate3d(1, 0, 0, 20deg);
opacity: 1;
}
100% {
-webkit-transform: perspective(400px) rotate3d(1, 0, 0, -90deg);
transform: perspective(400px) rotate3d(1, 0, 0, -90deg);
opacity: 0;
}
}
@keyframes ajs-flipOutX {
0% {
-webkit-transform: perspective(400px);
transform: perspective(400px);
}
30% {
-webkit-transform: perspective(400px) rotate3d(1, 0, 0, 20deg);
transform: perspective(400px) rotate3d(1, 0, 0, 20deg);
opacity: 1;
}
100% {
-webkit-transform: perspective(400px) rotate3d(1, 0, 0, -90deg);
transform: perspective(400px) rotate3d(1, 0, 0, -90deg);
opacity: 0;
}
}
@-webkit-keyframes ajs-flipInY {
0% {
-webkit-transform: perspective(400px) rotate3d(0, -1, 0, -90deg);
transform: perspective(400px) rotate3d(0, -1, 0, -90deg);
-webkit-transition-timing-function: ease-in;
transition-timing-function: ease-in;
opacity: 0;
}
40% {
-webkit-transform: perspective(400px) rotate3d(0, -1, 0, 20deg);
transform: perspective(400px) rotate3d(0, -1, 0, 20deg);
-webkit-transition-timing-function: ease-in;
transition-timing-function: ease-in;
}
60% {
-webkit-transform: perspective(400px) rotate3d(0, -1, 0, -10deg);
transform: perspective(400px) rotate3d(0, -1, 0, -10deg);
opacity: 1;
}
80% {
-webkit-transform: perspective(400px) rotate3d(0, -1, 0, 5deg);
transform: perspective(400px) rotate3d(0, -1, 0, 5deg);
}
100% {
-webkit-transform: perspective(400px);
transform: perspective(400px);
}
}
@keyframes ajs-flipInY {
0% {
-webkit-transform: perspective(400px) rotate3d(0, -1, 0, -90deg);
transform: perspective(400px) rotate3d(0, -1, 0, -90deg);
-webkit-transition-timing-function: ease-in;
transition-timing-function: ease-in;
opacity: 0;
}
40% {
-webkit-transform: perspective(400px) rotate3d(0, -1, 0, 20deg);
transform: perspective(400px) rotate3d(0, -1, 0, 20deg);
-webkit-transition-timing-function: ease-in;
transition-timing-function: ease-in;
}
60% {
-webkit-transform: perspective(400px) rotate3d(0, -1, 0, -10deg);
transform: perspective(400px) rotate3d(0, -1, 0, -10deg);
opacity: 1;
}
80% {
-webkit-transform: perspective(400px) rotate3d(0, -1, 0, 5deg);
transform: perspective(400px) rotate3d(0, -1, 0, 5deg);
}
100% {
-webkit-transform: perspective(400px);
transform: perspective(400px);
}
}
@-webkit-keyframes ajs-flipOutY {
0% {
-webkit-transform: perspective(400px);
transform: perspective(400px);
}
30% {
-webkit-transform: perspective(400px) rotate3d(0, -1, 0, 15deg);
transform: perspective(400px) rotate3d(0, -1, 0, 15deg);
opacity: 1;
}
100% {
-webkit-transform: perspective(400px) rotate3d(0, -1, 0, -90deg);
transform: perspective(400px) rotate3d(0, -1, 0, -90deg);
opacity: 0;
}
}
@keyframes ajs-flipOutY {
0% {
-webkit-transform: perspective(400px);
transform: perspective(400px);
}
30% {
-webkit-transform: perspective(400px) rotate3d(0, -1, 0, 15deg);
transform: perspective(400px) rotate3d(0, -1, 0, 15deg);
opacity: 1;
}
100% {
-webkit-transform: perspective(400px) rotate3d(0, -1, 0, -90deg);
transform: perspective(400px) rotate3d(0, -1, 0, -90deg);
opacity: 0;
}
}
@-webkit-keyframes ajs-slideIn {
0% {
margin-top: -100%;
}
100% {
margin-top: 5%;
}
}
@keyframes ajs-slideIn {
0% {
margin-top: -100%;
}
100% {
margin-top: 5%;
}
}
@-webkit-keyframes ajs-slideOut {
0% {
margin-top: 5%;
}
100% {
margin-top: -100%;
}
}
@keyframes ajs-slideOut {
0% {
margin-top: 5%;
}
100% {
margin-top: -100%;
}
}
.alertify-notifier {
position: fixed;
width: 0;
overflow: visible;
z-index: 1982;
-webkit-transform: translate3d(0, 0, 0);
transform: translate3d(0, 0, 0);
}
.alertify-notifier .ajs-message {
position: relative;
width: 260px;
max-height: 0;
padding: 0;
opacity: 0;
margin: 0;
-webkit-transform: translate3d(0, 0, 0);
transform: translate3d(0, 0, 0);
-webkit-transition-duration: 250ms;
transition-duration: 250ms;
-webkit-transition-timing-function: linear;
transition-timing-function: linear;
}
.alertify-notifier .ajs-message.ajs-visible {
-webkit-transition-duration: 500ms;
transition-duration: 500ms;
-webkit-transition-timing-function: cubic-bezier(0.175, 0.885, 0.32, 1.275);
transition-timing-function: cubic-bezier(0.175, 0.885, 0.32, 1.275);
opacity: 1;
max-height: 100%;
padding: 15px;
margin-top: 10px;
}
.alertify-notifier .ajs-message.ajs-success {
background: rgba(91, 189, 114, 0.95);
}
.alertify-notifier .ajs-message.ajs-error {
background: rgba(217, 92, 92, 0.95);
}
.alertify-notifier .ajs-message.ajs-warning {
background: rgba(252, 248, 215, 0.95);
}
.alertify-notifier .ajs-message .ajs-close {
position: absolute;
top: 0;
left: 0;
width: 16px;
height: 16px;
cursor: pointer;
background-image: url(data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAAgAAAAICAYAAADED76LAAAABGdBTUEAALGPC/xhBQAAAFBJREFUGBl1j0EKADEIA+ve/P9f9bh1hEihNBfjVCO1v7RKVqJK4h8gM5cAPR42AkQEpSXPwMTyoi13n5N9YqJehm3Fnr7nL1D0ZEbD5OubGyC7a9gx+9eNAAAAAElFTkSuQmCC);
background-repeat: no-repeat;
background-position: center center;
background-color: rgba(0, 0, 0, 0.5);
border-top-left-radius: 2px;
}
.alertify-notifier.ajs-top {
top: 10px;
}
.alertify-notifier.ajs-bottom {
bottom: 10px;
}
.alertify-notifier.ajs-right {
left: 10px;
}
.alertify-notifier.ajs-right .ajs-message {
left: -320px;
}
.alertify-notifier.ajs-right .ajs-message.ajs-visible {
left: 290px;
}
.alertify-notifier.ajs-left {
right: 10px;
}
.alertify-notifier.ajs-left .ajs-message {
right: -300px;
}
.alertify-notifier.ajs-left .ajs-message.ajs-visible {
right: 0;
}
.alertify-notifier.ajs-center {
right: 50%;
}
.alertify-notifier.ajs-center .ajs-message {
-webkit-transform: translateX(50%);
transform: translateX(50%);
}
.alertify-notifier.ajs-center .ajs-message.ajs-visible {
right: 50%;
-webkit-transition-timing-function: cubic-bezier(0.57, 0.43, 0.1, 0.65);
transition-timing-function: cubic-bezier(0.57, 0.43, 0.1, 0.65);
}
.alertify-notifier.ajs-center.ajs-top .ajs-message {
top: -300px;
}
.alertify-notifier.ajs-center.ajs-top .ajs-message.ajs-visible {
top: 0;
}
.alertify-notifier.ajs-center.ajs-bottom .ajs-message {
bottom: -300px;
}
.alertify-notifier.ajs-center.ajs-bottom .ajs-message.ajs-visible {
bottom: 0;
}
.ajs-no-transition.alertify .ajs-dimmer,
.ajs-no-transition.alertify .ajs-modal,
.ajs-no-transition.alertify .ajs-dialog {
-webkit-transition: none!important;
transition: none!important;
-webkit-animation: none!important;
animation: none!important;
}
.ajs-no-transition.alertify-notifier .ajs-message {
-webkit-transition: none!important;
transition: none!important;
-webkit-animation: none!important;
animation: none!important;
}
@media (prefers-reduced-motion: reduce) {
.alertify .ajs-dimmer,
.alertify .ajs-modal,
.alertify .ajs-dialog {
-webkit-transition: none!important;
transition: none!important;
-webkit-animation: none!important;
animation: none!important;
}
.alertify-notifier .ajs-message {
-webkit-transition: none!important;
transition: none!important;
-webkit-animation: none!important;
animation: none!important;
}
}

File diff suppressed because one or more lines are too long

View File

@@ -0,0 +1,61 @@
/**
* alertifyjs 1.14.0 http://alertifyjs.com
* AlertifyJS is a javascript framework for developing pretty browser dialogs and notifications.
* Copyright 2024 Mohammad Younes <Mohammad@alertifyjs.com> (http://alertifyjs.com)
* Licensed under GPL 3 <https://opensource.org/licenses/gpl-3.0>*/
.alertify .ajs-dimmer {
background-color: #000;
opacity: 0.5;
}
.alertify .ajs-dialog {
max-width: 600px;
min-height: 122px;
background-color: #fff;
border: 1px solid rgba(0, 0, 0, 0.2);
-webkit-box-shadow: 0 5px 15px rgba(0, 0, 0, 0.5);
box-shadow: 0 5px 15px rgba(0, 0, 0, 0.5);
border-radius: 6px;
}
.alertify .ajs-header {
color: #333;
border-bottom: 1px solid #e5e5e5;
border-radius: 6px 6px 0 0;
font-family: "Helvetica Neue", Helvetica, Arial, sans-serif;
font-size: 18px;
}
.alertify .ajs-body {
font-family: 'Roboto', sans-serif;
color: black;
}
.alertify.ajs-resizable .ajs-content,
.alertify.ajs-maximized:not(.ajs-resizable) .ajs-content {
top: 58px;
bottom: 68px;
}
.alertify .ajs-footer {
background-color: #fff;
padding: 15px;
border-top: 1px solid #e5e5e5;
border-radius: 0 0 6px 6px;
}
.alertify-notifier .ajs-message {
background: rgba(255, 255, 255, 0.95);
color: #000;
text-align: center;
border: solid 1px #ddd;
border-radius: 2px;
}
.alertify-notifier .ajs-message.ajs-success {
color: #fff;
background: rgba(91, 189, 114, 0.95);
text-shadow: -1px -1px 0 rgba(0, 0, 0, 0.5);
}
.alertify-notifier .ajs-message.ajs-error {
color: #fff;
background: rgba(217, 92, 92, 0.95);
text-shadow: -1px -1px 0 rgba(0, 0, 0, 0.5);
}
.alertify-notifier .ajs-message.ajs-warning {
background: rgba(252, 248, 215, 0.95);
border-color: #999;
}

View File

@@ -0,0 +1,6 @@
/**
* alertifyjs 1.14.0 http://alertifyjs.com
* AlertifyJS is a javascript framework for developing pretty browser dialogs and notifications.
* Copyright 2024 Mohammad Younes <Mohammad@alertifyjs.com> (http://alertifyjs.com)
* Licensed under GPL 3 <https://opensource.org/licenses/gpl-3.0>*/
.alertify .ajs-dimmer{background-color:#000;opacity:.5}.alertify .ajs-dialog{max-width:600px;min-height:122px;background-color:#fff;border:1px solid rgba(0,0,0,.2);-webkit-box-shadow:0 5px 15px rgba(0,0,0,.5);box-shadow:0 5px 15px rgba(0,0,0,.5);border-radius:6px}.alertify .ajs-header{color:#333;border-bottom:1px solid #e5e5e5;border-radius:6px 6px 0 0;font-family:"Helvetica Neue",Helvetica,Arial,sans-serif;font-size:18px}.alertify .ajs-body{font-family:Roboto,sans-serif;color:#000}.alertify.ajs-maximized:not(.ajs-resizable) .ajs-content,.alertify.ajs-resizable .ajs-content{top:58px;bottom:68px}.alertify .ajs-footer{background-color:#fff;padding:15px;border-top:1px solid #e5e5e5;border-radius:0 0 6px 6px}.alertify-notifier .ajs-message{background:rgba(255,255,255,.95);color:#000;text-align:center;border:solid 1px #ddd;border-radius:2px}.alertify-notifier .ajs-message.ajs-success{color:#fff;background:rgba(91,189,114,.95);text-shadow:-1px -1px 0 rgba(0,0,0,.5)}.alertify-notifier .ajs-message.ajs-error{color:#fff;background:rgba(217,92,92,.95);text-shadow:-1px -1px 0 rgba(0,0,0,.5)}.alertify-notifier .ajs-message.ajs-warning{background:rgba(252,248,215,.95);border-color:#999}

View File

@@ -0,0 +1,61 @@
/**
* alertifyjs 1.14.0 http://alertifyjs.com
* AlertifyJS is a javascript framework for developing pretty browser dialogs and notifications.
* Copyright 2024 Mohammad Younes <Mohammad@alertifyjs.com> (http://alertifyjs.com)
* Licensed under GPL 3 <https://opensource.org/licenses/gpl-3.0>*/
.alertify .ajs-dimmer {
background-color: #000;
opacity: 0.5;
}
.alertify .ajs-dialog {
max-width: 600px;
min-height: 122px;
background-color: #fff;
border: 1px solid rgba(0, 0, 0, 0.2);
-webkit-box-shadow: 0 5px 15px rgba(0, 0, 0, 0.5);
box-shadow: 0 5px 15px rgba(0, 0, 0, 0.5);
border-radius: 6px;
}
.alertify .ajs-header {
color: #333;
border-bottom: 1px solid #e5e5e5;
border-radius: 6px 6px 0 0;
font-family: "Helvetica Neue", Helvetica, Arial, sans-serif;
font-size: 18px;
}
.alertify .ajs-body {
font-family: 'Roboto', sans-serif;
color: black;
}
.alertify.ajs-resizable .ajs-content,
.alertify.ajs-maximized:not(.ajs-resizable) .ajs-content {
top: 58px;
bottom: 68px;
}
.alertify .ajs-footer {
background-color: #fff;
padding: 15px;
border-top: 1px solid #e5e5e5;
border-radius: 0 0 6px 6px;
}
.alertify-notifier .ajs-message {
background: rgba(255, 255, 255, 0.95);
color: #000;
text-align: center;
border: solid 1px #ddd;
border-radius: 2px;
}
.alertify-notifier .ajs-message.ajs-success {
color: #fff;
background: rgba(91, 189, 114, 0.95);
text-shadow: 1px -1px 0 rgba(0, 0, 0, 0.5);
}
.alertify-notifier .ajs-message.ajs-error {
color: #fff;
background: rgba(217, 92, 92, 0.95);
text-shadow: 1px -1px 0 rgba(0, 0, 0, 0.5);
}
.alertify-notifier .ajs-message.ajs-warning {
background: rgba(252, 248, 215, 0.95);
border-color: #999;
}

View File

@@ -0,0 +1,6 @@
/**
* alertifyjs 1.14.0 http://alertifyjs.com
* AlertifyJS is a javascript framework for developing pretty browser dialogs and notifications.
* Copyright 2024 Mohammad Younes <Mohammad@alertifyjs.com> (http://alertifyjs.com)
* Licensed under GPL 3 <https://opensource.org/licenses/gpl-3.0>*/
.alertify .ajs-dimmer{background-color:#000;opacity:.5}.alertify .ajs-dialog{max-width:600px;min-height:122px;background-color:#fff;border:1px solid rgba(0,0,0,.2);-webkit-box-shadow:0 5px 15px rgba(0,0,0,.5);box-shadow:0 5px 15px rgba(0,0,0,.5);border-radius:6px}.alertify .ajs-header{color:#333;border-bottom:1px solid #e5e5e5;border-radius:6px 6px 0 0;font-family:"Helvetica Neue",Helvetica,Arial,sans-serif;font-size:18px}.alertify .ajs-body{font-family:Roboto,sans-serif;color:#000}.alertify.ajs-maximized:not(.ajs-resizable) .ajs-content,.alertify.ajs-resizable .ajs-content{top:58px;bottom:68px}.alertify .ajs-footer{background-color:#fff;padding:15px;border-top:1px solid #e5e5e5;border-radius:0 0 6px 6px}.alertify-notifier .ajs-message{background:rgba(255,255,255,.95);color:#000;text-align:center;border:solid 1px #ddd;border-radius:2px}.alertify-notifier .ajs-message.ajs-success{color:#fff;background:rgba(91,189,114,.95);text-shadow:1px -1px 0 rgba(0,0,0,.5)}.alertify-notifier .ajs-message.ajs-error{color:#fff;background:rgba(217,92,92,.95);text-shadow:1px -1px 0 rgba(0,0,0,.5)}.alertify-notifier .ajs-message.ajs-warning{background:rgba(252,248,215,.95);border-color:#999}

View File

@@ -0,0 +1,69 @@
/**
* alertifyjs 1.14.0 http://alertifyjs.com
* AlertifyJS is a javascript framework for developing pretty browser dialogs and notifications.
* Copyright 2024 Mohammad Younes <Mohammad@alertifyjs.com> (http://alertifyjs.com)
* Licensed under GPL 3 <https://opensource.org/licenses/gpl-3.0>*/
.alertify .ajs-dialog {
background-color: white;
-webkit-box-shadow: 0px 15px 20px 0px rgba(0, 0, 0, 0.25);
box-shadow: 0px 15px 20px 0px rgba(0, 0, 0, 0.25);
border-radius: 2px;
}
.alertify .ajs-header {
color: black;
font-weight: bold;
background: #fafafa;
border-bottom: #eee 1px solid;
border-radius: 2px 2px 0 0;
}
.alertify .ajs-body {
color: black;
}
.alertify .ajs-body .ajs-content .ajs-input {
display: block;
width: 100%;
padding: 8px;
margin: 4px;
border-radius: 2px;
border: 1px solid #CCC;
}
.alertify .ajs-body .ajs-content p {
margin: 0;
}
.alertify .ajs-footer {
background: #fbfbfb;
border-top: #eee 1px solid;
border-radius: 0 0 2px 2px;
}
.alertify .ajs-footer .ajs-buttons .ajs-button {
background-color: transparent;
color: #000;
border: 0;
font-size: 14px;
font-weight: bold;
text-transform: uppercase;
}
.alertify .ajs-footer .ajs-buttons .ajs-button.ajs-ok {
color: #3593D2;
}
.alertify-notifier .ajs-message {
background: rgba(255, 255, 255, 0.95);
color: #000;
text-align: center;
border: solid 1px #ddd;
border-radius: 2px;
}
.alertify-notifier .ajs-message.ajs-success {
color: #fff;
background: rgba(91, 189, 114, 0.95);
text-shadow: -1px -1px 0 rgba(0, 0, 0, 0.5);
}
.alertify-notifier .ajs-message.ajs-error {
color: #fff;
background: rgba(217, 92, 92, 0.95);
text-shadow: -1px -1px 0 rgba(0, 0, 0, 0.5);
}
.alertify-notifier .ajs-message.ajs-warning {
background: rgba(252, 248, 215, 0.95);
border-color: #999;
}

View File

@@ -0,0 +1,6 @@
/**
* alertifyjs 1.14.0 http://alertifyjs.com
* AlertifyJS is a javascript framework for developing pretty browser dialogs and notifications.
* Copyright 2024 Mohammad Younes <Mohammad@alertifyjs.com> (http://alertifyjs.com)
* Licensed under GPL 3 <https://opensource.org/licenses/gpl-3.0>*/
.alertify .ajs-dialog{background-color:#fff;-webkit-box-shadow:0 15px 20px 0 rgba(0,0,0,.25);box-shadow:0 15px 20px 0 rgba(0,0,0,.25);border-radius:2px}.alertify .ajs-header{color:#000;font-weight:700;background:#fafafa;border-bottom:#eee 1px solid;border-radius:2px 2px 0 0}.alertify .ajs-body{color:#000}.alertify .ajs-body .ajs-content .ajs-input{display:block;width:100%;padding:8px;margin:4px;border-radius:2px;border:1px solid #ccc}.alertify .ajs-body .ajs-content p{margin:0}.alertify .ajs-footer{background:#fbfbfb;border-top:#eee 1px solid;border-radius:0 0 2px 2px}.alertify .ajs-footer .ajs-buttons .ajs-button{background-color:transparent;color:#000;border:0;font-size:14px;font-weight:700;text-transform:uppercase}.alertify .ajs-footer .ajs-buttons .ajs-button.ajs-ok{color:#3593d2}.alertify-notifier .ajs-message{background:rgba(255,255,255,.95);color:#000;text-align:center;border:solid 1px #ddd;border-radius:2px}.alertify-notifier .ajs-message.ajs-success{color:#fff;background:rgba(91,189,114,.95);text-shadow:-1px -1px 0 rgba(0,0,0,.5)}.alertify-notifier .ajs-message.ajs-error{color:#fff;background:rgba(217,92,92,.95);text-shadow:-1px -1px 0 rgba(0,0,0,.5)}.alertify-notifier .ajs-message.ajs-warning{background:rgba(252,248,215,.95);border-color:#999}

View File

@@ -0,0 +1,69 @@
/**
* alertifyjs 1.14.0 http://alertifyjs.com
* AlertifyJS is a javascript framework for developing pretty browser dialogs and notifications.
* Copyright 2024 Mohammad Younes <Mohammad@alertifyjs.com> (http://alertifyjs.com)
* Licensed under GPL 3 <https://opensource.org/licenses/gpl-3.0>*/
.alertify .ajs-dialog {
background-color: white;
-webkit-box-shadow: 0px 15px 20px 0px rgba(0, 0, 0, 0.25);
box-shadow: 0px 15px 20px 0px rgba(0, 0, 0, 0.25);
border-radius: 2px;
}
.alertify .ajs-header {
color: black;
font-weight: bold;
background: #fafafa;
border-bottom: #eee 1px solid;
border-radius: 2px 2px 0 0;
}
.alertify .ajs-body {
color: black;
}
.alertify .ajs-body .ajs-content .ajs-input {
display: block;
width: 100%;
padding: 8px;
margin: 4px;
border-radius: 2px;
border: 1px solid #CCC;
}
.alertify .ajs-body .ajs-content p {
margin: 0;
}
.alertify .ajs-footer {
background: #fbfbfb;
border-top: #eee 1px solid;
border-radius: 0 0 2px 2px;
}
.alertify .ajs-footer .ajs-buttons .ajs-button {
background-color: transparent;
color: #000;
border: 0;
font-size: 14px;
font-weight: bold;
text-transform: uppercase;
}
.alertify .ajs-footer .ajs-buttons .ajs-button.ajs-ok {
color: #3593D2;
}
.alertify-notifier .ajs-message {
background: rgba(255, 255, 255, 0.95);
color: #000;
text-align: center;
border: solid 1px #ddd;
border-radius: 2px;
}
.alertify-notifier .ajs-message.ajs-success {
color: #fff;
background: rgba(91, 189, 114, 0.95);
text-shadow: 1px -1px 0 rgba(0, 0, 0, 0.5);
}
.alertify-notifier .ajs-message.ajs-error {
color: #fff;
background: rgba(217, 92, 92, 0.95);
text-shadow: 1px -1px 0 rgba(0, 0, 0, 0.5);
}
.alertify-notifier .ajs-message.ajs-warning {
background: rgba(252, 248, 215, 0.95);
border-color: #999;
}

View File

@@ -0,0 +1,6 @@
/**
* alertifyjs 1.14.0 http://alertifyjs.com
* AlertifyJS is a javascript framework for developing pretty browser dialogs and notifications.
* Copyright 2024 Mohammad Younes <Mohammad@alertifyjs.com> (http://alertifyjs.com)
* Licensed under GPL 3 <https://opensource.org/licenses/gpl-3.0>*/
.alertify .ajs-dialog{background-color:#fff;-webkit-box-shadow:0 15px 20px 0 rgba(0,0,0,.25);box-shadow:0 15px 20px 0 rgba(0,0,0,.25);border-radius:2px}.alertify .ajs-header{color:#000;font-weight:700;background:#fafafa;border-bottom:#eee 1px solid;border-radius:2px 2px 0 0}.alertify .ajs-body{color:#000}.alertify .ajs-body .ajs-content .ajs-input{display:block;width:100%;padding:8px;margin:4px;border-radius:2px;border:1px solid #ccc}.alertify .ajs-body .ajs-content p{margin:0}.alertify .ajs-footer{background:#fbfbfb;border-top:#eee 1px solid;border-radius:0 0 2px 2px}.alertify .ajs-footer .ajs-buttons .ajs-button{background-color:transparent;color:#000;border:0;font-size:14px;font-weight:700;text-transform:uppercase}.alertify .ajs-footer .ajs-buttons .ajs-button.ajs-ok{color:#3593d2}.alertify-notifier .ajs-message{background:rgba(255,255,255,.95);color:#000;text-align:center;border:solid 1px #ddd;border-radius:2px}.alertify-notifier .ajs-message.ajs-success{color:#fff;background:rgba(91,189,114,.95);text-shadow:1px -1px 0 rgba(0,0,0,.5)}.alertify-notifier .ajs-message.ajs-error{color:#fff;background:rgba(217,92,92,.95);text-shadow:1px -1px 0 rgba(0,0,0,.5)}.alertify-notifier .ajs-message.ajs-warning{background:rgba(252,248,215,.95);border-color:#999}

View File

@@ -0,0 +1,89 @@
/**
* alertifyjs 1.14.0 http://alertifyjs.com
* AlertifyJS is a javascript framework for developing pretty browser dialogs and notifications.
* Copyright 2024 Mohammad Younes <Mohammad@alertifyjs.com> (http://alertifyjs.com)
* Licensed under GPL 3 <https://opensource.org/licenses/gpl-3.0>*/
.alertify .ajs-dimmer {
background-color: rgba(0, 0, 0, 0.85);
opacity: 1;
}
.alertify .ajs-dialog {
max-width: 50%;
min-height: 137px;
background-color: #F4F4F4;
border: 1px solid #DDD;
-webkit-box-shadow: none;
box-shadow: none;
border-radius: 5px;
}
.alertify .ajs-header {
padding: 1.5rem 2rem;
border-bottom: none;
border-radius: 5px 5px 0 0;
color: #555;
background-color: #fff;
font-family: "Helvetica Neue", Helvetica, Arial, sans-serif;
font-size: 1.6em;
font-weight: 700;
}
.alertify .ajs-body {
font-family: 'Roboto', sans-serif;
color: #555;
}
.alertify .ajs-body .ajs-content .ajs-input {
width: 100%;
margin: 0;
padding: 0.65em 1em;
font-size: 1em;
background-color: #FFF;
border: 1px solid rgba(0, 0, 0, 0.15);
outline: 0;
color: rgba(0, 0, 0, 0.7);
border-radius: 0.3125em;
-webkit-transition: background-color 0.3s ease-out, border-color 0.2s ease, -webkit-box-shadow 0.2s ease;
transition: background-color 0.3s ease-out, border-color 0.2s ease, -webkit-box-shadow 0.2s ease;
transition: background-color 0.3s ease-out, box-shadow 0.2s ease, border-color 0.2s ease;
transition: background-color 0.3s ease-out, box-shadow 0.2s ease, border-color 0.2s ease, -webkit-box-shadow 0.2s ease;
-webkit-box-sizing: border-box;
box-sizing: border-box;
}
.alertify .ajs-body .ajs-content .ajs-input:active {
border-color: rgba(0, 0, 0, 0.3);
background-color: #FAFAFA;
}
.alertify .ajs-body .ajs-content .ajs-input:focus {
border-color: rgba(0, 0, 0, 0.2);
color: rgba(0, 0, 0, 0.85);
}
.alertify.ajs-resizable .ajs-content,
.alertify.ajs-maximized:not(.ajs-resizable) .ajs-content {
top: 64px;
bottom: 74px;
}
.alertify .ajs-footer {
background-color: #fff;
padding: 1rem 2rem;
border-top: none;
border-radius: 0 0 5px 5px;
}
.alertify-notifier .ajs-message {
background: rgba(255, 255, 255, 0.95);
color: #000;
text-align: center;
border: solid 1px #ddd;
border-radius: 2px;
}
.alertify-notifier .ajs-message.ajs-success {
color: #fff;
background: rgba(91, 189, 114, 0.95);
text-shadow: -1px -1px 0 rgba(0, 0, 0, 0.5);
}
.alertify-notifier .ajs-message.ajs-error {
color: #fff;
background: rgba(217, 92, 92, 0.95);
text-shadow: -1px -1px 0 rgba(0, 0, 0, 0.5);
}
.alertify-notifier .ajs-message.ajs-warning {
background: rgba(252, 248, 215, 0.95);
border-color: #999;
}

View File

@@ -0,0 +1,6 @@
/**
* alertifyjs 1.14.0 http://alertifyjs.com
* AlertifyJS is a javascript framework for developing pretty browser dialogs and notifications.
* Copyright 2024 Mohammad Younes <Mohammad@alertifyjs.com> (http://alertifyjs.com)
* Licensed under GPL 3 <https://opensource.org/licenses/gpl-3.0>*/
.alertify .ajs-dimmer{background-color:rgba(0,0,0,.85);opacity:1}.alertify .ajs-dialog{max-width:50%;min-height:137px;background-color:#f4f4f4;border:1px solid #ddd;-webkit-box-shadow:none;box-shadow:none;border-radius:5px}.alertify .ajs-header{padding:1.5rem 2rem;border-bottom:none;border-radius:5px 5px 0 0;color:#555;background-color:#fff;font-family:"Helvetica Neue",Helvetica,Arial,sans-serif;font-size:1.6em;font-weight:700}.alertify .ajs-body{font-family:Roboto,sans-serif;color:#555}.alertify .ajs-body .ajs-content .ajs-input{width:100%;margin:0;padding:.65em 1em;font-size:1em;background-color:#fff;border:1px solid rgba(0,0,0,.15);outline:0;color:rgba(0,0,0,.7);border-radius:.3125em;-webkit-transition:background-color .3s ease-out,border-color .2s ease,-webkit-box-shadow .2s ease;transition:background-color .3s ease-out,border-color .2s ease,-webkit-box-shadow .2s ease;transition:background-color .3s ease-out,box-shadow .2s ease,border-color .2s ease;transition:background-color .3s ease-out,box-shadow .2s ease,border-color .2s ease,-webkit-box-shadow .2s ease;-webkit-box-sizing:border-box;box-sizing:border-box}.alertify .ajs-body .ajs-content .ajs-input:active{border-color:rgba(0,0,0,.3);background-color:#fafafa}.alertify .ajs-body .ajs-content .ajs-input:focus{border-color:rgba(0,0,0,.2);color:rgba(0,0,0,.85)}.alertify.ajs-maximized:not(.ajs-resizable) .ajs-content,.alertify.ajs-resizable .ajs-content{top:64px;bottom:74px}.alertify .ajs-footer{background-color:#fff;padding:1rem 2rem;border-top:none;border-radius:0 0 5px 5px}.alertify-notifier .ajs-message{background:rgba(255,255,255,.95);color:#000;text-align:center;border:solid 1px #ddd;border-radius:2px}.alertify-notifier .ajs-message.ajs-success{color:#fff;background:rgba(91,189,114,.95);text-shadow:-1px -1px 0 rgba(0,0,0,.5)}.alertify-notifier .ajs-message.ajs-error{color:#fff;background:rgba(217,92,92,.95);text-shadow:-1px -1px 0 rgba(0,0,0,.5)}.alertify-notifier .ajs-message.ajs-warning{background:rgba(252,248,215,.95);border-color:#999}

View File

@@ -0,0 +1,89 @@
/**
* alertifyjs 1.14.0 http://alertifyjs.com
* AlertifyJS is a javascript framework for developing pretty browser dialogs and notifications.
* Copyright 2024 Mohammad Younes <Mohammad@alertifyjs.com> (http://alertifyjs.com)
* Licensed under GPL 3 <https://opensource.org/licenses/gpl-3.0>*/
.alertify .ajs-dimmer {
background-color: rgba(0, 0, 0, 0.85);
opacity: 1;
}
.alertify .ajs-dialog {
max-width: 50%;
min-height: 137px;
background-color: #F4F4F4;
border: 1px solid #DDD;
-webkit-box-shadow: none;
box-shadow: none;
border-radius: 5px;
}
.alertify .ajs-header {
padding: 1.5rem 2rem;
border-bottom: none;
border-radius: 5px 5px 0 0;
color: #555;
background-color: #fff;
font-family: "Helvetica Neue", Helvetica, Arial, sans-serif;
font-size: 1.6em;
font-weight: 700;
}
.alertify .ajs-body {
font-family: 'Roboto', sans-serif;
color: #555;
}
.alertify .ajs-body .ajs-content .ajs-input {
width: 100%;
margin: 0;
padding: 0.65em 1em;
font-size: 1em;
background-color: #FFF;
border: 1px solid rgba(0, 0, 0, 0.15);
outline: 0;
color: rgba(0, 0, 0, 0.7);
border-radius: 0.3125em;
-webkit-transition: background-color 0.3s ease-out, border-color 0.2s ease, -webkit-box-shadow 0.2s ease;
transition: background-color 0.3s ease-out, border-color 0.2s ease, -webkit-box-shadow 0.2s ease;
transition: background-color 0.3s ease-out, box-shadow 0.2s ease, border-color 0.2s ease;
transition: background-color 0.3s ease-out, box-shadow 0.2s ease, border-color 0.2s ease, -webkit-box-shadow 0.2s ease;
-webkit-box-sizing: border-box;
box-sizing: border-box;
}
.alertify .ajs-body .ajs-content .ajs-input:active {
border-color: rgba(0, 0, 0, 0.3);
background-color: #FAFAFA;
}
.alertify .ajs-body .ajs-content .ajs-input:focus {
border-color: rgba(0, 0, 0, 0.2);
color: rgba(0, 0, 0, 0.85);
}
.alertify.ajs-resizable .ajs-content,
.alertify.ajs-maximized:not(.ajs-resizable) .ajs-content {
top: 64px;
bottom: 74px;
}
.alertify .ajs-footer {
background-color: #fff;
padding: 1rem 2rem;
border-top: none;
border-radius: 0 0 5px 5px;
}
.alertify-notifier .ajs-message {
background: rgba(255, 255, 255, 0.95);
color: #000;
text-align: center;
border: solid 1px #ddd;
border-radius: 2px;
}
.alertify-notifier .ajs-message.ajs-success {
color: #fff;
background: rgba(91, 189, 114, 0.95);
text-shadow: 1px -1px 0 rgba(0, 0, 0, 0.5);
}
.alertify-notifier .ajs-message.ajs-error {
color: #fff;
background: rgba(217, 92, 92, 0.95);
text-shadow: 1px -1px 0 rgba(0, 0, 0, 0.5);
}
.alertify-notifier .ajs-message.ajs-warning {
background: rgba(252, 248, 215, 0.95);
border-color: #999;
}

View File

@@ -0,0 +1,6 @@
/**
* alertifyjs 1.14.0 http://alertifyjs.com
* AlertifyJS is a javascript framework for developing pretty browser dialogs and notifications.
* Copyright 2024 Mohammad Younes <Mohammad@alertifyjs.com> (http://alertifyjs.com)
* Licensed under GPL 3 <https://opensource.org/licenses/gpl-3.0>*/
.alertify .ajs-dimmer{background-color:rgba(0,0,0,.85);opacity:1}.alertify .ajs-dialog{max-width:50%;min-height:137px;background-color:#f4f4f4;border:1px solid #ddd;-webkit-box-shadow:none;box-shadow:none;border-radius:5px}.alertify .ajs-header{padding:1.5rem 2rem;border-bottom:none;border-radius:5px 5px 0 0;color:#555;background-color:#fff;font-family:"Helvetica Neue",Helvetica,Arial,sans-serif;font-size:1.6em;font-weight:700}.alertify .ajs-body{font-family:Roboto,sans-serif;color:#555}.alertify .ajs-body .ajs-content .ajs-input{width:100%;margin:0;padding:.65em 1em;font-size:1em;background-color:#fff;border:1px solid rgba(0,0,0,.15);outline:0;color:rgba(0,0,0,.7);border-radius:.3125em;-webkit-transition:background-color .3s ease-out,border-color .2s ease,-webkit-box-shadow .2s ease;transition:background-color .3s ease-out,border-color .2s ease,-webkit-box-shadow .2s ease;transition:background-color .3s ease-out,box-shadow .2s ease,border-color .2s ease;transition:background-color .3s ease-out,box-shadow .2s ease,border-color .2s ease,-webkit-box-shadow .2s ease;-webkit-box-sizing:border-box;box-sizing:border-box}.alertify .ajs-body .ajs-content .ajs-input:active{border-color:rgba(0,0,0,.3);background-color:#fafafa}.alertify .ajs-body .ajs-content .ajs-input:focus{border-color:rgba(0,0,0,.2);color:rgba(0,0,0,.85)}.alertify.ajs-maximized:not(.ajs-resizable) .ajs-content,.alertify.ajs-resizable .ajs-content{top:64px;bottom:74px}.alertify .ajs-footer{background-color:#fff;padding:1rem 2rem;border-top:none;border-radius:0 0 5px 5px}.alertify-notifier .ajs-message{background:rgba(255,255,255,.95);color:#000;text-align:center;border:solid 1px #ddd;border-radius:2px}.alertify-notifier .ajs-message.ajs-success{color:#fff;background:rgba(91,189,114,.95);text-shadow:1px -1px 0 rgba(0,0,0,.5)}.alertify-notifier .ajs-message.ajs-error{color:#fff;background:rgba(217,92,92,.95);text-shadow:1px -1px 0 rgba(0,0,0,.5)}.alertify-notifier .ajs-message.ajs-warning{background:rgba(252,248,215,.95);border-color:#999}

View File

@@ -0,0 +1,49 @@
const libName = "awn"
const prefix = {
popup: `${libName}-popup`,
toast: `${libName}-toast`,
btn: `${libName}-btn`,
confirm: `${libName}-confirm`
}
// Constants for toasts
export const tConsts = {
prefix: prefix.toast,
klass: {
label: `${prefix.toast}-label`,
content: `${prefix.toast}-content`,
icon: `${prefix.toast}-icon`,
progressBar: `${prefix.toast}-progress-bar`,
progressBarPause: `${prefix.toast}-progress-bar-paused`
},
ids: {
container: `${prefix.toast}-container`
}
}
// Constants for popups
export const mConsts = {
prefix: prefix.popup,
klass: {
buttons: `${libName}-buttons`,
button: prefix.btn,
successBtn: `${prefix.btn}-success`,
cancelBtn: `${prefix.btn}-cancel`,
title: `${prefix.popup}-title`,
body: `${prefix.popup}-body`,
content: `${prefix.popup}-content`,
dotAnimation: `${prefix.popup}-loading-dots`
},
ids: {
wrapper: `${prefix.popup}-wrapper`,
confirmOk: `${prefix.confirm}-ok`,
confirmCancel: `${prefix.confirm}-cancel`
}
}
export const eConsts = {
klass: {
hiding: `${libName}-hiding`
},
lib: libName
}

View File

@@ -0,0 +1,75 @@
import {
eConsts
} from "./constants.js"
import {global} from '../../js/module/variable.js'
export default class {
constructor(parent, id, klass, style, options) {
this.newNode = document.createElement('div')
if (id) this.newNode.id = id
if (klass) this.newNode.className = klass
if (style) this.newNode.style.cssText = style
this.parent = parent
this.options = options
}
beforeInsert() {}
afterInsert() {}
insert() {
this.beforeInsert()
this.el = this.parent.appendChild(this.newNode)
this.afterInsert()
return this
}
replace(el) {
if (!this.getElement()) return
return this.beforeDelete().then(() => {
this.updateType(el.type)
this.parent.replaceChild(el.newNode, this.el)
this.el = this.getElement(el.newNode)
this.afterInsert()
return this
})
}
beforeDelete(el = this.el) {
let timeLeft = 0
if (this.start) {
timeLeft = this.options.minDurations[this.type] + this.start - Date.now()
if (timeLeft < 0) timeLeft = 0
}
return new Promise(resolve => {
setTimeout(() => {
el.classList.add(eConsts.klass.hiding)
setTimeout(resolve, this.options.animationDuration)
}, timeLeft)
})
}
delete(el = this.el) {
if (!this.getElement(el)) return null
return this.beforeDelete(el).then(() => {
el.remove()
this.afterDelete()
})
}
afterDelete() {}
getElement(el = this.el) {
if (!el) return null
return global.shadowRoot.getElementById(el.id)
}
addEvent(name, func) {
this.el.addEventListener(name, func)
}
toggleClass(klass) {
this.el.classList.toggle(klass)
}
updateType(type) {
this.type = type
this.duration = this.options.duration(this.type)
}
}

View File

@@ -0,0 +1,107 @@
import Options from "./options.js"
import Toast from "./toast.js"
import Popup from "./popup.js"
import Elem from "./elem.js"
import {global} from '../../js/module/variable.js'
import {
tConsts
} from "./constants.js"
export default class Notifier {
constructor(options = {}) {
this.options = new Options(options)
}
tip(msg, options) {
return this._addToast(msg, "tip", options).el
}
info(msg, options) {
return this._addToast(msg, "info", options).el
}
success(msg, options) {
return this._addToast(msg, "success", options).el
}
warning(msg, options) {
return this._addToast(msg, "warning", options).el
}
alert(msg, options) {
return this._addToast(msg, "alert", options).el
}
async (promise, onResolve, onReject, msg, options) {
let asyncToast = this._addToast(msg, "async", options)
return this._afterAsync(promise, onResolve, onReject, options, asyncToast)
}
confirm(msg, onOk, onCancel, options) {
return this._addPopup(msg, "confirm", options, onOk, onCancel)
}
asyncBlock(promise, onResolve, onReject, msg, options) {
let asyncBlock = this._addPopup(msg, "async-block", options)
return this._afterAsync(promise, onResolve, onReject, options, asyncBlock)
}
modal(msg, className, options) {
return this._addPopup(msg, className, options)
}
closeToasts() {
let c = this.container
while (c.firstChild) {
c.removeChild(c.firstChild)
}
}
// Tools
_addPopup(msg, className, options, onOk, onCancel) {
return new Popup(msg, className, this.options.override(options), onOk, onCancel)
}
_addToast(msg, type, options, old) {
options = this.options.override(options)
let newToast = new Toast(msg, type, options, this.container)
if (old) {
if (old instanceof Popup) return old.delete().then(() => newToast.insert())
let i = old.replace(newToast)
return i
}
return newToast.insert()
}
_afterAsync(promise, onResolve, onReject, options, oldElement) {
return promise.then(
this._responseHandler(onResolve, "success", options, oldElement),
this._responseHandler(onReject, "alert", options, oldElement)
)
}
_responseHandler(payload, toastName, options, oldElement) {
return result => {
switch (typeof payload) {
case 'undefined':
case 'string':
let msg = toastName === 'alert' ? payload || result : payload
this._addToast(msg, toastName, options, oldElement)
break
default:
oldElement.delete().then(() => {
if (payload) payload(result)
})
}
}
}
_createContainer() {
return new Elem(global.shadowRoot, tConsts.ids.container, `awn-${this.options.position}`).insert().el
}
get container() {
return global.shadowRoot.getElementById(tConsts.ids.container) || this._createContainer()
}
}

View File

@@ -0,0 +1 @@
module.exports = require("./index.js").default

View File

@@ -0,0 +1,129 @@
const defaults = {
maxNotifications: 10,
animationDuration: 300,
position: "bottom-right",
labels: {
tip: "Tip",
info: "Info",
success: "Success",
warning: "Attention",
alert: "Error",
async: "Loading",
confirm: "Confirmation required",
confirmOk: "OK",
confirmCancel: "Cancel"
},
icons: {
tip: "question-circle",
info: "info-circle",
success: "check-circle",
warning: "exclamation-circle",
alert: "exclamation-triangle",
async: "cog fa-spin",
confirm: "exclamation-triangle",
prefix: "<i class='fa fas fa-fw fa-",
suffix: "'></i>",
enabled: true
},
replacements: {
tip: null,
info: null,
success: null,
warning: null,
alert: null,
async: null,
"async-block": null,
modal: null,
confirm: null,
general: {
"<script>": "",
"</script>": ""
}
},
messages: {
tip: "",
info: "",
success: "Action has been succeeded",
warning: "",
alert: "Action has been failed",
confirm: "This action can't be undone. Continue?",
async: "Please, wait...",
"async-block": "Loading"
},
formatError(err) {
if (err.response) {
if (!err.response.data) return '500 API Server Error'
if (err.response.data.errors) {
return err.response.data.errors.map(o => o.detail).join('<br>')
}
if (err.response.statusText) {
return `${err.response.status} ${err.response.statusText}: ${err.response.data}`
}
}
if (err.message) return err.message
return err
},
durations: {
global: 5000,
success: null,
info: null,
tip: null,
warning: null,
alert: null
},
minDurations: {
async: 1000,
"async-block": 1000
},
}
export default class Options {
constructor(options = {}, global = defaults) {
Object.assign(this, this.defaultsDeep(global, options))
}
icon(type) {
if (this.icons.enabled) return `${this.icons.prefix}${this.icons[type]}${this.icons.suffix}`
return ''
}
label(type) {
return this.labels[type]
}
duration(type) {
let duration = this.durations[type]
return duration === null ? this.durations.global : duration
}
toSecs(value) {
return `${value / 1000}s`
}
applyReplacements(str, type) {
if (!str) return this.messages[type] || ""
for (const n of ['general', type]) {
if (!this.replacements[n]) continue
for (const k in this.replacements[n]) {
str = str.replace(k, this.replacements[n][k])
}
}
return str
}
override(options) {
if (options) return new Options(options, this)
return this
}
defaultsDeep(defaults, overrides) {
let result = {}
for (const k in defaults) {
if (overrides.hasOwnProperty(k)) {
result[k] = typeof defaults[k] === "object" && defaults[k] !== null ? this.defaultsDeep(defaults[k], overrides[k]) : overrides[k]
} else {
result[k] = defaults[k]
}
}
return result
}
}

View File

@@ -0,0 +1,86 @@
import Elem from "./elem.js"
import {
mConsts
} from "./constants.js"
import {global} from '../../js/module/variable.js'
export default class extends Elem {
constructor(msg, type = 'modal', options, onOk, onCancel) {
let animationDuration = `animation-duration: ${options.toSecs(options.animationDuration)};`
super(document.body, mConsts.ids.wrapper, null, animationDuration, options)
this[mConsts.ids.confirmOk] = onOk
this[mConsts.ids.confirmCancel] = onCancel
this.className = `${mConsts.prefix}-${type}`
if (!['confirm', 'async-block', 'modal'].includes(type)) type = 'modal'
this.updateType(type)
this.setInnerHtml(msg)
this.insert()
}
setInnerHtml(html) {
let innerHTML = this.options.applyReplacements(html, this.type)
switch (this.type) {
case "confirm":
let buttons = [`<button class='${mConsts.klass.button} ${mConsts.klass.successBtn}'id='${mConsts.ids.confirmOk}'>${this.options.labels.confirmOk}</button>`]
if (this[mConsts.ids.confirmCancel] !== false) {
buttons.push(`<button class='${mConsts.klass.button} ${mConsts.klass.cancelBtn}'id='${mConsts.ids.confirmCancel}'>${this.options.labels.confirmCancel}</button>`)
}
innerHTML = `${this.options.icon(this.type)}<div class='${mConsts.klass.title}'>${this.options.label(this.type)}</div><div class="${mConsts.klass.content}">${innerHTML}</div><div class='${mConsts.klass.buttons} ${mConsts.klass.buttons}-${buttons.length}'>${buttons.join('')}</div>`
break
case "async-block":
innerHTML = `${innerHTML}<div class="${mConsts.klass.dotAnimation}"></div>`
}
this.newNode.innerHTML = `<div class="${mConsts.klass.body} ${this.className}">${innerHTML}</div>`
}
keyupListener(e) {
if (this.type === 'async-block') return e.preventDefault()
switch (e.code) {
case 'Escape':
e.preventDefault()
this.delete()
case 'Tab':
e.preventDefault()
if (this.type !== 'confirm' || this[mConsts.ids.confirmCancel] === false) return true
let next = this.okBtn
if (e.shiftKey) {
if (document.activeElement.id == mConsts.ids.confirmOk) next = this.cancelBtn
} else if (document.activeElement.id !== mConsts.ids.confirmCancel) next = this.cancelBtn
next.focus()
}
}
afterInsert() {
this.listener = e => this.keyupListener(e)
window.addEventListener("keydown", this.listener)
switch (this.type) {
case 'async-block':
this.start = Date.now()
break
case 'confirm':
this.okBtn.focus()
this.addEvent("click", e => {
if (e.target.nodeName !== "BUTTON") return false
this.delete()
if (this[e.target.id]) this[e.target.id]()
})
break
default:
document.activeElement.blur()
this.addEvent("click", e => {
if (e.target.id === this.newNode.id) this.delete()
})
}
}
afterDelete() {
window.removeEventListener("keydown", this.listener)
}
get okBtn() {
return document.getElementById(mConsts.ids.confirmOk)
}
get cancelBtn() {
return document.getElementById(mConsts.ids.confirmCancel)
}
}

View File

@@ -0,0 +1,374 @@
@keyframes awn-fade-in {
0% {
opacity: 0
}
to {
opacity: 1
}
}
@keyframes awn-fade-out {
0% {
opacity: 1
}
to {
opacity: 0
}
}
@keyframes awn-slide-right {
0% {
left: 100%;
opacity: 0
}
to {
left: 0;
opacity: 1
}
}
@keyframes awn-slide-left {
0% {
opacity: 0;
right: 100%
}
to {
opacity: 1;
right: 0
}
}
@keyframes awn-bar {
0% {
right: 100%
}
to {
right: 0
}
}
.awn-popup-loading-dots, .awn-popup-loading-dots:after, .awn-popup-loading-dots:before {
animation-fill-mode: both;
animation: awn-loading-dots 1s ease-in-out infinite;
background: #fff;
border-radius: 50%;
height: 6px;
width: 6px
}
.awn-popup-loading-dots {
animation-delay: -.16s;
color: #fff;
display: inline-block;
margin-left: 24px;
position: relative
}
.awn-popup-loading-dots:after, .awn-popup-loading-dots:before {
content: "";
position: absolute;
top: 0
}
.awn-popup-loading-dots:before {
animation-delay: -.32s;
left: -16px
}
.awn-popup-loading-dots:after {
left: 16px
}
@keyframes awn-loading-dots {
0%, 80%, to {
box-shadow: 0 0 0 0
}
40% {
box-shadow: 0 0 0 2px
}
}
#awn-popup-wrapper {
align-items: center;
animation-fill-mode: both;
animation-name: awn-fade-in;
animation-timing-function: ease-out;
background: rgba(0, 0, 0, .7);
bottom: 0;
display: flex;
justify-content: center;
left: 0;
opacity: 0;
position: fixed;
right: 0;
top: 0;
z-index: 99999
}
#awn-popup-wrapper.awn-hiding {
animation-name: awn-fade-out
}
#awn-popup-wrapper .awn-popup-body {
background: #fff;
border-radius: 6px;
font-size: 14px;
max-width: 500px;
min-width: 320px;
padding: 24px;
position: relative;
word-break: break-word
}
#awn-popup-wrapper .awn-popup-body.awn-popup-confirm {
align-items: center;
display: flex;
flex-direction: column
}
#awn-popup-wrapper .awn-popup-body.awn-popup-confirm .fa {
color: #c26700;
font-size: 44px
}
#awn-popup-wrapper .awn-popup-body.awn-popup-async-block {
background: transparent;
color: #fff;
font-size: 32px;
font-weight: 700;
text-align: center
}
#awn-popup-wrapper .awn-popup-title {
font-size: 14px;
font-weight: 700;
margin-top: 8px;
text-transform: uppercase
}
#awn-popup-wrapper .awn-buttons {
display: flex;
justify-content: space-between;
margin-top: 24px;
width: 100%
}
#awn-popup-wrapper .awn-buttons .awn-btn {
border: 0;
border-radius: 4px;
color: #fff;
font-size: 14px;
font-weight: 700;
line-height: 32px;
transition: background .2s linear;
width: 45%
}
#awn-popup-wrapper .awn-buttons-1 .awn-btn {
width: 100%
}
#awn-popup-wrapper .awn-buttons .awn-btn-success {
background: #40871d
}
#awn-popup-wrapper .awn-buttons .awn-btn-success:hover {
background: #367218
}
#awn-popup-wrapper .awn-buttons .awn-btn-cancel {
background: #1c76a6
}
#awn-popup-wrapper .awn-buttons .awn-btn-cancel:hover {
background: #186690
}
#awn-toast-container {
bottom: 24px;
box-sizing: border-box;
position: fixed;
right: 24px;
z-index: 99998
}
#awn-toast-container.awn-top-left, #awn-toast-container.awn-top-right {
bottom: auto;
top: 24px
}
#awn-toast-container.awn-top-left .awn-toast:first-child, #awn-toast-container.awn-top-right .awn-toast:first-child {
margin-top: 16px
}
#awn-toast-container.awn-bottom-left, #awn-toast-container.awn-top-left {
left: 24px;
right: auto
}
#awn-toast-container.awn-bottom-left .awn-toast, #awn-toast-container.awn-top-left .awn-toast {
animation-name: awn-slide-left;
right: 100%
}
#awn-toast-container.awn-bottom-left .awn-toast.awn-hiding, #awn-toast-container.awn-top-left .awn-toast.awn-hiding {
right: 0
}
#awn-toast-container.awn-bottom-right .awn-toast, #awn-toast-container.awn-top-right .awn-toast {
animation-name: awn-slide-right;
left: 100%
}
#awn-toast-container.awn-bottom-right .awn-toast.awn-hiding, #awn-toast-container.awn-top-right .awn-toast.awn-hiding {
left: 0
}
.awn-toast {
animation-fill-mode: both;
animation-timing-function: linear;
background: #ebebeb;
border-radius: 6px;
color: gray;
cursor: pointer;
font-size: 14px;
margin-top: 16px;
opacity: 0;
overflow: hidden;
position: relative;
width: 320px
}
.awn-toast-content {
word-break: break-word
}
.awn-toast-label {
color: gray;
display: block;
font-size: 18px;
text-transform: uppercase
}
.awn-toast-icon {
align-items: center;
bottom: 0;
display: flex;
justify-content: flex-end;
position: absolute;
right: 16px;
top: 6px
}
.awn-toast-icon .fa {
color: gray;
font-size: 44px
}
.awn-toast-wrapper {
border: 2px solid #d1d1d1;
border-radius: 6px;
padding: 22px 88px 16px 16px
}
.awn-toast-progress-bar {
height: 6px;
left: 0;
position: absolute;
right: 0;
top: 0
}
.awn-toast-progress-bar:after {
animation-duration: inherit;
animation-fill-mode: both;
animation-name: awn-bar;
animation-timing-function: linear;
background: gray;
content: " ";
height: 6px;
position: absolute;
right: 100%;
top: 0;
width: 100%
}
.awn-toast.awn-toast-progress-bar-paused .awn-toast-progress-bar:after {
animation-play-state: paused
}
.awn-toast.awn-hiding {
animation-name: awn-fade-out !important
}
.awn-toast.awn-toast-success {
background: #dff8d3;
color: #40871d
}
.awn-toast.awn-toast-success .awn-toast-wrapper {
border-color: #a7d590
}
.awn-toast.awn-toast-success .fa, .awn-toast.awn-toast-success b {
color: #40871d
}
.awn-toast.awn-toast-success .awn-toast-progress-bar:after {
background: #40871d
}
.awn-toast.awn-toast-info {
background: #d3ebf8;
color: #1c76a6
}
.awn-toast.awn-toast-info .awn-toast-wrapper {
border-color: #9fd3ef
}
.awn-toast.awn-toast-info .fa, .awn-toast.awn-toast-info b {
color: #1c76a6
}
.awn-toast.awn-toast-info .awn-toast-progress-bar:after {
background: #1c76a6
}
.awn-toast.awn-toast-alert {
background: #f8d5d3;
color: #a92019
}
.awn-toast.awn-toast-alert .awn-toast-wrapper {
border-color: #f0a29d
}
.awn-toast.awn-toast-alert .fa, .awn-toast.awn-toast-alert b {
color: #a92019
}
.awn-toast.awn-toast-alert .awn-toast-progress-bar:after {
background: #a92019
}
.awn-toast.awn-toast-warning {
background: #ffe7cc;
color: #c26700
}
.awn-toast.awn-toast-warning .awn-toast-wrapper {
border-color: #ffc480
}
.awn-toast.awn-toast-warning .fa, .awn-toast.awn-toast-warning b {
color: #c26700
}
.awn-toast.awn-toast-warning .awn-toast-progress-bar:after {
background: #c26700
}
[class^=awn-] {
box-sizing: border-box
}

View File

@@ -0,0 +1,101 @@
@keyframes awn-fade-in {
from {
opacity: 0;
}
to {
opacity: 1;
}
}
@keyframes awn-fade-out {
from {
opacity: 1;
}
to {
opacity: 0;
}
}
@keyframes awn-slide-right {
from {
opacity: 0;
left: 100%;
}
to {
opacity: 1;
left: 0;
}
}
@keyframes awn-slide-left {
from {
opacity: 0;
right: 100%;
}
to {
opacity: 1;
right: 0;
}
}
@keyframes awn-bar {
from {
right: 100%;
}
to {
right: 0;
}
}
.awn-popup-loading-dots,
.awn-popup-loading-dots:before,
.awn-popup-loading-dots:after {
border-radius: 50%;
width: 6px;
height: 6px;
animation-fill-mode: both;
background: #fff;
animation: awn-loading-dots 1s infinite ease-in-out;
}
.awn-popup-loading-dots {
position: relative;
margin-left: 24px;
display: inline-block;
color: #fff;
animation-delay: -0.16s;
}
.awn-popup-loading-dots:before,
.awn-popup-loading-dots:after {
content: "";
position: absolute;
top: 0;
}
.awn-popup-loading-dots:before {
left: -16px;
animation-delay: -0.32s;
}
.awn-popup-loading-dots:after {
left: 16px;
}
@keyframes awn-loading-dots {
0%,
80%,
100% {
box-shadow: 0 0 0 0;
}
40% {
box-shadow: 0 0 0 2px;
}
}

View File

@@ -0,0 +1,97 @@
#awn-popup-wrapper {
position: fixed;
left: 0;
right: 0;
bottom: 0;
top: 0;
display: flex;
align-items: center;
justify-content: center;
background: $awn-popup-wrapper-bg;
z-index: $awn-popup-wrapper-z-index;
opacity: 0;
animation-name: $awn-popup-show-animation;
animation-timing-function: $awn-popup-animation-timing;
animation-fill-mode: both;
&.awn-hiding {
animation-name: $awn-popup-hide-animation;
}
.awn-popup-body {
position: relative;
border-radius: $awn-popup-border-radius;
word-break: break-word;
background: $awn-popup-bg;
padding: $awn-popup-padding;
min-width: $awn-popup-min-width;
font-size: $awn-popup-font-size;
max-width: $awn-popup-max-width;
&.awn-popup-confirm {
display: flex;
flex-direction: column;
align-items: center;
.fa {
font-size: $awn-popup-icon-size;
color: $awn-warning-color;
}
}
&.awn-popup-async-block {
background: transparent;
font-size: 32px;
font-weight: bold;
color: #fff;
text-align: center;
}
}
.awn-popup-title {
font-size: $awn-popup-font-size;
font-weight: bold;
text-transform: uppercase;
margin-top: 8px;
}
.awn-buttons {
width: 100%;
display: flex;
justify-content: space-between;
margin-top: $awn-popup-padding;
.awn-btn {
border-radius: $awn-popup-btn-border-radius;
border: 0;
font-weight: bold;
transition: background 0.2s linear;
font-size: $awn-popup-font-size;
width: 45%;
line-height: $awn-popup-btn-height;
color: $awn-popup-btn-color;
}
&-1 {
.awn-btn {
width: 100%;
}
}
.awn-btn-success {
background: $awn-success-color;
&:hover {
background: darken($awn-success-color, 5%);
}
}
.awn-btn-cancel {
background: $awn-info-color;
&:hover {
background: darken($awn-info-color, 5%);
}
}
}
}

View File

@@ -0,0 +1,8 @@
@import "variables";
@import "animations";
@import "popups";
@import "toasts";
[class^="awn-"] {
box-sizing: border-box;
}

View File

@@ -0,0 +1,194 @@
#awn-toast-container {
position: fixed;
z-index: $awn-container-z-index;
bottom: $awn-container-padding;
right: $awn-container-padding;
box-sizing: border-box;
&.awn-top-left,
&.awn-top-right {
top: $awn-container-padding;
bottom: auto;
.awn-toast:first-child {
margin-top: $awn-toast-margin;
}
}
&.awn-top-left,
&.awn-bottom-left {
left: $awn-container-padding;
right: auto;
.awn-toast {
right: 100%;
animation-name: $awn-toast-left-show-animation;
&.awn-hiding {
right: 0;
}
}
}
&.awn-top-right,
&.awn-bottom-right {
.awn-toast {
left: 100%;
animation-name: $awn-toast-right-show-animation;
&.awn-hiding {
left: 0;
}
}
}
}
.awn-toast {
position: relative;
cursor: pointer;
overflow: hidden;
opacity: 0;
width: $awn-toast-width;
background: $awn-primary-background;
margin-top: $awn-toast-margin;
border-radius: $awn-toast-border-radius;
color: $awn-primary-color;
font-size: $awn-toast-font-size;
animation-timing-function: $awn-toast-animation-timing;
animation-fill-mode: both;
&-content {
word-break: break-word;
}
&-label {
display: block;
text-transform: uppercase;
color: $awn-primary-color;
font-size: $awn-toast-title-font-size;
}
&-icon {
position: absolute;
right: $awn-toast-padding;
top: $awn-progress-bar-height;
bottom: 0;
display: flex;
align-items: center;
justify-content: flex-end;
.fa {
font-size: $awn-toast-icon-size;
color: $awn-primary-color;
}
}
&-wrapper {
padding: $awn-progress-bar-height + $awn-toast-padding 88px $awn-toast-padding $awn-toast-padding;
border: $awn-border;
border-radius: $awn-toast-border-radius;
}
&-progress-bar {
position: absolute;
top: 0;
left: 0;
right: 0;
height: $awn-progress-bar-height;
&:after {
content: " ";
background: $awn-primary-color;
position: absolute;
width: 100%;
right: 100%;
top: 0;
height: $awn-progress-bar-height;
animation-name: awn-bar;
animation-duration: inherit;
animation-timing-function: linear;
animation-fill-mode: both;
}
}
&.awn-toast-progress-bar-paused .awn-toast-progress-bar:after {
animation-play-state: paused;
}
&.awn-hiding {
animation-name: $awn-toast-hide-animation !important;
}
&.awn-toast-success {
background: $awn-success-background;
color: $awn-success-color;
.awn-toast-wrapper {
border-color: $awn-success-border-color;
}
b,
.fa {
color: $awn-success-color;
}
.awn-toast-progress-bar:after {
background: $awn-success-color;
}
}
&.awn-toast-info {
background: $awn-info-background;
color: $awn-info-color;
.awn-toast-wrapper {
border-color: $awn-info-border-color;
}
b,
.fa {
color: $awn-info-color;
}
.awn-toast-progress-bar:after {
background: $awn-info-color;
}
}
&.awn-toast-alert {
background: $awn-alert-background;
color: $awn-alert-color;
.awn-toast-wrapper {
border-color: $awn-alert-border-color;
}
b,
.fa {
color: $awn-alert-color;
}
.awn-toast-progress-bar:after {
background: $awn-alert-color;
}
}
&.awn-toast-warning {
background: $awn-warning-background;
color: $awn-warning-color;
.awn-toast-wrapper {
border-color: $awn-warning-border-color;
}
b,
.fa {
color: $awn-warning-color;
}
.awn-toast-progress-bar:after {
background: $awn-warning-color;
}
}
}

View File

@@ -0,0 +1,63 @@
// Container
$awn-container-z-index: 99998 !default;
$awn-container-padding: 24px !default;
// Colors
$awn-primary-color: hsl(0, 0%, 50%) !default;
$awn-primary-background: hsl(0, 0%, 92%) !default;
$awn-primary-border-color: hsl(0, 0%, 82%) !default;
$awn-success-color: hsl(100, 65%, 32%) !default;
$awn-success-background: hsl(100, 74%, 90%) !default;
$awn-success-border-color: hsl(100, 45%, 70%) !default;
$awn-info-color: hsl(201, 71%, 38%) !default;
$awn-info-background: hsl(201, 71%, 90%) !default;
$awn-info-border-color: hsl(201, 71%, 78%) !default;
$awn-alert-color: hsl(3, 74%, 38%) !default;
$awn-alert-background: hsl(3, 74%, 90%) !default;
$awn-alert-border-color: hsl(3, 74%, 78%) !default;
$awn-warning-color: hsl(32, 100%, 38%) !default;
$awn-warning-background: hsl(32, 100%, 90%) !default;
$awn-warning-border-color: hsl(32, 100%, 75%) !default;
// Notifications
$awn-toast-width: 320px !default;
$awn-toast-padding: 16px !default;
$awn-toast-margin: 16px !default;
$awn-toast-border-width: 2px !default;
$awn-toast-border-style: solid !default;
$awn-toast-border-color: $awn-primary-border-color !default;
$awn-toast-border-radius: 6px !default;
$awn-border: $awn-toast-border-width $awn-toast-border-style
$awn-toast-border-color !default;
$awn-progress-bar-height: 6px !default;
$awn-toast-font-size: 14px !default;
$awn-toast-title-font-size: 18px !default;
$awn-toast-icon-size: 44px !default;
// Popups
$awn-popup-wrapper-bg: rgba(0, 0, 0, 0.7) !default;
$awn-popup-wrapper-z-index: 99999 !default;
$awn-popup-bg: #fff !default;
$awn-popup-min-width: 320px !default;
$awn-popup-max-width: 500px !default;
$awn-popup-font-size: 14px !default;
$awn-popup-icon-size: 44px !default;
$awn-popup-padding: 24px !default;
$awn-popup-border-radius: 6px !default;
$awn-popup-btn-height: 32px !default;
$awn-popup-btn-color: #fff !default;
$awn-popup-btn-border-radius: 4px !default;
// Animations
$awn-popup-show-animation: awn-fade-in;
$awn-popup-hide-animation: awn-fade-out;
$awn-popup-animation-timing: ease-out;
$awn-toast-left-show-animation: awn-slide-left;
$awn-toast-right-show-animation: awn-slide-right;
$awn-toast-hide-animation: awn-fade-out;
$awn-toast-animation-timing: linear;

View File

@@ -0,0 +1,25 @@
export default class {
constructor(callback, delay) {
this.callback = callback
this.remaining = delay
this.resume()
}
pause() {
this.paused = true
window.clearTimeout(this.timerId)
this.remaining -= new Date() - this.start
}
resume() {
this.paused = false
this.start = new Date()
window.clearTimeout(this.timerId)
this.timerId = window.setTimeout(() => {
window.clearTimeout(this.timerId)
this.callback()
}, this.remaining)
}
toggle() {
if (this.paused) this.resume()
else this.pause()
}
}

View File

@@ -0,0 +1,61 @@
import Elem from "./elem.js"
import Timer from "./timer.js"
import {
tConsts,
eConsts
} from "./constants.js"
export default class extends Elem {
constructor(msg, type, options, parent) {
super(
parent,
`${tConsts.prefix}-${Math.floor(Date.now() - Math.random() * 100)}`,
`${tConsts.prefix} ${tConsts.prefix}-${type}`,
`animation-duration: ${options.toSecs(options.animationDuration)};`,
options
)
this.updateType(type)
this.setInnerHtml(msg)
}
setInnerHtml(html) {
if (this.type === 'alert' && html) html = this.options.formatError(html)
html = this.options.applyReplacements(html, this.type)
this.newNode.innerHTML = `<div class="awn-toast-wrapper">${this.progressBar}${this.label}<div class="${tConsts.klass.content}">${html}</div><span class="${tConsts.klass.icon}">${this.options.icon(this.type)}</span></div>`
}
beforeInsert() {
if (this.parent.childElementCount >= this.options.maxNotifications) {
let elements = Array.from(this.parent.getElementsByClassName(tConsts.prefix))
this.delete(elements.find(e => !this.isDeleted(e)))
}
}
afterInsert() {
if (this.type == "async") return this.start = Date.now()
this.addEvent("click", () => this.delete())
if (this.duration <= 0) return
this.timer = new Timer(() => this.delete(), this.duration)
for (const e of ["mouseenter", "mouseleave"]) {
this.addEvent(e, () => {
if (this.isDeleted()) return
this.toggleClass(tConsts.klass.progressBarPause)
this.timer.toggle()
})
}
}
isDeleted(el = this.el) {
return el.classList.contains(eConsts.klass.hiding)
}
get progressBar() {
if (this.duration <= 0 || this.type === 'async') return ""
return `<div class='${tConsts.klass.progressBar}' style="animation-duration:${this.options.toSecs(this.duration)};"></div>`
}
get label() {
return `<b class="${tConsts.klass.label}">${this.options.label(this.type)}</b>`
}
}

File diff suppressed because it is too large Load Diff

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

File diff suppressed because it is too large Load Diff

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

View File

@@ -0,0 +1,485 @@
/*!
* Bootstrap Reboot v5.1.3 (https://getbootstrap.com/)
* Copyright 2011-2021 The Bootstrap Authors
* Copyright 2011-2021 Twitter, Inc.
* Licensed under MIT (https://github.com/twbs/bootstrap/blob/main/LICENSE)
* Forked from Normalize.css, licensed MIT (https://github.com/necolas/normalize.css/blob/master/LICENSE.md)
*/
:root {
--bs-blue: #0d6efd;
--bs-indigo: #6610f2;
--bs-purple: #6f42c1;
--bs-pink: #d63384;
--bs-red: #dc3545;
--bs-orange: #fd7e14;
--bs-yellow: #ffc107;
--bs-green: #198754;
--bs-teal: #20c997;
--bs-cyan: #0dcaf0;
--bs-white: #fff;
--bs-gray: #6c757d;
--bs-gray-dark: #343a40;
--bs-gray-100: #f8f9fa;
--bs-gray-200: #e9ecef;
--bs-gray-300: #dee2e6;
--bs-gray-400: #ced4da;
--bs-gray-500: #adb5bd;
--bs-gray-600: #6c757d;
--bs-gray-700: #495057;
--bs-gray-800: #343a40;
--bs-gray-900: #212529;
--bs-primary: #0d6efd;
--bs-secondary: #6c757d;
--bs-success: #198754;
--bs-info: #0dcaf0;
--bs-warning: #ffc107;
--bs-danger: #dc3545;
--bs-light: #f8f9fa;
--bs-dark: #212529;
--bs-primary-rgb: 13, 110, 253;
--bs-secondary-rgb: 108, 117, 125;
--bs-success-rgb: 25, 135, 84;
--bs-info-rgb: 13, 202, 240;
--bs-warning-rgb: 255, 193, 7;
--bs-danger-rgb: 220, 53, 69;
--bs-light-rgb: 248, 249, 250;
--bs-dark-rgb: 33, 37, 41;
--bs-white-rgb: 255, 255, 255;
--bs-black-rgb: 0, 0, 0;
--bs-body-color-rgb: 33, 37, 41;
--bs-body-bg-rgb: 255, 255, 255;
--bs-font-sans-serif: system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, "Noto Sans", "Liberation Sans", sans-serif, "Apple Color Emoji", "Segoe UI Emoji", "Segoe UI Symbol", "Noto Color Emoji";
--bs-font-monospace: SFMono-Regular, Menlo, Monaco, Consolas, "Liberation Mono", "Courier New", monospace;
--bs-gradient: linear-gradient(180deg, rgba(255, 255, 255, 0.15), rgba(255, 255, 255, 0));
--bs-body-font-family: var(--bs-font-sans-serif);
--bs-body-font-size: 1rem;
--bs-body-font-weight: 400;
--bs-body-line-height: 1.5;
--bs-body-color: #212529;
--bs-body-bg: #fff;
}
*,
*::before,
*::after {
box-sizing: border-box;
}
@media (prefers-reduced-motion: no-preference) {
:root {
scroll-behavior: smooth;
}
}
body {
margin: 0;
font-family: var(--bs-body-font-family);
font-size: var(--bs-body-font-size);
font-weight: var(--bs-body-font-weight);
line-height: var(--bs-body-line-height);
color: var(--bs-body-color);
text-align: var(--bs-body-text-align);
background-color: var(--bs-body-bg);
-webkit-text-size-adjust: 100%;
-webkit-tap-highlight-color: rgba(0, 0, 0, 0);
}
hr {
margin: 1rem 0;
color: inherit;
background-color: currentColor;
border: 0;
opacity: 0.25;
}
hr:not([size]) {
height: 1px;
}
h6, h5, h4, h3, h2, h1 {
margin-top: 0;
margin-bottom: 0.5rem;
font-weight: 500;
line-height: 1.2;
}
h1 {
font-size: calc(1.375rem + 1.5vw);
}
@media (min-width: 1200px) {
h1 {
font-size: 2.5rem;
}
}
h2 {
font-size: calc(1.325rem + 0.9vw);
}
@media (min-width: 1200px) {
h2 {
font-size: 2rem;
}
}
h3 {
font-size: calc(1.3rem + 0.6vw);
}
@media (min-width: 1200px) {
h3 {
font-size: 1.75rem;
}
}
h4 {
font-size: calc(1.275rem + 0.3vw);
}
@media (min-width: 1200px) {
h4 {
font-size: 1.5rem;
}
}
h5 {
font-size: 1.25rem;
}
h6 {
font-size: 1rem;
}
p {
margin-top: 0;
margin-bottom: 1rem;
}
abbr[title],
abbr[data-bs-original-title] {
-webkit-text-decoration: underline dotted;
text-decoration: underline dotted;
cursor: help;
-webkit-text-decoration-skip-ink: none;
text-decoration-skip-ink: none;
}
address {
margin-bottom: 1rem;
font-style: normal;
line-height: inherit;
}
ol,
ul {
padding-left: 2rem;
}
ol,
ul,
dl {
margin-top: 0;
margin-bottom: 1rem;
}
ol ol,
ul ul,
ol ul,
ul ol {
margin-bottom: 0;
}
dt {
font-weight: 700;
}
dd {
margin-bottom: 0.5rem;
margin-left: 0;
}
blockquote {
margin: 0 0 1rem;
}
b,
strong {
font-weight: bolder;
}
small {
font-size: 0.875em;
}
mark {
padding: 0.2em;
background-color: #fcf8e3;
}
sub,
sup {
position: relative;
font-size: 0.75em;
line-height: 0;
vertical-align: baseline;
}
sub {
bottom: -0.25em;
}
sup {
top: -0.5em;
}
a {
color: #0d6efd;
text-decoration: underline;
}
a:hover {
color: #0a58ca;
}
a:not([href]):not([class]), a:not([href]):not([class]):hover {
color: inherit;
text-decoration: none;
}
pre,
code,
kbd,
samp {
font-family: var(--bs-font-monospace);
font-size: 1em;
direction: ltr /* rtl:ignore */;
unicode-bidi: bidi-override;
}
pre {
display: block;
margin-top: 0;
margin-bottom: 1rem;
overflow: auto;
font-size: 0.875em;
}
pre code {
font-size: inherit;
color: inherit;
word-break: normal;
}
code {
font-size: 0.875em;
color: #d63384;
word-wrap: break-word;
}
a > code {
color: inherit;
}
kbd {
padding: 0.2rem 0.4rem;
font-size: 0.875em;
color: #fff;
background-color: #212529;
border-radius: 0.2rem;
}
kbd kbd {
padding: 0;
font-size: 1em;
font-weight: 700;
}
figure {
margin: 0 0 1rem;
}
img,
svg {
vertical-align: middle;
}
table {
caption-side: bottom;
border-collapse: collapse;
}
caption {
padding-top: 0.5rem;
padding-bottom: 0.5rem;
color: #6c757d;
text-align: left;
}
th {
text-align: inherit;
text-align: -webkit-match-parent;
}
thead,
tbody,
tfoot,
tr,
td,
th {
border-color: inherit;
border-style: solid;
border-width: 0;
}
label {
display: inline-block;
}
button {
border-radius: 0;
}
button:focus:not(:focus-visible) {
outline: 0;
}
input,
button,
select,
optgroup,
textarea {
margin: 0;
font-family: inherit;
font-size: inherit;
line-height: inherit;
}
button,
select {
text-transform: none;
}
[role=button] {
cursor: pointer;
}
select {
word-wrap: normal;
}
select:disabled {
opacity: 1;
}
[list]::-webkit-calendar-picker-indicator {
display: none;
}
button,
[type=button],
[type=reset],
[type=submit] {
-webkit-appearance: button;
}
button:not(:disabled),
[type=button]:not(:disabled),
[type=reset]:not(:disabled),
[type=submit]:not(:disabled) {
cursor: pointer;
}
::-moz-focus-inner {
padding: 0;
border-style: none;
}
textarea {
resize: vertical;
}
fieldset {
min-width: 0;
padding: 0;
margin: 0;
border: 0;
}
legend {
float: left;
width: 100%;
padding: 0;
margin-bottom: 0.5rem;
font-size: calc(1.275rem + 0.3vw);
line-height: inherit;
}
@media (min-width: 1200px) {
legend {
font-size: 1.5rem;
}
}
legend + * {
clear: left;
}
::-webkit-datetime-edit-fields-wrapper,
::-webkit-datetime-edit-text,
::-webkit-datetime-edit-minute,
::-webkit-datetime-edit-hour-field,
::-webkit-datetime-edit-day-field,
::-webkit-datetime-edit-month-field,
::-webkit-datetime-edit-year-field {
padding: 0;
}
::-webkit-inner-spin-button {
height: auto;
}
[type=search] {
outline-offset: -2px;
-webkit-appearance: textfield;
}
/* rtl:raw:
[type="tel"],
[type="url"],
[type="email"],
[type="number"] {
direction: ltr;
}
*/
::-webkit-search-decoration {
-webkit-appearance: none;
}
::-webkit-color-swatch-wrapper {
padding: 0;
}
::-webkit-file-upload-button {
font: inherit;
}
::file-selector-button {
font: inherit;
}
::-webkit-file-upload-button {
font: inherit;
-webkit-appearance: button;
}
output {
display: inline-block;
}
iframe {
border: 0;
}
summary {
display: list-item;
cursor: pointer;
}
progress {
vertical-align: baseline;
}
[hidden] {
display: none !important;
}
/*# sourceMappingURL=bootstrap-reboot.css.map */

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

View File

@@ -0,0 +1,482 @@
/*!
* Bootstrap Reboot v5.1.3 (https://getbootstrap.com/)
* Copyright 2011-2021 The Bootstrap Authors
* Copyright 2011-2021 Twitter, Inc.
* Licensed under MIT (https://github.com/twbs/bootstrap/blob/main/LICENSE)
* Forked from Normalize.css, licensed MIT (https://github.com/necolas/normalize.css/blob/master/LICENSE.md)
*/
:root {
--bs-blue: #0d6efd;
--bs-indigo: #6610f2;
--bs-purple: #6f42c1;
--bs-pink: #d63384;
--bs-red: #dc3545;
--bs-orange: #fd7e14;
--bs-yellow: #ffc107;
--bs-green: #198754;
--bs-teal: #20c997;
--bs-cyan: #0dcaf0;
--bs-white: #fff;
--bs-gray: #6c757d;
--bs-gray-dark: #343a40;
--bs-gray-100: #f8f9fa;
--bs-gray-200: #e9ecef;
--bs-gray-300: #dee2e6;
--bs-gray-400: #ced4da;
--bs-gray-500: #adb5bd;
--bs-gray-600: #6c757d;
--bs-gray-700: #495057;
--bs-gray-800: #343a40;
--bs-gray-900: #212529;
--bs-primary: #0d6efd;
--bs-secondary: #6c757d;
--bs-success: #198754;
--bs-info: #0dcaf0;
--bs-warning: #ffc107;
--bs-danger: #dc3545;
--bs-light: #f8f9fa;
--bs-dark: #212529;
--bs-primary-rgb: 13, 110, 253;
--bs-secondary-rgb: 108, 117, 125;
--bs-success-rgb: 25, 135, 84;
--bs-info-rgb: 13, 202, 240;
--bs-warning-rgb: 255, 193, 7;
--bs-danger-rgb: 220, 53, 69;
--bs-light-rgb: 248, 249, 250;
--bs-dark-rgb: 33, 37, 41;
--bs-white-rgb: 255, 255, 255;
--bs-black-rgb: 0, 0, 0;
--bs-body-color-rgb: 33, 37, 41;
--bs-body-bg-rgb: 255, 255, 255;
--bs-font-sans-serif: system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, "Noto Sans", "Liberation Sans", sans-serif, "Apple Color Emoji", "Segoe UI Emoji", "Segoe UI Symbol", "Noto Color Emoji";
--bs-font-monospace: SFMono-Regular, Menlo, Monaco, Consolas, "Liberation Mono", "Courier New", monospace;
--bs-gradient: linear-gradient(180deg, rgba(255, 255, 255, 0.15), rgba(255, 255, 255, 0));
--bs-body-font-family: var(--bs-font-sans-serif);
--bs-body-font-size: 1rem;
--bs-body-font-weight: 400;
--bs-body-line-height: 1.5;
--bs-body-color: #212529;
--bs-body-bg: #fff;
}
*,
*::before,
*::after {
box-sizing: border-box;
}
@media (prefers-reduced-motion: no-preference) {
:root {
scroll-behavior: smooth;
}
}
body {
margin: 0;
font-family: var(--bs-body-font-family);
font-size: var(--bs-body-font-size);
font-weight: var(--bs-body-font-weight);
line-height: var(--bs-body-line-height);
color: var(--bs-body-color);
text-align: var(--bs-body-text-align);
background-color: var(--bs-body-bg);
-webkit-text-size-adjust: 100%;
-webkit-tap-highlight-color: rgba(0, 0, 0, 0);
}
hr {
margin: 1rem 0;
color: inherit;
background-color: currentColor;
border: 0;
opacity: 0.25;
}
hr:not([size]) {
height: 1px;
}
h6, h5, h4, h3, h2, h1 {
margin-top: 0;
margin-bottom: 0.5rem;
font-weight: 500;
line-height: 1.2;
}
h1 {
font-size: calc(1.375rem + 1.5vw);
}
@media (min-width: 1200px) {
h1 {
font-size: 2.5rem;
}
}
h2 {
font-size: calc(1.325rem + 0.9vw);
}
@media (min-width: 1200px) {
h2 {
font-size: 2rem;
}
}
h3 {
font-size: calc(1.3rem + 0.6vw);
}
@media (min-width: 1200px) {
h3 {
font-size: 1.75rem;
}
}
h4 {
font-size: calc(1.275rem + 0.3vw);
}
@media (min-width: 1200px) {
h4 {
font-size: 1.5rem;
}
}
h5 {
font-size: 1.25rem;
}
h6 {
font-size: 1rem;
}
p {
margin-top: 0;
margin-bottom: 1rem;
}
abbr[title],
abbr[data-bs-original-title] {
-webkit-text-decoration: underline dotted;
text-decoration: underline dotted;
cursor: help;
-webkit-text-decoration-skip-ink: none;
text-decoration-skip-ink: none;
}
address {
margin-bottom: 1rem;
font-style: normal;
line-height: inherit;
}
ol,
ul {
padding-right: 2rem;
}
ol,
ul,
dl {
margin-top: 0;
margin-bottom: 1rem;
}
ol ol,
ul ul,
ol ul,
ul ol {
margin-bottom: 0;
}
dt {
font-weight: 700;
}
dd {
margin-bottom: 0.5rem;
margin-right: 0;
}
blockquote {
margin: 0 0 1rem;
}
b,
strong {
font-weight: bolder;
}
small {
font-size: 0.875em;
}
mark {
padding: 0.2em;
background-color: #fcf8e3;
}
sub,
sup {
position: relative;
font-size: 0.75em;
line-height: 0;
vertical-align: baseline;
}
sub {
bottom: -0.25em;
}
sup {
top: -0.5em;
}
a {
color: #0d6efd;
text-decoration: underline;
}
a:hover {
color: #0a58ca;
}
a:not([href]):not([class]), a:not([href]):not([class]):hover {
color: inherit;
text-decoration: none;
}
pre,
code,
kbd,
samp {
font-family: var(--bs-font-monospace);
font-size: 1em;
direction: ltr ;
unicode-bidi: bidi-override;
}
pre {
display: block;
margin-top: 0;
margin-bottom: 1rem;
overflow: auto;
font-size: 0.875em;
}
pre code {
font-size: inherit;
color: inherit;
word-break: normal;
}
code {
font-size: 0.875em;
color: #d63384;
word-wrap: break-word;
}
a > code {
color: inherit;
}
kbd {
padding: 0.2rem 0.4rem;
font-size: 0.875em;
color: #fff;
background-color: #212529;
border-radius: 0.2rem;
}
kbd kbd {
padding: 0;
font-size: 1em;
font-weight: 700;
}
figure {
margin: 0 0 1rem;
}
img,
svg {
vertical-align: middle;
}
table {
caption-side: bottom;
border-collapse: collapse;
}
caption {
padding-top: 0.5rem;
padding-bottom: 0.5rem;
color: #6c757d;
text-align: right;
}
th {
text-align: inherit;
text-align: -webkit-match-parent;
}
thead,
tbody,
tfoot,
tr,
td,
th {
border-color: inherit;
border-style: solid;
border-width: 0;
}
label {
display: inline-block;
}
button {
border-radius: 0;
}
button:focus:not(:focus-visible) {
outline: 0;
}
input,
button,
select,
optgroup,
textarea {
margin: 0;
font-family: inherit;
font-size: inherit;
line-height: inherit;
}
button,
select {
text-transform: none;
}
[role=button] {
cursor: pointer;
}
select {
word-wrap: normal;
}
select:disabled {
opacity: 1;
}
[list]::-webkit-calendar-picker-indicator {
display: none;
}
button,
[type=button],
[type=reset],
[type=submit] {
-webkit-appearance: button;
}
button:not(:disabled),
[type=button]:not(:disabled),
[type=reset]:not(:disabled),
[type=submit]:not(:disabled) {
cursor: pointer;
}
::-moz-focus-inner {
padding: 0;
border-style: none;
}
textarea {
resize: vertical;
}
fieldset {
min-width: 0;
padding: 0;
margin: 0;
border: 0;
}
legend {
float: right;
width: 100%;
padding: 0;
margin-bottom: 0.5rem;
font-size: calc(1.275rem + 0.3vw);
line-height: inherit;
}
@media (min-width: 1200px) {
legend {
font-size: 1.5rem;
}
}
legend + * {
clear: right;
}
::-webkit-datetime-edit-fields-wrapper,
::-webkit-datetime-edit-text,
::-webkit-datetime-edit-minute,
::-webkit-datetime-edit-hour-field,
::-webkit-datetime-edit-day-field,
::-webkit-datetime-edit-month-field,
::-webkit-datetime-edit-year-field {
padding: 0;
}
::-webkit-inner-spin-button {
height: auto;
}
[type=search] {
outline-offset: -2px;
-webkit-appearance: textfield;
}
[type="tel"],
[type="url"],
[type="email"],
[type="number"] {
direction: ltr;
}
::-webkit-search-decoration {
-webkit-appearance: none;
}
::-webkit-color-swatch-wrapper {
padding: 0;
}
::-webkit-file-upload-button {
font: inherit;
}
::file-selector-button {
font: inherit;
}
::-webkit-file-upload-button {
font: inherit;
-webkit-appearance: button;
}
output {
display: inline-block;
}
iframe {
border: 0;
}
summary {
display: list-item;
cursor: pointer;
}
progress {
vertical-align: baseline;
}
[hidden] {
display: none !important;
}
/*# sourceMappingURL=bootstrap-reboot.rtl.css.map */

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

File diff suppressed because it is too large Load Diff

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

File diff suppressed because it is too large Load Diff

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

File diff suppressed because it is too large Load Diff

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

File diff suppressed because it is too large Load Diff

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

File diff suppressed because it is too large Load Diff

File diff suppressed because it is too large Load Diff

File diff suppressed because it is too large Load Diff

File diff suppressed because one or more lines are too long

File diff suppressed because it is too large Load Diff

View File

@@ -0,0 +1,5 @@
"use strict"
var m = require("./index")
if (typeof module !== "undefined") module["exports"] = m
else window.m = m

View File

@@ -0,0 +1,8 @@
"use strict"
var hyperscript = require("./render/hyperscript")
hyperscript.trust = require("./render/trust")
hyperscript.fragment = require("./render/fragment")
module.exports = hyperscript

View File

@@ -0,0 +1,26 @@
"use strict"
var hyperscript = require("./hyperscript")
var request = require("./request")
var mountRedraw = require("./mount-redraw")
var m = function m() { return hyperscript.apply(this, arguments) }
m.m = hyperscript
m.trust = hyperscript.trust
m.fragment = hyperscript.fragment
m.Fragment = "["
m.mount = mountRedraw.mount
m.route = require("./route")
m.render = require("./render")
m.redraw = mountRedraw.redraw
m.request = request.request
m.jsonp = request.jsonp
m.parseQueryString = require("./querystring/parse")
m.buildQueryString = require("./querystring/build")
m.parsePathname = require("./pathname/parse")
m.buildPathname = require("./pathname/build")
m.vnode = require("./render/vnode")
m.PromisePolyfill = require("./promise/polyfill")
m.censor = require("./util/censor")
module.exports = m

File diff suppressed because it is too large Load Diff

File diff suppressed because one or more lines are too long

View File

@@ -0,0 +1,5 @@
"use strict"
var render = require("./render")
module.exports = require("./api/mount-redraw")(render, typeof requestAnimationFrame !== "undefined" ? requestAnimationFrame : null, typeof console !== "undefined" ? console : null)

View File

@@ -0,0 +1,3 @@
"use strict"
module.exports = require("./mount-redraw").mount

View File

@@ -0,0 +1,21 @@
The MIT License (MIT)
Copyright (c) 2017 Leo Horie
Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
in the Software without restriction, including without limitation the rights
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
copies of the Software, and to permit persons to whom the Software is
furnished to do so, subject to the following conditions:
The above copyright notice and this permission notice shall be included in all
copies or substantial portions of the Software.
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
SOFTWARE.

View File

@@ -0,0 +1,667 @@
ospec [![npm Version](https://img.shields.io/npm/v/ospec.svg)](https://www.npmjs.com/package/ospec) [![npm License](https://img.shields.io/npm/l/ospec.svg)](https://www.npmjs.com/package/ospec)
=====
[About](#about) | [Usage](#usage) | [CLI](#command-line-interface) | [API](#api) | [Goals](#goals)
Noiseless testing framework
## About
- ~360 LOC including the CLI runner
- terser and faster test code than with mocha, jasmine or tape
- test code reads like bullet points
- assertion code follows [SVO](https://en.wikipedia.org/wiki/Subject%E2%80%93verb%E2%80%93object) structure in present tense for terseness and readability
- supports:
- test grouping
- assertions
- spies
- `equals`, `notEquals`, `deepEquals` and `notDeepEquals` assertion types
- `before`/`after`/`beforeEach`/`afterEach` hooks
- test exclusivity (i.e. `.only`)
- async tests and hooks
- explicitly regulates test-space configuration to encourage focus on testing, and to provide uniform test suites across projects
## Usage
### Single tests
Both tests and assertions are declared via the `o` function. Tests should have a description and a body function. A test may have one or more assertions. Assertions should appear inside a test's body function and compare two values.
```javascript
var o = require("module/talk/bundle/mithril-2.2.2/ospec/ospec")
o("addition", function () {
o(1 + 1).equals(2)
})
o("subtraction", function () {
o(1 - 1).notEquals(2)
})
```
Assertions may have descriptions:
```javascript
o("addition", function() {
o(1 + 1).equals(2)("addition should work")
/* in ES6, the following syntax is also possible
o(1 + 1).equals(2) `addition should work`
*/
})
/* for a failing test, an assertion with a description outputs this:
addition should work
1 should equal 2
Error
at stacktrace/goes/here.js:1:1
*/
```
### Grouping tests
Tests may be organized into logical groups using `o.spec`
```javascript
o.spec("math", function() {
o("addition", function() {
o(1 + 1).equals(2)
})
o("subtraction", function() {
o(1 - 1).notEquals(2)
})
})
```
Group names appear as a breadcrumb trail in test descriptions: `math > addition: 2 should equal 2`
### Nested test groups
Groups can be nested to further organize test groups. Note that tests cannot be nested inside other tests.
```javascript
o.spec("math", function() {
o.spec("arithmetics", function() {
o("addition", function() {
o(1 + 1).equals(2)
})
o("subtraction", function() {
o(1 - 1).notEquals(2)
})
})
})
```
### Callback test
The `o.spy()` method can be used to create a stub function that keeps track of its call count and received parameters
```javascript
// code to be tested
function call(cb, arg) {cb(arg)}
// test suite
var o = require("ospec")
o.spec("call()", function() {
o("works", function() {
var spy = o.spy()
call(spy, 1)
o(spy.callCount).equals(1)
o(spy.args[0]).equals(1)
o(spy.calls[0]).deepEquals([1])
})
})
```
A spy can also wrap other functions, like a decorator:
```javascript
// code to be tested
var count = 0
function inc() {
count++
}
// test suite
var o = require("ospec")
o.spec("call()", function() {
o("works", function() {
var spy = o.spy(inc)
spy()
o(count).equals(1)
})
})
```
### Asynchronous tests
If a test body function declares a named argument, the test is assumed to be asynchronous, and the argument is a function that must be called exactly one time to signal that the test has completed. As a matter of convention, this argument is typically named `done`.
```javascript
o("setTimeout calls callback", function(done) {
setTimeout(done, 10)
})
```
Alternativly you can return a promise or even use an async function in tests:
```javascript
o("promise test", function() {
return new Promise(function(resolve) {
setTimeout(resolve, 10)
})
})
```
```javascript
o("promise test", async function() {
await someOtherAsyncFunction()
})
```
#### Timeout delays
By default, asynchronous tests time out after 200ms. You can change that default for the current test suite and
its children by using the `o.specTimeout(delay)` function.
```javascript
o.spec("a spec that must timeout quickly", function(done, timeout) {
// wait 20ms before bailing out of the tests of this suite and
// its descendants
o.specTimeout(20)
o("some test", function(done) {
setTimeout(done, 10) // this will pass
})
o.spec("a child suite where the delay also applies", function () {
o("some test", function(done) {
setTimeout(done, 30) // this will time out.
})
})
})
o.spec("a spec that uses the default delay", function() {
// ...
})
```
This can also be changed on a per-test basis using the `o.timeout(delay)` function from within a test:
```javascript
o("setTimeout calls callback", function(done, timeout) {
o.timeout(500) // wait 500ms before bailing out of the test
setTimeout(done, 300)
})
```
Note that the `o.timeout` function call must be the first statement in its test. It also works with Promise-returning tests:
```javascript
o("promise test", function() {
o.timeout(1000)
return someOtherAsyncFunctionThatTakes900ms()
})
```
```javascript
o("promise test", async function() {
o.timeout(1000)
await someOtherAsyncFunctionThatTakes900ms()
})
```
Asynchronous tests generate an assertion that succeeds upon calling `done` or fails on timeout with the error message `async test timed out`.
### `before`, `after`, `beforeEach`, `afterEach` hooks
These hooks can be declared when it's necessary to setup and clean up state for a test or group of tests. The `before` and `after` hooks run once each per test group, whereas the `beforeEach` and `afterEach` hooks run for every test.
```javascript
o.spec("math", function() {
var acc
o.beforeEach(function() {
acc = 0
})
o("addition", function() {
acc += 1
o(acc).equals(1)
})
o("subtraction", function() {
acc -= 1
o(acc).equals(-1)
})
})
```
It's strongly recommended to ensure that `beforeEach` hooks always overwrite all shared variables, and avoid `if/else` logic, memoization, undo routines inside `beforeEach` hooks.
### Asynchronous hooks
Like tests, hooks can also be asynchronous. Tests that are affected by asynchronous hooks will wait for the hooks to complete before running.
```javascript
o.spec("math", function() {
var acc
o.beforeEach(function(done) {
setTimeout(function() {
acc = 0
done()
})
})
// tests only run after async hooks complete
o("addition", function() {
acc += 1
o(acc).equals(1)
})
o("subtraction", function() {
acc -= 1
o(acc).equals(-1)
})
})
```
### Running only some tests
One or more tests can be temporarily made to run exclusively by calling `o.only()` instead of `o`. This is useful when troubleshooting regressions, to zero-in on a failing test, and to avoid saturating console log w/ irrelevant debug information.
```javascript
o.spec("math", function() {
// will not run
o("addition", function() {
o(1 + 1).equals(2)
})
// this test will be run, regardless of how many groups there are
o.only("subtraction", function() {
o(1 - 1).notEquals(2)
})
// will not run
o("multiplication", function() {
o(2 * 2).equals(4)
})
// this test will be run, regardless of how many groups there are
o.only("division", function() {
o(6 / 2).notEquals(2)
})
})
```
### Running the test suite
```javascript
// define a test
o("addition", function() {
o(1 + 1).equals(2)
})
// run the suite
o.run()
```
### Running test suites concurrently
The `o.new()` method can be used to create new instances of ospec, which can be run in parallel. Note that each instance will report independently, and there's no aggregation of results.
```javascript
var _o = o.new('optional name')
_o("a test", function() {
_o(1).equals(1)
})
_o.run()
```
## Command Line Interface
Create a script in your package.json:
```
"scripts": {
"test": "ospec",
...
}
```
...and run it from the command line:
```
$ npm test
```
**NOTE:** `o.run()` is automatically called by the cli - no need to call it in your test code.
### CLI Options
Running ospec without arguments is equivalent to running `ospec '**/tests/**/*.js'`. In english, this tells ospec to evaluate all `*.js` files in any sub-folder named `tests/` (the `node_modules` folder is always excluded).
If you wish to change this behavior, just provide one or more glob match patterns:
```
ospec '**/spec/**/*.js' '**/*.spec.js'
```
You can also provide ignore patterns (note: always add `--ignore` AFTER match patterns):
```
ospec --ignore 'folder1/**' 'folder2/**'
```
Finally, you may choose to load files or modules before any tests run (**note:** always add `--require` AFTER match patterns):
```
ospec --require esm
```
Here's an example of mixing them all together:
```
ospec '**/*.test.js' --ignore 'folder1/**' --require esm ./my-file.js
```
### Run ospec directly from the command line:
ospec comes with an executable named `ospec`. npm auto-installs local binaries to `./node_modules/.bin/`. You can run ospec by running `./node_modules/.bin/ospec` from your project root, but there are more convenient methods to do so that we will soon describe.
ospec doesn't work when installed globally (`npm install -g`). Using global scripts is generally a bad idea since you can end up with different, incompatible versions of the same package installed locally and globally.
Here are different ways of running ospec from the command line. This knowledge applies to not just ospec, but any locally installed npm binary.
#### npx
If you're using a recent version of npm (v5+), you can use run `npx ospec` from your project folder.
#### npm-run
If you're using a recent version of npm (v5+), you can use run `npx ospec` from your project folder.
Otherwise, to work around this limitation, you can use [`npm-run`](https://www.npmjs.com/package/npm-run) which enables one to run the binaries of locally installed packages.
```
npm install npm-run -g
```
Then, from a project that has ospec installed as a (dev) dependency:
```
npm-run ospec
```
#### PATH
If you understand how your system's PATH works (e.g. for [OSX](https://coolestguidesontheplanet.com/add-shell-path-osx/)), then you can add the following to your PATH...
```
export PATH=./node_modules/.bin:$PATH
```
...and you'll be able to run `ospec` without npx, npm, etc. This one-time setup will also work with other binaries across all your node projects, as long as you run binaries from the root of your projects.
---
## API
Square brackets denote optional arguments
### void o.spec(String title, Function tests)
Defines a group of tests. Groups are optional
---
### void o(String title, Function([Function done [, Function timeout]]) assertions)
Defines a test.
If an argument is defined for the `assertions` function, the test is deemed to be asynchronous, and the argument is required to be called exactly one time.
---
### Assertion o(any value)
Starts an assertion. There are six types of assertion: `equals`, `notEquals`, `deepEquals`, `notDeepEquals`, `throws`, `notThrows`.
Assertions have this form:
```javascript
o(actualValue).equals(expectedValue)
```
As a matter of convention, the actual value should be the first argument and the expected value should be the second argument in an assertion.
Assertions can also accept an optional description curried parameter:
```javascript
o(actualValue).equals(expectedValue)("this is a description for this assertion")
```
Assertion descriptions can be simplified using ES6 tagged template string syntax:
```javascript
o(actualValue).equals(expectedValue) `this is a description for this assertion`
```
#### Function(String description) o(any value).equals(any value)
Asserts that two values are strictly equal (`===`)
#### Function(String description) o(any value).notEquals(any value)
Asserts that two values are strictly not equal (`!==`)
#### Function(String description) o(any value).deepEquals(any value)
Asserts that two values are recursively equal
#### Function(String description) o(any value).notDeepEquals(any value)
Asserts that two values are not recursively equal
#### Function(String description) o(Function fn).throws(Object constructor)
Asserts that a function throws an instance of the provided constructo
#### Function(String description) o(Function fn).throws(String message)
Asserts that a function throws an Error with the provided message
#### Function(String description) o(Function fn).notThrows(Object constructor)
Asserts that a function does not throw an instance of the provided constructor
#### Function(String description) o(Function fn).notThrows(String message)
Asserts that a function does not throw an Error with the provided message
---
### void o.before(Function([Function done [, Function timeout]]) setup)
Defines code to be run at the beginning of a test group
If an argument is defined for the `setup` function, this hook is deemed to be asynchronous, and the argument is required to be called exactly one time.
---
### void o.after(Function([Function done [, Function timeout]]) teardown)
Defines code to be run at the end of a test group
If an argument is defined for the `teardown` function, this hook is deemed to be asynchronous, and the argument is required to be called exactly one time.
---
### void o.beforeEach(Function([Function done [, Function timeout]]) setup)
Defines code to be run before each test in a group
If an argument is defined for the `setup` function, this hook is deemed to be asynchronous, and the argument is required to be called exactly one time.
---
### void o.afterEach(Function([Function done [, Function timeout]]) teardown)
Defines code to be run after each test in a group
If an argument is defined for the `teardown` function, this hook is deemed to be asynchronous, and the argument is required to be called exactly one time.
---
### void o.only(String title, Function([Function done [, Function timeout]]) assertions)
Declares that only a single test should be run, instead of all of them
---
### Function o.spy([Function fn])
Returns a function that records the number of times it gets called, and its arguments
#### Number o.spy().callCount
The number of times the function has been called
#### Array<any> o.spy().args
The arguments that were passed to the function in the last time it was called
---
### void o.run([Function reporter])
Runs the test suite. By default passing test results are printed using
`console.log` and failing test results are printed using `console.error`.
If you have custom continuous integration needs then you can use a
reporter to process [test result data](#result-data) yourself.
If running in Node.js, ospec will call `process.exit` after reporting
results by default. If you specify a reporter, ospec will not do this
and allow your reporter to respond to results in its own way.
---
### Number o.report(results)
The default reporter used by `o.run()` when none are provided. Returns the number of failures, doesn't exit Node.js by itself. It expects an array of [test result data](#result-data) as argument.
---
### Function o.new()
Returns a new instance of ospec. Useful if you want to run more than one test suite concurrently
```javascript
var $o = o.new()
$o("a test", function() {
$o(1).equals(1)
})
$o.run()
```
---
## Result data
Test results are available by reference for integration purposes. You
can use custom reporters in `o.run()` to process these results.
```javascript
o.run(function(results) {
// results is an array
results.forEach(function(result) {
// ...
})
})
```
---
### Boolean|Null result.pass
- `true` if the assertion passed.
- `false` if the assertion failed.
- `null` if the assertion was incomplete (`o("partial assertion) // and that's it`).
---
### Error result.error
The `Error` object explaining the reason behind a failure. If the assertion failed, the stack will point to the actuall error. If the assertion did pass or was incomplete, this field is identical to `result.testError`.
---
### Error result.testError
An `Error` object whose stack points to the test definition that wraps the assertion. Useful as a fallback because in some async cases the main may not point to test code.
---
### String result.message
If an exception was thrown inside the corresponding test, this will equal that Error's `message`. Otherwise, this will be a preformatted message in [SVO form](https://en.wikipedia.org/wiki/Subject%E2%80%93verb%E2%80%93object). More specifically, `${subject}\n${verb}\n${object}`.
As an example, the following test's result message will be `"false\nshould equal\ntrue"`.
```javascript
o.spec("message", function() {
o(false).equals(true)
})
```
If you specify an assertion description, that description will appear two lines above the subject.
```javascript
o.spec("message", function() {
o(false).equals(true)("Candyland") // result.message === "Candyland\n\nfalse\nshould equal\ntrue"
})
```
---
### String result.context
A `>`-separated string showing the structure of the test specification.
In the below example, `result.context` would be `testing > rocks`.
```javascript
o.spec("testing", function() {
o.spec("rocks", function() {
o(false).equals(true)
})
})
```
---
## Goals
- Do the most common things that the mocha/chai/sinon triad does without having to install 3 different libraries and several dozen dependencies
- Disallow configuration in test-space:
- Disallow ability to pick between API styles (BDD/TDD/Qunit, assert/should/expect, etc)
- Disallow ability to add custom assertion types
- Provide a default simple reporter
- Make assertion code terse, readable and self-descriptive
- Have as few assertion types as possible for a workable usage pattern
Explicitly disallowing modularity and configuration in test-space has a few benefits:
- tests always look the same, even across different projects and teams
- single source of documentation for entire testing API
- no need to hunt down plugins to figure out what they do, especially if they replace common JavaScript idioms with fuzzy spoken language constructs (e.g. what does `.is()` do?)
- no need to pollute project-space with ad-hoc configuration code
- discourages side-tracking and yak-shaving

View File

@@ -0,0 +1,110 @@
# Change log for ospec
- [Upcoming](#upcoming)
- [4.0.1](#401)
- [4.0.0](#400)
- [3.1.0](#310)
- [3.0.1](#301)
- [3.0.0](#300)
- [2.1.0](#210)
- [2.0.0](#200)
- [1.4.1](#141)
- [1.4.0](#140)
- [1.3 and earlier](#13-and-earlier)
### Upcoming...
### 4.0.1
_2019-08-18_
- Fix `require` with relative paths
### 4.0.0
_2019-07-24_
- Pull ESM support out
### 3.1.0
_2019-02-07_
- ospec: Test results now include `.message` and `.context` regardless of whether the test passed or failed. (#2227 @robertakarobin)
<!-- Add new lines here. Version number will be decided later -->
- Add `spy.calls` array property to get the `this` and `arguments` values for any arbitrary call. (#2221 [@dead-claudia](https://github.com/dead-claudia))
- Added `.throws` and `.notThrows` assertions to ospec. (#2255 @robertakarobin)
- Update `glob` dependency.
### 3.0.1
_2018-06-30_
#### Bug fix
- Move `glob` from `devDependencies` to `dependencies`, fix the test runner ([#2186](https://github.com/MithrilJS/mithril.js/pull/2186) [@porsager](https://github.com/porsager)
### 3.0.0
_2018-06-26_
#### Breaking
- Better input checking to prevent misuses of the library. Misues of the library will now throw errors, rather than report failures. This may uncover bugs in your test suites. Since it is potentially a disruptive update this change triggers a semver major bump. ([#2167](https://github.com/MithrilJS/mithril.js/pull/2167))
- Change the reserved character for hooks and test suite meta-information from `"__"` to `"\x01"`. Tests whose name start with `"\0x01"` will be rejected ([#2167](https://github.com/MithrilJS/mithril.js/pull/2167))
#### Features
- Give async timeout a stack trace that points to the problematic test ([#2154](https://github.com/MithrilJS/mithril.js/pull/2154) [@gilbert](github.com/gilbert), [#2167](https://github.com/MithrilJS/mithril.js/pull/2167))
- deprecate the `timeout` parameter in async tests in favour of `o.timeout()` for setting the timeout delay. The `timeout` parameter still works for v3, and will be removed in v4 ([#2167](https://github.com/MithrilJS/mithril.js/pull/2167))
- add `o.defaultTimeout()` for setting the the timeout delay for the current spec and its children ([#2167](https://github.com/MithrilJS/mithril.js/pull/2167))
- adds the possibility to select more than one test with o.only ([#2171](https://github.com/MithrilJS/mithril.js/pull/2171))
#### Bug fixes
- Detect duplicate calls to `done()` properly [#2162](https://github.com/MithrilJS/mithril.js/issues/2162) ([#2167](https://github.com/MithrilJS/mithril.js/pull/2167))
- Don't try to report internal errors as assertion failures, throw them instead ([#2167](https://github.com/MithrilJS/mithril.js/pull/2167))
- Don't ignore, silently, tests whose name start with the test suite meta-information sequence (was `"__"` up to this version) ([#2167](https://github.com/MithrilJS/mithril.js/pull/2167))
- Fix the `done()` call detection logic [#2158](https://github.com/MithrilJS/mithril.js/issues/2158) and assorted fixes (accept non-English names, tolerate comments) ([#2167](https://github.com/MithrilJS/mithril.js/pull/2167))
- Catch exceptions thrown in synchronous tests and report them as assertion failures ([#2171](https://github.com/MithrilJS/mithril.js/pull/2171))
- Fix a stack overflow when using `o.only()` with a large test suite ([#2171](https://github.com/MithrilJS/mithril.js/pull/2171))
### 2.1.0
_2018-05-25_
#### Features
- Pinpoint the `o.only()` call site ([#2157](https://github.com/MithrilJS/mithril.js/pull/2157))
- Improved wording, spacing and color-coding of report messages and errors ([#2147](https://github.com/MithrilJS/mithril.js/pull/2147), [@maranomynet](https://github.com/maranomynet))
#### Bug fixes
- Convert the exectuable back to plain ES5 [#2160](https://github.com/MithrilJS/mithril.js/issues/2160) ([#2161](https://github.com/MithrilJS/mithril.js/pull/2161))
### 2.0.0
_2018-05-09_
- Added `--require` feature to the ospec executable ([#2144](https://github.com/MithrilJS/mithril.js/pull/2144), [@gilbert](https://github.com/gilbert))
- In Node.js, ospec only uses colors when the output is sent to a terminal ([#2143](https://github.com/MithrilJS/mithril.js/pull/2143))
- the CLI runner now accepts globs as arguments ([#2141](https://github.com/MithrilJS/mithril.js/pull/2141), [@maranomynet](https://github.com/maranomynet))
- Added support for custom reporters ([#2020](https://github.com/MithrilJS/mithril.js/pull/2020), [@zyrolasting](https://github.com/zyrolasting))
- Make ospec more [Flems](https://flems.io)-friendly ([#2034](https://github.com/MithrilJS/mithril.js/pull/2034))
- Works either as a global or in CommonJS environments
- the o.run() report is always printed asynchronously (it could be synchronous before if none of the tests were async).
- Properly point to the assertion location of async errors [#2036](https://github.com/MithrilJS/mithril.js/issues/2036)
- expose the default reporter as `o.report(results)`
- Don't try to access the stack traces in IE9
### 1.4.1
_2018-05-03_
- Identical to v1.4.0, but with UNIX-style line endings so that BASH is happy.
### 1.4.0
_2017-12-01_
- Added support for async functions and promises in tests ([#1928](https://github.com/MithrilJS/mithril.js/pull/1928), [@StephanHoyer](https://github.com/StephanHoyer))
- Error handling for async tests with `done` callbacks supports error as first argument ([#1928](https://github.com/MithrilJS/mithril.js/pull/1928))
- Error messages which include newline characters do not swallow the stack trace [#1495](https://github.com/MithrilJS/mithril.js/issues/1495) ([#1984](https://github.com/MithrilJS/mithril.js/pull/1984), [@RodericDay](https://github.com/RodericDay))
### 1.3 and earlier
- Log using util.inspect to show object content instead of "[object Object]" ([#1661](https://github.com/MithrilJS/mithril.js/issues/1661), [@porsager](https://github.com/porsager))
- Shell command: Ignore hidden directories and files ([#1855](https://github.com/MithrilJS/mithril.js/pull/1855) [@pdfernhout)](https://github.com/pdfernhout))
- Library: Add the possibility to name new test suites ([#1529](https://github.com/MithrilJS/mithril.js/pull/1529))

View File

@@ -0,0 +1,397 @@
"use strict"
;(function(m) {
if (typeof module !== "undefined") module["exports"] = m()
else window.o = m()
})(function init(name) {
console.warn(
"Please switch to the `ospec` package to remove this warning and see " +
"the most recent features. Using the `ospec` bundled within Mithril.js " +
"is deprecated, and it will be removed in the next major release."
)
var spec = {}, subjects = [], results, only = [], ctx = spec, start, stack = 0, nextTickish, hasProcess = typeof process === "object", hasOwn = ({}).hasOwnProperty
var ospecFileName = getStackName(ensureStackTrace(new Error), /[\/\\](.*?):\d+:\d+/), timeoutStackName
var globalTimeout = noTimeoutRightNow
var currentTestError = null
if (name != null) spec[name] = ctx = {}
try {throw new Error} catch (e) {
var ospecFileName = e.stack && (/[\/\\](.*?):\d+:\d+/).test(e.stack) ? e.stack.match(/[\/\\](.*?):\d+:\d+/)[1] : null
}
function o(subject, predicate) {
if (predicate === undefined) {
if (!isRunning()) throw new Error("Assertions should not occur outside test definitions.")
return new Assert(subject)
} else {
if (isRunning()) throw new Error("Test definitions and hooks shouldn't be nested. To group tests, use 'o.spec()'.")
subject = String(subject)
if (subject.charCodeAt(0) === 1) throw new Error("test names starting with '\\x01' are reserved for internal use.")
ctx[unique(subject)] = new Task(predicate, ensureStackTrace(new Error))
}
}
o.before = hook("\x01before")
o.after = hook("\x01after")
o.beforeEach = hook("\x01beforeEach")
o.afterEach = hook("\x01afterEach")
o.specTimeout = function (t) {
if (isRunning()) throw new Error("o.specTimeout() can only be called before o.run().")
if (hasOwn.call(ctx, "\x01specTimeout")) throw new Error("A default timeout has already been defined in this context.")
if (typeof t !== "number") throw new Error("o.specTimeout() expects a number as argument.")
ctx["\x01specTimeout"] = t
}
o.new = init
o.spec = function(subject, predicate) {
var parent = ctx
ctx = ctx[unique(subject)] = {}
predicate()
ctx = parent
}
o.only = function(subject, predicate, silent) {
if (!silent) console.log(
highlight("/!\\ WARNING /!\\ o.only() mode") + "\n" + o.cleanStackTrace(ensureStackTrace(new Error)) + "\n",
cStyle("red"), ""
)
only.push(predicate)
o(subject, predicate)
}
o.spy = function(fn) {
var spy = function() {
spy.this = this
spy.args = [].slice.call(arguments)
spy.calls.push({this: this, args: spy.args})
spy.callCount++
if (fn) return fn.apply(this, arguments)
}
if (fn)
Object.defineProperties(spy, {
length: {value: fn.length},
name: {value: fn.name}
})
spy.args = []
spy.calls = []
spy.callCount = 0
return spy
}
o.cleanStackTrace = function(error) {
// For IE 10+ in quirks mode, and IE 9- in any mode, errors don't have a stack
if (error.stack == null) return ""
var i = 0, header = error.message ? error.name + ": " + error.message : error.name, stack
// some environments add the name and message to the stack trace
if (error.stack.indexOf(header) === 0) {
stack = error.stack.slice(header.length).split(/\r?\n/)
stack.shift() // drop the initial empty string
} else {
stack = error.stack.split(/\r?\n/)
}
if (ospecFileName == null) return stack.join("\n")
// skip ospec-related entries on the stack
while (stack[i] != null && stack[i].indexOf(ospecFileName) !== -1) i++
// now we're in user code (or past the stack end)
return stack[i]
}
o.timeout = function(n) {
globalTimeout(n)
}
o.run = function(reporter) {
results = []
start = new Date
test(spec, [], [], new Task(function() {
setTimeout(function () {
timeoutStackName = getStackName({stack: o.cleanStackTrace(ensureStackTrace(new Error))}, /([\w \.]+?:\d+:\d+)/)
if (typeof reporter === "function") reporter(results)
else {
var errCount = o.report(results)
if (hasProcess && errCount !== 0) process.exit(1) // eslint-disable-line no-process-exit
}
})
}, null), 200 /*default timeout delay*/)
function test(spec, pre, post, finalize, defaultDelay) {
if (hasOwn.call(spec, "\x01specTimeout")) defaultDelay = spec["\x01specTimeout"]
pre = [].concat(pre, spec["\x01beforeEach"] || [])
post = [].concat(spec["\x01afterEach"] || [], post)
series([].concat(spec["\x01before"] || [], Object.keys(spec).reduce(function(tasks, key) {
if (key.charCodeAt(0) !== 1 && (only.length === 0 || only.indexOf(spec[key].fn) !== -1 || !(spec[key] instanceof Task))) {
tasks.push(new Task(function(done) {
o.timeout(Infinity)
subjects.push(key)
var pop = new Task(function pop() {subjects.pop(), done()}, null)
if (spec[key] instanceof Task) series([].concat(pre, spec[key], post, pop), defaultDelay)
else test(spec[key], pre, post, pop, defaultDelay)
}, null))
}
return tasks
}, []), spec["\x01after"] || [], finalize), defaultDelay)
}
function series(tasks, defaultDelay) {
var cursor = 0
next()
function next() {
if (cursor === tasks.length) return
var task = tasks[cursor++]
var fn = task.fn
currentTestError = task.err
var timeout = 0, delay = defaultDelay, s = new Date
var current = cursor
var arg
globalTimeout = setDelay
var isDone = false
// public API, may only be called once from use code (or after returned Promise resolution)
function done(err) {
if (!isDone) isDone = true
else throw new Error("'" + arg + "()' should only be called once.")
if (timeout === undefined) console.warn("# elapsed: " + Math.round(new Date - s) + "ms, expected under " + delay + "ms\n" + o.cleanStackTrace(task.err))
finalizeAsync(err)
}
// for internal use only
function finalizeAsync(err) {
if (err == null) {
if (task.err != null) succeed(new Assert)
} else {
if (err instanceof Error) fail(new Assert, err.message, err)
else fail(new Assert, String(err), null)
}
if (timeout !== undefined) timeout = clearTimeout(timeout)
if (current === cursor) next()
}
function startTimer() {
timeout = setTimeout(function() {
timeout = undefined
finalizeAsync("async test timed out after " + delay + "ms")
}, Math.min(delay, 2147483647))
}
function setDelay (t) {
if (typeof t !== "number") throw new Error("timeout() and o.timeout() expect a number as argument.")
delay = t
}
if (fn.length > 0) {
var body = fn.toString()
arg = (body.match(/^(.+?)(?:\s|\/\*[\s\S]*?\*\/|\/\/.*?\n)*=>/) || body.match(/\((?:\s|\/\*[\s\S]*?\*\/|\/\/.*?\n)*(.+?)(?:\s|\/\*[\s\S]*?\*\/|\/\/.*?\n)*[,\)]/) || []).pop()
if (body.indexOf(arg) === body.lastIndexOf(arg)) {
var e = new Error
e.stack = "'" + arg + "()' should be called at least once\n" + o.cleanStackTrace(task.err)
throw e
}
try {
fn(done, setDelay)
}
catch (e) {
if (task.err != null) finalizeAsync(e)
// The errors of internal tasks (which don't have an Err) are ospec bugs and must be rethrown.
else throw e
}
if (timeout === 0) {
startTimer()
}
} else {
try{
var p = fn()
if (p && p.then) {
startTimer()
p.then(function() { done() }, done)
} else {
nextTickish(next)
}
} catch (e) {
if (task.err != null) finalizeAsync(e)
// The errors of internal tasks (which don't have an Err) are ospec bugs and must be rethrown.
else throw e
}
}
globalTimeout = noTimeoutRightNow
}
}
}
function unique(subject) {
if (hasOwn.call(ctx, subject)) {
console.warn("A test or a spec named '" + subject + "' was already defined.")
while (hasOwn.call(ctx, subject)) subject += "*"
}
return subject
}
function hook(name) {
return function(predicate) {
if (ctx[name]) throw new Error(name.slice(1) + " should be defined outside of a loop or inside a nested test group.")
ctx[name] = new Task(predicate, ensureStackTrace(new Error))
}
}
define("equals", "should equal", function(a, b) {return a === b})
define("notEquals", "should not equal", function(a, b) {return a !== b})
define("deepEquals", "should deep equal", deepEqual)
define("notDeepEquals", "should not deep equal", function(a, b) {return !deepEqual(a, b)})
define("throws", "should throw a", throws)
define("notThrows", "should not throw a", function(a, b) {return !throws(a, b)})
function isArguments(a) {
if ("callee" in a) {
for (var i in a) if (i === "callee") return false
return true
}
}
function deepEqual(a, b) {
if (a === b) return true
if (a === null ^ b === null || a === undefined ^ b === undefined) return false // eslint-disable-line no-bitwise
if (typeof a === "object" && typeof b === "object") {
var aIsArgs = isArguments(a), bIsArgs = isArguments(b)
if (a.constructor === Object && b.constructor === Object && !aIsArgs && !bIsArgs) {
for (var i in a) {
if ((!(i in b)) || !deepEqual(a[i], b[i])) return false
}
for (var i in b) {
if (!(i in a)) return false
}
return true
}
if (a.length === b.length && (a instanceof Array && b instanceof Array || aIsArgs && bIsArgs)) {
var aKeys = Object.getOwnPropertyNames(a), bKeys = Object.getOwnPropertyNames(b)
if (aKeys.length !== bKeys.length) return false
for (var i = 0; i < aKeys.length; i++) {
if (!hasOwn.call(b, aKeys[i]) || !deepEqual(a[aKeys[i]], b[aKeys[i]])) return false
}
return true
}
if (a instanceof Date && b instanceof Date) return a.getTime() === b.getTime()
if (typeof Buffer === "function" && a instanceof Buffer && b instanceof Buffer) {
for (var i = 0; i < a.length; i++) {
if (a[i] !== b[i]) return false
}
return true
}
if (a.valueOf() === b.valueOf()) return true
}
return false
}
function throws(a, b){
try{
a()
}catch(e){
if(typeof b === "string"){
return (e.message === b)
}else{
return (e instanceof b)
}
}
return false
}
function isRunning() {return results != null}
function Assert(value) {
this.value = value
this.i = results.length
results.push({pass: null, context: "", message: "Incomplete assertion in the test definition starting at...", error: currentTestError, testError: currentTestError})
}
function Task(fn, err) {
this.fn = fn
this.err = err
}
function define(name, verb, compare) {
Assert.prototype[name] = function assert(value) {
var self = this
var message = serialize(self.value) + "\n " + verb + "\n" + serialize(value)
if (compare(self.value, value)) succeed(self, message)
else fail(self, message)
var result = results[self.i]
return function(message) {
if (!result.pass) {
result.message = message + "\n\n" + result.message
}
}
}
}
function succeed(assertion, message) {
results[assertion.i].pass = true
results[assertion.i].context = subjects.join(" > ")
results[assertion.i].message = message
}
function fail(assertion, message, error) {
results[assertion.i].pass = false
results[assertion.i].context = subjects.join(" > ")
results[assertion.i].message = message
results[assertion.i].error = error != null ? error : ensureStackTrace(new Error)
}
function serialize(value) {
if (hasProcess) return require("util").inspect(value) // eslint-disable-line global-require
if (value === null || (typeof value === "object" && !(value instanceof Array)) || typeof value === "number") return String(value)
else if (typeof value === "function") return value.name || "<anonymous function>"
try {return JSON.stringify(value)} catch (e) {return String(value)}
}
function noTimeoutRightNow() {
throw new Error("o.timeout must be called snchronously from within a test definition or a hook.")
}
var colorCodes = {
red: "31m",
red2: "31;1m",
green: "32;1m"
}
function highlight(message, color) {
var code = colorCodes[color] || colorCodes.red;
return hasProcess ? (process.stdout.isTTY ? "\x1b[" + code + message + "\x1b[0m" : message) : "%c" + message + "%c "
}
function cStyle(color, bold) {
return hasProcess||!color ? "" : "color:"+color+(bold ? ";font-weight:bold" : "")
}
function ensureStackTrace(error) {
// mandatory to get a stack in IE 10 and 11 (and maybe other envs?)
if (error.stack === undefined) try { throw error } catch(e) {return e}
else return error
}
function getStackName(e, exp) {
return e.stack && exp.test(e.stack) ? e.stack.match(exp)[1] : null
}
o.report = function (results) {
var errCount = 0
for (var i = 0, r; r = results[i]; i++) {
if (r.pass == null) {
r.testError.stack = r.message + "\n" + o.cleanStackTrace(r.testError)
r.testError.message = r.message
throw r.testError
}
if (!r.pass) {
var stackTrace = o.cleanStackTrace(r.error)
var couldHaveABetterStackTrace = !stackTrace || timeoutStackName != null && stackTrace.indexOf(timeoutStackName) !== -1
if (couldHaveABetterStackTrace) stackTrace = r.testError != null ? o.cleanStackTrace(r.testError) : r.error.stack || ""
console.error(
(hasProcess ? "\n" : "") +
highlight(r.context + ":", "red2") + "\n" +
highlight(r.message, "red") +
(stackTrace ? "\n" + stackTrace + "\n" : ""),
cStyle("black", true), "", // reset to default
cStyle("red"), cStyle("black")
)
errCount++
}
}
var pl = results.length === 1 ? "" : "s"
var resultSummary = (errCount === 0) ?
highlight((pl ? "All " : "The ") + results.length + " assertion" + pl + " passed", "green"):
highlight(errCount + " out of " + results.length + " assertion" + pl + " failed", "red2")
var runningTime = " in " + Math.round(Date.now() - start) + "ms"
console.log(
(hasProcess ? "\n" : "") +
(name ? name + ": " : "") + resultSummary + runningTime,
cStyle((errCount === 0 ? "green" : "red"), true), ""
)
return errCount
}
if (hasProcess) {
nextTickish = process.nextTick
} else {
nextTickish = function fakeFastNextTick(next) {
if (stack++ < 5000) next()
else setTimeout(next, stack = 0)
}
}
return o
})

View File

@@ -0,0 +1,19 @@
{
"name": "ospec",
"version": "4.0.1",
"description": "Noiseless testing framework",
"main": "ospec.js",
"directories": {
"test": "tests"
},
"keywords": [ "testing" ],
"author": "Leo Horie <leohorie@hotmail.com>",
"license": "MIT",
"bin": {
"ospec": "./bin/ospec"
},
"repository": "MithrilJS/mithril.js",
"dependencies": {
"glob": "^7.1.3"
}
}

View File

@@ -0,0 +1,66 @@
{
"name": "mithril",
"version": "2.2.2",
"description": "A framework for building brilliant applications",
"author": "Leo Horie",
"license": "MIT",
"unpkg": "mithril.min.js",
"repository": "github:MithrilJS/mithril.js",
"scripts": {
"precommit": "lint-staged",
"watch": "run-p watch:**",
"watch:js": "node scripts/bundler browser.js -output mithril.js -watch",
"watch:docs": "node scripts/generate-docs --watch",
"watch:docs-lint": "node scripts/lint-docs --watch",
"build": "run-p build:browser build:min build:stream-min",
"build:browser": "node scripts/bundler browser.js -output mithril.js",
"build:docs": "node scripts/generate-docs",
"build:min": "node scripts/bundler browser.js -output mithril.min.js -minify -save",
"build:stream-min": "node scripts/minify-stream",
"cleanup:lint": "rimraf .eslintcache .lint-docs-cache",
"lint": "run-s -cn lint:**",
"lint:js": "eslint --cache",
"lint:docs": "node scripts/lint-docs --cache",
"perf": "node performance/test-perf.js",
"pretest": "npm run lint",
"test": "run-s test:js",
"test:js": "ospec",
"cover": "istanbul cover --print both ospec/bin/ospec"
},
"devDependencies": {
"@alrra/travis-scripts": "^3.0.1",
"@babel/parser": "^7.7.5",
"benchmark": "^2.1.4",
"chokidar": "^3.2.1",
"escape-string-regexp": "^2.0.0",
"eslint": "^8.9.0",
"gh-pages": "^2.1.1",
"glob": "^7.1.4",
"html-minifier": "^4.0.0",
"istanbul": "^0.4.5",
"lint-staged": "^12.3.4",
"locater": "^1.3.0",
"marked": "^4.0.10",
"minimist": "^1.2.0",
"npm-run-all": "^4.1.5",
"ospec": "^4.0.1",
"pinpoint": "^1.1.0",
"request": "^2.88.0",
"request-promise-native": "^1.0.7",
"rimraf": "^3.0.0",
"semver": "^6.3.0",
"terser": "^4.3.4"
},
"bin": {
"ospec": "./ospec/bin/ospec"
},
"lint-staged": {
"*.js": [
"eslint . --fix",
"git add"
]
},
"dependencies": {
"ospec": "4.0.0"
}
}

View File

@@ -0,0 +1,43 @@
"use strict"
var buildQueryString = require("../querystring/build")
var assign = require("../util/assign")
// Returns `path` from `template` + `params`
module.exports = function(template, params) {
if ((/:([^\/\.-]+)(\.{3})?:/).test(template)) {
throw new SyntaxError("Template parameter names must be separated by either a '/', '-', or '.'.")
}
if (params == null) return template
var queryIndex = template.indexOf("?")
var hashIndex = template.indexOf("#")
var queryEnd = hashIndex < 0 ? template.length : hashIndex
var pathEnd = queryIndex < 0 ? queryEnd : queryIndex
var path = template.slice(0, pathEnd)
var query = {}
assign(query, params)
var resolved = path.replace(/:([^\/\.-]+)(\.{3})?/g, function(m, key, variadic) {
delete query[key]
// If no such parameter exists, don't interpolate it.
if (params[key] == null) return m
// Escape normal parameters, but not variadic ones.
return variadic ? params[key] : encodeURIComponent(String(params[key]))
})
// In case the template substitution adds new query/hash parameters.
var newQueryIndex = resolved.indexOf("?")
var newHashIndex = resolved.indexOf("#")
var newQueryEnd = newHashIndex < 0 ? resolved.length : newHashIndex
var newPathEnd = newQueryIndex < 0 ? newQueryEnd : newQueryIndex
var result = resolved.slice(0, newPathEnd)
if (queryIndex >= 0) result += template.slice(queryIndex, queryEnd)
if (newQueryIndex >= 0) result += (queryIndex < 0 ? "?" : "&") + resolved.slice(newQueryIndex, newQueryEnd)
var querystring = buildQueryString(query)
if (querystring) result += (queryIndex < 0 && newQueryIndex < 0 ? "?" : "&") + querystring
if (hashIndex >= 0) result += template.slice(hashIndex)
if (newHashIndex >= 0) result += (hashIndex < 0 ? "" : "&") + resolved.slice(newHashIndex)
return result
}

View File

@@ -0,0 +1,43 @@
"use strict"
var parsePathname = require("./parse")
// Compiles a template into a function that takes a resolved path (without query
// strings) and returns an object containing the template parameters with their
// parsed values. This expects the input of the compiled template to be the
// output of `parsePathname`. Note that it does *not* remove query parameters
// specified in the template.
module.exports = function(template) {
var templateData = parsePathname(template)
var templateKeys = Object.keys(templateData.params)
var keys = []
var regexp = new RegExp("^" + templateData.path.replace(
// I escape literal text so people can use things like `:file.:ext` or
// `:lang-:locale` in routes. This is all merged into one pass so I
// don't also accidentally escape `-` and make it harder to detect it to
// ban it from template parameters.
/:([^\/.-]+)(\.{3}|\.(?!\.)|-)?|[\\^$*+.()|\[\]{}]/g,
function(m, key, extra) {
if (key == null) return "\\" + m
keys.push({k: key, r: extra === "..."})
if (extra === "...") return "(.*)"
if (extra === ".") return "([^/]+)\\."
return "([^/]+)" + (extra || "")
}
) + "$")
return function(data) {
// First, check the params. Usually, there isn't any, and it's just
// checking a static set.
for (var i = 0; i < templateKeys.length; i++) {
if (templateData.params[templateKeys[i]] !== data.params[templateKeys[i]]) return false
}
// If no interpolations exist, let's skip all the ceremony
if (!keys.length) return regexp.test(data.path)
var values = regexp.exec(data.path)
if (values == null) return false
for (var i = 0; i < keys.length; i++) {
data.params[keys[i].k] = keys[i].r ? values[i + 1] : decodeURIComponent(values[i + 1])
}
return true
}
}

View File

@@ -0,0 +1,24 @@
"use strict"
var parseQueryString = require("../querystring/parse")
// Returns `{path, params}` from `url`
module.exports = function(url) {
var queryIndex = url.indexOf("?")
var hashIndex = url.indexOf("#")
var queryEnd = hashIndex < 0 ? url.length : hashIndex
var pathEnd = queryIndex < 0 ? queryEnd : queryIndex
var path = url.slice(0, pathEnd).replace(/\/{2,}/g, "/")
if (!path) path = "/"
else {
if (path[0] !== "/") path = "/" + path
if (path.length > 1 && path[path.length - 1] === "/") path = path.slice(0, -1)
}
return {
path: path,
params: queryIndex < 0
? {}
: parseQueryString(url.slice(queryIndex + 1, queryEnd)),
}
}

View File

@@ -0,0 +1,12 @@
<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8">
<script src="../node_modules/lodash/lodash.js"></script>
<script src="../node_modules/benchmark/benchmark.js"></script>
<script src="../mithril.js"></script>
<script src="test-perf.js"></script>
</head>
<body>
</body>
</html>

View File

@@ -0,0 +1,493 @@
"use strict"
/* Based off of preact's perf tests, so including their MIT license */
/*
The MIT License (MIT)
Copyright (c) 2017 Jason Miller
Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
in the Software without restriction, including without limitation the rights
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
copies of the Software, and to permit persons to whom the Software is
furnished to do so, subject to the following conditions:
The above copyright notice and this permission notice shall be included in all
copies or substantial portions of the Software.
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
SOFTWARE.
*/
// Note: this tests against the generated bundle in browsers, but it tests
// against `index.js` in Node. Please do keep that in mind while testing.
//
// Mithril.js and Benchmark.js are loaded globally via bundle in the browser, so
// this doesn't require a CommonJS sham polyfill.
// I add it globally just so it's visible in the tests.
/* global m, rootElem: true */
// set up browser env on before running tests
var isDOM = typeof window !== "undefined"
var Benchmark
if (isDOM) {
Benchmark = window.Benchmark
window.rootElem = null
} else {
/* eslint-disable global-require */
global.window = require("../test-utils/browserMock")()
global.document = window.document
// We're benchmarking renders, not our throttling.
global.requestAnimationFrame = function () {
throw new Error("This should never be called.")
}
global.m = require("../index.js")
global.rootElem = null
Benchmark = require("benchmark")
/* eslint-enable global-require */
}
function cycleRoot() {
if (rootElem) document.body.removeChild(rootElem)
document.body.appendChild(rootElem = document.createElement("div"))
}
// Initialize benchmark suite
Benchmark.options.async = true
Benchmark.options.initCount = 10
Benchmark.options.minSamples = 40
if (isDOM) {
// Wait long enough for the browser to actually commit the DOM changes to
// the screen before moving on to the next cycle, so things are at least
// reasonably fresh each cycle.
Benchmark.options.delay = 1 / 30 /* frames per second */
}
var suite = new Benchmark.Suite("Mithril.js perf", {
onStart: function () {
this.start = Date.now()
},
onCycle: function (e) {
console.log(e.target.toString())
cycleRoot()
},
onComplete: function () {
console.log("Completed perf tests in " + (Date.now() - this.start) + "ms")
},
onError: function (e) {
console.error(e)
},
})
// eslint-disable-next-line no-unused-vars
var xsuite = {add: function(name) { console.log("skipping " + name) }}
suite.add("construct large vnode tree", {
setup: function () {
this.fields = []
for(var i=100; i--;) {
this.fields.push((i * 999).toString(36))
}
},
fn: function () {
m(".foo.bar[data-foo=bar]", {p: 2},
m("header",
m("h1.asdf", "a ", "b", " c ", 0, " d"),
m("nav",
m("a[href=/foo]", "Foo"),
m("a[href=/bar]", "Bar")
)
),
m("main",
m("form",
{onSubmit: function () {}},
m("input[type=checkbox][checked]"),
m("input[type=checkbox]"),
m("fieldset",
this.fields.map(function (field) {
return m("label",
field,
":",
m("input", {placeholder: field})
)
})
),
m("button-bar",
m("button",
{style: "width:10px; height:10px; border:1px solid #FFF;"},
"Normal CSS"
),
m("button",
{style: "top:0 ; right: 20"},
"Poor CSS"
),
m("button",
{style: "invalid-prop:1;padding:1px;font:12px/1.1 arial,sans-serif;", icon: true},
"Poorer CSS"
),
m("button",
{style: {margin: 0, padding: "10px", overflow: "visible"}},
"Object CSS"
)
)
)
)
)
},
})
suite.add("rerender identical vnode", {
setup: function () {
this.cached = m(".foo.bar[data-foo=bar]", {p: 2},
m("header",
m("h1.asdf", "a ", "b", " c ", 0, " d"),
m("nav",
m("a", {href: "/foo"}, "Foo"),
m("a", {href: "/bar"}, "Bar")
)
),
m("main",
m("form", {onSubmit: function () {}},
m("input", {type: "checkbox", checked: true}),
m("input", {type: "checkbox", checked: false}),
m("fieldset",
m("label",
m("input", {type: "radio", checked: true})
),
m("label",
m("input", {type: "radio"})
)
),
m("button-bar",
m("button",
{style: "width:10px; height:10px; border:1px solid #FFF;"},
"Normal CSS"
),
m("button",
{style: "top:0 ; right: 20"},
"Poor CSS"
),
m("button",
{style: "invalid-prop:1;padding:1px;font:12px/1.1 arial,sans-serif;", icon: true},
"Poorer CSS"
),
m("button",
{style: {margin: 0, padding: "10px", overflow: "visible"}},
"Object CSS"
)
)
)
)
)
},
fn: function () {
m.render(rootElem, this.cached)
},
})
suite.add("rerender same tree", {
fn: function () {
m.render(rootElem, m(".foo.bar[data-foo=bar]", {p: 2},
m("header",
m("h1.asdf", "a ", "b", " c ", 0, " d"),
m("nav",
m("a", {href: "/foo"}, "Foo"),
m("a", {href: "/bar"}, "Bar")
)
),
m("main",
m("form", {onSubmit: function () {}},
m("input", {type: "checkbox", checked: true}),
m("input", {type: "checkbox", checked: false}),
m("fieldset",
m("label",
m("input", {type: "radio", checked: true})
),
m("label",
m("input", {type: "radio"})
)
),
m("button-bar",
m("button",
{style: "width:10px; height:10px; border:1px solid #FFF;"},
"Normal CSS"
),
m("button",
{style: "top:0 ; right: 20"},
"Poor CSS"
),
m("button",
{style: "invalid-prop:1;padding:1px;font:12px/1.1 arial,sans-serif;", icon: true},
"Poorer CSS"
),
m("button",
{style: {margin: 0, padding: "10px", overflow: "visible"}},
"Object CSS"
)
)
)
)
))
},
})
suite.add("add large nested tree", {
setup: function () {
var fields = []
for(var i=100; i--;) {
fields.push((i * 999).toString(36))
}
var NestedHeader = {
view: function () {
return m("header",
m("h1.asdf", "a ", "b", " c ", 0, " d"),
m("nav",
m("a", {href: "/foo"}, "Foo"),
m("a", {href: "/bar"}, "Bar")
)
)
}
}
var NestedForm = {
view: function () {
return m("form", {onSubmit: function () {}},
m("input[type=checkbox][checked]"),
m("input[type=checkbox]", {checked: false}),
m("fieldset",
m("label",
m("input[type=radio][checked]")
),
m("label",
m("input[type=radio]")
)
),
m("fieldset",
fields.map(function (field) {
return m("label",
field,
":",
m("input", {placeholder: field})
)
})
),
m(NestedButtonBar, null)
)
}
}
var NestedButtonBar = {
view: function () {
return m(".button-bar",
m(NestedButton,
{style: "width:10px; height:10px; border:1px solid #FFF;"},
"Normal CSS"
),
m(NestedButton,
{style: "top:0 ; right: 20"},
"Poor CSS"
),
m(NestedButton,
{style: "invalid-prop:1;padding:1px;font:12px/1.1 arial,sans-serif;", icon: true},
"Poorer CSS"
),
m(NestedButton,
{style: {margin: 0, padding: "10px", overflow: "visible"}},
"Object CSS"
)
)
}
}
var NestedButton = {
view: function (vnode) {
return m("button", m.censor(vnode.attrs), vnode.children)
}
}
var NestedMain = {
view: function () {
return m(NestedForm)
}
}
this.NestedRoot = {
view: function () {
return m("div.foo.bar[data-foo=bar]",
{p: 2},
m(NestedHeader),
m(NestedMain)
)
}
}
},
fn: function () {
m.render(rootElem, m(this.NestedRoot))
},
})
suite.add("mutate styles/properties", {
setup: function () {
function get(obj, i) { return obj[i % obj.length] }
var counter = 0
var classes = ["foo", "foo bar", "", "baz-bat", null, "fooga", null, null, undefined]
var styles = []
var multivalue = ["0 1px", "0 0 1px 0", "0", "1px", "20px 10px", "7em 5px", "1px 0 5em 2px"]
var stylekeys = [
["left", function (c) { return c % 3 ? c + "px" : c }],
["top", function (c) { return c % 2 ? c + "px" : c }],
["margin", function (c) { return get(multivalue, c).replace("1px", c+"px") }],
["padding", function (c) { return get(multivalue, c) }],
["position", function (c) { return c%5 ? c%2 ? "absolute" : "relative" : null }],
["display", function (c) { return c%10 ? c%2 ? "block" : "inline" : "none" }],
["color", function (c) { return ("rgba(" + (c%255) + ", " + (255 - c%255) + ", " + (50+c%150) + ", " + (c%50/50) + ")") }],
["border", function (c) { return c%5 ? (c%10) + "px " + (c%2?"solid":"dotted") + " " + stylekeys[6][1](c) : "" }]
]
var i, j, style, conf
for (i=0; i<1000; i++) {
style = {}
for (j=0; j<i%10; j++) {
conf = get(stylekeys, ++counter)
style[conf[0]] = conf[1](counter)
}
styles[i] = style
}
var count = 0
this.app = function () {
var vnodes = []
for (var index = ++count, last = index + 300; index < last; index++) {
vnodes.push(
m("div.booga",
{
class: get(classes, index),
"data-index": index,
title: index.toString(36)
},
m("input.dooga", {type: "checkbox", checked: index % 3 === 0}),
m("input", {value: "test " + Math.floor(index / 4), disabled: index % 10 ? null : true}),
m("div", {class: get(classes, index * 11)},
m("p", {style: get(styles, index)}, "p1"),
m("p", {style: get(styles, index + 1)}, "p2"),
m("p", {style: get(styles, index * 2)}, "p3"),
m("p.zooga", {style: get(styles, index * 3 + 1), className: get(classes, index * 7)}, "p4")
)
)
)
}
return vnodes
}
},
fn: function () {
m.render(rootElem, this.app())
},
})
suite.add("repeated add/removal", {
setup: function () {
var RepeatedHeader = {
view: function () {
return m("header",
m("h1.asdf", "a ", "b", " c ", 0, " d"),
m("nav",
m("a", {href: "/foo"}, "Foo"),
m("a", {href: "/bar"}, "Bar")
)
)
}
}
var RepeatedForm = {
view: function () {
return m("form", {onSubmit: function () {}},
m("input", {type: "checkbox", checked: true}),
m("input", {type: "checkbox", checked: false}),
m("fieldset",
m("label",
m("input", {type: "radio", checked: true})
),
m("label",
m("input", {type: "radio"})
)
),
m(RepeatedButtonBar, null)
)
}
}
var RepeatedButtonBar = {
view: function () {
return m(".button-bar",
m(RepeatedButton,
{style: "width:10px; height:10px; border:1px solid #FFF;"},
"Normal CSS"
),
m(RepeatedButton,
{style: "top:0 ; right: 20"},
"Poor CSS"
),
m(RepeatedButton,
{style: "invalid-prop:1;padding:1px;font:12px/1.1 arial,sans-serif;", icon: true},
"Poorer CSS"
),
m(RepeatedButton,
{style: {margin: 0, padding: "10px", overflow: "visible"}},
"Object CSS"
)
)
}
}
var RepeatedButton = {
view: function (vnode) {
return m("button", vnode.attrs, vnode.children)
}
}
var RepeatedMain = {
view: function () {
return m(RepeatedForm)
}
}
this.RepeatedRoot = {
view: function () {
return m("div.foo.bar[data-foo=bar]",
{p: 2},
m(RepeatedHeader, null),
m(RepeatedMain, null)
)
}
}
},
fn: function () {
m.render(rootElem, [m(this.RepeatedRoot)])
m.render(rootElem, [])
},
})
if (isDOM) {
window.onload = function () {
cycleRoot()
suite.run()
}
} else {
cycleRoot()
suite.run()
}

View File

@@ -0,0 +1,15 @@
"use strict"
module.exports = {
"extends": "../.eslintrc.js",
"env": {
"browser": null,
"es6": null,
},
"parserOptions": {
"ecmaVersion": 5,
},
"rules": {
"no-process-env": "off",
},
};

View File

@@ -0,0 +1,112 @@
"use strict"
/** @constructor */
var PromisePolyfill = function(executor) {
if (!(this instanceof PromisePolyfill)) throw new Error("Promise must be called with 'new'.")
if (typeof executor !== "function") throw new TypeError("executor must be a function.")
var self = this, resolvers = [], rejectors = [], resolveCurrent = handler(resolvers, true), rejectCurrent = handler(rejectors, false)
var instance = self._instance = {resolvers: resolvers, rejectors: rejectors}
var callAsync = typeof setImmediate === "function" ? setImmediate : setTimeout
function handler(list, shouldAbsorb) {
return function execute(value) {
var then
try {
if (shouldAbsorb && value != null && (typeof value === "object" || typeof value === "function") && typeof (then = value.then) === "function") {
if (value === self) throw new TypeError("Promise can't be resolved with itself.")
executeOnce(then.bind(value))
}
else {
callAsync(function() {
if (!shouldAbsorb && list.length === 0) console.error("Possible unhandled promise rejection:", value)
for (var i = 0; i < list.length; i++) list[i](value)
resolvers.length = 0, rejectors.length = 0
instance.state = shouldAbsorb
instance.retry = function() {execute(value)}
})
}
}
catch (e) {
rejectCurrent(e)
}
}
}
function executeOnce(then) {
var runs = 0
function run(fn) {
return function(value) {
if (runs++ > 0) return
fn(value)
}
}
var onerror = run(rejectCurrent)
try {then(run(resolveCurrent), onerror)} catch (e) {onerror(e)}
}
executeOnce(executor)
}
PromisePolyfill.prototype.then = function(onFulfilled, onRejection) {
var self = this, instance = self._instance
function handle(callback, list, next, state) {
list.push(function(value) {
if (typeof callback !== "function") next(value)
else try {resolveNext(callback(value))} catch (e) {if (rejectNext) rejectNext(e)}
})
if (typeof instance.retry === "function" && state === instance.state) instance.retry()
}
var resolveNext, rejectNext
var promise = new PromisePolyfill(function(resolve, reject) {resolveNext = resolve, rejectNext = reject})
handle(onFulfilled, instance.resolvers, resolveNext, true), handle(onRejection, instance.rejectors, rejectNext, false)
return promise
}
PromisePolyfill.prototype.catch = function(onRejection) {
return this.then(null, onRejection)
}
PromisePolyfill.prototype.finally = function(callback) {
return this.then(
function(value) {
return PromisePolyfill.resolve(callback()).then(function() {
return value
})
},
function(reason) {
return PromisePolyfill.resolve(callback()).then(function() {
return PromisePolyfill.reject(reason);
})
}
)
}
PromisePolyfill.resolve = function(value) {
if (value instanceof PromisePolyfill) return value
return new PromisePolyfill(function(resolve) {resolve(value)})
}
PromisePolyfill.reject = function(value) {
return new PromisePolyfill(function(resolve, reject) {reject(value)})
}
PromisePolyfill.all = function(list) {
return new PromisePolyfill(function(resolve, reject) {
var total = list.length, count = 0, values = []
if (list.length === 0) resolve([])
else for (var i = 0; i < list.length; i++) {
(function(i) {
function consume(value) {
count++
values[i] = value
if (count === total) resolve(values)
}
if (list[i] != null && (typeof list[i] === "object" || typeof list[i] === "function") && typeof list[i].then === "function") {
list[i].then(consume, reject)
}
else consume(list[i])
})(i)
}
})
}
PromisePolyfill.race = function(list) {
return new PromisePolyfill(function(resolve, reject) {
for (var i = 0; i < list.length; i++) {
list[i].then(resolve, reject)
}
})
}
module.exports = PromisePolyfill

View File

@@ -0,0 +1,22 @@
/* global window */
"use strict"
var PromisePolyfill = require("./polyfill")
if (typeof window !== "undefined") {
if (typeof window.Promise === "undefined") {
window.Promise = PromisePolyfill
} else if (!window.Promise.prototype.finally) {
window.Promise.prototype.finally = PromisePolyfill.prototype.finally
}
module.exports = window.Promise
} else if (typeof global !== "undefined") {
if (typeof global.Promise === "undefined") {
global.Promise = PromisePolyfill
} else if (!global.Promise.prototype.finally) {
global.Promise.prototype.finally = PromisePolyfill.prototype.finally
}
module.exports = global.Promise
} else {
module.exports = PromisePolyfill
}

View File

@@ -0,0 +1,26 @@
"use strict"
module.exports = function(object) {
if (Object.prototype.toString.call(object) !== "[object Object]") return ""
var args = []
for (var key in object) {
destructure(key, object[key])
}
return args.join("&")
function destructure(key, value) {
if (Array.isArray(value)) {
for (var i = 0; i < value.length; i++) {
destructure(key + "[" + i + "]", value[i])
}
}
else if (Object.prototype.toString.call(value) === "[object Object]") {
for (var i in value) {
destructure(key + "[" + i + "]", value[i])
}
}
else args.push(encodeURIComponent(key) + (value != null && value !== "" ? "=" + encodeURIComponent(value) : ""))
}
}

View File

@@ -0,0 +1,51 @@
"use strict"
function decodeURIComponentSave(str) {
try {
return decodeURIComponent(str)
} catch(err) {
return str
}
}
module.exports = function(string) {
if (string === "" || string == null) return {}
if (string.charAt(0) === "?") string = string.slice(1)
var entries = string.split("&"), counters = {}, data = {}
for (var i = 0; i < entries.length; i++) {
var entry = entries[i].split("=")
var key = decodeURIComponentSave(entry[0])
var value = entry.length === 2 ? decodeURIComponentSave(entry[1]) : ""
if (value === "true") value = true
else if (value === "false") value = false
var levels = key.split(/\]\[?|\[/)
var cursor = data
if (key.indexOf("[") > -1) levels.pop()
for (var j = 0; j < levels.length; j++) {
var level = levels[j], nextLevel = levels[j + 1]
var isNumber = nextLevel == "" || !isNaN(parseInt(nextLevel, 10))
if (level === "") {
var key = levels.slice(0, j).join()
if (counters[key] == null) {
counters[key] = Array.isArray(cursor) ? cursor.length : 0
}
level = counters[key]++
}
// Disallow direct prototype pollution
else if (level === "__proto__") break
if (j === levels.length - 1) cursor[level] = value
else {
// Read own properties exclusively to disallow indirect
// prototype pollution
var desc = Object.getOwnPropertyDescriptor(cursor, level)
if (desc != null) desc = desc.value
if (desc == null) cursor[level] = desc = isNumber ? [] : {}
cursor = desc
}
}
}
return data
}

View File

@@ -0,0 +1,3 @@
"use strict"
module.exports = require("./mount-redraw").redraw

View File

@@ -0,0 +1,3 @@
"use strict"
module.exports = require("./render/render")(typeof window !== "undefined" ? window : null)

View File

@@ -0,0 +1,12 @@
"use strict"
var Vnode = require("./vnode")
var hyperscriptVnode = require("./hyperscriptVnode")
module.exports = function() {
var vnode = hyperscriptVnode.apply(0, arguments)
vnode.tag = "["
vnode.children = Vnode.normalizeChildren(vnode.children)
return vnode
}

View File

@@ -0,0 +1,93 @@
"use strict"
var Vnode = require("./vnode")
var hyperscriptVnode = require("./hyperscriptVnode")
var hasOwn = require("../util/hasOwn")
var selectorParser = /(?:(^|#|\.)([^#\.\[\]]+))|(\[(.+?)(?:\s*=\s*("|'|)((?:\\["'\]]|.)*?)\5)?\])/g
var selectorCache = {}
function isEmpty(object) {
for (var key in object) if (hasOwn.call(object, key)) return false
return true
}
function compileSelector(selector) {
var match, tag = "div", classes = [], attrs = {}
while (match = selectorParser.exec(selector)) {
var type = match[1], value = match[2]
if (type === "" && value !== "") tag = value
else if (type === "#") attrs.id = value
else if (type === ".") classes.push(value)
else if (match[3][0] === "[") {
var attrValue = match[6]
if (attrValue) attrValue = attrValue.replace(/\\(["'])/g, "$1").replace(/\\\\/g, "\\")
if (match[4] === "class") classes.push(attrValue)
else attrs[match[4]] = attrValue === "" ? attrValue : attrValue || true
}
}
if (classes.length > 0) attrs.className = classes.join(" ")
return selectorCache[selector] = {tag: tag, attrs: attrs}
}
function execSelector(state, vnode) {
var attrs = vnode.attrs
var hasClass = hasOwn.call(attrs, "class")
var className = hasClass ? attrs.class : attrs.className
vnode.tag = state.tag
vnode.attrs = {}
if (!isEmpty(state.attrs) && !isEmpty(attrs)) {
var newAttrs = {}
for (var key in attrs) {
if (hasOwn.call(attrs, key)) newAttrs[key] = attrs[key]
}
attrs = newAttrs
}
for (var key in state.attrs) {
if (hasOwn.call(state.attrs, key) && key !== "className" && !hasOwn.call(attrs, key)){
attrs[key] = state.attrs[key]
}
}
if (className != null || state.attrs.className != null) attrs.className =
className != null
? state.attrs.className != null
? String(state.attrs.className) + " " + String(className)
: className
: state.attrs.className != null
? state.attrs.className
: null
if (hasClass) attrs.class = null
for (var key in attrs) {
if (hasOwn.call(attrs, key) && key !== "key") {
vnode.attrs = attrs
break
}
}
return vnode
}
function hyperscript(selector) {
if (selector == null || typeof selector !== "string" && typeof selector !== "function" && typeof selector.view !== "function") {
throw Error("The selector must be either a string or a component.");
}
var vnode = hyperscriptVnode.apply(1, arguments)
if (typeof selector === "string") {
vnode.children = Vnode.normalizeChildren(vnode.children)
if (selector !== "[") return execSelector(selectorCache[selector] || compileSelector(selector), vnode)
}
vnode.tag = selector
return vnode
}
module.exports = hyperscript

View File

@@ -0,0 +1,53 @@
"use strict"
var Vnode = require("./vnode")
// Call via `hyperscriptVnode.apply(startOffset, arguments)`
//
// The reason I do it this way, forwarding the arguments and passing the start
// offset in `this`, is so I don't have to create a temporary array in a
// performance-critical path.
//
// In native ES6, I'd instead add a final `...args` parameter to the
// `hyperscript` and `fragment` factories and define this as
// `hyperscriptVnode(...args)`, since modern engines do optimize that away. But
// ES5 (what Mithril.js requires thanks to IE support) doesn't give me that luxury,
// and engines aren't nearly intelligent enough to do either of these:
//
// 1. Elide the allocation for `[].slice.call(arguments, 1)` when it's passed to
// another function only to be indexed.
// 2. Elide an `arguments` allocation when it's passed to any function other
// than `Function.prototype.apply` or `Reflect.apply`.
//
// In ES6, it'd probably look closer to this (I'd need to profile it, though):
// module.exports = function(attrs, ...children) {
// if (attrs == null || typeof attrs === "object" && attrs.tag == null && !Array.isArray(attrs)) {
// if (children.length === 1 && Array.isArray(children[0])) children = children[0]
// } else {
// children = children.length === 0 && Array.isArray(attrs) ? attrs : [attrs, ...children]
// attrs = undefined
// }
//
// if (attrs == null) attrs = {}
// return Vnode("", attrs.key, attrs, children)
// }
module.exports = function() {
var attrs = arguments[this], start = this + 1, children
if (attrs == null) {
attrs = {}
} else if (typeof attrs !== "object" || attrs.tag != null || Array.isArray(attrs)) {
attrs = {}
start = this
}
if (arguments.length === start + 1) {
children = arguments[start]
if (!Array.isArray(children)) children = [children]
} else {
children = []
while (start < arguments.length) children.push(arguments[start++])
}
return Vnode("", attrs.key, attrs, children)
}

Some files were not shown because too many files have changed in this diff Show More