Commit graph

978 commits

Author SHA1 Message Date
Arlo Breault b0f83b39fb Use Parsoid's regularity to find caption
Follow up to Ic652576f84e07c9fc8ef8be216a6fc94466198a6 where this was
hinted at.

The comment about active formatting elements is removed due to
I7b4e9df8490357f44d31d6a869fa9b7a15f029ea.

Bug: T321440
Change-Id: Ifb12dac64bd7a7fb8444ac2ada557868502cf213
2022-10-27 20:17:05 +00:00
jenkins-bot 3519a635a8 Merge "Fix credit fallback not updating when switching image" 2022-07-11 23:34:35 +00:00
Ed Sanders bf04f98306 MMV lightbox: Allow notifications to appear on top of the lightbox
Bug: T312778
Change-Id: I1e4a32325b36721b51ffb199df3471fc75e9498e
2022-07-11 16:01:14 +01:00
Ed Sanders f08e51741c Remove monobook selectors that assumed the '*' selector might not be available
None of the browsers we send JS to don't support the '*'
selector, so we can remove the fallback for monobook.

Change-Id: I691a71fc8bf4cfa62e8056fdf1021f6513517f75
2022-07-11 16:00:24 +01:00
Sam Smith 34e4968b2c Remove instrumentation
The MediaViewer and MultimediaViewer* instruments were disabled circa
October 2021 in Ie7dd8739efc.

This patch removes those instruments and any supporting code and data.
Notably, this patch does not remove the mw.mmv.logging.ViewLogger
instrument, which is responsible for logging image views.

Bug: T310890
Change-Id: I97d41be93849b2ae9d1adba6660546ea716657fd
2022-07-05 17:41:24 +00:00
dylsss 9d265ee1d0 Fix credit fallback not updating when switching image
jQuery object gets converted to "[object Object]" which results in an ununique array key in HUP.htmlToTextWithTags cache.textWithTags, instead pass HTML string.

Bug: T308958
Change-Id: If6fc934d263107a0d3346ccea8e91cade72db666
2022-06-07 23:29:49 +01:00
jenkins-bot 67035ba546 Merge "Support mw:File as well as mw:Image" 2022-05-26 20:40:21 +00:00
Ed Sanders e131da48f9 build: Update eslint-config-wikimedia to 0.22.1
Change-Id: I275ecfa03b3df8554b30f2a0f6d94d4b66da8088
2022-05-20 00:05:49 +01:00
Ed Sanders 3a61a45a53 build: Update stylelint-config-wikimedia to 0.13.0
Change-Id: I1b6de87b8a1b48220104af42a4e43d81a289438c
2022-05-19 23:58:01 +01:00
Ed Sanders 73e59d396d style: Remove vendor-prefixes no longer required
Change-Id: Ide19cd0decb8a6ef26ccb94bfc89376b3a886748
2022-05-19 23:48:51 +01:00
Arlo Breault 65cba344ad Support mw:File as well as mw:Image
Bug: T273505
Change-Id: I5734593936e620b4c74789080263ef1ea3b99c9d
2022-05-19 17:46:46 -04:00
Timo Tijhof 0f092b6cb3 tests: Minor clean up of mmv.ui.metadataPanel.js and other tests
* Declare variables inline, as per the current code conventions.

* Use `assert.true()` or `assert.false()` in a few places.

* Clarify some test names and simplify some surrounding code.

Change-Id: Id0bca942e34564b9c011e89c0b2298cbb4f8a582
2022-05-13 22:13:01 +01:00
Timo Tijhof 5e1dece304 tests: Make mmv.ui.metadataPanel.js pass with non-English locale
My browser is configured with en-GB as its locale. This meant that
when qqx was passed down, it fell back to my browser's default locale
and thus made the tests fail, as the expected data was set against
lang=en.

Ironically, MMV actually prefers the en-GB date format, and outside
tests even replaces 'en' with 'en-GB' when formatting dates in the
user interface. It was only in the tests that it asserted the 'en'
format that would otherwise never be used by MMV.

