Skip to content

Commit b1cbb21

Browse files
authored
Merge pull request #9803 from awesomemotive/release/3.6.0
Release 3.6.0
2 parents ba21c50 + c87e336 commit b1cbb21

File tree

147 files changed

+13743
-1711
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

147 files changed

+13743
-1711
lines changed

Gruntfile.js

Lines changed: 48 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -204,6 +204,54 @@ module.exports = function ( grunt ) {
204204
dest: 'build/easy-digital-downloads-public'
205205
}
206206
]
207+
},
208+
pot_lite: {
209+
options: {
210+
patterns: [
211+
{
212+
match: /Easy Digital Downloads \(Pro\)/g,
213+
replacement: 'Easy Digital Downloads',
214+
expression: true,
215+
},
216+
{
217+
match: /https:\/\/wordpress\.org\/support\/plugin\/easy-digital-downloads-pro/g,
218+
replacement: 'https://wordpress.org/support/plugin/easy-digital-downloads',
219+
expression: true,
220+
}
221+
]
222+
},
223+
files: [
224+
{
225+
expand: true,
226+
flatten: true,
227+
src: [ 'build/easy-digital-downloads/languages/easy-digital-downloads.pot' ],
228+
dest: 'build/easy-digital-downloads/languages'
229+
}
230+
]
231+
},
232+
pot_repo: {
233+
options: {
234+
patterns: [
235+
{
236+
match: /Easy Digital Downloads \(Pro\)/g,
237+
replacement: 'Easy Digital Downloads',
238+
expression: true,
239+
},
240+
{
241+
match: /https:\/\/wordpress\.org\/support\/plugin\/easy-digital-downloads-pro/g,
242+
replacement: 'https://wordpress.org/support/plugin/easy-digital-downloads',
243+
expression: true,
244+
}
245+
]
246+
},
247+
files: [
248+
{
249+
expand: true,
250+
flatten: true,
251+
src: [ 'build/easy-digital-downloads-public/languages/easy-digital-downloads.pot' ],
252+
dest: 'build/easy-digital-downloads-public/languages'
253+
}
254+
]
207255
}
208256
}
209257
} );

assets/css/admin/reports/_tooltip.scss

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -17,6 +17,7 @@
1717
transform: translate(-50%, 0);
1818
pointer-events: none;
1919
white-space: nowrap;
20+
z-index: 1000;
2021
}
2122

2223
.edd-chartjs-tooltip-key {

assets/css/admin/style.scss

Lines changed: 1 addition & 45 deletions
Original file line numberDiff line numberDiff line change
@@ -32,6 +32,7 @@
3232
@use "dashboard/style" as dashboard;
3333

3434
@import "customers/style";
35+
@import "tools/style";
3536

3637

3738
/**
@@ -2060,51 +2061,6 @@ h3 + .notice-wrap .notice {
20602061

20612062
}
20622063

2063-
/* System Info page styles
2064-
-------------------------------------------------------------- */
2065-
2066-
.inside .edd-tools-textarea {
2067-
background: #32373c;
2068-
color: rgba(240, 245, 250, 0.7);
2069-
font-size: 12px;
2070-
font-family: Menlo, Monaco, monospace;
2071-
display: block;
2072-
overflow: auto;
2073-
white-space: pre;
2074-
width: 100%;
2075-
height: 450px;
2076-
padding: 10px;
2077-
outline: none;
2078-
}
2079-
2080-
#system-info-textarea::selection {
2081-
background: #555;
2082-
color: #fff;
2083-
}
2084-
2085-
#edd-system-info .edd-inline-button {
2086-
margin-left: 5px;
2087-
}
2088-
2089-
/* Tools Styles
2090-
-------------------------------------------------------------- */
2091-
2092-
.recount-stats-controls form {
2093-
display: inline;
2094-
}
2095-
2096-
.edd-recount-stats-descriptions span {
2097-
display: none;
2098-
line-height: 24px;
2099-
}
2100-
2101-
#edd-debug-log .edd-inline-button {
2102-
margin-left: 5px;
2103-
}
2104-
2105-
/* Tools Styles
2106-
-------------------------------------------------------------- */
2107-
21082064
/* Content wrapper */
21092065

