Commit graph

458 commits

Author SHA1 Message Date
thiemowmde f7a171e14d Fix and add missing JSDoc type hints in SliderView class
Mostly motivated by the missing @type tag.

Also make the syntax more compact. This is significantly easier to
read, I would like to argue.

Change-Id: If5cea5ff66ed345df16a2b417f0db4c56db347c9
2022-11-22 14:32:33 +01:00
Thiemo Kreuz 3faf7ff34c Fix broken initial state when old/new revision id are swapped
This might not be the best possible solution, but it improves the
current, obviously broken situation a lot. At the moment one of the
dots is drawn outside of the slider, even if the revision it should
point at is part of the slider. Turns out the revisions shown on the
slider are loaded in multiple steps. The first step misses one of the
revisions when their order is swapped. When the missing revision is
added later it's already to late.

Bug: T168609
Change-Id: I10d15d04d981c87d35b2431080182fb5e3eb2b2b
2022-09-09 11:18:10 +02:00
Ed Sanders 4ed783c2e7 Remove unnecessary vendor prefixes
Change-Id: I1777f850595b3163e47e353aa02194ba838aebeb
2022-07-19 17:23:08 +01:00
jenkins-bot 643f4d7a27 Merge "Modernize and simplify smaller pieces of code in API module" 2022-06-22 19:36:03 +00:00
Thiemo Kreuz fd9b17633b Modernize and simplify smaller pieces of code in API module
Change-Id: Ic3f65516a76b0e4f03013587b164a56ad3785185
2022-06-22 13:11:52 +00:00
jenkins-bot bc9a5d7d84 Merge "Replace html paragraph tags in i18n" 2022-03-28 13:27:39 +00:00
Mortal303 9dc6fa7fb2 Replace html paragraph tags in i18n
Removed the HTML in the tutorial message and used linebreaks(\n\n) in i18n/en.json file,
replaced .html( mw.message( '…' ).…() ) with .text( mw.msg( '…' ) ) in modules/ext.RevisionSlider.HelpDialog.js
and added 'white-space: pre-wrap' in class '.mw-revslider-column-text' in file modules/ext.RevisionSlider.less
without affecting the front end of the page.

Bug: T267128
Change-Id: Iaf8b1819ca3139c18fb65cfca1c0b2120abb10f4
2022-03-21 15:49:07 +05:30
Ed Sanders 4a44f8c2e5 build: Update devDependencies
Change-Id: I0bbd117b2b3ebdfee8deb7ed38b409a561f570d5
2022-03-17 22:55:02 +00:00
WMDE-Fisch 1fa153aeab Fix issues to prepare for lint update
The new mw eslint config comes with node 12 and the change will be
quite big due to the lock file. I wanted to keep the diff of actual
code changes seperate.

- Applied all code style recommendations
- Removed one test that's not giving any value
- Changed regex .match to .test for performance and convinience

Change-Id: I578be8c6460c7a4d1220354c028a9bfd9bb86d13
2022-01-13 13:59:53 +01:00
Thiemo Kreuz 9aca3a2593 Merge ….RevisionList ResourceLoader module away
It's never used in another context but together with the
….Slider module.

Motivated by the confusion about the two types of require()
introduced in Idf1cc79.

Bug: T233279
Change-Id: I922d7ab56fd3ce80bc901f1a5d7174df6fe6756d
2021-12-20 12:13:09 +01:00
jenkins-bot d8c013e323 Merge "Merge ….HelpDialog ResourceLoader module away" 2021-12-17 13:48:22 +00:00
jenkins-bot fd8b96b791 Merge "Merge ….Pointer ResourceLoader module away" 2021-12-17 13:48:20 +00:00
Thiemo Kreuz 1407e0a90d Merge ….HelpDialog ResourceLoader module away
It's never used in another context but together with the
….Slider module as well as the ….init module. The ….init
module continues to require the ….Slider module, so all
dependencies are still met.

Motivated by the confusion about the two types of require()
introduced in Idf1cc79.

Bug: T233279
Change-Id: I4b4ef69f3074d57f884763c092a515ce976daaef
2021-12-16 16:45:41 +01:00
Thiemo Kreuz 319061c92a Merge ….Pointer ResourceLoader module away
It's never used in another context but together with the
….Slider module.

Motivated by the confusion about the two types of require()
introduced in Idf1cc79.