Ironically, the reason my locale is affecting the test is because
we switched from hardcoded lang=en to hardcoded lang=qqx which is
meant to disable any influence from localisation. However, when
passed to browser-native Intl API, qqx is not valid and thus
caused us to not have a hardcoded 'en' but a completely variable
UI language based on the developer's browser settings.

Bug: T250045
Change-Id: I94ad25cc7060ac5e9db41c6b6767aa9fd687a0db
2022-05-13 21:49:51 +01:00
stang 52f2d40c8e Add word-break rule for mw-mmv-image-links to prevent overflow
image-links section may overflow if file has a long filename,
and a horizontal scroll bar may appear. Add a
"word-break: break-word" rule to prevent it from happening.

Bug: T305328
Change-Id: Ief395b66525b686fdcd7dec0909775065240a724
2022-04-03 15:55:52 +00:00
Arlo Breault ae5a7aeac1 Separate processing for Parsoid thumbs
Take advantage of the regularity of the structure.

Limit selection to .mw-description links, which serves an equivalent
purpose to .image in the legacy output.

Bug: T292657
Change-Id: Ic652576f84e07c9fc8ef8be216a6fc94466198a6
2022-03-04 18:36:26 -05:00
Arlo Breault 681e1afe36 s/thumbContain/thumbContainer/
Change-Id: I57738c705b3be7aade3e5ba64c879eecc1727383
2022-03-04 18:34:06 -05:00
Sébastien Beyou a10359e6e6 Replace deprecated jQuery.throttle/debounce
This requires MediaWiki 1.38 for mw.util.throttle.

Bug: T213426
Change-Id: I3f689eea837ef72de9ab7afb68578093eab8db20
2022-02-10 13:22:52 +01:00
Ed Sanders b03af20581 eslint: Lint Gruntile.js using server rules
Change-Id: I6f6f7391668412b2bb572a8d77da8e137fa169bb
2022-02-07 16:38:38 +00:00
Iniquity 5803ea79eb Remove discussion and help links from footer
Bug: T133899
Change-Id: Ide631cd8bd98ff5084a8c406515c53b8a0cb033a
2022-02-06 01:15:02 +00:00
James D. Forrester 7dbee90cce Avoid ableist language in comments and test names
Change-Id: I55047f95da7c05f631f4009cbe25d8515dd937f1
2021-12-09 19:48:17 -05:00
Volker E f074ab467b Replace obsolete LESS box-shadow() mixin
With unprefixed property.

Change-Id: I2b4117e6dd7082d544e09969441e5a5f912f7d1d
2021-09-11 02:31:19 -07:00
seddon b007aaa741 Err: param required cant be empty/0 ThumbnailWidth
Bug: T277893
Change-Id: I5b440be10aa30527270515f6921596b8000a9f83
2021-08-25 20:34:32 +00:00
seddon a397ce8f88 Lightweight fix to FF Nightly/Fission scroll issue
Bug: T229484
Change-Id: Id1624e8822b81deedf8c58a3df83bd992946869b
2021-08-04 09:49:30 +00:00
jdlrobson 933d370ecf Prepare for MediaWiki UI version 2
In the next iteration of the MediaWiki UI icon styles, it will
not be possible to mix button classes with icons.

The change will result in a slight increase in height for
the settings cog which will be fixed as soon
as Ibc136a17662ae839f90babb21e0f7e8f27b7a7d5 is applied.

Bug: T191021
Change-Id: Ic976ba8cddde1515db260973b00d501f8fc7b901
2021-07-19 15:42:21 -07:00
DannyS712 5c0ef64a73 Typo fix: "the the" -> "the"
Bug: T201491
Change-Id: Ie0139401ea5826546219fc86f5efefbb76159027
2021-07-17 02:58:49 +00:00
Ostrzyciel c38a65410a Link to local description page if present
Currently for files from foreign repositories, the "More details"
button always points to the foreign description page, regardless of
whether a local description page exists. That is a bit unintuitive,
as the local description page often contains additional info (like
categories) that may be useful for the user.

