Commit graph

1043 commits

Author SHA1 Message Date
Simon Legner ea78739fd0 Use Codex styles for mmv.ui.download.pane
Bug: T340258
Change-Id: I3dc1b5ffdf8c6a810e9e16a2b7f293757cce5306
2024-05-04 20:53:09 +03:00
Simon Legner 8419e548a4 Use Codex colors to fix dark mode
Bug: T363776
Change-Id: Iab9a7ffc7dd707c453522fab25c4bb6061645616
2024-05-04 12:04:25 +03:00
Jon Robson 40b705600c Use hardcoded color for LESS mixin function
Bug: T359944
Bug: T357740
Change-Id: I4847fe4013760a6159d9c51241acf8eca1cda95e
2024-03-15 04:41:02 +00:00
jenkins-bot 612ebb5c80 Merge "Public API to Check Wikimedia Media Viewer Extension Status" 2024-02-15 19:21:24 +00:00
Simon Legner c25d52ef9f Metadata: show created as well as uploaded date
Bug: T296330
Change-Id: I3ffad8c6049e839386a6c279b9b33d3841ab5d89
2024-02-14 02:27:52 +00:00
libraryupgrader 147b576b57 build: Updating dependencies
composer:
* mediawiki/mediawiki-phan-config: 0.12.1 → 0.14.0

npm:
* eslint-config-wikimedia: 0.25.1 → 0.26.0
  The following rules are failing and were disabled:
  * resources:
    * es-x/no-resizable-and-growable-arraybuffers
  * tests/qunit:
    * es-x/no-resizable-and-growable-arraybuffers

* grunt-banana-checker: 0.11.0 → 0.11.1

Change-Id: Ief610bdadaccd2325cd1b8a2cae70b7e465d8b76
2024-02-13 02:13:29 +00:00
Simon Legner 07ba0e43a9 Don't use mw.Map(), use a native Map() instead
Bug: T353076
Change-Id: I91a556becc1093e0db4c4b13e4685f2c0e084031
2024-02-08 20:21:20 +00:00
Simon Legner 1ab8d0d899 Public API to Check Wikimedia Media Viewer Extension Status
mw.mmv.isMediaViewerEnabledOnClick()

Bug: T348026
Change-Id: Ibc34e370e6bf631d9f861b9f6baa75d3f227123e
2024-02-07 20:38:01 +01:00
Simon Legner ef53ab0834 File with percentage sign in file name does not open
Invoking encodeURI on the imageFileTitle makes sure that a "%" character is properly URL-escaped.

Bug: T337540
Change-Id: I538b7f813b546134848e93cea4744de8f4da9e90
2024-02-07 20:13:35 +01:00
Simon Legner 254ec713cc formatDate: handle year, handle <div>
Bug: T58794
Change-Id: Ie05241c8db18773d0eb84421813db69b425e0784
2024-02-05 22:25:39 +01:00
Volker E cfcb8d4755 build: Update 'svgo' to latest v3.2.0 and re-crush SVGs
The latest update of 'svgo' dependency includes three optimizations on
converting path commands, which
- improves closing paths and how we determine if to use absolute or
  relative commands.
- round arc or convert to lines based on the geometric sagitta
- convert cubic Bézier curves to quadratic Bézier curves where possible
Also
- removing obsolete 'grayscale.svg' which was introduced in
  I0f2c2b24aece3b but seems to have not been in use. It itself is not
  reasonable, as an SVG filter needs an element to be applied to, which
  this SVG didn't feature.
- unifying npm command to qua standard notation `minify:svg` and add
  “parent” command `minify` as well.

Bug: T354875
Change-Id: Ie4d8ef85b9b9d28943a7216f0b5ed6392592a43e
2024-01-18 12:04:02 +01:00
Jon Robson f3f86d6081 Fixes button sizes on file page and overlay
* The file page has a button that does not match the font size of
the page. This is also the case for the overlay.
* The icons are too big on the file page. This reduces their size.

Bug: T345749
Change-Id: I4f4edc0aa7adc0c72773a939c43108019bc4295b
2023-12-13 18:34:16 +00:00
Timo Tijhof b619d47f79 mmv.bootstrap: Avoid code duplication
Follows-up a0ce33226d (ref T348275, T349448).

Change-Id: I18bebf524686cac9e00e5d250eddd0c73c950893
2023-11-30 15:51:05 -06:00
jenkins-bot e0c48c1331 Merge "Skip thumbs from a.mw-file-description with typeof attribute" 2023-11-13 16:39:38 +00:00
Fomafix 3481080251 Improve variable declarations in JavaScript
Use the eslint rule
	"no-var": "error"
in resources/.eslintrc.json and in .eslintrc.json
to require the use of `const` and `let` instead of `var`.

