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

[pull] master from ClearlyKyle:master #2

Open
wants to merge 31 commits into
base: master
Choose a base branch
from
Open
Changes from all commits
Commits
Show all changes
31 commits
Select commit Hold shift + click to select a range
078d611
Added option to save both types of example sentences, and another opt…
ClearlyKyle May 28, 2024
4b5563a
only gather screenshot data if we are actually going to use it with t…
ClearlyKyle Dec 1, 2024
ac4d6fa
only gather data for fields we will be saving to
ClearlyKyle Dec 1, 2024
8f339d5
word will always be highlighted in subtitle, and fix bug image field …
ClearlyKyle Dec 1, 2024
26ebfa7
dont create duplicate screenshots
ClearlyKyle Dec 2, 2024
f0b09ea
toggle console logging
ClearlyKyle Dec 3, 2024
8fb9459
removed unused function, prefer let over var
ClearlyKyle Dec 3, 2024
9f958ae
buttons are made once, less query when setting buttons
ClearlyKyle Dec 4, 2024
08b62e6
removed file
ClearlyKyle Dec 4, 2024
874637e
if no anki connect url is set, we use the default one
ClearlyKyle Dec 4, 2024
092eeb8
updated popup code
ClearlyKyle Dec 6, 2024
30f1c66
updated popup loading and saving settings
ClearlyKyle Dec 6, 2024
e616cd7
updated README possible errors
ClearlyKyle Dec 7, 2024
1969811
simplified the setting up of element naming for easier adding more op…
ClearlyKyle Dec 9, 2024
84ee663
mapping the adding options to dropdowns
ClearlyKyle Dec 9, 2024
35b372d
Promise.all now working
ClearlyKyle Dec 9, 2024
d1acb13
recording audio from video
ClearlyKyle May 29, 2024
bf7386c
audio field option
ClearlyKyle May 30, 2024
da19d3c
capturing audio
ClearlyKyle Oct 30, 2024
baf0396
capturing audio and sending to anki
ClearlyKyle Dec 2, 2024
54202a0
url should be set without ankiFieldScreenshotSelected being used
ClearlyKyle Dec 11, 2024
ff0f624
save only one audio file for a given sub
ClearlyKyle Dec 11, 2024
def0129
Collecting audio from Yotube videos, audio will only collected once p…
ClearlyKyle Dec 12, 2024
bb24518
improved word highlighting
ClearlyKyle Dec 14, 2024
a950451
bug fix for audio/screenshot data not being recreated if user makes a…
ClearlyKyle Dec 15, 2024
9610ffe
added Init and more consistent globals naming
ClearlyKyle Dec 15, 2024
332a3ce
updated README
ClearlyKyle Dec 17, 2024
6d8d396
fix bug with example sentences starting with "undefined"
ClearlyKyle Dec 17, 2024
c506301
Fix not saving model and deck values #8
ClearlyKyle Jan 3, 2025
ac118cd
Fix initializing empty saved words list
ClearlyKyle Jan 4, 2025
f333ecb
#9 fix Get_Video_URL not selecting video element for Netflix, was ret…
ClearlyKyle Feb 11, 2025
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
25 changes: 17 additions & 8 deletions README.md
Original file line number Diff line number Diff line change
@@ -10,16 +10,20 @@ Language Reactor can be found here:

## Setup

1) Must install [AnkiConnect](https://ankiweb.net/shared/info/2055492159) plugin.
2) Must leave the Anki desktop application open in order to connect to it.
3) Install unpacked extension.
4) Setup the URL (default is `http://localhost:8765`), deck and model
1) Must install the [AnkiConnect](https://ankiweb.net/shared/info/2055492159) plugin.
2) Must leave the Anki desktop application open in order for Ankiconnect to connect to it.
3) Install the unpacked `Language-Learning-With-Anki` extension.
4) Setup the URL (default is `http://localhost:8765`), deck and model values, making sure the top field of your note type has a [valid field](#empty-note-error) value.

## Usage

Click a word to bring up the definition popup.
Clicking the Anki button will send the current word and definition straight to Anki.
Also, the "RC" option, will remove the colour from the selected word
The "RC" option, will remove the colour from the selected word

If the highlight word option is turned on then all words sent to Anki will be saved and highlighted, with this setting turned off, words will not be saved so will not be highlighted if turned back on.

When using the audio field, the extension will replay the subtitle again to collect the audio. Let the video play and wait for the success popup before doing anything else, interupting the playblack may cause a half finished audio track. Subsequent cards made with the same subtitle, will not need to recreate the audio.

![bubble-screenshot](https://raw.githubusercontent.com/ClearlyKyle/Language-Learning-With-Anki/master/screenshots/popup.PNG)

@@ -35,7 +39,8 @@ Exported data fields:
6) `Example Sentences` - examaples bellow the definitons in the popup, either from current video or Tatoeba
7) `Example Source` - Tatoeba or Current video
8) `Other Translation` - the extra translations of the word, formatted in HTML
9) `(URL)` - URL of current video with the current timestamp
9) `Audio` - audio for the current subtitle (limited to 16s)
9) `URL` - URL of current video with the current timestamp
10) `Highlight` - toggle wether to highlight words exported to Anki in the choosen colour

Settings allow you to choose which fields are filled with what data. A blank options means that data is skipped
@@ -44,7 +49,7 @@ Settings allow you to choose which fields are filled with what data. A blank opt

## Poissible Errors

`Acess to fetch at 'http://localhost:8765' from origin 'https://www.netflix.com' has been blocked by CORS policy`
- `Acess to fetch at 'http://localhost:8765' from origin 'https://www.netflix.com' has been blocked by CORS policy`

You need to make sure Netflix and Youtube are add to the "webCorsOriginList" in your AnkiConnect config. To do this, go to:

@@ -57,4 +62,8 @@ Example of "webCorsOriginList"
"https://www.netflix.com",
"https://www.youtube.com"
]
```
```

- `cannot create note because it is empty`<a id="empty-note-error"></a>

Make sure the field at position 1 in your Anki note type (Tools > Manage Note Types) is set to a value in the extentions settings page, if not, then you will get this error. See [also](https://github.com/ClearlyKyle/Language-Learning-With-Anki/issues/7#issuecomment-2510020695)
2 changes: 0 additions & 2 deletions background.js
Original file line number Diff line number Diff line change
@@ -2,10 +2,8 @@ chrome.runtime.onMessage.addListener(function (request, sender, sendResponse)
{
if (request.action === 'captureVisibleTab')
{
// Capture the visible tab
chrome.tabs.captureVisibleTab(null, { format: 'png' }, function (data_url)
{
// Send the captured image data back to the content script
sendResponse({ imageData: data_url });
console.log(data_url);
});
Loading