Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Feat/refactor network request #60

Merged
merged 23 commits into from
Dec 14, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion src/manifest.json
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
"name": "Stylish Reader",
"description": "Help you learn English better and easier.",
"developer": { "name": "Toly Feng", "url": "https://stylishreader.com" },
"version": "0.0.15",
"version": "0.0.16",
"icons": {
"48": "icons/stylish-reader-48.png"
},
Expand Down
16 changes: 11 additions & 5 deletions src/webPage/translationPanel/src/utils.ts
Original file line number Diff line number Diff line change
Expand Up @@ -53,19 +53,25 @@ export function convertStringToLowerCaseAndRemoveSpecialCharacter(s: string) {

export function goToLangManWebsite() {
const word = localStorage.getItem("currentWord")!;
window.open(`https://www.ldoceonline.com/dictionary/${word}`);
if (word) {
window.open(`https://www.ldoceonline.com/dictionary/${word}`);
}
}

export function goToCambridgeWebsite() {
const word = localStorage.getItem("currentWord")!;
window.open(`https://dictionary.cambridge.org/dictionary/english/${word}`);
if (word) {
window.open(`https://dictionary.cambridge.org/dictionary/english/${word}`);
}
}

export function goToGoogleTranslate() {
const word = localStorage.getItem("currentWord")!;
window.open(
`https://translate.google.com/?sl=auto&tl=zh-CN&text=${word}&op=translate`
);
if (word) {
window.open(
`https://translate.google.com/?sl=auto&tl=zh-CN&text=${word}&op=translate`
);
}
}

export async function searchWord(word: string) {
Expand Down
Loading