Commit graph

71 commits

Author SHA1 Message Date
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
Umherirrender fb1de7786c Improve special page handling in onBeforePageDisplay
Avoid creating of Title object to get the "fixed special name" (which is
the localized name) and compare that against the local name of the
current page, just use the SpecialPageFactory to get the canonical name
(which is the english internal name, not the english visible name) and
compare against the list of canonical allowed pages (adjust the existing
list to the canonical names, that are "old" names in different cases)

Change-Id: Ia6f6574bf6e65c75f8977ff016feda6ecdca3776
2023-09-23 00:03:01 +02:00
James D. Forrester 8d95d367a5 build: Update MediaWiki requirement to 1.41
All extensions in the MediaWiki tarball are expected to track MediaWiki's release directly.

Change-Id: I833380e20616462633f2e0b84bfd9a823ad085e4
2023-08-19 13:54:25 +08:00
Umherirrender ad1f6a6ee0 Use HookHandlers for core hooks
The use of "HookHandlers" attribute in extension.json makes it possible
to inject services into hook handler classes in a future patch.

Bug: T271019
Change-Id: I57dac8d590b5afa7524000d93c8477a10148c052
2023-08-14 20:47:02 +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
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 74a76718d7 Use packageFiles in mmv.test
Bug: T337030
Change-Id: Iaea2deec35003e306a8e1f12f890879c80cd8289
2023-05-21 06:41:31 +00: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
Jon Robson 00b65d02cd Remove jquery.tipsy and use OO.ui instead
Bug: T77402
Change-Id: I63328cf86872019fc9832162b26ffa8075382acd
2023-05-05 16:32:00 +00:00
Simon Legner d2ab19fdac Remove most uses of jquery.tipsy in MediaViewer
Tipsy was added in I993bf60909024453a14de85af6239bded02eb8a6 however
has since been deprecated and usage is discourage.

Falling back to standard HTML `title` attribute display seems fine. Some
buttons (such as previous/next arrow) have not had a tipsy tooltip.

To be done separately: TipsyDialog which is used for StatusInfo

Bug: T77402
Change-Id: I2f7ae189734ba6d6e67ca703a42ae899ec56729d
2023-05-02 18:21:57 +00:00
Volker E bee73f7520 styles: Replace old variables calls with skin variables
Replacing 'mediawiki.ui/variables.less' `@import`
with new skin-aware 'mediawiki.skin.variables.less' standard.
Also replacing and removing scattered WikimediaUI Base variables
with new skin variables.

Also
- replacing several static values with new Codex design tokens featuring
  skin variables for following properties:
  - `background-color`
  - `color`
  - `border*`
  - `border-radius`
- replacing local variables with new skin variables where applicable.

Bump required MediaWiki core version to >= v1.41.0.

Bug: T319381
Bug: T332541
Co-Authored-by: Volker E. <volker.e@wikimedia.org>
Depends-On: I04f9e48a1cf9dee915cf51e1e12b17ff0a595a06
Change-Id: Ie834b3f652bd22d9bf96c112166a5b7fcc3ecf2d
2023-04-16 03:32:27 -07:00
Timo Tijhof cd4da296c2 mmv: Use mediawiki.router instead of underlying oojs-router module
This is in preparation for merging the two modules in core and not
exposing oojs-router directly. mediawiki.router is merely 1 line
of code to hold a singleton, and indeed it appears there is no need
for multiple instances to exist given it communicates exclusively to
and from the 'window' object, which is also a global singleton.

Change-Id: Ice09b523dfbefd67493175554eeb525771e8f29d
2023-03-06 02:34:13 +00:00
alistair3149 00ae50ea49
Allow WebP to be previewed in viewer
WebP support was added to core but MMV was not updated to
allow WebP to be previewed. This should enable the functionality.

Bug: T282202
Change-Id: I4fd6a0a2189a58faa6bccfc1282de57b8beb16cc
2023-01-05 09:25:27 -05: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
Sam Smith a286166f88 Remove EventLoggingSchemas entries
The MediaViewer and MultimediaViewer* instruments were disabled circa
October 2021 in Ie7dd8739efc. However, the EventLoggingSchemas entries
are still included in the ext.eventLogging RL module, which is fetched
on the majority of pageviews.

