batterseapower / pinyin-toolkit

A plugin for the Anki Spaced Repetition System (http://ichi2.net/anki/)
http://batterseapower.github.com/pinyin-toolkit/
39 stars 14 forks source link

Rewrite Link-Bar Feature as a Dictionary Lookup List #42

Open Nick3C opened 15 years ago

Nick3C commented 15 years ago

I have added a 'Link-Bar' feature to paste a list of dictionary links into a field. It is designed to be displlayed as a bar at the top of the card. I am using it next to my card-type identifier [which indicates what answer I should give to the card] like so: [ English ] [nckiu] [WikiDict] [CEDICT] [e]

English is the question prompt and the other items are links to web dictionaries. It lets us add easy access to other features now, without having to spend all the time to impliment them.

The starting links are just a suggestion.

I have made this configurable (on/off) in the config.db and it will need to be added to the preferences dialogue. Additionally it could do with being made customisable. The best way is probably to provide a field in preference that lets the user write their own html phrase

It would be nice (though not vital) to make these things pop up in anki or display in the sidebar in a similar way to RLC_blitzer.

Also, I would like to fix the issue that means the bar doesn't display in the same order every time. I presume this is some issue with using dictionaries in this way so we need to find a way to sort it :/

batterseapower commented 15 years ago

I've added the links array to the config as well - we can eventually provide UI to update it.

I've also fixed the problem with the order being nondeterministic.

Nick3C commented 15 years ago

Oh, thought I fixed the order already...

Um. I have a confession... on reflection I have decided that the link-bar is a bad idea. The idea of having a dictionary lookup like this is a very good idea, just not in the format I have it in now as it is a bit messy to have a field for it when it can just be generated each time. How about we restructure it as a toolbr button?

I was thinking that it could bring up a popup like the recent cards deck in anki 0.9.9.8 (press control+r) what do you think?

batterseapower commented 15 years ago

I think thats a much better idea. Bit more work though. Let's disable the link bar feature and defer work on it for a bit until we can get a release out.

Nick3C commented 15 years ago

sure

Nick3C commented 15 years ago

oh, and note future plan to have it open in Anki popup rather than in browser

Nick3C commented 15 years ago

Incidentally I saw your code to add dictionary but modified it slightly to: %(Chinese)s (i.e. to protect the colourisation and make the link underline vanish.

This is sort of where I was coming from with link-bar, except if you add it into the card template you get two problems: 1) only have the one dictionary 2) it appears on all cards in the deck browser and so gets in the way and makes it hard to find 3) can't change for all models at once.

What we could do is have the recent-decks-style popup pop up when a character is clicked on to let the user decide which dictionary to query (also for pinyin and english meanings). We could even consider doing it using javascript if that would be easier?