mirror of
https://www.gitlink.org.cn/mayx/mayx.gitlink.net
synced 2026-05-22 17:22:24 +00:00
Update 6 files
- /assets/js/pjax.js - /assets/js/gitalk.min.js - /assets/js/jquery.min.js - /assets/css/gitalk.css - /_data/proxylist.yml - /_tools/stormkit-env_install
This commit is contained in:
@@ -1274,5 +1274,3 @@
|
||||
transform: rotate(360deg);
|
||||
}
|
||||
}
|
||||
|
||||
/*# sourceMappingURL=gitalk.css.map*/
|
||||
3
assets/js/gitalk.min.js
vendored
3
assets/js/gitalk.min.js
vendored
File diff suppressed because one or more lines are too long
1
assets/js/jquery.min.js
vendored
1
assets/js/jquery.min.js
vendored
File diff suppressed because one or more lines are too long
@@ -184,7 +184,28 @@
|
||||
$(document).on('pjax:error', function (xhr, textStatus, error) {
|
||||
console.warn('[pjax] error, fallback:', error);
|
||||
});
|
||||
$(document).on('pjax:end', function (event, xhr, options) {
|
||||
var $container = $(options.container || PJAX_OPTS.container);
|
||||
|
||||
$container.find('script[type="module"]').each(function () {
|
||||
var oldScript = this;
|
||||
var newScript = document.createElement('script');
|
||||
newScript.type = 'module';
|
||||
|
||||
// 如果是外链脚本 (<script src="..."></script>)
|
||||
if (oldScript.src) {
|
||||
newScript.src = oldScript.src;
|
||||
} else {
|
||||
// 如果是行内脚本 (<script>...code...</script>)
|
||||
newScript.textContent = oldScript.textContent;
|
||||
}
|
||||
// 插入到 body 中触发浏览器执行
|
||||
document.body.appendChild(newScript);
|
||||
|
||||
// 运行完后建议移除,防止 DOM 变得混乱(不影响模块执行)
|
||||
newScript.remove();
|
||||
});
|
||||
});
|
||||
// 首次加载初始化
|
||||
reinitCopyButtons();
|
||||
});
|
||||
|
||||
Reference in New Issue
Block a user