first commit

This commit is contained in:
User A0264400
2026-04-01 23:20:16 +03:00
commit a766acdc90
23071 changed files with 4933189 additions and 0 deletions

View File

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

View File

@@ -0,0 +1,175 @@
/* ==*/
#WBCR-AM .wam-cleditor {
box-sizing: border-box;
/* Conditions */
/* Buttons */
}
#WBCR-AM .wam-cleditor input {
float: none;
position: relative;
top: 0;
padding: 4px;
}
#WBCR-AM .wam-cleditor.wam-cleditor__disable-plugin-mode .wam-cleditor__param-select option[value="location-taxonomy"],
#WBCR-AM .wam-cleditor.wam-cleditor__disable-plugin-mode .wam-cleditor__param-select option[value="location-post-type"],
#WBCR-AM .wam-cleditor.wam-cleditor__disable-plugin-mode .wam-cleditor__param-select option[value="location-some-page"] {
display: none;
}
#WBCR-AM .wam-cleditor .wam-cleditor__text {
width: 300px;
}
#WBCR-AM .wam-cleditor .wam-cleditor__box {
padding: 25px 15px 15px 15px;
border-left: 1px solid #ddd;
background-color: #f9f9f9;
}
#WBCR-AM .wam-cleditor .wam-cleditor__when-empty {
display: none;
}
#WBCR-AM .wam-cleditor .wam-cleditor__empty .wam-cleditor__when-empty {
display: block;
}
#WBCR-AM .wam-cleditor .wam-cleditor__head {
display: flex;
overflow: auto;
background-color: #fff;
border-bottom: 1px solid #ddd;
border-left: 1px solid #ddd;
padding: 10px 15px;
}
#WBCR-AM .wam-cleditor .wam-cleditor__head .wam-cleditor__head-left,
#WBCR-AM .wam-cleditor .wam-cleditor__head .wam-cleditor__head-right {
display: inline-block;
}
#WBCR-AM .wam-cleditor .wam-cleditor__head .wam-cleditor__head-left {
text-align: left;
flex: 2 0 0;
}
#WBCR-AM .wam-cleditor .wam-cleditor__head .wam-cleditor__head-right {
text-align: right;
flex: 1 0 0;
}
#WBCR-AM .wam-cleditor .wam-cleditor__head .wam-cleditor__first-group-title {
text-transform: uppercase;
margin: 0;
font-weight: 600;
font-size: 14px;
line-height: 2.3;
}
#WBCR-AM .wam-cleditor .wam-cleditor__wrap .wam-cleditor__groups {
padding-left: 20px;
border-left: 1px solid #ddd;
}
#WBCR-AM .wam-cleditor .wam-cleditor__groups .wam-cleditor__point {
background-color: #fff;
border: 1px solid #0073aa;
border-radius: 100%;
width: 11px;
height: 11px;
display: block;
position: absolute;
margin-left: -26px;
margin-top: 19px;
}
#WBCR-AM .wam-cleditor .wam-cleditor__groups .wam-cleditor__point:after {
position: absolute;
content: " ";
display: block;
width: 15px;
border-top: 1px solid #ddd;
margin-left: 10px;
margin-top: 4px;
}
#WBCR-AM .wam-cleditor .wam-cleditor__group {
/*@{prefix}__group + @{prefix}__group {
margin-top: 20px;
}*/
}
#WBCR-AM .wam-cleditor .wam-cleditor__group .wam-cleditor__group-type {
display: none;
text-transform: uppercase;
margin: 0;
line-height: 2.3;
font-size: 12px;
font-weight: bold;
font-style: normal;
color: #222;
background: #f3f3f3;
text-align: center;
border-radius: 3px;
padding: 5px 10px 5px 10px;
}
#WBCR-AM .wam-cleditor .wam-cleditor__empty .wam-cleditor__conditions {
display: none;
}
#WBCR-AM .wam-cleditor .wam-cleditor__condition {
position: relative;
}
#WBCR-AM .wam-cleditor .wam-cleditor__condition .wam-cleditor__hint,
#WBCR-AM .wam-cleditor .wam-cleditor__condition .wam-cleditor__hint-content {
display: none;
}
#WBCR-AM .wam-cleditor .wam-cleditor__condition .wam-cleditor__hint {
position: relative;
display: inline-block;
padding: 0 6px 0 3px;
}
#WBCR-AM .wam-cleditor .wam-cleditor__condition .wam-cleditor__hint-icon {
background: url('../img/help.png') no-repeat 0 0 transparent;
position: relative;
height: 14px;
width: 13px;
display: inline-block;
cursor: help;
vertical-align: middle;
top: -1px;
opacity: 0.55;
}
#WBCR-AM .wam-cleditor .wam-cleditor__condition .wam-cleditor__hint:hover .wam-cleditor__hint-content {
display: block;
position: absolute;
width: 280px;
background-color: rgba(0, 0, 0, 0.8);
white-space: normal;
padding: 10px 12px 12px 12px;
font-weight: normal;
line-height: 150%;
border-radius: 4px;
color: #fff;
font-size: 13px;
z-index: 999;
}
#WBCR-AM .wam-cleditor .wam-cleditor__condition .wam-cleditor__hint .wam-cleditor__hint-content,
#WBCR-AM .wam-cleditor .wam-cleditor__condition .wam-cleditor__hint .wam-cleditor__hint-content a {
color: #fff;
}
#WBCR-AM .wam-cleditor .wam-cleditor__condition .wam-cleditor__operator-and {
display: block;
color: rgba(0, 0, 0, 0.7);
font-weight: bold;
border-top: 1px solid #ddd;
margin: 18px 0;
position: relative;
}
#WBCR-AM .wam-cleditor .wam-cleditor__condition .wam-cleditor__operator-and span {
position: absolute;
top: -10px;
background-color: #f9f9f9;
padding-right: 7px;
text-transform: uppercase;
}
#WBCR-AM .wam-cleditor .wam-cleditor__condition:first-child .wam-cleditor__operator-and {
display: none;
}
#WBCR-AM .wam-cleditor .wam-cleditor__condition > span {
display: inline-block;
vertical-align: top;
}
#WBCR-AM .wam-cleditor .wam-cleditor__condition .wam-cleditor__condition-actions {
position: absolute;
right: 0;
}
#WBCR-AM .wam-cleditor .wam-cleditor__buttons-group {
margin-top: 20px;
}
/*# sourceMappingURL=assets-conditions.css.map */

View File

