Skip to content

Feat/client optimizations #905

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 22 commits into from
Apr 8, 2025
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
22 commits
Select commit Hold shift + click to select a range
d096d4b
Implement page profiling and optimization data storage
selul Mar 27, 2025
6830ea9
Enhance optimization data handling and profiling features
selul Mar 27, 2025
0c5ae1d
Update dependencies and enhance lazy loading features
selul Apr 2, 2025
329828f
fix formating
selul Apr 2, 2025
a3c513f
Update assets/src/dashboard/parts/connected/settings/Lazyload.js
selul Apr 2, 2025
52ebcd9
Refactor media offload functionality and enhance REST API integration
selul Apr 3, 2025
e6ef871
Refactor connected components to streamline media offload logic
selul Apr 3, 2025
9fa0480
Comment out bulk actions registration in media offload for future imp…
selul Apr 3, 2025
cf696a0
Update assets/js/media.js
selul Apr 3, 2025
81181b2
Add Image editor to prevent errors with offloaded images
selul Apr 3, 2025
5f5b68b
Implement compression mode settings in the dashboard
selul Apr 4, 2025
9f12a31
Update assets/src/dashboard/parts/connected/settings/Compression.js
selul Apr 4, 2025
6c72ed0
Update admin settings to include default compression mode as speed op…
selul Apr 4, 2025
2f234d0
Refactor compression mode handling in Compression.js
selul Apr 4, 2025
fedabef
Merge pull request #910 from Codeinwp/fix/image-editor
selul Apr 5, 2025
270fff0
Enhance compression settings in Compression.js
selul Apr 7, 2025
84e92c8
Merge pull request #911 from Codeinwp/feat/compression-preset
selul Apr 7, 2025
9671e9e
Merge pull request #909 from Codeinwp/feat/single-image-move
selul Apr 7, 2025
04bc757
Merge branch 'development' into feat/client-optimizations
selul Apr 7, 2025
94f07d0
Update inc/admin.php
selul Apr 8, 2025
308c782
Add support for background shorthand in lazyload replacer
selul Apr 8, 2025
509e734
Remove unnecessary blank line in Optml_Url_Replacer class for cleaner…
selul Apr 8, 2025
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
42 changes: 42 additions & 0 deletions assets/js/media.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,42 @@
jQuery(document).ready(function($) {
jQuery('.move-image-optml').click(function() {
//get the id and send a jquery rest request to the server
var id = jQuery(this).data('id');
var action = jQuery(this).data('action');
moveImage(id, action, jQuery(this));
});
});

function moveImage(id, action, element, is_retry = false) {
//add a loading indicator
element.parent().find('.spinner').addClass('is-active');
element.parent().addClass('is-loading');
jQuery.ajax({
url: optimoleMediaListing.rest_url,
type: 'POST',
headers: {
'X-WP-Nonce': optimoleMediaListing.nonce
},
data: {
action: action,
status: is_retry ? 'check' : 'start',
id: id
},
success: function(response) {
if(response.code === 'moved') {
element.parent().find('.spinner').removeClass('is-active');
element.parent().removeClass('is-loading');
element.parent().find('.move-image-optml').toggleClass('hidden');

}else if(response.code === 'error'){
element.parent().find('.spinner').removeClass('is-active');
element.parent().removeClass('is-loading');
element.parent().text(response.data);
}else{
setTimeout(function() {
moveImage(id, action, element, true);
}, 1000);
}
}
});
}
Loading
Loading