資料夾功能修正
This commit is contained in:
@@ -2052,8 +2052,8 @@
|
||||
<label class="col-sm-3 col-form-label">頁面名稱</label>
|
||||
<div class="col-sm-9 input">
|
||||
<div>
|
||||
<input name="title" type="text" value="My page" class="form-control"
|
||||
placeholder="My page" required>
|
||||
<input id="new-page-title" name="title" type="text" value="" class="form-control"
|
||||
placeholder="我的頁面" required>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
@@ -2062,7 +2062,7 @@
|
||||
<label class="col-sm-3 col-form-label">檔案名稱</label>
|
||||
<div class="col-sm-9 input">
|
||||
<div>
|
||||
<input name="file" type="text" value="my-page.html" class="form-control"
|
||||
<input id="new-page-file" name="file" type="text" value="" class="form-control"
|
||||
placeholder="my-page.html" required>
|
||||
</div>
|
||||
</div>
|
||||
@@ -2083,8 +2083,8 @@
|
||||
<label class="col-sm-3 col-form-label">儲存至資料夾</label>
|
||||
<div class="col-sm-9 input">
|
||||
<div>
|
||||
<input name="folder" type="text" value="my-pages" class="form-control"
|
||||
placeholder="/" required>
|
||||
<input name="folder" type="text" value="" class="form-control"
|
||||
placeholder="留空 = 存放於根目錄">
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
@@ -2287,6 +2287,21 @@ Vvveb.FileManager.addPages(pages);
|
||||
Vvveb.FileManager.loadPage(pages[firstPage]["name"]);
|
||||
Vvveb.Gui.toggleRightColumn(false);
|
||||
Vvveb.Breadcrumb.init();
|
||||
|
||||
// ── 新增頁面對話框:頁面名稱自動同步至檔案名稱 ──
|
||||
document.addEventListener("DOMContentLoaded", function () {
|
||||
var titleInput = document.getElementById("new-page-title");
|
||||
var fileInput = document.getElementById("new-page-file");
|
||||
if (titleInput && fileInput) {
|
||||
titleInput.addEventListener("input", function () {
|
||||
var slug = titleInput.value.trim().toLowerCase()
|
||||
.replace(/[^\w\s-]/g, "")
|
||||
.replace(/[\s_]+/g, "-")
|
||||
.replace(/^-+|-+$/g, "");
|
||||
if (slug) fileInput.value = slug + ".html";
|
||||
});
|
||||
}
|
||||
});
|
||||
</script>
|
||||
<script>
|
||||
// Inject project slug for save bridge
|
||||
|
||||
Reference in New Issue
Block a user