User:Stumblean/common.js: Difference between revisions
No edit summary Tags: Mobile edit Mobile web edit Advanced mobile edit |
No edit summary Tags: Mobile edit Mobile web edit Advanced mobile edit |
||
Line 1: | Line 1: | ||
(function() { | (function() { | ||
// Create | // Create the menu container | ||
const menu = document.createElement("div"); | const menu = document.createElement("div"); | ||
menu.id = "mahitoMenu"; | menu.id = "mahitoMenu"; | ||
Line 22: | Line 22: | ||
menu.appendChild(title); | menu.appendChild(title); | ||
// | // "Open Explanation" button (placeholder) | ||
const | const openBtn = document.createElement("button"); | ||
openBtn.textContent = "Open Explanation"; | |||
openBtn.style.background = "#444"; | |||
openBtn.style.color = "#fff"; | |||
openBtn.style.border = "none"; | |||
openBtn.style.padding = "5px 10px"; | |||
openBtn.style.cursor = "pointer"; | |||
openBtn.onclick = function() { | |||
// do something later | |||
console.log("Open Explanation clicked"); | |||
}; | }; | ||
menu.appendChild( | menu.appendChild(openBtn); | ||
// Add the menu to the page | // Add the menu to the page | ||
document.body.appendChild(menu); | document.body.appendChild(menu); | ||
})(); | })(); |