Skip to content

Commit

Permalink
feat: use dialog for preview site (wip)
Browse files Browse the repository at this point in the history
  • Loading branch information
baiyuanneko committed Dec 17, 2024
1 parent bd9f585 commit 04446c4
Show file tree
Hide file tree
Showing 4 changed files with 41 additions and 2 deletions.
15 changes: 15 additions & 0 deletions App/manage.html
Original file line number Diff line number Diff line change
Expand Up @@ -145,6 +145,21 @@ <h5 class="modal-title"></h5>
</div>
</div>

<div class="modal fade" tabindex="-1" id="preview_and_publish_dialog">
<div class="modal-dialog modal-xl">
<div class="modal-content">
<div class="modal-header">
<h5 class="modal-title"></h5>
<button type="button" class="btn-close" data-bs-dismiss="modal" aria-label="Close"></button>
</div>
<div class="modal-body" id="preview_and_publish_content">


</div>
</div>
</div>
</div>




Expand Down
12 changes: 11 additions & 1 deletion App/manage.js
Original file line number Diff line number Diff line change
Expand Up @@ -110,6 +110,8 @@ const loadIME = require("./loadIME.js");
const render_preview_and_publish_page = require("./render_preview_and_publish_page.js");
const preview_and_publish = require("./preview_and_publish.js");
const enterPreviewAndPublishInterfaceOf = require("./navToSectionOfPreviewAndPublish.js");
const preview_and_publish_dialog = require("./preview_and_publish_dialog.js");
const express = require("express");

const xssStirct = require("xss");

Expand All @@ -118,13 +120,21 @@ storage.set("last_managed_site", {
rootdir: rootDir,
});

const server = express();

server.use(express.static(rootDir));

server.listen(41701, "localhost", () => {
// console.log("live server listening at http://localhost:41701");
});

// 初始化界面

function init_ui() {
document.querySelector("#root").innerHTML = "";
check_migrate();
render_container();
if (currentPage !== "markdown_editor"){
if (currentPage !== "markdown_editor") {
render_nav();
}
loadUniStyle();
Expand Down
14 changes: 14 additions & 0 deletions App/preview_and_publish_dialog.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
module.exports = function(){
const preview_and_publish_dialog = new bootstrap.Modal(document.getElementById("preview_and_publish_dialog"));
preview_and_publish_dialog.toggle();
document.querySelector("#preview_and_publish_content").innerHTML = /* html */`
<ul class="nav nav-tabs">
<li class="nav-item">
<a class="nav-link active" id="preview_site_tab">预览站点</a>
</li>
<li class="nav-item">
<a class="nav-link" id="publish_site_tab">发布站点</a>
</li>
</ul>
`;
};
2 changes: 1 addition & 1 deletion App/ui/nav_ui.html
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,7 @@
<button
id="nav_to_preview_and_publish_page"
type="button"
onclick="preview_site()"
onclick="preview_and_publish_dialog()"
class="list-group-item list-group-item-action"
data-bs-toggle="tooltip"
data-bs-placement="right"
Expand Down

0 comments on commit 04446c4

Please sign in to comment.