-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathkusted_kontent_app_concise.user.js
46 lines (41 loc) · 1.94 KB
/
kusted_kontent_app_concise.user.js
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
43
44
45
46
// ==UserScript==
// @name Kontent app beautification
// @namespace https://kontent.ai/learn
// @version 3.1.4
// @description Collapses large padding, hides guidelines when not editing, makes editable parts of the app more prominent, always shows all filters.
// @author Tomas Nosek, Kontent.ai
// @include https://app.kontent.ai/*
// @icon https://raw.githubusercontent.com/Kontent-ai-Learn/tampermonkey-scripts/master/files/custedlogo_48.png
// @updateURL https://github.com/Kontent-ai-Learn/tampermonkey-scripts/raw/master/kusted_kontent_app_concise.user.js
// @downloadURL https://github.com/Kontent-ai-Learn/tampermonkey-scripts/raw/master/kusted_kontent_app_concise.user.js
// @resource IMPORTED_CSS https://raw.githubusercontent.com/Kontent-ai-Learn/tampermonkey-scripts/master/files/kusted_kontent_app_concise.css
// @require https://ajax.googleapis.com/ajax/libs/jquery/3.6.0/jquery.min.js
// @grant GM_getResourceText
// @grant GM_addStyle
// @commithandle Kontent.ai concise
// ==/UserScript==
(function() {
'use strict';
var $ = window.jQuery;
const css = GM_getResourceText("IMPORTED_CSS");
GM_addStyle(css);
let observer = new MutationObserver((mutations) => {
mutations.forEach((mutation) => {
if (!mutation.addedNodes) return
for (let i = 0; i < mutation.addedNodes.length; i++) {
// Show all saved filters
if (window.location.href.indexOf("/content-inventory/") > -1) {
let node = mutation.addedNodes[i];
if (node.innerText != null && node.innerText.toLowerCase().indexOf('show all filters') > -1)
{
$(node).find('button:contains("Show all filters")').click();
}
}
}
});
});
observer.observe(document.body, {
childList: true
, subtree: true
});
})();