Commit graph

66 commits

Author SHA1 Message Date
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
Glaisher 703642e40e Hide thanks button for botedits if bots are not allowed to receive thanks in mobile as well
Also only load 'ext.thanks.mobilediff' module if the recipient is not an IP.

Bug: T118686
Change-Id: I096d3b05a46590db426ae038f17f6e180fa5bf37
2015-11-24 22:47:56 +05:00
Stephane Bisson 7a987af51c Add jquery.findWithParent to Thanks
Thanks has an implicit dependency on jquery.findWithParent.
It often fails because it is not yet loaded.
Adding it locally so it is self-contained. It is not
Flow's responsibility to provide such low-level utilities
to other extensions.

Bug: T116146
Change-Id: Id74e77b5fb81d5da8cb6dd97fd1b90e5d974ae82
2015-10-27 13:17:54 -04:00
Florian aad7e245fa Use the new module name for eventlogging module
The old name was deprecated in I07b4366.

Bug: T113289
Change-Id: Ie53dcd6e4031727ca75c90fa84176f552bc5cc73
2015-09-28 08:29:56 +00:00
Alangi Derick 899fec3566 Hygiene: Call to deprecated toast module updated
The toast module is now accessed via mobile.toast/toast

Change-Id: I9e6e016bff171e8a8dbceb548b15a1fd7214f288
2015-09-25 18:28:40 +00:00
Kunal Mehta c4cf317241 Use mw.Api#postWithToken for mobilediff
Change-Id: I6821a9af1e05963364c768e2a39a84ae25883b64
2015-06-17 01:25:15 +00:00
Kunal Mehta 514e9d4c7f Call mw.Api() constructor properly
Change-Id: I56b3c6e17a509056a5ed5ceb5b4dcb376cdec0c3
2015-06-15 19:58:07 -07:00
Moriel Schottlender 0a5664ce5e Check the thanked user's gender for Thanks messages
Retrieve gender data for the thanked user for i18n message parsing
with the correct {{GENDER...}} data.

Bug: T96527
Change-Id: I14c831be51482682f2b628a15c79341a4f372c16
2015-05-04 17:16:09 -07:00
Roan Kattouw 805fefd198 Actually pass jscs
Removed exemptions from .jscsrc and fixed the code so jscs still passes.

Kept the exemption for disallowDanglingUnderscores because
of the naming convention for private functions in this repo.

Change-Id: I860f73394a2b92a411fe682abbb2ab0b5e1325f9
2015-05-04 12:13:43 -07:00
Matthew Flaschen b7cefb78ae Add custom title text for Yes and No Thank confirmations
Bug: T89572
Change-Id: I54bfaf7852182c2b22bd897fe55480c2b0e7f1ab
2015-02-17 21:55:36 -05:00
Matthew Flaschen 84f1234e09 Use jQuery prop instead of attr for whether btn is disabled
Bug: T85511
Change-Id: I7f7a434bc62065d872e24472c65eade649249f9b
2015-01-30 10:12:52 -08:00
jdlrobson e02c334880 Add tests for rendering of thanks button on mobile diff page
This has broken many times and I want this test to ensure its protection
in future.

Bug: T86687
Change-Id: Iea01c5c7c1ba00de47182521eeba86c8aef03522
2015-01-28 12:48:08 -08:00
Florianschmidtwelzow 7a3d154447 Mobile: Conform to new LoggingSchema
MobileFrontend recently introduced a new loggingSchema structure. Match
here, too.

Bug: T77929
Change-Id: Ie863937566fb894860d705f51a04ab30de76140d
2015-01-13 22:16:56 +00:00
Bahodir Mansurov 24b0963a90 Match changed MobileWebClickingSchema
Bug: T78360
Change-Id: Ic8dbef12a7fb51e807aff16c86c749c8a3c13837
2014-12-12 14:13:01 -05:00
Florianschmidtwelzow 54952e1b36 Match changed MobileWebClickingSchema
Follow up: I623fde482baaba753608160d486d79a313ee5825

Bug: T78360
Change-Id: I5ea1dcc10c2afba89dad062eb171e1e6a1b915fd
2014-12-12 06:59:01 +01:00
Matthias Mullie 9b7ef1c05b Use postWithToken
Change-Id: I46e27d34bff32b240dc19aa6ef6db1aeddbc3da3
2014-09-19 01:12:12 +00:00
Kunal Mehta 5df573582f Send thanks via POST on mobile too
Bug: 70503
Change-Id: I340665f2119427b96f1bdb78224df7af172b7526
2014-09-06 20:45:20 -07:00
Matthias Mullie 8618a95f79 Use postWithToken
Change-Id: I8d8949b66782af2956726b55db64b2dce97d5e4a
2014-09-01 14:27:10 +02:00
Kunal Mehta c1e4c568cc Use jquery.confirmable instead of jquery.ui.dialog
Change-Id: Id75fd57954edb9341d25ba754dd64279a28deb54
2014-08-31 07:14:35 -04:00
Kunal Mehta a53c7b3127 Use POST requests for action=thanks/flowthanks
This is now necessary after the tokens re-write in core.

Bug: 70138
Change-Id: Ide61f7b9e6d58cc53b04cdeef9d17f781ef25039
2014-08-28 13:10:38 -07:00
Erik Bernhardson ccdca0d0d7 Support updated flow frontend
* Flow no-longer allows arbitrary html insertion, so remove
* Update ext.thanks.flowthank.js to work with thank links generated
  directly by flow.

Change-Id: I8ae14352f1b177446f3696ffadd6921a5125238e
2014-07-15 15:07:33 -07:00
wctaiwan 0e0ef33ea3 Bind Flow Thank click detection to .flow-container
Single-topic views do not have a flow-topics wrapper, making Thanks broken
in those views.

Bug: 63205
Change-Id: I19c7d2da2d409f8c0a270600b092d504255d4111
2014-06-05 14:00:00 +08:00
wctaiwan 078875980e Use .on() instead of .click() for Flow Thanks
This makes the Thank button function correctly for posts that are
dynamically loaded with JavaScript (from
http://stackoverflow.com/q/9344306)

Bug: 63205
Change-Id: If51e1801e633573c8f0814832e26d643e1237d53
2014-05-16 00:47:32 +00:00
jenkins-bot 45e38cadf8 Merge "Clone thanked label before inserting" 2014-04-07 19:27:21 +00:00
Benjamin Chen 18bbaf3bdd Clone thanked label before inserting
ThankedLabel is inserted before the Thank link that's being clicked.
The label needs to be cloned on each insertion so it is not removed
on subsequent $.insert().

Bug: 63506
Change-Id: I8327158880cba9a141a4d9977414022173c4c8ac
2014-04-04 03:05:21 +00:00
Benjamin Chen 36b839ead2 Add hover highlight to Thank link in Flow posts
Bug: 62556
Change-Id: I3adb60d5b1c75500f8276cda8b8eaa2646bb1565
2014-03-21 04:04:04 +08:00