Commit graph

953 commits

Author SHA1 Message Date
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
Esanders 24fcde2546 Revert "Clicking on the black wrapper should close MVV"
This reverts commit c7c8059a0a.

Bug: T133900
Bug: T231895
Change-Id: I0583487249ca4bb29bf68fb218a3ddf2251893e7
2019-09-23 18:51:33 +00:00
Ed Sanders 5da05073f1 eslint: Enable no-proxy rule
Change-Id: I54e0073c0f35db110add7518e888081af19cd069
2019-09-20 13:25:10 +01:00
James D. Forrester e75c8f3fb4 mmv: Don't try to use internal (now removed) ext property of mw.Title
Bug: T232521
Change-Id: I8af85efc2b7ff84f81a72b39986ce3eb356eac69
2019-09-10 12:57:33 -07:00
Timo Tijhof 70b0cbb727 Remove @embed where it needlessly delays loading of the UI
* mmv.ui.canvas / error-media-icon.svg:
  Used when the media file fails to load (e.g. due to an intermittent
  issue with the user's network connection). Rarely displayed,
  and the space is reserved (no FOUC). Seems fine to display
  slightly later within that use case (or not at all, if offline)
  to make the MMV interface itself load faster overall.

Bug: T121730
Change-Id: I760f46c920c3d1f3da2cb385d8cfd81951b628e5
2019-09-02 01:24:56 +00:00
libraryupgrader 5410aa9150 build: Updating eslint-utils to 1.4.2
* https://npmjs.com/advisories/1118

Additional changes:
* Added .eslintcache to .gitignore.

Change-Id: I9b6420e70ec7f4568b707371c731a8db56f6e34a
2019-08-24 12:16:21 +00:00
jenkins-bot b351d1b5fc Merge "build: Update devDependencies" 2019-08-01 02:15:32 +00:00
Ed Sanders 18a154b989 build: Update devDependencies
Change-Id: I46f5317976ef9f818e30b0c81018e83800535389
2019-07-31 22:59:13 +01:00
Ed Sanders f4d6c9f37e Remove useless .opacity mixin
Change-Id: Icff7c01aba4a647d23bae1925b725bddc555c762
2019-07-29 17:56:43 +01:00
Ed Sanders 0cda0f8706 Drop CSS hacks for unsupported browsers (IE<11, ancient Firefox)
Bug: T184543
Change-Id: Ibd07ecd545f9b69f4dd3adb2b371b4d87ca4098b
2019-07-29 15:33:58 +01:00
jenkins-bot ec72d6284d Merge "Chrome does not revert title to article title" 2019-07-29 14:20:14 +00:00
Simon Legner c7c8059a0a Clicking on the black wrapper should close MVV
Bug: T133900
Change-Id: I0f05a3b16cdbef9a64a3d5cb4982525460e3b002
2019-07-09 17:21:10 +00:00
jenkins-bot 989af50dcf Merge "Make the download/share buttons actual links for right/middle click" 2019-06-15 22:09:38 +00:00
jenkins-bot e19944e67d Merge "Use Object.create( null )" 2019-06-14 18:31:26 +00:00
Simon Legner a663d2884c Chrome does not revert title to article title
The issue seems to be related with the chronology of the document.title
update and the history.pushState/replaceState call.

Bug: T225387
Change-Id: Ifcd11d5efb3ba64d88b137eccb4b9c763d043004
2019-06-11 11:50:44 +02:00
Fomafix 08d5eaeb20 Use Object.create( null )
Object.create( null ) creates an Object without predefined methods like
hasOwnProperty or constructor. This allow to use
	key in object
instead of
	Object.prototype.hasOwnProperty.call( object, key )
although key is 'constructor'.

Change-Id: I07ef3b97a6b2d1b2fa9f3fb746ffe93a7f325cdf
2019-06-10 15:03:00 +02:00
Fomafix f89d7dc878 Remove "window." for location and setTimeout
The JavaScript in core also don't use "window." for these browser
properties and methods.

Change-Id: I344573fd7ef0e73c252779b4e59a53168d16574f
2019-06-10 12:46:58 +02:00
Fomafix 7e03aa58a5 Use mw.log.error instead of window.console.error
mw.log.error is always present and calls console.error if available.

Change-Id: I6337ce7f0b6fef2933b067cda7097037cf757d7b
2019-06-10 12:22:19 +02:00
jenkins-bot 0d4d5096b1 Merge "Replace moment.js with Date.toLocaleString" 2019-05-31 21:14:00 +00:00
Simon Legner 682873dd2d Replace moment.js with Date.toLocaleString
Bug: T224626
Change-Id: Ib312821d2c72c2570cec29153557fd44e4db2bf7
2019-05-31 21:56:45 +02:00
jenkins-bot c7e33d0f5e Merge "Download sizes: 480p, 720p, 1080p, 2160p" 2019-05-31 16:54:00 +00:00
jenkins-bot 1e704eec51 Merge "Fix unresponsive download button" 2019-05-31 16:52:51 +00:00
Simon Legner 1a00347c49 Fix unresponsive download button
Some handlers were not correctly unregistered when performing
`unattach`. Thus, `Dialog.handleOpenCloseClick` could be fired more than
once resulting in the dialog been opened and closed immediately
afterwards.

Bug: T186461
Change-Id: I0c3c79644a10d7201ef198f4a4d381c10db4c3af
2019-05-28 23:11:18 +02:00
Simon Legner e77393744d Fix routing after repeatedly opening/closing
Steps to reproduce:
1. click on image, 2. press Esc, 3. click on image, 4. press Esc

Expected results: page is visible again
Actual results: navigation to previous page happens

Change-Id: Idd1b6612971b8ea258bb55982e3241986ad1a54d
2019-05-28 22:37:00 +02:00
jenkins-bot a4e63f623c Merge "Adopt mediawiki.router" 2019-05-28 15:14:50 +00:00
Simon Legner b1ade19388 Adopt mediawiki.router
Bug: T77258
Change-Id: Id4df92b0ebed3fb4f4b9269862c952f3968bf957
2019-05-26 19:46:38 +02:00