diff --git a/templates/2k11/admin/plugins.inc.tpl b/templates/2k11/admin/plugins.inc.tpl
index f023d6fb..7db5f128 100644
--- a/templates/2k11/admin/plugins.inc.tpl
+++ b/templates/2k11/admin/plugins.inc.tpl
@@ -71,7 +71,7 @@
{else}
- {$CONST.BACK}
+ {$CONST.BACK}
{/if}
@@ -82,6 +82,7 @@
{foreach $pluggroups AS $pluggroup => $groupstack}
{if $only_group && $pluggroup != $only_group}{continue}{/if}
{foreach $groupnames as $available_group => $available_name}{if $pluggroup == $available_group}{$available_name}{/if}{/foreach}
+ {if $only_group == UPGRADE}{/if}
{foreach $groupstack as $plug}
-
diff --git a/templates/2k11/admin/serendipity_editor.js.tpl b/templates/2k11/admin/serendipity_editor.js.tpl
index 4531978f..094f17af 100644
--- a/templates/2k11/admin/serendipity_editor.js.tpl
+++ b/templates/2k11/admin/serendipity_editor.js.tpl
@@ -794,6 +794,35 @@
}, time);
}
+ serendipity.updateAll = function() {
+ var overlay = $('');
+ overlay.appendTo(document.body);
+ var progress = $('');
+ progress.attr('max', $('.plugin_status').length);
+ progress.appendTo(overlay);
+ $('#updateProgress').attr('value', 0);
+ serendipity.updateNext();
+ }
+
+ serendipity.updateNext = function() {
+ return $.get($('.plugin_status .button_link:visible').first().attr('href'))
+ .done(function() {
+ $('.plugins_installable > li:visible').first().fadeOut();
+ $('#updateProgress').attr('value', parseInt($('#updateProgress').attr('value')) + 1);
+ console.log($('.plugins_installable > li:visible').length);
+ if ($('.plugins_installable > li:visible').length > 0) {
+ return serendipity.updateNext();
+ } else {
+ $('#updateAll').hide();
+ $('#overlay').fadeOut();
+ $('#content').append(' {$CONST.SUCCESS} ');
+ }
+ })
+ .fail(function() {
+ $('#overlay').fadeOut();
+ });
+ }
+
}( window.serendipity = window.serendipity || {}, jQuery ))
$(function() {
@@ -1361,6 +1390,13 @@ $(function() {
});
}
+ // update all button in plugin upgrade menu
+ if ($('#updateAll').length > 0) {
+ $('#updateAll').click(function() {
+ serendipity.updateAll();
+ });
+ }
+
// minify images before upload, approach taken from https://github.com/joelvardy/javascript-image-upload/
{if {serendipity_getConfigVar key='uploadResize'} && ({serendipity_getConfigVar key='maxImgWidth'} > 0 || {serendipity_getConfigVar key='maxImgHeight'} > 0)}
if ($('#uploadform').length > 0) {
diff --git a/templates/2k11/admin/style.css b/templates/2k11/admin/style.css
index 7f0c2210..85bee1c5 100644
--- a/templates/2k11/admin/style.css
+++ b/templates/2k11/admin/style.css
@@ -2402,6 +2402,28 @@ input[name="serendipity[filter][fileCategory]"] {
}
/* end TEMP fixes */
+#overlay {
+ position: fixed;
+ top: 0;
+ left: 0;
+ width: 100%;
+ height: 100%;
+ background-color: rgba(0,0,0,0.5);
+ z-index: 10000;
+}
+
+#updateProgress {
+ margin: auto;
+ display: block;
+ position: relative;
+ top: 48%;
+ margin: auto;
+}
+
+#updateAll {
+ margin-bottom: 1em;
+}
+
/* MAGNIFIC POPUP */
.mfp-bg {
top: 0;