A PHP Error was encountered
Severity: 8192
Message: mysql_escape_string(): This function is deprecated; use mysql_real_escape_string() instead.
Filename: mysqli/mysqli_driver.php
Line Number: 320
A PHP Error was encountered
Severity: 8192
Message: mysql_escape_string(): This function is deprecated; use mysql_real_escape_string() instead.
Filename: mysqli/mysqli_driver.php
Line Number: 320
A PHP Error was encountered
Severity: 8192
Message: mysql_escape_string(): This function is deprecated; use mysql_real_escape_string() instead.
Filename: mysqli/mysqli_driver.php
Line Number: 320
A PHP Error was encountered
Severity: Notice
Message: Undefined index: websiteTitle
Filename: core/Loader.php(829) : eval()'d code
Line Number: 13
A PHP Error was encountered
Severity: Notice
Message: Undefined index: docs.pageOverview
Filename: core/Loader.php(829) : eval()'d code
Line Number: 106
A PHP Error was encountered
Severity: 8192
Message: mysql_escape_string(): This function is deprecated; use mysql_real_escape_string() instead.
Filename: mysqli/mysqli_driver.php
Line Number: 320
//';
//if (currentFilePath !== '') {
// fetch(currentFilePath)
// .then(response => response.text())
// .then(markdown => {
// // 先用marked解析markdown
// let htmlContent = DOMPurify.sanitize(marked.parse(markdown));
//
// // 创建一个临时的div来处理HTML字符串
// const tempDiv = document.createElement('div');
// tempDiv.innerHTML = htmlContent;
//
// // 查找所有带有externalLink类的链接并添加target="_blank"
// tempDiv.querySelectorAll('a.externalLink').forEach(link => {
// link.setAttribute('target', '_blank');
// });
//
// // 获取处理后的HTML
// htmlContent = tempDiv.innerHTML;
//
// // 将处理后的内容添加到页面
// document.getElementById('content').prepend(...Array.from($(htmlContent)));
//
// // 移除SEO预渲染内容
// const hiddenContent = document.querySelector('.hidden-content');
// if (hiddenContent) {
// hiddenContent.remove();
// }
//
// // 生成目录
// const toc = generateTOC(document.querySelector('.content'));
// document.querySelector('#footer-toc').innerHTML = toc;
// // 修改这部分来兼容旧版本的 highlight.js
// document.querySelectorAll('pre code').forEach((block) => {
// hljs.highlightBlock(block);
// });
//
// // 监听右侧toc的点击事件
// const tocLinks = document.querySelectorAll('#footer-toc .toc-item a');
// tocLinks.forEach(link => {
// link.addEventListener('click', function(event) {
// document.querySelectorAll('#footer-toc .toc-item a').forEach(item => item.classList.remove('toc-active'));
// this.classList.add('toc-active');
// });
// });
// })
// .catch(error => console.error('Error fetching markdown file:', error));
//}
function generateTOC(content) {
const headings = content.querySelectorAll('h2, h3');
let toc = '';
headings.forEach((heading, index) => {
const id = 'heading-' + index;
heading.id = id;
const level = heading.tagName.toLowerCase();
toc += `- ${heading.textContent}
`;
});
toc += '
';
return toc;
}
// 添加左侧菜单折叠功能
document.querySelectorAll('.leftMenu .toggle').forEach(toggle => {
toggle.addEventListener('click', function() {
this.classList.toggle('closed');
const subMenu = this.nextElementSibling;
if (subMenu) {
subMenu.style.display = this.classList.contains('closed') ? 'none' : 'block';
}
});
});
// 添加目录折叠功能
document.querySelector('.tocCollapse').addEventListener('click', function() {
this.classList.toggle('active');
});