updated plugin `Easy Digital Downloads` version 3.1.1.2

This commit is contained in:
KawaiiPunk 2023-03-17 22:34:04 +00:00 committed by Gitium
parent e8a66564bd
commit 19e086d1c4
647 changed files with 20986 additions and 27305 deletions

View File

@ -1,43 +0,0 @@
.chosen-container {
font-size: 14px;
}
.chosen-container-multi .search-field,
.chosen-container-single .chosen-single,
.chosen-container-active.chosen-with-drop .chosen-single {
background: $white 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 right 5px top 55%;
background-size: 16px 16px;
border: 1px solid $wp-input-border;
box-shadow: 0 0 0 transparent;
color: $wp-input-text;
}
.chosen-container-multi .chosen-choices,
.chosen-container-single .chosen-single {
border-radius: 4px;
border-color: $wp-input-border;
}
.chosen-container-multi.chosen-with-drop .chosen-choices,
.chosen-container-active.chosen-with-drop .chosen-single {
box-shadow: 0 1px 1px rgba(0, 0, 0, 0.04);
}
.chosen-container-single.chosen-container-active.chosen-with-drop.chosen-dropup .chosen-single,
.chosen-container-multi.chosen-container-active.chosen-dropup .chosen-choices {
border-radius: 0 0 4px 4px;
border-width: 0 1px 0 1px;
z-index: 1011;
}
.chosen-container .chosen-drop {
position: absolute;
top: 100%;
z-index: 1010;
width: 100%;
border-radius: 0 0 4px 4px;
border-width: 0 1px 0 1px;
border-color: transparent;
background: $white;
outline: 2px solid transparent;
}

View File

@ -1,24 +0,0 @@
/* WordPress Color Schemes */
:root {
@include edd-admin-colors();
}
.chosen-container.chosen-container-active .chosen-single,
.chosen-container.chosen-container-active .chosen-choices,
.chosen-with-drop.chosen-dropup .chosen-drop {
border-color: var(--wp-admin-theme-color);
box-shadow: 0 0 0 1px var(--wp-admin-theme-color);
}
.chosen-with-drop.chosen-dropup .chosen-single,
.chosen-container-active.chosen-dropup .chosen-choices,
.chosen-container .chosen-drop {
border-color: var(--wp-admin-theme-color);
box-shadow: 0 1px 0 1px var(--wp-admin-theme-color);
}
.chosen-container .chosen-results li.highlighted {
background-color: var(--wp-admin-theme-color);
}

View File

@ -1,20 +0,0 @@
.edd-select-chosen {
width: 100%;
max-width: 300px;
}
.edd-select-chosen.edd-customer-select {
width: 100% !important;
}
.edd-select-chosen.edd-time {
width: 55px;
max-width: 55px;
}
@media screen and (max-width: $break-medium) {
.edd-select-chosen.edd-time {
width: 70px;
max-width: 70px;
}
}

View File

@ -1,67 +0,0 @@
.chosen-container-multi {
.search-field {
border: none;
}
&.chosen-with-drop .chosen-choices {
border-bottom-color: transparent;
}
.chosen-choices li.search-field {
min-width: 100px !important;
width: 100%;
}
.chosen-choices li.search-field input[type=text] {
color: $wp-input-text;
font-family: unset;
height: unset;
margin: 0;
padding: 3px 10px;
width: 100% !important;
}
.spinner {
position: absolute;
top: 4px;
right: -4px;
}
.chosen-choices li.search-choice {
margin: 3px 5px 3px 0;
padding: 5px 22px 5px 5px;
border: 1px solid $wp-input-border;
max-width: 100%;
border-radius: 4px;
background: #f4f4f4;
box-shadow: none;
color: $wp-input-text;
cursor: default;
}
.chosen-choices li.search-choice .search-choice-close {
position: absolute;
top: 4px;
right: 3px;
display: block;
width: 15px;
height: 15px;
}
.chosen-choices li.search-choice .search-choice-close:before {
height: 15px;
width: 15px;
position: absolute;
top: 0;
right: 0;
color: $wp-input-text;
font-family: 'dashicons';
content: '\f158';
font-size: 15px;
line-height: 1;
}
.chosen-choices li.search-choice .search-choice-close:hover:before {
color: $wp-text;
}
}

View File

@ -1,16 +0,0 @@
.chosen-container .chosen-results {
color: $wp-text;
position: relative;
overflow-x: hidden;
overflow-y: auto;
margin: 0 4px 4px 0;
padding: 0 0 0 4px;
max-height: 240px;
}
.chosen-container .chosen-results li.highlighted {
background-image: none;
border-radius: 4px;
color: $white;
}

View File

@ -1,54 +0,0 @@
.chosen-container-single .chosen-single div b {
background-image: none;
}
.chosen-container-single .chosen-search:after {
display: block;
position: absolute;
right: 6px;
top: 50%;
font-family: dashicons;
font-size: 17px;
content: '\f179';
transform: translateY(-50%);
}
.chosen-container-single.chosen-container-active.chosen-with-drop .chosen-single {
border-radius: 4px 4px 0 0;
}
.chosen-container-single .chosen-single div {
width: 26px;
}
.chosen-container-single .chosen-default {
color: $wp-input-text;
}
.chosen-container-active .chosen-single {
border-color: transparent;
outline: 2px solid transparent;
}
.chosen-container-single .chosen-search input[type=text] {
margin: 1px 0;
padding: 4px 20px 4px 5px;
width: 100% !important;
height: auto;
outline: 0;
border: 1px solid $wp-input-border;
border-radius: 4px;
line-height: normal;
box-shadow: inset 0 1px 2px rgba( 0, 0, 0, 0.07 );
}
.chosen-container-single .chosen-single,
.chosen-container-single.chosen-container-active.chosen-with-drop .chosen-single {
min-height: 30px;
@media screen and (max-width: $break-medium) {
font-size: 16px;
line-height: 1.625;
min-height: 40px;
padding: 5px 8px;
}
}

View File

@ -1,17 +0,0 @@
/* Chosen styles
-------------------------------------------------------------- */
@import "~@wordpress/base-styles/colors";
@import "~@wordpress/base-styles/variables";
@import "~@wordpress/base-styles/mixins";
@import "~@wordpress/base-styles/breakpoints";
@import "~@wordpress/base-styles/animations";
@import "../../variables/colors";
@import "../../variables/mixins";
@import 'base';
@import 'single';
@import 'multi';
@import 'results';
@import 'colors';
@import 'edd';

View File

@ -1,349 +0,0 @@
/* Date Picker Default Styles */
.edd-datepicker {
padding: 0;
margin: 0;
-webkit-border-radius: 0;
-moz-border-radius: 0;
border-radius: 0;
background-color: #fff;
border: 1px solid #dfdfdf;
border-top: none;
-webkit-box-shadow: 0 3px 6px rgba(0, 0, 0, 0.075);
box-shadow: 0 3px 6px rgba(0, 0, 0, 0.075);
min-width: 17em;
width: auto;
z-index: 1000 !important;
}
.edd-datepicker * {
padding: 0;
font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Oxygen-Sans, Ubuntu, Cantarell, "Helvetica Neue", sans-serif;
-webkit-border-radius: 0;
-moz-border-radius: 0;
border-radius: 0;
}
.edd-datepicker table {
font-size: 13px;
margin: 0;
border: none;
border-collapse: collapse;
}
.edd-datepicker .ui-widget-header,
.edd-datepicker .ui-datepicker-header {
background-image: none;
border: none;
color: #fff;
font-weight: normal;
padding: .2em 0;
}
.edd-datepicker .ui-datepicker-header .ui-state-hover {
background: transparent;
border-color: transparent;
cursor: pointer;
}
.edd-datepicker .ui-datepicker-title {
margin: 0;
padding: 10px 0;
color: #fff;
font-size: 14px;
line-height: 14px;
text-align: center;
}
.edd-datepicker .ui-datepicker-prev,
.edd-datepicker .ui-datepicker-next {
position: relative;
top: 0;
height: 34px;
width: 34px;
}
.edd-datepicker .ui-state-hover.ui-datepicker-prev,
.edd-datepicker .ui-state-hover.ui-datepicker-next {
border: none;
}
.edd-datepicker .ui-datepicker-prev,
.edd-datepicker .ui-datepicker-prev-hover {
left: 0;
}
.edd-datepicker .ui-datepicker-next,
.edd-datepicker .ui-datepicker-next-hover {
right: 0;
}
.edd-datepicker .ui-datepicker-next span,
.edd-datepicker .ui-datepicker-prev span {
display: none;
}
.edd-datepicker .ui-datepicker-prev {
float: left;
}
.edd-datepicker .ui-datepicker-next {
float: right;
}
.edd-datepicker .ui-datepicker-prev:before,
.edd-datepicker .ui-datepicker-next:before {
font: normal 20px/34px 'dashicons';
padding-left: 7px;
color: #fff;
speak: none;
-webkit-font-smoothing: antialiased;
-moz-osx-font-smoothing: grayscale;
width: 34px;
height: 34px;
}
.edd-datepicker .ui-datepicker-prev:before {
content: '\f341';
}
.edd-datepicker .ui-datepicker-next:before {
content: '\f345';
}
.edd-datepicker .ui-datepicker-prev-hover:before,
.edd-datepicker .ui-datepicker-next-hover:before {
opacity: 0.7;
}
.edd-datepicker select.ui-datepicker-month,
.edd-datepicker select.ui-datepicker-year {
width: 33%;
}
.edd-datepicker thead {
color: #fff;
font-weight: 600;
}
.edd-datepicker th {
padding: 10px;
}
.edd-datepicker td {
padding: 0;
border: 1px solid #f4f4f4;
}
.edd-datepicker td.ui-datepicker-other-month {
border: transparent;
}
.edd-datepicker tr:first-of-type td {
border-top: 1px solid #f0f0f0;
}
.edd-datepicker td.ui-datepicker-week-end {
background-color: #f4f4f4;
border: 1px solid #f0f0f0;
}
.edd-datepicker td.ui-datepicker-today {
background-color: #f0f0c0;
}
.edd-datepicker td.ui-datepicker-current-day {
background: #bbdd88;
}
.edd-datepicker td .ui-state-default {
background: transparent;
border: none;
text-align: center;
text-decoration: none;
width: auto;
display: block;
padding: 5px 10px;
font-weight: normal;
color: #444;
}
.edd-datepicker td.ui-state-disabled .ui-state-default {
opacity: 0.5;
}
/* Default Color Scheme */
.edd-datepicker .ui-widget-header,
.edd-datepicker .ui-datepicker-header {
background: #00a0d2;
}
.edd-datepicker thead {
background: #32373c;
}
.edd-datepicker td .ui-state-hover {
background: #0073aa;
color: #fff;
}
/* WordPress Color Schemes */
/* Fresh */
.admin-color-fresh .edd-datepicker .ui-widget-header,
.admin-color-fresh .edd-datepicker .ui-datepicker-header {
background: #00a0d2;
}
.admin-color-fresh .edd-datepicker thead {
background: #32373c;
}
.admin-color-fresh .edd-datepicker td .ui-state-hover {
background: #0073aa;
color: #fff;
}
/* Blue */
.admin-color-blue .edd-datepicker .ui-widget-header,
.admin-color-blue .edd-datepicker .ui-datepicker-header {
background: #52accc;
}
.admin-color-blue .edd-datepicker thead {
background: #4796b3;
}
.admin-color-blue .edd-datepicker td .ui-state-hover {
background: #096484;
color: #fff;
}
/* Coffee */
.admin-color-coffee .edd-datepicker .ui-widget-header,
.admin-color-coffee .edd-datepicker .ui-datepicker-header {
background: #59524c;
}
.admin-color-coffee .edd-datepicker thead {
background: #46403c;
}
.admin-color-coffee .edd-datepicker td .ui-state-hover {
background: #c7a589;
color: #fff;
}
/* Ectoplasm */
.admin-color-ectoplasm .edd-datepicker .ui-widget-header,
.admin-color-ectoplasm .edd-datepicker .ui-datepicker-header {
background: #523f6d;
}
.admin-color-ectoplasm .edd-datepicker thead {
background: #413256;
}
.admin-color-ectoplasm .edd-datepicker td .ui-state-hover {
background: #a3b745;
color: #fff;
}
/* Midnight */
.admin-color-midnight .edd-datepicker .ui-widget-header,
.admin-color-midnight .edd-datepicker .ui-datepicker-header {
background: #363b3f;
}
.admin-color-midnight .edd-datepicker thead {
background: #26292c;
}
.admin-color-midnight .edd-datepicker td .ui-state-hover {
background: #e14d43;
color: #fff;
}
/* Ocean */
.admin-color-ocean .edd-datepicker .ui-widget-header,
.admin-color-ocean .edd-datepicker .ui-datepicker-header {
background: #738e96;
}
.admin-color-ocean .edd-datepicker thead {
background: #627c83;
}
.admin-color-ocean .edd-datepicker td .ui-state-hover {
background: #9ebaa0;
color: #fff;
}
/* Sunrise */
.admin-color-sunrise .edd-datepicker .ui-widget-header,
.admin-color-sunrise .edd-datepicker .ui-datepicker-header,
.admin-color-sunrise .edd-datepicker .ui-datepicker-header .ui-state-hover {
background: #cf4944;
}
.admin-color-sunrise .edd-datepicker th {
border-color: #be3631;
background: #be3631;
}
.admin-color-sunrise .edd-datepicker td .ui-state-hover {
background: #dd823b;
color: #fff;
}
/* Light */
.admin-color-light .edd-datepicker .ui-widget-header,
.admin-color-light .edd-datepicker .ui-datepicker-header {
background: #e5e5e5;
}
.admin-color-light .edd-datepicker thead {
background: #888;
}
.admin-color-light .edd-datepicker .ui-datepicker-title,
.admin-color-light .edd-datepicker td .ui-state-default,
.admin-color-light .edd-datepicker .ui-datepicker-prev:before,
.admin-color-light .edd-datepicker .ui-datepicker-next:before {
color: #555;
}
.admin-color-light .edd-datepicker td .ui-state-hover {
background: #e5e5e5;
}
/* bbPress Color Schemes */
/* Evergreen */
.admin-color-bbp-evergreen .edd-datepicker .ui-widget-header,
.admin-color-bbp-evergreen .edd-datepicker .ui-datepicker-header {
background: #56b274;
}
.admin-color-bbp-evergreen .edd-datepicker thead {
background: #36533f;
}
.admin-color-bbp-evergreen .edd-datepicker td .ui-state-hover {
background: #446950;
color: #fff;
}
/* Mint */
.admin-color-bbp-mint .edd-datepicker .ui-widget-header,
.admin-color-bbp-mint .edd-datepicker .ui-datepicker-header {
background: #4ca26a;
}
.admin-color-bbp-mint .edd-datepicker thead {
background: #4f6d59;
}
.admin-color-bbp-mint .edd-datepicker td .ui-state-hover {
background: #5fb37c;
color: #fff;
}

View File

@ -1,41 +0,0 @@
.edd-custom-price-option {
&-sections-wrap {
display: none;
border-width: 0 1px 1px;
border-style: solid;
border-color: $wp-border;
box-sizing: border-box;
width: 100%;
}
&-section {
display: block;
padding: 10px 8px;
border-bottom: 1px solid rgba( 222, 222, 222, 0.3 );
&-title {
display: block;
font-weight: 600;
padding: 0 0 10px;
}
&-content {
display: flex;
gap: 12px;
margin-bottom: 6px;
}
&:last-child {
border-bottom: none;
}
}
}
.toggle-custom-price-option-section {
color: $wp-gray-40;
&:hover {
color: $wp-text;
}
}

View File

@ -1,30 +0,0 @@
#edd_product_settings {
.edd-product-options__title,
.inside strong {
border-top: 1px solid $wp-border;
border-bottom: 1px solid $wp-border;
background-color: $wp-alternate;
display: flex;
font-weight: 600;
margin: 0 -12px 16px;
padding: 8px 12px;
justify-content: space-between;
align-items: center;
}
.edd-product-options-wrapper:first-of-type .edd-product-options__title,
.inside div:first-child strong {
margin-top: -8px;
}
.edd-product-options__title .edd-help-tip,
.inside strong .edd-help-tip {
font-size: 20px;
}
.label--block {
display: block;
margin: 0 0 4px;
}
}

View File

@ -1,188 +0,0 @@
.edd_repeatable_row.ui-sortable-placeholder {
line-height: 0;
padding: 0;
margin: 0;
box-sizing: border-box;
border: 1px dashed $wp-border;
visibility: visible !important;
}
.edd-add-repeatable-row {
border-top: 1px solid $wp-border;
padding: 12px;
margin: 15px -12px -12px -12px;
display: flex;
justify-content: flex-end;
align-items: center;
}
.edd_repeatable_row input[type="text"].large-text {
width: 100%;
}
.edd_variable_prices_wrapper:not(:first-child),
.edd_repeatable_upload_wrapper:not(:first-child) {
margin-top: 12px;
}
.edd_repeatable_row.ui-sortable-helper .edd-repeatable-row-actions .edd-remove-row {
display: none;
}
.edd-repeatable-row-actions {
color: $wp-gray-40;
a {
text-decoration: none;
width: auto;
cursor: pointer;
}
}
.edd-repeatable-row-header,
.edd-bundle-products-header {
clear: both;
background: $wp-gray-0;
border: 1px solid $wp-border;
display: flex;
justify-content: space-between;
}
.edd-repeatable-row-header {
cursor: move;
}
.edd_repeatable_row:hover .edd-repeatable-row-header,
.edd_repeatable_row:hover .edd-repeatable-row-standard-fields {
border-color: $wp-border;
}
.edd-repeatable-row-header:before,
.edd-repeatable-row-header:after,
.edd-bundled-product-row:before,
.edd-bundled-product-row:after {
content: '';
display: table;
}
.edd-repeatable-row-header:after,
.edd-bundled-product-row:after {
clear: both;
}
.edd-repeatable-row-title,
.edd-bundle-products-header {
font-weight: 600;
}
.edd-repeatable-row-title,
.edd-repeatable-row-actions,
.edd-bundle-products-header {
padding: 8px;
box-sizing: border-box;
}
.edd-repeatable-row-actions {
flex-grow: 1;
text-align: right;
}
.edd-repeatable-row-actions .edd-remove-row,
.edd-bundled-product-row .edd-remove-row {
width: auto;
cursor: pointer;
}
.edd-repeatable-row-standard-fields,
.edd-bundled-product-row {
padding: 8px;
border-width: 0 1px 1px;
border-style: solid;
border-color: $wp-border;
display: flex;
justify-content: space-between;
align-items: center;
gap: 18px;
}
/* @todo: remove these when .edd-form-row has been fully implemented */
.edd-repeatable-row-standard-fields .edd-form-group,
.edd-bundled-product-row .edd-form-group {
margin-bottom: 0;
display: inline-flex;
flex-direction: column;
flex-grow: 1;
justify-content: space-between;
}
.edd-repeatable-row-setting-label .edd-help-tip {
display: inline-block;
margin-left: 4px;
}
.edd-bundled-product-item-reorder {
min-width: 30px;
.edd-product-file-reorder {
font-size: 20px;
cursor: move;
color: $wp-gray-5;
font-family: "dashicons";
content: "\f545";
transition: .2s color;
&:hover {
color: $wp-gray-20;
}
}
}
.edd-bundled-product-actions {
align-self: center;
}
#edd_products .edd-select,
.edd_repeatable_upload_wrapper .pricing select,
.edd_repeatable_product_wrapper .edd-select {
min-width: 100%;
max-width: 200px;
}
.edd_repeatable_product_wrapper td {
overflow: visible;
}
@media screen and (max-width: $break-mobile) {
.edd-bundle-products-header,
.edd-repeatable-row-header,
.edd-repeatable-row-standard-fields,
.edd-bundled-product-row {
flex-wrap: wrap;
}
.edd-repeatable-row-standard-fields .edd-form-group,
.edd-bundled-product-row .edd-form-group {
margin-left: 0 !important;
margin-bottom: 24px;
}
}
/* still used by extensions - Software Licensing upgrade paths, Custom Prices */
.edd_remove_repeatable {
border: none;
cursor: pointer;
display: inline-block;
padding: 0;
overflow: hidden;
margin: 8px 0 0 0;
text-indent: -9999px;
width: 10px;
height: 10px;
}
.edd_remove_repeatable:active,
.edd_remove_repeatable:hover,
.edd_remove_repeatable:focus {
background-position: -10px 0 !important;
}

