readium-shared-js icon indicating copy to clipboard operation
readium-shared-js copied to clipboard

'DRY' up the CFI blacklist

Open jccr opened this issue 8 years ago • 3 comments

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.

jccr avatar Mar 02 '17 13:03 jccr

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"]
        });

danielweck avatar Apr 20 '17 16:04 danielweck

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"];

danielweck avatar Apr 20 '17 16:04 danielweck

Related issue (Feb. 2015): https://github.com/readium/readium-cfi-js/issues/30

danielweck avatar Apr 20 '17 16:04 danielweck