中文化作業

This commit is contained in:
2026-05-18 13:40:19 +08:00
parent c99d4e8014
commit 470e0b8947
2 changed files with 212 additions and 114 deletions

View File

@@ -666,6 +666,131 @@
console.log("[my-editor] Vvveb.NewSection.insert patched to prevent layout crashes.");
}
// ── 動態中文化 VvvebJS 元件與區塊 ─────────────────────────────────
function patchI18n() {
if (typeof Vvveb === "undefined" || !Vvveb.ComponentsGroup || Object.keys(Vvveb.ComponentsGroup).length === 0) {
setTimeout(patchI18n, 500);
return;
}
const translateMap = {
// 分類 (Groups)
"Grid": "網格系統",
"Components": "基礎元件",
"Basic": "基本",
"Typography": "排版",
"Media": "媒體",
"Forms": "表單",
"Widgets": "小工具",
"Advanced": "進階",
"Content": "內容區塊",
"Layout": "佈局",
"Blocks": "區塊",
"Features": "功能特色",
"Headers": "頁首",
"Footers": "頁尾",
"Pricing": "價格表",
"Testimonials": "客戶評價",
"Cards": "卡片",
"Services": "服務",
"Team": "團隊",
"About": "關於我們",
// 元件 (Components)
"Grid Row": "網格列 (Row)",
"Grid Column": "網格欄 (Column)",
"Container": "容器 (Container)",
"Heading": "標題 (Heading)",
"Link": "超連結 (Link)",
"Image": "圖片 (Image)",
"Video": "影片 (Video)",
"Paragraph": "段落文字",
"List": "列表",
"List item": "列表項目",
"Button": "按鈕",
"Button Group": "按鈕群組",
"Button Toolbar": "按鈕工具列",
"Form": "表單",
"Text Input": "文字輸入框",
"Textarea": "多行文字框",
"Checkbox": "核取方塊",
"Radio": "單選按鈕",
"Select": "下拉選單",
"Label": "標籤文字",
"Alert": "警告提示",
"Badge": "徽章 (Badge)",
"Card": "卡片 (Card)",
"Table": "表格",
"Progress": "進度條",
"Navbar": "導覽列 (Navbar)",
"Breadcrumb": "麵包屑 (Breadcrumb)",
"Pagination": "分頁",
"Jumbotron": "大型看板",
"Panel": "面板",
"Icon": "圖示",
"Divider": "分隔線",
"Map": "地圖",
"Audio": "音訊",
"File Upload": "檔案上傳",
"Date Input": "日期輸入框",
"Password Input": "密碼輸入框",
"Email Input": "Email 輸入框"
};
// 1. 翻譯 Vvveb 物件內的資料 (供重新渲染時使用)
if (Vvveb.ComponentsGroup) {
const newGroups = {};
for (let group in Vvveb.ComponentsGroup) {
let tGroup = translateMap[group] || group;
newGroups[tGroup] = Vvveb.ComponentsGroup[group];
newGroups[tGroup].forEach(compName => {
let comp = Vvveb.Components.get(compName);
if (comp && comp.name) {
comp.name = translateMap[comp.name] || comp.name;
}
});
}
Vvveb.ComponentsGroup = newGroups;
}
if (Vvveb.BlocksGroup) {
const newBlockGroups = {};
for (let group in Vvveb.BlocksGroup) {
let tGroup = translateMap[group] || group;
newBlockGroups[tGroup] = Vvveb.BlocksGroup[group];
}
Vvveb.BlocksGroup = newBlockGroups;
}
// 2. 直接修改當前已渲染的 DOM 文字
document.querySelectorAll(".components-list .header span, .blocks-list .header span, .sections-list .header span").forEach(el => {
const txt = el.textContent.trim();
if (translateMap[txt]) {
el.textContent = translateMap[txt];
}
});
document.querySelectorAll(".components-list li .name, .blocks-list li .name, .sections-list li .name").forEach(el => {
const txt = el.textContent.trim();
if (translateMap[txt]) {
// 如果有子元素,只替換文本節點
if (el.childNodes.length > 0) {
for (let i = 0; i < el.childNodes.length; i++) {
if (el.childNodes[i].nodeType === 3 && el.childNodes[i].textContent.trim() === txt) {
el.childNodes[i].textContent = translateMap[txt];
break;
}
}
} else {
el.textContent = translateMap[txt];
}
}
});
console.log("[my-editor] VvvebJS components and blocks localized.");
}
// ── 啟用 Save 按鈕vvvebjs 預設 disabled──────────────────────
function enableSaveBtn() {
const btn = document.querySelector(".save-btn");
@@ -698,12 +823,14 @@
patchSaveAjax();
patchFileManager();
patchNewSection();
patchI18n();
enableSaveBtn();
});
} else {
patchSaveAjax();
patchFileManager();
patchNewSection();
patchI18n();
enableSaveBtn();
}
})();