Bug: T233279
Change-Id: I7c98a41051e6d83ab3524cb14a709002feec2d78
2021-12-16 16:39:07 +01:00
Ed Sanders dcf19784eb Define documentable types in eslintrc instead of inline
Change-Id: I20e805839a13697ffea8d4a2f92b1c3a4b023175
2021-10-17 15:35:14 +01:00
Ed Sanders 64effa6e42 Move var declarations inline
Change-Id: If1256b01f6ac8237c79b5ba62f20ad65f1dc7691
2021-10-07 14:55:44 +01:00
Thiemo Kreuz a2bd859b29 Simplify/reformat code pieces with a lot of duplication
Change-Id: I7f933bb0d5c82858e5ab1831f9021f67e373ff69
2021-07-01 09:16:34 +02:00
Thiemo Kreuz c8ddf3c9b9 Fix jQuery.offset() calculation possibly failing
It turns out the jQuery documentation is incomplete:

  $( '<a>' ).offset() → { top: 0, left: 0 }
  $( '<a>' ).parent().offset() → undefined

The difference is that the jQuery set in the second example is
empty.

Bug: T282067
Change-Id: I7c19162f1a39bd529e0a74a6cc0c1ac987f33657
2021-06-21 15:35:21 +02:00
Volker E e39dc66484 build: Change 'stylelint' config rule to '*disallowed-list'
Available since 'stylelint-config-wikimedia' v0.10.3.

Bug: T279431
Change-Id: Ia537ebaa27935887f011f431647040f4a2357fa5
2021-04-28 02:52:08 -07:00
Volker E b0b3dcbed0 styles: Remove obsolete -moz- vendor prefixed rules
Bug: T278670
Change-Id: I99d91408feb7a87162522a1207dc7469d5bdd5f4
2021-03-29 02:51:54 -07:00
jenkins-bot 25c1078223 Merge "Migrate Slider module to packageFiles" 2020-11-19 13:59:52 +00:00
jenkins-bot 9f41794d86 Merge "Migrate RevisionList to packageFiles" 2020-11-19 13:57:20 +00:00
Adam Wight 8132e43a20 Migrate Slider module to packageFiles
Change-Id: Idf1cc799ab37ec8f49b3a28d161b6cd53090f707
2020-11-19 09:13:45 +00:00
Adam Wight ebd9985afc Migrate RevisionList to packageFiles
Change-Id: I3299d3a4bc66a3b85d0d0f7d8a49edbf8f6329c3
2020-11-19 08:54:10 +00:00
Thiemo Kreuz 6235d4b075 Add some missing @class type hints
Change-Id: I2395e96667d4cd2847fedd5697cff665d212192e
2020-11-18 11:51:22 +01:00
Thiemo Kreuz 4ac1ff57f1 Remove closure wrappers from all JavaScript code
These are not needed any more, because the code runs in a
seperate scope anyway.

Change-Id: I939a06102f194a0c98021accb2f62be73dd0562f
2020-11-18 11:16:04 +01:00
jenkins-bot df52b15efb Merge "Get rid of all var … = function () {} declarations" 2020-11-16 15:15:32 +00:00
Thiemo Kreuz c57fe0f2b6 Get rid of all var … = function () {} declarations
… and replace them with more trivial `function …() {}`. I
believe this does not make any difference. But I feel this
makes the code a little more straightforward.

The motivation for this patch is because a few other patches
change some of these function declarations, leaving a (in my
opinion) confusing mixture of styles behind.

Change-Id: Ib8928c4176a963afcf1fee1c785dd7bdc86c9706
2020-11-12 19:23:40 +00:00
WMDE-Fisch 9386cb6f65 Improve some JSDoc blocks
- mostly fine graining Event objects referenced
- removing one obsolete parameter doc

Change-Id: I1270c4b8100da647ca0739f7f3571bd48d484137
2020-11-12 15:48:27 +01:00
gopavasanth 748e4970f0 Fixed text wrapping to avoid word break in tooltip
Bug: T208318
Change-Id: Ib6ab38fdf99a14be237f3b611df24a9854781572
2020-11-03 16:57:31 +05:30
Adam Wight ddcd65f4de Migrate Pointer to packageFiles
Change-Id: I8e06c9eeb47688741a95bca8f996b2148b03028c
2020-09-21 18:14:07 +00:00
jenkins-bot 1e13c311e8 Merge "Migrate HelpDialog to packageFiles" 2020-09-21 07:21:33 +00:00
Ed Sanders 49d6f1ef8f build: Update eslint-config-wikimedia to 0.17.0
Fix instances of variable shadowing.