21102066
#edd-item-card-wrapper .item-section {

assets/css/admin/tools/style.scss

Lines changed: 52 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,52 @@
1+
/* System Info page styles
2+
-------------------------------------------------------------- */
3+
4+
.inside .edd-tools-textarea {
5+
background: #32373c;
6+
color: rgba(240, 245, 250, 0.7);
7+
font-size: 12px;
8+
font-family: Menlo, Monaco, monospace;
9+
display: block;
10+
overflow: auto;
11+
white-space: pre;
12+
width: 100%;
13+
height: 450px;
14+
padding: 10px;
15+
outline: none;
16+
}
17+
18+
#system-info-textarea::selection {
19+
background: #555;
20+
color: #fff;
21+
}
22+
23+
#edd-system-info .edd-inline-button {
24+
margin-left: 5px;
25+
}
26+
27+
/* Tools Styles
28+
-------------------------------------------------------------- */
29+
30+
.recount-stats-controls form {
31+
display: inline;
32+
}
33+
34+
.edd-recount-stats-descriptions span {
35+
display: none;
36+
line-height: 24px;
37+
}
38+
39+
#edd-debug-log .edd-inline-button {
40+
margin-left: 5px;
41+
}
42+
43+
.edd-log__actions {
44+
display: flex;
45+
gap: 6px;
46+
margin: 24px 0;
47+
}
48+
49+
.edd-profiler-log__timestamp {
50+
font-style: italic;
51+
text-align: right;
52+
}

assets/css/edd-admin-rtl.min.css

Lines changed: 1 addition & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

assets/css/edd-admin.min.css

Lines changed: 1 addition & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

assets/js/admin/components/conditionals/requirements.js

