overleaf-textarea
overleaf-textarea copied to clipboard
Add button to control plugin on page
This PR implements the suggestion from #21. It creates a button in the toolbar-pdf-left
that allows the plugin to be toggled on and off. Additionally, the code has been refactored so the toggle only affects its own page.
Possible TODOs:
- A better icon (currently Font Awesome, already used by overleaf);
- Proper tooltip (my attempt at imitating overleaf's tooltips failed);
Could use the same icon as the plugin does.
Could use the same icon as the plugin does.
Done:
But it is hard to see. Maybe a new asset should be created instead of one of the icons.
Hi, guess you are right. You can download a white version over here: https://fonts.google.com/icons?selected=Material+Icons&icon.query=spellcheck
I added the white icon to the button and also linked it with the dark theme, so the light theme will show the standard black icon:
This is indeed a critical feature, when will it be available? Or how to use it now?
The button now has a global behavior, like the active
checkbox.
For anyone that can't wait till this PR gets merged, it's also possible to add a bookmarklet which toggles the visibility of the textarea. Benefit of this method is that toggling is instant. For easy acces you can put it in your bookmarks toolbar, this way toggling is only one click away.
Just add a new bookmark and give the following as if it is the url:
javascript: (() => { var element = document.getElementById("spellcheck"); element.style.display = element.style.display === 'none' ? '' : 'none'; })();
I finally had the time to check this out. However, I'm not seeing the icon when building/running local. Am I missing anything?
Also, I think buttons are never cleaned up. For example, when switching tex files, a new button is added.
Also, I think buttons are never cleaned up. For example, when switching tex files, a new button is added.
Buttons are not cleaned up otherwise trying to toggle the text area off would make the button disappear. Nonetheless the button element is named and it is created only if it does not exist. Unfortunately I could not reproduce this scenario, here I can only see one button even switching .tex files.
very excellent pull request. I hope to have it soon.