mirror of
https://github.com/koreader/koreader.git
synced 2025-08-10 00:52:38 +00:00
View HTML: add CSS helpers with long-press
Move View html code from ReaderHighlight to a new dedicated module. Long-press on an element or its text in the HTML will show a popup with a list of selectors related to this element that can be copied to clipboard (to be pasted in Find or in a Book style tweak). 2 addtional buttons in this popup allow seeing all the CSS rulesets in all stylesheets that would be matched by this element, which should make it easier understanding the publisher stylesheets and using or creating style tweaks.
This commit is contained in:
@@ -937,6 +937,10 @@ function CreDocument:getHTMLFromXPointers(xp0, xp1, flags, from_root_node)
|
||||
end
|
||||
end
|
||||
|
||||
function CreDocument:getStylesheetsMatchingRulesets(node_dataindex)
|
||||
return self._document:getStylesheetsMatchingRulesets(node_dataindex)
|
||||
end
|
||||
|
||||
function CreDocument:getNormalizedXPointer(xp)
|
||||
-- Returns false when xpointer is not found in the DOM.
|
||||
-- When requested DOM version >= getDomVersionWithNormalizedXPointers,
|
||||
|
||||
Reference in New Issue
Block a user