mirror of
https://github.com/next-theme/hexo-theme-next.git
synced 2026-01-20 19:02:33 +00:00
Update pjax version
This commit is contained in:
parent
b9a822c4b7
commit
ee3be0a81a
@ -504,7 +504,7 @@ math:
|
|||||||
copy_tex: false
|
copy_tex: false
|
||||||
|
|
||||||
# Easily enable fast Ajax navigation on your website.
|
# Easily enable fast Ajax navigation on your website.
|
||||||
# Dependencies: https://github.com/next-theme/pjax
|
# For more information: https://github.com/next-theme/pjax
|
||||||
pjax: false
|
pjax: false
|
||||||
|
|
||||||
# FancyBox is a tool that offers a nice and elegant way to add zooming functionality for images.
|
# FancyBox is a tool that offers a nice and elegant way to add zooming functionality for images.
|
||||||
@ -902,7 +902,7 @@ vendors:
|
|||||||
copy_tex_js:
|
copy_tex_js:
|
||||||
copy_tex_css:
|
copy_tex_css:
|
||||||
|
|
||||||
# Internal version: 0.2.8
|
# Recommended version: 0.4.0
|
||||||
# pjax: //cdn.jsdelivr.net/gh/next-theme/pjax@0/pjax.min.js
|
# pjax: //cdn.jsdelivr.net/gh/next-theme/pjax@0/pjax.min.js
|
||||||
pjax:
|
pjax:
|
||||||
|
|
||||||
@ -978,7 +978,7 @@ vendors:
|
|||||||
pace:
|
pace:
|
||||||
pace_css:
|
pace_css:
|
||||||
|
|
||||||
# Internal version: 1.0.0
|
# JavaScript 3D library
|
||||||
# three: //cdn.jsdelivr.net/npm/three@0/build/three.min.js
|
# three: //cdn.jsdelivr.net/npm/three@0/build/three.min.js
|
||||||
# three_waves: //cdn.jsdelivr.net/gh/next-theme/theme-next-three@1/three-waves.min.js
|
# three_waves: //cdn.jsdelivr.net/gh/next-theme/theme-next-three@1/three-waves.min.js
|
||||||
# canvas_lines: //cdn.jsdelivr.net/gh/next-theme/theme-next-three@1/canvas_lines.min.js
|
# canvas_lines: //cdn.jsdelivr.net/gh/next-theme/theme-next-three@1/canvas_lines.min.js
|
||||||
|
|||||||
@ -3,7 +3,7 @@
|
|||||||
{{ canonical() }}
|
{{ canonical() }}
|
||||||
|
|
||||||
{# Exports some front-matter variables to Front-End #}
|
{# Exports some front-matter variables to Front-End #}
|
||||||
<script id="page-configurations">
|
<script{{ pjax }} id="page-configurations">
|
||||||
// https://hexo.io/docs/variables.html
|
// https://hexo.io/docs/variables.html
|
||||||
CONFIG.page = {
|
CONFIG.page = {
|
||||||
sidebar: {{ page.sidebar | json }},
|
sidebar: {{ page.sidebar | json }},
|
||||||
|
|||||||
@ -17,33 +17,7 @@ var pjax = new Pjax({
|
|||||||
});
|
});
|
||||||
|
|
||||||
document.addEventListener('pjax:success', () => {
|
document.addEventListener('pjax:success', () => {
|
||||||
document.querySelectorAll('script[data-pjax], script#page-configurations, #pjax script').forEach(element => {
|
pjax.executeScripts(document.querySelectorAll('script[data-pjax], #pjax script'));
|
||||||
var code = element.text || element.textContent || element.innerHTML || '';
|
|
||||||
var parent = element.parentNode;
|
|
||||||
parent.removeChild(element);
|
|
||||||
var script = document.createElement('script');
|
|
||||||
if (element.id) {
|
|
||||||
script.id = element.id;
|
|
||||||
}
|
|
||||||
if (element.className) {
|
|
||||||
script.className = element.className;
|
|
||||||
}
|
|
||||||
if (element.type) {
|
|
||||||
script.type = element.type;
|
|
||||||
}
|
|
||||||
if (element.src) {
|
|
||||||
script.src = element.src;
|
|
||||||
// Force synchronous loading of peripheral JS.
|
|
||||||
script.async = false;
|
|
||||||
}
|
|
||||||
if (element.dataset.pjax !== undefined) {
|
|
||||||
script.dataset.pjax = '';
|
|
||||||
}
|
|
||||||
if (code !== '') {
|
|
||||||
script.appendChild(document.createTextNode(code));
|
|
||||||
}
|
|
||||||
parent.appendChild(script);
|
|
||||||
});
|
|
||||||
NexT.boot.refresh();
|
NexT.boot.refresh();
|
||||||
// Define Motion Sequence & Bootstrap Motion.
|
// Define Motion Sequence & Bootstrap Motion.
|
||||||
if (CONFIG.motion.enable) {
|
if (CONFIG.motion.enable) {
|
||||||
|
|||||||
@ -15,7 +15,7 @@ hexo.extend.helper.register('js_vendors', function() {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
if (theme.pjax) {
|
if (theme.pjax) {
|
||||||
vendors.pjax = 'pjax/pjax.min.js';
|
vendors.pjax = '//cdn.jsdelivr.net/gh/next-theme/pjax@0/pjax.min.js';
|
||||||
}
|
}
|
||||||
if (theme.fancybox) {
|
if (theme.fancybox) {
|
||||||
vendors.jquery = '//cdn.jsdelivr.net/npm/jquery@3/dist/jquery.min.js';
|
vendors.jquery = '//cdn.jsdelivr.net/npm/jquery@3/dist/jquery.min.js';
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user