提交版本
This commit is contained in:
@@ -14,6 +14,7 @@
|
||||
<script src="https://cdn.socket.io/4.0.0/socket.io.min.js"></script>
|
||||
<link href="https://cdn.jsdelivr.net/npm/bootstrap@5.3.0-alpha1/dist/css/bootstrap.min.css" rel="stylesheet">
|
||||
<script src="https://unpkg.com/split.js/dist/split.min.js"></script>
|
||||
<script src="https://cdn.bootcdn.net/ajax/libs/jquery/3.7.1/jquery.min.js"></script>
|
||||
</head>
|
||||
<body>
|
||||
<div class="maxcontainer" id="maxcontainer">
|
||||
@@ -68,10 +69,36 @@
|
||||
chapter_id:"{{chapter_id}}"
|
||||
}
|
||||
</script>
|
||||
<script src="/static/js/chatbox.js"></script>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
|
||||
<!-- 侧边工具栏 -->
|
||||
<div class="sidebar-tools" id="sidebarTools">
|
||||
<div class="tool-button" onclick="sendInitiativeFunctionCall('sample_judge')">
|
||||
<div class="icon">+</div>
|
||||
<div class="description">代码试运行</div>
|
||||
</div>
|
||||
<div class="tool-button" onclick="sendInitiativeFunctionCall('judge')">
|
||||
<div class="icon">√</div>
|
||||
<div class="description">代码提交</div>
|
||||
</div>
|
||||
<!-- <div class="tool-button">
|
||||
<div class="icon">-</div>
|
||||
<div class="description">工具2</div>
|
||||
</div>
|
||||
<div class="tool-button">
|
||||
<div class="icon">?</div>
|
||||
<div class="description">工具3</div>
|
||||
</div> -->
|
||||
</div>
|
||||
|
||||
<!-- 切换按钮 -->
|
||||
<div class="toggle-button" id="toggleButton">
|
||||
<div class="icon" id="toggleButton_icon">❮</div>
|
||||
</div>
|
||||
|
||||
<script src="/static/js/chatbox.js"></script>
|
||||
<script>
|
||||
// 实现左右边栏可拖动
|
||||
|
||||
@@ -169,42 +196,20 @@
|
||||
loadMarkdown('{{course_id}}','{{chapter_id}}');
|
||||
});
|
||||
|
||||
|
||||
// function next_chapter(data) {
|
||||
// // 获取所有的 h3 元素
|
||||
// var iframe = document.getElementById('markdown-content-iframe');
|
||||
|
||||
// // 访问 iframe 的文档对象
|
||||
// var iframeDocument = iframe.contentDocument || iframe.contentWindow.document;
|
||||
// 侧边工具栏切换
|
||||
const sidebarTools = document.getElementById('sidebarTools');
|
||||
const toggleButton = document.getElementById('toggleButton');
|
||||
|
||||
// var h3Elements = iframeDocument.querySelectorAll('h3');
|
||||
// console.log("h3Elements next")
|
||||
// console.log(iframeDocument)
|
||||
// if (currentChapterIndex >= h3Elements.length) {
|
||||
// return; // 如果已经到了最后一个章节,则不进行任何操作
|
||||
// }
|
||||
|
||||
// // 隐藏当前章节及其后的内容
|
||||
// for (let i = 0; i < h3Elements.length; i++) {
|
||||
// h3Elements[i].style.display = 'none';
|
||||
// let nextSibling = h3Elements[i].nextElementSibling;
|
||||
// while (nextSibling && nextSibling.tagName !== 'H3') {
|
||||
// nextSibling.style.display = 'none';
|
||||
// nextSibling = nextSibling.nextElementSibling;
|
||||
// }
|
||||
// }
|
||||
|
||||
// // 显示下一个章节及其后的内容,直到再下一个h3元素或结束
|
||||
// if (currentChapterIndex + 1 < h3Elements.length) {
|
||||
// h3Elements[currentChapterIndex + 1].style.display = 'block';
|
||||
// let nextSibling = h3Elements[currentChapterIndex + 1].nextElementSibling;
|
||||
// while (nextSibling && nextSibling.tagName !== 'H3') {
|
||||
// nextSibling.style.display = 'block';
|
||||
// nextSibling = nextSibling.nextElementSibling;
|
||||
// }
|
||||
// }
|
||||
// currentChapterIndex++;
|
||||
// }
|
||||
toggleButton.addEventListener('click', function() {
|
||||
sidebarTools.classList.toggle('open');
|
||||
toggleButton.classList.toggle('open');
|
||||
if (document.getElementById('toggleButton_icon').innerText === '❮'){
|
||||
document.getElementById('toggleButton_icon').innerText = '❯';
|
||||
}else{
|
||||
document.getElementById('toggleButton_icon').innerText = '❮';
|
||||
}
|
||||
});
|
||||
|
||||
</script>
|
||||
</body>
|
||||
|
||||
Reference in New Issue
Block a user