Cleanup/Rewrite - #24
Open
splitbrain wants to merge 6 commits into
Open
Conversation
The button was appended to the toolbar DOM by hand, behind a check for the spell checker element DokuWiki dropped years ago, so it never appeared at all. It is now added to the toolbar array with an addBtnActionCellbg() handler creating the picker, leaving placement, ARIA state and toggling to the core toolbar code. The swatches reset background-image because templates tend to style buttons with a gradient that hides the color. Colors from a user defined user_cellbg_colors are no longer merged into the picker. That extension point was unusable for as long as the button was missing. Fixes dr4Ke#6
The special pattern anchored the color with '^' and relied on the lexer matching from the parse cursor. Matching happens against the full document now, so the anchor never held inside a table row and no cell was colored at all. A fixed-length lookbehind for the cell delimiter takes its place. It has to stay fixed length, as all patterns of a mode compile into a single regex and one that needs a newer PCRE than the server provides takes the whole table mode down with it. The pattern is registered with the table modes only. Elsewhere the syntax used to be recognized as well, producing instructions that every renderer other than XHTML dropped along with the text they covered. Validating the color in the pattern itself leaves an unusable color as literal text and makes the separate validation obsolete. It also makes rgb() triplets work, which were documented but unreachable. Cells carry a style attribute instead of the non-conforming bgcolor, header cells are colored as well, and the first color of a cell is the one that counts; a second color used to add another attribute to the same cell. Fixes dr4Ke#7 Replaces dr4Ke#8 Replaces dr4Ke#23
Beside the standard plugin info check, the syntax tests cover the accepted color notations, syntax that only looks like a color, and where in a table a color is recognized at all. Whether a color reaches the renderer is asserted on the instruction stream, because the rendered markup looks the same either way once a cell refuses a second color.
Templates color the cells of the row under the pointer. The background sat on the cell itself, which outranks that highlight, leaving the colored cells of a hovered row as the only ones not reacting to the pointer. Cells carry their color as a custom property now and a stylesheet turns it into the background, mixing the text color in for the hovered row so the highlight shows on light as well as on dark templates. The color of a cell depends on that stylesheet from now on. As the seed of the stylesheet URL does not cover the files a plugin contributes, a cached stylesheet leaves cells uncolored until the seed changes for another reason. Fixes dr4Ke#4
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
This is a major cleanup of the plugin, fixing a whole bunch of issues and catching up with the pending pull requests.
substitiontype (previous code was basically this, ignoring all other match types anyway)Judging from the lack of responses to previous issues and PRs and #4 (comment) I assume this plugin is abandoned. I will update the documentation and point the download to our fork. However CosmoCode will not maintain the plugin going forward.
fixes #4 #7 #8 #23 #6 #12 #13 #20 #22
replaces #9 #10 #11 #21