Bug: T337102
Change-Id: I3b3d6d426966a97c13f62494443f62bd5b790920
2023-11-06 23:11:23 +00:00
Umherirrender a0ce33226d Skip thumbs from a.mw-file-description with typeof attribute
Skip thumbs found by the newly added selector (from 4d4e86ec) to skip
when also matched for the parsoid part of the multimedia viewer.

Bug: T348275
Bug: T349448
Follow-Up: I5ec67accab4e1cbfa90544087750016e1baab85d
Change-Id: I0c45b877565fd54b3e1cc766e4ee745a48cdea27
2023-11-03 20:53:05 +01:00
Fomafix c37c64875b Improve variable declarations in JavaScript
Change-Id: Ibb3f99a98e019204b4def19af957511ef32e9dd4
2023-10-23 19:52:02 +00:00
jenkins-bot 8161b14ea0 Merge "Use a.mw-file-description to find thumbs" 2023-10-12 02:04:49 +00:00
Timo Tijhof 1a25711033 mmv.lightboxinterface: remove 'isFullscreened' data
This was used internally by `jquery.fullscreen` but now that we
have all the logic inside this file, we don't need to store this
information two places with a copy in `this.$main.data()`. We can
use this.isFullscreen directly as they are always the same.

Change-Id: Ie15729a038bc9c1f6278c0b068c0706620d95e93
2023-10-06 03:03:00 +00:00
jenkins-bot 01652054b3 Merge "Remove unused core JavaScript modules that ship with MediaWiki core" 2023-10-05 23:58:00 +00:00
Hannah Okwelum c9eed0a3b5 Remove unused core JavaScript modules that ship with MediaWiki core
Bug: T335723
Change-Id: I89e389b532cd80af488255ebe88e403a10ae3a38
2023-10-05 16:53:45 -07:00
Umherirrender 4d4e86ecb2 Use a.mw-file-description to find thumbs
a.thumb is no longer outputted when $wgParserEnableLegacyMediaDOM is
false (fdd8f864 ), use the new class from 350721cc

Bug: T348275
Change-Id: I5ec67accab4e1cbfa90544087750016e1baab85d
2023-10-05 21:16:50 +02:00
jenkins-bot e804f87b89 Merge "Add mw-no-invert class to MMV overlay" 2023-10-05 14:38:49 +00:00
Simon Legner 6ee3f05104 Use Codex styles for buttons in mmv.ui.download.pane
Bug: T340258
Change-Id: I30a7ab4a6732fd87a68c67593d322be2347b2ff8
2023-09-28 10:02:57 -07:00
Ed Sanders 2212255fe2 Add mw-no-invert class to MMV overlay
Bug: T345281
Change-Id: I2f2659809ef8e4fc2e1c752d8fd0eb3533c3cb78
2023-09-12 14:02:36 +01:00
Umherirrender b4e7477150 Escape use of commons.wikimedia.org in regular expression
Dots needs escaping

resources\mmv\model\mmv.model.Repo.js
  129:11  warning  Unsafe Regular Expression
security/detect-unsafe-regex
  169:11  warning  Unsafe Regular Expression
security/detect-unsafe-regex

The plugin does not like the backtracking for "https?", but that does
not looks like a performance problem when given long strings here.

Change-Id: Iac4c88b591c2e8ebb2ce037bbd99b774319a261c
2023-08-10 00:30:27 +02:00
Simon Legner de2349a509 Use Codex styles for buttons in mmv.bootstrap
Bug: T340258
Change-Id: I11fdbabae0ed996ed2e830259ccd3e02c3f035fc
2023-07-17 20:19:05 +00:00
Cormac Parle 6bb1cbaddb IP masking update
Use localstorage to store MMV preference for anon and temp users,
use regular user preference for non-temp accounts only

For embed default to wikitext for temp and regular users, html
for anon users

Bug: T340534
Change-Id: Ic19e8a6b6fbdeb2c86be14a33a306dd0f3088b1b
2023-07-04 11:52:40 +01:00
Ed Sanders 67188f8c31 eslint: Enforce max-statements-per-line
Change-Id: I416d0c951d18f2fb3b477695ab0913f75fb60a68
2023-06-28 19:12:48 +01:00
Ed Sanders a33f7e5c57 Update linters and fix issues
Change-Id: Ib562131bbb3a9940d56602e0c4dbbe810ce7358c
2023-06-28 19:12:48 +01:00
jenkins-bot b2c7f6747d Merge "Add mw-parser-output to file captions" 2023-06-21 23:33:13 +00:00
Simon Legner 9215d30471 Add shortcuts Home/End to jump to first/last image
Switch keydown handler to use KeyboardEvent.key
Ref: https://caniuse.com/?search=KeyboardEvent.key

