Diferencia entre revisiones de «Usuario:Fbstj/g:pretty-cats»
Ir a la navegación
Ir a la búsqueda
m (+) |
m (+) |
||
Línea 3: | Línea 3: | ||
* make really big categories easier to navigate |
* make really big categories easier to navigate |
||
* filter big category lists by letter, by prefix/search box |
* filter big category lists by letter, by prefix/search box |
||
+ | <pre> |
||
+ | <!-- above page list --> |
||
+ | <label>Filter: <input type="search" id="cat_filter"></label> |
||
+ | |||
+ | cat_filter.onsearch = function filter_list(ev) { |
||
+ | const re = new RegExp(cat_filter.value, 'i') |
||
+ | this.closest('#mw-pages').querySelectorAll('li').forEach(function check_item(li) { |
||
+ | if (re.test(li.textContent)) { |
||
+ | li.style.display = '' |
||
+ | } else { |
||
+ | li.style.display = 'none' |
||
+ | } |
||
+ | }) |
||
+ | } |
||
+ | // TODO: better than li.style.display manips |
||
+ | </pre> |
||
* filter by quality/other properties/templates/etc |
* filter by quality/other properties/templates/etc |
||
* show pages|subcats|media as tabs |
* show pages|subcats|media as tabs |
Revisión actual del 10:08 7 may 2020
make categories prettier & more useful
- make really big categories easier to navigate
- filter big category lists by letter, by prefix/search box
<!-- above page list --> <label>Filter: <input type="search" id="cat_filter"></label> cat_filter.onsearch = function filter_list(ev) { const re = new RegExp(cat_filter.value, 'i') this.closest('#mw-pages').querySelectorAll('li').forEach(function check_item(li) { if (re.test(li.textContent)) { li.style.display = '' } else { li.style.display = 'none' } }) } // TODO: better than li.style.display manips
- filter by quality/other properties/templates/etc
- show pages|subcats|media as tabs
- improve media gallery?
- fix cat-edit to show preview above item lists
- category tree stuff?