Skip to content

Commit

Permalink
Merge branch 'add-ons' into develop
Browse files Browse the repository at this point in the history
  • Loading branch information
afragen committed Jan 18, 2025
2 parents 1c85ab8 + bf2a53e commit 31fab91
Show file tree
Hide file tree
Showing 18 changed files with 226 additions and 1,581 deletions.
2 changes: 2 additions & 0 deletions CHANGES.md
Original file line number Diff line number Diff line change
@@ -1,4 +1,6 @@
#### [unreleased]
* refactor `Add_Ons` to use `plugins-api` REST endpoint and standard plugin card
* added features by @costdev for AJAXifying

#### 12.9.0 / 2025-01-07
* add API get for repo root contents for efficiency
Expand Down
2 changes: 1 addition & 1 deletion composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@
"php": ">=7.4",
"afragen/wordpress-plugin-readme-parser": "dev-master",
"afragen/singleton": "dev-master",
"afragen/wp-dependency-installer": "^4",
"afragen/wp-dismiss-notice": "*",
"freemius/wordpress-sdk": "^2"
},
"require-dev": {
Expand Down
62 changes: 1 addition & 61 deletions composer.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

5 changes: 5 additions & 0 deletions css/git-updater-settings.css
Original file line number Diff line number Diff line change
Expand Up @@ -48,3 +48,8 @@ div.hide-git-updater-settings {
.git-updater.plugin-card .desc {
margin-right: 0;
}

.git-updater-addons .plugin-card-bottom .column-rating,
.git-updater-addons .plugin-card-bottom .column-downloaded {
display: none;
}
2 changes: 1 addition & 1 deletion git-updater.php
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@
* Plugin Name: Git Updater
* Plugin URI: https://git-updater.com
* Description: A plugin to automatically update GitHub hosted plugins, themes, and language packs. Additional API plugins available for Bitbucket, GitLab, Gitea, and Gist.
* Version: 12.9.0
* Version: 12.9.0.1
* Author: Andy Fragen
* License: MIT
* Domain Path: /languages
Expand Down
89 changes: 89 additions & 0 deletions js/ajax-activate.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,89 @@
(function( $, wp ) {
var $document = $( document ),
$pluginFilter = $( "#plugin-filter, #plugin-information-footer" ),
__ = wp.i18n.__;
_x = wp.i18n._x,

$document.off( 'click', '#plugin-information-footer .activate-now' );

$pluginFilter.off( "click" );
$pluginFilter.on( "click", ".activate-now", function( event ) {
event.preventDefault();
var $activateButton = $( event.target );

if ( $activateButton.hasClass( "activating-message" ) || $activateButton.hasClass( "button-disabled" ) ) {
return;
}

$activateButton
.removeClass( "activate-now button-primary" )
.addClass( "activating-message" )
.attr(
"aria-label",
sprintf(
/* translators: %s: Plugin name. */
$activateButton.data( "name" ),
_x( "Activating %s", "plugin" ),
)
)
.text( __( "Activating..." ) );

wp.updates.activatePlugin(
{
name: $activateButton.data( "name" ),
slug: $activateButton.data( "slug" ),
plugin: $activateButton.data( "plugin" )
}
);
});

/**
* Pulls available jobs from the queue and runs them.
*
* @since 4.2.0
* @since 4.6.0 Can handle multiple job types.
*/
wp.updates.queueChecker = function() {
var job;

if ( wp.updates.ajaxLocked || ! wp.updates.queue.length ) {
return;
}

job = wp.updates.queue.shift();

// Handle a queue job.
switch ( job.action ) {
case 'install-plugin':
wp.updates.installPlugin( job.data );
break;

case 'update-plugin':
wp.updates.updatePlugin( job.data );
break;

case 'delete-plugin':
wp.updates.deletePlugin( job.data );
break;

case 'install-theme':
wp.updates.installTheme( job.data );
break;

case 'update-theme':
wp.updates.updateTheme( job.data );
break;

case 'delete-theme':
wp.updates.deleteTheme( job.data );
break;

case 'check_plugin_dependencies':
wp.updates.checkPluginDependencies( job.data );
break;

default:
break;
}
};
})( jQuery, window.wp, window._wpUpdatesSettings );
Loading

0 comments on commit 31fab91

Please sign in to comment.