diff --git a/README.md b/README.md index 4e79ee9..217f02e 100644 --- a/README.md +++ b/README.md @@ -1 +1,107 @@ -# setting \ No newline at end of file +# VideoTogether 設定頁 / Settings Page + +**[中文](#中文) · [English](#english)** + +> VideoTogether 設定頁的原始碼。獨立的 git 儲存庫,透過 GitHub Pages 部署,與前端 userscript/擴充功能連動。 +> +> Source for the VideoTogether settings page. A standalone git repository, deployed via GitHub Pages, that works together with the frontend userscript / extension. + +--- + +## 中文 + +### 這是什麼 +使用者點面板右上角的齒輪會開啟的設定頁。它**不直接呼叫**前端,而是透過共用的擴充 storage 連動: +設定頁送出 `postMessage({type:15, key, value})` → 內容腳本寫入擴充 storage → 同步回所有分頁 → 前端用 `getVideoTogetherStorage(key, 預設值)` 讀取。 + +### 推薦:和前端一起開發 +設定頁是靠共用 storage 跟前端連動的(見上),所以**最好的開發方式是把它和前端一起跑**: +把本儲存庫 `clone` 進前端主專案的 `source/setting/`,建構並在瀏覽器載入前端擴充後, +就能在設定頁切開關、**即時看到前端的反應**,端到端驗證連動,比單獨改設定頁直覺很多。 + +- 前端主專案:`VideoTogether/VideoTogether`(fork:`LCY000/VideoTogether`)。 +- 前端 repo 裡有完整的「前端 ⇄ 設定頁 連動」與「開發環境」說明:`docs/<語言>/settings-linkage.md`、`docs/<語言>/development.md`。 +- 本儲存庫是**獨立的 git**:在這裡 commit / push 只動設定頁;前端的改動在前端 repo。建構時對 `source/setting` 會 `git pull`,本地有未 commit 的修改請先 commit,或用 `disable_network` 跳過。 + +### 檔案結構 +| 檔案 | 說明 | +|------|------| +| `v3.buildme.html` | **唯一要手改的原始檔**。含版面、CSS、JS。 | +| `v3.html` | 由 `v3.buildme.html` **建構產生**,請勿手改(會被蓋掉)。這是線上實際載入的頁面。 | +| `v2.html` | 舊版網址,已改為轉址到 `v3.html`(讓仍指向 v2 的舊安裝不會 404)。 | +| `localization/*.json` | 四語字串(`zh-cn / zh-tw / en-us / ja-jp`),建構時用 `{{{ }}}` 注入進 `v3.buildme.html`。 | +| `vt_source.json` | 建構設定(`releaseTarget: "./"`,讓產物輸出在本資料夾)。 | +| `vercel.json` | 舊的 Vercel 設定(目前用 GitHub Pages,留著無害)。 | + +### 建構 +在前端主專案根目錄執行(設定頁是主專案的內嵌 repo): +```bash +python3 script/build_extension.py disable_network # disable_network 可避免覆蓋未 commit 的本地修改 +``` +建構會把 `*.buildme.html` + `localization/*.json` 編成 `v3.html`。 + +### 部署(GitHub Pages) +本儲存庫的 GitHub Pages 來源為 `main`: +```bash +git add -A && git commit -m "..." +git push origin main # push 後 Pages 會自動重新部署 v3.html +``` + +### 怎麼新增一個設定開關 +1. `v3.buildme.html` 加一段開關 DOM:label 的 `id` 必須是 `Label`、checkbox 的 `id` 必須是 ``。 +2. 要說明就加 `info_outline`,並在該列後面加 `
`(會自動被填入翻譯、點 ⓘ 就地展開)。 +3. `localization/*.json` 四語各加 `Label`(與選用的 `LabelHelp`)。 +4. 前端用 `getVideoTogetherStorage('', 預設值)` 讀取。**預設值務必讓「未設定=維持原本行為」**。 + +### 疑難排解 +- **改了 `v3.html`,下次卻被「還原」/說明文字整段消失**:八成是直接手改了成品 `v3.html`,但沒同步來源。任何一次建構都會用 `v3.buildme.html` + `localization/*.json` 重新產生 v3.html,把手改蓋掉(連 ⓘ 說明標記與容器都會一起不見)。修法:`git restore v3.html` 還原,再把**文案**改進 `localization/*.json`、把**結構**(如 ⓘ 說明標記)改進 `v3.buildme.html`,重新建構即可。驗證:用 brace-match 抽出 v3.html 內嵌的各語言物件、模擬一次建構,應能原樣還原 v3.html。 + +--- + +## English + +### What this is +The settings page opened from the gear icon in the panel. It does **not** call the frontend directly; it talks through shared extension storage: +the page posts `postMessage({type:15, key, value})` → the content script writes extension storage → it syncs back to all tabs → the frontend reads it via `getVideoTogetherStorage(key, default)`. + +### Recommended: develop alongside the frontend +Because the settings page links to the frontend through shared storage (above), the **best way to develop it is together with the frontend**: +`clone` this repo into the frontend project's `source/setting/`, build, and load the frontend extension in your browser — +then you can flip a toggle here and **see the frontend react live**, verifying the linkage end-to-end. Far more direct than editing the settings page alone. + +- Frontend project: `VideoTogether/VideoTogether` (fork: `LCY000/VideoTogether`). +- The frontend repo has the full "frontend ⇄ settings-page linkage" and "development" guides: `docs//settings-linkage.md`, `docs//development.md`. +- This repo is an **independent git**: committing / pushing here only touches the settings page; frontend changes live in the frontend repo. The build runs `git pull` on `source/setting`, so commit local edits first, or use `disable_network` to skip. + +### Files +| File | Purpose | +|------|---------| +| `v3.buildme.html` | **The only file you edit by hand.** Layout, CSS, JS. | +| `v3.html` | **Generated** from `v3.buildme.html` — do not edit (it gets overwritten). This is what loads in production. | +| `v2.html` | Old URL, now redirects to `v3.html` so older installs pointing at v2 don't 404. | +| `localization/*.json` | Strings for the four languages (`zh-cn / zh-tw / en-us / ja-jp`), injected into `v3.buildme.html` via `{{{ }}}` at build time. | +| `vt_source.json` | Build config (`releaseTarget: "./"` so output lands in this folder). | +| `vercel.json` | Legacy Vercel config (we use GitHub Pages; harmless to keep). | + +### Build +Run from the frontend main project's root (this settings page is an embedded repo of it): +```bash +python3 script/build_extension.py disable_network # disable_network avoids clobbering uncommitted local edits +``` +The build compiles `*.buildme.html` + `localization/*.json` into `v3.html`. + +### Deploy (GitHub Pages) +This repository's GitHub Pages source is `main`: +```bash +git add -A && git commit -m "..." +git push origin main # Pages redeploys v3.html automatically after push +``` + +### Adding a toggle +1. Add the toggle DOM in `v3.buildme.html`: the label's `id` must be `Label`, the checkbox's `id` must be ``. +2. For a help note, add `info_outline` and, right after that row, `
` (auto-filled with the translation; click ⓘ to expand inline). +3. Add `Label` (and optional `LabelHelp`) to all four `localization/*.json` files. +4. In the frontend, read it with `getVideoTogetherStorage('', default)`. **Choose the default so "unset = current behavior".** + +### Troubleshooting +- **Edited `v3.html` but it got "reverted" / help text vanished after a build**: you almost certainly hand-edited the generated `v3.html` without updating the source. Any build regenerates v3.html from `v3.buildme.html` + `localization/*.json`, clobbering manual edits (the ⓘ help markup and its container disappear too). Fix: `git restore v3.html`, then put **strings** into `localization/*.json` and **structure** (e.g. the ⓘ help markup) into `v3.buildme.html`, and rebuild. To verify, brace-match the inlined per-language objects out of v3.html and simulate a build — it should reproduce v3.html exactly. diff --git a/UPSTREAM-NOTES.md b/UPSTREAM-NOTES.md new file mode 100644 index 0000000..d53557e --- /dev/null +++ b/UPSTREAM-NOTES.md @@ -0,0 +1,78 @@ +# 給上游維護者的說明 / Notes for the upstream maintainer + +> 這個檔只是 PR 的溝通說明,**合併時可以任意改寫或直接刪除**。 +> This file is just PR context — **feel free to edit or delete it when you merge.** + +**[中文](#中文) · [English](#english)** + +--- + +## 中文 + +### 這份 PR 是什麼 +- 來源 fork:`LCY000/VideoTogether-setting` → 目標上游:`VideoTogether/setting`。 +- 內容是 **2026-06-14 ~ 06-18** 對設定頁 `v3` 的一次較大改版:外觀、功能、文案、四語在地化。 +- 光看設定頁,改動幅度就不小(整體視覺重做 + 多個開關與文案調整)。 + +### ⚠️ 這次和前端 PR 是一組的 +設定頁不直接呼叫前端,而是透過共用的擴充 storage 連動(見 `README.md`)。這次改版**和前端 PR 互相搭配**: + +- 前端:`LCY000/VideoTogether` → `VideoTogether/VideoTogether` +- 設定頁新增/調整的開關(如 `EnableMiniBar`、`EnableMessageVoice`、`WaitForLoadding`、`MinimiseDefault` …)需要前端以 `getVideoTogetherStorage('', 預設值)` 讀取。 +- **建議兩個 PR 一起合併**,否則新開關在設定頁會顯示,但前端沒有對應讀取就不會生效。 + +### 這 6–7 天改了什麼(重點整理) +- **外觀整體對齊浮動面板**:品牌藍頂列+logo、玻璃圓角卡片、漸層背景、開關藍校準成面板 `#5b8def`、深色模式、列對齊。 +- **ⓘ 就地展開說明**:每個開關點右側 ⓘ,在原地展開說明文字(不跳窗)。 +- **版面重整**:左欄依重要度排序、欄位改寫、迷你小窗移到左欄、移除主畫面的「輕鬆分享」、「檢查新版本更新」改成醒目按鈕後再收進右上 ⋮ 選單、密碼=控制權說明寫清楚。 +- **官方網站連結**:頂列地球 icon,依語言切 `zh-cn` / `en-us`。 +- **語言處理**:改為「Language」標籤、純「Auto」自動偵測、下拉與顯示語言以 `localStorage` 為準、修掉語言選單約 1 秒自動關閉的 bug。 +- **開關與文案**:新增「文字訊息語音播報」、語音播報預設開、M3U8 固定使用內建播放器並加說明、多處文案準確化。 +- **在地化**:`zh-cn / zh-tw / en-us / ja-jp` 四語同步。 +- **建置來源完整性修復**(本 PR 最後一筆):先前有 commit 直接手改成品 `v3.html`,會在下次建構被來源覆蓋;已把改動同步回 `v3.buildme.html` + `localization/*.json`,並在 README 補上疑難排解。 + +### 上游化檢查清單(你可能想調整的地方) +1. **fork 提及**:只有 `README.md` 兩處寫了「(fork: `LCY000/VideoTogether`)」當貢獻者指路用,其餘檔案沒有 fork 字樣——要保留或拿掉隨你。 +2. **網址/服務(已是上游,無需更動)**:`videotogether.github.io`(站台與 logo)、`unpkg`(MDUI CDN)、`vt.panghair.com:5000`(語音角色錄製 / ReEcho,上游後端)。**沒有任何個人或 fork 的部署網址。** +3. **語音功能的後端依賴**:語音角色錄製會 `POST` 到 `vt.panghair.com:5000/reecho/new_voice`(上游後端);請確認該端點在上游可用。 +4. **設定頁網址**:前端用哪個網址開設定頁,是寫在**前端 repo**、由搭配的前端 PR 處理;本 repo 內沒有需要改的自我網址。 +5. **部署**:GitHub Pages 來源維持 `main`;要重產 `v3.html` 的話,在前端主專案根目錄執行 `python3 script/build_extension.py`。 + +### 怎麼驗證沒被改壞 +`v3.html` 是 `v3.buildme.html` + `localization/*.json` 建構出來的成品。把 v3.html 內嵌的各語言物件用大括號配對抽出來、模擬一次建構,應能原樣還原 v3.html(本 PR 已驗證一致)。 + +--- + +## English + +### What this PR is +- Source fork: `LCY000/VideoTogether-setting` → upstream target: `VideoTogether/setting`. +- A sizable revamp of the `v3` settings page over **2026-06-14 to 06-18**: visuals, features, copy, and four-language localization. +- The settings page alone changed a lot (full visual redesign plus several toggle/copy changes). + +### ⚠️ This pairs with a frontend PR +The settings page doesn't call the frontend directly; it links through shared extension storage (see `README.md`). This revamp **goes together with a frontend PR**: + +- Frontend: `LCY000/VideoTogether` → `VideoTogether/VideoTogether` +- New/changed toggles here (`EnableMiniBar`, `EnableMessageVoice`, `WaitForLoadding`, `MinimiseDefault`, …) are read by the frontend via `getVideoTogetherStorage('', default)`. +- **Please merge both PRs together** — otherwise the new toggles render here but do nothing without the matching frontend readers. + +### What changed in the last 6–7 days +- **Visuals aligned to the floating panel**: brand-blue top bar + logo, glassy rounded cards, gradient background, switches calibrated to the panel blue `#5b8def`, dark mode, row alignment. +- **Inline ⓘ help**: click the info icon on a row to expand its explanation in place (no popup). +- **Layout reorg**: left column ordered by importance, fields rewritten, mini-window moved to the left column, "Easy Share" removed from the main view, "Check for updates" turned into a prominent button then tucked into the top ⋮ menu, password-as-control explanation clarified. +- **Official-site link**: globe icon in the top bar, language-aware (`zh-cn` / `en-us`). +- **Language handling**: "Language" label, pure "Auto" auto-detect, dropdown and display language driven by `localStorage`, fixed the ~1s auto-close bug on the language menu. +- **Toggles & copy**: added "Read text messages aloud", voice readout default on, M3U8 forced to the built-in player with explanation, many copy accuracy fixes. +- **Localization**: `zh-cn / zh-tw / en-us / ja-jp` kept in sync. +- **Build-source integrity fix** (last commit in this PR): an earlier commit hand-edited the generated `v3.html`, which a rebuild reverts; the edits are now synced back into `v3.buildme.html` + `localization/*.json`, and the README gained a troubleshooting note. + +### Upstreaming checklist (things you may want to adjust) +1. **Fork mention**: only `README.md` mentions "(fork: `LCY000/VideoTogether`)" as a pointer for contributors; nothing else references the fork — keep or drop as you prefer. +2. **URLs / services (already upstream, nothing to change)**: `videotogether.github.io` (site & logo), `unpkg` (MDUI CDN), `vt.panghair.com:5000` (voice-character recording / ReEcho, upstream backend). **No personal or fork deployment URLs anywhere.** +3. **Voice feature backend dependency**: voice-character recording `POST`s to `vt.panghair.com:5000/reecho/new_voice` (upstream backend); please confirm that endpoint is available upstream. +4. **Settings-page URL**: which URL the frontend uses to open the settings page lives in the **frontend repo** and is handled by the paired frontend PR; there's no self-URL to change in this repo. +5. **Deploy**: GitHub Pages source stays `main`; to regenerate `v3.html`, run `python3 script/build_extension.py` from the frontend project root. + +### How to verify nothing is broken +`v3.html` is generated from `v3.buildme.html` + `localization/*.json`. Brace-match the inlined per-language objects out of `v3.html` and simulate one build — it should reproduce `v3.html` exactly (verified for this PR). diff --git a/index.html b/index.html deleted file mode 100644 index df661f4..0000000 --- a/index.html +++ /dev/null @@ -1,157 +0,0 @@ - - - - - - - - - - - - -

您当前使用的版本不再支持设置功能

-

你可以访问我们的主页 https://2gether.video/ 获取更多信息

-

The version you are using no longer supports setting

-

You can visit our website https://2gether.video/ to get more info

- - - - - - \ No newline at end of file diff --git a/localization/en-us.json b/localization/en-us.json index 7a268b6..07856db 100644 --- a/localization/en-us.json +++ b/localization/en-us.json @@ -3,15 +3,16 @@ "Setting": "VideoTogether Settings", "Refresh": "Refresh", "Return": "Return to previous", - "MinimiseDefaultLabel": "Minimize window default", - "MinimiseDefaultLabelHelp": "You can display the window by clicking the small icon in the lower right corner.", + "MinimiseDefaultLabel": "Floating panel collapsed by default (docked bottom-right)", + "MinimiseDefaultLabelHelp": "This switch sets the panel's default when you're not in a room: on means every new page starts as a small icon in the bottom-right (click to expand), off means it starts expanded. While you're watching together in a room, each new page keeps your last state — expanded stays expanded, collapsed stays collapsed.", "DisableRedirectJoinLabel": "Do not automatically jump when joining a room", "DisableRedirectJoinLabelHelp": "If you encounter some video links that cannot be jumped correctly, please enable this option and manually open the same video as the host before joining the room.", - "PasswordProtectedRoomLabel": "The room I created must have a password to join", - "PasswordProtectedRoomLabelHelp": "Note: Others can also use the same password to become the owner. Please confirm that he/she is trustworthy before sharing the password.", + "PasswordProtectedRoomLabel": "Viewers need a password to join my room", + "PasswordProtectedRoomLabelHelp": "Off: anyone can join the room with just the room name — no password needed.\nOn: people must enter both the room name and the password to join.\n⚠️ Password = control: someone who knows the room name + password is only a viewer if they tap “Join”; but if they tap “Create room” instead, they take over as the new host and control everything. Only share the password with people you trust.", "ExtensionIsDisabled": "VideoTogether is disabled in this page, the settings in this page will not take effect", "EchoCancellationLabel": "Enable echo cancellation and noise cancellation when call", "WaitForLoaddingLabel": "When a member's video lags, host will pause to wait", + "WaitForLoaddingLabelHelp": "Host only. When any member's video is still buffering, your playback pauses to wait and resumes once everyone has loaded, so no one gets left behind. It won't trigger when you're watching alone, and it doesn't apply to live streams.", "SkipIntroLabel": "Skip Intro", "SkipIntroLengthLabel": "Intro Length:", "SkipIntroSecondLabel": "Seconds", @@ -19,8 +20,19 @@ "EasyShareLabel": "Easy Share", "SuperEasyShareLabel": "Super Powerful Easy Share(may cause video playback issues)", "DisableNativeM3u8PlayerLabel": "Disable native M3U8 player", + "DisableNativeM3u8PlayerLabelHelp": "VideoTogether always uses its own player for m3u8/HLS video — the browser's native HLS player (especially Android Chrome) doesn't expose the controls needed for syncing. Required setting, always on.", "EnableTextMessageLabel": "Text Message", - "EnableMiniBarLabel": "Mini Bar at fullscreen video", - "CheckUpdateLabel": "Check Update", - "CheckUpdateSucc": "Update Successfully" -} \ No newline at end of file + "EnableTextMessageLabelHelp": "In-room text chat: send text messages to others in the same room (like a chat box). Turn on to show the input box and incoming messages.", + "EnableMiniBarLabel": "Show the mini window during fullscreen video", + "EnableMiniBarLabelHelp": "When the video is fullscreen, the floating panel is hidden. Turn this on to show a small window in the corner so you can still see the viewer count and send or receive text messages (it only appears when Text chat is also on).", + "EnableMessageVoiceLabel": "Read text messages aloud", + "EnableMessageVoiceLabelHelp": "When on, incoming text messages in the room are read aloud automatically; when off, they are not.", + "CheckUpdateLabel": "Check for updates", + "OfficialWebsiteLabel": "Official Site", + "CheckUpdateSucc": "Update requested — refresh the page to apply", + "UsageTips": "Tips", + "PinTipLabel": "Pin the extension to your toolbar for quick access", + "PinTipLabelHelp": "Browser extension icons are often tucked into the toolbar's puzzle-piece menu (). Pinning VideoTogether keeps it one click away:
1. Click the puzzle-piece icon at the top-right of your browser.
2. Find “VideoTogether” and click the pin beside it.
Once pinned, the icon stays on your toolbar — just click it to open the panel and turn the extension on or off anytime.", + "DisableTipLabel": "Not using it now? Turn the extension off in one click", + "DisableTipLabelHelp": "When you don't need it, there's no need to remove the extension — one click turns it off, and the VideoTogether panel stops appearing on web pages:
1. Click the VideoTogether icon on your toolbar to open the panel.
2. Flip the switch in the panel to “off”.
The toolbar icon turns grey and the extension stops running on every page. To bring it back, click the icon again and switch it back “on”.
💡 After switching, already-open tabs may need a refresh to fully take effect." +} diff --git a/localization/ja-jp.json b/localization/ja-jp.json index f4ff4ee..b4b939f 100644 --- a/localization/ja-jp.json +++ b/localization/ja-jp.json @@ -3,15 +3,16 @@ "Setting": "VideoTogether 設定", "Refresh": "ページをリフレッシュ", "Return": "前のページに戻る", - "MinimiseDefaultLabel": "デフォルトでウィンドウを最小化", - "MinimiseDefaultLabelHelp": "右下のアイコンをクリックしてウィンドウを表示できます", + "MinimiseDefaultLabel": "フローティングパネルを既定で折りたたむ(右下に格納)", + "MinimiseDefaultLabelHelp": "このスイッチは「部屋にいないとき」のパネルの初期状態を決めます。オンにすると新しいページごとに右下の小さなアイコンに縮小され(クリックで展開)、オフにすると最初から展開されます。部屋で一緒に見ているときは、ページを移動しても直前の状態が引き継がれ、展開していたら展開のまま、閉じていたら閉じたままになります。", "DisableRedirectJoinLabel": "部屋に参加するときに自動リダイレクトしない", "DisableRedirectJoinLabelHelp": "一部のビデオリンクが正しくリダイレクトされない場合は、このオプションを有効にしてください。ホストと同じビデオを手動で開いてから部屋に参加してください", - "PasswordProtectedRoomLabel": "私が作成する部屋にはパスワードが必要です", - "PasswordProtectedRoomLabelHelp": "注意: 他の人も同じパスワードを使用してホストを追い出すことができます。パスワードを共有する前に、相手が信頼できるかどうか確認してください", + "PasswordProtectedRoomLabel": "自分の部屋は参加にパスワードが必要", + "PasswordProtectedRoomLabelHelp": "オフ:みんな「ルーム名」だけで部屋に入れます。パスワードは不要です。\nオン:ルーム名とパスワードの両方を入力しないと参加できません。\n⚠️ パスワード=操作権限:ルーム名とパスワードを知っている人は、「参加」を押せば視聴者ですが、「ルームを作成」を押すとあなたを引き継いで新しいホストになり、全体を操作できます。信頼できる人にだけ共有してください。", "ExtensionIsDisabled": "拡張機能が有効になっていないため、設定は反映されません", "EchoCancellationLabel": "通話時にエコーキャンセルとノイズキャンセルを有効にする", "WaitForLoaddingLabel": "メンバーのビデオが遅延した場合、ホストは一時停止して待機", + "WaitForLoaddingLabelHelp": "ホストのみ有効。部屋の誰かの動画がまだ読み込み中のとき、再生が自動的に一時停止して待ち、全員の準備ができたら一緒に再開します。一人で見ているときは作動せず、ライブ配信には適用されません。", "SkipIntroLabel": "イントロをスキップ", "SkipIntroLengthLabel": "イントロの長さ:", "SkipIntroSecondLabel": "秒", @@ -19,8 +20,19 @@ "EasyShareLabel": "簡単に共有", "SuperEasyShareLabel": "超簡単共有(ビデオ再生に影響を与える可能性あり)", "DisableNativeM3u8PlayerLabel": "ネイティブのM3U8プレーヤーを無効にする", + "DisableNativeM3u8PlayerLabelHelp": "VideoTogether は m3u8/HLS 動画を常に独自プレーヤーで処理します——ブラウザのネイティブ HLS プレーヤー(特に Android Chrome)は同期に必要な制御を提供しません。必須設定で、常にオンです。", "EnableTextMessageLabel": "テキストチャット", - "EnableMiniBarLabel": "フルスクリーンビデオ時のミニウィンドウ", - "CheckUpdateLabel": "更新を確認", - "CheckUpdateSucc": "更新に成功しました" + "EnableTextMessageLabelHelp": "ルーム内のテキストチャット:同じ部屋の人とテキストをやり取りします(チャット欄)。オンにすると入力欄と受信メッセージが表示されます。", + "EnableMiniBarLabel": "全画面動画時にミニウィンドウを表示", + "EnableMiniBarLabelHelp": "動画が全画面のとき、通常のフローティングパネルは隠れます。オンにすると全画面の隅に小さなウィンドウが表示され、視聴人数の確認やテキストメッセージの送受信ができます(「テキストチャット」も有効な場合のみ表示されます)。", + "EnableMessageVoiceLabel": "テキストメッセージを音声で読み上げる", + "EnableMessageVoiceLabelHelp": "オンにすると、ルーム内で受信したテキストメッセージを自動で読み上げます。オフでは読み上げません。", + "CheckUpdateLabel": "新しいバージョンを確認", + "OfficialWebsiteLabel": "公式サイト", + "CheckUpdateSucc": "更新をリクエストしました。ページを再読み込みすると反映されます", + "UsageTips": "使い方のヒント", + "PinTipLabel": "拡張機能をツールバーに固定して、すぐ使えるように", + "PinTipLabelHelp": "ブラウザの拡張機能アイコンは、ツールバーのパズルピースのメニュー()に隠れていることがよくあります。VideoTogether を固定しておくと、いつでもすぐ使えます:
1. ブラウザ右上のパズルピースのアイコン をクリックします。
2.「VideoTogether」を見つけて、その横のピン をクリックします。
固定すると、アイコンがツールバーに常に表示され、クリックするだけでパネルを開いて、いつでも拡張機能をオン・オフできます。", + "DisableTipLabel": "しばらく使わない?ワンクリックで拡張機能をオフに", + "DisableTipLabelHelp": "使わないときは、拡張機能を削除しなくても、ワンクリックで一時的にオフにできます。すると VideoTogether のパネルはウェブページに表示されなくなります:
1. ツールバーの VideoTogether アイコンをクリックして、パネルを開きます。
2. パネルのスイッチを「オフ」に切り替えます。
オフにすると、ツールバーのアイコンがグレーになり、拡張機能はどのページでも動作しなくなります。元に戻すには、もう一度アイコンをクリックしてスイッチを「オン」に戻します。
💡 切り替えた後、開いているタブは一度再読み込みすると完全に反映されます。" } diff --git a/localization/zh-cn.json b/localization/zh-cn.json index 66458d4..53f332a 100644 --- a/localization/zh-cn.json +++ b/localization/zh-cn.json @@ -3,15 +3,16 @@ "Setting": "VideoTogether 设置", "Refresh": "刷新页面", "Return": "返回上级页面", - "MinimiseDefaultLabel": "窗口默认最小化", - "MinimiseDefaultLabelHelp": "可以通过点击右下角的小图标显示窗口", + "MinimiseDefaultLabel": "浮动面板默认收合(停靠右下角)", + "MinimiseDefaultLabelHelp": "这个开关决定『没在房间时』面板的默认样子,开着就在每次打开新页面时先收成右下角的小图标(点一下即可展开),关掉则默认展开。当你正在房间里一起看时,换页会延续你上一页的状态,刚刚展开就保持展开,刚刚收起就保持收起。", "DisableRedirectJoinLabel": "加入房间时不要自动跳转", "DisableRedirectJoinLabelHelp": "如果遇到一些视频链接无法正确跳转时,请开启这个选项。手动打开和房主相同的视频后再加入房间", - "PasswordProtectedRoomLabel": "我创建的房间必须要密码才能加入", - "PasswordProtectedRoomLabelHelp": "注意:其他人同样可以用相同的密码挤掉房主,分享密码前请确认对方值得信赖", + "PasswordProtectedRoomLabel": "我创建的房间,观众要密码才能加入", + "PasswordProtectedRoomLabelHelp": "关闭:大家只要输入「房间名称」就能进入房间,不需要输入房间密码。\n开启:大家要输入房间名称和密码,才能成功加入房间。\n⚠️ 密码=控制权:知道房名+密码的人,按「加入」只是观众,但若改按「创建房间」就会顶掉你、成为新房主控制全场,所以密码只给你信任的人。", "ExtensionIsDisabled": "插件没有被启用, 设置将不会生效", "EchoCancellationLabel": "通话时开启回声消除和噪声消除", - "WaitForLoaddingLabel": "成员视频卡顿时, 房主暂停等待", + "WaitForLoaddingLabel": "成员视频卡顿时,房主暂停等待", + "WaitForLoaddingLabelHelp": "房主开启后,房间里只要有成员的视频还在缓冲卡住,你的播放就会自动暂停等他,等大家都加载好再一起继续,免得有人被丢下。独自一人看不会触发,直播也不适用。", "SkipIntroLabel": "跳过片头", "SkipIntroLengthLabel": "片头长度:", "SkipIntroSecondLabel": "秒", @@ -19,8 +20,19 @@ "EasyShareLabel": "轻松分享", "SuperEasyShareLabel": "超级无敌牛的轻松分享(可能会影响视频播放)", "DisableNativeM3u8PlayerLabel": "关闭原生M3U8播放器", + "DisableNativeM3u8PlayerLabelHelp": "VideoTogether 一律用自己的播放器处理 m3u8/HLS 视频——浏览器原生 HLS 播放器(尤其 Android Chrome)不提供同步所需的控制。此为必要设置,固定开启。", "EnableTextMessageLabel": "文本聊天", - "EnableMiniBarLabel": "全屏视频时的迷你小窗", - "CheckUpdateLabel": "检查更新", - "CheckUpdateSucc": "更新成功" -} \ No newline at end of file + "EnableTextMessageLabelHelp": "房间内的即时文字消息:和同房间的人互相发文字(像聊天室)。开启后才会显示输入框与收到的消息。", + "EnableMiniBarLabel": "全屏视频时显示迷你小窗", + "EnableMiniBarLabelHelp": "视频全屏时原本的浮动面板会被盖住,开启后会在全屏角落显示一个迷你小窗,让你仍能看到房间人数并收发文字消息(需搭配「文本聊天」一起开启才会出现)。", + "EnableMessageVoiceLabel": "文字讯息语音播报", + "EnableMessageVoiceLabelHelp": "开启后,房间内收到的文字消息会用语音自动念出来,关闭则不会念。", + "CheckUpdateLabel": "检查新版本更新", + "OfficialWebsiteLabel": "官方网站", + "CheckUpdateSucc": "已请求更新,刷新页面后生效", + "UsageTips": "使用小技巧", + "PinTipLabel": "把扩展固定到工具栏,随时开关", + "PinTipLabelHelp": "浏览器的扩展图标常被收在工具栏的拼图图标()里。把 VideoTogether 固定出来,使用起来更方便:
1. 点浏览器右上角的拼图图标
2. 找到「VideoTogether」,点它旁边的图钉
固定后,图标就会留在工具栏上,之后点一下即可打开小面板,随时开启或关闭扩展。", + "DisableTipLabel": "暂时不用?一键停用扩展(图标变灰)", + "DisableTipLabelHelp": "不想用的时候,不必卸载扩展,点一下就能暂时停用,网页上也不会再出现 VideoTogether 的面板:
1. 点工具栏上的 VideoTogether 图标,打开小面板。
2. 把面板上的开关切到「关」。
停用后,工具栏图标会变成灰色,扩展也不会在任何网页上运行。想恢复时,再点一次图标、把开关切回「开」即可。
💡 切换后,已打开的标签页可能需要刷新一次才会完全生效。" +} diff --git a/localization/zh-tw.json b/localization/zh-tw.json new file mode 100644 index 0000000..6b0fea7 --- /dev/null +++ b/localization/zh-tw.json @@ -0,0 +1,38 @@ +{ + "LanguageName": "繁體中文", + "Setting": "VideoTogether 設定", + "Refresh": "重新整理頁面", + "Return": "返回上一頁", + "MinimiseDefaultLabel": "浮動面板預設收合(停靠右下角)", + "MinimiseDefaultLabelHelp": "這個開關決定『沒在房間時』面板的預設樣子,開著就在每次開新頁面時先收成右下角的小圖示(點一下即可展開),關掉則預設展開。當你正在房間裡一起看時,換頁會延續你上一頁的狀態,剛剛展開就維持展開,剛剛收起就維持收起。", + "DisableRedirectJoinLabel": "加入房間時不要自動跳轉", + "DisableRedirectJoinLabelHelp": "如果遇到部分影片連結無法正確跳轉,請開啟這個選項。手動開啟和房主相同的影片後再加入房間", + "PasswordProtectedRoomLabel": "我創建的房間,觀眾要密碼才能加入", + "PasswordProtectedRoomLabelHelp": "關閉:大家只要輸入「房間名稱」就能進入房間,不需要輸入房間密碼。\n開啟:大家要輸入房間名稱和密碼,才能成功加入房間。\n⚠️ 密碼=控制權:知道房名+密碼的人,按「加入」只是觀眾,但若改按「創建房間」就會頂掉你、成為新房主控制全場,所以密碼只給你信任的人。", + "ExtensionIsDisabled": "擴充功能沒有啟用,設定將不會生效", + "EchoCancellationLabel": "通話時開啟回聲消除和雜訊消除", + "WaitForLoaddingLabel": "成員影片卡頓時,房主暫停等待", + "WaitForLoaddingLabelHelp": "房主開啟後,房間裡只要有成員的影片還在緩衝卡住,你的播放就會自動暫停等他,等大家都載好再一起繼續,免得有人被丟下。獨自一人看不會觸發,直播也不適用。", + "SkipIntroLabel": "跳過片頭", + "SkipIntroLengthLabel": "片頭長度:", + "SkipIntroSecondLabel": "秒", + "ExperimentalFeature": "實驗性功能", + "EasyShareLabel": "輕鬆分享", + "SuperEasyShareLabel": "超級無敵強的輕鬆分享(可能會影響影片播放)", + "DisableNativeM3u8PlayerLabel": "關閉原生 M3U8 播放器", + "DisableNativeM3u8PlayerLabelHelp": "VideoTogether 一律用自己的播放器處理 m3u8/HLS 影片——瀏覽器原生 HLS 播放器(尤其 Android Chrome)不提供同步所需的控制。此為必要設定,固定開啟。", + "EnableTextMessageLabel": "文字聊天", + "EnableTextMessageLabelHelp": "房間內的即時文字訊息:和同房間的人互相傳文字(像聊天室)。開啟後才會顯示輸入框與收到的訊息。", + "EnableMiniBarLabel": "全螢幕影片時的迷你小窗顯示", + "EnableMiniBarLabelHelp": "影片全螢幕時原本的浮動面板會被蓋住,開啟後會在全螢幕角落顯示一個迷你小窗,讓你仍能看到房間人數並收發文字訊息(需搭配「文字聊天」一起開啟才會出現)。", + "EnableMessageVoiceLabel": "文字訊息語音播報", + "EnableMessageVoiceLabelHelp": "開啟後,房間內收到的文字訊息會用語音自動念出來,關閉則不會念。", + "CheckUpdateLabel": "檢查新版本更新", + "OfficialWebsiteLabel": "官方網站", + "CheckUpdateSucc": "已要求更新,重新整理頁面後生效", + "UsageTips": "使用小技巧", + "PinTipLabel": "把擴充釘選到工具列,隨時開關", + "PinTipLabelHelp": "瀏覽器的擴充圖示常被收在工具列的拼圖圖示()裡。把 VideoTogether 釘選出來,使用起來更方便:
1. 點瀏覽器右上角的拼圖圖示
2. 找到「VideoTogether」,點它旁邊的圖釘
釘選後,圖示就會固定在工具列上,之後點一下即可打開小面板,隨時開啟或關閉擴充。", + "DisableTipLabel": "暫時不用?一鍵停用擴充(圖示變灰)", + "DisableTipLabelHelp": "不想用的時候,不必移除擴充,點一下就能暫時停用,網頁上也不會再出現 VideoTogether 的面板:
1. 點工具列上的 VideoTogether 圖示,打開小面板。
2. 把面板上的開關切到「關」。
停用後,工具列圖示會變成灰色,擴充也不會在任何網頁上運作。想恢復時,再點一次圖示、把開關切回「開」即可。
💡 切換後,已開啟的分頁可能需要重新整理一次才會完全生效。" +} diff --git a/v2.beta.html b/v2.beta.html deleted file mode 100644 index d3242d0..0000000 --- a/v2.beta.html +++ /dev/null @@ -1,458 +0,0 @@ - - - - - - - - - - - - VideoTogether - - - - -
- VideoTogether -
- - brightness_4 - - - more_vert - - -
-
-
-
-
-
-
-
- - - - -
-
- Language / 语言 -
- -
-
- -
- - - help_outline - - -
- -
- - -
- - - -
- - - help_outline - - -
- -
- - - help_outline - - -
- -
- - -
-
- - -
- - -
- -
-
-
-
-
-
-
-
-
-
-
- - , - - - - - - -
-
- - -
-
- - -
-
- - -
-
- - -
-
- - -
-
-
-
-
-
- - - - - - - \ No newline at end of file diff --git a/v2.html b/v2.html index 95264c9..5967a7f 100644 --- a/v2.html +++ b/v2.html @@ -3,596 +3,13 @@ - - - - - - VideoTogether - - - - -
- VideoTogether -
- - brightness_4 - - - more_vert - - -
-
-
-
-
-
-
-
- - - - -
-
- Language / 语言 -
- -
-
- -
- - - help_outline - - -
- -
- - -
- -
- - - help_outline - - -
- -
- - - help_outline - - -
- -
- - -
- -
- -
-
-
-
-
-
-
-
-
-
-
- - , - - - - - - -
-
- - -
-
- - -
-
- - -
-
- - -
-
- - -
-
-
- - - - -
- - - - - -
- -
-
-
-
-
-
-
+ - - - - + - \ No newline at end of file + diff --git a/v2_website.html b/v2_website.html deleted file mode 100644 index 8f7b558..0000000 --- a/v2_website.html +++ /dev/null @@ -1,318 +0,0 @@ - - - - - - - - - - - - VideoTogether - - - - -
- VideoTogether -
- - brightness_4 - - - more_vert - - -
-
-
-
-
-
- - - - - - -
-
- Language / 语言 -
- -
-
- -
- - - help_outline - - -
- -
- - -
- - - -
- - - help_outline - - -
- -
- - - help_outline - - -
- -
- - -
- -
- - - help_outline - - -
- - -
-
-
- - - - - - \ No newline at end of file diff --git a/v2.buildme.html b/v3.buildme.html similarity index 55% rename from v2.buildme.html rename to v3.buildme.html index 9dd15da..be9e5b0 100644 --- a/v2.buildme.html +++ b/v3.buildme.html @@ -12,10 +12,17 @@ VideoTogether - +
+ VideoTogether + + public +
brightness_4 @@ -26,6 +33,8 @@ @@ -51,12 +60,17 @@ { key: "EnableTextMessage", defaultVal: true + }, + { + key: "EnableMessageVoice", + defaultVal: true } ] let languageDicts = { /**VT_DELETE_THIS_LINE "zh-cn": {{{ {"": "./localization/zh-cn.json", "order":0} }}}, + "zh-tw": {{{ {"": "./localization/zh-tw.json", "order":0} }}}, "en-us": {{{ {"": "./localization/en-us.json", "order":0} }}}, 'ja-jp': {{{ {"": "./localization/ja-jp.json", "order":0} }}}, VT_DELETE_THIS_LINE **/ @@ -64,7 +78,7 @@ let currentExtensionLanguages = undefined; function getExtensionLanguages() { - let languages = ['en-us', 'zh-cn']; + let languages = ['zh-cn', 'zh-tw', 'en-us', 'ja-jp']; try{ if(currentExtensionLanguages.length > 0){ languages = currentExtensionLanguages; @@ -79,8 +93,8 @@ let language = 'en-us'; let prefixLen = 0; - if (typeof settingLanguage != 'string') { - settingLanguage = navigator.language; + if (typeof settingLanguage != 'string' || settingLanguage.trim() === '' || settingLanguage.toLowerCase() === 'auto') { + settingLanguage = navigator.language; // 空值/auto=自動偵測瀏覽器語言 } if (typeof settingLanguage == 'string') { settingLanguage = settingLanguage.toLowerCase(); @@ -107,7 +121,7 @@ _lastExtensionLanguages = lastExtensionLanguages; // update the select options const select = document.querySelector("#DisplayLanguage"); - select.innerHTML = ""; + select.innerHTML = ""; for (let i = 0; i < lastExtensionLanguages.length; i++) { const language = lastExtensionLanguages[i]; const option = document.createElement("option"); @@ -125,6 +139,12 @@ } catch (e) { } } + // 官方網站連結依語言切換(上游只有 zh-cn / en-us,其餘退回最接近的) + try { + const officialBase = (displayLanguage && displayLanguage.indexOf('zh') === 0) ? 'zh-cn' : 'en-us'; + const ob = document.querySelector('#OfficialWebsiteBtn'); + if (ob) ob.href = 'https://videotogether.github.io/' + officialBase + '/'; + } catch (e) { } if (displayLanguage == "zh-cn") { document.getElementById('voicePannel').style.display = "none" } else { @@ -134,6 +154,11 @@ function getLanguageText(key) { return languageDicts[getDisplayLanguage(_settingLanguage)][key]; } + // 點 ⓘ 在該列下方就地展開/收合說明(取代會自動消失的 snackbar) + function toggleHelp(id) { + var el = document.getElementById(id); + if (el) el.classList.toggle('vt-help-open'); + } let extensionEnabled = false; window.addEventListener("message", e => { @@ -144,25 +169,23 @@ document.querySelector("#PasswordProtectedRoom").checked = (e.data.data.PasswordProtectedRoom != false); document.querySelector("#WaitForLoadding").checked = (e.data.data.WaitForLoadding != false); document.querySelector("#EchoCancellation").checked = !(e.data.data.EchoCancellation === false); - let isDisplayLanguageUpdated = false; - try { - let newValue = e.data.data.DisplayLanguage ? e.data.data.DisplayLanguage : ""; - if (newValue != document.querySelector("#DisplayLanguage").value) { - isDisplayLanguageUpdated = true; - } - } catch { }; - document.querySelector("#DisplayLanguage").value = e.data.data.DisplayLanguage; + let _vtLangVal = null; + try { _vtLangVal = localStorage.getItem('vtSettingDisplayLanguage'); } catch (e) { } + let _vtDesiredLang = _vtLangVal || e.data.data.DisplayLanguage || 'auto'; + // 只有語言「真的改變」時才重設 select 值+handleUpdate。 + // 否則每秒 PostStorage 都重設 MDUI select,會把使用者展開中的語言選單關掉 + // (修:語言選單一打開、約 1 秒就自己閃退)。 try { - if (isDisplayLanguageUpdated) { - DisplayLanguageSelect.handleUpdate(); + let _vtSel = document.querySelector("#DisplayLanguage"); + if (_vtSel && _vtSel.value !== _vtDesiredLang) { + _vtSel.value = _vtDesiredLang; + try { if (DisplayLanguageSelect) DisplayLanguageSelect.handleUpdate(); } catch { } } } catch { } document.querySelector("#SkipIntroLength").value = emptyStrIfUdf(e.data.data.SkipIntroLength); document.querySelector("#SkipIntro").checked = e.data.data.SkipIntro; - document.querySelector("#EasyShare").checked = (e.data.data.EasyShare != false); - document.querySelector("#SuperEasyShare").checked = e.data.data.SuperEasyShare; - document.querySelector("#DisableNativeM3u8Player").checked = (e.data.data.DisableNativeM3u8Player != false); + document.querySelector("#DisableNativeM3u8Player").checked = true; // 鎖定開啟:一律停用原生 HLS 播放器以利同步(關掉會無法同步 m3u8) if (e.data.data.PublicReechoVoiceId) { updateInnerText(document.getElementById('voiceIdLabel'), "语音角色ID: " + e.data.data.PublicReechoVoiceId) } else { @@ -173,7 +196,10 @@ document.querySelector(`#${item.key}`).checked = e.data.data[item.key] == undefined ? item.defaultVal : e.data.data[item.key]; } currentExtensionLanguages = e.data.data.ExtensionLanguages; - updateDisplayLanguage(e.data.data.DisplayLanguage); + // 本頁記住的語言(localStorage)優先,擴充回傳不覆蓋使用者在本頁的選擇 + let _vtPageLang = null; + try { _vtPageLang = localStorage.getItem('vtSettingDisplayLanguage'); } catch (e) { } + updateDisplayLanguage(_vtPageLang || e.data.data.DisplayLanguage); } }); @@ -186,68 +212,98 @@
-
- Language / 语言 + +
+ Language
+
- + - help_outline + info_outline
+
+
- + + + info_outline +
+
+
- - - help_outline + + + info_outline
+
+
- - - help_outline + + + info_outline
+
+
- +
+
- + + + info_outline + + +
+
+ + +
+
@@ -274,40 +330,38 @@
- - -
-
- - -
-
- + + + info_outline +
+
- + + + info_outline +
+
- + + + info_outline +
+
+
+
+
+
+
+
+
+ +
+ + + info_outline + +
+
+ +
+ + + info_outline + +
+
+
+
+
+
+ diff --git a/v3.html b/v3.html new file mode 100644 index 0000000..48a0e50 --- /dev/null +++ b/v3.html @@ -0,0 +1,1038 @@ + + + + + + + + + + + + VideoTogether + + + + +
+ + VideoTogether + + public + +
+ + brightness_4 + + + more_vert + + +
+
+
+
+
+
+
+
+ + + + +
+ +
+ Language +
+ +
+
+ + +
+ + + info_outline + + +
+
+ + +
+ + + info_outline + + +
+
+ + +
+ + + info_outline + + +
+
+ + +
+ + + info_outline + + +
+
+ + +
+ + +
+ + +
+ + + info_outline + + +
+
+ + +
+ +
+
+
+
+
+
+
+
+
+
+
+ + , + + + + + + +
+
+ + + info_outline + + +
+
+
+ + + info_outline + + +
+
+
+ + + info_outline + + +
+
+
+
+ + + + +
+ + + + + +
+ +
+
+
+
+
+
+
+
+
+
+
+
+
+ +
+ + + info_outline + +
+
+ +
+ + + info_outline + +
+
+
+
+
+
+
+ + + + + + + + \ No newline at end of file diff --git a/vercel.json b/vercel.json index bbfc90f..254dfab 100644 --- a/vercel.json +++ b/vercel.json @@ -1,23 +1,5 @@ { "headers": [ - { - "source": "/sw.js", - "headers": [ - { - "key": "Cache-Control", - "value": "public, max-age=0, must-revalidate" - } - ] - }, - { - "source": "/v2_website.html", - "headers": [ - { - "key": "Content-Disposition", - "value": "attachment; filename=\"v2_website.html\"" - } - ] - }, { "source": "(.*)", "headers": [