Changeset 29263


Ignore:
Timestamp:
08/24/14 22:40:19 (6 years ago)
Author:
flop25
Message:

feature:3049
Add filter box to narrow plugin list, thx to msakik

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/admin/themes/default/template/plugins_new.tpl

    r25005 r29263  
    3232    $.get("admin.php?plugins_new_order="+sortOrder); 
    3333  }); 
     34   
     35  jQuery('#filter').keyup(function(){ 
     36  var filter = $(this).val(); 
     37  if (filter.length>2) { 
     38   $('.pluginBox').hide(); 
     39    $('#availablePlugins .pluginBox input[name="name"]').each(function(){ 
     40      if ($(this).val().toUpperCase().indexOf(filter.toUpperCase()) != -1) { 
     41       $(this).parents('div').show(); 
     42      } 
     43    }); 
     44  } 
     45  else { 
     46    $('.pluginBox').show(); 
     47  } 
     48 }); 
     49 jQuery("#filter").focus(); 
     50 jQuery(".titrePage input[name='Clear']").click(function(){ 
     51   $("#filter").val(''); 
     52   $(".pluginBox").show(); 
     53 }); 
    3454}); 
    3555{/literal}{/footer_script} 
     
    3757<div class="titrePage"> 
    3858<span class="sort"> 
     59{'Filter'|@translate} : <input type="text" id="filter"> 
     60<input type="button" name="Clear" Value="{'Clear'|@translate}"> | 
    3961{'Sort order'|@translate} :  
    4062{html_options name="selectOrder" options=$order_options selected=$order_selected} 
Note: See TracChangeset for help on using the changeset viewer.