View File

@@ -21,23 +21,24 @@
<div id="top-panel">
<div class="btn-group float-start" role="group">
<a href="https://www.vvveb.com" target="_blank">
<img src="/static/Vvvebjs/img/logo.png" alt="Vvveb" class="float-start" id="logo">
<a href="/dashboard" class="btn btn-light px-2 me-2 d-flex align-items-center" style="gap: 5px; font-weight: 500;">
<i class="la la-arrow-left"></i> 返回管理器
</a>
<button class="btn btn-light px-1" title="Toggle file manager" id="toggle-file-manager-btn"
<button class="btn btn-light px-1" title="切換檔案管理員" id="toggle-file-manager-btn"
data-vvveb-action="toggleFileManager" data-bs-toggle="button" aria-pressed="false">
<img src="/static/Vvvebjs/libs/builder/icons/file-manager-layout.svg" width="18" height="18" alt=""
role="presentation">
</button>
<button class="btn btn-light px-1" title="Toggle left column" id="toggle-left-column-btn"
<button class="btn btn-light px-1" title="切換左側欄" id="toggle-left-column-btn"
data-vvveb-action="toggleLeftColumn" data-bs-toggle="button" aria-pressed="false">
<img src="/static/Vvvebjs/libs/builder/icons/left-column-layout.svg" width="18" height="18" alt=""
role="presentation">
</button>
<button class="btn btn-light px-1" title="Toggle right column" id="toggle-right-column-btn"
<button class="btn btn-light px-1" title="切換右側欄" id="toggle-right-column-btn"
data-vvveb-action="toggleRightColumn" data-bs-toggle="button" aria-pressed="false">
<img src="/static/Vvvebjs/libs/builder/icons/right-column-layout.svg" width="18" height="18" alt=""
role="presentation">
@@ -47,12 +48,12 @@
<div>
<div class="btn-group me-3" role="group">
<button class="btn btn-light" title="Undo (Ctrl/Cmd + Z)" id="undo-btn" data-vvveb-action="undo"
<button class="btn btn-light" title="復原 (Ctrl/Cmd + Z)" id="undo-btn" data-vvveb-action="undo"
data-vvveb-shortcut="ctrl+z">
<i class="la la-undo"></i>
</button>
<button class="btn btn-light" title="Redo (Ctrl/Cmd + Shift + Y)" id="redo-btn"
<button class="btn btn-light" title="重做 (Ctrl/Cmd + Shift + Y)" id="redo-btn"
data-vvveb-action="redo" data-vvveb-shortcut="ctrl+shift+z">
<i class="la la-undo la-flip-horizontal"></i>
</button>
@@ -60,33 +61,33 @@
<div class="btn-group me-3" role="group">
<button class="btn btn-light" title="Designer Mode (Free dragging)" id="designer-mode-btn"
<button class="btn btn-light" title="設計師模式 (自由拖曳)" id="designer-mode-btn"
data-bs-toggle="button" aria-pressed="false" data-vvveb-action="setDesignerMode">
<i class="la la-hand-rock"></i>
</button>
<button class="btn btn-light" title="Preview" id="preview-btn" type="button" data-bs-toggle="button"
<button class="btn btn-light" title="預覽" id="preview-btn" type="button" data-bs-toggle="button"
aria-pressed="false" data-vvveb-action="preview">
<i class="icon-eye-outline"></i>
</button>
<button class="btn btn-light" title="Fullscreen (F11)" id="fullscreen-btn" data-bs-toggle="button"
<button class="btn btn-light" title="全螢幕 (F11)" id="fullscreen-btn" data-bs-toggle="button"
aria-pressed="false" data-vvveb-action="fullscreen">
<i class="icon-expand-outline"></i>
</button>
<button class="btn btn-light" title="Show hidden elements" id="toggle-hidden"
<button class="btn btn-light" title="顯示隱藏元素" id="toggle-hidden"
data-bs-toggle="button" data-vvveb-action="toggleHidden" aria-pressed="false">
<i class="icon-scan-outline"></i>
</button>
<button class="btn btn-light active" title="Toggle navigator (Ctrl + Shift + L)"
<button class="btn btn-light active" title="切換導覽器 (Ctrl + Shift + L)"
id="toggle-tree-list" data-bs-toggle="button" data-vvveb-action="toggleTreeList"
aria-pressed="true">
<i class="icon-layers-outline"></i>
</button>
<button class="btn btn-light" title="Download" id="download-btn" data-vvveb-action="download"
<button class="btn btn-light" title="下載" id="download-btn" data-vvveb-action="download"
data-v-download="index.html">
<i class="la la-download"></i>
</button>
@@ -116,34 +117,34 @@
<div class="dropdown-menu">
<button id="mobile-view" data-view="sm" class="btn btn-light w-100" title="Mobile view"
<button id="mobile-view" data-view="sm" class="btn btn-light w-100" title="手機版視圖"
data-vvveb-action="viewport">
<i class="la la-mobile"></i>
<span>Mobile view</span>
<span>手機版視圖</span>
</button>
<button id="tablet-view" data-view="md" class="btn btn-light w-100" title="Tablet view"
<button id="tablet-view" data-view="md" class="btn btn-light w-100" title="平板視圖"
data-vvveb-action="viewport">
<i class="la la-tablet la-rotate-90"></i>
<span>Tablet view</span>
<span>平板視圖</span>
</button>
<button id="tablet-landscape-view" data-view="lg" class="btn btn-light w-100"
title="Tablet landscape view" data-vvveb-action="viewport">
title="平板橫向視圖" data-vvveb-action="viewport">
<i class="la la-tablet"></i>
<span>Tablet landscape view</span>
<span>平板橫向視圖</span>
</button>
<button id="laptop-view" data-view="xl" class="btn btn-light w-100" title="Laptop view"
<button id="laptop-view" data-view="xl" class="btn btn-light w-100" title="筆電視圖"
data-vvveb-action="viewport">
<i class="la la-laptop"></i>
<span>Laptop view</span>
<span>筆電視圖</span>
</button>
<button id="desktop-view" data-view="xxl" class="btn btn-light w-100" title="Desktop view"
<button id="desktop-view" data-view="xxl" class="btn btn-light w-100" title="桌面視圖"
data-vvveb-action="viewport">
<i class="la la-desktop"></i>
<span>Desktop view</span>
<span>桌面視圖</span>
</button>
</div>
@@ -160,7 +161,7 @@
<div class="btn-group me-2" role="group">
<div class="btn-group">
<button class="btn btn-primary btn-icon btn-sm save-btn" title="Save changes (Ctrl + S)"
<button class="btn btn-primary btn-icon btn-sm save-btn" title="儲存變更 (Ctrl + S)"
data-vvveb-action="saveAjax" data-vvveb-url="/api/save" data-v-vvveb-shortcut="ctrl+s"
disabled>
<span class="loading d-none">
@@ -168,12 +169,12 @@
<!-- i class="la la-save"></i -->
<span class="spinner-border spinner-border-sm align-middle" role="status"
aria-hidden="true"></span>
<span>Saving </span> ...
<span>儲存中 </span> ...
</span>
<span class="button-text">
<!-- i class="icon-save-outline"></i -->
<span>Save</span>
<span>儲存</span>
</span>
</button>
</div>
@@ -192,20 +193,20 @@
<div id="filemanager">
<div class="header">
<span class="text-muted lh-lg">
<span>Pages</span>
<span>頁面管理</span>
</span>
<div class="float-end" role="group">
<button class="btn btn-outline-primary btn-sm btn-icon btn-add"
title="New page (Ctrl + Shift + P)" id="new-file-btn" data-vvveb-action="newPage"
title="新增頁面 (Ctrl + Shift + P)" id="new-file-btn" data-vvveb-action="newPage"
data-vvveb-shortcut="">
<span>Add page</span>
<span>新增頁面</span>
<i class="icon-add"></i>
</button>
<button class="btn btn-primary btn-sm btn-icon btn-add"
title="New section (Ctrl + Shift + S)" id="new-section" data-vvveb-action="newSection"
title="新增區塊 (Ctrl + Shift + S)" id="new-section" data-vvveb-action="newSection"
data-vvveb-shortcut="">
<i class="icon-add"></i>
@@ -233,7 +234,7 @@
<li class="nav-item component-tab">
<a class="nav-link active" id="components-tab" data-bs-toggle="tab"
href="#components-tabs" role="tab" aria-controls="components" aria-selected="true"
title="Components">
title="元件">
<i class="icon-cube-outline"></i>
<!-- img src="../../../js/vvvebjs/icons/product.svg" height="23" -->
<!-- div><small>Components</small></div -->
@@ -241,18 +242,18 @@
</li>
<li class="nav-item sections-tab">
<a class="nav-link" id="sections-tab" data-bs-toggle="tab" href="#sections" role="tab"
aria-controls="sections" aria-selected="false" title="Sections">
aria-controls="sections" aria-selected="false" title="區塊">
<i class="icon-layers-outline"></i>
<!-- img src="../../../js/vvvebjs/icons/list_group.svg" height="23" -->
<!-- div><small>Sections</small></div -->
</a>
</li>
<!-- li class="nav-item sections-tab">
<a class="nav-link" id="sections-tab" data-bs-toggle="tab" href="#sections" role="tab" aria-controls="sections" aria-selected="false" title="Sections"><img src="../../../js/vvvebjs/icons/list_group.svg" width="24" height="23"> <div><small>Sections</small></div></a>
<a class="nav-link" id="sections-tab" data-bs-toggle="tab" href="#sections" role="tab" aria-controls="sections" aria-selected="false" title="區塊"><img src="../../../js/vvvebjs/icons/list_group.svg" width="24" height="23"> <div><small>Sections</small></div></a>
</li -->
<li class="nav-item component-configuration-tab">
<a class="nav-link" id="configuration-tab" data-bs-toggle="tab" href="#configuration"
role="tab" aria-controls="configuration" aria-selected="false" title="Style">
role="tab" aria-controls="configuration" aria-selected="false" title="樣式">
<i class="icon-sparkles-outline"></i>
<!-- img src="/js/vvvebjs/icons/filters.svg" height="23"-->
<!-- div><small>Properties</small></div -->
@@ -260,7 +261,7 @@
</li>
<li class="nav-item component-properties-tab d-none">
<a class="nav-link" id="properties-tab" data-bs-toggle="tab" href="#properties"
role="tab" aria-controls="properties" aria-selected="false" title="Properties">
role="tab" aria-controls="properties" aria-selected="false" title="屬性">
<i class="icon-settings-outline"></i>
<!-- img src="/js/vvvebjs/icons/filters.svg" height="23"-->
<!-- div><small>Properties</small></div -->
@@ -280,7 +281,7 @@
aria-controls="components" aria-selected="true">
<i class="icon-square-outline"></i>
<div>
<span>Components</span>
<span>元件庫</span>
</div>
</a>
</li>
@@ -289,7 +290,7 @@
aria-controls="components" aria-selected="false">
<i class="icon-copy-outline"></i>
<div>
<span>Blocks</span>
<span>預設區塊</span>
</div>
</a>
</li>
@@ -308,7 +309,7 @@
</button>
</div>
<input class="form-control component-search" placeholder="Search components"
<input class="form-control component-search" placeholder="搜尋元件"
type="text" data-vvveb-action="search" data-vvveb-on="keyup">
<button class="clear-backspace" data-vvveb-action="clearSearch">
<i class="la la-times"></i>
@@ -338,7 +339,7 @@
</button>
</div>
<input class="form-control block-search" placeholder="Search blocks"
<input class="form-control block-search" placeholder="搜尋區塊"
type="text" data-vvveb-action="search" data-vvveb-on="keyup">
<button class="clear-backspace" data-vvveb-action="clearSearch">
<i class="la la-times"></i>
@@ -380,7 +381,7 @@
aria-controls="sections" aria-selected="true">
<i class="icon-document-text-outline"></i>
<div>
<span>Page Sections</span>
<span>頁面區塊</span>
</div>
</a>
</li>
@@ -434,7 +435,7 @@
</div>
<div class="buttons"> <a class="delete-btn" href="" title="Remove section"><i class="la la-trash text-danger"></i></a>
<a class="properties-btn" href="" title="Properties"><i class="icon-settings-outline"></i></a> </div>
<a class="properties-btn" href="" title="屬性"><i class="icon-settings-outline"></i></a> </div>
</div>
<input class="header_check" type="checkbox" id="section-components-9338">
<label for="section-components-9338">
@@ -463,7 +464,7 @@
</button>
</div>
<input class="form-control section-search" placeholder="Search sections"
<input class="form-control section-search" placeholder="搜尋區塊"
type="text" data-vvveb-action="search" data-vvveb-on="keyup">
<button class="clear-backspace" data-vvveb-action="clearSearch"
title="Clear search">
@@ -500,7 +501,7 @@
href="#content-left-panel-tab" role="tab"
aria-controls="components" aria-selected="true">
<i class="icon-albums-outline"></i>
<span>Content</span>
<span>內容</span>
</a>
</li>
<li class="nav-item style-tab">
@@ -516,7 +517,7 @@
href="#advanced-left-panel-tab" role="tab"
aria-controls="advanced" aria-selected="false">
<i class="icon-settings-outline"></i>
<span>Advanced</span>
<span>進階</span>
</a>
</li>
</ul>
@@ -529,8 +530,8 @@
role="alert" style="">
<button type="button" class="btn-close" data-bs-dismiss="alert"
aria-label="Close"></button>
<strong>No selected element!</strong>
<br> Click on an element to edit.
<strong>未選擇任何元素!</strong>
<br> 點擊元素進行編輯。
</div>
</div>
@@ -540,7 +541,7 @@
<div class="justify-content-end d-flex">
<select class="form-select w-50"
data-vvveb-action="setState" data-vvveb-on="change">
<option value=""> - State - </option>
<option value=""> - 狀態 - </option>
<option value="hover">hover</option>
<option value="active">active</option>
<option value="nth-of-type(2n)">nth-of-type(2n)</option>
@@ -568,7 +569,7 @@
aria-controls="styles" aria-selected="true">
<i class="icon-color-wand-outline"></i>
<div>
<span>Styles</span>
<span>樣式</span>
</div>
</a>
</li>
@@ -577,7 +578,7 @@
aria-controls="components" aria-selected="false">
<i class="icon-brush-outline"></i>
<div>
<span>Variables</span>
<span>變數</span>
</div>
</a>
</li>
@@ -602,7 +603,7 @@
</button>
</div>
<input class="form-control block-search" placeholder="Search styles"
<input class="form-control block-search" placeholder="搜尋樣式"
type="text" data-vvveb-action="search" data-vvveb-on="keyup">
<button class="clear-backspace" data-vvveb-action="clearSearch">
<i class="la la-times"></i>
@@ -631,7 +632,7 @@
<div class="component-properties d-block">
<!-- color palette -->
<!--
<label class="header" data-header="default" for="header_pallette"><span>Global styles</span>
<label class="header" data-header="default" for="header_pallette"><span>全局樣式</span>
<div class="header-arrow"></div>
</label> -->
<input class="header_check" type="checkbox" checked
@@ -980,7 +981,7 @@
</button>
</div>
<input class="form-control component-search" placeholder="Search components" type="text"
<input class="form-control component-search" placeholder="搜尋元件" type="text"
data-vvveb-action="search" data-vvveb-on="keyup">
<button class="clear-backspace" data-vvveb-action="clearSearch">
<i class="la la-times"></i>
@@ -1007,7 +1008,7 @@
</button>
</div>
<input class="form-control block-search" placeholder="Search blocks" type="text"
<input class="form-control block-search" placeholder="搜尋區塊" type="text"
data-vvveb-action="search" data-vvveb-on="keyup">
<button class="clear-backspace" data-vvveb-action="clearSearch">
<i class="la la-times"></i>
@@ -1035,7 +1036,7 @@
</button>
</div>
<input class="form-control section-search" placeholder="Search sections" type="text"
<input class="form-control section-search" placeholder="搜尋區塊" type="text"
data-vvveb-action="search" data-vvveb-on="keyup">
<button class="clear-backspace" data-vvveb-action="clearSearch">
<i class="la la-times"></i>
@@ -1108,7 +1109,7 @@
<a class="nav-link active" data-bs-toggle="tab" href="#content-tab" role="tab"
aria-controls="components" aria-selected="true">
<i class="icon-albums-outline"></i>
<span>Content</span>
<span>內容</span>
</a>
</li>
<li class="nav-item style-tab">
@@ -1122,7 +1123,7 @@
<a class="nav-link" data-bs-toggle="tab" href="#advanced-tab" role="tab" aria-controls="blocks"
aria-selected="false">
<i class="icon-settings-outline"></i>
<span>Advanced</span>
<span>進階</span>
</a>
</li>
</ul>
@@ -1132,8 +1133,8 @@
aria-labelledby="content-tab">
<div class="alert alert-dismissible fade show alert-light m-3" role="alert">
<button type="button" class="btn-close" data-bs-dismiss="alert" aria-label="Close"></button>
<strong>No selected element!</strong>
<br> Click on an element to edit.
<strong>未選擇任何元素!</strong>
<br> 點擊元素進行編輯。
</div>
</div>
@@ -1142,7 +1143,7 @@
<div class="pb-2 px-2">
<div class="justify-content-end d-flex">
<select class="form-select w-50" data-vvveb-action="setState" data-vvveb-on="change">
<option value=""> - State - </option>
<option value=""> - 狀態 - </option>
<option value="hover">hover</option>
<option value="active">active</option>
<option value="nth-of-type(2n)">nth-of-type(2n)</option>
@@ -1482,7 +1483,7 @@
<!--
<a class="up-btn" href="" title="Move element up"><i class="la la-arrow-up"></i></a>
<a class="down-btn" href="" title="Move element down"><i class="la la-arrow-down"></i></a>
<a class="properties-btn" href="" title="Properties"><i class="icon-settings-outline"></i></a>
<a class="properties-btn" href="" title="屬性"><i class="icon-settings-outline"></i></a>
-->
</div>
</div>
@@ -1897,7 +1898,7 @@
<a class="up-btn" href="" title="Move element up"><i class="la la-arrow-up"></i></a>
<a class="down-btn" href="" title="Move element down"><i class="la la-arrow-down"></i></a>
-->
<a class="properties-btn" href="" title="Properties"><i class="icon-settings-outline"></i></a>
<a class="properties-btn" href="" title="屬性"><i class="icon-settings-outline"></i></a>
</div>
</div>
@@ -1939,18 +1940,18 @@
<span class="modal-title"></span>
<div class="float-end">
<button type="button" class="btn btn-light border btn-icon" data-bs-dismiss="modal"><i
class="la la-times"></i>Close</button>
class="la la-times"></i>關閉</button>
<button class="btn btn-primary btn-icon save-btn" title="Save changes">
<button class="btn btn-primary btn-icon save-btn" title="儲存變更">
<span class="loading d-none">
<i class="la la-save"></i>
<span class="spinner-border spinner-border-sm align-middle" role="status"
aria-hidden="true">
</span>
<span>Saving </span> ... </span>
<span>儲存中 </span> ... </span>
<span class="button-text">
<i class="la la-save"></i> <span>Save changes</span>
<i class="la la-save"></i> <span>儲存變更</span>
</span>
</button>
</div>
@@ -1971,7 +1972,7 @@
<div class="modal-dialog modal-lg" role="document">
<div class="modal-content">
<div class="modal-header">
<p class="modal-title text-primary"><i class="la la-lg la-save"></i> Export html</p>
<p class="modal-title text-primary"><i class="la la-lg la-save"></i> 匯出 HTML</p>
<button type="button" class="btn-close" data-bs-dismiss="modal" aria-label="Close">
<!-- span aria-hidden="true"><small><i class="la la-times"></i></small></span -->
</button>
@@ -1983,7 +1984,7 @@
</div>
<div class="modal-footer">
<button type="button" class="btn btn-secondary btn-lg" data-bs-dismiss="modal"><i
class="la la-times"></i> Close</button>
class="la la-times"></i> 關閉</button>
</div>
</div>
</div>
@@ -2000,12 +2001,12 @@
</button>
</div>
<div class="modal-body">
<p>Page was successfully saved!.</p>
<p>頁面已成功儲存!</p>
</div>
<div class="modal-footer">
<!-- <button type="button" class="btn btn-primary">Ok</button> -->
<button type="button" class="btn btn-secondary btn-lg" data-bs-dismiss="modal"><i
class="la la-times"></i> Close</button>
class="la la-times"></i> 關閉</button>
</div>
</div>
</div>
@@ -2029,7 +2030,7 @@
<div class="modal-body text">
<div class="mb-3 row" data-key="type">
<label class="col-sm-3 col-form-label">
Template
模板
<abbr
title="The contents of this template will be used as a start for the new template">
<i class="la la-lg la-question-circle text-primary"></i>
@@ -2039,7 +2040,7 @@
<div class="col-sm-9 input">
<div>
<select class="form-select" name="startTemplateUrl">
<option value="new-page-blank-template.html">Blank Template</option>
<option value="new-page-blank-template.html">空白模板</option>
<option value="demo/narrow-jumbotron/index.html">Narrow jumbotron</option>
<option value="demo/album/index.html">Album</option>
</select>
@@ -2048,7 +2049,7 @@
</div>
<div class="mb-3 row" data-key="href">
<label class="col-sm-3 col-form-label">Page name</label>
<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"
@@ -2058,7 +2059,7 @@
</div>
<div class="mb-3 row" data-key="href">
<label class="col-sm-3 col-form-label">File name</label>
<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"
@@ -2079,7 +2080,7 @@
-->
<div class="mb-3 row" data-key="href">
<label class="col-sm-3 col-form-label">Save to folder</label>
<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"
@@ -2091,11 +2092,11 @@
<div class="modal-footer">
<button class="btn btn-outline-secondary btn-icon" type="reset" data-bs-dismiss="modal">
<i class="la la-times"></i> Cancel
<i class="la la-times"></i> 取消
</button>
<button class="btn btn-primary btn-icon" type="submit">
<i class="la la-check"></i>
<span>Create</span>
<span>建立</span>
</button>
</div>
</div>
@@ -2109,16 +2110,16 @@
<div class="toast-container position-fixed end-0 bottom-0 me-4 my-4">
<div class="toast " role="alert" aria-live="assertive" aria-atomic="true" id="bottom-toast">
<div class="toast-header bg-success bg-opacity-25 border-0">
<strong class="me-auto">Page save</strong>
<strong class="me-auto">頁面儲存</strong>
<!-- <small class="badge bg-success">status</small> -->
<button type="button" class="btn-close me-1" data-bs-dismiss="toast" aria-label="Close"></button>
</div>
<div class="toast-body">
<div class="flex-grow-1">
<div class="message">
<div>Elements saved!</div>
<div>Template backup was saved!</div>
<div>Template was saved!</div>
<div>元素已儲存!</div>
<div>模板備份已儲存!</div>
<div>模板已儲存!</div>
</div>
<div>
<!-- <a class="btn btn-success btn-icon btn-sm w-100 mt-2" href="">View page</a></div> -->
@@ -2131,16 +2132,16 @@
<div class="toast-container position-fixed end-0 top-0 me-4 my-4">
<div class="toast " role="alert" aria-live="assertive" aria-atomic="true" id="top-toast">
<div class="toast-header bg-success bg-opacity-25 border-0">
<strong class="me-auto">Page save</strong>
<strong class="me-auto">頁面儲存</strong>
<!-- <small class="badge bg-success">status</small> -->
<button type="button" class="btn-close me-1" data-bs-dismiss="toast" aria-label="Close"></button>
</div>
<div class="toast-body">
<div class="flex-grow-1">
<div class="message">
<div>Elements saved!</div>
<div>Template backup was saved!</div>
<div>Template was saved!</div>
<div>元素已儲存!</div>
<div>模板備份已儲存!</div>
<div>模板已儲存!</div>
</div>
<div>
<!-- <a class="btn btn-success btn-icon btn-sm w-100 mt-2" href="">View page</a></div> -->
@@ -2287,36 +2288,6 @@ Vvveb.FileManager.loadPage(pages[firstPage]["name"]);
Vvveb.Gui.toggleRightColumn(false);
Vvveb.Breadcrumb.init();
</script>
<style>
#back-to-dashboard {
position: fixed;
bottom: 1rem;
left: 1rem;
z-index: 9999;
background: rgba(30,32,48,0.92);
color: #a5b4fc;
border: 1px solid rgba(99,102,241,0.4);
border-radius: 8px;
padding: 0.45rem 0.9rem;
font-size: 0.82rem;
font-weight: 500;
cursor: pointer;
display: flex;
align-items: center;
gap: 0.4rem;
backdrop-filter: blur(8px);
transition: background 0.2s, color 0.2s;
text-decoration: none;
}
#back-to-dashboard:hover {
background: rgba(99,102,241,0.25);
color: #fff;
}
</style>
<a id="back-to-dashboard" href="/dashboard">
&#8592; 返回管理器
</a>
<script>
// Inject project slug for save bridge
window.VVVEB_PROJECT_SLUG = "{% endraw %}{{ slug | safe }}{% raw %}";