At the time of writing it is not clear whether the instrumentation code
will be archived. If it is not archived, it should be migrated to the
Event Platform, in which case the EventLoggingSchemas entries can be
reinstated.

Bug: T310890
Change-Id: I2e99664f4c00513dc61fdf9f3b53da241902e13d
2022-06-17 14:53:16 +01:00
jenkins-bot 3a97d5dc47 Merge "Namespace extension" 2022-02-23 06:19:04 +00: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
Reedy e49e7da070 Namespace extension
Change-Id: Ic480033a3a2418e41d39aaf777872587c11f1786
2022-02-06 15:24:30 +00:00
Iniquity 5803ea79eb Remove discussion and help links from footer
Bug: T133899
Change-Id: Ide631cd8bd98ff5084a8c406515c53b8a0cb033a
2022-02-06 01:15:02 +00:00
Umherirrender 7b9375ef82 Remove PHP entry point
Copy description from entry point to extension.json

Bug: T140850
Change-Id: I25fc5ffdceb6e4c882c885d89780421e18375df4
2021-12-05 16:02:34 +01:00
vladshapik 0e00f3e2f7 Avoid using User::getOption
Remove using of User:getOption since this method
will be hard-deprecated. Now it is soft-deprecated.

Bug: T296083
Change-Id: Ic7d52a3be7bcfef8827d3fa33b663fbe05fef3f8
2021-12-01 17:31:55 +01:00
Reedy a78f97419c Convert to manifest_version 2
Bug: T252470
Change-Id: I0ec17528558cca78a2e3c44a7fce00c80a0892fd
2020-06-12 10:07:29 +00:00
Timo Tijhof ece9f65067 Remove redundant dependency on 'mediawiki.notify'
The 1 line of code this contained, to lazy-load mediawiki.notification,
and forward the function call is now part of mediawiki.base,
and required no dependency.

Bug: T233676
Change-Id: I15e135f7e91ef2a608f7ee915ae3f530c47e5734
2020-04-08 16:46:49 +00:00
DannyS712 d46bb28023 extension.json - don't use array syntax when hooks only have 1 handler
Change-Id: Icea2021ab6c9a500de3025a471a657ee9dccea02
2020-03-11 10:42:07 +00:00
Kunal Mehta 0c460e78cf Remove unused "position" field from "ResourceModules" in extension.json
Bug: T224847
Change-Id: I260e9b19b1243f10aab749e6d2fdc4f2f571462a
2019-06-02 22:12:54 -04: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 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
Simon Legner 2fbf2c06a9 Download sizes: 480p, 720p, 1080p, 2160p
Bug: T77642
Change-Id: I41b7d59d14342345fc060085b755ce28f3e9cf98
2019-05-26 19:15:09 +02:00
Ed Sanders 394b893c7d Use upstream CopyTextLayout in share/embed/download panels
Results in small UI changes, but allows us to delete a lot
of code duplication.

Depends-On: I9049f5a1c0d88680fc4a174e390dd08e27c0eee2
Change-Id: Iebe7bdc8a026b929a35e823d8107d90e7bb62b82
2019-05-23 20:01:36 +01:00
Thiemo Kreuz 44457ec926 Rename all hook handler functions to follow on<HookName> scheme
Change-Id: Ic770a9dd0a708a670a8658d3be037c7b73ebea83
2019-05-10 14:26:15 +02:00
James D. Forrester 23b2f78642 Remove the BetaFeatures integration
Not used in years. Sadly $wgMediaViewerEnableByDefault has to remain
for now.

Change-Id: If2d90627de230b9b36e7b24abe0d4bdee8a2ef35
2019-05-08 11:22:35 -07:00
Timo Tijhof c520b76978 Rename MakeGlobalVariablesScript hook for consistency
Given case-sensitive search, the callback didn't show up
when searching for "MakeGlobalVariablesScript", unlike for
almost every other deployed extension.

Change-Id: Ib9138446a898802150a123e140a14bfba08709e6
2019-04-16 22:59:25 +00:00
James D. Forrester 8ec4150af0 Replace use of deprecated ResourceLoaderTestModules hook
Use the new extension.json attribute instead.

