103 lines
No EOL
10 KiB
JavaScript
103 lines
No EOL
10 KiB
JavaScript
/*jshint esversion: 6 */
|
|
// ==UserScript==
|
|
// @name Builded
|
|
// @namespace https://git.swee.codes/swee/Builded
|
|
// @version 0.1
|
|
// @description Vencord, but for Guilded
|
|
// @author Swee
|
|
// @match https://*.guilded.gg/*
|
|
// @match https://builded.swee.codes/settings
|
|
// @icon https://git.swee.codes/swee/Builded/raw/branch/main/Builded-solid.svg
|
|
// @grant GM_setValue
|
|
// @grant GM_getValue
|
|
// @require https://code.jquery.com/jquery-3.7.1.min.js
|
|
// @require https://github.com/pie6k/jquery.initialize/raw/refs/heads/master/jquery.initialize.min.js
|
|
// @run-at document-body
|
|
// ==/UserScript==
|
|
function waitForElm(selector) {
|
|
return new Promise(resolve => {
|
|
if (document.querySelector(selector)) {
|
|
return resolve(document.querySelector(selector));
|
|
}
|
|
|
|
const observer = new MutationObserver(mutations => {
|
|
if (document.querySelector(selector)) {
|
|
observer.disconnect();
|
|
resolve(document.querySelector(selector));
|
|
}
|
|
});
|
|
|
|
// If you get "parameter 1 is not of type 'Node'" error, see https://stackoverflow.com/a/77855838/492336
|
|
observer.observe(document.body, {
|
|
childList: true,
|
|
subtree: true
|
|
});
|
|
});
|
|
}
|
|
(async () => {
|
|
let settings_HTML = `
|
|
<p>There are no features here... Want to suggest some <a target="_blank" class=link onclick="window.close()" href="https://discuss.swee.codes/c/10">here?</a> :3</p>
|
|
`;
|
|
|
|
let customloader = await GM.getValue("customLoader", `
|
|
<img height="90px" src="data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAQAAAAEACAYAAABccqhmAAAACXBIWXMAAE69AABOvQFzamgUAAAAGXRFWHRTb2Z0d2FyZQB3d3cuaW5rc2NhcGUub3Jnm+48GgAAAFV0RVh0Q29weXJpZ2h0AENDIEF0dHJpYnV0aW9uLU5vbkNvbW1lcmNpYWwgaHR0cDovL2NyZWF0aXZlY29tbW9ucy5vcmcvbGljZW5zZXMvYnktbmMvNC4wL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KFUBsRot/sDivw4B/HuPPCflRZN2uFzCWALOY57Wcak0FkIIBpsVbt/8rcBYEmpasXm7FOS2nGX6mSgWQht6fB9hZ27+GMa/nE4qmfLhgXMdq3lPH3f6dqQBS0B/pPMDOBnwY52SgdzPapHm4MILzcQb8w5zhvblIKyIVQAq2RTwE2FnbH2Jvjsf5t9hRInmGLm0G/XOxg/SKCiAN+8UO8LKTfAuD/qc459CkC4aMr7ONY5nl344dpZdUAGmYHjvAqwz6jTjHU/8Zhldj/AkD/C6n+Yuxw/SaCiAFLWbEjrBLg76cts/BeCfwTOw4gfn4E3zezIDfAJ7yKcnKqABS0GL/2BF2a8BvZwtvwfn8+Px3eTO+S5cTGfQP0PY1sePEpAJIQ3qHAK80z9cz6B9jlMOAS7BAzzPsrWUY72SAE5nl340dJgUqgBR0Ez0E2JXZ/lPa/jds43DgM5k8jPRbOG3afgoDfntTd/d3RQWQAsuoACbM9VW0/ZNM45cwzgTuIPQTjsp5FuNKnGNp+1wGfXHsQCmKewWaTMivACac5FuA+cB8OnYozvswzgCOA/p6nOZ54E6cmxhkibb0e6YCSEGOewC70vZngUuBS+nYdOBEYA4wB+c4LPge5wbgXmAhzkIG+YHe9FOTfwH0s5mxLVCKWsBrJ/Fzz1YdpOfG5stbOP4HltkMRjgK50jgaFocBbwB5yDGToJO/JkwAmzEeAnYCKyky3LgEYxHabGcmV63jyZ7zlyFKSlZageygc3Mc92d2AMqAJEG06cAIg2mAhBpMBWASIOpAEQaTAUg0mAqAJEGUwGINJgKQKTBVAAiDaYCEGkwFYBIg6kARBpMBSDSYCoAkQZTAYg0mApApMFUACINpgIQabD/A0Bhb1PuxiEJAAAAAElFTkSuQmCC" />
|
|
<hr>Guilded load...
|
|
`)
|
|
let customloader_enable = await GM.getValue("customLoaderEnable", true)
|
|
let settings_entry = `
|
|
<div onclick="window.location = 'https://www.guilded.gg/explore/servers/overview';" class="DraggableHandle-container NavV4SelectorRow-container NavV4TeamSelectorBottomOptionsList-row">
|
|
<div class="NavV4SelectorRow-icon-container">
|
|
<div class="SVGIcon-container NavV4SelectorRow-svg-icon">
|
|
<svg class="icon SVGIcon-icon icon-globe" shape-rendering="geometricPrecision" role="img">
|
|
<use xml:space="http://www.w3.org/1999/xlink" xlink:href="#icon-globe"></use>
|
|
</svg>
|
|
</div>
|
|
</div>
|
|
<div class="NavV4SelectorRow-row-content">
|
|
<div class="NavV4TeamSelectorBottomOptionsList-label">
|
|
Discover
|
|
</div>
|
|
</div>
|
|
</div>
|
|
<div onclick="window.location = 'https://www.guilded.gg/chat';" class="DraggableHandle-container NavV4SelectorRow-container NavV4TeamSelectorBottomOptionsList-row NavV4TeamSelectorBottomOptionsList-dms">
|
|
<div class="NavV4SelectorRow-icon-container">
|
|
<div class="SVGIcon-container NavV4SelectorRow-svg-icon">
|
|
<svg class="icon SVGIcon-icon icon-dm" shape-rendering="geometricPrecision" role="img">
|
|
<use xml:space="http://www.w3.org/1999/xlink" xlink:href="#icon-dm">
|
|
</use>
|
|
</svg>
|
|
</div>
|
|
</div>
|
|
<div class="NavV4SelectorRow-row-content">
|
|
<div class="NavV4TeamSelectorBottomOptionsList-label">
|
|
Direct messages
|
|
</div>
|
|
</div>
|
|
</div>
|
|
<div onclick='window.open("https://builded.swee.codes/settings", "ree", "titlebar=yes,menubar=no,height=500px,width=300px,menubar=no,status=no");' class="DraggableHandle-container NavV4SelectorRow-container NavV4TeamSelectorBottomOptionsList-row">
|
|
<div class="NavV4SelectorRow-icon-container">
|
|
<div class="SVGIcon-container NavV4SelectorRow-svg-icon">
|
|
<img src="https://git.swee.codes/swee/Builded/raw/branch/main/Builded-solid.svg" height="32">
|
|
</div>
|
|
</div>
|
|
<div class="NavV4SelectorRow-row-content">
|
|
<div class="NavV4TeamSelectorBottomOptionsList-label">
|
|
Builded settings
|
|
</div>
|
|
</div>
|
|
</div>
|
|
`
|
|
if (location.host == "www.guilded.gg") {
|
|
console.info("Guilded.GG detected.");
|
|
$.initialize('.NavV4TeamSelectorBottomOptionsList-container', function() {
|
|
console.info("Injecting settings entry...")
|
|
$(this)[0].innerHTML = settings_entry;
|
|
});
|
|
$.initialize('#loading', function() {
|
|
$(this)[0].innerHTML = customloader;
|
|
});
|
|
} else {
|
|
document.body.innerHTML += settings_HTML;
|
|
}
|
|
console.info("Builded Loaded <3");
|
|
})(); |