MCPcopy
hub / github.com/ChinaGodMan/UserScripts / createControl

Function createControl

missav-explorer/missav-explorer.user.js:1421–1438  ·  view source on GitHub ↗
(tagName, attributes = {}, styles = {}, parent = document.body)

Source from the content-addressed store, hash-verified

1419 }
1420 // 创建设置界面
1421 function createControl(tagName, attributes = {}, styles = {}, parent = document.body) {
1422 const element = document.createElement(tagName)
1423
1424 // 设置属性
1425 for (const key in attributes) {
1426 element[key] = attributes[key]
1427 }
1428
1429 // 设置样式
1430 Object.assign(element.style, styles)
1431
1432 // 添加到父元素
1433 if (parent) {
1434 parent.appendChild(element)
1435 }
1436
1437 return element
1438 }
1439
1440 function createSettingsUI() {
1441 const modalContainer = createControl('div', {

Callers 1

createSettingsUIFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected