Commit Graph

1571 Commits

Author SHA1 Message Date
toasted-nutbread
4110a848f5 Move additional utility functions to DOM 2019-11-26 18:59:52 -05:00
toasted-nutbread
96aad50340 Create DOM utility file 2019-11-26 18:59:52 -05:00
siikamiika
c2ff25b0ec use fallback for ambiguous furigana
fixes #281, fixes #94
2019-11-27 01:20:04 +02:00
toasted-nutbread
50604b25e6 Organize core.js 2019-11-26 17:38:05 -05:00
toasted-nutbread
099847729c utilIsObject => isObject, move to core.js 2019-11-26 17:33:09 -05:00
toasted-nutbread
7e94fca7c7 Rename extension.js to core.js to better reflect its use 2019-11-26 17:29:52 -05:00
toasted-nutbread
a14b820a19 Move utilInvoke into api.js, rename to _apiInvoke 2019-11-26 17:23:55 -05:00
toasted-nutbread
d71bd056e8 Use consistent event handler notation 2019-11-26 17:18:17 -05:00
toasted-nutbread
7f9a73135d Remove utilAsync 2019-11-26 17:18:17 -05:00
toasted-nutbread
0ebf676305 Update WanaKana to v4.0.2
Resolves #290
2019-11-26 12:46:41 -05:00
toasted-nutbread
3a7ef6c560 Simplify clozeBuild 2019-11-26 12:35:17 -05:00
toasted-nutbread
afddec66eb Update cloze.body to use original sentence text 2019-11-26 12:35:17 -05:00
toasted-nutbread
befee9ceca Pass kanji character to clozeBuild 2019-11-26 12:35:17 -05:00
toasted-nutbread
cb9f9b585a Update how source terms are navigated 2019-11-26 12:31:20 -05:00
toasted-nutbread
c7cb1b3d9e Require context for setContentTerms and setContentKanji 2019-11-26 12:31:17 -05:00
toasted-nutbread
cfa16ce675 Include sentence in context on search page 2019-11-26 11:34:06 -05:00
siikamiika
3423ed7d67
Merge pull request #279 from siikamiika/query-parser-1
Search page query parser
2019-11-26 18:31:35 +02:00
toasted-nutbread
820beb7c93 Fix incorrect opacity check 2019-11-25 21:04:34 -05:00
toasted-nutbread
9dc03f6d47 Remove wanakana reference from float.html 2019-11-25 13:34:56 -05:00
toasted-nutbread
91c54e1853 Remove JQuery from the context popup window 2019-11-24 11:46:29 -05:00
toasted-nutbread
10b33dbd20 Optimize toggle on the context popup window
Remove bootstrap-toggle dependency
2019-11-24 11:42:27 -05:00
toasted-nutbread
cf18e3b42e Replace string.substr and string.slice with string.substring
Improves semantic clarity, and it's recommended to not use substr.
2019-11-24 11:02:52 -05:00
toasted-nutbread
eef05f6a64 Add accept type for dictionary import 2019-11-24 10:47:07 -05:00
siikamiika
89c6ef54b0 always return a promise from Mecab.invoke 2019-11-24 02:34:16 +02:00
siikamiika
43fad608fb remove popup from background page
Not supported on all browsers
2019-11-23 19:25:11 +02:00
siikamiika
7bf2c8048d add mecab version check 2019-11-23 19:18:29 +02:00
siikamiika
2577d4054e fix scanning parser 2019-11-23 18:08:22 +02:00
siikamiika
cc8221c6ea add reading modes 2019-11-23 17:50:46 +02:00
siikamiika
f625321650 refactor selected parser refreshing 2019-11-23 17:50:46 +02:00
siikamiika
933fd77957 remove async 2019-11-23 17:50:46 +02:00
siikamiika
707b039927 store local copy of selected parser
Options don't update early enough even after awaiting
2019-11-23 17:50:46 +02:00
siikamiika
0d6e0edc31 remove height hack and use overflow-y: scroll 2019-11-23 17:50:46 +02:00
siikamiika
f6f19dc9de typo 2019-11-23 17:50:46 +02:00
siikamiika
9dff658640 add parser selection 2019-11-23 17:50:46 +02:00
siikamiika
84f30113e4 give names to complex slices 2019-11-23 17:50:46 +02:00
siikamiika
b02a30a2fd explicit checks in while and if 2019-11-23 17:50:46 +02:00
siikamiika
1f2eee449e mecab refactoring and bugfix 2019-11-23 17:50:46 +02:00
siikamiika
f97877a209 promise improvements 2019-11-23 17:50:46 +02:00
siikamiika
b336ab3a9a use const 2019-11-23 17:49:25 +02:00
siikamiika
8d9a635d5c remove dead code 2019-11-23 17:48:03 +02:00
siikamiika
c1d24208d3 start mecab only after enabling the setting 2019-11-23 17:45:44 +02:00
siikamiika
955e131f96 add parser selection options 2019-11-23 17:45:44 +02:00
siikamiika
1700318988 remove unneeded feature
Unidic actually has a field for the base form of the input
2019-11-23 17:45:44 +02:00
siikamiika
1bf48d24ef change mecab path
https://github.com/siikamiika/yomichan-mecab-installer
2019-11-23 17:45:44 +02:00
siikamiika
515345ba0a remove code duplication 2019-11-23 17:45:44 +02:00
siikamiika
b0c924d4bd fix mecab variable 2019-11-23 17:45:44 +02:00
siikamiika
bc66f254ea click & text selection improvements on search page 2019-11-23 17:45:44 +02:00
siikamiika
c78ca36f3d switch to mousemove events in query parser 2019-11-23 17:45:44 +02:00
siikamiika
8825c481b5 respect text selection option in query parser 2019-11-23 17:45:44 +02:00
siikamiika
5a3e8c819c optimize mouseover scanning in query parser 2019-11-23 17:45:44 +02:00
siikamiika
41020289ab add mecab support 2019-11-23 17:45:44 +02:00
siikamiika
3881457e4e use handlebars templates for query parser 2019-11-23 17:45:44 +02:00
siikamiika
e6a1b78164 use correct source text 2019-11-23 17:44:31 +02:00
siikamiika
408aa73cce fix default params for term clicking 2019-11-23 17:43:30 +02:00
siikamiika
627e16d44b improve text preview 2019-11-23 17:43:30 +02:00
siikamiika
530b95895b remove unused css 2019-11-23 17:40:52 +02:00
siikamiika
d19f447b80 fix stem length checking
Starting from the end and stopping at first match doesn't guarantee
correctness. Starting from the beginning does.
2019-11-23 17:40:52 +02:00
siikamiika
c35a05cd62 add kana to text 2019-11-23 17:40:52 +02:00
toasted-nutbread
b4c6fa2d37 Improve usability of domain profile condition 2019-11-23 10:28:37 -05:00
siikamiika
f63e8e4be0 add simple query parser 2019-11-23 16:56:10 +02:00
toasted-nutbread
baf0325f62 Fix missing details 2019-11-18 21:55:06 -05:00
Alex Yatskov
b1659522b3
Merge pull request #274 from toasted-nutbread/lookup-wildcards
Lookup wildcards
2019-11-13 18:51:50 -08:00
siikamiika
7d9d45ae10 close popups on search page when query changes 2019-11-13 21:19:01 +02:00
siikamiika
29c38b06b2 only paste Japanese text from clipboard 2019-11-13 13:51:47 +02:00
toasted-nutbread
db4a303365 Fix dictionary settings not using the current profile 2019-11-12 20:13:25 -05:00
toasted-nutbread
72e7a42c8d Fix settings not being saved correctly 2019-11-12 20:01:55 -05:00
toasted-nutbread
7333873244 Add support for wildcards 2019-11-10 14:02:43 -05:00
toasted-nutbread
3a225c3f91 Add details field to apiTermsFind 2019-11-10 14:02:43 -05:00
toasted-nutbread
7093d8f06e Simplify how definition count is limited 2019-11-10 14:02:43 -05:00
toasted-nutbread
58c0997999 Give findKanji the same API as findTerms 2019-11-10 14:02:43 -05:00
toasted-nutbread
af1662acad Update how apiTermsFind works 2019-11-10 14:02:43 -05:00
toasted-nutbread
ae10bb7096 Simplify dictTermsSort 2019-11-10 14:02:43 -05:00
toasted-nutbread
fe82913991 Rename function 2019-11-10 14:02:43 -05:00
toasted-nutbread
a9ab774a3f Move function 2019-11-10 14:02:43 -05:00
toasted-nutbread
d9b4404075 Create functions for the cases of isMouseButton
jshint was showing a warning that there was no break statement
after the first case, which there doesn't need to be.