@@ -0,0 +1,252 @@
/**
* Float panel
* @author Alex Kovalev <alex.kovalevv@gmail.com>
* @copyright Webcraftic 26.08.2019
*/
.wam-float-panel {
position: fixed;
z-index: 50;
top: 30px;
right: 0;
left: 0;
width: 100%;
display: -webkit-flex;
display: -ms-flexbox;
display: flex;
-ms-flex-pack: justify;
-webkit-justify-content: space-between;
justify-content: space-between;
height: 62px;
padding: 0 20px;
margin: 0;
color: #FFF;
background: #23282d;
font-size: 16px;
border-top: 2px solid #ffcb1e;
}
.wam-float-panel__premium {
position: relative;
display: block;
width: 20px;
height: 40px;
background: #ffcb1e;
margin-left: -30px;
}
.wam-float-panel__premium:hover {
cursor: pointer;
}
.wam-float-panel__premium .wam-tooltip {
position: relative;
right: -30px;
top: 8px;
font-size: 12px;
font-weight: bold;
font-style: normal;
color: #ffffff;
background: #f22714;
width: 45px;
text-align: center;
border-radius: 3px;
padding: 5px 0 5px 0;
line-height: 1.2;
}
.wam-float-panel__premium:after {
display: block;
content: '';
position: absolute;
top: 1px;
left: 0;
width: 19px;
height: 38px;
background: #23282d;
}
.wam-float-panel__left,
.wam-float-panel__right {
display: -webkit-flex;
display: -ms-flexbox;
display: flex;
-webkit-align-items: center;
align-items: center;
-ms-flex-align: center;
}
.wam-float-panel__left {
min-width: 800px;
margin: 0 44px 0 0;
}
.wam-float-panel__logo {
width: 38px;
height: 32px;
margin: 0 44px 0 0;
background: url("data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAACYAAAAgCAMAAABJuvqBAAAC+lBMVEUAAAD7bBgLxt8LyOP/oRqTVqOWV6T/gALpHxCKT5oMy+bwCgX/dhn/oxeXV6XxJxP/igzxIQztFAP/iQAIwNfoIBP/jgkPz+wOzun/igf/fgD/iggOze3hHxDuDAF0P4KWV6UP0OzyKxX/lw3iHxD/hAaXV6XyGgsPzu3/ggaJTpn/iw6JTZiUVqOUVqTlFQsve3T2Qy1lazvqIhOBHyvvlxW7FRCTaR3xGQX/kBIP0eyGTJbjIBKASJAAXn3uFQMPzewJxNo1JFOLUZuHTZb/xCEAkqmXV6X/ggB5QogNyOD/WSaWV6VjNnBHFTsLUVnrEgMQ0en/ggADtsz/mRTvJRT/igfpDwLgHw//ixD/igYQ0un/xiXlIBP/rhnnIRSXV6X/lgT/ig36OBz/ZzbkJBj/fAAMyeD/iQoFtMkPzeyNUZziHxHgHw/mCwIBobT/yy3kBQNIIVp2dz4PzewAc4L/ckKXV6V6JDr/oRb0DAD9egD/jAcOze2XV6XeHw7jAwPnIRSXV6X/vSoPz+j/fgB+DjKXV6X/ziAPzuzlIBP/iw7/yx7yJxT/YCLpIRQP0uwLxt2TV6T/YSD/nBTuJBT/jhCQVKCNUp2DSpL/xRf8PRf4LhTsIhT/kREQ0egOzOQMyuEJwtiKT5qGTZaASI9xPn//XSH/tRr/Uhf/oBb3KRPjHxAHv9UGvNEDsMUCqLwAjp98RItdMWg3Hkr/VyD/xh//wR7/Xx7/XBv/rxn6NBf/rBb/lxP/lBP+RRP9NQ3/igv/iQv+Kwv3Iwf/pQUOzuYGt813QoZqOnYAYHRULmJBJVQwFz3+Tx//1R3/uxz8Rhz/Shv/pxj/phb/vhL/sgr/mAIPzucEuc4BoLMBnK4AmKoAg5MAf5IAd4cAbYEAbHxkNnAAT2kIVGQASF5KJ1kARlcVU1U+ZEYsGEVfdTtIHDltKzJ6fS2OOCyniinWsCL/YyD3YCDkSyCrNCDvyR+8KR/50Bj/uRH/tQ7/qwnxGwX/kQIQ63s7AAAAh3RSTlMAAyIQCsuvaz8wKx4Y/vn58PDp5+Xk5NbAu6+rqJuVgH15d3dpXE1HRTAoIyAYFhQNCv7+/fz7+vn39vX19PLy8O/u6urk397c29ra19TU087JyMfGxMO6squjoJ+fnpyZmZiUk5GRkI+Oi4uJiINybGZhYV1dWldPTk1LQzo6OCopJSMYEw7x8GTCAAACaUlEQVQ4y2LABzgi6hkIgsZYmzUqhBQZKol2da3JJaBKPXRuP1CZLF5FPMn8vVON+/ErYyzznj2ndyrIuBw8rkrZsfzinN5ekDI8XlBaObnv3O7VYOM4MGSZmZiYmIE0t+D+HX1bIbaK6qMq0VCMlvASEQnOByoTOrCzb/klkHH98YwwFVwaJYoy4lYTbiycuPbmho2lDAxyR4C2go0TRNgp0wkCE+YvmLho3fqNp/wNGNQtZu/oA3lidSrCvloHsKpjQMPW33n43LyaQT/gMMQT/BWMCHVZMMOO37r/9N3RNAaGvCP7QbYeNnHyldeCO18CpGrhonUb7j5+/eOaBw9Dgz3YE9+3nF621CVbD6qOSXwCyEqgw15+O3/1ryoDQzjQE5++vDlzctPMxdNZOWGeBSgQZOXtBy8+nu+YdVSKgaHwz/7Jn99u2Xxi5pIZ0yf5NEHVtaQ7rttw78mHWT0dPdeEecBB9/4V0Moli6dPam9n1YWHXqabndGeFds6Oq5eZwcG3eGvZ5+BrJwxqR0IEhAeNig2vbJrew/IVkaGKrOzZx6dWAq0EqyMTw2hLnHKqj0XgLb+EtZkaPPbsnnZUrBhYMAGV1VjuXfKZZCts0C2Fm1etgnsfj53NoXyOh14Uoyctm8KL8jWnt9BLAwM8p621s6sbApqeihpRFtg2ry9YFs7foq1AgV0ODm1dBnRUxtgqt3d8/ZNuQK2VRl3ks3o7p42b8oqkK0xLLiVSR/qBtl6eYVrAR5VDJKHurtBnohrxpszw0DK5oVUEsjlkgcPdospszAQAFEHBZK0GQgCdmlNfNIAQzEmYu+mR3cAAAAASUVORK5CYII=");
}
.wam-float-panel__data {
display: -webkit-flex;
display: -ms-flexbox;
display: flex;
-webkit-align-items: center;
align-items: center;
-ms-flex-align: center;
margin: 0 -22px;
padding: 0;
list-style: none;
}
.wam-float-panel__data:not(:last-child) {
margin-right: 22px;
}
.wam-float-panel__data-item {
margin: 0 22px;
color: #909090;
text-align: center;
vertical-align: top;
padding: 8px 0 8px;
}
.wam-float-panel__data-hidden {
display: none;
margin: 0 44px 0 0;
}
.wam-float-panel__data-hidden img {
vertical-align: middle;
}
.wam-float-panel__item_value {
font-size: 15px;
color: #d0d0d0;
background: #4c4c4c;
border-radius: 2px;
padding: 2px 5px;
}
.wam-float-panel__reset,
.wam-float-panel__save,
.wam-float-panel__reset.input[type="submit"],
.wam-float-panel__save.input[type="submit"] {
display: inline-block;
padding: 8px 15px 7px;
cursor: pointer;
transition: 0.1s;
vertical-align: middle;
text-transform: uppercase !important;
border: none;
border-radius: 2px;
font-size: 14px;
line-height: 1.5;
color: #222 !important;
}
.wam-float-panel__reset:hover,
.wam-float-panel__save:hover,
.wam-float-panel__reset:focus,
.wam-float-panel__save:focus {
outline: none;
text-decoration: none;
}
.wam-float-panel__reset:active,
.wam-float-panel__save:active {
-webkit-transform: translateY(2px);
transform: translateY(2px);
}
.wam-float-panel__reset,
.wam-float-panel__reset.input[type="submit"] {
margin: 0 10px 0 0;
padding-right: 30px;
padding-left: 30px;
background: #E1E5E9;
box-shadow: 0 4px #A8AEB3 !important;
}
.wam-float-panel__reset:hover,
.wam-float-panel__reset:focus {
background: #E7EAED !important;
}
.wam-float-panel__reset:active {
box-shadow: 0 2px #A8AEB3 !important;
}
.wam-float-panel__save,
.wam-float-panel__save.input[type="submit"] {
margin: 0 10px 0 0;
padding-right: 30px;
padding-left: 30px;
color: #222 !important;
background: #FFCB1E !important;
box-shadow: 0 4px #BF9A17 !important;
}
.wam-float-panel__save:hover,
.wam-float-panel__save:focus {
background: #FFD340 !important;
box-shadow: 0 4px #BF9A17 !important;
}
.wam-float-panel__save:active {
background: #FFD340 !important;
box-shadow: 0 2px #BF9A17 !important;
}
.wam-float-panel__save + div {
margin: 0;
}
.wam-float-panel__checkbox {
cursor: pointer;
font-size: 15px;
transform: none;
}
.wam-float-panel__checkbox-text,
.wam-float-panel__checkbox-text-premium {
position: relative;
padding: 0 0 0 26px;
}
.wam-float-panel__checkbox-text::before,
.wam-float-panel__checkbox-text-premium::before {
content: "";
position: absolute;
top: -1px;
left: 0;
width: 20px;
height: 20px;
border-radius: 2px;
background: #ffcb1e;
}
.wam-float-panel__checkbox-input:checked + .wam-float-panel__checkbox-text::after,
.wam-float-panel__checkbox-input:checked + .wam-float-panel__checkbox-text-premium::after {
content: "";
position: absolute;
top: 5px;
left: 6px;
width: 8px;
height: 5px;
-webkit-transform: rotate(-45deg);
transform: rotate(-45deg);
border: solid #444;
border-width: 0 0 2px 2px;
}
.wam-float-panel__checkbox-text-premium {
display: inline;
color: rgba(245, 245, 245, 0.3);
}
.wam-float-panel__checkbox-text-premium b {
display: inline-block;
font-size: 9px;
font-weight: 700;
color: #fff;
background: #f22714;
width: 25px;
padding: 3px 0;
text-align: center;
vertical-align: top;
border-radius: 3px;
line-height: 1.5;
}
.wam-float-panel__checkbox-text-premium::before {
background: rgba(245, 245, 245, 0.3);
}
.wam-float-panel__close,
.wam-float-panel__close:hover {
width: 36px;
height: 36px;
margin: 0 20px 0 20px;
cursor: pointer;
transition: 0.2s;
border: 4px solid #FFF;
border-radius: 50%;
background: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 352 512'%3E%3Cpath fill='%23FFF' d='M242.72 256l100.07-100.07c12.28-12.28 12.28-32.19 0-44.48l-22.24-22.24c-12.28-12.28-32.19-12.28-44.48 0L176 189.28 75.93 89.21c-12.28-12.28-32.19-12.28-44.48 0L9.21 111.45c-12.28 12.28-12.28 32.19 0 44.48L109.28 256 9.21 356.07c-12.28 12.28-12.28 32.19 0 44.48l22.24 22.24c12.28 12.28 32.2 12.28 44.48 0L176 322.72l100.07 100.07c12.28 12.28 32.2 12.28 44.48 0l22.24-22.24c12.28-12.28 12.28-32.19 0-44.48L242.72 256z'/%3E%3C/svg%3E") no-repeat 50% 0px;
}
.wam-float-panel__close:focus,
.wam-float-panel__close:hover:focus {
opacity: 0.5;
outline: none;
}
/*# sourceMappingURL=float-panel.css.map */

View File

@@ -0,0 +1,251 @@
/**
* Reset styles
* @author Webcraftic <wordpress.webraftic@gmail.com>
* @copyright Webcraftic 15.10.2018
*/
*,
*:before,
*:after {
-webkit-box-sizing: border-box;
-moz-box-sizing: border-box;
box-sizing: border-box;
}
h2,
h3,
h4,
h5,
h6,
p,
strong,
b,
span,
em,
i,
a,
div,
main,
section,
li,
button,
input[type="submit"],
input[type="reset"],
.wbcr-gnz-switch-premium {
font-family: Arial, "Helvetica Neue", sans-serif !important;
font-size: 14px;
font-style: normal;
font-weight: normal;
text-transform: none;
text-shadow: none;
}
h1 {
font-size: 2em;
margin: 0.67em 0;
}
hr {
box-sizing: content-box;
height: 0;
overflow: visible;
}
pre {
font-family: monospace, monospace;
font-size: 1em;
}
a {
background-color: transparent;
}
abbr[title] {
border-bottom: none;
text-decoration: underline dotted;
}
b,
strong {
font-weight: bolder;
}
code,
kbd,
samp {
font-family: monospace, monospace;
font-size: 1em;
}
small {
font-size: 80%;
}
sub,
sup {
font-size: 75%;
line-height: 0;
position: relative;
vertical-align: baseline;
}
sub {
bottom: -0.25em;
}
sup {
top: -0.5em;
}
img {
border-style: none;
}
button,
input,
optgroup,
select,
textarea {
font-family: inherit;
font-size: 100%;
line-height: 1.15;
margin: 0;
height: auto;
width: auto;
}
button,
input,
optgroup,
select,
textarea,
button:hover,
input:hover,
optgroup:hover,
select:hover,
textarea:hover,
button:focus,
input:focus,
optgroup:focus,
select:focus,
textarea:focus {
-moz-box-shadow: none;
-ms-box-shadow: none;
-webkit-box-shadow: none;
-o-box-shadow: none;
}
button,
input {
overflow: visible;
}
button,
select {
text-transform: none;
}
button,
[type="button"],
[type="reset"],
[type="submit"] {
-webkit-appearance: button;
}
button::-moz-focus-inner,
[type="button"]::-moz-focus-inner,
[type="reset"]::-moz-focus-inner,
[type="submit"]::-moz-focus-inner {
border-style: none;
padding: 0;
}
button:-moz-focusring,
[type="button"]:-moz-focusring,
[type="reset"]:-moz-focusring,
[type="submit"]:-moz-focusring {
outline: 1px dotted ButtonText;
}
fieldset {
padding: 0.35em 0.75em 0.625em;
}
legend {
box-sizing: border-box;
color: inherit;
display: table;
max-width: 100%;
padding: 0;
white-space: normal;
}
textarea {
overflow: auto;
}
[type="checkbox"],
[type="radio"] {
box-sizing: border-box;
padding: 0;
}
[type="number"]::-webkit-inner-spin-button,
[type="number"]::-webkit-outer-spin-button {
height: auto;
}
[type="search"] {
-webkit-appearance: textfield;
outline-offset: -2px;
}
[type="search"]::-webkit-search-decoration {
-webkit-appearance: none;
}
::-webkit-file-upload-button {
-webkit-appearance: button;
font: inherit;
}
fieldset {
padding: 0.35em 0.75em 0.625em;
}
legend {
box-sizing: border-box;
color: inherit;
display: table;
max-width: 100%;
padding: 0;
white-space: normal;
}
progress {
vertical-align: baseline;
}
textarea {
overflow: auto;
}
[type=checkbox],
[type=radio] {
box-sizing: border-box;
padding: 0;
}
[type=number]::-webkit-inner-spin-button,
[type=number]::-webkit-outer-spin-button {
height: auto;
}
[type=search] {
-webkit-appearance: textfield;
outline-offset: -2px;
}
[type=search]::-webkit-search-decoration {
-webkit-appearance: none;
}
::-webkit-file-upload-button {
-webkit-appearance: button;
font: inherit;
}
details {
display: block;
}
summary {
display: list-item;
}
template {
display: none;
}
[hidden] {
display: none;
}
table,
caption,
tbody,
tfoot,
thead,
tr,
th,
td {
margin: 0;
padding: 0;
border: 0;
font-size: 100%;
font: inherit;
vertical-align: middle;
line-height: 1.2;
}
table {
table-layout: auto;
border-collapse: collapse;
border-spacing: 0;
}

View File

