MCPcopy Create free account
hub / github.com/dajie111/nodeseek-userscript / _createStatsDialog

Function _createStatsDialog

focus.js:247–369  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

245 border: 'none', boxShadow: 'none', overflow: 'visible',
246 });
247 if (isMobile()) {
248 Object.assign(dialog.style, {
249 position: 'fixed', top: '0', bottom: '0', left: '0', right: '0',
250 width: '100%', height: 'auto',
251 maxHeight: 'calc(100vh - ' + SAFE_TOP() + 'px - ' + SAFE_BOTTOM() + 'px)',
252 zIndex: '10000',
253 });
254 } else {
255 Object.assign(dialog.style, {
256 position: 'fixed', top: '60px', right: '156px', zIndex: '10000',
257 width: '520px', height: HB_STATS_LOADING_H, maxHeight: HB_STATS_LOADING_H,
258 margin: '0', padding: '0', background: 'transparent',
259 border: 'none', boxShadow: 'none', overflow: 'visible',
260 });
261 }
262
263 const dragArea = document.createElement('div');
264 dragArea.title = '左上角区域拖动窗口';
265 Object.assign(dragArea.style, {
266 position: 'absolute', left: '0', top: '0',
267 width: DRAG_CORNER_PX + 'px', height: DRAG_CORNER_PX + 'px',
268 cursor: 'move', zIndex: '2', background: 'transparent',
269 });
270
271 const closeBtn = document.createElement('button');
272 closeBtn.id = 'hot-topics-dialog-close';
273 closeBtn.type = 'button';
274 closeBtn.textContent = '\u00D7';
275 closeBtn.title = '关闭';
276 if (isMobile()) {
277 Object.assign(closeBtn.style, {
278 position: 'absolute', top: '12px', right: '12px', zIndex: '4',
279 cursor: 'pointer', fontSize: '28px', lineHeight: '1', color: '#fff',
280 border: 'none', background: 'rgba(0,0,0,0.35)', borderRadius: '50%',
281 padding: '8px', minWidth: '44px', minHeight: '44px',
282 fontFamily: 'inherit', boxShadow: 'none',
283 });
284 } else {
285 Object.assign(closeBtn.style, {
286 position: 'absolute', top: '6px', right: '6px', zIndex: '4',
287 cursor: 'pointer', fontSize: '22px', lineHeight: '1', color: '#999',
288 border: 'none', background: 'rgba(255,255,255,0.92)', borderRadius: '8px',
289 padding: '2px 10px', minHeight: 'auto', fontFamily: 'inherit',
290 boxShadow: '0 1px 4px rgba(0,0,0,.08)',
291 });
292 }
293 closeBtn.onclick = () => {
294 const keepSubs = this._subPanels && this._subPanels.size > 0;
295 if (keepSubs) this._parkStatsIframeBridge(dialog);
296 else this._closeAllSubDialogs();
297 dialog.remove();
298 if (!keepSubs) this._statsIframe = null;
299 };
300
301 let iframe = this._statsIframe;
302 const canReuseBridge = iframe && iframe.parentNode && document.body.contains(iframe) &&
303 iframe.contentWindow &&
304 !document.getElementById('hot-topics-dialog') &&

Callers

nothing calls this directly

Calls 3

SAFE_TOPFunction · 0.85
SAFE_BOTTOMFunction · 0.85
isMobileFunction · 0.70

Tested by

no test coverage detected