mirror of
https://github.com/fireinrain/JHS-enhance.git
synced 2026-09-28 07:36:38 +08:00
修复115固有jq导致加载冲突
This commit is contained in:
Vendored
+7
-5
@@ -1100,7 +1100,7 @@
|
||||
);
|
||||
insertStyle(mainCss);
|
||||
insertStyle(subtitleModalCss);
|
||||
window.jQuery = $$1;
|
||||
window.$ = window.jQuery = $$1;
|
||||
if (typeof $$1.trim !== "function") {
|
||||
$$1.trim = function (text) {
|
||||
return text == null ? "" : (text + "").trim();
|
||||
@@ -16944,10 +16944,11 @@ ${err.stack}` : "");
|
||||
var el;
|
||||
}));
|
||||
})();
|
||||
if (typeof layer !== "undefined") {
|
||||
const originalLayerClose = layer.close;
|
||||
layer.close = function(index) {
|
||||
layer.close = function (index) {
|
||||
const result = originalLayerClose.call(this, index);
|
||||
!(function(waitTime = 10) {
|
||||
!(function (waitTime = 10) {
|
||||
setTimeout((() => {
|
||||
const openLayerCount = document.querySelectorAll(".layui-layer-shade").length;
|
||||
document.documentElement.style.overflow = openLayerCount > 0 ? "hidden" : "";
|
||||
@@ -16956,14 +16957,15 @@ ${err.stack}` : "");
|
||||
return result;
|
||||
};
|
||||
const originalLayerOpen = layer.open;
|
||||
layer.open = function(options) {
|
||||
layer.open = function (options) {
|
||||
const originalSuccess = (options = options || {}).success;
|
||||
options.success = function(layero, index) {
|
||||
options.success = function (layero, index) {
|
||||
"function" == typeof originalSuccess && originalSuccess.call(this, layero, index);
|
||||
utils.setupEscClose(index);
|
||||
};
|
||||
return originalLayerOpen.call(this, options);
|
||||
};
|
||||
}
|
||||
utils.importResource("https://cdn.jsdelivr.net/npm/layui-layer@1.0.9/layer.min.css");
|
||||
utils.importResource("https://cdn.jsdelivr.net/npm/toastify-js@1.12.0/src/toastify.min.css");
|
||||
utils.importResource("https://cdn.jsdelivr.net/npm/viewerjs@1.11.1/dist/viewer.min.css");
|
||||
|
||||
+1
-3
@@ -6,7 +6,7 @@ import Viewer from 'viewerjs';
|
||||
import QRCode from 'qrcodejs';
|
||||
import { currentHref, isJavDb, isJavBus, isSearchPage, Status_RUNNING, Status_SUCCESS, Status_FAIL, Status_LOADING, Status_FILTER, Status_FAVORITE, Status_HAS_DOWN, Status_HAS_WATCH, NO, YES } from './constants.js';
|
||||
|
||||
window.jQuery = $;
|
||||
window.$ = window.jQuery = $;
|
||||
if (typeof $.trim !== 'function') {
|
||||
$.trim = function (text) {
|
||||
return text == null ? '' : (text + '').trim();
|
||||
@@ -32,5 +32,3 @@ window.Status_HAS_DOWN = Status_HAS_DOWN;
|
||||
window.Status_HAS_WATCH = Status_HAS_WATCH;
|
||||
window.NO = NO;
|
||||
window.YES = YES;
|
||||
|
||||
import 'layui-layer';
|
||||
+10
-8
@@ -820,29 +820,31 @@ window.ImageHoverPreview = class {
|
||||
}));
|
||||
}();
|
||||
|
||||
const originalLayerClose = layer.close;
|
||||
if (typeof layer !== 'undefined') {
|
||||
const originalLayerClose = layer.close;
|
||||
|
||||
layer.close = function(index) {
|
||||
layer.close = function (index) {
|
||||
const result = originalLayerClose.call(this, index);
|
||||
!function(waitTime = 10) {
|
||||
!function (waitTime = 10) {
|
||||
setTimeout((() => {
|
||||
const openLayerCount = document.querySelectorAll(".layui-layer-shade").length;
|
||||
document.documentElement.style.overflow = openLayerCount > 0 ? "hidden" : "";
|
||||
}), waitTime);
|
||||
}();
|
||||
return result;
|
||||
};
|
||||
};
|
||||
|
||||
const originalLayerOpen = layer.open;
|
||||
const originalLayerOpen = layer.open;
|
||||
|
||||
layer.open = function(options) {
|
||||
layer.open = function (options) {
|
||||
const originalSuccess = (options = options || {}).success;
|
||||
options.success = function(layero, index) {
|
||||
options.success = function (layero, index) {
|
||||
"function" == typeof originalSuccess && originalSuccess.call(this, layero, index);
|
||||
utils.setupEscClose(index);
|
||||
};
|
||||
return originalLayerOpen.call(this, options);
|
||||
};
|
||||
};
|
||||
}
|
||||
|
||||
utils.importResource("https://cdn.jsdelivr.net/npm/layui-layer@1.0.9/layer.min.css");
|
||||
|
||||
|
||||
@@ -99,23 +99,8 @@ export default defineConfig({
|
||||
'tabulator-tables': 'Tabulator',
|
||||
'viewerjs': 'Viewer',
|
||||
'qrcodejs': 'QRCode',
|
||||
'layui-layer': 'layer',
|
||||
},
|
||||
},
|
||||
}),
|
||||
{
|
||||
name: 'layui-layer-dev-shim',
|
||||
apply: 'serve',
|
||||
resolveId(id) {
|
||||
if (id === 'layui-layer') {
|
||||
return '\0layui-layer-shim';
|
||||
}
|
||||
},
|
||||
load(id) {
|
||||
if (id === '\0layui-layer-shim') {
|
||||
return 'export default window.layer;';
|
||||
}
|
||||
},
|
||||
},
|
||||
],
|
||||
});
|
||||
Reference in New Issue
Block a user