@@ -0,0 +1,85 @@
/**
* Tabless
* @author Alex Kovalev <alex.kovalevv@gmail.com>
* @copyright Webcraftic 26.08.2019
*/
.wam-table {
width: 100%;
box-sizing: border-box;
table-layout: fixed;
border-collapse: collapse;
}
.wam-table__handle-deps {
margin-top: 15px;
}
.wam-table__handle-deps span,
.wam-table__handle-deps a {
font-size: 11px !important;
}
.wam-table__handle-deps a {
color: red;
text-decoration: underline;
}
.wam-table tr:nth-child(2n) > td {
background: #f9f9f9;
}
.wam-table th {
padding: 12px 10px;
text-align: left;
color: #333;
background: #ECEDED;
box-shadow: none;
}
.wam-table th:not(:last-child) {
border-right: 2px solid #FFF;
}
.wam-table__th-actions {
width: 200px;
}
.wam-table__th-type {
width: 100px;
}
.wam-table__th-version {
width: 100px;
}
.wam-table__th-size {
width: 100px;
}
.wam-table__th-plugins-list,
.wam-table__td-plugins-list {
width: 350px;
}
.wam-table td {
padding: 17px 10px;
vertical-align: top;
text-align: left;
box-shadow: none;
}
.wam-table__td-handle {
word-break: break-word;
}
.wam-table__td-plugins-list {
padding: 0 !important;
}
.wam-table__th-plugins-settings,
.wam-table__td-plugins-settings {
width: 80%;
padding: 15px;
text-align: left;
}
.wam-table .js-wam-table__tr--disabled-section {
background: #fbf5f4;
opacity: 0.7;
}
.wam-table__asset-settings-conditions {
display: none;
background: #f3f3f3;
color: #7b7b7b;
font-size: 13px;
box-shadow: 0 2px 0 #d4d4d4;
}
.wam-table__asset-settings-conditions > td {
padding: 0 25px 15px 25px;
}
/*# sourceMappingURL=tables.css.map */

View File