This patch changes the behavior of the button to link to a local
description page if available.

Change-Id: I7db609a4dda42f28ef913ad6d4256fb5adabeb89
2021-06-20 07:24:00 +00:00
Vedmaka ca57e8eda0 Adds viewer state invalidation into wikipage.content hook callback
When new content is added to a page ( like images LazyLoading ) the
MultimediaViewer reacts mostly correctly, except that is does not
rebuild images indexes for a viewer hence breaking next/prev order.
The patch solves this by resetting the viewer state at MMVB.processThumbs()
letting the viewer to be correctly re-initialized at later stages.

Change-Id: Ib1e3ba05f5bc84d477302e365ad7984de1a84272
2021-06-02 11:14:45 +00:00
Volker E 3205e72ad8 build: Replace 'grunt-svgmin' with npm based 'svgo' & re-crush SVGs
Replacing 'grunt-svgmin' with 'svgo' v2.3.0.
Also
- replacing all Grunt based tasks with npm equivalents. 'build' has
before just been for SVG minification and that's the same now in npm.
- changing to JS based '.svgo.config.js'
- re-crushing all SVGs. Note that 'link-hover.svg' and 'link.svg' have
been optimized with reduced precision. All other changes are resulting
from updated SVGO.

Bug: T278656
Change-Id: Ie895edb4e88336ffc56f570b8f80bf7d1e331894
2021-04-12 13:01:59 -07:00
Volker E 1a5aa67c08 styles: Remove obsolete vendor prefixed properties
Bug: T278670
Change-Id: I5640e4539598de8e9ae2d4e5172a5ae41b570ce3
2021-03-29 02:19:27 -07:00
jdlrobson d9925de6d5 Catch malformed URIs
Malformed URIs are difficult to filter due a lack of normalization
across browsers. This is our top error message with over 300 instances.

Catching this would reduce logspam and make our client error logging
much more usable.

Bug: T268060
Change-Id: If1c345af704df82f16c7ef1ecbf63862c1fbee77
2021-03-04 09:12:47 -08:00
Cormac Parle ecbb6856cf url-encode page uri before starting the view duration timer
Bug: T268060
Change-Id: I956f745786fe41b2c62c8ee6d13d91d9dc89bda5
2020-12-10 12:22:15 +00:00
AronDemian 72636057d8 [cleanup] Fix eslint (new version) warnings
Bug: T245930
Change-Id: I7a62e5a0a90ce0f4e4385afdae1e57722bc9ac82
2020-11-02 02:58:31 +01:00
diwanshu885 5271e7a08d Wrap the mw.Uri creation in a try-catch block
Bug: T261799
Change-Id: Ibaf027917f34d0591b7ebc669d9fbaff2f0bb442
2020-10-20 00:21:07 +05:30
Ed Sanders bfdcd8dbf1 eslint: Update eslint-config-wikimedia to 0.16.2
Change-Id: I0c35ed9b5ab00952124cb0e5c6c48fbc0d734f60
2020-06-26 12:14:27 +01:00
Ed Sanders d554d7f426 Docs: Fix whitespace
Change-Id: I98dc12787f68bd8db60e5a5bcb9366daf9f2f6b8
2020-06-26 11:21:04 +01:00
Timo Tijhof caa11531b1 mmv.bootstrap: Remove direct static call to OO.Router.prototype
Follows-up Id4df92b0ebed3 where a direct call was added into
the OO.Router.prototype which is invalid.

It also didn't add much value as it literally contains just
one line of trivial code that was already used without any
shared state with the actual instance of OO.Router used.

Use location.href directly.

