chore: 规范命名

This commit is contained in:
MoonLeeeaf
2024-05-29 17:40:10 +08:00
parent 9f456b95c1
commit 822a4ad4da
6 changed files with 559 additions and 24 deletions

View File

@@ -19,6 +19,7 @@
* limitations under the License.
*/
// 2024.5.28 睡着了
const sleep = (t) => new Promise((res) => setTimeout(res, t))
const UrlArgs = new URL(location.href).searchParams
@@ -28,28 +29,6 @@ function isMobile() {
return ('ontouchstart' in document.documentElement);
}
function setOnRightClick(e, cb) {
if (!(e instanceof jQuery))
e = $(e)
let longPressTimer
if (!cb) throw new Error("定义回调!!!!")
e.on('contextmenu', function (e) {
e.preventDefault() // 阻止默认右键菜单
cb()
})
e.on('mousedown', function () {
longPressTimer = setTimeout(function () {
cb()
}, 1000)
})
e.on('mouseup', function () {
clearTimeout(longPressTimer)
});
}
if (UrlArgs.get("debug")) {
let script = document.createElement('script')
script.src = "//cdn.jsdelivr.net/npm/eruda"