Skip to content
This repository has been archived by the owner on Jun 13, 2024. It is now read-only.

Add a badge to show the substitution count #50

Open
wants to merge 3 commits into
base: master
Choose a base branch
from

Conversation

piquan
Copy link

@piquan piquan commented May 28, 2016

(Note that this pull request is based on top of #48. The code to count substitutions is different depending on whether or not #48 is accepted, so I wrote this branch assuming it would be. That means that #48's diffs show up here too; I'll update the pull request once #48 is accepted or rejected.)

Add a badge to show the substitution count.

This also changes the disabled icon, since it has a drawn-in badge. If it makes substitutions but then the user disables the extension, the substitution count is still shown until the page is reloaded (because
there are still substitutions on the page). The two badges conflict visually, so this pull request changes the disabled icon.

This also will add mouseovers with the original text.
We already ignore the immediate children of script, form,
etc. elements, as well as spans that we've inserted ourselves.  This
change makes us skip the entire subtree of such an element.

One important effect is that if another extension changes one of our
spans using a similar algorithm to ours (inserting a new subtree) we
previously could end up reprocessing that node in a future
document_end event.  Now, we prevent that.
This also changes the disabled icon, since it has a drawn-in badge.
If it makes substitutions but then disables the extension, then the
substitution count is still shown until the page is reloaded (because
there are still substitutions on the page).  The two badges conflict
visually.
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant