Skip to content

Commit

Permalink
Added link to Forvo; updated dictionary; updated links to Chinese Gra…
Browse files Browse the repository at this point in the history
…mmar Wiki
  • Loading branch information
cschiller committed Mar 8, 2020
1 parent fe7bab3 commit 9ba5506
Show file tree
Hide file tree
Showing 7 changed files with 188,208 additions and 187,096 deletions.
1 change: 1 addition & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -169,6 +169,7 @@ want to look up a word in one of the freely available online dictionaries. Zhong
lets you quickly do that by some simple keyboard shortcuts.

* <kbd>Alt</kbd> + <kbd>1</kbd> looks up the selected word using [LINE Dict](https://dict.naver.com/linedict/zhendict).
* <kbd>Alt</kbd> + <kbd>2</kbd> lets you look up the pronunciation on [Forvo](https://forvo.com).
* <kbd>Alt</kbd> + <kbd>3</kbd> takes you to [Dict.cn](https://dict.cn).
* <kbd>Alt</kbd> + <kbd>4</kbd> uses [iCIBA](https://www.iciba.com).
* <kbd>Alt</kbd> + <kbd>5</kbd> looks up the word in the [MDBG dictionary](https://mdbg.net).
Expand Down
20 changes: 17 additions & 3 deletions content.js
Original file line number Diff line number Diff line change
Expand Up @@ -283,7 +283,20 @@ function onKeyDown(keyDown) {
}
break;

// '2' is currenty unused
case 50: // '2'
if (keyDown.altKey) {
let sel = encodeURIComponent(
window.getSelection().toString());

// https://forvo.com/search/%E4%B8%AD%E6%96%87/zh/
var forvo = 'https://forvo.com/search/' + sel + '/zh/';

chrome.runtime.sendMessage({
type: 'open',
url: forvo
});
}
break;

case 51: // '3'
if (keyDown.altKey) {
Expand Down Expand Up @@ -1057,8 +1070,9 @@ let miniHelp = `
Look up selected text in online resources:
<table style="margin: 10px;" cellspacing=5 cellpadding=5>
<tr><td><b>&nbsp;</b></td><td>&nbsp;</td></tr>
<tr><td><b>Alt + 1&nbsp;:</b></td><td>&nbsp;LINE Dict</td></tr>
<tr><td><b>Alt + 3&nbsp;:</b></td><td>&nbsp;Dict.cn</td></tr>
<tr><td><b>Alt + 1 :</b></td><td>&nbsp;LINE Dict</td></tr>
<tr><td><b>Alt + 2 :</b></td><td>&nbsp;Forvo</td></tr>
<tr><td><b>Alt + 3 :</b></td><td>&nbsp;Dict.cn</td></tr>
<tr><td><b>Alt + 4&nbsp;:</b></td><td>&nbsp;iCIBA</td></tr>
<tr><td><b>Alt + 5&nbsp;:</b></td><td>&nbsp;MDBG</td></tr>
<tr><td><b>Alt + 6&nbsp;:</b></td><td>&nbsp;JuKuu</td></tr>
Expand Down
Loading

0 comments on commit 9ba5506

Please sign in to comment.