Bug: T163976
Change-Id: Ia0d5b2b8d28324c89b0fa11916de9cdd6d16434a
2023-06-21 22:09:24 +00:00
Saint Johann fc42f2c39b Add mw-parser-output to file captions
Bug: T284857
Change-Id: I1c18ece776d615e58f3d694ef475c2a8b586f18f
2023-06-21 22:09:19 +00:00
jenkins-bot a397dc6062 Merge "Add jsdoc to MMV" 2023-06-16 19:24:59 +00:00
Simon Legner 5f781b7a9b Add jsdoc to MMV
This replaces the jsduck implementation that we recently removed.

Changes:
* Document events on Document element.

Bug: T337039
Change-Id: Iaa9f54c7838159a75a38eec0d49f203803aadee7
2023-06-12 22:08:14 +02:00
Simon Legner 48b6c76601 Notify user and close MMV if image from route not present on page
Fixes: only a black screen without any controls or messages is shown

Bug: T77327
Bug: T336619
Change-Id: I53687fce2c767ff6681707da424b974ecf51675a
2023-06-12 19:13:48 +00:00
Simon Legner 30fad6b8b8 Use ES6 features
* classes
* arrow functions
* const/let
* string templates
* Object.assign

Bug: T337102
Change-Id: I757b9993a2feeed707fb4ad213944001498f3f6a
2023-06-12 16:45:08 +00:00
Simon Legner 0683f3ecc8 Remove global mw.mmv
Bug: T337030
Change-Id: I90e8507cb1b7c30f6ba29dbdec8966e84b46aff2
2023-05-21 08:02:54 +00:00
Simon Legner 74a76718d7 Use packageFiles in mmv.test
Bug: T337030
Change-Id: Iaea2deec35003e306a8e1f12f890879c80cd8289
2023-05-21 06:41:31 +00:00
Simon Legner d82910fbb3 Use packageFiles in mmv
Bug: T337030
Change-Id: I833c7e91230272b82a2512fd55f1c7c0f61233b4
2023-05-20 10:04:41 +03:00
Simon Legner 35cd0f18c0 Use packageFiles in mmv
Bug: T337030
Change-Id: I90cdfb626c176b27b59db6b92b9edd6b2fe49b68
2023-05-20 09:34:56 +03:00
jenkins-bot 91bb566fec Merge "Use packageFiles in mmv.ui.ondemandshareddependencies" 2023-05-19 16:45:57 +00:00
Simon Legner 4709abae0a Use packageFiles in mmv.ui.ondemandshareddependencies
Bug: T337030
Change-Id: I09b4d1fecd1940a1a767d2033c4449b5002a88a8
2023-05-19 18:08:39 +03:00
Simon Legner 26f4c60495 Use packageFiles in mmv.ui.reuse.shareembed
Bug: T337030
Change-Id: Ic54d1a1a40ee5318f65ee1245e261db7059583ba
2023-05-19 18:05:56 +03:00
Simon Legner d0066039ac Deep-link to the license section of a file page
The necessary anchor link depends on the language used on Wikimedia Commons:

* https://commons.wikimedia.org/wiki/File:GATEWAY_(Moon_Space_Station).png?uselang=en#Licensing
* https://commons.wikimedia.org/wiki/File:GATEWAY_(Moon_Space_Station).png?uselang=de#Lizenz
* Ref: https://commons.wikimedia.org/wiki/Template:License-header

Remove jsduck due to lacking support for ES6 string templates.

Bug: T336708
Change-Id: Ib71e647682835baa71bd375ae3098966ae01f26c
2023-05-19 13:57:54 +00:00
Volker E b64642a527 styles: Remove obsolete mixin
Duplicated in core mixins with `.user-select()` since v1.38.0.

Change-Id: Ia0d36bbd2fd417a7195c235854ddd81ac76e51c1
2023-05-09 18:56:17 -07:00
Volker E 132763dd70 styles: Remove deprecated .background-image() mixin call
Deprecated since v1.38.0.

Change-Id: I5723bddcf4ffa529a5a89118ec4a7d36b480408d
2023-05-09 18:24:39 -07:00
Jon Robson 00b65d02cd Remove jquery.tipsy and use OO.ui instead
Bug: T77402
Change-Id: I63328cf86872019fc9832162b26ffa8075382acd
2023-05-05 16:32:00 +00:00
Jon Robson d41884b8e5 Fix file page integration
Bug: T335997
Change-Id: I1c7b6a9b8f0903670d1ac40e3d29239674f5365f
2023-05-04 11:39:23 -07:00
jenkins-bot acd340b5de Merge "Remove most uses of jquery.tipsy in MediaViewer" 2023-05-02 19:27:10 +00:00