Commit graph

100 commits

Author SHA1 Message Date
Volker E b4daae5ba2 build: Update 'svgo' to latest v3.2.0 and re-minify 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 unifiying npm command to qua standard notation `minify:svg`.

Bug: T354875
Change-Id: I099da9abda686371acea3207a6121cfe0aa5b937
2024-01-15 22:05:13 +01:00
Jon Robson 31bcd72898 Do not use deprecated MobileFrontend library, use Codex
Additionally:
* Begin progress of switching codebase to ES6

Bug: T348807
Change-Id: I22d46f0d0d9f5ace7291f4ddedfc515ef69d0835
2023-12-12 17:24:46 +00:00
Ed Sanders 32eaf729f0 Remove jsduck config
This has never been published, and there is very little public API
to publish. Use stanard jsdoc config in ESLint.

sendThanks doesn't need to return false as the return value is
never used.

Change-Id: I02dd9c83511afa5a6e66faf8e96d240eb2464ce3
2023-11-30 12:01:26 +00:00
Ed Sanders f18aee5bbc Move var declarations inline
Change-Id: Ib952bd8a8eb9e0fce9541c4f9336169416593f3e
2023-11-30 10:58:04 +00:00
bwang b6a7933544 Update Thanks extension to use IconButton.js from MobileFrontend
Bug: T340262
Change-Id: Id177ce9a11b2f5e82bd1099613fd7a9c4cde6dc5
2023-07-28 11:17:43 -07:00
Thiemo Kreuz a9878ab2ab Some smaller general code cleanups
In detail:
* Use more compact syntax to avoid a bit of code duplication.
* Use createMock() shortcut in tests.
* Avoid hiding code in strings.
* Remove a comment that literally repeats what the code says.

Change-Id: Ibedef380489451268e2e87f0864164e8f9737913
2023-01-03 12:30:41 +01:00
libraryupgrader da266db965 build: Updating dependencies
composer:
* mediawiki/mediawiki-codesniffer: 38.0.0 → 39.0.0
* mediawiki/mediawiki-phan-config: 0.11.0 → 0.11.1
* php-parallel-lint/php-console-highlighter: 0.5.0 → 1.0.0
* php-parallel-lint/php-parallel-lint: 1.3.1 → 1.3.2

npm:
* eslint-config-wikimedia: 0.20.0 → 0.22.1
* grunt: 1.4.0 → 1.5.2
* grunt-eslint: 23.0.0 → 24.0.0
* async: 3.2.0 → 3.2.3
  * https://github.com/advisories/GHSA-fwr7-v2mv-hh25
  * https://github.com/advisories/GHSA-fwr7-v2mv-hh25

Additional changes:
* Set `name` in package.json.

Change-Id: I7dfe053d1281bab4df8abcbaac84aa2a2f1bf198
2022-05-21 15:34:41 +00:00
bwang f2a7007931 Cleanup: Remove deprecated hasText option from MobileFrontend Icon
Depends-on: I6f4b0b914fbd329bdc64be89b512a377712600e6
Change-Id: I6344b51edcbe5b69d892b5867f983d2fadde9178
2022-02-11 16:23:07 +00:00
Volker E bb54b8a122 build: Add SVGO latest v2.8.0 and re-crush SVGs
Adding new 'minify-svg' npm script.
Also re-crushing SVGs.

Bug: T283068
Change-Id: I24c4f386c83fd9412e7b861341add9838a898f7b
2022-02-07 05:12:10 -08:00
David Lynch 7e05c0f97a Correct attribute for flow thanks
This is a follow up to aaaa5b63da.

Bug: T300831
Change-Id: I984a45c330a3f28dde11d80c520d40aac3b4aacb
2022-02-03 14:06:17 -06:00
Ed Sanders aaaa5b63da JS: Update APIs to make more extensible
* Don't require a jQuery element with a specific attribute
  to record thanks. Instead pass in the thanked ID directly.
* In Flow, don't override the cookieName static property,
  instead pass it in as an argument.
  Change the static property (effectively a global) prevents
  us from having multiple types of thanks on the same page.

Change-Id: Ia569f8636f070f2af69f89d7da66c9a6f9821d24
2022-01-25 22:02:15 +00:00
Ed Sanders 1daf4bcf2d build: Update eslint config
Change-Id: If0871326eb35f8cb6ef026784cd04fca5754ab59
2022-01-25 22:01:31 +00:00
bwang b1ea8ca01b Update MobileFrontend Icon usage to include 'type' option
Change-Id: I4674dd8489acd9cf75c55faaf67666b10efb3d72
2022-01-04 17:18:47 -06:00
Umherirrender 35ee72248c Move userTalk-constructive icons from root to modules
Store all SVGs in the same folder.