Bug: T77258
Change-Id: I00c018f97d6569a532e51f817a1faa2df4f2fb1a
2020-06-12 10:07:40 +00:00
Volker E 9d2f7de650 Amend Base10 color from #222 to #202122
Amending Base10 to slightly darker `#202122` to fulfill WCAG
requirements in connection to Accent50.
Also adding it as WikimediaUI Base equivalent variable for
future replacement.
Also removing variables not in use any more.

Bug: T248393
Change-Id: I6fb5c288cfeb2bd3c786c2f5ab771074203b8fc0
2020-04-20 13:50:10 -07:00
Volker E d5aad3a260 Add file extension to LESS imports
Similar to how other extensions have been amended.

Change-Id: Ic9905fe166507739cd687f5aa2f44a0625b9746b
2020-04-17 21:13:01 -07:00
Volker E 02c0fd738f Rename 'mmv.globals.less' to 'mmv.variables.less' following naming pattern
Renaming 'mmv.globals.less' to 'mmv.variables.less' following naming
pattern of other extensions like MobileFrontend, Echo or Flow.

Change-Id: I376c3fd1463ed225e214f165943576f3e3c7df39
2020-04-17 21:05:58 -07:00
jenkins-bot 7b3e5b5093 Merge "Maintenance: npm -s run lint:fix caught some missed empty lines and spaces." 2020-02-27 18:48:55 +00:00
AronDemian c73a73a203 Maintenance: npm -s run lint:fix caught some missed empty lines and spaces.
Bug: T245930
Change-Id: I338069768111963a25531fc3996f6031b76dc4ee
2020-02-27 06:50:49 +01:00
James D. Forrester cf26ef2e1a metadataPanel.formatDate: Account for timezoneness
As MDN says, new Date( dateString ) is strongly discouraged, for
exactly this reason. Oy.

Bug: T243160
Change-Id: Ib71b16185f5bd1cd522535716b6e36d2699678cd
2020-02-24 15:16:00 -08:00
Matthias Mullie ca1364928c Move mmv-close event trigger higher up in lightboxinterface/unattach
This avoids a bug with Firefox's automatic scroll restoration logic,
which seems to always jump to the top of the page upon closing MMV.

Bug: T229484
Change-Id: Ia4261ce268df4d8fb07b4813a6ae72ad88728e91
2020-01-15 00:50:13 +00:00
Umherirrender 6a6d17b999 build: Remove unneeded exclude from .eslintrc.json
This reverts parts of commit bb26bc47b4.

Change-Id: I108e2f39713fb95f4b00dabd495e27f4bd5af90a
2020-01-08 19:51:42 +00:00
jenkins-bot 5c931b5d2e Merge "Increase timout for browser cache hits from 10ms to 100ms" 2019-11-28 18:13:34 +00:00
Thiemo Kreuz 550d01d231 Increase timout for browser cache hits from 10ms to 100ms
At the moment, the blur effect is shown all the time when flipping back
and forth between images that have already been loaded. I believe the
code just does not have enough time to get it's job done. Even if it was
a cache hit, the very low limit of only 10ms results in all actions being
considered "long running", and the blur effect been shown.

Given the animation takes 300ms, using a very low threshold like 10ms
seems unfair. Something like 1/2 of the animation time seems more
appropriate.

Change-Id: I8d655be3830fef3f363a0942ac64c932c1e8f7f7
2019-11-28 03:44:31 +00:00
Volker E 44d39ad807 Remove obsolete color
Removing obsolete color, the list items needs to inherit WikimediaUI
palette color `#222` from `.mw-mmv-post-image` instead.

Change-Id: I70354470e0571b6eb8276a3e47167c507b4d717c
2019-10-13 09:40:55 -07:00
jenkins-bot 7178e76d37 Merge "eslint: Enable no-proxy rule" 2019-09-28 21:37:15 +00:00
Krinkle bfc93418c8 Merge "Remove @embed where it needlessly delays loading of the UI" 2019-09-27 16:19:42 +00:00
jenkins-bot dd4f996ae4 Merge "Revert "Clicking on the black wrapper should close MVV"" 2019-09-23 19:16:59 +00:00