DifferenceEngine extends ContextSource, so we can
get the user from there instead of using a global.
Change-Id: I46e7a244729f2d8259319bed2c905e2971b37bf0
There seems to be no good way to enforce language on the QUnit tests. It works
for the number formatting by setting the user language on the fly but for everything
else it fails. I simplified some tests and skip some tests or asserts when the language
is not 'en'.
I also added a helper to have conditions for skipping tests. This should be part of
QUnit IMO.
Still I dont know if this is something we should care about at all or just assume, that
devs will know what they do when they try to run tests.
Change-Id: I624ccf3984434e06200abffe7ccdd25b396251af
As suggested in a comment in T135198, do not show anything above the
diff when JavaScript disabled instead of always putting a message
there.
Change-Id: I1c66fa4a9fa6e90f8318de3a4f656d629000d9ca
Changes include:
- not passing in HTML attributes when creating tag elements,
- creating HTML elements instead of appending hand-crafted HTML,
- single append() calls instead of multiple consecutie appends,
- not using raw HTML messages when not needed,
- prefixing all CSS classes and IDs with "mw-" to avoid potential
name conflicts.
Change-Id: I164538bbaf44d46a4c66659f56e07ec7225d7fa9
If the user has a time offset that will be used.
If the user uses the default then the offset is
still retrieved from mw.user.options.values.timecorrection
If the user is anon then mw.config.values.extRevisionSliderTimeOffset
is used which is added as a JS var by the Hook
Bug: T135109
Change-Id: Iab56bbeb6a1dd2ea08b73983341485623ff63ef1
* threw out most of the things from init.js
* turned Slider + View into respective modules
* pointers should remember position (except on page load) and correctly
slide back to their position/to the side
Some things still need testing and refactoring.
Addshore: - CS fixes and comment out current failing tests
Bug: T134395
Change-Id: I78a7095e1d9902314163b1443448f47ef0484d4e
This creates a module for the draggable pointers for the RevisionSlider
mainly to encapsulate both the pointers' state and their HTML code.
Some animation methods such as slideToSide and slideToPosition
that are still flying around in init.js weren't added to the
module since I thought they should be part of the not yet existing
Slider module.
Change-Id: I1292bfb0bbd68f8d2de04b3b5e5f3133ec6363b8
As far as I can tell diff is the only thing that is needed
to show a diff page (which is where we want to show the Slider)
For example:
- http://localhost/w/index.php?title=Foo&diff=5
Change-Id: I0c4e5ae04412a6da4034cf8c804742537aaeafdd
This turns the prototype code of the Revision Slider into a MediaWiki
extension.
With this extension enabled the slider should appear on diff pages
already but it won't actually show diffs when adjusting the slider
pointers.
Things that changed so far in the prototype JS code:
- pulled out the rainbow function and made it use Math.floor instead of
the ~~ binary operator
- pulled out the API request that fetches the revisions into its own
module
- cleaned up and documented some parts of the code
The code is still very much WIP and JSCS still has a couple of
complaints.
Bug: T132576
Change-Id: I2e22365f3b93a76d5b8d3997242b5fed996c6d78