@@ -0,0 +1,55 @@
/**
* Tooltip
* @author Alex Kovalev <alex.kovalevv@gmail.com>
* @copyright Webcraftic 26.08.2019
*/
.wam-tooltip {
position: relative;
}
.wam-tooltip::before {
content: "";
position: absolute;
z-index: 60;
left: 5px;
display: none;
width: 20px;
height: 20px;
}
.wam-tooltip::after {
content: attr(data-tooltip);
position: absolute;
z-index: 60;
left: 5px;
display: none;
min-width: 200px;
padding: 8px 15px;
color: #6d5506;
background: #FFCB1E;
font-size: 13px;
font-weight: normal;
line-height: 1.2;
}
.wam-tooltip-top::before {
bottom: 100%;
background: linear-gradient(135deg, #FFCB1E, #FFCB1E 50%, transparent 50%, transparent) no-repeat;
}
.wam-tooltip-top::after {
bottom: 100%;
margin: 0 0 10px;
border-radius: 6px 6px 6px 0;
}
.wam-tooltip--bottom::before {
top: 100%;
background: linear-gradient(45deg, #FFCB1E, #FFCB1E 50%, transparent 50%, transparent) no-repeat;
}
.wam-tooltip--bottom::after {
top: 100%;
margin: 15px 0 0;
border-radius: 0 6px 6px 6px;
}
.wam-tooltip:hover::before,
.wam-tooltip:hover::after {
display: block;
}
/*# sourceMappingURL=tooltip.css.map */

Binary file not shown.

After

Width:  |  Height:  |  Size: 435 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 314 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 493 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 155 B

View File

@@ -0,0 +1 @@
<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 330 330" width="36" height="36"><g fill="#FFF"><path d="M165 0C74.019 0 0 74.02 0 165.001 0 255.982 74.019 330 165 330s165-74.018 165-164.999S255.981 0 165 0zm0 300c-74.44 0-135-60.56-135-134.999S90.56 30 165 30s135 60.562 135 135.001C300 239.44 239.439 300 165 300z"/><path d="M164.998 70c-11.026 0-19.996 8.976-19.996 20.009 0 11.023 8.97 19.991 19.996 19.991 11.026 0 19.996-8.968 19.996-19.991 0-11.033-8.97-20.009-19.996-20.009zM165 140c-8.284 0-15 6.716-15 15v90c0 8.284 6.716 15 15 15 8.284 0 15-6.716 15-15v-90c0-8.284-6.716-15-15-15z"/></g></svg>

After

Width:  |  Height:  |  Size: 608 B

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,790 @@
var _typeof = typeof Symbol === "function" && typeof Symbol.iterator === "symbol" ? function (obj) { return typeof obj; } : function (obj) { return obj && typeof Symbol === "function" && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj; };
var _extends = Object.assign || function (target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i]; for (var key in source) { if (Object.prototype.hasOwnProperty.call(source, key)) { target[key] = source[key]; } } } return target; };
/* src/PNotifyConfirm.html generated by Svelte v2.16.1 */
var WamPnotifyConfirm = function (PNotify) {
"use strict";
PNotify = PNotify && PNotify.__esModule ? PNotify["default"] : PNotify;
function data() {
return _extends({
'_notice': null, // The PNotify notice.
'_options': {} // The options for the notice.
}, PNotify.modules.Confirm.defaults);
};
var methods = {
initModule: function initModule(options) {
this.set(options);
},
afterOpen: function afterOpen() {
if (this.get().prompt && this.get().focus !== false) {
if (this.get().promptMultiLine) {
this.refs.promptMulti.focus();
} else {
this.refs.promptSingle.focus();
}
} else if (this.get().confirm && (this.get().focus === true || this.get().focus === null && this.get()._options.stack.modal)) {
var buttons = this.get().buttons;
if (buttons.length) {
var i = buttons.length - 1;
while (i >= 0) {
if (buttons[i].promptTrigger) {
break;
}
i--;
}
this.refs.buttons.children[i].focus();
}
}
},
handleClick: function handleClick(button, event) {
if (button.click) {
button.click(this.get()._notice, this.get().prompt ? this.get().promptValue : null, event);
}
},
handleKeyPress: function handleKeyPress(event) {
if (event.keyCode === 13 && !event.shiftKey) {
event.preventDefault();
var _get = this.get(),
buttons = _get.buttons;
for (var i = 0; i < buttons.length; i++) {
if (buttons[i].promptTrigger && buttons[i].click) {
buttons[i].click(this.get()._notice, this.get().prompt ? this.get().promptValue : null, event);
}
}
}
}
};
function oncreate() {
this.fire('init', { module: this });
};
function setup(Component) {
Component.key = 'Confirm';
Component.defaults = {
// Make a confirmation box.
confirm: false,
// Make a prompt.
prompt: false,
// Classes to add to the input element of the prompt.
promptClass: '',
// The value of the prompt.
promptValue: '',
// Whether the prompt should accept multiple lines of text.
promptMultiLine: false,
// For confirmation boxes, true means the first button or the button with promptTrigger will be focused, and null means focus will change only for modal notices. For prompts, true or null means focus the prompt. When false, focus will not change.
focus: null,
// Where to align the buttons. (flex-start, center, flex-end, space-around, space-between)
align: 'flex-end',
// The buttons to display, and their callbacks.
buttons: [{
text: 'Ok',
textTrusted: false,
addClass: '',
primary: true,
// Whether to trigger this button when the user hits enter in a single line prompt. Also, focus the button if it is a modal prompt.
promptTrigger: true,
click: function click(notice, value) {
notice.close();
notice.fire('pnotify.confirm', { notice: notice, value: value });
}
}, {
text: 'Cancel',
textTrusted: false,
addClass: '',
click: function click(notice) {
notice.close();
notice.fire('pnotify.cancel', { notice: notice });
}
}]
};
// Register the module with PNotify.
PNotify.modules.Confirm = Component;
// Append this module to the container.
PNotify.modulesAppendContainer.push(Component);
// Add button styles to styling objects.
_extends(PNotify.styling.brighttheme, {
actionBar: '',
promptBar: '',
btn: '',
btnPrimary: 'brighttheme-primary',
input: ''
});
_extends(PNotify.styling.bootstrap3, {
actionBar: 'ui-pnotify-confirm-ml',
promptBar: 'ui-pnotify-confirm-ml',
btn: 'btn btn-default ui-pnotify-confirm-mx-1',
btnPrimary: 'btn btn-default ui-pnotify-confirm-mx-1 btn-primary',
input: 'form-control'
});
_extends(PNotify.styling.bootstrap4, {
actionBar: 'ui-pnotify-confirm-ml',
promptBar: 'ui-pnotify-confirm-ml',
btn: 'btn btn-secondary mx-1',
btnPrimary: 'btn btn-primary mx-1',
input: 'form-control'
});
if (!PNotify.styling.material) {
PNotify.styling.material = {};
}
_extends(PNotify.styling.material, {
actionBar: '',
promptBar: '',
btn: '',
btnPrimary: 'ui-pnotify-material-primary',
input: ''
});
};
function add_css() {
var style = createElement("style");
style.id = 'svelte-1y9suua-style';
style.textContent = ".ui-pnotify-action-bar.svelte-1y9suua,.ui-pnotify-prompt-bar.svelte-1y9suua{margin-top:5px;clear:both}.ui-pnotify-action-bar.svelte-1y9suua{display:flex;flex-wrap:wrap;justify-content:flex-end}.ui-pnotify-prompt-input.svelte-1y9suua{margin-bottom:5px;display:block;width:100%}.ui-pnotify-confirm-mx-1.svelte-1y9suua{margin:0 5px}.ui-pnotify.ui-pnotify-with-icon .ui-pnotify-confirm-ml.svelte-1y9suua{margin-left:24px}[dir=rtl] .ui-pnotify.ui-pnotify-with-icon .ui-pnotify-confirm-ml.svelte-1y9suua{margin-right:24px;margin-left:0}";
append(document.head, style);
}
function click_handler(event) {
var _svelte = this._svelte,
component = _svelte.component,
ctx = _svelte.ctx;
component.handleClick(ctx.button, event);
}
function get_each_context(ctx, list, i) {
var child_ctx = Object.create(ctx);
child_ctx.button = list[i];
return child_ctx;
}
function create_main_fragment(component, ctx) {
var if_block_anchor;
var if_block = (ctx.confirm || ctx.prompt) && create_if_block(component, ctx);
return {
c: function c() {
if (if_block) if_block.c();
if_block_anchor = createComment();
},
m: function m(target, anchor) {
if (if_block) if_block.m(target, anchor);
insert(target, if_block_anchor, anchor);
},
p: function p(changed, ctx) {
if (ctx.confirm || ctx.prompt) {
if (if_block) {
if_block.p(changed, ctx);
} else {
if_block = create_if_block(component, ctx);
if_block.c();
if_block.m(if_block_anchor.parentNode, if_block_anchor);
}
} else if (if_block) {
if_block.d(1);
if_block = null;
}
},
d: function d(detach) {
if (if_block) if_block.d(detach);
if (detach) {
detachNode(if_block_anchor);
}
}
};
}
// (1:0) {#if confirm || prompt}
function create_if_block(component, ctx) {
var div1, text, div0, div0_class_value;
var if_block = ctx.prompt && create_if_block_2(component, ctx);
var each_value = ctx.buttons;
var each_blocks = [];
for (var i = 0; i < each_value.length; i += 1) {
each_blocks[i] = create_each_block(component, get_each_context(ctx, each_value, i));
}
return {
c: function c() {
div1 = createElement("div");
if (if_block) if_block.c();
text = createText("\n ");
div0 = createElement("div");
for (var i = 0; i < each_blocks.length; i += 1) {
each_blocks[i].c();
}
div0.className = div0_class_value = "\n ui-pnotify-action-bar\n " + (ctx._notice.get()._styles.actionBar ? ctx._notice.get()._styles.actionBar : '') + "\n " + (ctx._notice.get()._styles.text ? ctx._notice.get()._styles.text : '') + "\n " + " svelte-1y9suua";
setStyle(div0, "justify-content", ctx.align);
div1.className = "ui-pnotify-confirm";
},
m: function m(target, anchor) {
insert(target, div1, anchor);
if (if_block) if_block.m(div1, null);
append(div1, text);
append(div1, div0);
for (var i = 0; i < each_blocks.length; i += 1) {
each_blocks[i].m(div0, null);
}
component.refs.buttons = div0;
},
p: function p(changed, ctx) {
if (ctx.prompt) {
if (if_block) {
if_block.p(changed, ctx);
} else {
if_block = create_if_block_2(component, ctx);
if_block.c();
if_block.m(div1, text);
}
} else if (if_block) {
if_block.d(1);
if_block = null;
}
if (changed.buttons || changed._notice) {
each_value = ctx.buttons;
for (var i = 0; i < each_value.length; i += 1) {
var child_ctx = get_each_context(ctx, each_value, i);
if (each_blocks[i]) {
each_blocks[i].p(changed, child_ctx);
} else {
each_blocks[i] = create_each_block(component, child_ctx);
each_blocks[i].c();
each_blocks[i].m(div0, null);
}
}
for (; i < each_blocks.length; i += 1) {
each_blocks[i].d(1);
}
each_blocks.length = each_value.length;
}
if (changed._notice && div0_class_value !== (div0_class_value = "\n ui-pnotify-action-bar\n " + (ctx._notice.get()._styles.actionBar ? ctx._notice.get()._styles.actionBar : '') + "\n " + (ctx._notice.get()._styles.text ? ctx._notice.get()._styles.text : '') + "\n " + " svelte-1y9suua")) {
div0.className = div0_class_value;
}
if (changed.align) {
setStyle(div0, "justify-content", ctx.align);
}
},
d: function d(detach) {
if (detach) {
detachNode(div1);
}
if (if_block) if_block.d();
destroyEach(each_blocks, detach);
if (component.refs.buttons === div0) component.refs.buttons = null;
}
};
}
// (3:4) {#if prompt}
function create_if_block_2(component, ctx) {
var div, div_class_value;
function select_block_type(ctx) {
if (ctx.promptMultiLine) return create_if_block_3;
return create_else_block_1;
}
var current_block_type = select_block_type(ctx);
var if_block = current_block_type(component, ctx);
return {
c: function c() {
div = createElement("div");
if_block.c();
div.className = div_class_value = "\n ui-pnotify-prompt-bar\n " + (ctx._notice.get()._styles.promptBar ? ctx._notice.get()._styles.promptBar : '') + "\n " + (ctx._notice.get()._styles.text ? ctx._notice.get()._styles.text : '') + "\n " + " svelte-1y9suua";
},
m: function m(target, anchor) {
insert(target, div, anchor);
if_block.m(div, null);
},
p: function p(changed, ctx) {
if (current_block_type === (current_block_type = select_block_type(ctx)) && if_block) {
if_block.p(changed, ctx);
} else {
if_block.d(1);
if_block = current_block_type(component, ctx);
if_block.c();
if_block.m(div, null);
}
if (changed._notice && div_class_value !== (div_class_value = "\n ui-pnotify-prompt-bar\n " + (ctx._notice.get()._styles.promptBar ? ctx._notice.get()._styles.promptBar : '') + "\n " + (ctx._notice.get()._styles.text ? ctx._notice.get()._styles.text : '') + "\n " + " svelte-1y9suua")) {
div.className = div_class_value;
}
},
d: function d(detach) {
if (detach) {
detachNode(div);
}
if_block.d();
}
};
}
// (21:8) {:else}
function create_else_block_1(component, ctx) {
var input,
input_updating = false,
input_class_value;
function input_input_handler() {
input_updating = true;
component.set({ promptValue: input.value });
input_updating = false;
}
function keypress_handler(event) {
component.handleKeyPress(event);
}
return {
c: function c() {
input = createElement("input");
addListener(input, "input", input_input_handler);
addListener(input, "keypress", keypress_handler);
setAttribute(input, "type", "text");
input.className = input_class_value = "\n ui-pnotify-prompt-input\n " + (ctx._notice.get()._styles.input ? ctx._notice.get()._styles.input : '') + "\n " + ctx.promptClass + "\n " + " svelte-1y9suua";
},
m: function m(target, anchor) {
insert(target, input, anchor);
component.refs.promptSingle = input;
input.value = ctx.promptValue;
},
p: function p(changed, ctx) {
if (!input_updating && changed.promptValue) input.value = ctx.promptValue;
if ((changed._notice || changed.promptClass) && input_class_value !== (input_class_value = "\n ui-pnotify-prompt-input\n " + (ctx._notice.get()._styles.input ? ctx._notice.get()._styles.input : '') + "\n " + ctx.promptClass + "\n " + " svelte-1y9suua")) {
input.className = input_class_value;
}
},
d: function d(detach) {
if (detach) {
detachNode(input);
}
removeListener(input, "input", input_input_handler);
removeListener(input, "keypress", keypress_handler);
if (component.refs.promptSingle === input) component.refs.promptSingle = null;
}
};
}
// (10:8) {#if promptMultiLine}
function create_if_block_3(component, ctx) {
var textarea,
textarea_updating = false,
textarea_class_value;
function textarea_input_handler() {
textarea_updating = true;
component.set({ promptValue: textarea.value });
textarea_updating = false;
}
function keypress_handler(event) {
component.handleKeyPress(event);
}
return {
c: function c() {
textarea = createElement("textarea");
addListener(textarea, "input", textarea_input_handler);
addListener(textarea, "keypress", keypress_handler);
textarea.rows = "5";
textarea.className = textarea_class_value = "\n ui-pnotify-prompt-input\n " + (ctx._notice.get()._styles.input ? ctx._notice.get()._styles.input : '') + "\n " + ctx.promptClass + "\n " + " svelte-1y9suua";
},
m: function m(target, anchor) {
insert(target, textarea, anchor);
component.refs.promptMulti = textarea;
textarea.value = ctx.promptValue;
},
p: function p(changed, ctx) {
if (!textarea_updating && changed.promptValue) textarea.value = ctx.promptValue;
if ((changed._notice || changed.promptClass) && textarea_class_value !== (textarea_class_value = "\n ui-pnotify-prompt-input\n " + (ctx._notice.get()._styles.input ? ctx._notice.get()._styles.input : '') + "\n " + ctx.promptClass + "\n " + " svelte-1y9suua")) {
textarea.className = textarea_class_value;
}
},
d: function d(detach) {
if (detach) {
detachNode(textarea);
}
removeListener(textarea, "input", textarea_input_handler);
removeListener(textarea, "keypress", keypress_handler);
if (component.refs.promptMulti === textarea) component.refs.promptMulti = null;
}
};
}
// (51:57) {:else}
function create_else_block(component, ctx) {
var text_value = ctx.button.text,
text;
return {
c: function c() {
text = createText(text_value);
},
m: function m(target, anchor) {
insert(target, text, anchor);
},
p: function p(changed, ctx) {
if (changed.buttons && text_value !== (text_value = ctx.button.text)) {
setData(text, text_value);
}
},
d: function d(detach) {
if (detach) {
detachNode(text);
}
}
};
}
// (51:14) {#if button.textTrusted}
function create_if_block_1(component, ctx) {
var raw_value = ctx.button.text,
raw_before,
raw_after;
return {
c: function c() {
raw_before = createElement('noscript');
raw_after = createElement('noscript');
},
m: function m(target, anchor) {
insert(target, raw_before, anchor);
raw_before.insertAdjacentHTML("afterend", raw_value);
insert(target, raw_after, anchor);
},
p: function p(changed, ctx) {
if (changed.buttons && raw_value !== (raw_value = ctx.button.text)) {
detachBetween(raw_before, raw_after);
raw_before.insertAdjacentHTML("afterend", raw_value);
}
},
d: function d(detach) {
if (detach) {
detachBetween(raw_before, raw_after);
detachNode(raw_before);
detachNode(raw_after);
}
}
};
}
// (43:6) {#each buttons as button}
function create_each_block(component, ctx) {
var button, button_class_value;
function select_block_type_1(ctx) {
if (ctx.button.textTrusted) return create_if_block_1;
return create_else_block;
}
var current_block_type = select_block_type_1(ctx);
var if_block = current_block_type(component, ctx);
return {
c: function c() {
button = createElement("button");
if_block.c();
button._svelte = { component: component, ctx: ctx };
addListener(button, "click", click_handler);
button.type = "button";
button.className = button_class_value = "\n ui-pnotify-action-button\n " + (ctx.button.primary ? ctx._notice.get()._styles.btnPrimary ? ctx._notice.get()._styles.btnPrimary : '' : ctx._notice.get()._styles.btn ? ctx._notice.get()._styles.btn : '') + "\n " + (ctx.button.addClass ? ctx.button.addClass : '') + "\n " + " svelte-1y9suua";
},
m: function m(target, anchor) {
insert(target, button, anchor);
if_block.m(button, null);
},
p: function p(changed, _ctx) {
ctx = _ctx;
if (current_block_type === (current_block_type = select_block_type_1(ctx)) && if_block) {
if_block.p(changed, ctx);
} else {
if_block.d(1);
if_block = current_block_type(component, ctx);
if_block.c();
if_block.m(button, null);
}
button._svelte.ctx = ctx;
if ((changed.buttons || changed._notice) && button_class_value !== (button_class_value = "\n ui-pnotify-action-button\n " + (ctx.button.primary ? ctx._notice.get()._styles.btnPrimary ? ctx._notice.get()._styles.btnPrimary : '' : ctx._notice.get()._styles.btn ? ctx._notice.get()._styles.btn : '') + "\n " + (ctx.button.addClass ? ctx.button.addClass : '') + "\n " + " svelte-1y9suua")) {
button.className = button_class_value;
}
},
d: function d(detach) {
if (detach) {
detachNode(button);
}
if_block.d();
removeListener(button, "click", click_handler);
}
};
}
function PNotifyConfirm(options) {
var _this = this;
init(this, options);
this.refs = {};
this._state = assign(data(), options.data);
this._intro = true;
if (!document.getElementById("svelte-1y9suua-style")) add_css();
this._fragment = create_main_fragment(this, this._state);
this.root._oncreate.push(function () {
oncreate.call(_this);
_this.fire("update", { changed: assignTrue({}, _this._state), current: _this._state });
});
if (options.target) {
this._fragment.c();
this._mount(options.target, options.anchor);
flush(this);
}
}
assign(PNotifyConfirm.prototype, {
destroy: destroy,
get: get,
fire: fire,
on: on,
set: set,
_set: _set,
_stage: _stage,
_mount: _mount,
_differs: _differs
});
assign(PNotifyConfirm.prototype, methods);
PNotifyConfirm.prototype._recompute = noop;
setup(PNotifyConfirm);
function createElement(name) {
return document.createElement(name);
}
function append(target, node) {
target.appendChild(node);
}
function createComment() {
return document.createComment('');
}
function insert(target, node, anchor) {
target.insertBefore(node, anchor);
}
function detachNode(node) {
node.parentNode.removeChild(node);
}
function createText(data) {
return document.createTextNode(data);
}
function setStyle(node, key, value) {
node.style.setProperty(key, value);
}
function destroyEach(iterations, detach) {
for (var i = 0; i < iterations.length; i += 1) {
if (iterations[i]) iterations[i].d(detach);
}
}
function addListener(node, event, handler, options) {
node.addEventListener(event, handler, options);
}
function setAttribute(node, attribute, value) {
if (value == null) node.removeAttribute(attribute);else node.setAttribute(attribute, value);
}
function removeListener(node, event, handler, options) {
node.removeEventListener(event, handler, options);
}
function setData(text, data) {
text.data = '' + data;
}
function detachBetween(before, after) {
while (before.nextSibling && before.nextSibling !== after) {
before.parentNode.removeChild(before.nextSibling);
}
}
function init(component, options) {
component._handlers = blankObject();
component._slots = blankObject();
component._bind = options._bind;
component._staged = {};
component.options = options;
component.root = options.root || component;
component.store = options.store || component.root.store;
if (!options.root) {
component._beforecreate = [];
component._oncreate = [];
component._aftercreate = [];
}
}
function assign(tar, src) {
for (var k in src) {
tar[k] = src[k];
}return tar;
}
function assignTrue(tar, src) {
for (var k in src) {
tar[k] = 1;
}return tar;
}
function flush(component) {
component._lock = true;
callAll(component._beforecreate);
callAll(component._oncreate);
callAll(component._aftercreate);
component._lock = false;
}
function destroy(detach) {
this.destroy = noop;
this.fire('destroy');
this.set = noop;
this._fragment.d(detach !== false);
this._fragment = null;
this._state = {};
}
function get() {
return this._state;
}
function fire(eventName, data) {
var handlers = eventName in this._handlers && this._handlers[eventName].slice();
if (!handlers) return;
for (var i = 0; i < handlers.length; i += 1) {
var handler = handlers[i];
if (!handler.__calling) {
try {
handler.__calling = true;
handler.call(this, data);
} finally {
handler.__calling = false;
}
}
}
}
function on(eventName, handler) {
var handlers = this._handlers[eventName] || (this._handlers[eventName] = []);
handlers.push(handler);
return {
cancel: function cancel() {
var index = handlers.indexOf(handler);
if (~index) handlers.splice(index, 1);
}
};
}
function set(newState) {
this._set(assign({}, newState));
if (this.root._lock) return;
flush(this.root);
}
function _set(newState) {
var oldState = this._state,
changed = {},
dirty = false;
newState = assign(this._staged, newState);
this._staged = {};
for (var key in newState) {
if (this._differs(newState[key], oldState[key])) changed[key] = dirty = true;
}
if (!dirty) return;
this._state = assign(assign({}, oldState), newState);
this._recompute(changed, this._state);
if (this._bind) this._bind(changed, this._state);
if (this._fragment) {
this.fire("state", { changed: changed, current: this._state, previous: oldState });
this._fragment.p(changed, this._state);
this.fire("update", { changed: changed, current: this._state, previous: oldState });
}
}
function _stage(newState) {
assign(this._staged, newState);
}
function _mount(target, anchor) {
this._fragment[this._fragment.i ? 'i' : 'm'](target, anchor || null);
}
function _differs(a, b) {
return a != a ? b == b : a !== b || a && (typeof a === "undefined" ? "undefined" : _typeof(a)) === 'object' || typeof a === 'function';
}
function noop() {}
function blankObject() {
return Object.create(null);
}
function callAll(fns) {
while (fns && fns.length) {
fns.shift()();
}
}
return PNotifyConfirm;
}(WamPnotify);
//# sourceMappingURL=PNotifyConfirm.js.map