The most straightforward way to fix this without using the unclear
// jshint ignore:line
is to just have two functions.

This change also updates invocations of isMouseButton to use
the exact case function, as this will remove the need to check
the case of mosueEvent.type. This was done because onMouseMove
is invoked at a high frequency.
2019-11-10 14:00:44 -05:00
toasted-nutbread
dad685dba4 Fix overwriting const value 2019-11-10 13:56:06 -05:00
toasted-nutbread
d6cdd693c8 Fix several warnings about name conflicts 2019-11-10 13:55:37 -05:00
toasted-nutbread
157e6f7c75 Optimize DisplaySearch.onKeyDown 2019-11-10 13:40:48 -05:00
toasted-nutbread
120f97be26 Refactor apiOptionsSet 2019-11-10 13:36:35 -05:00
toasted-nutbread
aa92855b37 Fixes for Edge 2019-11-10 13:01:39 -05:00
toasted-nutbread
75883ed885 Remove dexie 2019-11-10 13:01:39 -05:00
toasted-nutbread
e48bfb8f1a Use native indexedDB pointer 2019-11-10 13:01:39 -05:00
toasted-nutbread
183ec6b381 Use native IndexedDB to delete the database 2019-11-10 13:01:39 -05:00
toasted-nutbread
3a1e3392ed Use native IndexedDB to create database and object stores 2019-11-10 13:01:39 -05:00
toasted-nutbread
6c023789d9 Use native IndexedDB for bulkAdd operations 2019-11-10 13:01:39 -05:00
toasted-nutbread
750439ebf0 Use native IndexedDB for database additions 2019-11-10 13:01:39 -05:00
toasted-nutbread
6f53030469 Use for of loop instead of forEach 2019-11-10 12:25:28 -05:00
sabs
fd17a0fccd Remove Download check when resolving Audio data
There is a bug (seemingly unreported) in Yomichan where an Anki card
will not contain any audio if the JapanesePod101 audio source trumps
a secondary audio source (e.g. JapanesePod101-alternate) where
the jpod101 source can't find the word requested.

