ace editor

This commit is contained in:
Nova Cat 2024-11-30 21:39:48 -08:00
parent a5540cd3b6
commit cced136a3b

View file

@ -50,6 +50,33 @@ background: #013e6d !important;
.pale, i.pale, .directory_listing_table {
color: white !important;
opacity: 1;
}
/* Ace editor */
.ace-tm .ace_gutter {
}
`;
document.body.appendChild(style);
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
});
});
}
document.body.appendChild(style);
waitForElm('.ace_gutter').then((elm) => {
Anywhere.Editor.editor.setOption("theme", "ace/theme/tomorrow_night")
});