first commit
This commit is contained in:
656
wp-content/plugins/brizy/admin/static/css/style.css
Normal file
656
wp-content/plugins/brizy/admin/static/css/style.css
Normal file
@@ -0,0 +1,656 @@
|
||||
.brizy-editor-enabled #insert-media-button,
|
||||
.brizy-editor-enabled #wp-content-editor-tools .wp-editor-tabs,
|
||||
.brizy-editor-enabled #wp-content-editor-container .quicktags-toolbar,
|
||||
.brizy-editor-enabled #wp-content-editor-container .wp-editor-area,
|
||||
.brizy-editor-enabled .editor-block-list__layout,
|
||||
.brizy-editor-enabled .block-editor-block-list__layout,
|
||||
.brizy-editor-enabled .block-editor-writing-flow__click-redirect,
|
||||
.brizy-editor-enabled .edit-post-text-editor__body .editor-post-text-editor {
|
||||
display: none;
|
||||
}
|
||||
|
||||
#brizy-admin-enable,
|
||||
#brizy-admin-disable {
|
||||
float: left;
|
||||
}
|
||||
|
||||
#brizy-admin-disable,
|
||||
.brizy-editor-enabled #brizy-admin-enable {
|
||||
display: none;
|
||||
}
|
||||
|
||||
.brizy-editor-enabled #brizy-admin-disable {
|
||||
display: block;
|
||||
}
|
||||
|
||||
.brizy-editor {
|
||||
padding: 10% 0;
|
||||
display: none;
|
||||
background: #fff;
|
||||
align-items: center;
|
||||
justify-content: center;
|
||||
}
|
||||
|
||||
.brizy-editor-enabled .brizy-editor {
|
||||
display: flex;
|
||||
}
|
||||
|
||||
.brizy-button--arrow {
|
||||
max-height: 14px;
|
||||
margin-right: 11px;
|
||||
}
|
||||
|
||||
.brizy-buttons {
|
||||
margin-top:auto;
|
||||
margin-bottom:auto;
|
||||
text-align:center;
|
||||
}
|
||||
.brizy-buttons .button {
|
||||
height: 33px;
|
||||
min-height: 32px !important;
|
||||
line-height: 1 !important;
|
||||
display: inline-flex;
|
||||
align-items: center;
|
||||
}
|
||||
|
||||
.brizy-buttons .button::before {
|
||||
background-color: white;
|
||||
content: "\00a0";
|
||||
width: 20px;
|
||||
height: 20px;
|
||||
margin-right: 10px;
|
||||
}
|
||||
|
||||
.is-classic-editor {
|
||||
margin: 20px 20px 20px 0;
|
||||
text-align: left;
|
||||
}
|
||||
|
||||
.brizy-buttons-gutenberg {
|
||||
margin-bottom: 50px;
|
||||
height: 300px;
|
||||
width: 100%;
|
||||
}
|
||||
|
||||
.brizy-buttons-gutenberg a {
|
||||
height: 100%;
|
||||
display: -webkit-box;
|
||||
display: -ms-flexbox;
|
||||
display: flex;
|
||||
-webkit-box-pack: center;
|
||||
-ms-flex-pack: center;
|
||||
justify-content: center;
|
||||
-webkit-box-align: center;
|
||||
-ms-flex-align: center;
|
||||
align-items: center;
|
||||
border: 1px solid #dedede;
|
||||
background-color: #f9f9f9;
|
||||
text-decoration: none;
|
||||
position: relative;
|
||||
}
|
||||
|
||||
.brizy-buttons-gutenberg .button {
|
||||
min-height: 46px !important;
|
||||
padding-left: 35px !important;
|
||||
padding-right: 35px !important;
|
||||
}
|
||||
|
||||
.brizy-buttons-gutenberg a:hover {
|
||||
background-color: #fff
|
||||
}
|
||||
|
||||
.brizy-button {
|
||||
padding: 0px 12px 0px;
|
||||
border-style: solid;
|
||||
border-width: 1px;
|
||||
border-bottom: 0;
|
||||
border-radius: 3px;
|
||||
background-color: #d62c64;
|
||||
text-shadow: none;
|
||||
font-size: 13px;
|
||||
font-family: "Open Sans", sans-serif;
|
||||
color: #fff !important;
|
||||
line-height: 1;
|
||||
display: inline-flex;
|
||||
align-items: center;
|
||||
text-decoration: none;
|
||||
transition: all 200ms linear;
|
||||
height: 33px;
|
||||
}
|
||||
|
||||
.brizy-go-editor-back-arrow {
|
||||
padding-bottom: 5px;
|
||||
font-size: 18px;
|
||||
}
|
||||
.brizy-button--default {
|
||||
font-size: 15px;
|
||||
color: #444;
|
||||
border-color: #e5e5e5;
|
||||
background-color: #fff;
|
||||
box-shadow: 0px 2px 0px 0px #e3e3e3;
|
||||
}
|
||||
|
||||
.brizy-button--primary {
|
||||
color: #555 !important;
|
||||
border-color: #ccc !important;
|
||||
background-color: #f7f7f7 !important;
|
||||
box-shadow: 0 1px 0 #ccc !important;
|
||||
-webkit-box-shadow: 0 1px 0 #ccc!important;
|
||||
}
|
||||
|
||||
a.brizy-button--primary:hover {
|
||||
background-color: #e9e9e9 !important;
|
||||
}
|
||||
|
||||
.brizy-button--default:hover,
|
||||
.brizy-button--default:focus,
|
||||
.brizy-button--default:active {
|
||||
color: #444;
|
||||
border-color: #e5e5e5;
|
||||
background-color: #fff;
|
||||
box-shadow: 0px 2px 0px 0px #e3e3e3;
|
||||
}
|
||||
|
||||
/**
|
||||
* Style Brizy Templates
|
||||
*/
|
||||
.brizy-template-rules .error {
|
||||
color: red;
|
||||
}
|
||||
|
||||
.brizy-template-rules .rules-container {
|
||||
position: relative;
|
||||
}
|
||||
|
||||
.brizy-template-rules .rules-container .lock-screen {
|
||||
position: absolute;
|
||||
top:0px;
|
||||
left:0px;
|
||||
bottom:0px;
|
||||
right: 0px;
|
||||
background: white;
|
||||
opacity: 0.3;
|
||||
text-align: center;
|
||||
font-size: 3em;
|
||||
padding-top: 1em;
|
||||
}
|
||||
|
||||
|
||||
.brizy-template-rules input[type="text"],
|
||||
.brizy-template-rules select {
|
||||
vertical-align: middle;
|
||||
height: 28px;
|
||||
line-height: 28px;
|
||||
background-color: #fff;
|
||||
border: 1px solid #aaa;
|
||||
border-radius: 4px;
|
||||
box-sizing: border-box;
|
||||
cursor: pointer;
|
||||
user-select: none;
|
||||
-webkit-user-select: none;
|
||||
box-shadow: none;
|
||||
}
|
||||
|
||||
.brizy-rule-select,
|
||||
.brizy-rule-select ~ .select2-container {
|
||||
margin-right: 5px;
|
||||
}
|
||||
|
||||
.brizy-template-rules .rule:not(:first-of-type) {
|
||||
margin-top: 10px;
|
||||
}
|
||||
|
||||
.brizy-template-rules .rule {
|
||||
position: relative;
|
||||
}
|
||||
|
||||
.brizy-template-rules .rule .rule-fields {
|
||||
position: relative;
|
||||
}
|
||||
|
||||
.brizy-template-rules .rule .overlay {
|
||||
position: absolute;
|
||||
top: -10px;
|
||||
bottom: -10px;
|
||||
left: 0px;
|
||||
right: 0px;
|
||||
}
|
||||
|
||||
.brizy-delete-rule {
|
||||
border: 0;
|
||||
padding: 0;
|
||||
font-size: 13px;
|
||||
text-decoration: underline;
|
||||
cursor: pointer;
|
||||
background: none;
|
||||
color: #a00;
|
||||
}
|
||||
|
||||
#template-rules .inside {
|
||||
padding-bottom: 20px;
|
||||
}
|
||||
|
||||
.brizy-rule-select > select {
|
||||
padding-left: 8px;
|
||||
padding-right: 20px;
|
||||
overflow: hidden;
|
||||
text-overflow: ellipsis;
|
||||
white-space: nowrap;
|
||||
line-height: 1;
|
||||
appearance: none;
|
||||
}
|
||||
|
||||
.brizy-rule-select > select:disabled {
|
||||
color: #444;
|
||||
background-color: #eee;
|
||||
border: 1px solid #aaa;
|
||||
}
|
||||
|
||||
.brizy-rule-select--options {
|
||||
min-width: 175px;
|
||||
}
|
||||
|
||||
.brizy-rule-select {
|
||||
position: relative;
|
||||
}
|
||||
|
||||
.brizy-template-rules .select2-selection__arrow {
|
||||
color: #32373c;
|
||||
border-color: #7e8993;
|
||||
box-shadow: none;
|
||||
border-radius: 3px;
|
||||
padding: 0 5px 0 0;
|
||||
-webkit-appearance: none;
|
||||
background: #fff url('data:image/svg+xml;charset=US-ASCII,%3Csvg%20width%3D%2220%22%20height%3D%2220%22%20xmlns%3D%22http%3A%2F%2Fwww.w3.org%2F2000%2Fsvg%22%3E%3Cpath%20d%3D%22M5%206l5%205%205-5%202%201-7%207-7-7%202-1z%22%20fill%3D%22%23555%22%2F%3E%3C%2Fsvg%3E') no-repeat left 5px top 55%;
|
||||
background-size: 16px 16px;
|
||||
cursor: pointer;
|
||||
vertical-align: middle;
|
||||
}
|
||||
|
||||
.brizy-template-rules .brizy-template-type label {
|
||||
margin-right: 20px;
|
||||
}
|
||||
|
||||
.brizy-template-rules .select2-selection__arrow b {
|
||||
display: none;
|
||||
}
|
||||
|
||||
.brizy-rule-new-condition .brizy-rule-select2::after {
|
||||
content: none;
|
||||
}
|
||||
|
||||
.brizy-rule-list-item {
|
||||
|
||||
}
|
||||
|
||||
|
||||
.brizy-featured-image {
|
||||
|
||||
}
|
||||
|
||||
.brizy-featured-image .wrapper {
|
||||
position: relative;
|
||||
}
|
||||
|
||||
.brizy-featured-image .focal-point {
|
||||
position: absolute;
|
||||
z-index: 10;
|
||||
width: 14px;
|
||||
height: 14px;
|
||||
-webkit-transform: translate(-50%, -50%);
|
||||
transform: translate(-50%, -50%);
|
||||
background-color: #2eb0d8;
|
||||
border: 2px solid #fff;
|
||||
border-radius: 18px;
|
||||
cursor: pointer;
|
||||
}
|
||||
|
||||
.brizy-featured-image .deleteImage {
|
||||
position: absolute;
|
||||
right: -4px;
|
||||
top: -4px;
|
||||
z-index: 11;
|
||||
font-size: 16px;
|
||||
width: 16px;
|
||||
height: 16px;
|
||||
background-color: #2d323b;
|
||||
border-radius: 50%;
|
||||
color: #fff;
|
||||
cursor: pointer;
|
||||
}
|
||||
|
||||
.brizy-featured-image .deleteImage svg {
|
||||
display: inline-block;
|
||||
width: 1em;
|
||||
height: 1em;
|
||||
position: relative;
|
||||
color: #efefef;
|
||||
fill: #efefef;
|
||||
stroke: none;
|
||||
}
|
||||
|
||||
#brizy_dashboard .brizy-overview__feed {
|
||||
font-size: 14px;
|
||||
font-weight: 500;
|
||||
}
|
||||
|
||||
#brizy_dashboard .e-brizy__feed .e-overview__post-link {
|
||||
padding-bottom: 5px;
|
||||
}
|
||||
|
||||
#brizy_dashboard .brizy-overview__recently-edited .brizy-overview__heading, #brizy_dashboard .brizy-overview__feed .brizy-overview__heading {
|
||||
font-weight: 700;
|
||||
border-bottom: 1px solid #eee;
|
||||
margin: 0 -12px;
|
||||
padding: 6px 12px;
|
||||
}
|
||||
|
||||
#brizy_dashboard .brizy-overview__badge {
|
||||
background: #39b54a;
|
||||
color: #fff;
|
||||
font-size: .75em;
|
||||
padding: 3px 6px;
|
||||
-webkit-border-radius: 3px;
|
||||
border-radius: 3px;
|
||||
text-transform: uppercase
|
||||
}
|
||||
|
||||
.brizy-dashboard-widget-footer {
|
||||
margin-top: 0;
|
||||
margin-bottom: 0;
|
||||
padding: 12px 12px 12px 0;
|
||||
border-top: 1px solid #eee;
|
||||
}
|
||||
|
||||
.brizy-dashboard-widget-footer a {
|
||||
margin: 0 10px;
|
||||
display: inline-block;
|
||||
text-decoration: none;
|
||||
}
|
||||
|
||||
.brizy-dashboard-widget-footer a:first-child {
|
||||
margin-left: 0;
|
||||
}
|
||||
|
||||
.brizy-dashboard-widget-footer a .dashicons {
|
||||
font-size: 17px;
|
||||
}
|
||||
|
||||
.brizy-dashboard-widget-footer__go-pro {
|
||||
display: inline-flex;
|
||||
fill: #0073aa;
|
||||
}
|
||||
|
||||
.brizy-dashboard-widget-footer__go-pro:hover {
|
||||
fill: #00a0d2;
|
||||
}
|
||||
|
||||
.brizy-dashboard-widget-footer__go-pro svg {
|
||||
vertical-align: bottom;
|
||||
}
|
||||
|
||||
/* Maintenance Mode */
|
||||
.brz-maintenance-table-access-links {
|
||||
max-width: 1024px;
|
||||
/*text-align: left;*/
|
||||
}
|
||||
|
||||
.brz-maintenance-table-access-links th,
|
||||
.brz-maintenance-table-access-links td {
|
||||
border: 1px solid #ccd0d4;
|
||||
}
|
||||
|
||||
.brz-maintenance-table-access-links th:first-child,
|
||||
.brz-maintenance-table-access-links td:first-child {
|
||||
width: 35px;
|
||||
text-align: center;
|
||||
}
|
||||
|
||||
.brz-maintenance-table-access-links th:not(:first-child) {
|
||||
padding-left: 10px;
|
||||
}
|
||||
|
||||
.brz-maintenance-delete-links {
|
||||
padding-left: 10px !important;
|
||||
}
|
||||
|
||||
.brz-maintenance-add-link {
|
||||
margin-top: 15px !important;
|
||||
}
|
||||
|
||||
/* Admin notice give us a rating */
|
||||
.brz-review-notice-container {
|
||||
display: flex;
|
||||
align-items: center;
|
||||
padding-top: 10px;
|
||||
}
|
||||
|
||||
.brz-review-notice-container .dashicons {
|
||||
font-size: 1.4em;
|
||||
padding-left: 10px;
|
||||
}
|
||||
|
||||
.brz-review-notice-container a {
|
||||
padding-left: 5px;
|
||||
text-decoration: none;
|
||||
}
|
||||
|
||||
.brz-review-notice-container .dashicons:first-child {
|
||||
padding-left: 0;
|
||||
}
|
||||
|
||||
.brz-notice-image {
|
||||
max-width: 100px;
|
||||
}
|
||||
|
||||
.brz-notice-content .brz-notice-heading {
|
||||
padding-bottom: 5px;
|
||||
}
|
||||
|
||||
.brz-notice-content {
|
||||
margin-left: 15px;
|
||||
}
|
||||
|
||||
.brz-notice-container {
|
||||
padding-top: 10px;
|
||||
padding-bottom: 10px;
|
||||
display: flex;
|
||||
justify-content: left;
|
||||
align-items: center;
|
||||
}
|
||||
|
||||
/* Admin deactivate plugin modal */
|
||||
.brz-deactivate-modal {
|
||||
border-radius: 3px;
|
||||
animation: brz-feedback-modal-fadein .5s linear;
|
||||
}
|
||||
|
||||
.brz-deactivate-overlay {
|
||||
animation: brz-feedback-overlay-fadein .5s linear;
|
||||
}
|
||||
|
||||
.brz-deactivate-feedback-dialog-logo {
|
||||
width: 40px;
|
||||
vertical-align: middle;
|
||||
}
|
||||
|
||||
.brz-deactivate-modal .ui-dialog-titlebar {
|
||||
display: none;
|
||||
}
|
||||
|
||||
.brz-deactivate-modal .ui-dialog-content {
|
||||
padding: 0;
|
||||
}
|
||||
|
||||
.brz-deactivate-feedback-dialog-header {
|
||||
padding: 18px 15px;
|
||||
box-shadow: 0 0 8px rgba(0, 0, 0, .1);
|
||||
text-align: left;
|
||||
}
|
||||
|
||||
.brz-deactivate-feedback-dialog-header-title {
|
||||
font-size: 15px;
|
||||
text-transform: uppercase;
|
||||
font-weight: 700;
|
||||
padding-left: 5px;
|
||||
color: #495157;
|
||||
}
|
||||
|
||||
.brz-deactivate-feedback-dialog-form {
|
||||
padding: 30px;
|
||||
text-align: left;
|
||||
}
|
||||
|
||||
.brz-deactivate-feedback-dialog-form-caption {
|
||||
font-weight: 700;
|
||||
font-size: 15px;
|
||||
color: #495157;
|
||||
line-height: 1.4;
|
||||
margin-bottom: 30px;
|
||||
}
|
||||
|
||||
.brz-deactivate-feedback-dialog-input {
|
||||
float: left;
|
||||
margin: 0 15px 0 0;
|
||||
box-shadow: none;
|
||||
}
|
||||
|
||||
.brz-deactivate-feedback-dialog-label {
|
||||
display: block;
|
||||
font-size: 13px;
|
||||
color: #6d7882;
|
||||
}
|
||||
|
||||
#brz-deactivate-feedback-dialog .brz-deactivate-feedback-dialog-input {
|
||||
float: left;
|
||||
margin: 0 15px 0 0;
|
||||
box-shadow: none;
|
||||
}
|
||||
|
||||
.brz-deactivate-feedback-dialog-input-wrapper {
|
||||
line-height: 1.3;
|
||||
overflow: hidden;
|
||||
margin-bottom: 15px;
|
||||
}
|
||||
|
||||
.brz-deactivate-modal .ui-dialog-buttonpane {
|
||||
border: none;
|
||||
padding-bottom: 30px;
|
||||
border-radius: 3px;
|
||||
}
|
||||
|
||||
.brz-deactivate-modal .ui-dialog-buttonset {
|
||||
float: none;
|
||||
}
|
||||
|
||||
.brz-feedback-submit {
|
||||
background-color: #05b3e6;
|
||||
color: #fff;
|
||||
width: 180px;
|
||||
height: 38px;
|
||||
border: none;
|
||||
}
|
||||
|
||||
.brz-feedback-submit:hover,
|
||||
.brz-feedback-submit:focus {
|
||||
opacity: 0.9;
|
||||
background-color: #05b3e6;
|
||||
color: #fff !important;
|
||||
}
|
||||
|
||||
.brz-feedback-submit:disabled:hover {
|
||||
color: #a4afb7 !important;
|
||||
}
|
||||
|
||||
.brz-feedback-skip {
|
||||
font-size: 12px;
|
||||
color: #a4afb7;
|
||||
background: none;
|
||||
float: right;
|
||||
width: auto;
|
||||
border: none;
|
||||
box-shadow: none;
|
||||
}
|
||||
|
||||
.brz-feedback-skip:hover,
|
||||
.brz-feedback-skip:active,
|
||||
.brz-feedback-skip:focus {
|
||||
opacity: 0.8;
|
||||
color: #a4afb7;
|
||||
background: none;
|
||||
box-shadow: none;
|
||||
}
|
||||
|
||||
.brz-feedback-text {
|
||||
margin: 10px 0 0 30px;
|
||||
padding: 5px;
|
||||
font-size: 13px;
|
||||
-webkit-box-shadow: none;
|
||||
box-shadow: none;
|
||||
background-color: #fff;
|
||||
width: 92%;
|
||||
}
|
||||
|
||||
.brz-feedback-text-alert {
|
||||
max-width: fit-content;
|
||||
color: #b01b1b;
|
||||
padding: 0;
|
||||
}
|
||||
|
||||
@-webkit-keyframes brz-feedback-modal-fadein {
|
||||
0% {
|
||||
opacity: 0;
|
||||
}
|
||||
|
||||
to {
|
||||
opacity: 1;
|
||||
}
|
||||
}
|
||||
|
||||
@-webkit-keyframes brz-feedback-overlay-fadein {
|
||||
0% {
|
||||
opacity: 0;
|
||||
}
|
||||
|
||||
to {
|
||||
opacity: 0.7;
|
||||
}
|
||||
}
|
||||
|
||||
@-webkit-keyframes brz-rotation {
|
||||
0% {
|
||||
-webkit-transform: rotate(0deg);
|
||||
transform: rotate(0deg);
|
||||
}
|
||||
|
||||
to {
|
||||
-webkit-transform: rotate(359deg);
|
||||
transform: rotate(359deg);
|
||||
}
|
||||
}
|
||||
|
||||
@keyframes brz-rotation {
|
||||
0% {
|
||||
-webkit-transform: rotate(0deg);
|
||||
transform: rotate(0deg);
|
||||
}
|
||||
|
||||
to {
|
||||
-webkit-transform: rotate(359deg);
|
||||
transform: rotate(359deg);
|
||||
}
|
||||
}
|
||||
|
||||
.brz-loading:before {
|
||||
display: inline-block;
|
||||
content: "\f463";
|
||||
font: 18px dashicons;
|
||||
animation: brz-rotation 2s linear infinite;
|
||||
margin-top: 10px;
|
||||
}
|
||||
|
||||
.brz-leads-export-disable {
|
||||
pointer-events: none;
|
||||
cursor: default;
|
||||
opacity: 0.5;
|
||||
}
|
||||
BIN
wp-content/plugins/brizy/admin/static/img/arrow.png
Normal file
BIN
wp-content/plugins/brizy/admin/static/img/arrow.png
Normal file
Binary file not shown.
|
After Width: | Height: | Size: 564 B |
7
wp-content/plugins/brizy/admin/static/img/brizy-logo.svg
Normal file
7
wp-content/plugins/brizy/admin/static/img/brizy-logo.svg
Normal file
@@ -0,0 +1,7 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<svg width="16px" height="16px" viewBox="0 0 16 16" version="1.1" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink">
|
||||
<title>Icons / Brizy / logo</title>
|
||||
<g id="Icons-/-Brizy-/-logo" stroke="none" stroke-width="1" fill="none" fill-rule="evenodd">
|
||||
<path d="M8.31363932,1.00097401 C14.6921658,1.04143425 14.9865593,2.3548823 15.0001467,7.26264889 L15.0001467,8.73850282 C14.9863402,13.7254269 14.6825962,15.0011517 8.00022831,15.0011517 C1.42392978,15.0011517 1.02536623,13.7656047 1.00121086,8.97318 L0.999847253,8.49821537 C0.999652451,8.33614065 0.999652451,8.17028679 0.999652451,8.00057586 L0.999676802,7.74889252 C0.999701152,7.66595585 0.999749852,7.58397371 0.999847253,7.50293635 L1.00121086,7.02797171 C1.02536623,2.235547 1.42392978,1 8.00022831,1 Z M4.3880998,8.44637849 L3.57881198,9.29081447 L8.09695816,11.9481732 L12.6151044,9.29081447 L11.8298616,8.46052061 L8.09695816,10.6253103 L4.3880998,8.44637849 Z M8.09695816,3.94761089 L3.57881198,6.65368016 L8.09695816,9.3597494 L12.6151044,6.65368016 L8.09695816,3.94761089 Z M8.09695816,5.24430492 L10.5506638,6.71811036 L8.09695816,8.19191581 L5.64325255,6.71811036 L8.09695816,5.24430492 Z" id="Combined-Shape" fill="#03080F" fill-rule="nonzero"></path>
|
||||
</g>
|
||||
</svg>
|
||||
|
After Width: | Height: | Size: 1.3 KiB |
BIN
wp-content/plugins/brizy/admin/static/img/brizy.png
Normal file
BIN
wp-content/plugins/brizy/admin/static/img/brizy.png
Normal file
Binary file not shown.
|
After Width: | Height: | Size: 498 B |
10
wp-content/plugins/brizy/admin/static/img/logo.svg
Normal file
10
wp-content/plugins/brizy/admin/static/img/logo.svg
Normal file
@@ -0,0 +1,10 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<svg width="87px" height="74px" viewBox="0 0 87 74" version="1.1" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink">
|
||||
<title>Brizy logo</title>
|
||||
<g id="Brizy-logo" stroke="none" stroke-width="1" fill="none" fill-rule="evenodd">
|
||||
<g id="Group" transform="translate(5.000000, 5.000000)">
|
||||
<path d="M0,23.3212886 L38.4152832,3.55271368e-15 L76.8305664,23.3212886 L38.4152832,46.6425772 L0,23.3212886 Z M13.7901017,23.8765574 L38.4152832,38.8688143 L63.0404647,23.8765574 L38.4152832,8.88430041 L13.7901017,23.8765574 Z" id="Top-element" fill="#181C25" fill-rule="nonzero"></path>
|
||||
<polygon id="Bottom-el" fill="#A7B2DD" points="0 40.1772962 6.88092406 36 38.4152832 55.1225586 70.1540838 36.124113 76.8305664 40.1772962 38.4152832 63.4985848"></polygon>
|
||||
</g>
|
||||
</g>
|
||||
</svg>
|
||||
|
After Width: | Height: | Size: 881 B |
12
wp-content/plugins/brizy/admin/static/img/spinner.svg
Normal file
12
wp-content/plugins/brizy/admin/static/img/spinner.svg
Normal file
@@ -0,0 +1,12 @@
|
||||
<svg xmlns="http://www.w3.org/2000/svg" width="16" height="16" viewBox="0 0 16 16">
|
||||
<symbol id="circle" viewBox="0 0 16 16">
|
||||
<g class="nc-icon-wrapper" fill="#111111">
|
||||
<g class="nc-loop_circle-02-16" transform="rotate(46.097857151180506 8 8)">
|
||||
<path opacity="0.4" fill="#111111"
|
||||
d="M8,16c-4.4111328,0-8-3.5888672-8-8s3.5888672-8,8-8s8,3.5888672,8,8S12.4111328,16,8,16z M8,2C4.6914062,2,2,4.6914062,2,8s2.6914062,6,6,6s6-2.6914062,6-6S11.3085938,2,8,2z"></path>
|
||||
<path data-color="color-2"
|
||||
d="M16,8h-2c0-3.3085938-2.6914062-6-6-6V0C12.4111328,0,16,3.5888672,16,8z"></path>
|
||||
</g>
|
||||
</g>
|
||||
</symbol>
|
||||
</svg>
|
||||
|
After Width: | Height: | Size: 721 B |
36
wp-content/plugins/brizy/admin/static/js/cloud.js
Normal file
36
wp-content/plugins/brizy/admin/static/js/cloud.js
Normal file
@@ -0,0 +1,36 @@
|
||||
jQuery(document).ready(function ($) {
|
||||
|
||||
var BrizyCloud = {
|
||||
form: null,
|
||||
pageUrl: null,
|
||||
init: function (form) {
|
||||
BrizyCloud.form = form;
|
||||
BrizyCloud.pageUrl = form.attr('action');
|
||||
form.find('select[name=brizy-cloud-use-container]').on('change', BrizyCloud.containerChange)
|
||||
},
|
||||
containerChange: function (e) {
|
||||
var value = e.target.value;
|
||||
$.ajax({
|
||||
url: Brizy_Admin_Data.url,
|
||||
data: {action: 'brizy-cloud-projects', container: value}
|
||||
}).done(function (response) {
|
||||
var select = BrizyCloud.form
|
||||
.find('select[name=brizy-cloud-use-project]');
|
||||
|
||||
select
|
||||
.find('option[value!=0]')
|
||||
.remove();
|
||||
|
||||
for (var i = 0; i < response.data.length; i++) {
|
||||
select.append('<option value="'+response.data[i].id+'">'+response.data[i].name+'</option>')
|
||||
}
|
||||
});
|
||||
}
|
||||
};
|
||||
|
||||
$(function () {
|
||||
BrizyCloud.init($('#cloud-form'));
|
||||
});
|
||||
});
|
||||
|
||||
|
||||
137
wp-content/plugins/brizy/admin/static/js/featured-image.js
Normal file
137
wp-content/plugins/brizy/admin/static/js/featured-image.js
Normal file
@@ -0,0 +1,137 @@
|
||||
jQuery(document).ready(function ($) {
|
||||
if (wp.hooks && wp.hooks.addFilter)
|
||||
wp.hooks.addFilter(
|
||||
'editor.PostFeaturedImage',
|
||||
'brizy/featuredImage',
|
||||
function (originalElement) {
|
||||
return function (origianalProps) {
|
||||
|
||||
var isDragging = false;
|
||||
var el = wp.element.createElement;
|
||||
var x = Brizy_Admin_Data.page.focalPoint.x;
|
||||
var y = Brizy_Admin_Data.page.focalPoint.y;
|
||||
|
||||
if (!origianalProps.media) {
|
||||
return el(originalElement, origianalProps);
|
||||
}
|
||||
|
||||
var clickAndMouseMoveHandler = function ( e ) {
|
||||
|
||||
if ( ! isDragging && e.type !== 'click' ) {
|
||||
return;
|
||||
}
|
||||
|
||||
var $this = $(e.target);
|
||||
var imageW = $this.width();
|
||||
var imageH = $this.height();
|
||||
var $focalPointX = $('#_thumbnail_focal_point_x');
|
||||
var $focalPointY = $('#_thumbnail_focal_point_y');
|
||||
var $focalPointDiv = $('#_thumbnail_focal_point_div');
|
||||
|
||||
$focalPointDiv.on('mouseup', function () {
|
||||
isDragging = false;
|
||||
});
|
||||
|
||||
if ( window.getSelection ) {
|
||||
window.getSelection().removeAllRanges();
|
||||
} else if ( document.selection ) {
|
||||
document.selection.empty();
|
||||
}
|
||||
|
||||
// Calculate FocusPoint coordinates
|
||||
var offsetX = e.pageX - $this.offset().left;
|
||||
var offsetY = e.pageY - $this.offset().top;
|
||||
|
||||
// Calculate CSS Percentages
|
||||
var percentageX = (offsetX / imageW) * 100;
|
||||
var percentageY = (offsetY / imageH) * 100;
|
||||
|
||||
// Set positioning
|
||||
$focalPointDiv.css({
|
||||
left: percentageX.toFixed(0) + '% ',
|
||||
top: percentageY.toFixed(0) + '%'
|
||||
});
|
||||
$focalPointX.val(percentageX.toFixed(0));
|
||||
$focalPointY.val(percentageY.toFixed(0));
|
||||
|
||||
wp.data.dispatch('core/editor').editPost({
|
||||
'brizy_attachment_focal_point': {
|
||||
x: percentageX.toFixed(0),
|
||||
y: percentageY.toFixed(0)
|
||||
}
|
||||
});
|
||||
|
||||
};
|
||||
|
||||
return el('div', {class: 'brizy-featured-image hide-if-no-js'}, [
|
||||
el('input', {
|
||||
id: '_thumbnail_focal_point_x',
|
||||
name: '_thumbnail_focal_point_x',
|
||||
type: 'hidden',
|
||||
value: Brizy_Admin_Data.page.focalPoint.x
|
||||
}),
|
||||
el('input', {
|
||||
id: '_thumbnail_focal_point_y',
|
||||
name: '_thumbnail_focal_point_y',
|
||||
type: 'hidden',
|
||||
value: Brizy_Admin_Data.page.focalPoint.y
|
||||
}),
|
||||
el('div',
|
||||
{
|
||||
class: 'wrapper',
|
||||
onMouseLeave: function () {
|
||||
isDragging = false;
|
||||
}
|
||||
}, [
|
||||
el('img', {
|
||||
id: 'featured-image-el',
|
||||
src: origianalProps.media.source_url,
|
||||
width: "100%",
|
||||
onClick: clickAndMouseMoveHandler,
|
||||
onMouseMove: clickAndMouseMoveHandler,
|
||||
onMouseDown: function () {
|
||||
isDragging = true;
|
||||
},
|
||||
onMouseUp: function () {
|
||||
isDragging = false;
|
||||
}
|
||||
}),
|
||||
|
||||
el('div', {
|
||||
class: 'focal-point',
|
||||
id: '_thumbnail_focal_point_div',
|
||||
style: {left: x + "%", top: y + "%"},
|
||||
onMouseDown: function () {
|
||||
isDragging = true;
|
||||
}
|
||||
}),
|
||||
el('div', {class: 'deleteImage'}, [
|
||||
el('a', {
|
||||
id: 'remove-post-thumbnail', href: "#", onClick: function (e) {
|
||||
origianalProps.onRemoveImage(e);
|
||||
|
||||
Brizy_Admin_Data.page.focalPoint.x = 50;
|
||||
Brizy_Admin_Data.page.focalPoint.y = 50;
|
||||
|
||||
wp.data.dispatch('core/editor').editPost({
|
||||
'brizy_attachment_focal_point': {
|
||||
x: 50,
|
||||
y: 50
|
||||
}
|
||||
});
|
||||
}
|
||||
},
|
||||
[
|
||||
el('svg', {class: 'brz-icon-svg'}, [
|
||||
el('use', {'xlinkHref': Brizy_Admin_Data.pluginUrl + '/editor/icons/icons.svg#nc-circle-remove'}),
|
||||
]),
|
||||
]),
|
||||
]),
|
||||
]),
|
||||
]);
|
||||
}
|
||||
}
|
||||
);
|
||||
});
|
||||
|
||||
|
||||
2
wp-content/plugins/brizy/admin/static/js/hyperapp.js
Normal file
2
wp-content/plugins/brizy/admin/static/js/hyperapp.js
Normal file
@@ -0,0 +1,2 @@
|
||||
!function(e,n){"object"==typeof exports&&"undefined"!=typeof module?n(exports):"function"==typeof define&&define.amd?define(["exports"],n):n(e.hyperapp={})}(this,function(e){"use strict";e.h=function(e,n){for(var t=[],r=[],o=arguments.length;2<o--;)t.push(arguments[o]);for(;t.length;){var u=t.pop();if(u&&u.pop)for(o=u.length;o--;)t.push(u[o]);else null!=u&&!0!==u&&!1!==u&&r.push(u)}return"function"==typeof e?e(n||{},r):{nodeName:e,attributes:n||{},children:r,key:n&&n.key}},e.app=function(e,n,t,r){var o,u=[].map,l=r&&r.children[0]||null,i=l&&function n(e){return{nodeName:e.nodeName.toLowerCase(),attributes:{},children:u.call(e.childNodes,function(e){return 3===e.nodeType?e.nodeValue:n(e)})}}(l),y=[],g=!0,f=b(e),a=function e(r,o,u){for(var n in u)"function"==typeof u[n]?function(e,t){u[e]=function(e){var n=t(e);return"function"==typeof n&&(n=n(v(r,f),u)),n&&n!==(o=v(r,f))&&!n.then&&s(f=d(r,b(o,n),f)),n}}(n,u[n]):e(r.concat(n),o[n]=b(o[n]),u[n]=b(u[n]));return u}([],f,b(n));return s(),a;function N(e){return"function"==typeof e?N(e(f,a)):null!=e?e:""}function c(){o=!o;var e=N(t);for(r&&!o&&(l=function e(n,t,r,o,u){if(o===r);else if(null==r||r.nodeName!==o.nodeName){var l=function e(n,t){var r="string"==typeof n||"number"==typeof n?document.createTextNode(n):(t=t||"svg"===n.nodeName)?document.createElementNS("http://www.w3.org/2000/svg",n.nodeName):document.createElement(n.nodeName),o=n.attributes;if(o){o.oncreate&&y.push(function(){o.oncreate(r)});for(var u=0;u<n.children.length;u++)r.appendChild(e(n.children[u]=N(n.children[u]),t));for(var l in o)w(r,l,o[l],null,t)}return r}(o,u);n.insertBefore(l,t),null!=r&&x(n,t,r),t=l}else if(null==r.nodeName)t.nodeValue=o;else{!function(e,n,t,r){for(var o in b(n,t))t[o]!==("value"===o||"checked"===o?e[o]:n[o])&&w(e,o,t[o],n[o],r);var u=g?t.oncreate:t.onupdate;u&&y.push(function(){u(e,n)})}(t,r.attributes,o.attributes,u=u||"svg"===o.nodeName);for(var i={},f={},a=[],c=r.children,s=o.children,d=0;d<c.length;d++){a[d]=t.childNodes[d];var v=k(c[d]);null!=v&&(i[v]=[a[d],c[d]])}for(var d=0,h=0;h<s.length;){var v=k(c[d]),p=k(s[h]=N(s[h]));if(f[v])d++;else if(null==p||p!==k(c[d+1]))if(null==p||g)null==v&&(e(t,a[d],c[d],s[h],u),h++),d++;else{var m=i[p]||[];v===p?(e(t,m[0],m[1],s[h],u),d++):m[0]?e(t,t.insertBefore(m[0],a[d]),m[1],s[h],u):e(t,a[d],null,s[h],u),f[p]=s[h],h++}else null==v&&x(t,a[d],c[d]),d++}for(;d<c.length;)null==k(c[d])&&x(t,a[d],c[d]),d++;for(var d in i)f[d]||x(t,i[d][0],i[d][1])}return t}(r,l,i,i=e)),g=!1;y.length;)y.pop()()}function s(){o||(o=!0,setTimeout(c))}function b(e,n){var t={};for(var r in e)t[r]=e[r];for(var r in n)t[r]=n[r];return t}function d(e,n,t){var r={};return e.length?(r[e[0]]=1<e.length?d(e.slice(1),n,t[e[0]]):n,b(t,r)):n}function v(e,n){for(var t=0;t<e.length;)n=n[e[t++]];return n}function k(e){return e?e.key:null}function h(e){return e.currentTarget.events[e.type](e)}function w(e,n,t,r,o){if("key"===n);else if("style"===n)for(var u in b(r,t)){var l=null==t||null==t[u]?"":t[u];"-"===u[0]?e[n].setProperty(u,l):e[n][u]=l}else"o"===n[0]&&"n"===n[1]?(n=n.slice(2),e.events?r||(r=e.events[n]):e.events={},(e.events[n]=t)?r||e.addEventListener(n,h):e.removeEventListener(n,h)):n in e&&"list"!==n&&"type"!==n&&"draggable"!==n&&"spellcheck"!==n&&"translate"!==n&&!o?e[n]=null==t?"":t:null!=t&&!1!==t&&e.setAttribute(n,t),null!=t&&!1!==t||e.removeAttribute(n)}function x(e,n,t){function r(){e.removeChild(function e(n,t){var r=t.attributes;if(r){for(var o=0;o<t.children.length;o++)e(n.childNodes[o],t.children[o]);r.ondestroy&&r.ondestroy(n)}return n}(n,t))}var o=t.attributes&&t.attributes.onremove;o?o(n,r):r()}}});
|
||||
//# sourceMappingURL=hyperapp.js.map
|
||||
900
wp-content/plugins/brizy/admin/static/js/rules.js
Normal file
900
wp-content/plugins/brizy/admin/static/js/rules.js
Normal file
@@ -0,0 +1,900 @@
|
||||
var h = hyperapp.h;
|
||||
|
||||
var RULE_TYPE_INCLUDE = 1;
|
||||
var RULE_TYPE_EXCLUDE = 2;
|
||||
|
||||
var RULE_POSTS = 1;
|
||||
var RULE_TAXONOMY = 2;
|
||||
var RULE_ARCHIVE = 4;
|
||||
var RULE_TEMPLATE = 8;
|
||||
var RULE_BRIZY_TEMPLATE = 16;
|
||||
var ANY_CHILD_TAXONOMY = 128;
|
||||
var WOO_PAGES = 256;
|
||||
var RULE_DATE_ARCHIVE = 512;
|
||||
var RULE_YEAR_ARCHIVE = 1024;
|
||||
var RULE_MONTH_ARCHIVE = 2048;
|
||||
var RULE_DAY_ARCHIVE = 4096;
|
||||
|
||||
var defaultTemplateType = Brizy_Admin_Rules.templateType !== '' ? Brizy_Admin_Rules.templateType : 'single';
|
||||
var defaultAppliedFor = null;
|
||||
var defaultEntityType = null;
|
||||
|
||||
switch (defaultTemplateType) {
|
||||
case 'archive':
|
||||
defaultAppliedFor = RULE_TAXONOMY;
|
||||
defaultEntityType = 'category';
|
||||
break;
|
||||
case 'single_product':
|
||||
defaultAppliedFor = RULE_POSTS;
|
||||
defaultEntityType = 'product';
|
||||
break;
|
||||
case 'product_archive':
|
||||
defaultAppliedFor = WOO_PAGES;
|
||||
defaultEntityType = 'shop_page';
|
||||
break;
|
||||
default:
|
||||
defaultAppliedFor = RULE_POSTS;
|
||||
defaultEntityType = 'post';
|
||||
break;
|
||||
}
|
||||
|
||||
|
||||
var defaultRule = {
|
||||
type: RULE_TYPE_INCLUDE,
|
||||
appliedFor: defaultAppliedFor,
|
||||
entityType: defaultEntityType,
|
||||
entityValues: []
|
||||
};
|
||||
|
||||
var state = {
|
||||
locked: false,
|
||||
templateType: defaultTemplateType,
|
||||
rule: defaultRule,
|
||||
rules: {
|
||||
single: [],
|
||||
archive: [],
|
||||
single_product: [],
|
||||
product_archive: [],
|
||||
},
|
||||
errors: "",
|
||||
groups: [],
|
||||
};
|
||||
|
||||
state.rules[state.templateType] = Brizy_Admin_Rules.rules;
|
||||
|
||||
var apiCache = {
|
||||
groupList: null,
|
||||
postGroupListPromise: [],
|
||||
archiveGroupListPromise: [],
|
||||
templateGroupListPromise: [],
|
||||
postList: [],
|
||||
termList: []
|
||||
};
|
||||
|
||||
var api = {
|
||||
getGroupList: function (templateType) {
|
||||
|
||||
if (!apiCache.groupList) {
|
||||
apiCache.groupList = [];
|
||||
}
|
||||
|
||||
if (apiCache.groupList && apiCache.groupList[templateType])
|
||||
return apiCache.groupList[templateType];
|
||||
|
||||
return apiCache.groupList[templateType] = jQuery.getJSON(Brizy_Admin_Rules.url, {
|
||||
action: Brizy_Admin_Rules.prefix + "_rule_group_list",
|
||||
hash: Brizy_Admin_Rules.hash,
|
||||
version: Brizy_Admin_Data.editorVersion,
|
||||
context: 'template-rules',
|
||||
templateType: templateType
|
||||
})
|
||||
},
|
||||
|
||||
getPostsGroupList: function (postType, templateType) {
|
||||
|
||||
if (apiCache.postGroupListPromise[postType + templateType])
|
||||
return apiCache.postGroupListPromise[postType + templateType];
|
||||
|
||||
return apiCache.postGroupListPromise[postType + templateType] = jQuery.getJSON(Brizy_Admin_Rules.url, {
|
||||
action: Brizy_Admin_Rules.prefix + "_rule_posts_group_list",
|
||||
postType: postType,
|
||||
hash: Brizy_Admin_Rules.hash,
|
||||
version: Brizy_Admin_Data.editorVersion,
|
||||
context: 'template-rules',
|
||||
templateType: templateType
|
||||
})
|
||||
},
|
||||
|
||||
getArchiveGroupList: function (taxonomy, templateType) {
|
||||
|
||||
if (apiCache.archiveGroupListPromise[taxonomy + templateType])
|
||||
return apiCache.archiveGroupListPromise[taxonomy + templateType];
|
||||
|
||||
return apiCache.archiveGroupListPromise[taxonomy + templateType] = jQuery.getJSON(Brizy_Admin_Rules.url, {
|
||||
action: Brizy_Admin_Rules.prefix + "_rule_archive_group_list",
|
||||
taxonomy: taxonomy,
|
||||
hash: Brizy_Admin_Rules.hash,
|
||||
version: Brizy_Admin_Data.editorVersion,
|
||||
context: 'template-rules',
|
||||
templateType: templateType
|
||||
})
|
||||
},
|
||||
|
||||
getTemplateGroupList: function (templateType) {
|
||||
if (apiCache.templateGroupListPromise[templateType + '-author'])
|
||||
return apiCache.templateGroupListPromise[templateType + '-author'];
|
||||
|
||||
return apiCache.templateGroupListPromise[templateType + '-author'] = jQuery.getJSON(Brizy_Admin_Rules.url, {
|
||||
action: Brizy_Admin_Rules.prefix + "_rule_template_group_list",
|
||||
hash: Brizy_Admin_Rules.hash,
|
||||
version: Brizy_Admin_Data.editorVersion,
|
||||
context: 'template-rules',
|
||||
templateType: templateType
|
||||
})
|
||||
},
|
||||
|
||||
getTerms: function (taxonomy) {
|
||||
if (apiCache.termList[taxonomy])
|
||||
return apiCache.termList[taxonomy];
|
||||
|
||||
return jQuery.getJSON(Brizy_Admin_Rules.url, {
|
||||
action: Brizy_Admin_Rules.prefix + "_get_terms",
|
||||
hash: Brizy_Admin_Rules.hash,
|
||||
version: Brizy_Admin_Data.editorVersion,
|
||||
taxonomy: taxonomy
|
||||
}).done(function (data) {
|
||||
apiCache.termList[taxonomy] = jQuery.Deferred().resolve(data);
|
||||
});
|
||||
},
|
||||
|
||||
validateRule: function (rule) {
|
||||
|
||||
var url = new URL(Brizy_Admin_Rules.url);
|
||||
url.searchParams.append('action', Brizy_Admin_Rules.prefix + '_validate_rule');
|
||||
url.searchParams.append('hash', Brizy_Admin_Rules.hash);
|
||||
url.searchParams.append('post', Brizy_Admin_Rules.id);
|
||||
url.searchParams.append('version', Brizy_Admin_Data.editorVersion);
|
||||
url.searchParams.append('dataVersion', 0);
|
||||
url.searchParams.append('ignoreDataVersion', 1);
|
||||
|
||||
return jQuery.ajax({
|
||||
type: "POST",
|
||||
url: url.toString(),
|
||||
data: JSON.stringify(rule),
|
||||
contentType: "application/json; charset=utf-8"
|
||||
});
|
||||
},
|
||||
};
|
||||
|
||||
var actions = {
|
||||
getState: function (value) {
|
||||
return function (state) {
|
||||
return state;
|
||||
};
|
||||
},
|
||||
|
||||
updateGroups: function (value) {
|
||||
return function (state) {
|
||||
return {
|
||||
groups: value,
|
||||
};
|
||||
};
|
||||
},
|
||||
setLocked: function (value) {
|
||||
return function (state) {
|
||||
return {
|
||||
locked: value,
|
||||
};
|
||||
};
|
||||
},
|
||||
rule: {
|
||||
update: function (rule) {
|
||||
return function (state) {
|
||||
return rule;
|
||||
};
|
||||
},
|
||||
|
||||
setType: function (value) {
|
||||
return function (state) {
|
||||
return {type: value};
|
||||
};
|
||||
},
|
||||
setAppliedFor: function (value) {
|
||||
return function (state) {
|
||||
return {appliedFor: value};
|
||||
};
|
||||
},
|
||||
setEntityType: function (value) {
|
||||
return function (state) {
|
||||
return {entityType: value};
|
||||
};
|
||||
},
|
||||
setEntityValues: function (value) {
|
||||
return function (state) {
|
||||
return {entityValues: value};
|
||||
};
|
||||
}
|
||||
},
|
||||
|
||||
resetRule: function () {
|
||||
return function (state) {
|
||||
switch (state.templateType) {
|
||||
case 'archive':
|
||||
defaultAppliedFor = RULE_TAXONOMY;
|
||||
defaultEntityType = 'category';
|
||||
break;
|
||||
|
||||
default:
|
||||
defaultAppliedFor = RULE_POSTS;
|
||||
defaultEntityType = 'post';
|
||||
break;
|
||||
}
|
||||
|
||||
var defaultRule = {
|
||||
type: RULE_TYPE_INCLUDE,
|
||||
appliedFor: defaultAppliedFor,
|
||||
entityType: defaultEntityType,
|
||||
entityValues: []
|
||||
};
|
||||
|
||||
return {errors: "", rule: defaultRule};
|
||||
};
|
||||
},
|
||||
addFormErrors: function (errors) {
|
||||
return function (state) {
|
||||
return {errors: errors};
|
||||
};
|
||||
},
|
||||
|
||||
addRule: function (rule) {
|
||||
return function (state) {
|
||||
|
||||
switch (state.templateType) {
|
||||
case 'archive':
|
||||
defaultAppliedFor = RULE_TAXONOMY;
|
||||
defaultEntityType = 'category';
|
||||
break;
|
||||
|
||||
default:
|
||||
defaultAppliedFor = RULE_POSTS;
|
||||
defaultEntityType = 'post';
|
||||
break;
|
||||
}
|
||||
|
||||
var defaultRule = {
|
||||
type: RULE_TYPE_INCLUDE,
|
||||
appliedFor: defaultAppliedFor,
|
||||
entityType: defaultEntityType,
|
||||
entityValues: []
|
||||
};
|
||||
|
||||
return {
|
||||
rules: {[state.templateType]: [...state.rules[state.templateType] || [], rule]},
|
||||
rule: defaultRule,
|
||||
errors: ""
|
||||
};
|
||||
};
|
||||
},
|
||||
removeRule: function (rule) {
|
||||
return function (state) {
|
||||
var rules = state.rules[state.templateType];
|
||||
rules.splice(rules.indexOf(rule), 1);
|
||||
return {
|
||||
rules: {
|
||||
[state.templateType]: rules
|
||||
}
|
||||
};
|
||||
};
|
||||
},
|
||||
setTemplateType: function (type) {
|
||||
return function (state) {
|
||||
return {
|
||||
templateType: type,
|
||||
};
|
||||
};
|
||||
}
|
||||
};
|
||||
|
||||
function arr_diff(a1, a2) {
|
||||
|
||||
var a = [], diff = [];
|
||||
|
||||
for (var i = 0; i < a1.length; i++) {
|
||||
a[a1[i]] = true;
|
||||
}
|
||||
|
||||
for (var i = 0; i < a2.length; i++) {
|
||||
if (a[a2[i]]) {
|
||||
delete a[a2[i]];
|
||||
} else {
|
||||
a[a2[i]] = true;
|
||||
}
|
||||
}
|
||||
|
||||
for (var k in a) {
|
||||
diff.push(k);
|
||||
}
|
||||
|
||||
return diff;
|
||||
}
|
||||
|
||||
|
||||
var RuleTypeField = function (params) {
|
||||
return function (state, action) {
|
||||
return h(
|
||||
"span",
|
||||
{
|
||||
class: "brizy-rule-select",
|
||||
},
|
||||
|
||||
h(
|
||||
"select",
|
||||
{
|
||||
name: params.name,
|
||||
style: {width: "100px"},
|
||||
// oncreate: function (element) {
|
||||
// var el = jQuery(element);
|
||||
// el.on("change", function(e){ action.rule.setType(e.target.value); });
|
||||
// el.select2();
|
||||
// },
|
||||
// onremove: function (element, done) {
|
||||
// jQuery(element).select2("destroy");
|
||||
// done();
|
||||
// },
|
||||
onchange: function (e) {
|
||||
action.rule.setType(e.target.value);
|
||||
}
|
||||
},
|
||||
[
|
||||
h(
|
||||
"option",
|
||||
{
|
||||
value: RULE_TYPE_INCLUDE,
|
||||
selected: parseInt(params.value) === RULE_TYPE_INCLUDE
|
||||
},
|
||||
"Include"
|
||||
),
|
||||
h(
|
||||
"option",
|
||||
{
|
||||
value: RULE_TYPE_EXCLUDE,
|
||||
selected: parseInt(params.value) === RULE_TYPE_EXCLUDE
|
||||
},
|
||||
"Exclude"
|
||||
)
|
||||
]
|
||||
)
|
||||
);
|
||||
};
|
||||
};
|
||||
|
||||
var BrzSelect2 = function (params) {
|
||||
|
||||
var oncreate = function (element) {
|
||||
|
||||
var el = jQuery(element);
|
||||
el.on("change", params.onChange);
|
||||
|
||||
if (typeof params.optionRequest === 'function') {
|
||||
const optionRequest = params.optionRequest();
|
||||
|
||||
if (typeof params.optionRequest === 'function') {
|
||||
optionRequest.done(function (response) {
|
||||
var options = params.convertResponseToOptions(response);
|
||||
options.forEach(function (option) {
|
||||
el.append(option);
|
||||
});
|
||||
el.select2();
|
||||
});
|
||||
} else {
|
||||
var options = params.convertResponseToOptions(optionRequest);
|
||||
options.forEach(function (option) {
|
||||
el.append(option);
|
||||
});
|
||||
el.select2();
|
||||
}
|
||||
}
|
||||
};
|
||||
|
||||
var onremove = function (element, done) {
|
||||
if (jQuery(element).data('select2')) {
|
||||
jQuery(element).select2("destroy");
|
||||
}
|
||||
done();
|
||||
};
|
||||
|
||||
return h(
|
||||
"select",
|
||||
{
|
||||
key: params.id + '|' + params.value,
|
||||
akey: params.id + '|' + params.value,
|
||||
style: params.style,
|
||||
oncreate: oncreate,
|
||||
onremove: onremove,
|
||||
name: params.name,
|
||||
},
|
||||
[]
|
||||
);
|
||||
};
|
||||
|
||||
var RulePostsGroupSelectField = function (params) {
|
||||
return function (state, actions) {
|
||||
var appliedFor = params.rule.appliedFor;
|
||||
var entityType = params.rule.entityType;
|
||||
var value = String(params.rule.entityValues[0] ? params.rule.entityValues[0] : '');
|
||||
|
||||
var convertResponseToOptions = function (response) {
|
||||
var groups = [];
|
||||
groups.push(new Option("All", '', true, value === ''));
|
||||
response.data.forEach(function (group) {
|
||||
if (group.title === "") {
|
||||
group.items.forEach(function (option) {
|
||||
var optionValue = String(option.value);
|
||||
var selected = params.rule.entityValues.includes(optionValue);
|
||||
groups.push(new Option(option.title, optionValue, false, selected));
|
||||
});
|
||||
} else {
|
||||
var groupElement = document.createElement("OPTGROUP");
|
||||
groupElement.label = group.title;
|
||||
|
||||
if (group.items.length > 0) {
|
||||
group.items.forEach(function (option) {
|
||||
var optionValue = String(option.value);
|
||||
var selected = params.rule.entityValues.includes(optionValue);
|
||||
groupElement.appendChild(new Option(option.title, optionValue, false, selected))
|
||||
});
|
||||
groups.push(groupElement);
|
||||
}
|
||||
}
|
||||
});
|
||||
|
||||
return groups;
|
||||
};
|
||||
|
||||
|
||||
return h(
|
||||
BrzSelect2,
|
||||
{
|
||||
id: "post-groups-" + entityType + '-' + params.type,
|
||||
style: params.style ? params.style : {width: "200px"},
|
||||
name: params.name,
|
||||
optionRequest: function () {
|
||||
actions.setLocked(true);
|
||||
return api.getPostsGroupList(entityType, params.type).done(function (data) {
|
||||
actions.setLocked(false);
|
||||
return data;
|
||||
});
|
||||
},
|
||||
convertResponseToOptions: convertResponseToOptions,
|
||||
onChange: params.onChange,
|
||||
},
|
||||
[]
|
||||
);
|
||||
}
|
||||
};
|
||||
|
||||
var RuleArchiveGroupSelectField = function (params) {
|
||||
return function (state, actions) {
|
||||
var appliedFor = params.rule.appliedFor;
|
||||
var taxonomy = params.rule.entityType;
|
||||
var value = String(params.rule.entityValues[0] ? params.rule.entityValues[0] : '');
|
||||
|
||||
var convertResponseToOptions = function (response) {
|
||||
var groups = [];
|
||||
groups.push(new Option("All", '', false, value === ''));
|
||||
response.data.forEach(function (group) {
|
||||
|
||||
if (group.title === "") {
|
||||
group.items.forEach(function (option) {
|
||||
var optionValue = String(option.value);
|
||||
groups.push(new Option(option.title, optionValue, false, params.rule.entityValues.includes(optionValue)));
|
||||
});
|
||||
} else {
|
||||
var groupElement = document.createElement("OPTGROUP");
|
||||
groupElement.label = group.title;
|
||||
|
||||
if (group.items.length > 0) {
|
||||
group.items.forEach(function (option) {
|
||||
var optionValue = String(option.value);
|
||||
groupElement.appendChild(new Option(option.title, optionValue, false, params.rule.entityValues.includes(optionValue)))
|
||||
});
|
||||
groups.push(groupElement);
|
||||
}
|
||||
}
|
||||
});
|
||||
|
||||
return groups;
|
||||
};
|
||||
|
||||
return h(
|
||||
BrzSelect2,
|
||||
{
|
||||
id: "archive-groups-" + params.taxonomy,
|
||||
style: params.style ? params.style : {width: "200px"},
|
||||
name: params.name,
|
||||
optionRequest: function () {
|
||||
actions.setLocked(true);
|
||||
return api.getArchiveGroupList(taxonomy, params.type).done(function (data) {
|
||||
actions.setLocked(false);
|
||||
return data;
|
||||
});
|
||||
},
|
||||
convertResponseToOptions: convertResponseToOptions,
|
||||
onChange: params.onChange,
|
||||
},
|
||||
[]
|
||||
);
|
||||
}
|
||||
};
|
||||
|
||||
var RuleAuthorGroupSelectField = function (params) {
|
||||
return function (state, actions) {
|
||||
var appliedFor = params.rule.appliedFor;
|
||||
var taxonomy = params.rule.entityType;
|
||||
var value = String(params.rule.entityValues[0] ? params.rule.entityValues[0] : '');
|
||||
|
||||
var convertResponseToOptions = function (response) {
|
||||
var groups = [];
|
||||
groups.push(new Option("All", '', false, value === ''));
|
||||
response.data.forEach(function (group) {
|
||||
|
||||
if (group.title === "") {
|
||||
group.items.forEach(function (option) {
|
||||
var optionValue = String(option.value);
|
||||
groups.push(new Option(option.title, optionValue, false, params.rule.entityValues.includes(optionValue)));
|
||||
});
|
||||
} else {
|
||||
var groupElement = document.createElement("OPTGROUP");
|
||||
groupElement.label = group.title;
|
||||
|
||||
if (group.items.length > 0) {
|
||||
group.items.forEach(function (option) {
|
||||
var optionValue = String(option.value);
|
||||
groupElement.appendChild(new Option(option.title, optionValue, false, params.rule.entityValues.includes(optionValue)))
|
||||
});
|
||||
groups.push(groupElement);
|
||||
}
|
||||
}
|
||||
});
|
||||
|
||||
return groups;
|
||||
};
|
||||
|
||||
return h(
|
||||
BrzSelect2,
|
||||
{
|
||||
id: "archive-groups-author",
|
||||
style: params.style ? params.style : {width: "200px"},
|
||||
name: params.name,
|
||||
optionRequest: function () {
|
||||
actions.setLocked(true);
|
||||
return api.getTemplateGroupList(params.type).done(function (data) {
|
||||
actions.setLocked(false);
|
||||
return data;
|
||||
});
|
||||
},
|
||||
convertResponseToOptions: convertResponseToOptions,
|
||||
onChange: params.onChange,
|
||||
},
|
||||
[]
|
||||
);
|
||||
}
|
||||
};
|
||||
|
||||
var RuleApplyGroupField = function (params) {
|
||||
return function (state, actions) {
|
||||
|
||||
var appliedFor = params.rule.appliedFor;
|
||||
var entityType = params.rule.entityType;
|
||||
var value = appliedFor + "|" + entityType;
|
||||
var groups = [];
|
||||
|
||||
params.groups.forEach(function (group) {
|
||||
var options = [];
|
||||
group.items.forEach(function (option) {
|
||||
var optionValue = option.groupValue + "|" + option.value;
|
||||
var attributes = {
|
||||
value: optionValue,
|
||||
selected: optionValue === value
|
||||
};
|
||||
options.push(h("option", attributes, option.title));
|
||||
});
|
||||
const attributes = {label: group.title};
|
||||
|
||||
if (group.value + "|" === "|") {
|
||||
groups.push(h("option", {value: "|"}, group.title));
|
||||
} else {
|
||||
groups.push(h("optgroup", attributes, options));
|
||||
}
|
||||
});
|
||||
|
||||
const attributes = {
|
||||
name: params.name,
|
||||
style: {width: "200px"},
|
||||
class: "brizy-rule-select--options[] ",
|
||||
onchange: function (e) {
|
||||
var values = e.target.value.split("|");
|
||||
actions.rule.update({
|
||||
appliedFor: parseInt(values[0]),
|
||||
entityType: values[1],
|
||||
entityValues: []
|
||||
});
|
||||
}
|
||||
};
|
||||
|
||||
var elements = [
|
||||
h("span", {class: "brizy-rule-select brizy-rule-select2"},
|
||||
h("select", attributes, groups)
|
||||
)
|
||||
];
|
||||
|
||||
switch (parseInt(appliedFor)) {
|
||||
case RULE_POSTS:
|
||||
elements.push(
|
||||
h("span", {class: "brizy-rule-select brizy-rule-select2"}, [
|
||||
h(RulePostsGroupSelectField, {
|
||||
id: params.type + appliedFor + value,
|
||||
key: params.type + appliedFor + value,
|
||||
rule: params.rule,
|
||||
type: params.type,
|
||||
name: params.type ? 'brizy-' + params.type + '-rule-entity-values[]' : '',
|
||||
onChange: function (e) {
|
||||
actions.rule.update({
|
||||
entityValues: e.target.value ? [e.target.value] : [],
|
||||
});
|
||||
}
|
||||
})
|
||||
]));
|
||||
break;
|
||||
case RULE_TAXONOMY:
|
||||
elements.push(
|
||||
h("span", {class: "brizy-rule-select brizy-rule-select2"}, [
|
||||
h(RuleArchiveGroupSelectField, {
|
||||
id: params.type + appliedFor + value,
|
||||
key: params.type + appliedFor + value,
|
||||
rule: params.rule,
|
||||
type: params.type,
|
||||
taxonomy: entityType,
|
||||
name: params.type ? 'brizy-' + params.type + '-rule-entity-values[]' : '',
|
||||
onChange: function (e) {
|
||||
actions.rule.update({
|
||||
entityValues: e.target.value ? [e.target.value] : [],
|
||||
});
|
||||
}
|
||||
})
|
||||
]));
|
||||
break;
|
||||
|
||||
case RULE_TEMPLATE:
|
||||
if (entityType === 'author') {
|
||||
elements.push(
|
||||
h("span", {class: "brizy-rule-select brizy-rule-select2"}, [
|
||||
h(RuleAuthorGroupSelectField, {
|
||||
id: params.type + appliedFor + value,
|
||||
key: params.type + appliedFor + value,
|
||||
rule: params.rule,
|
||||
type: params.type,
|
||||
name: params.type ? 'brizy-' + params.type + '-rule-entity-values[]' : '',
|
||||
onChange: function (e) {
|
||||
actions.rule.update({
|
||||
entityValues: e.target.value ? [e.target.value] : [],
|
||||
});
|
||||
}
|
||||
})
|
||||
]));
|
||||
}
|
||||
break;
|
||||
|
||||
|
||||
}
|
||||
return h("span", {}, elements);
|
||||
};
|
||||
};
|
||||
|
||||
var RuleForm = function (params) {
|
||||
var elements = [
|
||||
h("h4", {}, "Add New Condition"),
|
||||
h(RuleTypeField, {value: String(params.rule.type)}),
|
||||
h(RuleApplyGroupField, {rule: params.rule, groups: params.groups, type: params.type}),
|
||||
h("input", {
|
||||
type: "button",
|
||||
class: "button",
|
||||
onclick: params.onSubmit,
|
||||
value: "Add"
|
||||
})
|
||||
];
|
||||
|
||||
if (params.errors) {
|
||||
elements.push(h("p", {class: "error"}, params.errors));
|
||||
}
|
||||
|
||||
return h("div", {class: "brizy-rule-new-condition"}, elements);
|
||||
};
|
||||
|
||||
var RuleListItem = function (params) {
|
||||
var rule = params.rule;
|
||||
var key = 'list-' + rule.type + rule.appliedType + rule.appliedFor + rule.entityValues.join('') + params.index;
|
||||
return h("div", {class: "rule", key: key}, [
|
||||
|
||||
h("span", {class: 'rule-fields'}, [
|
||||
h(RuleTypeField, {value: String(params.rule.type), name: 'brizy-' + params.type + '-rule-type[]'}),
|
||||
h(RuleApplyGroupField, {
|
||||
rule: params.rule,
|
||||
groups: params.groups,
|
||||
type: params.type,
|
||||
name: 'brizy-' + params.type + '-rule-group[]'
|
||||
}),
|
||||
h('div', {class: 'overlay'}, [])
|
||||
]),
|
||||
h("input", {
|
||||
class: "brizy-delete-rule ",
|
||||
type: "button",
|
||||
value: "Delete",
|
||||
onclick: function (e) {
|
||||
if (confirm('Are you sure you want to delete?'))
|
||||
params.onDelete(params.rule);
|
||||
}
|
||||
})
|
||||
]);
|
||||
};
|
||||
|
||||
var RuleList = function (params) {
|
||||
var elements = [];
|
||||
if (params.rules.length) {
|
||||
elements.push(h("h4", {}, "Where do You Want to Display it"));
|
||||
}
|
||||
|
||||
params.rules.forEach(function (rule, index) {
|
||||
elements.push(
|
||||
h(RuleListItem, {
|
||||
index: index,
|
||||
rule: rule,
|
||||
groups: params.groups,
|
||||
onDelete: params.onDelete,
|
||||
type: params.type
|
||||
})
|
||||
);
|
||||
});
|
||||
|
||||
return h("div", {}, elements);
|
||||
};
|
||||
|
||||
var TemplateTypeSelect = function (params) {
|
||||
return h(
|
||||
"fieldset", {class: 'brizy-template-type'}, [
|
||||
h('h4', {}, 'Template Type'),
|
||||
h('label', {}, [
|
||||
h('input', {
|
||||
type: 'radio',
|
||||
name: 'brizy-template-type',
|
||||
onchange: params.onChange,
|
||||
value: 'single',
|
||||
checked: 'single' === params.value
|
||||
}),
|
||||
h('span', {class: "date-time-text format-i18n"}, Brizy_Admin_Rules.labels.single),
|
||||
]),
|
||||
h('label', {}, [
|
||||
h('input', {
|
||||
type: 'radio',
|
||||
name: 'brizy-template-type',
|
||||
onchange: params.onChange,
|
||||
value: 'archive',
|
||||
checked: 'archive' === params.value
|
||||
}),
|
||||
h('span', {class: "date-time-text format-i18n"}, Brizy_Admin_Rules.labels.archive),
|
||||
]),
|
||||
...(Brizy_Admin_Rules.labels.single_product ?
|
||||
[h('label', {}, [
|
||||
h('input', {
|
||||
type: 'radio',
|
||||
name: 'brizy-template-type',
|
||||
onchange: params.onChange,
|
||||
value: 'single_product',
|
||||
checked: 'single_product' === params.value
|
||||
}),
|
||||
h('span', {class: "date-time-text format-i18n"}, Brizy_Admin_Rules.labels.single_product),
|
||||
]), h('label', {}, [
|
||||
h('input', {
|
||||
type: 'radio',
|
||||
name: 'brizy-template-type',
|
||||
onchange: params.onChange,
|
||||
value: 'product_archive',
|
||||
checked: 'product_archive' === params.value
|
||||
}),
|
||||
h('span', {class: "date-time-text format-i18n"}, Brizy_Admin_Rules.labels.product_archive),
|
||||
])] : []),
|
||||
]
|
||||
);
|
||||
};
|
||||
|
||||
var ruleView = function (state, actions) {
|
||||
|
||||
return h(
|
||||
"div",
|
||||
{
|
||||
class: "rules-container",
|
||||
oncreate: function () {
|
||||
if (state.templateType != '')
|
||||
actions.setLocked(true);
|
||||
api.getGroupList(state.templateType).done(function (response) {
|
||||
actions.updateGroups(response.data)
|
||||
actions.setLocked(false);
|
||||
});
|
||||
},
|
||||
},
|
||||
[
|
||||
h(
|
||||
TemplateTypeSelect, {
|
||||
value: state.templateType,
|
||||
onChange: function (e) {
|
||||
const type = e.target.value && e.target.value != "null"
|
||||
? e.target.value
|
||||
: null;
|
||||
|
||||
actions.setLocked(true);
|
||||
actions.setTemplateType(type);
|
||||
api.getGroupList(type).done(function (response) {
|
||||
actions.updateGroups(response.data);
|
||||
actions.rule.update({
|
||||
appliedFor: String(response.data[0].value),
|
||||
entityType: String(response.data[0].items[0].value),
|
||||
});
|
||||
actions.setLocked(false);
|
||||
});
|
||||
}
|
||||
}, []
|
||||
),
|
||||
h(RuleList, {
|
||||
type: state.templateType,
|
||||
rules: state.rules[state.templateType] || [],
|
||||
groups: state.groups,
|
||||
onDelete: function (rule) {
|
||||
actions.removeRule(rule);
|
||||
}
|
||||
}),
|
||||
state.templateType ? [
|
||||
h(RuleForm, {
|
||||
type: state.templateType,
|
||||
rule: state.rule,
|
||||
groups: state.groups,
|
||||
errors: state.errors,
|
||||
onSubmit: function () {
|
||||
var rules = state.rules[state.templateType] || [];
|
||||
|
||||
try {
|
||||
rules.forEach(rule => {
|
||||
if (rule.type !== state.rule.type) return;
|
||||
if (rule.appliedFor !== state.rule.appliedFor) return;
|
||||
if (rule.entityType !== state.rule.entityType) return;
|
||||
if (arr_diff(rule.entityValues, state.rule.entityValues).length > 0) return;
|
||||
throw 'This rule already exist';
|
||||
});
|
||||
} catch (error) {
|
||||
actions.addFormErrors('This rule already exist');
|
||||
return;
|
||||
}
|
||||
api.validateRule(state.rule)
|
||||
.done(function () {
|
||||
actions.addRule(state.rule);
|
||||
actions.resetRule();
|
||||
})
|
||||
.fail(function (response) {
|
||||
if (response.responseJSON && response.responseJSON.data) {
|
||||
if (response.responseJSON.data.message)
|
||||
actions.addFormErrors(response.responseJSON.data.message);
|
||||
else
|
||||
actions.addFormErrors("Failed to add the rule");
|
||||
}
|
||||
});
|
||||
}
|
||||
})] :
|
||||
[],
|
||||
state.locked ? [h('div', {class: 'lock-screen'}, "Loading..")] : [],
|
||||
]
|
||||
);
|
||||
};
|
||||
|
||||
jQuery(document).ready(function ($) {
|
||||
hyperapp.app(state, actions, ruleView, document.getElementById("rules"));
|
||||
});
|
||||
|
||||
237
wp-content/plugins/brizy/admin/static/js/script.js
Normal file
237
wp-content/plugins/brizy/admin/static/js/script.js
Normal file
@@ -0,0 +1,237 @@
|
||||
jQuery(document).ready(function ($) {
|
||||
|
||||
$( '.brz-review-deserve, .brz-review-later, .brz-review-done' ).on( 'click', function ( e ) {
|
||||
|
||||
var btn = $( this );
|
||||
notice = btn.closest( '.brz-notice' );
|
||||
|
||||
if ( ! btn.hasClass( 'brz-review-deserve' ) ) {
|
||||
e.preventDefault();
|
||||
}
|
||||
|
||||
$.ajax( {
|
||||
url: Brizy_Admin_Data.url,
|
||||
type: 'POST',
|
||||
data: {
|
||||
'action': 'brizy-dismiss-notice',
|
||||
'nonce': Brizy_Admin_Data.nonce,
|
||||
'repeat': !!btn.hasClass( 'brz-review-later' )
|
||||
}
|
||||
} );
|
||||
|
||||
notice.animate({
|
||||
opacity: '-=1'
|
||||
}, 1000, function() {
|
||||
notice.remove();
|
||||
});
|
||||
} );
|
||||
|
||||
var BrizyFeedbackDialog = {
|
||||
|
||||
init: function () {
|
||||
|
||||
if ( ! $( '#brz-deactivate-feedback-dialog' ).length && typeof dialog !== "function" ) {
|
||||
return;
|
||||
}
|
||||
|
||||
this.initDialog();
|
||||
|
||||
$( 'tr[data-slug="brizy"] .deactivate' ).click( function ( e ) {
|
||||
e.preventDefault();
|
||||
$( '#brz-deactivate-feedback-dialog' ).dialog( 'open' );
|
||||
} );
|
||||
|
||||
$( '#brz-deactivate-feedback-dialog input:radio' ).change( function () {
|
||||
|
||||
var radio = $( this ),
|
||||
submitBtn = $( '.brz-feedback-submit' ),
|
||||
skipBtn = $( '.brz-feedback-skip' );
|
||||
|
||||
$( '.brz-feedback-text' ).addClass( 'hidden' );
|
||||
submitBtn.prop( 'disabled', false );
|
||||
skipBtn.prop( 'disabled', false );
|
||||
|
||||
if ( radio.val() === 'brizy_pro' ) {
|
||||
submitBtn.prop( 'disabled', true );
|
||||
skipBtn.prop( 'disabled', true );
|
||||
}
|
||||
|
||||
radio.parent().find( '.brz-feedback-text' ).removeClass( 'hidden' );
|
||||
} );
|
||||
},
|
||||
submitFeedback: function () {
|
||||
|
||||
var redirect = false;
|
||||
|
||||
$( '#brz-deactivate-feedback-dialog input:radio' ).each( function () {
|
||||
if ( $( this ).is( ':checked' ) ) {
|
||||
redirect = true;
|
||||
}
|
||||
} );
|
||||
|
||||
if ( !redirect ) {
|
||||
return;
|
||||
}
|
||||
|
||||
$( '.brz-feedback-submit .ui-button-text' ).addClass( 'brz-loading' ).text( '' );
|
||||
|
||||
$.ajax( {
|
||||
url: Brizy_Admin_Data.url,
|
||||
type: 'POST',
|
||||
data: {
|
||||
'action': 'brizy-send-feedback',
|
||||
'nonce': Brizy_Admin_Data.nonce,
|
||||
'form': $( 'form.brz-deactivate-feedback-dialog-form' ).serialize()
|
||||
}
|
||||
} );
|
||||
|
||||
setTimeout( function () {
|
||||
location.href = $( 'tr[data-slug="brizy"] .deactivate a' ).attr( 'href' );
|
||||
}, 1000 );
|
||||
},
|
||||
initDialog: function () {
|
||||
|
||||
$( '#brz-deactivate-feedback-dialog' ).dialog( {
|
||||
dialogClass: 'brz-deactivate-modal',
|
||||
autoOpen: false,
|
||||
draggable: false,
|
||||
width: 'auto',
|
||||
modal: true,
|
||||
resizable: false,
|
||||
closeOnEscape: true,
|
||||
buttons: [
|
||||
{
|
||||
text: Brizy_Admin_Data.l10n.deactivateFeedbackSubmitBtn,
|
||||
class: 'brz-feedback-submit',
|
||||
click: function () {
|
||||
BrizyFeedbackDialog.submitFeedback();
|
||||
}
|
||||
},
|
||||
{
|
||||
text: Brizy_Admin_Data.l10n.deactivateFeedbackSkipBtn,
|
||||
class: 'brz-feedback-skip',
|
||||
click: function () {
|
||||
location.href = $( 'tr[data-slug="brizy"] .deactivate a' ).attr( 'href' );
|
||||
}
|
||||
}
|
||||
],
|
||||
open: function () {
|
||||
var overlay = $('.ui-widget-overlay');
|
||||
|
||||
overlay.addClass( 'brz-deactivate-overlay' );
|
||||
|
||||
$( '.brz-feedback-text' ).addClass( 'hidden' );
|
||||
$( '.brz-deactivate-modal input:radio' ).prop( 'checked', false );
|
||||
|
||||
// close dialog by clicking the overlay behind it
|
||||
overlay.bind( 'click', function () {
|
||||
$( '#brz-deactivate-feedback-dialog' ).dialog( 'close' );
|
||||
} );
|
||||
|
||||
$( '.brz-feedback-submit' ).prop( 'disabled', false );
|
||||
$( '.brz-feedback-skip' ).prop( 'disabled', false );
|
||||
},
|
||||
create: function () {
|
||||
// style fix for WordPress admin
|
||||
$( '.ui-dialog-titlebar-close' ).addClass( 'ui-button' );
|
||||
},
|
||||
} );
|
||||
}
|
||||
};
|
||||
|
||||
$('.enable-brizy-editor').on('click', function (event) {
|
||||
event.preventDefault();
|
||||
|
||||
jQuery(window).off('beforeunload.edit-post');
|
||||
|
||||
if (wp.autosave) {
|
||||
wp.autosave.server.triggerSave();
|
||||
}
|
||||
|
||||
window.location = $(this).attr('href');
|
||||
});
|
||||
|
||||
// Open our submenu link "Get Help" in a new tab.
|
||||
$( '#get-help,#go-pro' ).parent().attr( 'target', '_blank' );
|
||||
|
||||
var BrizyGutenberg = {
|
||||
|
||||
insertBrizyBtn: function () {
|
||||
|
||||
if ( $( '.edit-post-header-toolbar .brizy-buttons' ).length ) {
|
||||
return;
|
||||
}
|
||||
|
||||
var guten = $( '#editor' ),
|
||||
html = $( '#brizy-gutenberg-btn-middle' ).html();
|
||||
|
||||
if ( ! guten ) {
|
||||
return;
|
||||
}
|
||||
|
||||
guten.find( '.edit-post-header-toolbar' ).append( $( '#brizy-gutenberg-btn-switch-mode' ).html() );
|
||||
|
||||
if ( html && ! $( '.brizy-buttons-gutenberg' ).length ) {
|
||||
guten.find( '.edit-post-visual-editor .block-editor-writing-flow' ).append( html );
|
||||
guten.find( '.editor-post-text-editor' ).after( html );
|
||||
}
|
||||
},
|
||||
|
||||
init: function () {
|
||||
var self = this;
|
||||
|
||||
if (typeof wp.data != 'undefined') {
|
||||
wp.data.subscribe(function () {
|
||||
setTimeout( function () {
|
||||
self.insertBrizyBtn();
|
||||
}, 1 );
|
||||
});
|
||||
}
|
||||
}
|
||||
};
|
||||
|
||||
var BrizyMaintenance = {
|
||||
getSelectAccessRole: function() {
|
||||
return $( '#brizy-maintenance-access-role' );
|
||||
},
|
||||
getSelectMode: function() {
|
||||
return $( 'select[name="brizy-maintenance[mode]"]' );
|
||||
},
|
||||
handleEvents: function () {
|
||||
this.getSelectAccessRole().change( function ( e ) {
|
||||
var display = 'custom' === $( this ).val() ? 'table-cell' : 'none';
|
||||
$( '.brizy-maintenance-roles th, .brizy-maintenance-roles td' ).css( 'display', display );
|
||||
} );
|
||||
|
||||
this.getSelectMode().change( function ( e ) {
|
||||
var self = $( this ),
|
||||
trs = self.closest( 'table' ).find( 'tr:not(#brizy-maintenance-js-mode)' );
|
||||
|
||||
if ( self.val() ) {
|
||||
trs.removeClass( 'hidden' );
|
||||
} else {
|
||||
trs.addClass( 'hidden' );
|
||||
}
|
||||
} );
|
||||
|
||||
this.getSelectMode().trigger( 'change' );
|
||||
this.getSelectAccessRole().trigger( 'change' );
|
||||
},
|
||||
|
||||
init: function () {
|
||||
if ( ! this.getSelectAccessRole().length ) {
|
||||
return;
|
||||
}
|
||||
|
||||
this.handleEvents();
|
||||
}
|
||||
};
|
||||
|
||||
$( function () {
|
||||
BrizyGutenberg.init();
|
||||
BrizyFeedbackDialog.init();
|
||||
BrizyMaintenance.init();
|
||||
} );
|
||||
});
|
||||
|
||||
|
||||
Reference in New Issue
Block a user