For example, そして has an audio entry in the alternate source but not
the standard source.

(Alternatively, there may be a bug in the jpod101 audioUrlBuilder,
because I've only noticed this problem with hiragana-only expressions.
JPod101 may not host those on the same url scheme any more.  I'm not
sure how to fix that, though, and the bug I'm addressing here does
still persist).

The reason this happens is that audioGetFromUrl uses downloaded audio
to effectively check for a 404 (by examining the audio duration), but
that check doesn't happen when an Anki card is being created (i.e.
"download" is set, which I've changed to "willDownload" here).

This change removes that check, but retains the will-download intent
information to prevent attempts to download tts data, which AnkiConnect
cannot do. I've also added a short explanation as to why the download
check happens where it does.

I think the unused audio object will get garbage collected since it's
not referenced again, but I've explicitly unset it as well.
2019-11-09 20:58:09 -05:00
toasted-nutbread
3e864c44c3 Fixes for Edge 2019-11-09 20:52:16 -05:00
siikamiika
4ac4128388 search page checkbox styling
Change checkboxes to color-inverting icons
2019-11-10 03:15:55 +02:00
toasted-nutbread
184cc4cf28 Allow templates to be tested on the settings page 2019-11-09 16:34:39 -05:00
toasted-nutbread
085881d342 Use HTML templates for anki fields 2019-11-09 14:31:13 -05:00
siikamiika
40c8268fd6 always disable scanning IME checkbox label 2019-11-09 13:01:21 +02:00
siikamiika
cf0bb0a9e2 enable custom CSS on search page 2019-11-09 12:43:22 +02:00
siikamiika
177fad56b5 use scan toggling for stroke order diagram too 2019-11-09 12:28:12 +02:00
siikamiika
25af532ab7 enable expression scan toggling on search page 2019-11-09 12:27:09 +02:00
toasted-nutbread
b59a5b8cdb Add support for some regex functions in handlebars templates 2019-11-08 22:57:20 -05:00
toasted-nutbread
4d7940e8e4 Optimize dictFieldFormat 2019-11-08 22:25:03 -05:00
toasted-nutbread
fa963722a7 Fix seekForward and seekBackward not handling length=0 case correctly 2019-11-08 19:24:33 -05:00
toasted-nutbread
b059609670 Add outdated warning 2019-11-07 20:30:55 -05:00
toasted-nutbread
cad0648cbe Remove unused function 2019-11-07 20:30:55 -05:00
toasted-nutbread
f7700789fe Update dictionary order based on priority 2019-11-07 20:30:55 -05:00
toasted-nutbread
fcb922400a Prevent page exit while database operations are in progress 2019-11-07 20:30:55 -05:00
toasted-nutbread
e5dcb41824 Add support for importing multiple dictionaries at once 2019-11-07 20:30:55 -05:00
toasted-nutbread
e091c7ebe2 Add support for deleting individual dictionaries 2019-11-07 20:30:55 -05:00
toasted-nutbread
e355b83914 Update how nodes are hidden 2019-11-07 20:30:55 -05:00
toasted-nutbread
3d78d5400d Add button and confirmation dialog for database purge 2019-11-07 20:30:55 -05:00
toasted-nutbread
2ab871e7ee Update how dictionaries are displayed on the settings page 2019-11-07 20:30:55 -05:00
toasted-nutbread
79069d5908 Add functions for getting dictionary information 2019-11-07 20:30:55 -05:00
toasted-nutbread
44638b7ceb Simplify how option visibility is changed 2019-11-07 20:30:55 -05:00
91c01e0a7e Update version 2019-11-05 19:03:23 -08:00
toasted-nutbread
a85ec440d6 Fix overlapping popup timers 2019-11-05 19:48:08 -05:00
siikamiika
83460bcdad refactoring and optimization 2019-11-04 02:15:33 +02:00
siikamiika
f4a987912a prevent accidental lookup on glossary text select 2019-11-03 18:56:22 +02:00
toasted-nutbread
75ff05148d Fix autoHideResults not working 2019-11-03 11:06:31 -05:00
toasted-nutbread
7de24dd355 Add favicons 2019-11-02 10:10:03 -04:00
toasted-nutbread
bcffe80a1e Group similar functions together 2019-10-28 17:03:42 -04:00
toasted-nutbread
6d85dae68d Fix some issues with the context menu 2019-10-28 17:03:42 -04:00
toasted-nutbread
d2644c0776 Style update 2019-10-28 17:03:42 -04:00
toasted-nutbread
c365101ec2 Reset preventions earlier 2019-10-28 17:03:42 -04:00
toasted-nutbread
e542f38110 Check pendingLookup earlier 2019-10-28 17:03:42 -04:00
toasted-nutbread
9703e123bf Remove setPrimaryTouch 2019-10-28 17:03:42 -04:00
toasted-nutbread
80eb357527 Simplify touch event implementation 2019-10-28 17:03:42 -04:00
toasted-nutbread
131dc8397d Make selectionContainsPoint static 2019-10-28 17:03:42 -04:00
toasted-nutbread
a648e05091 Improve naming 2019-10-28 17:03:42 -04:00
toasted-nutbread
9178636613 Remove setters 2019-10-28 17:03:42 -04:00
toasted-nutbread
c74c466c36 Remove unused variable 2019-10-28 17:03:42 -04:00
toasted-nutbread
f2dec4ca20 Remove searchFromTouch 2019-10-28 17:03:42 -04:00
toasted-nutbread
8c5240d7a6 Simplify how touch events use onAfterSearch 2019-10-28 17:03:42 -04:00
toasted-nutbread
e91bcf5f55 Rename textSourceLast to textSourceCurrent 2019-10-28 17:03:42 -04:00
toasted-nutbread
be27781c15 Update how definitions are searched for 2019-10-28 17:03:42 -04:00
toasted-nutbread
f927f806ba Move check 2019-10-28 17:03:42 -04:00
toasted-nutbread
1f0a434e96 Remove unused vars 2019-10-28 17:03:42 -04:00
toasted-nutbread
dcb6f68826 Don't pass null textSource into searchSource 2019-10-28 17:03:42 -04:00
toasted-nutbread
185963899b Use promiseTimeout 2019-10-28 17:03:42 -04:00
toasted-nutbread
d608657495 Move onError catch into searchAt 2019-10-28 17:03:42 -04:00
toasted-nutbread
1039536cfb Create promise version of setTimeout 2019-10-28 17:03:42 -04:00
siikamiika
f6d3f739a8 improve search page checkbox usability
Disable text selection and make the entire area clickable, including
whitespace
2019-10-28 01:13:05 +02:00
siikamiika
a31ee0a0e9 refactoring 2019-10-28 00:09:36 +02:00
siikamiika
d62d04f806 fix wanakana toggle on empty input 2019-10-27 23:52:16 +02:00
siikamiika
68179607b3 use apiOptionsGet to modify the correct profile 2019-10-27 23:34:50 +02:00
siikamiika
9641747ba1 Revert "modify correct profile apiOptionsSet"
This reverts commit 51c35c9f30.
2019-10-27 23:02:41 +02:00
siikamiika
51c35c9f30 modify correct profile apiOptionsSet 2019-10-27 22:43:20 +02:00
siikamiika
70418202cf make search page checkbox options persist 2019-10-27 20:11:23 +02:00
siikamiika
48776145d6 add workaround to Chrome clipboard.readText
For some reason this doesn't work on Firefox, so keep using the new API
for Firefox
2019-10-27 15:46:27 +02:00
siikamiika
d3f51690f8 make clipboardRead an optional permission 2019-10-27 01:51:18 +03:00
siikamiika
7ee87265cd refactor and tune wanakana toggling 2019-10-27 01:26:17 +03:00
siikamiika
01ffb052e6 simplify search history state handling 2019-10-26 19:32:41 +03:00
siikamiika
bbbd23c842 add button to enable/disable wanakana IME 2019-10-26 19:12:13 +03:00
siikamiika
303205dc12 keep url query in history 2019-10-26 18:42:57 +03:00