| 123456789101112131415161718192021222324252627282930313233343536373839 |
- (function () {
- var HIDE_AT_ROOT = new Set(['content', 'excels', 'excels_html', 'pdfs', 'words', 'words_html']);
- function isRootFilesPath(path) {
- var p = (path || '').replace(/\/+$/, '');
- return p === '' || p === '/files';
- }
- function textOf(el) {
- var n = el.querySelector && el.querySelector('.name');
- var t = n ? (n.textContent || '') : (el.textContent || '');
- return t.trim();
- }
- function hideDefaultFoldersAtRoot() {
- if (!isRootFilesPath(location.pathname)) return;
- var items = document.querySelectorAll('#listing .item');
- items.forEach(function (item) {
- var name = textOf(item);
- if (!name || !HIDE_AT_ROOT.has(name)) return;
- // hide item card/row without affecting backend data
- item.style.display = 'none';
- item.setAttribute('data-fb-hidden-default', '1');
- });
- }
- function apply() {
- hideDefaultFoldersAtRoot();
- }
- var ob = new MutationObserver(function () { apply(); });
- ob.observe(document.documentElement, { childList: true, subtree: true });
- apply();
- setTimeout(apply, 100);
- setTimeout(apply, 400);
- })();
|