View File

@@ -0,0 +1,305 @@
var _typeof = typeof Symbol === "function" && typeof Symbol.iterator === "symbol" ? function (obj) { return typeof obj; } : function (obj) { return obj && typeof Symbol === "function" && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj; };
var _extends = Object.assign || function (target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i]; for (var key in source) { if (Object.prototype.hasOwnProperty.call(source, key)) { target[key] = source[key]; } } } return target; };
/* src/PNotifyHistory.html generated by Svelte v2.16.1 */
var WamPnotifyHistory = function (PNotify) {
"use strict";
PNotify = PNotify && PNotify.__esModule ? PNotify["default"] : PNotify;
function data() {
return _extends({
'_notice': null, // The PNotify notice.
'_options': {} // The options for the notice.
}, PNotify.modules.History.defaults);
};
var methods = {
initModule: function initModule(options) {
this.set(options);
if (this.get().history) {
// Don't destroy notices that are in history.
var _get = this.get(),
_notice = _get._notice;
if (_notice.get().destroy) {
_notice.set({ 'destroy': false });
}
}
},
beforeOpen: function beforeOpen() {
var _get2 = this.get(),
maxInStack = _get2.maxInStack,
_options = _get2._options;
if (maxInStack === Infinity) {
return;
}
var stack = _options.stack;
if (stack === false) {
return;
}
// Remove oldest notifications leaving only maxInStack from the stack.
if (PNotify.notices && PNotify.notices.length > maxInStack) {
// Oldest are normally in front of array, or if stack.push=='top' then
// they are at the end of the array!
var top = stack.push === 'top';
var forRemoval = [];
var currentOpen = 0;
for (var i = top ? 0 : PNotify.notices.length - 1; top ? i < PNotify.notices.length : i >= 0; top ? i++ : i--) {
if (['opening', 'open'].indexOf(PNotify.notices[i].get()._state) !== -1 && PNotify.notices[i].get().stack === stack) {
if (currentOpen >= maxInStack) {
forRemoval.push(PNotify.notices[i]);
} else {
currentOpen++;
}
}
}
for (var _i = 0; _i < forRemoval.length; _i++) {
forRemoval[_i].close(false);
}
}
}
};
function setup(Component) {
Component.key = 'History';
Component.defaults = {
// Place the notice in the history.
history: true,
// Maximum number of notices to have open in its stack.
maxInStack: Infinity
};
Component.init = function (notice) {
return new Component({ target: document.body });
};
Component.showLast = function (stack) {
if (stack === undefined) {
stack = PNotify.defaultStack;
}
if (stack === false) {
return;
}
var top = stack.push === 'top';
// Look up the last history notice, and display it.
var i = top ? 0 : PNotify.notices.length - 1;
var notice = void 0;
do {
notice = PNotify.notices[i];
if (!notice) {
return;
}
i += top ? 1 : -1;
} while (notice.get().stack !== stack || !notice.get()._modules.History.get().history || notice.get()._state === 'opening' || notice.get()._state === 'open');
notice.open();
};
Component.showAll = function (stack) {
if (stack === undefined) {
stack = PNotify.defaultStack;
}
if (stack === false) {
return;
}
// Display all notices. (Disregarding non-history notices.)
for (var i = 0; i < PNotify.notices.length; i++) {
var notice = PNotify.notices[i];
if ((stack === true || notice.get().stack === stack) && notice.get()._modules.History.get().history) {
notice.open();
}
}
};
// Register the module with PNotify.
PNotify.modules.History = Component;
};
function create_main_fragment(component, ctx) {
return {
c: noop,
m: noop,
p: noop,
d: noop
};
}
function PNotifyHistory(options) {
init(this, options);
this._state = assign(data(), options.data);
this._intro = true;
this._fragment = create_main_fragment(this, this._state);
if (options.target) {
this._fragment.c();
this._mount(options.target, options.anchor);
}
}
assign(PNotifyHistory.prototype, {
destroy: destroy,
get: get,
fire: fire,
on: on,
set: set,
_set: _set,
_stage: _stage,
_mount: _mount,
_differs: _differs
});
assign(PNotifyHistory.prototype, methods);
PNotifyHistory.prototype._recompute = noop;
setup(PNotifyHistory);
function noop() {}
function init(component, options) {
component._handlers = blankObject();
component._slots = blankObject();
component._bind = options._bind;
component._staged = {};
component.options = options;
component.root = options.root || component;
component.store = options.store || component.root.store;
if (!options.root) {
component._beforecreate = [];
component._oncreate = [];
component._aftercreate = [];
}
}
function assign(tar, src) {
for (var k in src) {
tar[k] = src[k];
}return tar;
}
function destroy(detach) {
this.destroy = noop;
this.fire('destroy');
this.set = noop;
this._fragment.d(detach !== false);
this._fragment = null;
this._state = {};
}
function get() {
return this._state;
}
function fire(eventName, data) {
var handlers = eventName in this._handlers && this._handlers[eventName].slice();
if (!handlers) return;
for (var i = 0; i < handlers.length; i += 1) {
var handler = handlers[i];
if (!handler.__calling) {
try {
handler.__calling = true;
handler.call(this, data);
} finally {
handler.__calling = false;
}
}
}
}
function on(eventName, handler) {
var handlers = this._handlers[eventName] || (this._handlers[eventName] = []);
handlers.push(handler);
return {
cancel: function cancel() {
var index = handlers.indexOf(handler);
if (~index) handlers.splice(index, 1);
}
};
}
function set(newState) {
this._set(assign({}, newState));
if (this.root._lock) return;
flush(this.root);
}
function _set(newState) {
var oldState = this._state,
changed = {},
dirty = false;
newState = assign(this._staged, newState);
this._staged = {};
for (var key in newState) {
if (this._differs(newState[key], oldState[key])) changed[key] = dirty = true;
}
if (!dirty) return;
this._state = assign(assign({}, oldState), newState);
this._recompute(changed, this._state);
if (this._bind) this._bind(changed, this._state);
if (this._fragment) {
this.fire("state", { changed: changed, current: this._state, previous: oldState });
this._fragment.p(changed, this._state);
this.fire("update", { changed: changed, current: this._state, previous: oldState });
}
}
function _stage(newState) {
assign(this._staged, newState);
}
function _mount(target, anchor) {
this._fragment[this._fragment.i ? 'i' : 'm'](target, anchor || null);
}
function _differs(a, b) {
return a != a ? b == b : a !== b || a && (typeof a === "undefined" ? "undefined" : _typeof(a)) === 'object' || typeof a === 'function';
}
function blankObject() {
return Object.create(null);
}
function flush(component) {
component._lock = true;
callAll(component._beforecreate);
callAll(component._oncreate);
callAll(component._aftercreate);
component._lock = false;
}
function callAll(fns) {
while (fns && fns.length) {
fns.shift()();
}
}
return PNotifyHistory;
}(WamPnotify);
//# sourceMappingURL=PNotifyHistory.js.map

View File