View File

@ -1,27 +0,0 @@
.edd_repeatable_upload_wrapper .edd_repeatable_upload_field_container {
position: relative;
width: 100%;
+span:first-child {
width: 100%;
}
}
.edd_repeatable_upload_field {
padding-right: 32px;
}
.edd_upload_file button {
background: $wp-gray-0;
border: none;
border-left: 1px solid $wp-border;
padding: 0 4px;
position: absolute;
height: calc(100% - 4px);
overflow: hidden;
top: 2px;
right: 2px;
display: inline-flex;
justify-content: center;
align-items: center;
}

View File

@ -1,4 +0,0 @@
@import "prices";
@import "product_settings";
@import "repeatable_row";
@import "upload";

View File

@ -1,63 +0,0 @@
/**
* EDD Admin CSS
*
* @package EDD
* @subpackage Admin Email Tags CSS
* @copyright Copyright (c) 2015, Pippin Williamson
* @license http://opensource.org/licenses/gpl-2.0.php GNU Public License
*/
.edd-email-tags-filter {
margin: -15px -15px 15px;
padding: 15px;
border-bottom: 1px solid #ddd;
background: #f3f3f3;
}
.edd-email-tags-filter-search {
padding: 10px;
width: 100%;
font-size: 20px;
}
.edd-email-tags-list {
margin: 0;
}
.edd-email-tags-list-item {
margin-bottom: 15px;
}
.edd-email-tags-list-item::last-child {
margin-bottom: 0;
}
.edd-email-tags-list-button {
cursor: pointer;
color: #666;
text-align: left;
padding: 0.8rem;
width: 100%;
background: none;
border: 1px solid #ddd;
border-radius: 3px;
}
.edd-email-tags-list-button:hover {
background: #fafafa;
}
.edd-email-tags-list-button strong {
color: #444;
font-size: 14px;
margin-bottom: 8px;
}
.edd-email-tags-list-button code {
margin-left: 10px;
}
.edd-email-tags-list-button span {
display: block;
margin-top: 10px;
}

View File

@ -1,143 +0,0 @@
/* Extension Manager
------------------------------------------------------------- */
.edd-extension-manager__card {
background-color: #fff;
padding: 2em;
margin: 0;
display: flex;
flex-direction: column;
justify-content: space-between;
}
.edd-extension-manager__card-group .edd-extension-manager__card {
float: left;
max-width: 360px;
margin: 1em;
}
@supports(grid-area: auto) {
.edd-extension-manager__card-group {
display: grid;
grid-template-columns: auto;
gap: 1em;
margin-top: 24px;
}
.edd-extension-manager__card-group .edd-extension-manager__card {
float: none;
margin: 0;
max-width: unset;
}
}
.inside .edd-extension-manager__card {
padding: 0;
}
.edd-extension-manager__title {
margin: 0 0 1em 0;
}
.edd-extension-manager__group {
display: grid;
}
.edd-extension-manager__step {
grid-area: 1/-1;
margin: 0;
}
.edd-extension-manager__step:not(:first-of-type) {
display: none;
}
.edd-extension-manager__step .button {
display: table;
margin: 0 auto;
text-align: center;
white-space: normal;
}
td .edd-extension-manager__step .button {
display: inline-block;
}
.edd-extension-manager__body {
display: grid;
gap: 1.5em;
grid-template-rows: auto 1fr;
flex-grow: 1;
}
.edd-extension-manager__image img {
display: block;
margin: 0 auto;
max-width: 500px;
width: 100%;
}
.edd-extension-manager__features ul {
display: grid;
grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
}
.edd-extension-manager__features .dashicons-yes {
color: #008a20;
margin-right: .25em;
}
.edd-extension-manager__body .notice {
max-width: 320px;
}
/* Extension Manager Style Variations
--------------------------------------- */
.edd-extension-manager__card--horizontal {
margin: 24px 0;
max-width: 700px;
}
.edd-extension-manager__card--detailed {
background-color: transparent;
max-width: 700px;
}
.edd-extension-manager__card--detailed-2col {
background-color: transparent;
max-width: 900px;
}
.edd-extension-manager__card--detailed .edd-extension-manager__title,
.edd-extension-manager__card--detailed-2col .edd-extension-manager__title {
border-bottom: 1px solid #ccc;
padding-bottom: 1em;
}
@media screen and (min-width: 601px) {
.edd-extension-manager__card-group {
grid-template-columns: repeat(auto-fill, minmax(360px, 1fr));
}
.edd-extension-manager__card--horizontal .edd-extension-manager__body {
grid-template-columns: minmax(0, 300px) 1fr;
grid-template-rows: 1fr auto;
grid-auto-flow: column;
}
.edd-extension-manager__card--horizontal .edd-extension-manager__image {
grid-row: 1 / 4;
}
.edd-extension-manager__features,
.edd-extension-manager__card--horizontal .edd-extension-manager__description {
align-self: center;
}
}
@media screen and (min-width: 783px) {
.edd-extension-manager__card--detailed-2col .edd-extension-manager__body {
grid-template-columns: minmax(0, 375px) 1fr;
grid-auto-flow: column;
}
}

View File

@ -1,86 +0,0 @@
/**
* Form Group
*
* <div class="edd-form-group">
* <label class="edd-form-group__label">Label</label>
* <div class="edd-form-group__control">
* <input type="text" class="edd-form-group__input" />
* </div>
* <p class="edd-form-group__help">Help</p>
* </div>
*
*
* <fieldset class="edd-form-group">
* <legend class="edd-form-group__label">Label</label>
*
* <div class="edd-form-group__control">
* <input type="radio" class="edd-form-group__input" />
* <label>Radio 1</label>
* </div>
*
* <div class="edd-form-group__control">
* <input type="radio" class="edd-form-group__input" />
* <label>Radio 2</label>
* </div>
* </fieldset>
*
*/
.edd-form-group {
margin-bottom: 16px;
&:last-of-type {
margin-bottom: 0;
}
}
.edd-form-group__label,
.edd-form-group>label {
display: block;
font-weight: 600;
margin-bottom: 8px;
padding: 0;
}
.edd-form-group__control {
margin-bottom: 12px;
max-width: 100%;
&.is-radio,
&.is-check {
margin-top: 4px;
}
&:last-of-type {
margin-bottom: 0;
}
&--is-inline {
display: inline-flex;
align-items: flex-end;
}
}
.edd-form-group__input {
max-width: 100%;
&[type="checkbox"],
&[type="radio"] {
margin-top: 0;
+label {
display: unset;
}
}
}
select.edd-form-group__input {
max-width: 100%;
}
.edd-form-group__help {
color: $wp-gray-50;
font-size: 13px;
font-style: italic;
line-height: initial;
margin: 8px 0 0;
}

View File

@ -1,20 +0,0 @@
.edd-form-row {
display: flex;
flex-wrap: wrap;
gap: 12px;
&__column {
display: inline-flex;
flex-direction: column;
justify-content: flex-end;
&.edd-form-group {
margin-bottom: 0;
}
}
label,
label.edd-form-group__label {
margin-bottom: 8px;
}
}

View File

@ -1,2 +0,0 @@
@import "form-group";
@import "form-row";

View File

@ -1,21 +0,0 @@
/* PayPal Connect
-------------------------------------------------------------- */
.edd-paypal-account-status ul {
margin-left: 25px;
}
.edd-paypal-account-status > li {
margin-bottom: 1em;
}
.edd-paypal-account-status ul:not(.edd-paypal-webhook-events) {
list-style: disc;
list-style-position: inside;
}
.edd-paypal-account-status ul:not(.edd-paypal-webhook-events) li {
margin: .25em 0;
}
.edd-paypal-account-status .dashicons-yes {
color: #008a20;
}
.edd-paypal-account-status .dashicons-no {
color: #d63638;
}

View File

@ -1,13 +0,0 @@
.edd-item-header-small {
padding-bottom: 20px;
border-bottom: 1px solid #e5e5e5;
display: flex;
justify-content: flex-start;
align-items: center;
gap: 6px;
span {
font-weight: 600;
font-size: 15px;
}
}

View File

@ -1,64 +0,0 @@
/**
* EDD Admin Menu CSS
*
* @package EDD
* @subpackage Admin CSS
* @copyright Copyright (c) 2015, Pippin Williamson
* @license http://opensource.org/licenses/gpl-2.0.php GNU Public License
*/
@import "~@wordpress/base-styles/breakpoints";
@import "../variables/colors";
/* Submenu Styles
-------------------------------------------------------------- */
#menu-posts-download a[href^="edit.php?post_type=download"] {
&:hover,
&:focus {
box-shadow: inset 4px 0 0 0 currentColor;
transition: box-shadow .1s linear;
}
}
/* Secondary Separators */
#menu-posts-download li:not(:last-child) a[href^="post-new.php?post_type=download"]:after,
#menu-posts-download li:not(:last-child) a[href^="edit.php?post_type=download&page=edd-discount"]:after,
#menu-posts-download li:not(:last-child) a[href^="edit.php?post_type=download&page=edd-reports"]:after,
#menu-posts-download li:nth-last-child(2) a:after {
border-bottom: 1px solid rgba(255, 255, 255, 0.2);
display: block;
float: left;
margin: 13px -15px 8px;
content: '';
width: calc(100% + 26px);
@media screen and (max-width: $break-medium) {
margin: 20px -20px 8px -20px;
width: calc(100% + 30px);
}
}
#adminmenu #menu-posts-download {
/* WordPress 5.7 fix for left-shadow on hover */
ul.wp-submenu-wrap li {
clear: both;
}
a.wp-has-current-submenu:after {
display: none;
}
}
/* Show Submenu Arrow */
ul#adminmenu #menu-posts-download ul.wp-submenu li.current a:before {
right: 0;
border: solid 8px transparent;
content: " ";
height: 0;
width: 0;
position: absolute;
pointer-events: none;
border-right-color: $wp-gray-0;
margin-top: 2px;
}

View File

@ -1,123 +0,0 @@
/* Notifications
-------------------------------------------------------------- */
.edd-overlay {
position: fixed;
z-index: 1052;
top: 0;
right: 0;
bottom: 0;
left: 160px;
background-color: #141b38;
opacity: .5;
transition: .5s;
}
.edd-slide-in {
transform: translateX(100%) !important;
-webkit-transform: translateX(100%) !important;
}
#edd-notifications-panel {
background-color: white;
height: 100%;
width: 100%;
max-width: 570px;
position: fixed;
z-index: 1053;
top: 0;
right: 0;
bottom: 0;
overflow-x: hidden;
transition: .5s;
transform: translateX(0%);
-webkit-transform: translateX(0%);
}
body.admin-bar #edd-notifications-panel {
top: 32px;
}
@media screen and (max-width: 600px) {
body.admin-bar #edd-notifications-panel {
top: 46px;
}
}
#edd-notifications-header {
display: flex;
align-items: center;
padding: 0 30px;
color: #fff;
background-color: #0c5d95;
}
#edd-notifications-header h3 {
color: #fff;
flex: 1;
}
#edd-notifications-header .edd-close {
background: none;
border: none;
color: #fff;
cursor: pointer;
}
#edd-notifications-body {
padding: 30px;
}
.edd-notification {
display: flex;
gap: 20px;
margin-bottom: 20px;
}
.edd-notification--icon {
color: #00aa63;
}
.edd-notification--icon.edd-notification--icon-info {
color: #005ae0;
}
.edd-notification--icon.edd-notification--icon-warning {
color: #f18200;
}
.edd-notification--icon.edd-notification--icon-error {
color: #df2a4a;
}
.edd-notification--body {
flex: 1;
}
.edd-notification--header {
align-items: center;
display: flex;
justify-content: space-between;
gap: 5px;
margin-bottom: 7px;
}
.edd-notification--title {
color: #141b38;
flex: 1;
font-size: 16px;
font-weight: 600;
margin: 0;
}
.edd-notification--date {
color: #71747e;
font-size: 12px;
}
.edd-notification--actions {
flex-wrap: wrap;
display: flex;
align-items: center;
gap: 5px;
margin-top: 10px;
}
.edd-notification--dismiss {
background: none !important;
border: none !important;
box-shadow: none !important;
color: #71747e !important;
cursor: pointer;
padding: 0 10px;
text-decoration: underline;
}
.edd-notification--dismiss:hover {
text-decoration: none;
}

View File

@ -1,124 +0,0 @@
$fixed-column-width: 80px;
#edd-submit-refund-status {
text-align: center;
font-size: 1.2em;
.edd-submit-refund-message {
&:before{
font-family: dashicons;
font-size: 1.5em;
vertical-align: middle;
color: #fff;
border-radius: 16px;
margin: 5px;
}
&.success:before {
content: "\f147";
background-color: $wp-green-50;
padding-right: 1px;
}
&.fail {
display: block;
margin-bottom: 16px;
&::before {
content: "\f335";
background-color: $wp-red-50;
}
}
}
}
.refund-items {
td,
th.check-column {
vertical-align: baseline;
}
.column-amount,
.column-quantity,
.column-subtotal,
.column-tax,
.column-discount,
.column-total {
width: $fixed-column-width;
}
.edd-form-group__control {
display: flex;
align-items: center;
select,
input {
background-color: transparent;
border: 0;
border-bottom: 1px solid;
border-radius: 0;
box-shadow: none;
text-align: right;
width: 100%;
&:disabled {
border-bottom: none;
}
&:focus {
border-bottom: 1px solid var(--wp-admin-theme-color-darker-10);
box-shadow: 0 1px 0 var(--wp-admin-theme-color-darker-10);
}
}
select[data-original="1"] {
background: transparent;
}
select,
.is-before + span > input {
text-align: left;
}
}
.edd-refund-submit-line-total {
background-color: $white !important;
td {
text-align: right;
}
}
.edd-refund-submit-line-total-amount {
display: inline-block;
margin-left: 20px;
text-align: left;
width: $fixed-column-width;
}
#edd-refund-submit-subtotal td {
border-top: 2px solid $wp-border;
}
@media screen and ( max-width: 782px ) {
td.column-total {
margin-bottom: 16px;
}
.edd-refund-submit-line-total-amount {
padding-right: 16px;
width: unset;
}
}
}
.edd-submit-refund-actions {
margin: 16px 0 0;
}
.did-refund {
.refund-items,
.edd-submit-refund-actions {
display: none;
}
}

View File

@ -1,2 +0,0 @@
@import "refunds-modal";

View File

@ -1,92 +0,0 @@
.edd-admin-notice-top-of-page {
font-size: 15px;
line-height: 1.4;
color: #fff;
margin-left: -20px;
padding: 12px 32px 12px 20px;
background: #2d6ca2;
display: none;
@media screen and ( min-width: 783px ) {
padding: 10px 46px 10px 22px;
}
@media screen and ( min-width: 961px ) {
text-align: center;
}
a {
color: #fff;
&:hover {
text-decoration: none;
}
}
.button-link {
position: absolute;
top: 48px;
right: -1px;
font-size: 20px;
color: #fff;
font-weight: bold;
text-decoration: none;
margin-left: 5px;
padding: 6px 10px;
&:hover, &:active, &:focus {
color: #fff;
text-decoration: none;
}
@media screen and ( min-width: 601px ) {
top: 1px;
}
@media screen and ( min-width: 783px ) {
right: 9px;
}
}
}
/* Five Star Review Request
------------------------------------------------------------- */
#edd-admin-notice-five-star-review {
display: grid;
}
#edd_dashboard_sales .edd-promo-notice {
border-bottom: 1px solid #c3c4c7;
}
.edd-review-actions {
display: flex;
gap: 6px;
margin: 0 0 16px 0;
}
.edd-promo-notice .edd-peeking {
align-self: flex-end;
justify-self: flex-end;
margin-right: 16px;
margin-bottom: -1px;
}
@media screen and (max-width: 782px) {
#edd-admin-notice-five-star-review.notice .edd-peeking {
margin-bottom: -6px;
}
}
@media screen and (min-width: 400px) {
.edd-promo-notice .edd-peeking {
justify-self: flex-start;
margin-right: 0;
margin-left: 200px;
}
}
.edd-review-step,
.edd-promo-notice .edd-peeking {
grid-area: 1/-1;
}

View File

@ -1,129 +0,0 @@
#edd-filters {
padding: 10px;
margin: 0;
display: flex;
justify-content: space-between;
flex-wrap: wrap;
gap: 8px;
.filter-items {
display: flex;
align-items: center;
flex-wrap: wrap;
gap: 6px;
float: none;
flex-grow: 1;
.edd-date-range-options {
display: inline-block;
margin: 10px 0;
}
}
> p {
color: $gray-700;
}
input[type="text"].edd_datepicker,
input[type="number"] {
max-width: 105px;
}
input[type="number"],
.button-secondary {
margin-bottom: 0;
}
.search-form {
margin: 0;
}
@media screen and ( max-width: 480px ) {
span {
margin: 2px 0;
}
}
}
#edd-advanced-filters {
position: relative;
.inside {
z-index: 99;
position: absolute;
top: 29px;
right: 0;
border: 1px solid $gray-200;
padding: 0;
background: $white;
box-shadow: 0 3px 5px rgba(0,0,0,0.2);
min-width: 285px;
opacity: 0;
visibility: hidden;
}
fieldset {
display: block;
padding: 10px 15px 15px;
margin: 10px 0;
&:not(:last-of-type) {
border-bottom: 1px solid $gray-200;
}
&:last-of-type {
padding-bottom: 5px;
}
&.edd-add-on-filters {
label,
span,
p,
div {
display: block;
margin-bottom: 2px;
}
}
}
div.edd-select-chosen:not(:last-child) {
margin-bottom: 10px;
}
&.open {
.edd-advanced-filters-button {
background: $gray-200;
border-color: $gray-600;
box-shadow: inset 0 2px 5px -3px rgba( 0, 0, 0, 0.5 );
-webkit-transform: translateY(1px);
transform: translateY(1px);
}
.inside {
visibility: visible;
opacity: 1;
-webkit-transition: opacity 0.2s ease-in;
-moz-transition: opacity 0.2s ease-in;
-o-transition: opacity 0.2s ease-in;
transition: opacity 0.2s ease-in;
}
}
}
.download_page_edd-reports {
#edd-filters {
margin-bottom: -1px;
box-shadow: none;
@media screen and ( max-width: 782px ) {
gap: 0;
}
}
}
.edd-old-log-filters {
margin-top: -30px;
margin-left: 2px;
}

View File

@ -1,26 +0,0 @@
@media screen and (min-width: $break-small) {
#edd-reports-charts-wrap {
display: -ms-grid;
display: grid;
grid-template-columns: repeat(2, minmax(200px, 50%));
grid-gap: 20px;
}
.edd-reports-chart {
margin-bottom: 0;
}
.edd-reports-chart-line {
grid-column: 1 / span 2;
}
}
.edd-reports-chart {
height: 500px;
max-height: 700px;
}
.chart-timezone {
font-size: .75rem;
color: #CCCCCC;
}

View File

@ -1,27 +0,0 @@
.edd-mobile-link {
line-height: 32px;
a {
text-decoration: none;
&:before,
&:after {
display: inline-block;
-webkit-font-smoothing: antialiased;
font: normal 20px/30px "dashicons";
vertical-align: top;
margin: 1px 0 0 0;
padding: 0;
}
&:before {
content: "\f470";
color: $gray-700;
margin-right: -3px;
}
&:after {
content: "\f504";
}
}
}

View File