Bug: T214211
Depends-On: I27ecebe27d7aaebe6d1317bc5eaea9cca368b45d
Change-Id: Iacb68ce9a7bab864720ef9a56f8702a4f02c129d
2019-02-13 15:05:33 -08:00
Eric Gardner bbaf7a38b4 Get Rid of EmbedFileInfo
* Deletes the mmv.model.EmbedFileInfo class file and its test file
* Updates the extension.json and MultimediaViewerHooks.php files to reflect
  these deletions (by removing entries from dependency lists)
* Refactors all instances of `new mmv.model.EmbedFileInfo()` to instead use a
  POJO with appropriate properties. Conditional assignment is used for the
  caption and alt properties if there is any chance they won't be available, to
  keep from adding props with falsy values.
* Refactors JSDoc method annotations so that `@param` tags expecting an
  EmbedFileInfo instance now expect an object; relevant properties of this
  object and their types have been added to the method annotations as well.

Bug: T77320
Change-Id: Ie9f5f24136f4b73000259685474ce4d765a3ccd3
2019-02-05 15:31:49 -08:00
Fomafix 92f9f75b81 Add missing dependencies on core modules
The JavaScript files from the module 'mmv' uses directly functions from
the core modules 'mediawiki.user' and 'mediawiki.util'.
This change adds the missing dependencies on these modules to ensure
that the used functions are present.

Change-Id: Iad7142a5ed52a90b433f94afa25c8ce58b26df5b
2018-12-06 18:37:32 +01:00
James D. Forrester 1677403033 RL: Add mediawiki.notify dependency to mmv.bootstrap
No longer implicitly loaded on every page by MediaWiki, since Ifa222ca05e.

Change-Id: Iaae6fd8b1d428fdad834eaeb24dbeff5d2512804
2018-12-03 16:45:00 +00:00
Kunal Mehta c50794c3f2 Don't use deprecated jquery.hidpi module
Using window.devicePixelRatio directly means we won't be supporting Windows 8
and/or IE 10 & 11. But that seems intentional based on 828f6d6ac9db.

Bug: T206099
Change-Id: I53dbce0a8ddc69c4edfd4d10f98031aa4f7cd20a
2018-10-08 20:15:18 -07:00
Timo Tijhof 5c9faa580e Move files to their own directory per module
Bug: T193826
Change-Id: I925b1c7be2dbbb50994ed9f1ef12b5978ba175ff
2018-07-30 15:15:25 +02:00
Kunal Mehta cdac35ffda Register EventLogging schemas in extension.json
Change-Id: I7102950ff23fe6cb7f61d5a067076ddd77b10096
2018-07-26 09:51:31 -07:00
Kunal Mehta 03eb49cde1 Remove unnecessary $wgExtensionFunctions
As best I can tell, adding the `ext.eventLogging` module as a dependency
for these three modules is unnecesary. One of those modules doesn't
even exist, and my greps across the entire extension show that
mmv.logging.Logger.js uses `mw.loader.using` to load the module, so a
server-side dependency isn't required.

As an aside, this extension should probably use the more abstract
`mw.track` interface instead.

Bug: T180192
Change-Id: If71277114be5a003d8f51040e52a601ace983c51
2018-07-25 17:02:59 -07:00
Kunal Mehta e2d79e8044 Don't use deprecated mediawiki.api.options
It was merged into `mediawiki.api`.

Bug: T196802
Change-Id: Id8c7baafbb0bb334d2099af39db7455ad4c1e92b
2018-06-09 00:21:01 -07:00
Antoine Musso 8894e67a43 Registration must use www.mediawiki.org domain
1) ExtensionJsonValidationTest::testPassesValidation
Failed asserting thatMultimediaViewer/extension.json did not pass
validation.\n
[url] Should use www.mediawiki.org domain\n
' matches expected false.

Change-Id: I90fe971f48e94f6810832fd8a784c9ca8967576b
2018-05-25 16:13:02 +02:00
Ed Sanders bc5870527a Remove jQuery.hashchange library
This library just provides fallbacks for browsers
that we no longer support.

Change-Id: If81df7b33b3106ab58744494a4f67583241861dc
2018-05-11 18:47:08 +00:00