(content, href, time, wordColor, backColor)
| 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"; |
no test coverage detected