-
Notifications
You must be signed in to change notification settings - Fork 10
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
fc5007a
commit 15adb3b
Showing
19 changed files
with
554 additions
and
146 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,4 +1,4 @@ | ||
inject-jyutping.zip | ||
node_modules | ||
DS_Store | ||
dist | ||
jsconfig.tsbuildinfo |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,18 +1,14 @@ | ||
<h1>Inject Jyutping <ruby>幫<rt>bong1</rt></ruby> <ruby>漢<rt>hon3</rt></ruby> <ruby>字<rt>zi6</rt></ruby> <ruby>標<rt>biu1</rt></ruby> <ruby>粵<rt>jyut6</rt></ruby> <ruby>拼<rt>ping3</rt></ruby></h1> | ||
|
||
呢個係一個可以幫網頁上面嘅漢字自動標註粵拼嘅 Chrome 同 Firefox 插件,係學習粵拼同粵語嘅強大工具。 | ||
呢個係一個可以幫網頁上面嘅漢字自動標註粵拼嘅 Chrome、Firefox 同 Edge 擴充功能,係學習粵拼同粵語嘅強大工具。 | ||
|
||
A browser extension for Mozilla Firefox and Google Chrome that adds Cantonese pronunciation (Jyutping) on Chinese characters, a powerful tool for learning Cantonese and Jyutping. | ||
A browser extension for Google Chrome, Mozilla Firefox, and Microsoft Edge that adds Cantonese pronunciation (Jyutping) on Chinese characters, a powerful tool for learning Cantonese and Jyutping. | ||
|
||
<h2>Install <ruby>安<rt>on1</rt></ruby> <ruby>裝<rt>zong1</rt></ruby> </h2> | ||
<h2>Install <ruby>安<rt>on1</rt></ruby> <ruby>裝<rt>zong1</rt></ruby></h2> | ||
|
||
- [Chrome Web Store](https://chrome.google.com/webstore/detail/inject-jyutping/lfgpgjkjglogbndlkikjgbbfoiofbdjp) | ||
- [Firefox Browser Add-On](https://addons.mozilla.org/en-US/firefox/addon/inject-jyutping/) | ||
- [Firefox Browser Add-On](https://addons.mozilla.org/firefox/addon/inject-jyutping/) | ||
|
||
<h2>Build <ruby>編<rt>pin1</rt></ruby> <ruby>譯<rt>jik6</rt></ruby> </h2> | ||
|
||
See [`.github/workflows/build.yml`](.github/workflows/build.yml). | ||
|
||
<h2>Screenshot <ruby>截<rt>zit6</rt></ruby> <ruby>圖<rt>tou4</rt></ruby> </h2> | ||
<h2>Preview <ruby>預<rt>jyu6</rt></ruby> <ruby>覽<rt>laam5</rt></ruby></h2> | ||
|
||
![Demo](./demo.jpg) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -15,6 +15,6 @@ | |
"message": "" | ||
}, | ||
"refreshPromptText": { | ||
"message": "請刷新頁面使更改生效。" | ||
"message": "請重新載入頁面以使變更生效。" | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -15,6 +15,6 @@ | |
"message": "" | ||
}, | ||
"refreshPromptText": { | ||
"message": "請刷新頁面使更改生效。" | ||
"message": "請重新載入頁面以使變更生效。" | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,25 @@ | ||
import '/node_modules/webextension-polyfill/dist/browser-polyfill.min.js'; | ||
import '/node_modules/to-jyutping/dist/index.js'; | ||
import '/lib/MessageManager.js'; | ||
|
||
/* Communicate with content script */ | ||
|
||
browser.runtime.onConnect.addListener(port => { | ||
/** @type { MessageManager<{ convert(msg: string): [string, string | null][] }> } */ | ||
const mm = new MessageManager(port); | ||
mm.registerHandler('convert', ToJyutping.getJyutpingList); | ||
}); | ||
|
||
/* Context Menu */ | ||
|
||
browser.contextMenus.onClicked.addListener((info, tab) => { | ||
if (info.menuItemId === 'do-inject-jyutping') { | ||
browser.tabs.sendMessage(tab?.id || 0, { name: 'do-inject-jyutping' }); | ||
} | ||
}); | ||
|
||
browser.contextMenus.create({ | ||
id: 'do-inject-jyutping', | ||
title: browser.i18n.getMessage('contextMenuItemDoInjectJyutping'), | ||
contexts: ['page'], | ||
}); |
This file was deleted.
Oops, something went wrong.
File renamed without changes.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,3 @@ | ||
declare const browser: import('webextension-polyfill').Browser; | ||
declare const ToJyutping: import('to-jyutping').default; | ||
declare const MessageManager: import('./lib/MessageManager').MessageManager; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.