Commit graph

44 commits

Author SHA1 Message Date
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
bwang f2a7007931 Cleanup: Remove deprecated hasText option from MobileFrontend Icon
Depends-on: I6f4b0b914fbd329bdc64be89b512a377712600e6
Change-Id: I6344b51edcbe5b69d892b5867f983d2fadde9178
2022-02-11 16:23:07 +00:00
bwang b1ea8ca01b Update MobileFrontend Icon usage to include 'type' option
Change-Id: I4674dd8489acd9cf75c55faaf67666b10efb3d72
2022-01-04 17:18:47 -06:00
Ed Sanders cf9aeb5689 build: Update eslint-config-wikimedia to 0.16.2
Change-Id: If00a92d0ff96cee4df4d5468a862e3ae2a90b911
2020-07-09 16:35:57 +01: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
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
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
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
Prateek Saxena f0e1ec158b Use mw-ui-progressive instead of constructive
Bug: T146923
Change-Id: I6e18cc6151f315badb938a358c2896149a6ced8f
2016-09-29 18:52:09 +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
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
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
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
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 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
Kunal Mehta 5df573582f Send thanks via POST on mobile too
Bug: 70503
Change-Id: I340665f2119427b96f1bdb78224df7af172b7526
2014-09-06 20:45:20 -07:00
kaldari 22adcc3625 Add mw-ui-button styles since old button styles have been scrapped
Also adding a helpful comment.

Leaving existing mw-mf-action-button class for now since this
provides the float left. Eventually we should migrate the styles
in MobileFrontend to use mw-ui-button as well and reduce the
redundant styles that are set. See also:
Change I59e8441f4c4e1d33bff33afcab6c6670d7b99634

Bug: 61490
Change-Id: I7e14b8eb522d8d7443fa917d97cb91773c6410f0
2014-03-03 17:31:14 -08:00
kaldari cdc91d7f54 Story 1604: Remember mobile thanks
If the user has already been thanked, make the button greyed out
and display the text "Thanked" instead of "Thank".

Dependency: Ife9f456a7a9cf74b1b54fdc6128feb230fd6f671
Bug: 59828
Change-Id: Ifab78fe62910c9c3f2a927a6a4bbe28fb953b160
2014-01-15 17:36:53 -08:00
kaldari ea4646ae7f Regression: Update name of toast module so mobile thanks isn't broken.
Change-Id: I85d878d6b9452cbc3f21851f9bd63a4a1408cca1
2014-01-14 17:28:41 -08:00
Siebrand Mazeland 08f8d9ed44 Add GENDER support for 'thanks-error-ratelimited'
Spotted by Matma Rex and reported at
https://translatewiki.net/wiki/Thread:Support/About_MediaWiki:Thanks-error-ratelimited/en

Change-Id: Ib19f7297e6a99d89cc9465233d1604e55c330bfa
2013-10-07 17:17:18 +02:00
Siebrand Mazeland b3e97e76e7 Add GENDER support for 'thanks-button-thank'
Spotted by Asaifm at
https://translatewiki.net/wiki/Thread:Support/About_MediaWiki:Thanks-button-thank/ar

Change-Id: Iaeacd998344645557384e9c90c9cc48350abf9f0
2013-10-07 09:26:07 +00:00
kaldari bd5bdba07e Migrating Mobile thanks into Thanks extension
Also making thank button for mobile capitalized.

Also update for new clickTracking code.

Also promoting to stable.

Dependency: I56e2c5bc69f85e83ab3dfd9b9e617dbb98661870
Change-Id: Ifaf44fe8994a8085c30522292bba8b768da533db
2013-09-26 18:42:13 -07:00