-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathFilterable.php
More file actions
42 lines (33 loc) · 1021 Bytes
/
Filterable.php
File metadata and controls
42 lines (33 loc) · 1021 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
<?php if (!defined('PmWiki')) exit();
/**
Filterable lists and tables for PmWiki
Written by (c) Petko Yotov 2020-2025 www.pmwiki.org/petko
License: MIT
This extension creates search boxes for large lists and tables.
*/
$RecipeInfo['Filterable']['Version'] = '2025-07-22';
SDVA($Filterable, [
'selector' => 'ul.filterable, ol.filterable, table.filterable',
'minsize' => 5,
]);
SDVA($InputTags['filterbox'], [
':html' => "<input type='search' \$InputFormArgs />",
'class' => 'inputbox noprint',
'size' => 30,
'data-filterbox' => 1,
':args' => ['data-selector', 'data-minsize'],
]);
function initFilterable() {
global $Filterable;
$conf = extGetConfig($Filterable);
$dataconf = [
'selector' => $conf['selector'],
'minsize' => $conf['minsize'],
'ftable' => XL('Filter table'),
'flist' => XL('Filter list'),
];
$attrs = [];
$attrs['filterable.js']['data-conf'] = $dataconf;
extAddResource('jets/jets.min.js filterable.js', $attrs);
}
initFilterable();