migaku-official / Migaku-Dictionary-Addon

Migaku Dictionary allows users to lookup word definitions, export definitions to their cards in real-time, hear word audio and see word frequency, etc. If you have an issue please report it in the "Issues" tab. Reponses to issues can be slow on GitHub, for faster support consider joining our Discord server through our Patreon page.
GNU General Public License v3.0
64 stars 24 forks source link

More flexible "send to field" options #35

Closed lostasock closed 4 years ago

lostasock commented 4 years ago

Type:

Environment:

I'm going to open a PR to resolve the issue:

Description: I'd love to see more control over what part/s and where to, the header of a definition gets sent to. Currently the whole header gets sent to a single field. There is no option to change formatting, choose which parts get sent, or choose where they are being sent to.

I think more control over this would be beneficial, because it could help to improve the efficiency of doing reviews. With the current implementation, information that I don't need during reviews is displayed on the card, and is distracting. I don't need to see the altterm or the card's frequency. This information though, is useful whilst adding the definitions in the first place, and later, the frequency especially is useful when deciding what to do with a leech card.

The other reason is so that I can match the cards to have the same format as the rest of my (6000+) non-MIA-dictionary made cards. If the information on the cards is in the same place each time, I don't have to waste any time searching.

Obviously it's not much time, but I think these little inefficiencies can add up over tens of thousands of reviews. The way I'm imagining that it could be implemented, is a "custom..." option under the part where you select a field to send the information to.

image

lostasock commented 4 years ago

I've come up with a workaround that's probably better than what I was suggesting above anyway. As you can see in the code below, I am simply using the replace() method in javascript to hide the stars.

<span id="htmlMeaningNoStars"><span>
<script>
var meaningStars = "{{Meaning}}";
var meaningNoStars = meaningStars.replace(/★/g, "");
document.getElementById("htmlMeaningNoStars").innerHTML = meaningNoStars;
</script>