@ -1,145 +0,0 @@
#edd-reports-tiles-wrap #dashboard-widgets .sortable-placeholder {
padding: 0;
margin: 0 0 20px 0;
line-height: 0;
box-sizing: border-box;
height: 110px;
}
#edd-reports-tiles-wrap #dashboard-widgets #primary-sortables {
margin-left: 0;
}
#edd-reports-tiles-wrap #dashboard-widgets #tertiary-sortables {
margin-right: 0;
}
#edd-reports-tiles-wrap {
display: grid;
grid-template-columns: repeat(auto-fill, minmax(250px, 1fr));
grid-gap: 20px;
}
.edd-reports-tile {
text-align: center;
padding: 20px 10px 35px 10px;
display: flex;
flex-direction: column;
justify-content: center;
border: 1px solid #e5e5e5;
background: #fafafa;
position: relative;
box-sizing: border-box;
gap: .5em;
>span:not(.tile-compare) {
width: 100%;
}
}
.edd-reports-tile .tile-label {
text-align: center;
text-transform: uppercase;
font-size: 12px;
font-weight: normal;
color: $wp-gray-2;
}
.edd-reports-tile .tile-value {
color: #333;
font-size: 2em;
line-height: 1;
transition: all .2s ease-in-out;
display: flex;
justify-content: center;
flex-direction: column;
gap: .25em;
}
.edd-reports-tile:hover {
border: 1px solid #aaa;
}
.edd-reports-tile:hover .tile-value:not(.tile-no-data) {
transform: scale(1.05);
}
.edd-reports-tile .tile-amount {
color: rgb(39, 148, 218);
}
.edd-reports-tile .tile-number {
color: rgb(153, 102, 255);
}
.edd-reports-tile .tile-amount,
.edd-reports-tile .tile-number {
color: #fff;
}
.edd-reports-tile .tile-value.tile-no-data {
color: #ddd;
}
.edd-reports-tile .tile-value.tile-url {
font-size: 1.5em;
}
.edd-reports-tile .tile-relative {
font-size: 12px;
font-weight: normal;
color: #888;
}
.edd-reports-tile span.dashicons {
display: inline-block;
font-size: 30px;
line-height: 20px;
height: 20px;
width: 20px;
position: relative;
top: 4px;
left: -5px;
margin-left: -5px;
color: $wp-inactive;
}
.edd-reports-tile .tile-relative {
span.dashicons {
top: -5px;
left: -3px;
margin-left: 0px;
}
span.dashicons-arrow-down,
span.dashicons-arrow-up.reverse {
color: $wp-red-50;
}
span.dashicons-arrow-up,
span.dashicons-arrow-down.reverse {
color: $wp-green-50;
}
}
.edd-reports-tile .tile-compare {
position: absolute;
right: 0;
bottom: 0;
color: #aaa;
font-size: 11px;
line-height: 1em;
background-color: #fff;
border-left: 1px solid #e5e5e5;
border-top: 1px solid #e5e5e5;
border-bottom: 1px solid #fff;
border-right: 1px solid #fff;
border-top-left-radius: 8px;
padding: 4px 0 0 9px;
margin: 0 -1px -1px 0;
}
.edd-reports-tile:hover .tile-compare {
border-left: 1px solid #bbb;
border-top: 1px solid #bbb;
color: #777;
}

View File

@ -1,11 +0,0 @@
@import "~@wordpress/base-styles/colors";
@import "~@wordpress/base-styles/variables";
@import "~@wordpress/base-styles/mixins";
@import "~@wordpress/base-styles/breakpoints";
@import "~@wordpress/base-styles/animations";
@import "../../variables/colors";
@import "filter";
@import "layout";
@import "mobile-link";
@import "tiles";

View File

@ -1,34 +0,0 @@
.edd-tax-rate-table-add {
th select,
th input[type="text"],
th input[type="number"] {
width: 100%;
margin: 0;
padding: 4px;
}
#tax_rate_region_global {
margin-right: 4px;
margin-bottom: 8px;
}
@media screen and (max-width: $break-medium) {
display: block;
th {
display: block;
}
.screen-reader-text {
display: block;
width: unset;
clip: unset;
height: unset;
clip-path: unset;
margin: 0 0 12px;
position: relative;
}
}
}

View File

@ -1,110 +0,0 @@
#edd-admin-tax-rates {
margin: 1em 0 0;
table {
border-collapse: collapse;
}
.tablenav.top {
display: flex;
justify-content: space-between;
}
.edd-admin-tax-rates__tablenav--left {
display: inline-flex;
}
th:not(.check-column) {
padding: 15px 10px;
width: unset;
}
.chosen-container {
width: 100% !important;
}
tbody tr:not(:last-of-type) {
border-bottom: 1px solid $gray-200;
}
tfoot.add-new th {
font-weight: normal;
padding: 12px 8px 10px 8px;
}
/**
* [1] Due to the inability to reset the <tbody> child views the "empty" view
* can only be appended to the parent. This means duplicates may be added.
*
* This can be removed once changes are immediately reflected with Backbone.sync()
*/
.edd-tax-rate-row--is-empty + .edd-tax-rate-row--is-empty, /* [1] */
.edd-tax-rate-row--inactive {
display: none;
}
.has-inactive .edd-tax-rate-row--inactive {
display: table-row;
}
.edd-tax-rate-row--is-empty td {
background-color: $wp-alternate;
}
.edd-tax-rate-row--inactive td {
color: $wp-inactive;
background-color: $wp-alternate;
}
.edd-tax-rate-table-add {
background-color: $wp-alternate;
}
@media screen and (max-width: 782px) {
thead th:not(.edd-tax-rates-table-rate),
tfoot:not(.add-new) th:not(.edd-tax-rates-table-rate) {
display: none;
}
thead tr,
tfoot:not(.add-new) tr,
.edd-tax-rate-row {
display: grid;
grid-template-columns: 2.5em 1fr;
grid-template-rows: 1fr;
grid-gap: 0 16px;
}
th.edd-tax-rates-table-rate {
padding-left: 12px;
}
.edd-tax-rates-table-checkbox {
grid-row: 1 / 5;
}
tbody td {
padding-left: 35% !important;
}
td:before {
content: attr(data-colname);
display: block;
width: 32%;
position: absolute;
}
.tablenav.top {
flex-wrap: wrap;
}
.edd-admin-tax-rates__tablenav--left {
margin-bottom: 16px;
}
.edd-admin-tax-rates__tablenav--left select {
margin-right: 6px;
}
}
}

View File

@ -1,9 +0,0 @@
@import "~@wordpress/base-styles/colors";
@import "~@wordpress/base-styles/variables";
@import "~@wordpress/base-styles/mixins";
@import "~@wordpress/base-styles/breakpoints";
@import "~@wordpress/base-styles/animations";
@import "../../variables/colors";
@import "base";
@import "add";

View File

@ -1,22 +0,0 @@
#edd-migration-progress {
.dashicons-minus {
color: $gray-600;
}
.dashicons-yes {
color: green;
}
.dashicons-update:before {
animation: rotation 2s infinite linear;
display: block;
}
}
#edd-v3-migration-remove-legacy-data-submit-wrap {
display: flex;
align-items: center;
gap: 6px;
.button {
margin: 0;
}
}

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

View File

@ -1 +1 @@
#menu-posts-download a[href^="edit.php?post_type=download"]:focus,#menu-posts-download a[href^="edit.php?post_type=download"]:hover{box-shadow:inset -4px 0 0 0 currentColor;transition:box-shadow .1s linear}#menu-posts-download li>a[href^="post-new.php?post_type=download"]{display:none}#menu-posts-download li:not(:last-child) a[href^="edit.php?post_type=download&page=edd-discount"]:after,#menu-posts-download li:not(:last-child) a[href^="edit.php?post_type=download&page=edd-reports"]:after,#menu-posts-download li:not(:last-child) a[href^="post-new.php?post_type=download"]:after,#menu-posts-download li:nth-last-child(3) a:after{border-bottom:1px solid hsla(0,0%,100%,.2);display:block;float:right;margin:13px -15px 8px;content:"";width:calc(100% + 26px)}@media screen and (max-width:782px){#menu-posts-download li:not(:last-child) a[href^="edit.php?post_type=download&page=edd-discount"]:after,#menu-posts-download li:not(:last-child) a[href^="edit.php?post_type=download&page=edd-reports"]:after,#menu-posts-download li:not(:last-child) a[href^="post-new.php?post_type=download"]:after,#menu-posts-download li:nth-last-child(3) a:after{margin:20px -20px 8px;width:calc(100% + 30px)}}#adminmenu #menu-posts-download ul.wp-submenu-wrap li{clear:both}#adminmenu #menu-posts-download a.wp-has-current-submenu:after{display:none}ul#adminmenu #menu-posts-download ul.wp-submenu li.current a:before{left:0;content:" ";height:0;width:0;position:absolute;pointer-events:none;border:8px solid transparent;border-left-color:#f6f7f7;margin-top:2px}
#menu-posts-download .wp-submenu{display:flex;flex-wrap:wrap}#menu-posts-download .wp-submenu li{width:100%}#menu-posts-download a[href^="edit.php?post_type=download"]:focus,#menu-posts-download a[href^="edit.php?post_type=download"]:hover{box-shadow:inset -4px 0 0 0 currentColor;transition:box-shadow .1s linear}#menu-posts-download li>a[href^="post-new.php?post_type=download"]{display:none}#menu-posts-download li:not(:last-child) a[href^="edit.php?post_type=download&page=edd-discount"]:after,#menu-posts-download li:not(:last-child) a[href^="edit.php?post_type=download&page=edd-reports"]:after,#menu-posts-download li:not(:last-child) a[href^="post-new.php?post_type=download"]:after,#menu-posts-download li:nth-last-child(2) a:after{border-bottom:1px solid hsla(0,0%,100%,.2);display:block;float:right;margin:13px -15px 8px;content:"";width:calc(100% + 26px)}@media screen and (max-width:782px){#menu-posts-download li:not(:last-child) a[href^="edit.php?post_type=download&page=edd-discount"]:after,#menu-posts-download li:not(:last-child) a[href^="edit.php?post_type=download&page=edd-reports"]:after,#menu-posts-download li:not(:last-child) a[href^="post-new.php?post_type=download"]:after,#menu-posts-download li:nth-last-child(2) a:after{margin:20px -20px 8px;width:calc(100% + 30px)}}#adminmenu #menu-posts-download ul.wp-submenu-wrap li{clear:both}#adminmenu #menu-posts-download a.wp-has-current-submenu:after{display:none}ul#adminmenu #menu-posts-download ul.wp-submenu li.current a:before{left:0;content:" ";height:0;width:0;position:absolute;pointer-events:none;border:8px solid transparent;border-left-color:#f6f7f7;margin-top:2px}a.edd-onboarding__menu-item{background:#dd823b!important;color:#fff!important;font-weight:600}a.edd-onboarding__menu-item:hover{color:#000!important}a.edd-sidebar__upgrade-pro,a.edd-sidebar__upgrade-pro:hover{background-color:#1da867!important;color:#fff!important;font-weight:600}

View File

