Mholloway has uploaded a new change for review. ( https://gerrit.wikimedia.org/r/395653 )
Change subject: Media: Exclude .noviewer and .metadata items ...................................................................... Media: Exclude .noviewer and .metadata items Looks like this mostly overlaps with our size- and mime-based filtering. Bug: T177430 Change-Id: Idfe8664cf187e0811a27dbce94a1f361e42cb910 --- M lib/selectors.js M test/lib/media/media-test.js 2 files changed, 13 insertions(+), 10 deletions(-) git pull ssh://gerrit.wikimedia.org:29418/mediawiki/services/mobileapps refs/changes/53/395653/1 diff --git a/lib/selectors.js b/lib/selectors.js index 835aac7..213ebed 100644 --- a/lib/selectors.js +++ b/lib/selectors.js @@ -1,15 +1,15 @@ 'use strict'; const MediaSelectors = [ - 'figure[typeof^=mw:Image]', - 'figure[typeof^=mw:Video]', - 'figure[typeof^=mw:Audio]', - 'span[typeof^=mw:Image]', - 'span[typeof^=mw:Video]', - 'span[typeof^=mw:Audio]', - 'figure-inline[typeof^=mw:Image]', - 'figure-inline[typeof^=mw:Video]', - 'figure-inline[typeof^=mw:Audio]', + 'figure[typeof^=mw:Image]:not(.noviewer,.metadata)', + 'figure[typeof^=mw:Video]:not(.noviewer,.metadata)', + 'figure[typeof^=mw:Audio]:not(.noviewer,.metadata)', + 'span[typeof^=mw:Image]:not(.noviewer,.metadata)', + 'span[typeof^=mw:Video]:not(.noviewer,.metadata)', + 'span[typeof^=mw:Audio]:not(.noviewer,.metadata)', + 'figure-inline[typeof^=mw:Image]:not(.noviewer,.metadata)', + 'figure-inline[typeof^=mw:Video]:not(.noviewer,.metadata)', + 'figure-inline[typeof^=mw:Audio]:not(.noviewer,.metadata)', 'span.IPA+small a[rel=mw:MediaLink]' ]; diff --git a/test/lib/media/media-test.js b/test/lib/media/media-test.js index 7ab95bd..2fd8020 100644 --- a/test/lib/media/media-test.js +++ b/test/lib/media/media-test.js @@ -29,12 +29,15 @@ const noTypeSpan = '<span><video resource="./File:Foo"/></span>'; const noTypeFigureInline = '<figure-inline><video resource="./File:Foo"/></figure-inline>'; +const imageNoViewer = '<figure typeof="mw:Image" class="noviewer"><img resource="./File:Foo"/></figure>'; +const imageMetadata = '<figure typeof="mw:Image" class="metadata"><img resource="./File:Foo"/></figure>'; + const images = [imageFigure, imageSpan, imageFigureInline, imageThumbFigure, imageThumbSpan, imageThumbFigureInline]; const videos = [videoFigure, videoSpan, videoFigureInline, videoThumbFigure, videoThumbSpan, videoThumbFigureInline]; const audio = [audioFigure, audioSpan, audioFigureInline]; const validItems = images.concat(videos).concat(audio); -const invalidItems = [noTypeFigure, noTypeSpan, noTypeFigureInline]; +const invalidItems = [noTypeFigure, noTypeSpan, noTypeFigureInline, imageNoViewer, imageMetadata]; const imageWithCaption = '<figure typeof="mw:Image">' + -- To view, visit https://gerrit.wikimedia.org/r/395653 To unsubscribe, visit https://gerrit.wikimedia.org/r/settings Gerrit-MessageType: newchange Gerrit-Change-Id: Idfe8664cf187e0811a27dbce94a1f361e42cb910 Gerrit-PatchSet: 1 Gerrit-Project: mediawiki/services/mobileapps Gerrit-Branch: master Gerrit-Owner: Mholloway <mhollo...@wikimedia.org> _______________________________________________ MediaWiki-commits mailing list MediaWiki-commits@lists.wikimedia.org https://lists.wikimedia.org/mailman/listinfo/mediawiki-commits