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

Function showModal

missav-explorer/missav-explorer.user.js:1097–1123  ·  view source on GitHub ↗
(message, autoCloseDelay = 0)

Source from the content-addressed store, hash-verified

1095
1096 // 创建或更新模态窗口
1097 function showModal(message, autoCloseDelay = 0) {
1098 // 如果模态窗口不存在,则创建新的模态窗口
1099 if (!modalContainer) {
1100 modalContainer = document.createElement('div')
1101 modalContainer.className = 'modal-container'
1102 modalContainer.style.cssText = `
1103 position: fixed;
1104 top: 50%;
1105 left: 50%;
1106 transform: translate(-50%, -50%);
1107 background-color: rgba(255, 255, 255, 0.9);
1108 border-radius: 8px;
1109 box-shadow: 0 4px 8px rgba(0, 0, 0, 0.1);
1110 z-index: 9999;
1111 padding: 20px;
1112 `
1113 document.body.appendChild(modalContainer)
1114 }
1115
1116 // 更新模态窗口的内容
1117 modalContainer.textContent = message
1118
1119 // 自动关闭模态窗口
1120 if (autoCloseDelay > 0) {
1121 setTimeout(closeModal, autoCloseDelay)
1122 }
1123 }
1124
1125 // 关闭模态窗口
1126 function closeModal() {

Callers 7

fetchJsonDataFunction · 0.85
fetchPageFunction · 0.85
processPageContentFunction · 0.85
checkIfCompleteFunction · 0.85
downloadAllZipsFunction · 0.85
loginFunction · 0.85
downloadSelectedFilesFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected