v1.18.x
barisusakli 9 years ago
parent fea18a050f
commit 77cf860c7a

@ -16,12 +16,18 @@ define('admin/extend/plugins', function() {
$('#plugin-search').val('');
pluginsList.on('click', 'button[data-action="toggleActive"]', function() {
pluginID = $(this).parents('li').attr('data-plugin-id');
var btn = $(this);
var pluginEl = $(this).parents('li');
pluginID = pluginEl.attr('data-plugin-id');
var btn = $('#' + pluginID + ' [data-action="toggleActive"]');
socket.emit('admin.plugins.toggleActive', pluginID, function(err, status) {
btn.html('<i class="fa fa-power-off"></i> ' + (status.active ? 'Deactivate' : 'Activate'));
btn.toggleClass('btn-warning', status.active).toggleClass('btn-success', !status.active);
//clone it to active plugins tab
if (status.active && !$('#active #' + pluginID).length) {
$('#active ul').prepend(pluginEl.clone(true));
}
app.alert({
alert_id: 'plugin_toggled',
title: 'Plugin ' + (status.active ? 'Enabled' : 'Disabled'),
@ -141,6 +147,7 @@ define('admin/extend/plugins', function() {
});
populateUpgradeablePlugins();
populateActivePlugins();
};
function confirmInstall(pluginID, callback) {
@ -235,5 +242,13 @@ define('admin/extend/plugins', function() {
});
}
function populateActivePlugins() {
$('#installed ul li').each(function() {
if ($(this).hasClass('active')) {
$('#active ul').append($(this).clone(true));
}
});
}
return Plugins;
});

@ -1,5 +1,6 @@
<ul class="nav nav-pills">
<li class="active"><a href="#installed" data-toggle="tab">Installed Plugins</a></li>
<li><a href="#active" data-toggle="tab">Active Plugins</a></li>
<li><a href="#download" data-toggle="tab">Download Plugins</a></li>
<li><a href="#upgrade" data-toggle="tab">Upgradable Plugins</a></li>
</ul>
@ -15,6 +16,9 @@
<!-- END installed -->
</ul>
</div>
<div class="tab-pane fade" id="active">
<ul class="active"></ul>
</div>
<div class="tab-pane fade" id="download">
<ul class="download">
<!-- BEGIN download -->

@ -1,5 +1,5 @@
<!-- IF !installed.error -->
<li id="{installed.id}" data-plugin-id="{installed.id}" data-version="{installed.version}" class="clearfix">
<li id="{installed.id}" data-plugin-id="{installed.id}" data-version="{installed.version}" class="clearfix <!-- IF installed.active -->active<!-- ENDIF installed.active -->">
<div class="pull-right">
<!-- IF installed.isTheme -->
<a href="{config.relative_path}/admin/appearance/themes" class="btn btn-info">Themes</a>

Loading…
Cancel
Save