@@ -0,0 +1,856 @@
(function($) {
class cEditorCondition {
constructor(editor, group, options) {
this.editor = editor;
this.group = group;
this.element = editor.element;
this.options = $.extend({}, {
index: null,
operator: 'equals'
}, options);
this._index = this.options.index;
this._conditionElement = this._createMarkup();
this._hintElement = this._conditionElement.find(".wam-cleditor__hint");
this._hintContentElement = this._conditionElement.find(".wam-cleditor__hint-content");
this._prepareFields(true);
this._register_events()
}
getData() {
let paramOptions = this._getParamOptions(),
currentParam = this._conditionElement.find(".wam-cleditor__param-select").val(),
$operator = this._conditionElement.find(".wam-cleditor__operator-select"),
currentOperator = $operator.val();
let value = null;
if( 'select' === paramOptions['type'] ) {
value = this._getSelectControlValue(paramOptions);
} else if( 'equals' === paramOptions['type'] ) {
value = this._getEqualsControlValue(paramOptions);
} else if( 'integer' === paramOptions['type'] ) {
value = this._getIntegerControlValue(paramOptions);
} else {
value = this._getTextValue(paramOptions);
}
return {
param: currentParam,
operator: currentOperator,
type: paramOptions['type'],
value: value
};
}
_createMarkup() {
let conditionTmpl = this.editor.getTemplate(".wam-cleditor__condition");
this.group.groupElement.find(".wam-cleditor__conditions").append(conditionTmpl);
return conditionTmpl;
}
_remove() {
this.group.removeCondition(this._index);
this._conditionElement.remove();
this.group.groupElement.trigger('winp.conditions-changed');
this.element.trigger('wam.editor-updated');
}
_register_events() {
let self = this;
this._conditionElement.find(".wam-cleditor__param-select").change(function() {
self._prepareFields();
self.element.trigger('wam.editor-updated');
});
this._conditionElement.find(".wam-cleditor__operator-select").change(function() {
self.element.trigger('wam.editor-updated');
});
this._conditionElement.find(".wam-cleditor__condition-value").on('change keyup', function() {
self.element.trigger('wam.editor-updated');
})
// buttons
this._conditionElement.find(".js-wam-cleditor__condition-remove").click(function() {
self._remove();
return false;
});
this._conditionElement.find(".js-wam-cleditor__condition-add-and").click(function() {
self.group.addCondition();
return false;
});
}
_prepareFields(isInit) {
if( isInit && this.options.param ) {
this._selectParam(this.options.param);
}
let paramOptions = this._getParamOptions();
this._setParamHint(paramOptions.description);
let operators = [];
if( 'select' === paramOptions['type'] || paramOptions['onlyEquals'] ) {
operators = ['equals', 'notequal'];
} else if( 'date' === paramOptions['type'] ) {
operators = ['equals', 'notequal', 'younger', 'older', 'between'];
} else if( 'date-between' === paramOptions['type'] ) {
operators = ['between'];
} else if( 'integer' === paramOptions['type'] ) {
operators = ['equals', 'notequal', 'less', 'greater', 'between'];
} else if( 'equals' === paramOptions['type'] ) {
operators = ['equals', 'notequal'];
} else if( 'regexp' === paramOptions['type'] ) {
operators = ['equals'];
} else if( 'default' === paramOptions['type'] ) {
operators = ['equals', 'notequal'];
} else {
operators = ['equals', 'notequal', 'contains', 'notcontain'];
}
this._setOperators(operators);
if( isInit && this.options.operator ) {
this._selectOperator(this.options.operator);
} else {
this._selectFirstOperator();
}
this._createValueControl(paramOptions, isInit);
}
/**
* Displays and configures the param hint.
*/
_setParamHint(description) {
if( description ) {
this._hintContentElement.html(description);
this._hintElement.show();
} else {
this._hintElement.hide();
}
}
/**
* Creates control to specify value.
*/
_createValueControl(paramOptions, isInit) {
if( 'select' === paramOptions['type'] ) {
this._createValueAsSelect(paramOptions, isInit);
} else if( 'equals' === paramOptions['type'] ) {
this._createValueAsEquals(paramOptions, isInit);
} else if( 'integer' === paramOptions['type'] ) {
this._createValueAsInteger(paramOptions, isInit);
} else {
this._createValueAsText(paramOptions, isInit);
}
}
// -------------------
// Select Control
// -------------------
/**
* Creates the Select control.
*/
_createValueAsSelect(paramOptions, isInit) {
let self = this;
let createSelectField = function(values) {
let $select = self._createSelect(values);
self._insertValueControl($select);
if( isInit && self.options.value ) {
self._setSelectValue(self.options.value);
}
self._conditionElement.find(".wam-cleditor__condition-value").trigger("insert.select");
};
if( !paramOptions['values'] ) {
return;
}
if( 'ajax' === paramOptions['values']['type'] ) {
let $fakeSelect = self._createSelect([
{
value: null,
title: '- loading -'
}
]);
self._insertValueControl($fakeSelect);
$fakeSelect.attr('disabled', 'disabled');
$fakeSelect.addClass('wam-cleditor__fake-select');
if( isInit && this.options.value ) {
$fakeSelect.data('value', this.options.value);
}
let req = $.ajax({
url: window.ajaxurl,
method: 'post',
data: {
action: paramOptions['values']['action']
},
dataType: 'json',
success: function(data) {
createSelectField(data.values);
},
error: function() {
console.log('Unexpected error during the ajax request.');
},
complete: function() {
if( $fakeSelect ) {
$fakeSelect.remove();
}
$fakeSelect = null;
}
});
} else {
createSelectField(paramOptions['values']);
}
}
/**
* Returns a value for the select control.
*/
_getSelectControlValue() {
let $select = this._conditionElement.find(".wam-cleditor__condition-value select");
let value = $select.val();
if( !value ) {
value = $select.data('value');
}
return value;
}
/**
* Sets a select value.
*/
_setSelectValue(value) {
let $select = this._conditionElement.find(".wam-cleditor__condition-value select");
if( $select.hasClass('.wam-cleditor__fake-select') ) {
$select.data('value', value);
} else {
$select.val(value);
}
}
// -------------------
// Integer Control
// -------------------
/**
* Creates a control for the input linked with the integer.
*/
_createValueAsInteger(paramOptions, isInit) {
let self = this;
let $operator = this._conditionElement.find(".wam-cleditor__operator-select");
$operator.on('change', function() {
let currentOperator = $operator.val();
let $control;
if( 'between' === currentOperator ) {
$control = $("<span><input type='text' class='wam-cleditor__integer-start' /> and <input type='text' class='wam-cleditor__integer-end' /></span>");
} else {
$control = $("<input type='text' class='wam-cleditor__integer-solo' /></span>");
}
self._insertValueControl($control);
});
$operator.change();
if( isInit && this.options.value ) {
this._setIntegerValue(this.options.value);
}
}
/**
* Returns a value for the Integer control.
*/
_getIntegerControlValue() {
let value = {};
let $operator = this._conditionElement.find(".wam-cleditor__operator-select");
let currentOperator = $operator.val();
if( 'between' === currentOperator ) {
value.range = true;
value.start = this._conditionElement.find(".wam-cleditor__integer-start").val();
value.end = this._conditionElement.find(".wam-cleditor__integer-end").val();
} else {
value = this._conditionElement.find(".wam-cleditor__integer-solo").val();
}
return value;
}
/**
* Sets a value for the Integer control.
*/
_setIntegerValue(value) {
if( !value ) {
value = {};
}
if( value.range ) {
this._conditionElement.find(".wam-cleditor__integer-start").val(value.start);
this._conditionElement.find(".wam-cleditor__integer-end").val(value.end);
} else {
this._conditionElement.find(".wam-cleditor__integer-solo").val(value);
}
}
// -------------------
// Query string Control
// -------------------
/**
* Creates a control for the input linked with the integer.
*/
_createValueAsEquals(paramOptions, isInit) {
let self = this;
let $operator = this._conditionElement.find(".wam-cleditor__operator-select");
let $control;
$control = $("<span><input type='text' class='wam-cleditor__equals-value1' /> <span class='wam-cleditor__equals-icon'>=</span> <input type='text' class='wam-cleditor__equals-value2' /></span>");
if( paramOptions['placeholder'] && $.isArray(paramOptions['placeholder']) ) {
$control.find('.wam-cleditor__equals-value1').attr('placeholder', paramOptions['placeholder'][0]);
if( paramOptions['placeholder'][1] ) {
$control.find('.wam-cleditor__equals-value2').attr('placeholder', paramOptions['placeholder'][1]);
}
}
self._insertValueControl($control);
$operator.on('change', function() {
let currentOperator = $operator.val();
let equalIcon = $control.find('.wam-cleditor__equals-icon');
if( 'equals' === currentOperator ) {
equalIcon.text('=');
} else {
equalIcon.text('≠');
}
});
$operator.change();
if( isInit && this.options.value ) {
this._setEqualsControlValue(this.options.value);
}
}
/**
* Returns a value for the Integer control.
*/
_getEqualsControlValue() {
let value = {};
value.var_name = this._conditionElement.find(".wam-cleditor__equals-value1").val();
value.var_value = this._conditionElement.find(".wam-cleditor__equals-value2").val();
return value;
}
/**
* Sets a value for the Integer control.
*/
_setEqualsControlValue(value) {
if( !value ) {
value = {};
}
this._conditionElement.find(".wam-cleditor__equals-value1").val(value.var_name);
this._conditionElement.find(".wam-cleditor__equals-value2").val(value.var_value);
}
// -------------------
// Text Control
// -------------------
/**
* Creates a control for the input linked with the integer.
*/
_createValueAsText(paramOptions, isInit) {
let $control = $("<input type='text' class='wam-cleditor__text' /></span>");
if( paramOptions['placeholder'] ) {
$control.attr('placeholder', paramOptions['placeholder']);
}
this._insertValueControl($control);
if( isInit && this.options.value && "" !== this.options.value ) {
this._setTextValue(this.options.value);
} else if( paramOptions['default_value'] ) {
this._setTextValue(paramOptions['default_value'])
}
}
/**
* Returns a value for the Text control.
* @returns {undefined}
*/
_getTextValue() {
return this._conditionElement.find(".wam-cleditor__text").val();
}
/**
* Sets a value for the Text control.
*/
_setTextValue(value) {
this._conditionElement.find(".wam-cleditor__text").val(value);
}
// -------------------
// Helper Methods
// -------------------
_selectParam(value) {
this._conditionElement.find(".wam-cleditor__param-select").val(value);
}
_selectOperator(value) {
this._conditionElement.find(".wam-cleditor__operator-select").val(value);
}
_selectFirstOperator() {
this._conditionElement.find(".wam-cleditor__operator-select").prop('selectedIndex', 0);
}
_setOperators(values) {
let $operator = this._conditionElement.find(".wam-cleditor__operator-select");
$operator.show();//.off('change');
$operator.find("option").hide();
for( let index in values ) {
if( !values.hasOwnProperty(index) ) {
continue;
}
$operator.find("option[value='" + values[index] + "']").show();
}
let value = $operator.find("option:not(:hidden):eq(0)").val();
$operator.val(value);
}
_insertValueControl($control) {
this._conditionElement.find(".wam-cleditor__condition-value").html("").append($control);
}
_getParamOptions() {
let selectElement = this._conditionElement.find(".wam-cleditor__param-select"),
optionElement = selectElement.find('option:selected');
if( !selectElement.length ) {
return false;
}
let type = optionElement.data('type'),
data = {
id: selectElement.val(),
title: optionElement.text().trim(),
type: optionElement.data('type'),
default_value: optionElement.data('default-value'),
values: optionElement.data('params'),
description: optionElement.data('hint').trim()
};
if( "text" === type || "default" === type || "regexp" === type || "equals" === type ) {
data['placeholder'] = optionElement.data('placeholder');
delete data['values'];
}
return data;
}
_createSelect(values, attrs) {
let $select = $("<select></select>");
if( attrs ) {
$select.attr(attrs);
}
for( let index in values ) {
if( !values.hasOwnProperty(index) ) {
continue;
}
let item = values[index];
let $option = '';
if( typeof index === "string" && isNaN(index) === true ) {
let $optgroup = $("<optgroup></optgroup>").attr('label', index);
for( let subindex in item ) {
if( !item.hasOwnProperty(subindex) ) {
continue;
}
let subvalue = item[subindex];
$option = $("<option></option>").attr('value', subvalue['value']).text(subvalue['title']);
$optgroup.append($option);
}
$select.append($optgroup);
} else {
$option = $("<option></option>").attr('value', item['value']).text(item['title']);
$select.append($option);
}
}
return $select;
}
}
class cEditorGroup {
constructor(editor, options) {
this.editor = editor;
this.element = editor.element;
this.options = $.extend({}, {
conditions: null,
index: null
}, options);
this._index = this.options.index;
this.conditions = {};
this.groupElement = this._createMarkup();
this._conditionsCounter = 0;
this._load();
}
getData() {
let condtions = [];
for( let ID in this.conditions ) {
if( !this.conditions.hasOwnProperty(ID) ) {
continue;
}
condtions.push(this.conditions[ID].getData());
}
if( !condtions.length ) {
return null;
}
return {
type: 'OR',
conditions: condtions
};
}
getCountConditions() {
return Object.keys(this.conditions).length;
}
removeCondition(ID) {
if( this.conditions[ID] ) {
delete this.conditions[ID];
}
}
_createMarkup() {
let $group = this.editor.getTemplate('.wam-cleditor__group');
this.element.find(".wam-cleditor__groups").append($group);
if( this._index <= 1 ) {
$group.find('.wam-cleditor__group-type').hide();
$group.find('.js-wam-cleditor__remove-group').remove();
} else {
$group.find('.wam-cleditor__group-type').show();
$group.find('.wam-cleditor__first-group-title').remove();
}
return $group;
}
_registerEvents() {
let self = this;
this.groupElement.find(".js-wam-cleditor__add-condition").click(function() {
self.addCondition();
return false;
});
this.groupElement.find(".js-wam-cleditor__remove-group").click(function() {
self._remove();
return false;
});
this.groupElement.on('winp.conditions-changed', function() {
self._checkIsEmpty();
});
}
_load() {
if( !this.options.conditions ) {
this.addCondition();
} else {
this._setGroupData();
}
this._registerEvents();
}
_remove() {
this.editor.removeGroup(this._index);
this.groupElement.remove();
this.element.trigger('wam.filters-changed');
this.element.trigger('wam.editor-updated');
}
_setGroupData() {
this.groupElement.find('.wam-cleditor__condition').remove();
if( this.options.conditions ) {
for( let index in this.options.conditions ) {
if( !this.options.conditions.hasOwnProperty(index) ) {
continue;
}
this.addCondition(this.options.conditions[index]);
}
}
this._checkIsEmpty();
}
addCondition(data) {
if( !data ) {
data = {type: 'AND'};
}
this._conditionsCounter = this._conditionsCounter + 1;
data.index = this._index + '_' + this._conditionsCounter;
this.conditions[data.index] = new cEditorCondition(this.editor, this, data);
this.groupElement.trigger('winp.conditions-changed');
this.element.trigger('wam.editor-updated');
}
_checkIsEmpty() {
if( this.getCountConditions() === 0 ) {
this.groupElement.addClass('wam-cleditor__empty');
} else {
this.groupElement.removeClass('wam-cleditor__empty');
}
}
}
class cEditor {
constructor(element, options) {
this.element = element;
this.options = $.extend({}, {
groups: null,
// where to get an editor template
templateSelector: null,
// where to put editor options
saveInputSelector: null,
callback: null
}, options);
this.groups = {};
this.groupsCounter = 0;
this.element = this._createMarkup();
this._load();
if( this.options.callback ) {
this.options.callback(this);
}
}
/*showParams() {
this.element.find('.wam-cleditor__param-select').find('options').show();
}
hideParams(params) {
if( params.length ) {
for( let i = 0; i < params.length; i++ ) {
this.element.find('.wam-cleditor__param-select').find('option[value="' + params[i] + '"]').hide();
}
}
}*/
getData() {
let self = this;
let groups = [];
for( let ID in self.groups ) {
if( !self.groups.hasOwnProperty(ID) ) {
continue;
}
let groupData = self.groups[ID].getData();
if( groupData ) {
groups.push(self.groups[ID].getData());
}
}
if( !groups.length ) {
return null;
}
return groups;
}
getImportData() {
if( this.options.saveInputSelector ) {
let data = this.element.parent().find(this.options.saveInputSelector).val();
if( !data ) {
return null;
}
return JSON.parse(data);
}
return null;
}
setExportData() {
if( this.options.saveInputSelector && $(this.options.saveInputSelector).length ) {
let data = !this.getData() ? '' : JSON.stringify(this.getData());
this.element.parent().find(this.options.saveInputSelector).val(data);
} else {
throw new Error('[Error]: Save input is not found! Selector: ' + this.options.saveInputSelector);
}
}
getTemplate(selector) {
let tmpl = $($(this.options.templateSelector).html());
if( !tmpl.length ) {
throw new Error('[Error]: Editor template is not found! Selector: ' + this.options.templateSelector);
}
return tmpl.find(selector).clone();
}
getCountGroups() {
return Object.keys(this.groups).length;
}
removeGroup(ID) {
if( this.groups[ID] ) {
delete this.groups[ID];
}
}
destroy() {
this.element.remove();
}
_registerEvents() {
let self = this;
this.element.on('wam.editor-updated', function() {
self.setExportData();
});
this.element.on('wam.filters-changed', function() {
self._checkIsEmpty();
});
this.element.find(".js-wam-cleditor__add-group").click(function() {
self._addGroup();
return false;
});
}
_createMarkup() {
let $editor = $('<div></div>').addClass('wam-cleditor');
this.element.prepend($editor);
$editor.append(this.getTemplate('.wam-cleditor__wrap'));
$editor.append(this.getTemplate('.wam-cleditor__buttons-group'));
return $editor;
}
_load() {
let groups, savedOptions;
savedOptions = this.getImportData();
if( savedOptions ) {
groups = savedOptions;
} else if( this.options.groups && this.options.groups.length > 0 ) {
groups = this.options.groups;
}
if( groups ) {
for( let index in groups ) {
if( !groups.hasOwnProperty(index) ) {
continue;
}
this._addGroup(groups[index]);
}
}
this._checkIsEmpty();
this._registerEvents();
// If editor will create demo data, we will trigger an event
if( !savedOptions ) {
this.element.trigger('wam.editor-updated');
}
}
_addGroup(data) {
if( !data ) {
data = {type: 'OR'};
}
this.groupsCounter = this.groupsCounter + 1;
this.groups[this.groupsCounter] = new cEditorGroup(this, {
index: this.groupsCounter,
conditions: data.conditions
});
this.element.trigger('wam.editor-updated');
this.element.trigger('wam.filters-changed');
}
_checkIsEmpty() {
if( this.getCountGroups() === 0 ) {
this.element.addClass('wam-cleditor__empty');
} else {
this.element.removeClass('wam-cleditor__empty');
}
}
}
$.fn.wamConditionsEditor = function(options) {
return this.each(function() {
new cEditor($(this), options);
});
};
})(jQuery);