Change-Id: I9f8d4dcab8cb400d04600e7bb543ddda2705d1df
2020-09-11 16:28:52 +01:00
gopavasanth 2f14374d0a Fixed vertical alignment of tooltips
Removed padding for the tooltips of Slider left, right arrows and
help button.

Bug: T255752
Change-Id: Iec9d5bc765f627291c9b9824dbd98877d9ee496d
2020-06-19 23:47:05 +05:30
Ed Sanders eaa7966710 build: Update eslint-config-wikimedia to 0.16.1
Mostly documentation style fixes

Change-Id: I75262aead377f7f41931de44c5208b7b7d06930d
2020-06-16 15:13:36 +01:00
jenkins-bot 1d43c464ac Merge "Do not show entries for hidden tags" 2020-04-13 14:14:25 +00:00
jenkins-bot e8d659495b Merge "Use tag displaynames when fetching additional revisions" 2020-04-13 14:14:05 +00:00
Adam Wight c9958c5edd Migrate HelpDialog to packageFiles
FIXME: Reusing HelpDialog as a module entrypoint creates a circular
reference.  It's harmless because the dependencies are added at
different times, but also easy to refactor away.

Change-Id: I3608a78baddf2376cc9eb4524625f4911c130c06
2020-04-05 01:50:48 +02:00
Adam Wight d369701709 Migrate Settings module to packageFiles
Change-Id: I984404dd216fff469d7891f4f69a92d83d19d1c4
2020-04-05 01:37:15 +02:00
Bartosz Dziewoński 0699e09dd8 Do not show entries for hidden tags
Bug: T249266
Change-Id: I7e83523c5e8f088efaf95acb339973e0f805ff48
2020-04-02 21:00:02 +00:00
Bartosz Dziewoński 36c51562f6 Use tag displaynames when fetching additional revisions
They were previously only used for the initial fetch.

Bug: T249266
Change-Id: Iecf0fcf6bc0a691b0e3e5d13adbe75abbecb54da
2020-04-02 20:59:48 +00:00
jenkins-bot 4124a82ebf Merge "Improve discoverability of JS code with @class tags" 2020-01-24 18:01:43 +00:00
jenkins-bot 659b492cb8 Merge "Fix misplaced pin" 2020-01-24 17:58:37 +00:00
Thiemo Kreuz 7f38c9c579 Improve discoverability of JS code with @class tags
In my PHPStorm IDE, this makes it possible to follow all methods and
properties in these classes, even these that are later defined.
Otherwise only the empty stub of each class is found.

This might be different in other IDEs.

Basically: PHPStorm does not understand the meaning of the $.extend()
syntax from jQuery without these hints.

Change-Id: I4aa76db183122f6669dc72561441f46f0056d793
2020-01-24 17:21:23 +01:00
WMDE-Fisch 0435e0b5d2 Fix misplaced pin
Removed some hacks that messed with the position and size of the icon.

Bug: T243593
Change-Id: Iaaa4027ec8c094cc8d103615aad646c3331a3ba3
2020-01-24 13:30:03 +01:00
WMDE-Fisch f121c62990 Fix misplaced arrow icon on slider buttons
Seems like OOUI changes lead to this hack not beeing used anymore.

Bug: T243592
Change-Id: Ib12f5eef69e57abc78c89680144505b4a92b2145
2020-01-24 13:16:42 +01:00
Ed Sanders 28bc463836 build: Update linters
Change-Id: Ia316dd09b6d6b7452610ff2b8816a146a3bb48a4
2019-12-11 13:42:51 +00:00
WMDE-Fisch a4df17a922 build: Upgrade stylelint-config-wikimedia from 0.5.0 to 0.6.0 and make pass
Change-Id: I1db434584d6927cf0322fdbd6253ebb1846537c0
2019-07-03 12:14:05 +02:00
WMDE-Fisch 7c47e6e981 Apply user highlighting for all revisions in DOM
This only solves part of the issue. Highlighting is applied for more
elements since they are retrieved from the DOM. The problem still exists
since highlighting depends on the RevisionList chunk on which is it applied.

To fix the issue completely highlighing should be managed somehow globally
on the global list.

Bug: T207781
Change-Id: Idda930f3d0dd64e767c68dade2ca8759bc636898
2019-05-19 11:27:59 +02:00
WMDE-Fisch 9e73c7d2c1 Fix re-highlighting of revisions
This was broken for obvious reasons. Also adding a test.

Change-Id: Ib6e8988884ff84472928758d4112574e17fa48be
2019-04-25 11:15:14 +02:00