diff --git a/docs/NEWS b/docs/NEWS
index 69090aca..fb8bf088 100644
--- a/docs/NEWS
+++ b/docs/NEWS
@@ -4,6 +4,10 @@
Version 2.0-beta3 ()
------------------------------------------------------------------------
+ * Changed JS for category filtering and its reset button to be a
+ reusable function, which is now also used in the list of
+ installable plugins.
+
* Fixed wrong local documentation URL in plugin configuration
* Added new "backend_dashboard" event-hook for plugins to use
diff --git a/templates/2k11/admin/entries.tpl b/templates/2k11/admin/entries.tpl
index 5e62fd59..3faebf72 100644
--- a/templates/2k11/admin/entries.tpl
+++ b/templates/2k11/admin/entries.tpl
@@ -111,7 +111,7 @@
{$CONST.FILTERS}
- {$CONST.RESET_FILTERS}
+ {$CONST.RESET_FILTERS}
{foreach from=$entry_vars.category_options item="entry_cat"}
diff --git a/templates/2k11/admin/plugins.inc.tpl b/templates/2k11/admin/plugins.inc.tpl
index c3e53143..983e02de 100644
--- a/templates/2k11/admin/plugins.inc.tpl
+++ b/templates/2k11/admin/plugins.inc.tpl
@@ -52,19 +52,27 @@
-
- {$CONST.FILTERS}
-
- {foreach $groupnames as $available_group => $available_name}
- {$available_name}
- {/foreach}
- {$CONST.ALL_CATEGORIES}
- {$CONST.WORD_NEW}
-
-
+
+
{foreach $pluggroups AS $pluggroup => $groupstack}
@@ -77,21 +85,23 @@
{foreach $groupstack as $plug}
-
{$plug.name}
+
+
{$plug.name}
- {if $plug.description}
-
- {$plug.class_name}
+ {if $plug.description}
+
+ {$plug.class_name}
-
- {$plug.description}
+
+ {$plug.description}
+
+
+ {else}
+
+ {$plug.class_name}
-
- {else}
-
- {$plug.class_name}
+ {/if}
- {/if}
{if ! empty($plug.author)}
diff --git a/templates/2k11/admin/serendipity_editor.js.tpl b/templates/2k11/admin/serendipity_editor.js.tpl
index 3cd062d0..6495b9d3 100644
--- a/templates/2k11/admin/serendipity_editor.js.tpl
+++ b/templates/2k11/admin/serendipity_editor.js.tpl
@@ -625,6 +625,24 @@
}
}
+ serendipity.liveFilters = function(input, target, elem) {
+ var currentInput = $(input).val().toLowerCase();
+
+ if (currentInput == '') {
+ $(target).toggle(true);
+ } else {
+ $(target).each(function() {
+ var $el = $(this);
+
+ if ($el.find(elem).html().toLowerCase().indexOf(currentInput) > -1) {
+ $el.toggle(true);
+ } else {
+ $el.toggle(false);
+ }
+ });
+ }
+ }
+
}( window.serendipity = window.serendipity || {}, jQuery ));
// Source: https://github.com/yatil/accessifyhtml5.js
@@ -980,27 +998,20 @@ $(function() {
}
{/if}
- // Category filter
+ // Category live filter
$('#categoryfilter').keyup(function() {
- var current_categoryfilter = $(this).val().toLowerCase();
-
- if (current_categoryfilter == '') {
- $('#edit_entry_category .form_check').toggle(true);
- } else {
- $('#edit_entry_category .form_check').each(function() {
- var $el = $(this);
- if ($el.find('label').html().toLowerCase().indexOf(current_categoryfilter) > -1) {
- $el.toggle(true);
- } else {
- $el.toggle(false);
- }
- });
- }
+ serendipity.liveFilters($(this), '#edit_entry_category .form_check', 'label');
});
- // Reset button for category filter
- $('#reset_categoryfilter').click(function() {
- $('#categoryfilter').val("").keyup();
+ // Plugins live filter
+ $('#pluginfilter').keyup(function() {
+ serendipity.liveFilters($(this), '.plugins_installable > li', '.plugin_features');
+ });
+
+ // Reset button for live filters
+ $('.reset_livefilter').click(function() {
+ var target = '#' + $(this).attr('data-target');
+ $(target).val('').keyup();
});
// Advanced options
diff --git a/templates/2k11/admin/style.css b/templates/2k11/admin/style.css
index bbfdd081..9484370a 100644
--- a/templates/2k11/admin/style.css
+++ b/templates/2k11/admin/style.css
@@ -507,7 +507,8 @@ form > button,
}
.overviewListForm > button,
-.ping_services .form_check {
+.ping_services .form_check,
+.plugins_installable {
margin-top: 0;
margin-bottom: 0;
}
@@ -2708,12 +2709,18 @@ img.mfp-img {
.entryproperties_access_groups,
.entryproperties_access_users,
.entryproperties_access_author,
- .entryproperties_markup {
+ .entryproperties_markup,
+ #plugin_groups,
+ #plugin_filter {
float: left;
margin-right: 2%;
width: 48%;
}
+ #plugin_groups .form_buttons {
+ margin-bottom: 0;
+ }
+
.entryproperties_customfields {
clear: both;
}