View File

@@ -0,0 +1,678 @@
/**
* Assets manager scripts
* @author Webcraftic <wordpress.webraftic@gmail.com>
* @copyright (c) 13.11.2017, Webcraftic
* @version 1.0
*/
(function($) {
'use strict';
class AssetsManager {
constructor() {
if( undefined === typeof window.wam_localize_data || !wam_localize_data.ajaxurl ) {
throw new Error("Undefined wam_localize_data, please check the var in source!");
}
this.pluginVars = window.wam_localize_data;
this.initEvents();
this.updateStat();
this.setDefaultCategoryTab();
}
initEvents() {
var self = this;
$('.js-wam-require-handle-tag').click(function() {
let handle = $(this).data('tag-handle'),
assetElement = $('[data-asset-handle="' + handle + '"]'),
currentTabElement = $(this).closest('.wam-assets-type-tab-content'),
searchTabElement = assetElement.closest('.wam-assets-type-tab-content');
self.switchCategoryTab($('.wam-assets-type-tabs__button--' + searchTabElement.data('category')));
assetElement.get(0).scrollIntoView({
block: 'center'
});
assetElement.css('border', '1px solid red');
setTimeout(function() {
assetElement.css('border', '0');
}, 2000)
return false;
});
$('.js-wam-assets-type-tabs__button').click(function() {
self.switchCategoryTab($(this));
return false;
});
$('.js-wam-nav-plugins__tab-switch').click(function() {
self.switchPluginTab($(this));
return false;
});
$('.js-wam-top-panel__save-button').click(function() {
self.saveSettings();
return false;
});
$('.js-wam-select-plugin-load-mode').change(function() {
if( 'enable' === $(this).val() ) {
self.enablePlugin($(this));
} else if( 'disable_assets' === $(this).val() || 'disable_plugin' === $(this).val() ) {
self.disablePlugin($(this));
}
return false;
});
$('.js-wam-open-plugin-settings').click(function() {
if( $(this).hasClass('js-wam-button--opened') ) {
self.closePluginSettings($(this));
return false;
}
self.openPluginSettings($(this));
return false;
});
$('.js-wam-select-asset-load-mode').change(function() {
let selectElement = $(this),
requires = selectElement.closest('tr').find('.js-wam-table__asset-requires');
if( 'enable' === selectElement.val() ) {
self.enableAsset(selectElement);
return false;
}
if( requires.length ) {
// show warning
var notice = WamPnotify.notice({
title: self.pluginVars.i18n.asset_canbe_required_title,
text: self.pluginVars.i18n.asset_canbe_required_text.replace('%s', requires.text()),
icon: 'fas fa-question-circle',
hide: false,
stack: {
'dir1': 'down',
'modal': true,
'firstpos1': 25
},
modules: {
Confirm: {
confirm: true
},
Buttons: {
closer: false,
sticker: false
},
History: {
history: false
},
}
});
notice.on('pnotify.confirm', function() {
self.disableAsset(selectElement);
});
return false;
}
self.disableAsset(selectElement);
return false;
});
$('.js-wam-open-asset-settings').click(function() {
if( $(this).hasClass('js-wam-button--opened') ) {
self.closeAssetSettings($(this));
return false;
}
self.openAssetSettings($(this));
return false;
});
$('.js-wam-reset-settings').click(function() {
self.setWarningForClearSettingsAction($(this));
return false;
});
}
setWarningForClearSettingsAction(button) {
var notice = WamPnotify.notice({
title: this.pluginVars.i18n.reset_settings_warning_title,
text: this.pluginVars.i18n.reset_settings_warning_text,
icon: 'fas fa-question-circle',
hide: false,
stack: {
'dir1': 'down',
'modal': true,
'firstpos1': 25
},
modules: {
Confirm: {
confirm: true
},
Buttons: {
closer: false,
sticker: false
},
History: {
history: false
},
}
});
notice.on('pnotify.confirm', function() {
window.location.href = button.attr('href');
});
/*notice.on('pnotify.cancel', function() {
alert('Oh ok. Chicken, I see.');
});*/
}
setDefaultCategoryTab() {
let tabHash = window.location.hash.replace('#', '');
tabHash && $('.js-wam-assets-type-tabs__button[data-type="' + tabHash + '"]').click();
}
switchCategoryTab(element) {
window.location.hash = '#' + element.data('type');
$('.js-wam-assets-type-tabs__button').removeClass('wam-assets-type-tab__active');
element.addClass('wam-assets-type-tab__active');
$('.wam-assets-type-tab-content').removeClass('wam-assets-type-tab-content__active');
$('#wam-assets-type-tab-content__' + element.data('type')).addClass('wam-assets-type-tab-content__active');
}
switchPluginTab(element) {
$('.js-wam-nav-plugins__tab-switch').removeClass('wam-nav-plugins__tab--active');
element.addClass('wam-nav-plugins__tab--active');
$('.wam-nav-plugins__tab-content').removeClass('js-wam-nav-plugins__tab-content--active');
$(element.find('a').attr('href')).addClass('js-wam-nav-plugins__tab-content--active');
$('.wam-table__th-plugins-settings').text(element.find('.wam-plugin-name').text());
}
setSettingsButtonOpenState(buttonElement) {
buttonElement.removeClass('js-wam-button--opened');
buttonElement.addClass('js-wam-button__icon--cogs').removeClass('js-wam-button__icon--close');
}
setSettingsButtonCloseState(buttonElement) {
buttonElement.addClass('js-wam-button--opened');
buttonElement.removeClass('js-wam-button__icon--cogs').addClass('js-wam-button__icon--close');
}
disablePlugin(selectElement) {
let activeContainerElement = selectElement.closest('.js-wam-nav-plugins__tab-content--active'),
settingsButtonElement = selectElement.closest('.wam-plugin-settings__controls').find('.js-wam-open-plugin-settings');
/*if( currentContentTabElement.find('.js-wam-select-asset-load-mode option[value="disable"]:selected').length ) {
var passAction = confirm("If you want to change the plugins load mode, all your logical settings to disable the plugins assets will be reset. Do you really want to do this?");
if( !passAction ) {
return;
}
}*/
/*var notice = PNotify.notice({
title: 'Confirmation Needed',
text: 'Are you sure?',
icon: 'fas fa-question-circle',
hide: false,
stack: {
'dir1': 'down',
'modal': true,
'firstpos1': 25
},
modules: {
Confirm: {
confirm: true
},
Buttons: {
closer: false,
sticker: false
},
History: {
history: false
},
}
});
notice.on('pnotify.confirm', function() {
alert('Ok, cool.');
});
notice.on('pnotify.cancel', function() {
alert('Oh ok. Chicken, I see.');
});*/
settingsButtonElement.removeClass('js-wam-button--hidden');
selectElement.removeClass('js-wam-select--enable')
.addClass('js-wam-select--disable');
// Disable assets table
let assetSettingsContainer = activeContainerElement.find('.wam-table__asset-settings');
assetSettingsContainer.addClass('js-wam-table__tr--disabled-section');
//assetSettingsContainer.hide();
let assetConditionsContainer = activeContainerElement.find('.wam-table__asset-settings-conditions');
assetConditionsContainer.hide();
assetConditionsContainer.find(".wam-cleditor").remove();
assetConditionsContainer.find(".wam-conditions-builder__settings").val('');
activeContainerElement.find('.js-wam-select-asset-load-mode').val('disable')
.removeClass('js-wam-select--enable')
.addClass('js-wam-select--disable')
.prop('disabled', true);
activeContainerElement.find('.js-wam-open-asset-settings')
.removeClass('js-wam-button--opened')
.addClass('js-wam-button--hidden');
this.openPluginSettings(settingsButtonElement, "disable_plugin" === selectElement.val());
this.updateStat();
}
enablePlugin(selectElement) {
let activeContainerElement = selectElement.closest('.js-wam-nav-plugins__tab-content--active'),
settingsButtonElement = selectElement.closest('.wam-plugin-settings__controls').find('.js-wam-open-plugin-settings');
settingsButtonElement.addClass('js-wam-button--hidden');
selectElement.removeClass('js-wam-select--disable')
.addClass('js-wam-select--enable');
// Enable assets table
activeContainerElement.find('.wam-table__asset-settings').removeClass('js-wam-table__tr--disabled-section');
activeContainerElement.find('.js-wam-select-asset-load-mode').val('enable')
.addClass('js-wam-select--enable')
.removeClass('js-wam-select--disable')
.prop('disabled', false);
activeContainerElement.find('.js-wam-open-asset-settings')
.addClass('js-wam-button--hidden');
this.closePluginSettings(settingsButtonElement, true);
this.updateStat();
}
openPluginSettings(buttonElement) {
let containerElement = buttonElement.closest('.wam-plugin-settings'),
editorContainerElement = containerElement.find('.js-wam-plugin-settings__conditions');
this.setSettingsButtonCloseState(buttonElement);
editorContainerElement.show();
if( !editorContainerElement.find('.wam-cleditor').length ) {
this.createConditionsEditor(editorContainerElement, function(e) {
function a() {
let loadMode = containerElement.find('.js-wam-select-plugin-load-mode').val();
if( "disable_plugin" === loadMode ) {
e.element.addClass('wam-cleditor__disable-plugin-mode');
} else {
e.element.removeClass('wam-cleditor__disable-plugin-mode');
}
}
containerElement.find('.js-wam-select-plugin-load-mode').change(function() {
a();
});
a();
});
}
}
closePluginSettings(buttonElement, destroyEditor = false) {
let containerElement = buttonElement.closest('.wam-plugin-settings'),
editorContainerElement = containerElement.find('.js-wam-plugin-settings__conditions');
if( destroyEditor ) {
this.destroyCoditionEditor(editorContainerElement);
}
if( !buttonElement.hasClass('js-wam-button--opened') ) {
return false;
}
this.setSettingsButtonOpenState(buttonElement);
editorContainerElement.hide();
}
disableAsset(selectElement) {
let containerElement = selectElement.closest('tr'),
settingsButtonElement = containerElement.find('.js-wam-open-asset-settings');
settingsButtonElement.removeClass('js-wam-button--hidden');
containerElement.addClass('js-wam-table__tr--disabled-section');
selectElement.removeClass('js-wam-select--enable').addClass('js-wam-select--disable');
this.openAssetSettings(settingsButtonElement);
this.updateStat();
}
enableAsset(selectElement) {
let containerElement = selectElement.closest('tr'),
settingsButtonElement = containerElement.find('.js-wam-open-asset-settings');
settingsButtonElement.addClass('js-wam-button--hidden');
selectElement.removeClass('js-wam-select--disable').addClass('js-wam-select--enable');
containerElement.removeClass('js-wam-table__tr--disabled-section');
this.closeAssetSettings(settingsButtonElement, true);
this.updateStat();
}
/**
* Toggle Asset Settings
* @param buttonElement Object settings button
* @returns {boolean}
*/
openAssetSettings(buttonElement) {
var placeID = buttonElement.closest('tr').attr('id'),
place = $('#' + placeID + '-conditions');
if( buttonElement.hasClass('js-wam-button--opened') ) {
return false;
}
this.setSettingsButtonCloseState(buttonElement);
place.show();
if( !place.find('.wam-cleditor').length ) {
this.createConditionsEditor(place.find(".wam-asset-conditions-builder"));
}
return true;
}
closeAssetSettings(buttonElement, destroyEditor = false) {
var placeID = buttonElement.closest('tr').attr('id'),
place = $('#' + placeID + '-conditions');
if( destroyEditor ) {
this.destroyCoditionEditor(place.find(".wam-asset-conditions-builder"));
}
if( !buttonElement.hasClass('js-wam-button--opened') ) {
return false;
}
this.setSettingsButtonOpenState(buttonElement);
place.hide();
return true;
}
saveSettings() {
var settings = {
save_mode: $('#js-wam-save-mode-checkbox').prop("checked"),
plugins: {},
theme: {},
misc: {}
};
$('.wam-nav-plugins__tab-content').each(function() {
let pluginGroupVisabilityConditionsElement = $(this).find('.js-wam-plugin-settings__conditions').find('.wam-conditions-builder__settings'),
pluginName = pluginGroupVisabilityConditionsElement.data('plugin-name'),
pluginGroupVisabilityConditionsVal = pluginGroupVisabilityConditionsElement.val(),
pluginGroupLoadMode = $('.js-wam-select-plugin-load-mode', $(this)).val();
if( pluginName ) {
if( !settings['plugins'][pluginName] ) {
settings['plugins'][pluginName] = {};
}
settings['plugins'][pluginName]['load_mode'] = pluginGroupLoadMode;
settings['plugins'][pluginName]['visability'] = pluginGroupVisabilityConditionsVal;
}
$('.wam-table__asset-settings', $(this)).each(function() {
let resourceType = $(this).data('resource-type'),
resourceHandle = $(this).data('resource-handle');
if( settings['plugins'][pluginName] ) {
if( !settings['plugins'][pluginName][resourceType] ) {
settings['plugins'][pluginName][resourceType] = {};
}
if( !settings['plugins'][pluginName][resourceType][resourceHandle] ) {
settings['plugins'][pluginName][resourceType][resourceHandle] = {};
}
settings['plugins'][pluginName][resourceType][resourceHandle]['move_to_footer'] = $(this).find('.wam-checkbox__move-to-footer').prop('checked');
}
});
$('.wam-table__asset-settings-conditions', $(this)).each(function() {
let resourceVisabilityConditionsElement = $(this).find('.wam-conditions-builder__settings'),
resourceVisabilityConditionsVal = resourceVisabilityConditionsElement.val(),
resourceType = resourceVisabilityConditionsElement.data('resource-type'),
resourceHandle = resourceVisabilityConditionsElement.data('resource-handle');
if( settings['plugins'][pluginName] ) {
if( !settings['plugins'][pluginName][resourceType] ) {
settings['plugins'][pluginName][resourceType] = {};
}
if( !settings['plugins'][pluginName][resourceType][resourceHandle] ) {
settings['plugins'][pluginName][resourceType][resourceHandle] = {};
}
if( 'enable' !== pluginGroupLoadMode ) {
resourceVisabilityConditionsVal = "";
}
settings['plugins'][pluginName][resourceType][resourceHandle]['visability'] = resourceVisabilityConditionsVal;
}
});
});
$('.wam-table__asset-settings', '#wam-assets-type-tab-content__theme,#wam-assets-type-tab-content__misc').each(function() {
let groupType = $(this).data('group-type'),
recourceType = $(this).data("resource-type"),
resourceHandle = $(this).data("resource-handle");
if( !settings[groupType] ) {
settings[groupType] = {};
}
if( !settings[groupType][recourceType] ) {
settings[groupType][recourceType] = {};
}
if( !settings[groupType][recourceType][resourceHandle] ) {
settings[groupType][recourceType][resourceHandle] = {};
}
settings[groupType][recourceType][resourceHandle]['move_to_footer'] = $(this).find('.wam-checkbox__move-to-footer').prop('checked');
});
$('.wam-conditions-builder__settings', '#wam-assets-type-tab-content__theme,#wam-assets-type-tab-content__misc').each(function() {
let groupType = $(this).data('group-type'),
recourceType = $(this).data("resource-type"),
resourceHandle = $(this).data("resource-handle");
if( !settings[groupType] ) {
settings[groupType] = {};
}
if( !settings[groupType][recourceType] ) {
settings[groupType][recourceType] = {};
}
if( !settings[groupType][recourceType][resourceHandle] ) {
settings[groupType][recourceType][resourceHandle] = {};
}
settings[groupType][recourceType][resourceHandle]['visability'] = $(this).val();
});
let stackBottomRight = {
'dir1': 'up',
'dir2': 'left',
'firstpos1': 25,
'firstpos2': 25
};
WamPnotify.closeAll();
WamPnotify.alert({
title: 'Saving settings!',
text: 'Please wait, saving settings ...',
stack: stackBottomRight,
hide: false
});
$.ajax(this.pluginVars.ajaxurl, {
type: 'post',
dataType: 'json',
data: {
action: 'wam-save-settings',
scope: this.pluginVars.scope,
settings: settings,
_wpnonce: $('#wam-save-button').data('nonce')
},
success: function(response) {
WamPnotify.closeAll();
if( !response || !response.success ) {
if( response.data ) {
WamPnotify.alert({
title: response.data.error_message_title,
text: response.data.error_message_content,
stack: stackBottomRight,
type: 'error',
delay: 15000,
hide: true
});
} else {
console.log(response);
}
return;
}
if( response.data ) {
WamPnotify.alert({
title: response.data.save_massage_title,
text: response.data.save_message_content,
stack: stackBottomRight,
type: 'success',
delay: 3000,
hide: true
});
}
},
error: function(xhr, ajaxOptions, thrownError) {
WamPnotify.alert({
title: 'Unknown error',
text: thrownError,
stack: {
'dir1': 'up',
'dir2': 'left',
'firstpos1': 25,
'firstpos2': 25
},
type: 'error',
delay: 15000,
hide: true
});
}
});
}
createConditionsEditor(element, callback = null) {
element.wamConditionsEditor({
// where to get an editor template
templateSelector: '#wam-conditions-builder-template',
// where to put editor options
saveInputSelector: '.wam-conditions-builder__settings',
groups: [
{
"type": "group",
"conditions": [
{
"param": "current-url",
"operator": "equals",
"type": "default",
"value": this.getCurrentUrl()
}
]
}
],
callback: callback
});
}
/**
* Get current url
*
* if it is the admin area url would be with query string
*
* @returns {jQuery|*|*}
*/
getCurrentUrl() {
let path = $(location).attr('pathname'),
queryString = $(location).attr('search');
if( "admin" === this.pluginVars.scope || "networkadmin" === this.pluginVars.scope ) {
return path + queryString.replace(/[?&]{1}wbcr_assets_manager=1/g, '');
}
return path;
}
destroyCoditionEditor(element) {
element.find('.wam-cleditor').remove();
element.find('.wam-conditions-builder__settings').val('');
}
updateStat() {
let total_requests = 0,
total_size = 0,
optimized_size = 0,
disabled_js = 0,
disabled_css = 0;
$('.js-wam-asset').each(function() {
let size = $(this).data('size');
if( !$.isNumeric(size) ) {
return;
}
total_requests++;
total_size = total_size + size;
if( !$(this).hasClass('js-wam-table__tr--disabled-section') ) {
optimized_size = optimized_size + size;
} else {
if( $(this).hasClass('js-wam-js-asset') ) {
disabled_js++;
}
if( $(this).hasClass('js-wam-css-asset') ) {
disabled_css++;
}
}
});
$('.wam-float-panel__data-item.__info-request').find('.wam-float-panel__item_value').html(total_requests);
$('.wam-float-panel__data-item.__info-total-size').find('.wam-float-panel__item_value').html(Math.round(total_size) + ' KB');
$('.wam-float-panel__data-item.__info-reduced-total-size').find('.wam-float-panel__item_value').html(Math.round(optimized_size) + ' KB');
$('.wam-float-panel__data-item.__info-disabled-js').find('.wam-float-panel__item_value').html(disabled_js);
$('.wam-float-panel__data-item.__info-disabled-css').find('.wam-float-panel__item_value').html(disabled_css);
}
}
$(function() {
new AssetsManager();
});
})(jQuery);