jQuery advanced filter list plugin

This is a plugin for realtime list filtering using a text input. It’s very simple in use. Look at examples below:

Init filter:

$(document).ready(function() {
$('ul.dynamic-search-list').filterList({
inputSelector: '#filter-input'
});
});

inputSelector is the only option required by plugin. It’s a jQuery selector for input field that will be used for list filtering.

Detach filter:

$('ul#2').filterList('detach');

Disable filtering for the specified list (by a selector).

Optional settings:

  • caseSensitive true|false – enable or disable letter case sensitivity (it’s turned off by default).
  • noResultsText string – text that appears if no element matches text (by default it’s english).
  • duration integer – animation speed in miliseconds.
  • zebra true|false – add even class to even elements on the list (true by default).

Demo:

Check demo at: http://realhe.ro/demo/jquery-filter-list/

Download:

Smarty gettext with domain support (block t plugin) [depreciated]

Attention! Official Gettext plugin for Smarty has domain support since version 1.1. Check official repository: https://github.com/smarty-gettext/smarty-gettext.

Description:

This is a Smarty gettext plugin modification. It enables domain support and utilize gettext wrapper for PHP,

Why do I use such wrapper for a gettext? It’s simple, not every server has native support for translation. This crafty script gives you fallback in case if it does not.

Usage example:

Init before any template parsed by Smarty:

// include gettext wrapper for PHP
include('./php-gettext/gettext.inc');
 
// set locale
T_setlocale(LC_MESSAGES, 'en_US');
 
// load lang file
/* loads ./lang/en_US/LC_MESSAGES/example.mo (do not close path with final slash) */
T_bindtextdomain('example', './lang'); 
T_bind_textdomain_codeset('example', 'utf-8'); /* just in case */ 
 
// set default domain 
T_textdomain('default');

Smarty syntax example:

{t domain="example"}This text will be translated using gettext domain example.{/t}
{t}This text will be translated using standard gettext domain.{/t}

Installation:

Simply put file block.t.php into Smarty plugins directory.

Download: