readium-shared-js
readium-shared-js copied to clipboard
'DRY' up the CFI blacklist
This issue is a Code Cleaning Task
Related issue(s) and/or pull request(s)
#380, #375
Expected
The CFI blacklist to have one single source of truth
Observed
The CFI blacklist is duplicated in the ReflowableView and OnePageView
- readium-js/readium-shared-js/js/views/one_page_view.js:935
- readium-js/readium-shared-js/js/views/reflowable_view.js:63
Additional Information
The issues referenced here were caused because one of the cfi blacklist set went out of sync from the other.
https://github.com/readium/readium-shared-js/blob/develop/js/views/one_page_view.js#L983
return new CfiNavigationLogic({
$iframe: _$iframe,
frameDimensions: getFrameDimensions,
visibleContentOffsets: getVisibleContentOffsets,
classBlacklist: ["cfi-marker", "mo-cfi-highlight", "resize-sensor", "resize-sensor-expand", "resize-sensor-shrink", "resize-sensor-inner"],
elementBlacklist: [],
idBlacklist: ["MathJax_Message", "MathJax_SVG_Hidden"]
});
https://github.com/readium/readium-shared-js/blob/develop/js/views/reflowable_view.js#L63
var _cfiClassBlacklist = ["cfi-marker", "mo-cfi-highlight", "resize-sensor", "resize-sensor-expand", "resize-sensor-shrink", "resize-sensor-inner"];
var _cfiElementBlacklist = [];
var _cfiIdBlacklist = ["MathJax_Message", "MathJax_SVG_Hidden"];
Related issue (Feb. 2015): https://github.com/readium/readium-cfi-js/issues/30