Lines changed: 21 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -11,11 +11,11 @@
1111
* @param {string} requires The requirement identifier (e.g., 'vat-enable').
1212
* @param {bool} enabled Whether the requirement is met.
1313
*/
14-
function updateRequirements ( requires, enabled ) {
14+
export function updateRequirements( requires, enabled ) {
1515
const elements = document.querySelectorAll( '.edd-requires__' + requires );
1616
elements.forEach( function ( element ) {
1717
element.classList.remove( 'edd-hidden--required' );
18-
element.classList.toggle( 'edd-hidden', !enabled );
18+
element.classList.toggle( 'edd-hidden', ! enabled );
1919
if ( element.classList.contains( 'edd-hidden' ) ) {
2020
element.classList.add( 'edd-hidden--required' );
2121
}
@@ -25,13 +25,13 @@ function updateRequirements ( requires, enabled ) {
2525
/**
2626
* Initialize requirements on page load.
2727
*/
28-
function initializeRequirements () {
28+
export function initializeRequirements() {
2929
// Find all checkboxes with data-edd-requirement attribute
3030
const requirementCheckboxes = document.querySelectorAll( '[data-edd-requirement]' );
3131

3232
requirementCheckboxes.forEach( function ( checkbox ) {
3333
const requires = checkbox.getAttribute( 'data-edd-requirement' );
34-
if ( !requires ) {
34+
if ( ! requires ) {
3535
return;
3636
}
3737

@@ -43,25 +43,39 @@ function initializeRequirements () {
4343
/**
4444
* Add event listeners for checkbox changes.
4545
*/
46-
function addRequirementListeners () {
46+
export function addRequirementListeners() {
47+
// Listen to native checkbox change events
4748
document.addEventListener( 'change', function ( event ) {
4849
const target = event.target;
4950

5051
// Only process checkboxes with data-edd-requirement attribute
51-
if ( target.type !== 'checkbox' || !target.hasAttribute( 'data-edd-requirement' ) ) {
52+
if ( target.type !== 'checkbox' || ! target.hasAttribute( 'data-edd-requirement' ) ) {
5253
return;
5354
}
5455

5556
const requires = target.getAttribute( 'data-edd-requirement' );
56-
if ( !requires ) {
57+
if ( ! requires ) {
5758
return;
5859
}
5960

6061
// Update dependent elements
6162
updateRequirements( requires, target.checked );
6263
} );
64+
65+
// Listen for custom events from AJAX toggles
66+
document.addEventListener( 'eddSettingToggled', function ( event ) {
67+
if ( ! event.detail?.setting ) {
68+
return;
69+
}
70+
71+
updateRequirements( event.detail.setting, event.detail.value );
72+
} );
6373
}
6474

75+
/**
76+
* Auto-initialize on DOM ready for global settings pages.
77+
* Can be called manually for specific pages via explicit imports.
78+
*/
6579
document.addEventListener( 'DOMContentLoaded', function () {
6680
initializeRequirements();
6781
addRequirementListeners();
Lines changed: 71 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,71 @@
1+
/* global eddSettings */
2+
3+
/**
4+
* Handle the AJAX toggle request for a setting.
5+
*
6+
* @param {Event} event The change event from the checkbox.
7+
* @return {void}
8+
*/
9+
function handleToggleChange( event ) {
10+
const input = event.target;
11+
if ( ! input || input.nodeName !== 'INPUT' || input.type !== 'checkbox' ) {
12+
return;
13+
}
14+
15+
const setting = input.dataset.setting;
16+
if ( ! setting ) {
17+
return;
18+
}
19+
20+
// Disable during request
21+
input.disabled = true;
22+
const desiredChecked = input.checked;
23+
24+
const body = new URLSearchParams();
25+
body.append( 'action', 'edd_toggle_ajax_setting' );
26+
body.append( 'nonce', eddSettings?.nonce || '' );
27+
body.append( 'setting', setting );
28+
body.append( 'value', desiredChecked ? '1' : '0' );
29+
30+
fetch( eddSettings.ajaxurl, {
31+
method: 'POST',
32+
headers: { 'Content-Type': 'application/x-www-form-urlencoded' },
33+
credentials: 'same-origin',
34+
body: body,
35+
} )
36+
.then( function ( res ) {
37+
if ( ! res.ok ) {
38+
throw new Error( 'Network response was not ok' );
39+
}
40+
return res.json();
41+
} )
42+
.then( function ( json ) {
43+
if ( ! json?.success ) {
44+
throw new Error( json?.data?.message || 'Save failed' );
45+
}
46+
47+
// Dispatch custom event for other modules to listen to
48+
document.dispatchEvent(
49+
new CustomEvent( 'eddSettingToggled', {
50+
detail: { setting, value: desiredChecked, ...json.data },
51+
} )
52+
);
53+
} )
54+
.catch( function () {
55+
// Revert UI on error
56+
input.checked = ! desiredChecked;
57+
} )
58+
.finally( function () {
59+
input.disabled = false;
60+
} );
61+
}
62+
63+
/**
64+
* Initialize the settings toggle listeners.
65+
* This should be called once the DOM is ready.
66+
*
67+
* @return {void}
68+
*/
69+
export function initializeSettingsToggles() {
70+
document.addEventListener( 'change', handleToggleChange );
71+
}

assets/js/admin/downloads/index.js

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -382,4 +382,9 @@ var EDD_Download_Configuration = {
382382

383383
jQuery( document ).ready( function( $ ) {
384384
EDD_Download_Configuration.init();
385+
386+
// add a listener for the edd_download_type_changed event
387+
document.addEventListener( 'edd_download_type_changed', function ( e ) {
388+
EDD_Download_Configuration.initChosen( $( '#edd_product_files' ) );
389+
} );
385390
} );

assets/js/admin/downloads/move.js

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,9 @@ events.forEach( function ( event ) {
1111
} );
1212

1313
function addRowListeners () {
14+
if ( ! sections ) {
15+
return;
16+
}
1417
const dynamicRows = sections.querySelectorAll( '.edd-has-handle-actions' );
1518
if ( ! dynamicRows.length ) {
1619
return;

0 commit comments

Comments
 (0)