mirror of
https://github.com/LingChair/LingChair-V0.git
synced 2025-12-08 01:55:50 +08:00
chore: 规范命名
This commit is contained in:
@@ -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"
|
||||
|
||||
Reference in New Issue
Block a user