Change-Id: I0b2205e1e894bccae3527a6544a9c370b13ffcec
2021-03-06 19:01:48 +00:00
jenkins-bot ba78be728a Merge "build: Update eslint-config-wikimedia to 0.16.2" 2020-07-09 16:39:26 +00:00
Ed Sanders cf9aeb5689 build: Update eslint-config-wikimedia to 0.16.2
Change-Id: If00a92d0ff96cee4df4d5468a862e3ae2a90b911
2020-07-09 16:35:57 +01:00
Gergő Tisza 3d17c58922 Use mw.cookie instead of $.cookie
Bug: T254024
Change-Id: If487ef4d14f308fd6da0d6b938e35dc68dca5b5e
2020-05-29 19:44:12 +00:00
Ed Sanders c033679cb8 build: Update eslint-config-wikimedia
Change-Id: I3cbcbb1695896ddc1e54c40dc0da50f91944916f
2019-12-12 11:36:24 +00:00
Fomafix fdc02d0d15 Avoid double HTML escaping
Also use the shorter

 mw.msg( ... )

instead of

 mw.message( ... ).text()

Change-Id: Ifb379960d875b090a14fd990c479df0b5aeb146d
2019-09-17 10:14:38 +02:00
jdlrobson 7a7f751b42 Create mobile thanks using the mobile library
The thanks icon had styling issues as it didn't use the mobile
icon and button fundamental components.

The icon should also be inside the button, the element should not
be both a button and an icon.

Bug: T229440
Change-Id: I0136466fe1452f904961b89ae7677fc1a511adab
2019-09-13 19:23:49 +00:00
Ammar eae0f237df Remove unneeded CSS for thanks toast link
Minerva now provides default styling for these links.
Also removing 'grunt-stylelint' package as there are no
CSS/LESS files in this extension any more.

Bug: T232102
Change-Id: I4e8b44d3159ab4a87103fa8471c7b1b145ac6016
2019-09-06 09:23:12 -07:00
jdlrobson d626e6f04d Annotate thanked confirmation with span and class
Users that have already been thanked have the link "thank" replaced
with the message "thanked".

This allows skins e.g. Minerva to style this differently from the rest
of the content.

Change-Id: Iacf7d840cf088afdad6d93ace0f69bf225e05cfa
2019-03-28 00:52:29 +00:00
Olena23 ca055ec16f Fix typo
Fixed typo occurd-occured

Bug: T201491
Change-Id: I077376e45130631425dd1012cc6a860938c8c265
2019-03-08 15:48:21 +02:00
jdlrobson 99393ea6a6 Follow ups to I807f729c1b1a9e9b5952685bb18f540f81d70f47
* Capitalise "cancel"
* Link is inline block with margin from text so that
it can spill down to new line on small resolutions

Change-Id: Id7ceaa85ce88e7eef7cada88596781ca5f7755df
2019-02-12 11:55:49 -08:00
jdlrobson 4f276041f4 Add client side click to cancel on thank
When the thanks button is clicked a thanks will be
queued, that the user can cancel by clicking "cancel"
before the action is completed.

This should help the majority of users experiencing
accidental thanks.

Bug: T63737
Change-Id: I807f729c1b1a9e9b5952685bb18f540f81d70f47
2019-02-08 17:31:20 -05:00
jdlrobson c90883c591 popup is undefined
This will throw a client side error. Let's not do that. What's
needed here is a toast.

Change-Id: I6395fec5cf3fc6ac561aa13d3d9d031e153f3341
2019-02-08 12:31:03 -08:00
Ed Sanders e453114f55 Remove obsolete aliases from closures
Bug: T208951
Change-Id: Ie84c06e4a69923a5993b173d490bfa97189c285b
2018-11-12 19:22:46 +00:00
jdlrobson a6fa3c4977 Do not use PNG for thanks button
Instead use mediawiki.ui and ResourceLoaderImageModule

Other changes:
* Add gender support to thanks-button-thanked

Depends-On: I0745e112d11026ed59d8daca990b313305cd094a
Bug: T198151
Change-Id: I82ae596330aff8387653c65a6bab5ff729641a80
2018-08-09 17:13:21 +00:00
jenkins-bot 314dbc9d00 Merge "Add log-thanks support to corethank module" 2018-04-03 18:35:14 +00:00
Sam Wilson 3973a11e8d Add log-thanks support to corethank module
This adds support for thanking for log entries. It gets the log
ID from and attribute on the thank link (which does not yet have
this; that will come in T187485), and sets the source to be 'log'
if it's being called from Special:Log (this can be extended in
the future if we want to thank for log entries from elsewhere).

Bug: T186921
Change-Id: Ifdb458b873ed4f1e6e64760658d2293aba1e02b3
2018-04-03 07:55:12 +08:00
Roan Kattouw 52663255f7 corethank: Use the recipient's gender for all "thanked" messages
It was already being used when changing a "thank" link to a "thanked"
message because the user just clicked it and thanked that person, but
not when updating links on page load for things the user had already
thanked previously.

Bug: T190563
Change-Id: I4c5758ef446aa2712ae27a1c784555cbf23806f9
2018-03-28 21:55:48 +02:00
Sam Wilson 2059e3ff4b Add revision-thanking links to some log entries
Many log entries are associated to (exactly one) revision,
and for these (only, and only where the log type is
whitelisted) we add a thank-link that behaves exactly
as the thank-link on diff and history pages.

