MCPcopy Index your code
hub / github.com/hoothin/UserScripts / showTips

Function showTips

Pagetual/pagetual.user.js:11979–12004  ·  view source on GitHub ↗
(content, href, time, wordColor, backColor)

Source from the content-addressed store, hash-verified

11977
11978 let hideTipsTimeout;
11979 function showTips(content, href, time, wordColor, backColor) {
11980 initView();
11981 document.documentElement.appendChild(tipsWords);
11982 tipsWords.style.color = wordColor || 0xFFFFFF;
11983 tipsWords.style.backgroundColor = backColor || 0x000;
11984 let _time = 1500;
11985 if (href) {
11986 _time = 3500;
11987 setHTML(tipsWords, `<a href='${href}' target='_blank'>${content}</a>`);
11988 tipsWords.style.pointerEvents = 'all';
11989 } else {
11990 setHTML(tipsWords, content);
11991 }
11992 tipsWords.style.marginLeft = -tipsWords.offsetWidth / 2 + "px";
11993 setTimeout(() => {
11994 tipsWords.style.marginLeft = -tipsWords.offsetWidth / 2 + "px";
11995 }, 0);
11996 setTimeout(() => {
11997 tipsWords.style.opacity = 0.8;
11998 clearTimeout(hideTipsTimeout);
11999 hideTipsTimeout = setTimeout(() => {
12000 tipsWords.style.opacity = 0;
12001 tipsWords.style.pointerEvents = '';
12002 }, time || _time);
12003 }, 1);
12004 }
12005
12006 const loadmoreReg = /^\s*((点击?)?(这里)?((看|显示|加载|展开)(更多|剩余)|继续加载)|(點擊?)?(這裡)?((看|顯示|加載|展開)(更多|剩餘)|繼續加載)|load\s*more|もっと読み込む)[\.…▼\s\d%]*$/i;
12007 const defaultLoadmoreSel = ".loadMore,.LoadMore,[class^='load-more'],[class*=' load-more'],.show-more,button.show_more,button[data-testid='more-results-button'],#dataMoreBtn,#btn_preview_remain,.view-more-btn";

Callers 14

pagetual.user.jsFile · 0.85
reachedLastPageMethod · 0.85
initPageMethod · 0.85
noValidContentMethod · 0.85
initMethod · 0.85
getTempRuleMethod · 0.85
showFirstAlertFunction · 0.85
createImportBtnFunction · 0.85
initConfigFunction · 0.85
saveSortMethod · 0.85
delMethod · 0.85
updateRulesFunction · 0.85

Calls 2

initViewFunction · 0.85
setHTMLFunction · 0.70

Tested by

no test coverage detected