vb
https://lh3.googleusercontent.com/a-/AOh14GgA2surNY12MbC2gt4iQ9umb7GxXqyt2qlldnzXwI8#.png
Сторінка Віталій Бондаря
--------------
Модифікація поведінки і зовнішнього вигляду Scrapbox для користувача
Спливне меню внизу
https://scrapbox.io/files/5f7f472264c2d40025b8712a.mp4
code:script.js
if (/Macintosh/.test(navigator.userAgent) && !/Porter/.test(navigator.userAgent)) {
setTimeout(() => {
const observer = new MutationObserver(records => {
for (const record of records) {
for (const node of record.addedNodes) {
if (node.getAttribute('class') !== 'selections') {
continue;
}
const popup = node.getElementsByClassName('popup-menu')0; if (!popup) return;
popup.style.top = (() => {
const selectionList = document.getElementsByClassName('selection');
let lowestSelection = selectionList0; const length = selectionList.length;
if (length !== 1) {
for (let i = 1; i < length; i++) {
if (parseInt(selectionListi-1.style.top) < parseInt(selectionListi.style.top)) { lowestSelection = selectionListi; }
}
}
return (parseInt(lowestSelection.style.top) + parseInt(lowestSelection.style.height) + popup.clientHeight + 25) + 'px';
})();
const triangleStyle = popup.getElementsByClassName('triangle')0.style; triangleStyle.borderTop = 'none';
triangleStyle.borderBottom = '6px solid #111'; triangleStyle.top = '-6px';
break;
}
}
});
observer.observe(document.getElementById('editor'), { childList: true });
}, 2000);
}