Commit graph

91 commits

Author SHA1 Message Date
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
Prateek Saxena be2ed5f959 Use OO.ui.alert() instead of plain alert
Bug: T128891
Change-Id: Ib5d47bad48e8d42098de19a2c87dd863a38c2a2d
2016-07-15 20:55:21 +05:30
Ricordisamoa c1da017852 Use "csrf" tokens instead of "edit" ones
"edit" type tokens have been deprecated in favour of the
more generic "csrf" type tokens.
This has been causing warnings since: 65077ede90

See also https://www.mediawiki.org/wiki/API:Tokens

Bug: T134532
Change-Id: I3ce3c1e6a40f8a21c931c77314021e2ae94e5fb7
2016-05-26 09:02:17 +02:00
James D. Forrester e690a5b9f9 build: Provide jsduck to build JS-land documentation
Change-Id: I8d24398e23e1c8f57183a32bcf9fdf8795e5543f
2016-04-25 11:38:26 -04:00
James D. Forrester a23a878953 build: Remove all non-mobile jscs over-rides and make pass
Change-Id: Iecc96b34c2a3bdecdd6d90b4e5d9b76f12604386
2016-04-22 12:47:08 -07:00
Glaisher 4c5b405425 ext.thanks.revthank: Prevent double clicks while API request is in progress
Bug: T53303
Change-Id: Ie886a8093469904f327bba8a0b30048fc6d6b638
2016-04-14 09:55:53 +05:00
Baha 69454efba5 Remove mobile event logging code
MobileWebDiffClickTracking schema has been removed.

Bug: T122504
Depends-On: I71fb074226c3d0f0a0d8a32de3794158adfb0e48
Change-Id: I4878e3f33b7379efdfb1eaffe87a6c842882e183
2016-04-04 08:28:07 -04:00
Kunal Mehta 88e344de1b Make sure error code is always passed to 'thanks-error-undefined'
Bug: T130880
Change-Id: I3c6d8d7592b867a3457283e321940895e3c08ba5
2016-03-29 15:12:57 -07:00
Kunal Mehta 93c7a1048e Include error code in API failure message
Otherwise the error reports we get are completely useless.

Bug: T78697
Change-Id: Ic0244e2e947256c411c889a8850c8f18ee3658a4
2016-03-04 11:33:27 -08:00
Stephane Bisson 1888227212 Fix Flow thank of post with descendents
Bug: T125168
Change-Id: Ic9d8c04549a174ad5f6a426e872fd7bc219b755d
2016-01-29 14:28:20 -05:00