Bug: T189752
Change-Id: I5f4e84c65d4fe2d95b20cdb3c3f9522ad3e5f422
2018-03-22 11:57:55 +08:00
Sam Wilson 78831d2b68 Rename files and classes in preparation for adding log-thanks
Bug: T186855
Change-Id: I20f5d200c33e395aca9489b73d0ed9b1d0ad5b8c
2018-02-21 12:49:21 +08:00
Stephane Bisson 3f139b3dd2 Send thank for the right link
Due to confusion between $thankLinks (plural)
and $thankLink (singular), clicking any thank link
was sending thank for the first thankable revision
on the page.

Introduced in I9097bd976f8da1632577a3f4438b9f1186baca88

Bug: T187757
Change-Id: I7993531206c46657908a66d73369928ccf5dc677
2018-02-20 14:16:18 +00:00
Fomafix 90eef72c48 Simplify ext.thanks.mobilediff.js
* Explicit return null instead of no return.
* Document right @return type.
* Avoid else paths by using early return.

Change-Id: I24c434ebb57188346ad7cd722f08390ba6da2c34
2018-02-10 20:31:17 +01:00
Fomafix 99baf3eff9 Simplify by using jQuery
Change-Id: I31262cc68d0e0d2c6bbdabf496f81da9c1089a0f
2018-02-10 19:33:48 +01:00
Fomafix b1f27da62b Simplify promise by using .then()
Change-Id: I400c604a693f8786964f3710140b32ba74e3bd93
2018-02-04 16:46:39 +01:00
Roan Kattouw 6bb7939a79 revthank: Clarify confirmation message and change yes/no messages
Bug: T159302
Change-Id: I49ac7d644f207fe76a49efd650b727e33049b3af
2018-01-19 17:07:42 -08:00
Roan Kattouw 6184c79e72 revthank: Embed gender of thanks recipients in the page
That way we don't have to do an API request to get the gender,
and we'll also be able to use gender-sensitive messages in the
confirmation step.

Bug: T159302
Change-Id: I9097bd976f8da1632577a3f4438b9f1186baca88
2018-01-19 17:07:38 -08:00
James D. Forrester e315e954a6 build: Replace jshint and jscs with eslint; drop csslint
Removing csslint rather than replacing it with stylelint as there
are no CSS or LESS files in this repo.

Also bumping banana and jsonlint to latest.

Change-Id: I9ffce273f63b061e07c3fa90ab4e82b5e551aa92
2017-08-03 17:24:34 -07:00
Matthew Flaschen 641c4a702f Fix Thanks messages not say "received your thanks"
We don't know if they'll receive it, due to Echo preferences
being private.

Bug: T168589
Change-Id: I45375ea3fdc48128513c53c945e55578307633d4
2017-06-21 20:31:37 -04:00
jenkins-bot 9dc0cc68b9 Merge "Remove unused reference to mw.mobileFrontend" 2017-04-18 01:50:08 +00:00
Fomafix 669fa8b93e Remove unused reference to mw.mobileFrontend
Follows-up to 35964a6c

Change-Id: I6e7ef6831607b80acfc75824594eedac0a8f907c
2017-04-17 11:48:17 +02:00
Fomafix 063277213b Fix whitespaces
Change-Id: I7e56a4475f3bedd3bec18818bd7e2845e430fc24
2017-04-16 12:46:40 +02:00
jdlrobson 35964a6c77 Remove MobileFrontend toast dependency
Rather than using mobile.startup, switch
to using mediawiki.notification which is more
lightweight and does same thing.

Bug: T155801
Change-Id: I23d75272602766e24e8b01410f4a88609eda6dee
2017-01-26 11:56:18 -08:00
Fomafix 8dc7cec329 Replace $( document ).ready(...) by $(...)
In jQuery 3 $(document).ready(...) is deprecated.
https://jquery.com/upgrade-guide/3.0/#deprecated-document-ready-handlers-other-than-jquery-function

Change-Id: I71bd8bb06809faf5d0d9f99018ed21d3bb816f79
2017-01-06 14:17:40 +01:00
Prateek Saxena f0e1ec158b Use mw-ui-progressive instead of constructive
Bug: T146923
Change-Id: I6e18cc6151f315badb938a358c2896149a6ced8f
2016-09-29 18:52:09 +05:30
addshore e0d7d87b50 Stop listening to revslider.diffreload hook
Bug: T142636
Change-Id: I3a35823a204c9045ffdbf24260dbc5d55338191d
Depends-On: Ie88021abb2325cc6259cf2fb041fbdca4ae9ca89
2016-09-13 09:54:31 +02:00
addshore 0b241d4d29 Listen to the wikipage.diff hook for adding JS links
Bug: T142636
Change-Id: Ie488021f5d0e314a8ad6c8d1f1f3d936c427d719
2016-09-13 09:52:41 +02:00
Leszek Manicki 0842943ad5 Re-add actions to Thanks links when Revision Slider reloads a diff
Thanks listens to a hook fired by Revision Slider on diff reload
(added in I02a8736d00e6560d0807888c957b0e9aa3e80bb8).

Bug: T142636
Change-Id: I0e6c0072a9fe46c02b8ccbe528a9b87f0381bd65
2016-08-25 17:25:40 +02:00