@ -1 +1 @@
#menu-posts-download a[href^="edit.php?post_type=download"]:focus,#menu-posts-download a[href^="edit.php?post_type=download"]:hover{box-shadow:inset 4px 0 0 0 currentColor;transition:box-shadow .1s linear}#menu-posts-download li>a[href^="post-new.php?post_type=download"]{display:none}#menu-posts-download li:not(:last-child) a[href^="edit.php?post_type=download&page=edd-discount"]:after,#menu-posts-download li:not(:last-child) a[href^="edit.php?post_type=download&page=edd-reports"]:after,#menu-posts-download li:not(:last-child) a[href^="post-new.php?post_type=download"]:after,#menu-posts-download li:nth-last-child(3) a:after{border-bottom:1px solid hsla(0,0%,100%,.2);display:block;float:left;margin:13px -15px 8px;content:"";width:calc(100% + 26px)}@media screen and (max-width:782px){#menu-posts-download li:not(:last-child) a[href^="edit.php?post_type=download&page=edd-discount"]:after,#menu-posts-download li:not(:last-child) a[href^="edit.php?post_type=download&page=edd-reports"]:after,#menu-posts-download li:not(:last-child) a[href^="post-new.php?post_type=download"]:after,#menu-posts-download li:nth-last-child(3) a:after{margin:20px -20px 8px;width:calc(100% + 30px)}}#adminmenu #menu-posts-download ul.wp-submenu-wrap li{clear:both}#adminmenu #menu-posts-download a.wp-has-current-submenu:after{display:none}ul#adminmenu #menu-posts-download ul.wp-submenu li.current a:before{right:0;content:" ";height:0;width:0;position:absolute;pointer-events:none;border:8px solid transparent;border-right-color:#f6f7f7;margin-top:2px}
#menu-posts-download .wp-submenu{display:flex;flex-wrap:wrap}#menu-posts-download .wp-submenu li{width:100%}#menu-posts-download a[href^="edit.php?post_type=download"]:focus,#menu-posts-download a[href^="edit.php?post_type=download"]:hover{box-shadow:inset 4px 0 0 0 currentColor;transition:box-shadow .1s linear}#menu-posts-download li>a[href^="post-new.php?post_type=download"]{display:none}#menu-posts-download li:not(:last-child) a[href^="edit.php?post_type=download&page=edd-discount"]:after,#menu-posts-download li:not(:last-child) a[href^="edit.php?post_type=download&page=edd-reports"]:after,#menu-posts-download li:not(:last-child) a[href^="post-new.php?post_type=download"]:after,#menu-posts-download li:nth-last-child(2) a:after{border-bottom:1px solid hsla(0,0%,100%,.2);display:block;float:left;margin:13px -15px 8px;content:"";width:calc(100% + 26px)}@media screen and (max-width:782px){#menu-posts-download li:not(:last-child) a[href^="edit.php?post_type=download&page=edd-discount"]:after,#menu-posts-download li:not(:last-child) a[href^="edit.php?post_type=download&page=edd-reports"]:after,#menu-posts-download li:not(:last-child) a[href^="post-new.php?post_type=download"]:after,#menu-posts-download li:nth-last-child(2) a:after{margin:20px -20px 8px;width:calc(100% + 30px)}}#adminmenu #menu-posts-download ul.wp-submenu-wrap li{clear:both}#adminmenu #menu-posts-download a.wp-has-current-submenu:after{display:none}ul#adminmenu #menu-posts-download ul.wp-submenu li.current a:before{right:0;content:" ";height:0;width:0;position:absolute;pointer-events:none;border:8px solid transparent;border-right-color:#f6f7f7;margin-top:2px}a.edd-onboarding__menu-item{background:#dd823b!important;color:#fff!important;font-weight:600}a.edd-onboarding__menu-item:hover{color:#000!important}a.edd-sidebar__upgrade-pro,a.edd-sidebar__upgrade-pro:hover{background-color:#1da867!important;color:#fff!important;font-weight:600}

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 @@
.edd-pass-handler__description{display:-ms-grid;display:grid;gap:1em;margin-bottom:1em}.edd-pass-handler__control{display:flex;gap:4px;flex-wrap:wrap}.edd-pass-handler__control>input{max-width:250px!important}.edd-pass-handler__control+.notice{max-width:400px;margin-top:1em}.edd-pass-handler__control .button{margin:0}.edd-pass-handler__loading{display:flex;align-items:center;gap:.5em}.edd-pass-handler__loading:before{background:none;display:block;animation:edd-spinning 1.5s linear infinite;animation-play-state:inherit;border:2px solid #7e8993;border-bottom-color:#f9f9f9;border-radius:100%;content:"";width:12px;height:12px;transform:translate3d(50%,-50%,0);will-change:transform}.edd-pass-handler__verifying-wrap{display:flex;position:fixed;right:36px;left:0;top:0;bottom:0;background:rgba(0,0,0,.5);justify-content:center;align-items:center;z-index:1}.edd-pass-handler__verifying-wrap p{background:#fff;border:1px solid #7e8993;border-radius:4px;padding:2em}@media only screen and (min-width:960px){.wp-admin:not(.folded) .edd-pass-handler__verifying-wrap{right:160px}}@media only screen and (max-width:782px){.edd-pass-handler__verifying-wrap{right:0}}.edd-pass-handler__verifying ul#adminmenu #menu-posts-download ul.wp-submenu li.current a:before{border-left-color:#787878}.edd-pass-handler__actions{display:flex;gap:4px}

View File

@ -0,0 +1 @@
.edd-pass-handler__description{display:-ms-grid;display:grid;gap:1em;margin-bottom:1em}.edd-pass-handler__control{display:flex;gap:4px;flex-wrap:wrap}.edd-pass-handler__control>input{max-width:250px!important}.edd-pass-handler__control+.notice{max-width:400px;margin-top:1em}.edd-pass-handler__control .button{margin:0}.edd-pass-handler__loading{display:flex;align-items:center;gap:.5em}.edd-pass-handler__loading:before{background:none;display:block;animation:edd-spinning 1.5s linear infinite;animation-play-state:inherit;border:2px solid #7e8993;border-bottom-color:#f9f9f9;border-radius:100%;content:"";width:12px;height:12px;transform:translate3d(-50%,-50%,0);will-change:transform}.edd-pass-handler__verifying-wrap{display:flex;position:fixed;left:36px;right:0;top:0;bottom:0;background:rgba(0,0,0,.5);justify-content:center;align-items:center;z-index:1}.edd-pass-handler__verifying-wrap p{background:#fff;border:1px solid #7e8993;border-radius:4px;padding:2em}@media only screen and (min-width:960px){.wp-admin:not(.folded) .edd-pass-handler__verifying-wrap{left:160px}}@media only screen and (max-width:782px){.edd-pass-handler__verifying-wrap{left:0}}.edd-pass-handler__verifying ul#adminmenu #menu-posts-download ul.wp-submenu li.current a:before{border-right-color:#787878}.edd-pass-handler__actions{display:flex;gap:4px}

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

View File

@ -1,29 +0,0 @@
@import "~@wordpress/base-styles/colors";
@import "~@wordpress/base-styles/colors.native";
/**
* WordPress Core colors current as of 5.5.1.
*/
$wp-text: $gray-text-min;
$wp-border: #c3c4c7;
$wp-input-text: #32373c;
$wp-input-border: #7e8993;
$wp-alternate: #f9f9f9;
$wp-inactive: #999;
$wp-red-50: #d63638;
$wp-green-50: #008a20;
$wp-gray-0: $gray-0;
$wp-gray-2: $gray-100;
$wp-gray-5: #dcdcde;
$wp-gray-10: #c3c4c7;
$wp-gray-20: $gray-20;
$wp-gray-40: $gray-40;
$wp-gray-50: $gray-50;
$buddypress-colors: (
'evergreen': #36533f,
'mint': #4f6d59,
);

View File

@ -1,10 +0,0 @@
@mixin edd-admin-colors() {
@include admin-scheme(#007cba);
@include wordpress-admin-schemes();
@each $slug, $color in $buddypress-colors {
body.admin-color-#{$slug} {
@include admin-scheme($color);
}
}
}

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

View File

@ -0,0 +1,14 @@
<svg width="20" height="21" viewBox="0 0 20 21" fill="none" xmlns="http://www.w3.org/2000/svg">
<path d="M12.2585 8.15696L11.8878 7.78628C11.4784 7.37684 10.8146 7.37684 10.4051 7.78628L2.99154 15.1999C2.5821 15.6093 2.5821 16.2731 2.99154 16.6826L3.36222 17.0533C3.77166 17.4627 4.4355 17.4627 4.84494 17.0533L12.2585 9.63968C12.668 9.23023 12.668 8.5664 12.2585 8.15696Z" stroke="#2794DA" stroke-width="1.5" stroke-linecap="round" stroke-linejoin="round"/>
<path d="M9.15283 9.43262L10.8471 10.8919" stroke="#2794DA" stroke-width="1.5" stroke-linecap="round" stroke-linejoin="round"/>
<path d="M4.82202 6.81934H6.6896" stroke="#2794DA" stroke-width="1.5" stroke-linecap="round" stroke-linejoin="round"/>
<path d="M5.75586 5.8855V7.75307" stroke="#2794DA" stroke-width="1.5" stroke-linecap="round" stroke-linejoin="round"/>
<path d="M10.4248 15.2234H12.2924" stroke="#2794DA" stroke-width="1.5" stroke-linecap="round" stroke-linejoin="round"/>
<path d="M16.5796 10.7058H18.4472" stroke="#2794DA" stroke-width="1.5" stroke-linecap="round" stroke-linejoin="round"/>
<path d="M9 3.59595H10.8676" stroke="#2794DA" stroke-width="1.5" stroke-linecap="round" stroke-linejoin="round"/>
<path d="M11.3586 14.2896V16.1571" stroke="#2794DA" stroke-width="1.5" stroke-linecap="round" stroke-linejoin="round"/>
<path d="M17.5132 9.77222V11.6398" stroke="#2794DA" stroke-width="1.5" stroke-linecap="round" stroke-linejoin="round"/>
<path d="M9.93359 2.66211V4.52968" stroke="#2794DA" stroke-width="1.5" stroke-linecap="round" stroke-linejoin="round"/>
<path d="M14 5.59595H15.8676" stroke="#2794DA" stroke-width="1.5" stroke-linecap="round" stroke-linejoin="round"/>
<path d="M14.9336 4.66211V6.52968" stroke="#2794DA" stroke-width="1.5" stroke-linecap="round" stroke-linejoin="round"/>
</svg>

After

Width:  |  Height:  |  Size: 1.7 KiB

View File

@ -0,0 +1,5 @@
<svg width="20" height="21" viewBox="0 0 20 21" fill="none" xmlns="http://www.w3.org/2000/svg">
<path d="M14.5249 12.7583L18.9166 14.6666C18.991 14.699 19.0544 14.7524 19.0989 14.8203C19.1434 14.8882 19.1671 14.9676 19.1671 15.0487C19.1671 15.1299 19.1434 15.2093 19.0989 15.2771C19.0544 15.345 18.991 15.3984 18.9166 15.4308L10.3791 19.145C10.3265 19.1679 10.2698 19.1798 10.2124 19.1798C10.1551 19.1798 10.0983 19.1679 10.0458 19.145L1.50828 15.4325C1.43385 15.4001 1.3705 15.3467 1.32601 15.2788C1.28152 15.2109 1.25781 15.1315 1.25781 15.0504C1.25781 14.9692 1.28152 14.8898 1.32601 14.822C1.3705 14.7541 1.43385 14.7007 1.50828 14.6683L5.89994 12.7583" stroke="#2794DA" stroke-width="1.5" stroke-linecap="round" stroke-linejoin="round"/>
<path d="M14.5249 8.17505L18.9166 10.0834C18.991 10.1158 19.0544 10.1692 19.0989 10.237C19.1434 10.3049 19.1671 10.3843 19.1671 10.4655C19.1671 10.5466 19.1434 10.626 19.0989 10.6939C19.0544 10.7618 18.991 10.8152 18.9166 10.8475L10.3791 14.5617C10.3265 14.5847 10.2698 14.5965 10.2124 14.5965C10.1551 14.5965 10.0983 14.5847 10.0458 14.5617L1.50828 10.8492C1.43385 10.8168 1.3705 10.7634 1.32601 10.6956C1.28152 10.6277 1.25781 10.5483 1.25781 10.4671C1.25781 10.386 1.28152 10.3066 1.32601 10.2387C1.3705 10.1708 1.43385 10.1174 1.50828 10.085L5.89994 8.17505" stroke="#2794DA" stroke-width="1.5" stroke-linecap="round" stroke-linejoin="round"/>
<path d="M10.3792 9.9742C10.3266 9.9969 10.2698 10.0086 10.2125 10.0086C10.1552 10.0086 10.0985 9.9969 10.0459 9.9742L1.50836 6.2617C1.43466 6.22898 1.37204 6.17559 1.32809 6.10799C1.28414 6.04039 1.26074 5.96149 1.26074 5.88086C1.26074 5.80023 1.28414 5.72133 1.32809 5.65373C1.37204 5.58614 1.43466 5.53274 1.50836 5.50003L10.0459 1.78503C10.0984 1.76209 10.1552 1.75024 10.2125 1.75024C10.2699 1.75024 10.3266 1.76209 10.3792 1.78503L18.9167 5.50003C18.9911 5.5324 19.0545 5.58581 19.099 5.65368C19.1435 5.72156 19.1672 5.80095 19.1672 5.88211C19.1672 5.96327 19.1435 6.04267 19.099 6.11054C19.0545 6.17842 18.9911 6.23182 18.9167 6.2642L10.3792 9.9742Z" stroke="#2794DA" stroke-width="1.5" stroke-linecap="round" stroke-linejoin="round"/>
</svg>

After

Width:  |  Height:  |  Size: 2.1 KiB

View File

@ -0,0 +1 @@
<?xml version="1.0" encoding="UTF-8" standalone="no"?><!DOCTYPE svg PUBLIC "-//W3C//DTD SVG 1.1//EN" "http://www.w3.org/Graphics/SVG/1.1/DTD/svg11.dtd"><svg width="100%" height="100%" viewBox="0 0 150 150" version="1.1" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" xml:space="preserve" xmlns:serif="http://www.serif.com/" style="fill-rule:evenodd;clip-rule:evenodd;stroke-linecap:round;stroke-linejoin:round;stroke-miterlimit:1.5;"><path d="M74.894,30.066c15.766,-29.983 47.3,-29.983 63.068,-14.992c15.767,14.992 15.767,44.976 -0,74.959c-11.037,22.488 -39.418,44.975 -63.068,59.967c-23.651,-14.992 -52.032,-37.479 -63.069,-59.967c-15.767,-29.984 -15.767,-59.967 0,-74.959c15.768,-14.991 47.301,-14.991 63.069,14.992Z" style="fill:#0c5d95;stroke:#000;stroke-width:0.3px;"/></svg>

After

Width:  |  Height:  |  Size: 811 B

View File

@ -0,0 +1,4 @@
<svg width="20" height="19" viewBox="0 0 20 19" fill="none" xmlns="http://www.w3.org/2000/svg">
<path d="M18.3429 16.743L1.6715 10.9287C1.39948 10.8338 1.16251 10.6588 0.991695 10.4268C0.82088 10.1948 0.724204 9.91661 0.714355 9.62868V8.07154C0.715532 7.77623 0.808198 7.48854 0.979604 7.24806C1.15101 7.00758 1.39273 6.82613 1.6715 6.72868L18.3429 0.928679C18.45 0.892524 18.564 0.882273 18.6758 0.898768C18.7876 0.915262 18.8938 0.958033 18.9859 1.02357C19.0779 1.0891 19.153 1.17553 19.2052 1.27575C19.2573 1.37597 19.2849 1.48714 19.2858 1.60011V16.0715C19.2849 16.1845 19.2573 16.2957 19.2052 16.3959C19.153 16.4961 19.0779 16.5825 18.9859 16.6481C18.8938 16.7136 18.7876 16.7564 18.6758 16.7729C18.564 16.7894 18.45 16.7791 18.3429 16.743Z" stroke="#2794DA" stroke-width="1.5" stroke-linecap="round" stroke-linejoin="round"/>
<path d="M12.1145 14.6002C11.9942 15.5925 11.5002 16.5016 10.733 17.1425C9.96588 17.7833 8.98331 18.1076 7.98541 18.0494C6.98752 17.9911 6.04937 17.5546 5.36203 16.8288C4.67468 16.1031 4.28984 15.1426 4.28589 14.143V11.8716" stroke="#2794DA" stroke-width="1.5" stroke-linecap="round" stroke-linejoin="round"/>
</svg>

After

Width:  |  Height:  |  Size: 1.1 KiB

View File

@ -0,0 +1,10 @@
<svg width="20" height="21" viewBox="0 0 20 21" fill="none" xmlns="http://www.w3.org/2000/svg">
<g clip-path="url(#clip0_223_5271)">
<path d="M2.50031 3.00098H17.5001C17.7211 3.00098 17.9331 3.08877 18.0893 3.24505C18.2456 3.40133 18.3334 3.61329 18.3334 3.8343V17.1674C18.3334 17.3884 18.2456 17.6004 18.0893 17.7567C17.9331 17.913 17.7211 18.0008 17.5001 18.0008H2.50031C2.2793 18.0008 2.06734 17.913 1.91107 17.7567C1.75479 17.6004 1.66699 17.3884 1.66699 17.1674V3.8343C1.66699 3.61329 1.75479 3.40133 1.91107 3.24505C2.06734 3.08877 2.2793 3.00098 2.50031 3.00098ZM16.6668 9.66754H3.33363V16.3341H16.6668V9.66754ZM16.6668 8.0009V4.66762H3.33363V8.0009H16.6668ZM11.6668 13.0008H15.0001V14.6675H11.6668V13.0008Z" fill="#2794DA"/>
</g>
<defs>
<clipPath id="clip0_223_5271">
<rect width="19.9997" height="19.9997" fill="white" transform="translate(0 0.5)"/>
</clipPath>
</defs>
</svg>

After

Width:  |  Height:  |  Size: 886 B

View File

@ -0,0 +1,3 @@
<svg width="16" height="16" viewBox="0 0 16 16" fill="none" xmlns="http://www.w3.org/2000/svg">
<path fill-rule="evenodd" clip-rule="evenodd" d="M9.11158 1V6.07591H10.9641V6.81692L8.00007 9.78095L5.03604 6.81692V6.07591H6.88856V1H9.11158ZM3.18352 10.1515V12.004H12.8166V10.1515H15.7807V13.486V14.968H14.2986H1.7015H0.219482V13.486V10.1515H3.18352Z" fill="#999"/>
</svg>

After

Width:  |  Height:  |  Size: 372 B

View File

@ -0,0 +1,13 @@
<svg width="20" height="21" viewBox="0 0 20 21" fill="none" xmlns="http://www.w3.org/2000/svg">
<g clip-path="url(#clip0_223_5292)">
<path d="M9.17993 10.3824L12.6524 6.90991" stroke="#2794DA" stroke-width="1.5" stroke-linecap="round" stroke-linejoin="round"/>
<path d="M12.6526 6.91L13.1259 3.785L15.8326 1.125L16.2509 3.31167L18.4376 3.73L15.7776 6.43667L12.6526 6.91Z" stroke="#2794DA" stroke-width="1.5" stroke-linecap="round" stroke-linejoin="round"/>
<path d="M17.5459 8.42754C17.9876 10.1018 17.8829 11.8733 17.247 13.4838C16.6111 15.0943 15.4774 16.4596 14.0111 17.3805C12.5448 18.3014 10.8227 18.7298 9.09585 18.6033C7.36899 18.4767 5.72772 17.8018 4.41137 16.677C3.09502 15.5521 2.17243 14.0362 1.77816 12.3502C1.38388 10.6642 1.53852 8.89629 2.21954 7.30434C2.90055 5.7124 4.07233 4.37965 5.56398 3.50043C7.05564 2.62121 8.78917 2.24151 10.5118 2.4167" stroke="#2794DA" stroke-width="1.5" stroke-linecap="round" stroke-linejoin="round"/>
<path d="M13.935 9.4475C14.1542 10.3314 14.0922 11.2617 13.7576 12.1087C13.423 12.9557 12.8324 13.6771 12.0683 14.1725C11.3041 14.668 10.4044 14.9126 9.49464 14.8724C8.58484 14.8322 7.71025 14.5091 6.99279 13.9482C6.27532 13.3873 5.75073 12.6166 5.49213 11.7434C5.23354 10.8702 5.25382 9.93805 5.55016 9.07693C5.8465 8.2158 6.40413 7.46859 7.14532 6.93944C7.88651 6.4103 8.77432 6.12559 9.68501 6.125" stroke="#2794DA" stroke-width="1.5" stroke-linecap="round" stroke-linejoin="round"/>
</g>
<defs>
<clipPath id="clip0_223_5292">
<rect width="20" height="20" fill="white" transform="translate(0 0.5)"/>
</clipPath>
</defs>
</svg>

After

Width:  |  Height:  |  Size: 1.5 KiB

View File

@ -0,0 +1,4 @@
<svg width="16" height="16" viewBox="0 0 16 16" fill="none" xmlns="http://www.w3.org/2000/svg">
<path fill-rule="evenodd" clip-rule="evenodd" d="M15.2902 6.29322L13.7747 7.1682C13.8136 7.44014 13.8336 7.71794 13.8336 8.00014C13.8336 8.2824 13.8136 8.5602 13.7747 8.83214L15.2902 9.70714L13.1235 13.4599L11.6076 12.5847C11.1732 12.9269 10.6888 13.2089 10.167 13.4177V15.1668H5.83365V13.4177C5.3118 13.2089 4.82738 12.9269 4.39302 12.5847L2.87712 13.4599L0.710456 9.70714L2.22593 8.83214C2.18706 8.5602 2.16698 8.2824 2.16698 8.00014C2.16698 7.71794 2.18706 7.44014 2.22592 7.1682L0.710449 6.29322L2.87712 2.54044L4.39302 3.41565C4.82738 3.07344 5.31179 2.79149 5.83365 2.58261V0.833496H10.167V2.58261C10.6888 2.79149 11.1732 3.07344 11.6076 3.41565L13.1235 2.54044L15.2902 6.29322ZM8.00016 10.3333C9.28883 10.3333 10.3335 9.28867 10.3335 8C10.3335 6.71134 9.28883 5.66667 8.00016 5.66667C6.7115 5.66667 5.66683 6.71134 5.66683 8C5.66683 9.28867 6.7115 10.3333 8.00016 10.3333Z" fill="#6B7280"/>
<path fill-rule="evenodd" clip-rule="evenodd" d="M15.2902 6.29322L13.7747 7.1682C13.8136 7.44014 13.8336 7.71794 13.8336 8.00014C13.8336 8.2824 13.8136 8.5602 13.7747 8.83214L15.2902 9.70714L13.1235 13.4599L11.6076 12.5847C11.1732 12.9269 10.6888 13.2089 10.167 13.4177V15.1668H5.83365V13.4177C5.3118 13.2089 4.82738 12.9269 4.39302 12.5847L2.87712 13.4599L0.710456 9.70714L2.22593 8.83214C2.18706 8.5602 2.16698 8.2824 2.16698 8.00014C2.16698 7.71794 2.18706 7.44014 2.22592 7.1682L0.710449 6.29322L2.87712 2.54044L4.39302 3.41565C4.82738 3.07344 5.31179 2.79149 5.83365 2.58261V0.833496H10.167V2.58261C10.6888 2.79149 11.1732 3.07344 11.6076 3.41565L13.1235 2.54044L15.2902 6.29322ZM8.00016 10.3333C9.28883 10.3333 10.3335 9.28867 10.3335 8C10.3335 6.71134 9.28883 5.66667 8.00016 5.66667C6.7115 5.66667 5.66683 6.71134 5.66683 8C5.66683 9.28867 6.7115 10.3333 8.00016 10.3333Z" fill="white" fill-opacity="0.5"/>
</svg>

After

Width:  |  Height:  |  Size: 1.9 KiB

View File

@ -0,0 +1 @@
<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 36 36"><circle fill="#FFCC4D" cx="18" cy="18" r="18"/><path fill="#664500" d="M10.515 23.621C10.56 23.8 11.683 28 18 28c6.318 0 7.44-4.2 7.485-4.379.055-.217-.043-.442-.237-.554-.195-.111-.439-.078-.6.077C24.629 23.163 22.694 25 18 25s-6.63-1.837-6.648-1.855C11.256 23.05 11.128 23 11 23c-.084 0-.169.021-.246.064-.196.112-.294.339-.239.557z"/><ellipse fill="#664500" cx="12" cy="13.5" rx="2.5" ry="3.5"/><ellipse fill="#664500" cx="24" cy="13.5" rx="2.5" ry="3.5"/></svg>

After

Width:  |  Height:  |  Size: 526 B

View File

@ -0,0 +1,10 @@
<svg width="22" height="23" viewBox="0 0 22 23" fill="none" xmlns="http://www.w3.org/2000/svg">
<g clip-path="url(#clip0_223_5284)">
<path d="M18.5 5.66211L11 1.33198V9.99224L18.5 5.66211ZM2 16.6621L9.5 20.9922V12.332L2 16.6621ZM1.75 11.1621C1.75 8.53876 3.87665 6.41211 6.5 6.41211V4.91211C3.04822 4.91211 0.25 7.71033 0.25 11.1621H1.75ZM19.25 11.1621C19.25 13.7855 17.1234 15.9121 14.5 15.9121V17.4121C17.9518 17.4121 20.75 14.6139 20.75 11.1621H19.25ZM6.5 6.41211H11.75V4.91211H6.5V6.41211ZM20.75 11.1621V8.16211H19.25V11.1621H20.75ZM0.25 11.1621V13.6621H1.75V11.1621H0.25ZM14.5 15.9121H10.5V17.4121H14.5V15.9121ZM10.5 15.9121H8.75V17.4121H10.5V15.9121Z" fill="#2794DA"/>
</g>
<defs>
<clipPath id="clip0_223_5284">
<rect width="22" height="22" fill="white" transform="translate(0 0.5)"/>
</clipPath>
</defs>
</svg>

After

Width:  |  Height:  |  Size: 818 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 10 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 8.8 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 11 KiB

View File

@ -0,0 +1,24 @@
<?xml version="1.0" encoding="utf-8"?>
<!-- Generator: Adobe Illustrator 24.0.3, SVG Export Plug-In . SVG Version: 6.00 Build 0) -->
<svg version="1.1" id="Layer_1" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" x="0px" y="0px"
viewBox="0 0 468 222.5" style="enable-background:new 0 0 468 222.5;" xml:space="preserve">
<style type="text/css">
.st0{fill-rule:evenodd;clip-rule:evenodd;fill:#635BFF;}
</style>
<g>
<path class="st0" d="M414,113.4c0-25.6-12.4-45.8-36.1-45.8c-23.8,0-38.2,20.2-38.2,45.6c0,30.1,17,45.3,41.4,45.3
c11.9,0,20.9-2.7,27.7-6.5v-20c-6.8,3.4-14.6,5.5-24.5,5.5c-9.7,0-18.3-3.4-19.4-15.2h48.9C413.8,121,414,115.8,414,113.4z
M364.6,103.9c0-11.3,6.9-16,13.2-16c6.1,0,12.6,4.7,12.6,16H364.6z"/>
<path class="st0" d="M301.1,67.6c-9.8,0-16.1,4.6-19.6,7.8l-1.3-6.2h-22v116.6l25-5.3l0.1-28.3c3.6,2.6,8.9,6.3,17.7,6.3
c17.9,0,34.2-14.4,34.2-46.1C335.1,83.4,318.6,67.6,301.1,67.6z M295.1,136.5c-5.9,0-9.4-2.1-11.8-4.7l-0.1-37.1
c2.6-2.9,6.2-4.9,11.9-4.9c9.1,0,15.4,10.2,15.4,23.3C310.5,126.5,304.3,136.5,295.1,136.5z"/>
<polygon class="st0" points="223.8,61.7 248.9,56.3 248.9,36 223.8,41.3 "/>
<rect x="223.8" y="69.3" class="st0" width="25.1" height="87.5"/>
<path class="st0" d="M196.9,76.7l-1.6-7.4h-21.6v87.5h25V97.5c5.9-7.7,15.9-6.3,19-5.2v-23C214.5,68.1,202.8,65.9,196.9,76.7z"/>
<path class="st0" d="M146.9,47.6l-24.4,5.2l-0.1,80.1c0,14.8,11.1,25.7,25.9,25.7c8.2,0,14.2-1.5,17.5-3.3V135
c-3.2,1.3-19,5.9-19-8.9V90.6h19V69.3h-19L146.9,47.6z"/>
<path class="st0" d="M79.3,94.7c0-3.9,3.2-5.4,8.5-5.4c7.6,0,17.2,2.3,24.8,6.4V72.2c-8.3-3.3-16.5-4.6-24.8-4.6
C67.5,67.6,54,78.2,54,95.9c0,27.6,38,23.2,38,35.1c0,4.6-4,6.1-9.6,6.1c-8.3,0-18.9-3.4-27.3-8v23.8c9.3,4,18.7,5.7,27.3,5.7
c20.8,0,35.1-10.3,35.1-28.2C117.4,100.6,79.3,105.9,79.3,94.7z"/>
</g>
</svg>

After

Width:  |  Height:  |  Size: 1.8 KiB

View File

@ -1,9 +0,0 @@
/* global jQuery */
jQuery( document ).ready( function( $ ) {
$( '.edd-advanced-filters-button' ).on( 'click', function( e ) {
e.preventDefault();
$( this ).closest( '#edd-advanced-filters' ).toggleClass( 'open' );
} );
} );

View File

@ -1,147 +0,0 @@
/* global _ */
/**
* Internal dependencies.
*/
import { getChosenVars } from 'utils/chosen.js';
jQuery( document ).ready( function( $ ) {
// Globally apply to elements on the page.
$( '.edd-select-chosen' ).each( function() {
const el = $( this );
el.chosen( getChosenVars( el ) );
} );
$( '.edd-select-chosen .chosen-search input' ).each( function() {
// Bail if placeholder already set
if ( $( this ).attr( 'placeholder' ) ) {
return;
}
const selectElem = $( this ).parent().parent().parent().prev( 'select.edd-select-chosen' ),
placeholder = selectElem.data( 'search-placeholder' );
if ( placeholder ) {
$( this ).attr( 'placeholder', placeholder );
}
} );
// Add placeholders for Chosen input fields
$( '.chosen-choices' ).on( 'click', function() {
let placeholder = $( this ).parent().prev().data( 'search-placeholder' );
if ( typeof placeholder === 'undefined' ) {
placeholder = edd_vars.type_to_search;
}
$( this ).children( 'li' ).children( 'input' ).attr( 'placeholder', placeholder );
} );
// This fixes the Chosen box being 0px wide when the thickbox is opened
$( '#post' ).on( 'click', '.edd-thickbox', function() {
$( '.edd-select-chosen', '#choose-download' ).css( 'width', '100%' );
} );
// Variables for setting up the typing timer
// Time in ms, Slow - 521ms, Moderate - 342ms, Fast - 300ms
let userInteractionInterval = 342,
typingTimerElements = '.edd-select-chosen .chosen-search input, .edd-select-chosen .search-field input',
typingTimer;
// Replace options with search results
$( document.body ).on( 'keyup', typingTimerElements, _.debounce( function( e ) {
let element = $( this ),
val = element.val(),
container = element.closest( '.edd-select-chosen' ),
select = container.prev(),
select_type = select.data( 'search-type' ),
no_bundles = container.hasClass( 'no-bundles' ),
variations = container.hasClass( 'variations' ),
variations_only = container.hasClass( 'variations-only' ),
lastKey = e.which,
search_type = 'edd_download_search';
// String replace the chosen container IDs
container.attr( 'id' ).replace( '_chosen', '' );
// Detect if we have a defined search type, otherwise default to downloads
if ( typeof select_type !== 'undefined' ) {
// Don't trigger AJAX if this select has all options loaded
if ( 'no_ajax' === select_type ) {
return;
}
search_type = 'edd_' + select_type + '_search';
} else {
return;
}
// Don't fire if short or is a modifier key (shift, ctrl, apple command key, or arrow keys)
if (
( val.length <= 3 && 'edd_download_search' === search_type ) ||
(
lastKey === 16 ||
lastKey === 13 ||
lastKey === 91 ||
lastKey === 17 ||
lastKey === 37 ||
lastKey === 38 ||
lastKey === 39 ||
lastKey === 40
)
) {
container.children( '.spinner' ).remove();
return;
}
// Maybe append a spinner
if ( ! container.children( '.spinner' ).length ) {
container.append( '<span class="spinner is-active"></span>' );
}
$.ajax( {
type: 'GET',
dataType: 'json',
url: ajaxurl,
data: {
s: val,
action: search_type,
no_bundles: no_bundles,
variations: variations,
variations_only: variations_only,
},
beforeSend: function() {
select.closest( 'ul.chosen-results' ).empty();
},
success: function( data ) {
// Remove all options but those that are selected
$( 'option:not(:selected)', select ).remove();
// Add any option that doesn't already exist
$.each( data, function( key, item ) {
if ( ! $( 'option[value="' + item.id + '"]', select ).length ) {
select.prepend( '<option value="' + item.id + '">' + item.name + '</option>' );
}
} );
// Get the text immediately before triggering an update.
// Any sooner will cause the text to jump around.
const val = element.val();
// Update the options
select.trigger( 'chosen:updated' );
element.val( val );
},
} ).fail( function( response ) {
if ( window.console && window.console.log ) {
console.log( response );
}
} ).done( function( response ) {
container.children( '.spinner' ).remove();
} );
}, userInteractionInterval ) );
} );

View File

@ -1,26 +0,0 @@
/**
* Date picker
*
* This juggles a few CSS classes to avoid styling collisions with other
* third-party plugins.
*/
jQuery( document ).ready( function( $ ) {
const edd_datepicker = $( 'input.edd_datepicker' );
if ( edd_datepicker.length > 0 ) {
edd_datepicker
// Disable autocomplete to avoid it covering the calendar
.attr( 'autocomplete', 'off' )
// Invoke the datepickers
.datepicker( {
dateFormat: edd_vars.date_picker_format,
beforeShow: function() {
$( '#ui-datepicker-div' )
.removeClass( 'ui-datepicker' )
.addClass( 'edd-datepicker' );
},
} );
}
} );

View File

@ -1,23 +0,0 @@
jQuery( document ).ready( function ( $ ) {
$( '.edd_countries_filter' ).on( 'change', function () {
const select = $( this ),
data = {
action: 'edd_get_shop_states',
country: select.val(),
nonce: select.data( 'nonce' ),
field_name: 'edd_regions_filter',
};
$.post( ajaxurl, data, function ( response ) {
$( 'select.edd_regions_filter' ).find( 'option:gt(0)' ).remove();
if ( 'nostates' !== response ) {
$( response ).find( 'option:gt(0)' ).appendTo( 'select.edd_regions_filter' );
}
$( 'select.edd_regions_filter' ).trigger( 'chosen:updated' );
} );
return false;
} );
} );

View File

@ -1,125 +0,0 @@
/* global edd_vars */
document.addEventListener( 'alpine:init', () => {
Alpine.store( 'eddNotifications', {
isPanelOpen: false,
notificationsLoaded: false,
numberActiveNotifications: 0,
activeNotifications: [],
inactiveNotifications: [],
init: function() {
const eddNotifications = this;
/*
* The bubble starts out hidden until AlpineJS is initialized. Once it is, we remove
* the hidden class. This prevents a flash of the bubble's visibility in the event that there
* are no notifications.
*/
const notificationCountBubble = document.querySelector( '#edd-notification-button .edd-number' );
if ( notificationCountBubble ) {
notificationCountBubble.classList.remove( 'edd-hidden' );
}
document.addEventListener( 'keydown', function( e ) {
if ( e.key === 'Escape' ) {
eddNotifications.closePanel();
}
} );
const params = new URLSearchParams( window.location.search );
const triggerNotifications = params.has( 'notifications' );
if ( triggerNotifications && 'true' === params.get( 'notifications' ) ) {
eddNotifications.openPanel();
}
},
openPanel: function() {
const panelHeader = document.getElementById( 'edd-notifications-header' );
if ( this.notificationsLoaded ) {
this.isPanelOpen = true;
if ( panelHeader ) {
setTimeout( function() {
panelHeader.focus();
} );
}
return;
}
this.isPanelOpen = true;
this.apiRequest( '/notifications', 'GET' )
.then( data => {
this.activeNotifications = data.active;
this.inactiveNotifications = data.dismissed;
this.notificationsLoaded = true;
if ( panelHeader ) {
panelHeader.focus();
}
} )
.catch( error => {
console.log( 'Notification error', error );
} );
},
closePanel: function() {
if ( ! this.isPanelOpen ) {
return;
}
this.isPanelOpen = false;
const notificationButton = document.getElementById( 'edd-notification-button' );
if ( notificationButton ) {
notificationButton.focus();
}
},
apiRequest: function( endpoint, method ) {
return fetch( edd_vars.restBase + endpoint, {
method: method,
credentials: 'same-origin',
headers: {
'Content-Type': 'application/json',
'X-WP-Nonce': edd_vars.restNonce
}
} ).then( response => {
if ( ! response.ok ) {
return Promise.reject( response );
}
/*
* Returning response.text() instead of response.json() because dismissing
* a notification doesn't return a JSON response, so response.json() will break.
*/
return response.text();
//return response.json();
} ).then( data => {
return data ? JSON.parse( data ) : null;
} );
} ,
dismiss: function( event, index ) {
if ( 'undefined' === typeof this.activeNotifications[ index ] ) {
return;
}
event.target.disabled = true;
const notification = this.activeNotifications[ index ];
this.apiRequest( '/notifications/' + notification.id, 'DELETE' )
.then( response => {
this.activeNotifications.splice( index, 1 );
this.numberActiveNotifications = this.activeNotifications.length;
} )
.catch( error => {
console.log( 'Dismiss error', error );
} );
}
} );
} );

View File

@ -1,42 +0,0 @@
/* global ajaxurl */
jQuery( document ).ready( function( $ ) {
/**
* Display notices
*/
const topOfPageNotice = $( '.edd-admin-notice-top-of-page' );
if ( topOfPageNotice ) {
const topOfPageNoticeEl = topOfPageNotice.detach();
$( '#wpbody-content' ).prepend( topOfPageNoticeEl );
topOfPageNotice.delay( 1000 ).slideDown();
}
/**
* Dismiss notices
*/
$( '.edd-promo-notice' ).each( function() {
const notice = $( this );
notice.on( 'click', '.edd-promo-notice-dismiss', function( e ) {
// Only prevent default behavior for buttons, not links.
if ( ! $( this ).attr( 'href' ) ) {
e.preventDefault();
}
$.ajax( {
type: 'POST',
data: {
action: 'edd_dismiss_promo_notice',
notice_id: notice.data( 'id' ),
nonce: notice.data( 'nonce' ),
lifespan: notice.data( 'lifespan' )
},
url: ajaxurl,
success: function( response ) {
notice.slideUp();
}
} );
} );
} );
} );

View File

@ -1,34 +0,0 @@
/**
* Sortables
*
* This makes certain settings sortable, and attempts to stash the results
* in the nearest .edd-order input value.
*/
jQuery( document ).ready( function( $ ) {
const edd_sortables = $( 'ul.edd-sortable-list' );
if ( edd_sortables.length > 0 ) {
edd_sortables.sortable( {
axis: 'y',
items: 'li',
cursor: 'move',
tolerance: 'pointer',
containment: 'parent',
distance: 2,
opacity: 0.7,
scroll: true,
/**
* When sorting stops, assign the value to the previous input.
* This input should be a hidden text field
*/
stop: function() {
const keys = $.map( $( this ).children( 'li' ), function( el ) {
return $( el ).data( 'key' );
} );
$( this ).prev( 'input.edd-order' ).val( keys );
},
} );
}
} );

View File

@ -1,7 +0,0 @@
/* global jQuery */
jQuery( document ).ready( function ( $ ) {
if ( $( 'body' ).hasClass( 'taxonomy-download_category' ) || $( 'body' ).hasClass( 'taxonomy-download_tag' ) ) {
$( '.nav-tab-wrapper, .nav-tab-wrapper + br' ).detach().insertAfter( '.wp-header-end' );
}
} );

View File

@ -1,28 +0,0 @@
/**
* Attach tooltips
*
* @param {string} selector
*/
export const edd_attach_tooltips = function( selector ) {
selector.tooltip( {
content: function() {
return $( this ).prop( 'title' );
},
tooltipClass: 'edd-ui-tooltip',
position: {
my: 'center top',
at: 'center bottom+10',
collision: 'flipfit',
},
hide: {
duration: 200,
},
show: {
duration: 200,
},
} );
};
jQuery( document ).ready( function( $ ) {
edd_attach_tooltips( $( '.edd-help-tip' ) );
} );

View File

@ -1,74 +0,0 @@
jQuery( document ).ready( function( $ ) {
// AJAX user search
$( '.edd-ajax-user-search' )
// Search
.keyup( function() {
let user_search = $( this ).val(),
exclude = '';
if ( $( this ).data( 'exclude' ) ) {
exclude = $( this ).data( 'exclude' );
}
$( '.edd_user_search_wrap' ).addClass( 'loading' );
const data = {
action: 'edd_search_users',
user_name: user_search,
exclude: exclude,
};
$.ajax( {
type: 'POST',
data: data,
dataType: 'json',
url: ajaxurl,
success: function( search_response ) {
$( '.edd_user_search_wrap' ).removeClass( 'loading' );
$( '.edd_user_search_results' ).removeClass( 'hidden' );
$( '.edd_user_search_results span' ).html( '' );
if ( search_response.results ) {
$( search_response.results ).appendTo( '.edd_user_search_results span' );
}
},
} );
} )
// Hide
.blur( function() {
if ( edd_user_search_mouse_down ) {
edd_user_search_mouse_down = false;
} else {
$( this ).removeClass( 'loading' );
$( '.edd_user_search_results' ).addClass( 'hidden' );
}
} )
// Show
.focus( function() {
$( this ).keyup();
} );
$( document.body ).on( 'click.eddSelectUser', '.edd_user_search_results span a', function( e ) {
e.preventDefault();
const login = $( this ).data( 'login' );
$( '.edd-ajax-user-search' ).val( login );
$( '.edd_user_search_results' ).addClass( 'hidden' );
$( '.edd_user_search_results span' ).html( '' );
} );
$( document.body ).on( 'click.eddCancelUserSearch', '.edd_user_search_results a.edd-ajax-user-cancel', function( e ) {
e.preventDefault();
$( '.edd-ajax-user-search' ).val( '' );
$( '.edd_user_search_results' ).addClass( 'hidden' );
$( '.edd_user_search_results span' ).html( '' );
} );
// Cancel user-search.blur when picking a user
var edd_user_search_mouse_down = false;
$( '.edd_user_search_results' ).mousedown( function() {
edd_user_search_mouse_down = true;
} );
} );

View File

@ -1,61 +0,0 @@
jQuery( document ).ready( function( $ ) {
const sectionSelector = '.edd-vertical-sections.use-js';
// If the current screen doesn't have JS sections, return.
if ( 0 === $( sectionSelector ).length ) {
return;
}
// Hides the section content.
$( `${ sectionSelector } .section-content` ).hide();
const hash = window.location.hash;
if ( hash && hash.includes( 'edd_' ) ) {
// Show the section content related to the URL.
$( sectionSelector ).find( hash ).show();
// Set the aria-selected for section titles to be false
$( `${ sectionSelector } .section-title` ).attr( 'aria-selected', 'false' ).removeClass( 'section-title--is-active' );
// Set aria-selected true on the related link.
$( sectionSelector ).find( '.section-title a[href="' + hash + '"]' ).parents( '.section-title' ).attr( 'aria-selected', 'true' ).addClass( 'section-title--is-active' );
} else {
// Shows the first section's content.
$( `${ sectionSelector } .section-content:first-child` ).show();
// Makes the 'aria-selected' attribute true for the first section nav item.
$( `${ sectionSelector } .section-nav li:first-child` ).attr( 'aria-selected', 'true' ).addClass( 'section-title--is-active' );
}
// When a section nav item is clicked.
$( `${ sectionSelector } .section-nav li a` ).on( 'click',
function( j ) {
// Prevent the default browser action when a link is clicked.
j.preventDefault();
// Get the `href` attribute of the item.
const them = $( this ),
href = them.attr( 'href' ),
rents = them.parents( '.edd-vertical-sections' );
// Hide all section content.
rents.find( '.section-content' ).hide();
// Find the section content that matches the section nav item and show it.
rents.find( href ).show();
// Set the `aria-selected` attribute to false for all section nav items.
rents.find( '.section-title' ).attr( 'aria-selected', 'false' ).removeClass( 'section-title--is-active' );
// Set the `aria-selected` attribute to true for this section nav item.
them.parent().attr( 'aria-selected', 'true' ).addClass( 'section-title--is-active' );
// Maybe re-Chosen
rents.find( 'div.chosen-container' ).css( 'width', '100%' );
// Add the current "link" to the page URL
window.history.pushState( 'object or string', '', href );
}
); // click()
} );

View File

@ -1,140 +0,0 @@
/**
* Customer management screen JS
*/
var EDD_Customer = {
vars: {
customer_card_wrap_editable: $( '#edit-customer-info .editable' ),
customer_card_wrap_edit_item: $( '#edit-customer-info .edit-item' ),
user_id: $( 'input[name="customerinfo[user_id]"]' ),
},
init: function() {
this.edit_customer();
this.add_email();
this.user_search();
this.remove_user();
this.cancel_edit();
this.change_country();
this.delete_checked();
},
edit_customer: function() {
$( document.body ).on( 'click', '#edit-customer', function( e ) {
e.preventDefault();
EDD_Customer.vars.customer_card_wrap_editable.hide();
EDD_Customer.vars.customer_card_wrap_edit_item.show().css( 'display', 'block' );
} );
},
add_email: function() {
$( document.body ).on( 'click', '#add-customer-email', function( e ) {
e.preventDefault();
const button = $( this ),
wrapper = button.parent().parent().parent().parent(),
customer_id = wrapper.find( 'input[name="customer-id"]' ).val(),
email = wrapper.find( 'input[name="additional-email"]' ).val(),
primary = wrapper.find( 'input[name="make-additional-primary"]' ).is( ':checked' ),
nonce = wrapper.find( 'input[name="add_email_nonce"]' ).val(),
postData = {
edd_action: 'customer-add-email',
customer_id: customer_id,
email: email,
primary: primary,
_wpnonce: nonce,
};
wrapper.parent().find( '.notice-container' ).remove();
wrapper.find( '.spinner' ).css( 'visibility', 'visible' );
button.attr( 'disabled', true );
$.post( ajaxurl, postData, function( response ) {
setTimeout( function() {
if ( true === response.success ) {
window.location.href = response.redirect;
} else {
button.attr( 'disabled', false );
wrapper.before( '<div class="notice-container"><div class="notice notice-error inline"><p>' + response.message + '</p></div></div>' );
wrapper.find( '.spinner' ).css( 'visibility', 'hidden' );
}
}, 342 );
}, 'json' );
} );
},
user_search: function() {
// Upon selecting a user from the dropdown, we need to update the User ID
$( document.body ).on( 'click.eddSelectUser', '.edd_user_search_results a', function( e ) {
e.preventDefault();
const user_id = $( this ).data( 'userid' );
EDD_Customer.vars.user_id.val( user_id );
} );
},
remove_user: function() {
$( document.body ).on( 'click', '#disconnect-customer', function( e ) {
e.preventDefault();
if ( confirm( edd_vars.disconnect_customer ) ) {
const customer_id = $( 'input[name="customerinfo[id]"]' ).val(),
postData = {
edd_action: 'disconnect-userid',
customer_id: customer_id,
_wpnonce: $( '#edit-customer-info #_wpnonce' ).val(),
};
$.post( ajaxurl, postData, function( response ) {
// Weird
window.location.href = window.location.href;
}, 'json' );
}
} );
},
cancel_edit: function() {
$( document.body ).on( 'click', '#edd-edit-customer-cancel', function( e ) {
e.preventDefault();
EDD_Customer.vars.customer_card_wrap_edit_item.hide();
EDD_Customer.vars.customer_card_wrap_editable.show();
$( '.edd_user_search_results' ).html( '' );
} );
},
change_country: function() {
$( 'select[name="customerinfo[country]"]' ).change( function() {
const select = $( this ),
state_input = $( ':input[name="customerinfo[region]"]' ),
data = {
action: 'edd_get_shop_states',
country: select.val(),
nonce: select.data( 'nonce' ),
field_name: 'customerinfo[region]',
};
$.post( ajaxurl, data, function( response ) {
console.log( response );
if ( 'nostates' === response ) {
state_input.replaceWith( '<input type="text" name="' + data.field_name + '" value="" class="edd-edit-toggles medium-text"/>' );
} else {
state_input.replaceWith( response );
}
} );
return false;
} );
},
delete_checked: function() {
$( '#edd-customer-delete-confirm' ).change( function() {
const records_input = $( '#edd-customer-delete-records' );
const submit_button = $( '#edd-delete-customer' );
if ( $( this ).prop( 'checked' ) ) {
records_input.attr( 'disabled', false );
submit_button.attr( 'disabled', false );
} else {
records_input.attr( 'disabled', true );
records_input.prop( 'checked', false );
submit_button.attr( 'disabled', true );
}
} );
},
};
jQuery( document ).ready( function( $ ) {
EDD_Customer.init();
} );

View File

@ -1,14 +0,0 @@
jQuery( document ).ready( function( $ ) {
if ( $( '#edd_dashboard_sales' ).length ) {
$.ajax( {
type: 'GET',
data: {
action: 'edd_load_dashboard_widget',
},
url: ajaxurl,
success: function( response ) {
$( '#edd_dashboard_sales .edd-loading' ).html( response );
},
} );
}
} );

View File

@ -1,21 +0,0 @@
/**
* Internal dependencies.
*/
import { jQueryReady } from 'utils/jquery.js';
/**
* DOM ready.
*/
jQueryReady( () => {
const products = $( '#edd_products' );
if ( ! products ) {
return;
}
/**
* Show/hide conditions based on input value.
*/
products.change( function() {
$( '#edd-discount-product-conditions' ).toggle( null !== products.val() );
} );
} );

View File

@ -1,43 +0,0 @@
jQuery( document ).ready( function( $ ) {
$( 'body' ).on( 'click', '#the-list .editinline', function() {
let post_id = $( this ).closest( 'tr' ).attr( 'id' );
post_id = post_id.replace( 'post-', '' );
const $edd_inline_data = $( '#post-' + post_id );
const regprice = $edd_inline_data.find( '.column-price .downloadprice-' + post_id ).val();
// If variable priced product disable editing, otherwise allow price changes
if ( regprice !== $( '#post-' + post_id + '.column-price .downloadprice-' + post_id ).val() ) {
$( '.regprice', '#edd-download-data' ).val( regprice ).attr( 'disabled', false );
} else {
$( '.regprice', '#edd-download-data' ).val( edd_vars.quick_edit_warning ).attr( 'disabled', 'disabled' );
}
} );
// Bulk edit save
$( document.body ).on( 'click', '#bulk_edit', function() {
// define the bulk edit row
const $bulk_row = $( '#bulk-edit' );
// get the selected post ids that are being edited
const $post_ids = new Array();
$bulk_row.find( '#bulk-titles' ).children().each( function() {
$post_ids.push( $( this ).attr( 'id' ).replace( /^(ttle)/i, '' ) );
} );
// get the stock and price values to save for all the product ID's
const $price = $( '#edd-download-data input[name="_edd_regprice"]' ).val();
const data = {
action: 'edd_save_bulk_edit',
edd_bulk_nonce: $post_ids,
post_ids: $post_ids,
price: $price,
};
// save the data
$.post( ajaxurl, data );
} );
} );

View File

@ -1,409 +0,0 @@
/**
* Internal dependencies.
*/
import { getChosenVars } from 'utils/chosen.js';
import { edd_attach_tooltips } from 'admin/components/tooltips';
import './bulk-edit.js';
/**
* Download Configuration Metabox
*/
var EDD_Download_Configuration = {
init: function() {
this.add();
this.move();
this.remove();
this.type();
this.prices();
this.files();
this.updatePrices();
this.showAdvanced();
},
clone_repeatable: function( row ) {
// Retrieve the highest current key
let key = 1;
let highest = 1;
row.parent().find( '.edd_repeatable_row' ).each( function() {
const current = $( this ).data( 'key' );
if ( parseInt( current ) > highest ) {
highest = current;
}
} );
key = highest += 1;
const clone = row.clone();
clone.removeClass( 'edd_add_blank' );
clone.attr( 'data-key', key );
clone.find( 'input, select, textarea' ).val( '' ).each( function() {
let elem = $( this ),
name = elem.attr( 'name' ),
id = elem.attr( 'id' );
if ( name ) {
name = name.replace( /\[(\d+)\]/, '[' + parseInt( key ) + ']' );
elem.attr( 'name', name );
}
elem.attr( 'data-key', key );
if ( typeof id !== 'undefined' ) {
id = id.replace( /(\d+)/, parseInt( key ) );
elem.attr( 'id', id );
}
} );
/** manually update any select box values */
clone.find( 'select' ).each( function() {
$( this ).val( row.find( 'select[name="' + $( this ).attr( 'name' ) + '"]' ).val() );
} );
/** manually uncheck any checkboxes */
clone.find( 'input[type="checkbox"]' ).each( function() {
// Make sure checkboxes are unchecked when cloned
const checked = $( this ).is( ':checked' );
if ( checked ) {
$( this ).prop( 'checked', false );
}
// reset the value attribute to 1 in order to properly save the new checked state
$( this ).val( 1 );
} );
clone.find( 'span.edd_price_id' ).each( function() {
$( this ).text( parseInt( key ) );
} );
clone.find( 'input.edd_repeatable_index' ).each( function() {
$( this ).val( parseInt( $( this ).data( 'key' ) ) );
} );
clone.find( 'span.edd_file_id' ).each( function() {
$( this ).text( parseInt( key ) );
} );
clone.find( '.edd_repeatable_default_input' ).each( function() {
$( this ).val( parseInt( key ) ).removeAttr( 'checked' );
} );
clone.find( '.edd_repeatable_condition_field' ).each( function() {
$( this ).find( 'option:eq(0)' ).prop( 'selected', 'selected' );
} );
clone.find( 'label' ).each( function () {
var labelFor = $( this ).attr( 'for' );
if ( labelFor ) {
$( this ).attr( 'for', labelFor.replace( /(\d+)/, parseInt( key ) ) );
}
} );
// Remove Chosen elements
clone.find( '.search-choice' ).remove();
clone.find( '.chosen-container' ).remove();
edd_attach_tooltips( clone.find( '.edd-help-tip' ) );
return clone;
},
add: function() {
$( document.body ).on( 'click', '.edd_add_repeatable', function( e ) {
e.preventDefault();
const button = $( this ),
row = button.closest( '.edd_repeatable_table' ).find( '.edd_repeatable_row' ).last(),
clone = EDD_Download_Configuration.clone_repeatable( row );
clone.insertAfter( row ).find( 'input, textarea, select' ).filter( ':visible' ).eq( 0 ).focus();
// Setup chosen fields again if they exist
clone.find( '.edd-select-chosen' ).each( function() {
const el = $( this );
el.chosen( getChosenVars( el ) );
} );
clone.find( '.edd-select-chosen' ).css( 'width', '100%' );
clone.find( '.edd-select-chosen .chosen-search input' ).attr( 'placeholder', edd_vars.search_placeholder );
} );
},
move: function() {
$( '.edd_repeatable_table .edd-repeatables-wrap' ).sortable( {
axis: 'y',
handle: '.edd-draghandle-anchor',
items: '.edd_repeatable_row',
cursor: 'move',
tolerance: 'pointer',
containment: 'parent',
distance: 2,
opacity: 0.7,
scroll: true,
update: function() {
let count = 0;
$( this ).find( '.edd_repeatable_row' ).each( function() {
$( this ).find( 'input.edd_repeatable_index' ).each( function() {
$( this ).val( count );
} );
count++;
} );
},
start: function( e, ui ) {
ui.placeholder.height( ui.item.height() - 2 );
},
} );
},
remove: function() {
$( document.body ).on( 'click', '.edd-remove-row, .edd_remove_repeatable', function( e ) {
e.preventDefault();
let row = $( this ).parents( '.edd_repeatable_row' ),
count = row.parent().find( '.edd_repeatable_row' ).length,
type = $( this ).data( 'type' ),
repeatable = 'div.edd_repeatable_' + type + 's',
focusElement,
focusable,
firstFocusable;
// Set focus on next element if removing the first row. Otherwise set focus on previous element.
if ( $( this ).is( '.ui-sortable .edd_repeatable_row:first-child .edd-remove-row, .ui-sortable .edd_repeatable_row:first-child .edd_remove_repeatable' ) ) {
focusElement = row.next( '.edd_repeatable_row' );
} else {
focusElement = row.prev( '.edd_repeatable_row' );
}
focusable = focusElement.find( 'select, input, textarea, button' ).filter( ':visible' );
firstFocusable = focusable.eq( 0 );
if ( type === 'price' ) {
const price_row_id = row.data( 'key' );
/** remove from price condition */
$( '.edd_repeatable_condition_field option[value="' + price_row_id + '"]' ).remove();
}
if ( count > 1 ) {
$( 'input, select', row ).val( '' );
row.fadeOut( 'fast' ).remove();
firstFocusable.focus();
} else {
switch ( type ) {
case 'price' :
alert( edd_vars.one_price_min );
break;
case 'file' :
$( 'input, select', row ).val( '' );
break;
default:
alert( edd_vars.one_field_min );
break;
}
}
/* re-index after deleting */
$( repeatable ).each( function( rowIndex ) {
$( this ).find( 'input, select' ).each( function() {
let name = $( this ).attr( 'name' );
name = name.replace( /\[(\d+)\]/, '[' + rowIndex + ']' );
$( this ).attr( 'name', name ).attr( 'id', name );
} );
} );
} );
},
type: function() {
$( document.body ).on( 'change', '#_edd_product_type', function( e ) {
const edd_products = $( '#edd_products' ),
edd_download_files = $( '#edd_download_files' ),
edd_download_limit_wrap = $( '#edd_download_limit_wrap' );
if ( 'bundle' === $( this ).val() ) {
edd_products.show();
edd_download_files.hide();
edd_download_limit_wrap.hide();
} else {
edd_products.hide();
edd_download_files.show();
edd_download_limit_wrap.show();
}
} );
},
prices: function() {
$( document.body ).on( 'change', '#edd_variable_pricing', function( e ) {
const checked = $( this ).is( ':checked' ),
single = $( '#edd_regular_price_field' ),
variable = $( '#edd_variable_price_fields, .edd_repeatable_table .pricing' ),
bundleRow = $( '.edd-bundled-product-row, .edd-repeatable-row-standard-fields' );
if ( checked ) {
single.hide();
variable.show();
bundleRow.addClass( 'has-variable-pricing' );
} else {
single.show();
variable.hide();
bundleRow.removeClass( 'has-variable-pricing' );
}
} );
},
files: function() {
var file_frame;
window.formfield = '';
$( document.body ).on( 'click', '.edd_upload_file_button', function( e ) {
e.preventDefault();
const button = $( this );
window.formfield = button.closest( '.edd_repeatable_upload_wrapper' );
// If the media frame already exists, reopen it.
if ( file_frame ) {
file_frame.open();
return;
}
// Create the media frame.
file_frame = wp.media.frames.file_frame = wp.media( {
title: button.data( 'uploader-title' ),
frame: 'post',
state: 'insert',
button: { text: button.data( 'uploader-button-text' ) },
multiple: $( this ).data( 'multiple' ) === '0' ? false : true, // Set to true to allow multiple files to be selected
} );
file_frame.on( 'menu:render:default', function( view ) {
// Store our views in an object.
const views = {};
// Unset default menu items
view.unset( 'library-separator' );
view.unset( 'gallery' );
view.unset( 'featured-image' );
view.unset( 'embed' );
// Initialize the views in our view object.
view.set( views );
} );
// When an image is selected, run a callback.
file_frame.on( 'insert', function() {
const selection = file_frame.state().get( 'selection' );
selection.each( function( attachment, index ) {
attachment = attachment.toJSON();
let selectedSize = 'image' === attachment.type ? $( '.attachment-display-settings .size option:selected' ).val() : false,
selectedURL = attachment.url,
selectedName = attachment.title.length > 0 ? attachment.title : attachment.filename;
if ( selectedSize && typeof attachment.sizes[ selectedSize ] !== 'undefined' ) {
selectedURL = attachment.sizes[ selectedSize ].url;
}
if ( 'image' === attachment.type ) {
if ( selectedSize && typeof attachment.sizes[ selectedSize ] !== 'undefined' ) {
selectedName = selectedName + '-' + attachment.sizes[ selectedSize ].width + 'x' + attachment.sizes[ selectedSize ].height;
} else {
selectedName = selectedName + '-' + attachment.width + 'x' + attachment.height;
}
}
if ( 0 === index ) {
// place first attachment in field
window.formfield.find( '.edd_repeatable_attachment_id_field' ).val( attachment.id );
window.formfield.find( '.edd_repeatable_thumbnail_size_field' ).val( selectedSize );
window.formfield.find( '.edd_repeatable_upload_field' ).val( selectedURL );
window.formfield.find( '.edd_repeatable_name_field' ).val( selectedName );
} else {
// Create a new row for all additional attachments
const row = window.formfield,
clone = EDD_Download_Configuration.clone_repeatable( row );
clone.find( '.edd_repeatable_attachment_id_field' ).val( attachment.id );
clone.find( '.edd_repeatable_thumbnail_size_field' ).val( selectedSize );
clone.find( '.edd_repeatable_upload_field' ).val( selectedURL );
clone.find( '.edd_repeatable_name_field' ).val( selectedName );
clone.insertAfter( row );
}
} );
} );
// Finally, open the modal
file_frame.open();
} );
// @todo Break this out and remove jQuery.
$( '.edd_repeatable_upload_field' )
.on( 'focus', function() {
const input = $( this );
input.data( 'originalFile', input.val() );
} )
.on( 'change', function() {
const input = $( this );
const originalFile = input.data( 'originalFile' );
if ( originalFile !== input.val() ) {
input
.closest( '.edd-repeatable-row-standard-fields' )
.find( '.edd_repeatable_attachment_id_field' )
.val( 0 );
}
} );
var file_frame;
window.formfield = '';
},
updatePrices: function() {
$( '#edd_price_fields' ).on( 'keyup', '.edd_variable_prices_name', function() {
const key = $( this ).parents( '.edd_repeatable_row' ).data( 'key' ),
name = $( this ).val(),
field_option = $( '.edd_repeatable_condition_field option[value=' + key + ']' );
if ( field_option.length > 0 ) {
field_option.text( name );
} else {
$( '.edd_repeatable_condition_field' ).append(
$( '<option></option>' )
.attr( 'value', key )
.text( name )
);
}
} );
},
showAdvanced: function() {
// Toggle display of entire custom settings section for a price option
$( document.body ).on( 'click', '.toggle-custom-price-option-section', function( e ) {
e.preventDefault();
const toggle = $( this ),
show = toggle.html() === edd_vars.show_advanced_settings ?
true :
false;
if ( show ) {
toggle.html( edd_vars.hide_advanced_settings );
} else {
toggle.html( edd_vars.show_advanced_settings );
}
const header = toggle.parents( '.edd-repeatable-row-header' );
header.siblings( '.edd-custom-price-option-sections-wrap' ).slideToggle();
let first_input;
if ( show ) {
first_input = $( ':input:not(input[type=button],input[type=submit],button):visible:first', header.siblings( '.edd-custom-price-option-sections-wrap' ) );
} else {
first_input = $( ':input:not(input[type=button],input[type=submit],button):visible:first', header.siblings( '.edd-repeatable-row-standard-fields' ) );
}
first_input.focus();
} );
}
};
jQuery( document ).ready( function( $ ) {
EDD_Download_Configuration.init();
} );

View File

@ -1,16 +0,0 @@
/**
* Internal dependencies.
*/
import './components/date-picker';
import './components/chosen';
import './components/tooltips';
import './components/vertical-sections';
import './components/sortable-list';
import './components/user-search';
import './components/advanced-filters';
import './components/taxonomies';
import './components/location';
import './components/promos';
import './components/notifications';
// Note: This is not common across all admin pages and at some point this code will be moved to a new file that only loads on the orders table page.
import './orders/list-table';

View File

@ -1,134 +0,0 @@
/**
* Notes
*/
const EDD_Notes = {
init: function() {
this.enter_key();
this.add_note();
this.remove_note();
},
enter_key: function() {
$( document.body ).on( 'keydown', '#edd-note', function( e ) {
if ( e.keyCode === 13 && ( e.metaKey || e.ctrlKey ) ) {
e.preventDefault();
$( '#edd-add-note' ).click();
}
} );
},
/**
* Ajax handler for adding new notes
*
* @since 3.0
*/
add_note: function() {
$( '#edd-add-note' ).on( 'click', function( e ) {
e.preventDefault();
const edd_button = $( this ),
edd_note = $( '#edd-note' ),
edd_notes = $( '.edd-notes' ),
edd_no_notes = $( '.edd-no-notes' ),
edd_spinner = $( '.edd-add-note .spinner' ),
edd_note_nonce = $( '#edd_note_nonce' );
const postData = {
action: 'edd_add_note',
nonce: edd_note_nonce.val(),
object_id: edd_button.data( 'object-id' ),
object_type: edd_button.data( 'object-type' ),
note: edd_note.val(),
};
if ( postData.note ) {
edd_button.prop( 'disabled', true );
edd_spinner.css( 'visibility', 'visible' );
$.ajax( {
type: 'POST',
data: postData,
url: ajaxurl,
success: function( response ) {
let res = wpAjax.parseAjaxResponse( response );
res = res.responses[ 0 ];
edd_notes.append( res.data );
edd_no_notes.hide();
edd_button.prop( 'disabled', false );
edd_spinner.css( 'visibility', 'hidden' );
edd_note.val( '' );
},
} ).fail( function( data ) {
if ( window.console && window.console.log ) {
console.log( data );
}
edd_button.prop( 'disabled', false );
edd_spinner.css( 'visibility', 'hidden' );
} );
} else {
const border_color = edd_note.css( 'border-color' );
edd_note.css( 'border-color', 'red' );
setTimeout( function() {
edd_note.css( 'border-color', border_color );
}, userInteractionInterval );
}
} );
},
/**
* Ajax handler for deleting existing notes
*
* @since 3.0
*/
remove_note: function() {
$( document.body ).on( 'click', '.edd-delete-note', function( e ) {
e.preventDefault();
const edd_link = $( this ),
edd_notes = $( '.edd-note' ),
edd_note = edd_link.parents( '.edd-note' ),
edd_no_notes = $( '.edd-no-notes' ),
edd_note_nonce = $( '#edd_note_nonce' );
if ( confirm( edd_vars.delete_note ) ) {
const postData = {
action: 'edd_delete_note',
nonce: edd_note_nonce.val(),
note_id: edd_link.data( 'note-id' ),
};
edd_note.addClass( 'deleting' );
$.ajax( {
type: 'POST',
data: postData,
url: ajaxurl,
success: function( response ) {
if ( '1' === response ) {
edd_note.remove();
}
if ( edd_notes.length === 1 ) {
edd_no_notes.show();
}
return false;
},
} ).fail( function( data ) {
if ( window.console && window.console.log ) {
console.log( data );
}
edd_note.removeClass( 'deleting' );
} );
return true;
}
} );
},
};
jQuery( document ).ready( function( $ ) {
EDD_Notes.init();
} );

View File

@ -1,28 +0,0 @@
/**
* Deletes the debug log file and disables logging.
*/
; ( function ( document, $ ) {
'use strict';
$( '#edd-disable-debug-log' ).on( 'click', function ( e ) {
e.preventDefault();
$( this ).attr( 'disabled', true );
var notice = $( '#edd-debug-log-notice' );
$.ajax( {
type: "GET",
data: {
action: 'edd_disable_debugging',
nonce: $( '#edd_debug_log_delete' ).val(),
},
url: ajaxurl,
success: function ( response ) {
notice.empty().append( response.data );
setTimeout( function () {
notice.slideUp();
}, 3000 );
}
} ).fail( function ( response ) {
notice.empty().append( response.responseJSON.data );
} );
} );
} )( document, jQuery );

View File

@ -1,130 +0,0 @@
/**
* Internal dependencies
*/
import OrderOverview from './order-overview';
import './order-details';
import { jQueryReady } from 'utils/jquery.js';
jQueryReady( () => {
// Order Overview.
if ( window.eddAdminOrderOverview ) {
OrderOverview.render();
/**
* Add validation to Add/Edit Order form.
*
* @since 3.0
*/
( () => {
const overview = OrderOverview.options.state;
const orderItems = overview.get( 'items' );
const noItemErrorEl = document.getElementById( 'edd-add-order-no-items-error' );
const noCustomerErrorEl = document.getElementById( 'edd-add-order-customer-error' );
const assignCustomerEl = document.getElementById( 'customer_id' );
const newCustomerEmailEl = document.getElementById( 'edd_new_customer_email' );
[
'edd-add-order-form',
'edd-edit-order-form',
].forEach( ( form ) => {
const formEl = document.getElementById( form );
if ( ! formEl ) {
return;
}
formEl.addEventListener( 'submit', submitForm );
} );
/**
* Submits an Order form.
*
* @since 3.0
*
* @param {Object} event Submit event.
*/
function submitForm( event ) {
let hasError = false;
// Ensure `OrderItem`s.
if ( noItemErrorEl ) {
if ( 0 === orderItems.length ) {
noItemErrorEl.style.display = 'block';
hasError = true;
} else {
noItemErrorEl.style.display = 'none';
}
}
// Ensure Customer.
if ( noCustomerErrorEl ) {
if ( '0' === assignCustomerEl.value && '' === newCustomerEmailEl.value ) {
noCustomerErrorEl.style.display = 'block';
hasError = true;
} else {
noCustomerErrorEl.style.display = 'none';
}
if ( true === hasError ) {
event.preventDefault();
}
}
}
/**
* Remove `OrderItem` notice when an `OrderItem` is added.
*
* @since 3.0
*/
orderItems.on( 'add', function() {
noItemErrorEl.style.display = 'none';
} );
/**
* Remove Customer notice when a Customer is changed.
*
* Uses a jQuery binding for Chosen support.
*
* @since 3.0
*
* @param {Object} event Change event.
*/
$( assignCustomerEl ).on( 'change', ( event ) => {
const val = event.target.value;
if ( '0' !== val ) {
noCustomerErrorEl.style.display = 'none';
}
} )
if ( newCustomerEmailEl ) {
/**
* Remove Customer notice when a Customer is set.
*
* @since 3.0
*
* @param {Object} event Input event.
*/
newCustomerEmailEl.addEventListener( 'input', ( event ) => {
const val = event.target.value;
if ( '' !== val ) {
noCustomerErrorEl.style.display = 'none';
}
} );
}
} )();
}
// Move `.update-nag` items below the top header.
// `#update-nag` is legacy styling, which core still supports.
//
// `.notice` items are properly moved, but WordPress core
// does not move `.update-nag`.
if ( 0 !== $( '.edit-post-editor-regions__header' ).length ) {
$( 'div.update-nag, div#update-nag' ).insertAfter( $( '.edit-post-editor-regions__header' ) );
}
} );

View File

@ -1,17 +0,0 @@
/* global $, ajaxurl */
/**
* Internal dependencies
*/
import { jQueryReady } from 'utils/jquery.js';
jQueryReady( () => {
$( '.download_page_edd-payment-history .row-actions .delete a' ).on( 'click', function() {
if( confirm( edd_vars.delete_payment ) ) {
return true;
}
return false;
});
} );

View File

@ -1,256 +0,0 @@
/* global $, ajaxurl, _ */
/**
* Internal dependencies
*/
import OrderOverview from './../order-overview';
import { getChosenVars } from 'utils/chosen.js';
import { jQueryReady } from 'utils/jquery.js';
// Store customer search results to help prefill address data.
let CUSTOMER_SEARCH_RESULTS = {
addresses: {
'0': {
address: '',
address2: '',
city: '',
region: '',
postal_code: '',
country: '',
},
},
};
jQueryReady( () => {
/**
* Adjusts Overview tax configuration when the Customer's address changes.
*
* @since 3.0
*/
( () => {
const { state: overviewState } = OrderOverview.options;
// No tax, do nothing.
if ( false === overviewState.get( 'hasTax' ) ) {
return;
}
// Editing, do nothing.
if ( false === overviewState.get( 'isAdding' ) ) {
return;
}
const countryInput = document.getElementById(
'edd_order_address_country'
);
const regionInput = document.getElementById(
'edd_order_address_region'
);
if ( ! ( countryInput && regionInput ) ) {
return;
}
/**
* Retrieves a tax rate based on the currently selected Address.
*
* @since 3.0
*/
function getTaxRate() {
const country = $( '#edd_order_address_country' ).val();
const region = $( '#edd_order_address_region' ).val();
const nonce = document.getElementById( 'edd_get_tax_rate_nonce' )
.value;
wp.ajax.send( 'edd_get_tax_rate', {
data: {
nonce,
country,
region,
},
/**
* Updates the Overview's tax configuration on successful retrieval.
*
* @since 3.0
*
* @param {Object} response AJAX response.
*/
success( response ) {
let { tax_rate: rate } = response;
// Make a percentage.
rate = rate * 100;
overviewState.set( 'hasTax', {
...overviewState.get( 'hasTax' ),
country,
region,
rate,
} );
},
/*
* Updates the Overview's tax configuration on failed retrieval.
*
* @since 3.0
*/
error() {
overviewState.set( 'hasTax', 'none' );
},
} );
}
// Update rate on Address change.
//
// Wait for Region field to be replaced when Country changes.
// Wait for typing when Regino field changes.
// jQuery listeners for Chosen compatibility.
$( '#edd_order_address_country' ).on( 'change', _.debounce( getTaxRate, 250 ) );
$( '#edd-order-address' ).on( 'change', '#edd_order_address_region', getTaxRate );
$( '#edd-order-address' ).on( 'keyup', '#edd_order_address_region', _.debounce( getTaxRate, 250 ) );
} )();
$( '.edd-payment-change-customer-input' ).on( 'change', function() {
const $this = $( this ),
data = {
action: 'edd_customer_addresses',
customer_id: $this.val(),
nonce: $( '#edd_add_order_nonce' ).val(),
};
$.post( ajaxurl, data, function( response ) {
const { success, data } = response;
if ( ! success ) {
$( '.customer-address-select-wrap' ).hide();
return;
}
// Store response for later use.
CUSTOMER_SEARCH_RESULTS = {
...CUSTOMER_SEARCH_RESULTS,
...data,
addresses: {
...CUSTOMER_SEARCH_RESULTS.addresses,
...data.addresses,
},
};
if ( data.html ) {
$( '.customer-address-select-wrap' ).show();
$( '.customer-address-select-wrap .edd-form-group__control' ).html( data.html );
} else {
$( '.customer-address-select-wrap' ).hide();
}
}, 'json' );
return false;
} );
/**
* Retrieves a list of states based on a Country HTML <select>.
*
* @since 3.0
*
* @param {HTMLElement} countryEl Element containing country information.
* @param {string} fieldName the name of the field to use in response.
* @return {$.promise} Region data response.
*/
function getStates( countryEl, fieldName, fieldId ) {
const data = {
action: 'edd_get_shop_states',
country: countryEl.val(),
nonce: countryEl.data( 'nonce' ),
field_name: fieldName,
field_id: fieldId,
};
return $.post( ajaxurl, data );
}
/**
* Replaces the Region area with the appropriate field type.
*
* @todo This is hacky and blindly picks elements from the DOM.
*
* @since 3.0
*
* @param {string} regions Regions response.
*/
function replaceRegionField( regions ) {
const state_wrapper = $( '#edd_order_address_region' );
$( '#edd_order_address_region_chosen' ).remove();
if ( 'nostates' === regions ) {
state_wrapper
.replaceWith( '<input type="text" name="edd_order_address[region]" id="edd_order_address_region" value="" class="wide-fat" style="max-width: none; width: 100%;" />' );
} else {
state_wrapper
.replaceWith( regions );
$( '#edd_order_address_region' ).chosen( getChosenVars( $( '#edd_order_address_region' ) ) );
}
}
/**
* Handles replacing a Region field when a Country field changes.
*
* @since 3.0
*/
function updateRegionFieldOnChange() {
getStates(
$( this ),
'edd_order_address[region]',
'edd_order_address_region'
)
.done( replaceRegionField );
}
$( document.body ).on( 'change', '.customer-address-select-wrap .add-order-customer-address-select', function() {
const $this = $( this ),
val = $this.val(),
address = CUSTOMER_SEARCH_RESULTS.addresses[ val ];
$( '#edd-add-order-form input[name="edd_order_address[address]"]' ).val( address.address );
$( '#edd-add-order-form input[name="edd_order_address[address2]"]' ).val( address.address2 );
$( '#edd-add-order-form input[name="edd_order_address[postal_code]"]' ).val( address.postal_code );
$( '#edd-add-order-form input[name="edd_order_address[city]"]' ).val( address.city );
$( '#edd-add-order-form input[name="edd_order_address[address_id]"]' ).val( val );
// Remove global `change` event handling to prevent loop.
$( '#edd_order_address_country' ).off( 'change', updateRegionFieldOnChange );
// Set Country.
$( '#edd_order_address_country' )
.val( address.country )
.trigger( 'change' )
.trigger( 'chosen:updated' );
// Set Region.
getStates(
$( '#edd_order_address_country' ),
'edd_order_address[region]',
'edd_order_address_region'
)
.done( replaceRegionField )
.done( ( response ) => {
$( '#edd_order_address_region' )
.val( address.region )
.trigger( 'change' )
.trigger( 'chosen:updated' );
} );
// Add back global `change` event handling.
$( '#edd_order_address_country' ).on( 'change', updateRegionFieldOnChange );
return false;
} );
// Country change.
$( '#edd_order_address_country' ).on( 'change', updateRegionFieldOnChange );
} );

View File

@ -1,69 +0,0 @@
/* global $ */
/**
* Internal dependencies
*/
import { jQueryReady } from 'utils/jquery.js';
jQueryReady( () => {
// Change Customer.
$( '.edd-payment-change-customer-input' ).on( 'change', function() {
const $this = $( this ),
data = {
action: 'edd_customer_details',
customer_id: $this.val(),
nonce: $( '#edd_customer_details_nonce' ).val(),
};
if ( '' === data.customer_id ) {
return;
}
$( '.customer-details' ).css( 'display', 'none' );
$( '#customer-avatar' ).html( '<span class="spinner is-active"></span>' );
$.post( ajaxurl, data, function( response ) {
const { success, data } = response;
if ( success ) {
$( '.customer-details' ).css( 'display', 'flex' );
$( '.customer-details-wrap' ).css( 'display', 'flex' );
$( '#customer-avatar' ).html( data.avatar );
$( '.customer-name' ).html( data.name );
$( '.customer-since span' ).html( data.date_created_i18n );
$( '.customer-record a' ).prop( 'href', data._links.self );
} else {
$( '.customer-details-wrap' ).css( 'display', 'none' );
}
}, 'json' );
} );
$( '.edd-payment-change-customer-input' ).trigger( 'change' );
// New Customer.
$( '#edd-customer-details' ).on( 'click', '.edd-payment-new-customer, .edd-payment-new-customer-cancel', function( e ) {
e.preventDefault();
var new_customer = $( this ).hasClass( 'edd-payment-new-customer' ),
cancel = $( this ).hasClass( 'edd-payment-new-customer-cancel' );
if ( new_customer ) {
$( '.order-customer-info' ).hide();
$( '.new-customer' ).show();
} else if ( cancel ) {
$( '.order-customer-info' ).show();
$( '.new-customer' ).hide();
}
var new_customer = $( '#edd-new-customer' );
if ( $( '.new-customer' ).is( ':visible' ) ) {
new_customer.val( 1 );
} else {
new_customer.val( 0 );
}
} );
} );

View File

@ -1,3 +0,0 @@
import './address.js';
import './customer.js';
import './receipt.js';

View File

@ -1,32 +0,0 @@
/* global $, ajaxurl */
/**
* Internal dependencies
*/
import { jQueryReady } from 'utils/jquery.js';
jQueryReady( () => {
const emails_wrap = $( '.edd-order-resend-receipt-addresses' );
$( document.body ).on( 'click', '#edd-select-receipt-email', function( e ) {
e.preventDefault();
emails_wrap.slideDown();
} );
$( document.body ).on( 'change', '.edd-order-resend-receipt-email', function() {
const selected = $('input:radio.edd-order-resend-receipt-email:checked').val();
$( '#edd-select-receipt-email').data( 'email', selected );
} );
$( document.body).on( 'click', '#edd-select-receipt-email', function () {
if ( confirm( edd_vars.resend_receipt ) ) {
const href = $( this ).prop( 'href' ) + '&email=' + $( this ).data( 'email' );
window.location = href;
}
} );
$( document.body ).on( 'click', '#edd-resend-receipt', function() {
return confirm( edd_vars.resend_receipt );
} );
} );

View File

@ -1,279 +0,0 @@
import { NumberFormat } from '@easy-digital-downloads/currency';
const number = new NumberFormat();
/* global eddAdminOrderOverview */
// Loads the modal when the refund button is clicked.
$(document.body).on('click', '.edd-refund-order', function (e) {
e.preventDefault();
var link = $(this),
postData = {
action : 'edd_generate_refund_form',
order_id: $('input[name="edd_payment_id"]').val(),
};
$.ajax({
type : 'POST',
data : postData,
url : ajaxurl,
success: function success(data) {
let modal_content = '';
if (data.success) {
modal_content = data.html;
} else {
modal_content = data.message;
}
$('#edd-refund-order-dialog').dialog({
position: { my: 'top center', at: 'center center-25%' },
width : '75%',
modal : true,
resizable: false,
draggable: false,
classes: {
'ui-dialog': 'edd-dialog',
},
closeText: eddAdminOrderOverview.i18n.closeText,
open: function( event, ui ) {
$(this).html( modal_content );
},
close: function( event, ui ) {
$( this ).html( '' );
if ( $( this ).hasClass( 'did-refund' ) ) {
location.reload();
}
}
});
return false;
}
}).fail(function (data) {
$('#edd-refund-order-dialog').dialog({
position: { my: 'top center', at: 'center center-25%' },
width : '75%',
modal : true,
resizable: false,
draggable: false
}).html(data.message);
return false;
});
});
$( document.body ).on( 'click', '.ui-widget-overlay', function ( e ) {
$( '#edd-refund-order-dialog' ).dialog( 'close' );
} );
/**
* Listen for the bulk actions checkbox, since WP doesn't trigger a change on sub-items.
*/
$( document.body ).on( 'change', '#edd-refund-order-dialog #cb-select-all-1', function () {
const itemCheckboxes = $( '.edd-order-item-refund-checkbox' );
const isChecked = $( this ).prop( 'checked' );
itemCheckboxes.each( function() {
$( this ).prop( 'checked', isChecked ).trigger( 'change' );
} );
} );
/**
* Listen for individual checkbox changes.
* When it does, trigger a quantity change.
*/
$( document.body ).on( 'change', '.edd-order-item-refund-checkbox', function () {
const parent = $( this ).parent().parent();
const quantityField = parent.find( '.edd-order-item-refund-quantity' );
if ( quantityField.length ) {
if ( $( this ).prop( 'checked' ) ) {
// Triggering a change on the quantity field handles enabling the inputs.
quantityField.trigger( 'change' );
} else {
// Disable inputs and recalculate total.
parent.find( '.edd-order-item-refund-input' ).prop( 'disabled', true );
recalculateRefundTotal();
}
}
} );
/**
* Handles quantity changes, which includes items in the refund.
*/
$( document.body ).on( 'change', '#edd-refund-order-dialog .edd-order-item-refund-input', function () {
let parent = $( this ).closest( '.refunditem' ),
quantityField = parent.find( '.edd-order-item-refund-quantity' ),
quantity = parseInt( quantityField.val() );
if ( quantity > 0 ) {
parent.addClass( 'refunded' );
} else {
parent.removeClass( 'refunded' );
}
// Only auto calculate subtotal / tax if we've adjusted the quantity.
if ( $( this ).hasClass( 'edd-order-item-refund-quantity' ) ) {
// Enable/disable amount fields.
parent.find( '.edd-order-item-refund-input:not(.edd-order-item-refund-quantity)' ).prop( 'disabled', quantity === 0 );
if ( quantity > 0 ) {
quantityField.prop( 'disabled', false );
}
let subtotalField = parent.find( '.edd-order-item-refund-subtotal' ),
taxField = parent.find( '.edd-order-item-refund-tax' ),
originalSubtotal = number.unformat( subtotalField.data( 'original' ) ),
originalTax = taxField.length ? number.unformat( taxField.data( 'original' ) ) : 0.00,
originalQuantity = parseInt( quantityField.data( 'max' ) ),
calculatedSubtotal = ( originalSubtotal / originalQuantity ) * quantity,
calculatedTax = taxField.length ? ( originalTax / originalQuantity ) * quantity : 0.00;
// Make sure totals don't go over maximums.
if ( calculatedSubtotal > parseFloat( subtotalField.data( 'max' ) ) ) {
calculatedSubtotal = subtotalField.data( 'max' );
}
if ( taxField.length && calculatedTax > parseFloat( taxField.data( 'max' ) ) ) {
calculatedTax = taxField.data( 'max' );
}
// Guess the subtotal and tax for the selected quantity.
subtotalField.val( number.format( calculatedSubtotal ) );
if ( taxField.length ) {
taxField.val( number.format( calculatedTax ) );
}
}
recalculateRefundTotal();
} );
/**
* Calculates all the final refund values.
*/
function recalculateRefundTotal() {
let newSubtotal = 0,
newTax = 0,
newTotal = 0,
canRefund = false,
allInputBoxes = $( '#edd-refund-order-dialog .edd-order-item-refund-input' ),
allReadOnly = $( '#edd-refund-order-dialog .edd-order-item-refund-input.readonly' );
// Set a readonly while we recalculate, to avoid race conditions in the browser.
allInputBoxes.prop( 'readonly', true );
// Loop over all order items.
$( '#edd-refund-order-dialog .edd-order-item-refund-quantity' ).each( function() {
const thisItemQuantity = parseInt( $( this ).val() );
if ( ! thisItemQuantity ) {
return;
}
const thisItemParent = $( this ).closest( '.refunditem' );
const thisItemSelected = thisItemParent.find( '.edd-order-item-refund-checkbox' ).prop( 'checked' );
if ( ! thisItemSelected ) {
thisItemParent.removeClass( 'refunded' );
return;
}
// Values for this item.
let thisItemTax = 0.00;
let thisItemSubtotal = number.unformat( thisItemParent.find( '.edd-order-item-refund-subtotal' ).val() );
if ( thisItemParent.find( '.edd-order-item-refund-tax' ).length ) {
thisItemTax = number.unformat( thisItemParent.find( '.edd-order-item-refund-tax' ).val() );
}
let thisItemTotal = thisItemSubtotal + thisItemTax;
thisItemParent.find( '.column-total span' ).text( number.format( thisItemTotal ) );
// Negate amounts if working with credit.
if ( thisItemParent.data( 'credit' ) ) {
thisItemSubtotal = thisItemSubtotal * -1;
thisItemTax = thisItemTax * -1;
thisItemTotal = thisItemTotal * -1;
}
// Only include order items in the subtotal.
if ( thisItemParent.data( 'orderItem' ) ) {
newSubtotal += thisItemSubtotal;
}
newTax += thisItemTax;
newTotal += thisItemTotal;
} );
if ( parseFloat( newTotal ) > 0 ) {
canRefund = true;
}
$( '#edd-refund-submit-subtotal-amount' ).text( number.format( newSubtotal ) );
$( '#edd-refund-submit-tax-amount' ).text( number.format( newTax ) );
$( '#edd-refund-submit-total-amount' ).text( number.format( newTotal ) );
$( '#edd-submit-refund-submit' ).attr( 'disabled', ! canRefund );
// Remove the readonly.
allInputBoxes.prop( 'readonly', false );
allReadOnly.prop( 'readonly', true );
}
/**
* Process the refund form after the button is clicked.
*/
$(document.body).on( 'click', '#edd-submit-refund-submit', function(e) {
e.preventDefault();
$('.edd-submit-refund-message').removeClass('success').removeClass('fail');
$( this ).removeClass( 'button-primary' ).attr( 'disabled', true ).addClass( 'updating-message' );
$('#edd-submit-refund-status').hide();
const refundForm = $( '#edd-submit-refund-form' );
const refundData = refundForm.serialize();
var postData = {
action: 'edd_process_refund_form',
data: refundData,
order_id: $('input[name="edd_payment_id"]').val()
};
$.ajax({
type : 'POST',
data : postData,
url : ajaxurl,
success: function success(response) {
const message_target = $('.edd-submit-refund-message'),
url_target = $('.edd-submit-refund-url');
if ( response.success ) {
message_target.text(response.data.message).addClass('success');
url_target.attr( 'href', response.data.refund_url ).show();
$( '#edd-submit-refund-status' ).show();
url_target.focus();
$( '#edd-refund-order-dialog' ).addClass( 'did-refund' );
} else {
message_target.html(response.data).addClass('fail');
url_target.hide();
$('#edd-submit-refund-status').show();
$( '#edd-submit-refund-submit' ).attr( 'disabled', false ).removeClass( 'updating-message' ).addClass( 'button-primary' );
}
}
} ).fail( function ( data ) {
const message_target = $('.edd-submit-refund-message'),
url_target = $('.edd-submit-refund-url'),
json = data.responseJSON;
message_target.text( json.data ).addClass( 'fail' );
url_target.hide();
$( '#edd-submit-refund-status' ).show();
$( '#edd-submit-refund-submit' ).attr( 'disabled', false ).removeClass( 'updating-message' ).addClass( 'button-primary' );
return false;
});
});
// Initialize WP toggle behavior for the modal.
$( document.body ).on( 'click', '.refund-items .toggle-row', function () {
$( this ).closest( 'tr' ).toggleClass( 'is-expanded' );
} );

View File

@ -1,101 +0,0 @@
/* global Backbone */
/**
* Internal dependencies
*/
import { OrderAdjustment } from './../models/order-adjustment.js';
import { OrderAdjustmentDiscount } from './../models/order-adjustment-discount.js';
/**
* Collection of `OrderAdjustment`s.
*
* @since 3.0
*
* @class Adjustments
* @augments Backbone.Collection
*/
export const OrderAdjustments = Backbone.Collection.extend( {
/**
* @since 3.0
*/
comparator: 'type',
/**
* Initializes the `OrderAdjustments` collection.
*
* @since 3.0
*
* @constructs OrderAdjustments
* @augments Backbone.Collection
*/
initialize() {
this.getByType = this.getByType.bind( this );
},
/**
* Determines which Model to use and instantiates it.
*
* @since 3.0
*
* @param {Object} attributes Model attributes.
* @param {Object} options Model options.
*/
model( attributes, options ) {
let model;
switch ( attributes.type ) {
case 'discount':
model = new OrderAdjustmentDiscount( attributes, options );
break;
default:
model = new OrderAdjustment( attributes, options );
}
return model;
},
/**
* Defines the model's attribute that defines it's ID.
*
* Uses the `OrderAdjustment`'s Type ID.
*
* @since 3.0
*
* @param {Object} attributes Model attributes.
* @return {number}
*/
modelId( attributes ) {
return `${ attributes.type }-${ attributes.typeId }-${ attributes.description }`;
},
/**
* Determines if `OrderAdjustments` contains a specific `OrderAdjustment`.
*
* @since 3.0
*
* @param {OrderAdjustment} model Model to look for.
* @return {bool} True if the Collection contains the Model.
*/
has( model ) {
return (
undefined !==
this.findWhere( {
typeId: model.get( 'typeId' ),
} )
);
},
/**
* Returns a list of `OrderAdjustment`s by type.
*
* @since 3.0
*
* @param {string} type Type of adjustment to retrieve. `fee`, `credit`, or `discount`.
* @return {Array} List of type-specific adjustments.
*/
getByType( type ) {
return this.where( {
type,
} );
},
} );

View File

@ -1,137 +0,0 @@
/* global Backbone, $, _ */
/**
* External dependencies
*/
import uuid from 'uuid-random';
/**
* Internal dependencies
*/
import { OrderAdjustments } from './../collections/order-adjustments.js';
import { OrderAdjustmentDiscount } from './../models/order-adjustment-discount.js';
import { OrderItem } from './../models/order-item.js';
/**
* Collection of `OrderItem`s.
*
* @since 3.0
*
* @class OrderItems
* @augments Backbone.Collection
*/
export const OrderItems = Backbone.Collection.extend( {
/**
* @since 3.0
*
* @type {OrderItem}
*/
model: OrderItem,
/**
* Ensures `OrderItems` has access to the current state through a similar
* interface as Views. BackBone.Collection does not automatically set
* passed options as a property.
*
* @since 3.0
*
* @param {null|Array} models List of Models.
* @param {Object} options Collection options.
*/
preinitialize( models, options ) {
this.options = options;
},
/**
* Determines if `OrderItems` contains a specific `OrderItem`.
*
* Uses the `OrderItem`s Product ID and Price ID to create a unique
* value to check against.
*
* @since 3.0
*
* @param {OrderItem} model Model to look for.
* @return {bool} True if the Collection contains the Model.
*/
has( model ) {
const duplicates = this.filter( ( item ) => {
const itemId =
item.get( 'productId' ) + '_' + item.get( 'priceId' );
const modelId =
model.get( 'productId' ) + '_' + model.get( 'priceId' );
return itemId === modelId;
} );
return duplicates.length > 0;
},
/**
* Updates the amounts for all current `OrderItem`s.
*
* @since 3.0
*
* @return {$.promise} A jQuery promise representing zero or more requests.
*/
updateAmounts() {
const { options } = this;
const { state } = options;
const items = state.get( 'items' );
const discounts = new Backbone.Collection(
state.get( 'adjustments' ).getByType( 'discount' )
);
const args = {
country: state.getTaxCountry(),
region: state.getTaxRegion(),
products: items.map( ( item ) => ( {
id: item.get( 'productId' ),
quantity: item.get( 'quantity' ),
options: {
price_id: item.get( 'priceId' ),
}
} ) ),
discountIds: discounts.pluck( 'typeId' ),
};
// Keep track of all jQuery Promises.
const promises = [];
// Find each `OrderItem`'s amounts.
items.models.forEach( ( item ) => {
const getItemAmounts = item.getAmounts( args );
getItemAmounts
// Update `OrderItem`-level Adjustments.
.done( ( { adjustments } ) => {
// Map returned Discounts to `OrderAdjustmentDiscount`.
const orderItemDiscounts = adjustments.map( ( adjustment ) => {
return new OrderAdjustmentDiscount( {
...adjustment,
id: uuid(),
objectId: item.get( 'id' ),
} );
} );
// Gather existing `fee` and `credit` `OrderItem`-level Adjustments.
const orderItemAdjustments = item.get( 'adjustments' ).filter( ( adjustment ) => {
return [ 'fee', 'credit' ].includes( adjustment.type );
} );
// Reset `OrderAdjustments` collection with new data.
item.set( 'adjustments', new OrderAdjustments( [
...orderItemDiscounts,
...orderItemAdjustments,
] ) );
} )
// Update individual `OrderItem`s and `OrderAdjustment`s with new amounts.
.done( ( response ) => item.setAmounts( response ) );
// Track jQuery Promise.
promises.push( getItemAmounts );
} );
return $.when.apply( $, promises );
},
} );

View File

@ -1,21 +0,0 @@
/* global Backbone */
/**
* Internal dependencies
*/
import { OrderRefund } from './../models/order-refund.js';
/**
* Collection of `OrderRefund`s.
*
* @since 3.0
*
* @class OrderRefunds
* @augments Backbone.Collection
*/
export const OrderRefunds = Backbone.Collection.extend( {
/**
* @since 3.0
*/
model: OrderRefund,
} );

View File

@ -1,106 +0,0 @@
/**
* Internal dependencies
*/
import { Currency, NumberFormat } from '@easy-digital-downloads/currency';
import { Overview } from './views/overview.js';
import { OrderItems } from './collections/order-items.js';
import { OrderItem } from './models/order-item.js';
import { OrderAdjustments } from './collections/order-adjustments.js';
import { OrderRefunds } from './collections/order-refunds.js';
import { State } from './models/state.js';
// Temporarily include old Refund flow.
import './_refund.js';
let overview;
( () => {
if ( ! window.eddAdminOrderOverview ) {
return;
}
const {
isAdding,
isRefund,
hasTax,
hasQuantity,
hasDiscounts,
order,
items,
adjustments,
refunds,
} = window.eddAdminOrderOverview;
const currencyFormatter = new Currency( {
currency: order.currency,
currencySymbol: order.currencySymbol,
} );
// Create and hydrate state.
const state = new State( {
isAdding: '1' === isAdding,
isRefund: '1' === isRefund,
hasTax: '0' === hasTax ? false : hasTax,
hasQuantity: '1' === hasQuantity,
hasDiscounts: '1' === hasDiscounts,
formatters: {
currency: currencyFormatter,
// Backbone doesn't merge nested defaults.
number: new NumberFormat(),
},
order,
} );
// Create collections and add to state.
state.set( {
items: new OrderItems( null, {
state,
} ),
adjustments: new OrderAdjustments( null, {
state,
} ),
refunds: new OrderRefunds( null, {
state,
} ),
} );
// Create Overview.
overview = new Overview( {
state,
} );
// Hydrate collections.
// Hydrate `OrderItem`s.
//
// Models are created manually before being added to the collection to
// ensure attributes maintain schema with deep model attributes.
items.forEach( ( item ) => {
const orderItemAdjustments = new OrderAdjustments( item.adjustments );
const orderItem = new OrderItem( {
...item,
adjustments: orderItemAdjustments,
state,
} );
state.get( 'items' ).add( orderItem );
} );
// Hyrdate `Order`-level `Adjustments`.
adjustments.forEach( ( adjustment ) => {
state.get( 'adjustments' ).add( {
state,
...adjustment,
} )
} );
// Hydrate `OrderRefund`s.
refunds.forEach( ( refund ) => {
state.get( 'refunds' ).add( {
state,
...refund,
} );
} );
} ) ();
export default overview;

View File

@ -1,76 +0,0 @@
/* global _ */
/**
* Internal dependencies
*/
import { OrderAdjustment } from './order-adjustment.js';
/**
* OrderAdjustmentDiscount
*
* @since 3.0
*
* @class OrderAdjustmentDiscount
* @augments Backbone.Model
*/
export const OrderAdjustmentDiscount = OrderAdjustment.extend( {
/**
* @since 3.0
*
* @typedef {Object} OrderAdjustmentDiscount
*/
defaults: {
...OrderAdjustment.prototype.defaults,
type: 'discount',
},
/**
* @since 3.0
*/
idAttribute: 'typeId',
/**
* Returns the `OrderAdjustmentDiscount`'s amount based on the current values
* of all `OrderItems` discounts.
*
* @since 3.0
*
* @return {number} `OrderAdjustmentDiscount` amount.
*/
getAmount() {
let amount = 0;
const state = this.get( 'state' );
// Return stored amount if viewing an existing Order.
if ( false === state.get( 'isAdding' ) ) {
return OrderAdjustment.prototype.getAmount.apply( this, arguments );
}
const { models: items } = state.get( 'items' );
const { number } = state.get( 'formatters' );
items.forEach( ( item ) => {
const discount = item.get( 'adjustments' ).findWhere( {
typeId: this.get( 'typeId' ),
} );
if ( undefined !== discount ) {
amount += number.unformat(
number.format( discount.get( 'subtotal' ) )
);
}
} );
return amount;
},
/**
* Returns the `OrderAdjustment` total.
*
* @since 3.0
*/
getTotal() {
return this.getAmount();
},
} );

View File

@ -1,101 +0,0 @@
/* global Backbone */
/**
* OrderAdjustment
*
* @since 3.0
*
* @class OrderAdjustment
* @augments Backbone.Model
*/
export const OrderAdjustment = Backbone.Model.extend( {
/**
* @since 3.0
*
* @typedef {Object} OrderAdjustment
*/
defaults: {
id: 0,
objectId: 0,
objectType: '',
typeId: 0,
type: '',
description: '',
subtotal: 0,
tax: 0,
total: 0,
dateCreated: '',
dateModified: '',
uuid: '',
},
/**
* Returns the `OrderAdjustment` amount.
*
* Separate from subtotal or total calculation so `OrderAdjustmentDiscount`
* can be calculated independently.
*
* @see OrderAdjustmentDiscount.prototype.getAmount()
*
* @since 3.0
*/
getAmount() {
return this.get( 'subtotal' );
},
/**
* Retrieves the `OrderAdjustment` tax.
*
* @since 3.0.0
*
* @return {number} Total amount.
*/
getTax() {
return this.get( 'tax' );
},
/**
* Returns the `OrderAdjustment` total.
*
* @since 3.0
*/
getTotal() {
// Fees always have tax added exclusively.
// @link https://github.com/easydigitaldownloads/easy-digital-downloads/issues/2445#issuecomment-53215087
// @link https://github.com/easydigitaldownloads/easy-digital-downloads/blob/f97f4f6f5454921a2014dc1fa8f4caa5f550108c/includes/cart/class-edd-cart.php#L1306-L1311
return this.get( 'subtotal' ) + this.get( 'tax' );
},
/**
* Recalculates the tax amount based on the current tax rate.
*
* @since 3.0.0
*/
updateTax() {
const state = this.get( 'state' );
const hasTax = state.get( 'hasTax' );
if (
'none' === hasTax ||
'' === hasTax.country ||
'' === hasTax.rate
) {
return;
}
const { number } = state.get( 'formatters' );
const taxRate = hasTax.rate / 100;
const adjustments = state.get( 'adjustments' ).getByType( 'fee' );
adjustments.forEach( ( adjustment ) => {
if ( false === adjustment.get( 'isTaxable' ) ) {
return;
}
const taxableAmount = adjustment.getAmount();
const taxAmount = number.unformat( taxableAmount * taxRate );
adjustment.set( 'tax', taxAmount );
} );
}
} );

View File

@ -1,250 +0,0 @@
/* global Backbone, _, $ */
/**
* Internal dependencies
*/
import { OrderAdjustments } from './../collections/order-adjustments.js';
/**
* OrderItem
*
* @since 3.0
*
* @class OrderItem
* @augments Backbone.Model
*/
export const OrderItem = Backbone.Model.extend( {
/**
* @since 3.0
*
* @typedef {Object} OrderItem
*/
defaults: {
id: 0,
orderId: 0,
productId: 0,
productName: '',
priceId: null,
cartIndex: 0,
type: 'download',
status: '',
statusLabel: '',
quantity: 1,
amount: 0,
subtotal: 0,
discount: 0,
tax: 0,
total: 0,
dateCreated: '',
dateModified: '',
uuid: '',
// Track manually set amounts.
amountManual: 0,
taxManual: 0,
subtotalManual: 0,
// Track if the amounts have been adjusted manually on addition.
_isAdjustingManually: false,
// Track `OrderItem`-level adjustments.
//
// The handling of Adjustments in the API is currently somewhat
// fragmented with certain extensions creating Adjustments at the
// `Order` level, some at a duplicate `OrderItem` level, and some both.
adjustments: new OrderAdjustments(),
},
/**
* Returns the `OrderItem` subtotal amount.
*
* @since 3.0.0
*
* @param {bool} includeTax If taxes should be included when retrieving the subtotal.
* This is needed in some scenarios with inclusive taxes.
* @return {number} Subtotal amount.
*/
getSubtotal( includeTax = false ) {
const state = this.get( 'state' );
const subtotal = this.get( 'subtotal' );
// Use stored value if the record has already been created.
if ( false === state.get( 'isAdding' ) ) {
return subtotal;
}
// Calculate subtotal.
if ( true === state.hasInclusiveTax() && false === includeTax ) {
return subtotal - this.getTax();
}
return subtotal;
},
/**
* Returns the Discount amount.
*
* If an Order is being added the amount is calculated based
* on the total of `OrderItem`-level Adjustments that are
* currently applied.
*
* If an Order has already been added use the amount stored
* directly in the database.
*
* @since 3.0
*
* @return {number} Discount amount.
*/
getDiscountAmount() {
let amount = 0;
const discounts = this.get( 'adjustments' ).getByType( 'discount' );
if ( 0 === discounts.length ) {
return this.get( 'discount' );
}
discounts.forEach( ( discount ) => {
amount += +discount.get( 'subtotal' );
} );
return amount;
},
/**
* Retrieves the rounded Tax for the order item.
*
* Rounded to match storefront checkout.
*
* @since 3.0.0
*
* @return {number} Total amount.
*/
getTax() {
const state = this.get( 'state' );
const tax = this.get( 'tax' );
// Use stored value if the record has already been created.
if ( false === state.get( 'isAdding' ) ) {
return tax;
}
// Calculate tax.
const { number } = state.get( 'formatters' );
return number.unformat( number.format( tax ) );
},
/**
* Retrieves the Total for the order item.
*
* @since 3.0.0
*
* @return {number} Total amount.
*/
getTotal() {
const state = this.get( 'state' );
// Use stored value if the record has already been created.
if ( false === state.get( 'isAdding' ) ) {
return this.get( 'total' );
}
// Calculate total.
if ( true === state.hasInclusiveTax() ) {
return this.get( 'subtotal' ) - this.getDiscountAmount();
}
return ( this.get( 'subtotal' ) - this.getDiscountAmount() ) + this.getTax();
},
/**
* Retrieves amounts for the `OrderItem` based on other `OrderItem`s and `OrderAdjustment`s.
*
* @since 3.0
*
* @param {Object} args Arguments to pass as data in the XHR request.
* @param {string} args.country Country code to determine tax rate.
* @param {string} args.region Region to determine tax rate.
* @param {Array} args.products List of current products added to the order.
* @param {Array} args.discountIds List of `OrderAdjustmentDiscount`s to calculate amounts against.
* @return {$.promise} A jQuery promise that represents the request.
*/
getAmounts( {
country = '',
region = '',
products = [],
discountIds = [],
} ) {
const {
nonces: { edd_admin_order_get_item_amounts: nonce },
} = window.eddAdminOrderOverview;
const { productId, priceId, quantity, amount, tax, subtotal } = _.clone(
this.attributes
);
return wp.ajax.send( 'edd-admin-order-get-item-amounts', {
data: {
nonce,
productId,
priceId,
quantity,
amount,
tax,
subtotal,
country,
region,
products: _.uniq( [
...products,
{
id: productId,
quantity,
options: {
price_id: priceId,
},
},
], function( { id, options: { price_id } } ) {
return `${ id }_${ price_id }`
} ),
discounts: _.uniq( discountIds ),
},
} );
},
/**
* Bulk sets amounts.
*
* Only adjusts the Discount amount if adjusting manually.
*
* @since 3.0
*
* @param {Object} amounts Amounts to set.
* @param {number} amounts.amount `OrderItem` unit price.
* @param {number} amounts.discount `OrderItem` discount amount.
* @param {number} amounts.tax `OrderItem` tax amount.
* @param {number} amounts.subtotal `OrderItem` subtotal amount.
* @param {number} amounts.total `OrderItem` total amount.
*/
setAmounts( {
amount = 0,
discount = 0,
tax = 0,
subtotal = 0,
total = 0,
} ) {
if ( true === this.get( '_isAdjustingManually' ) ) {
this.set( {
discount,
} );
} else {
this.set( {
amount,
discount,
tax,
subtotal,
total,
} );
}
},
} );

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