Commit graph

24 commits

Author SHA1 Message Date
Jakob Warkotsch 079f5607c9 Add button to reopen the help dialog.
Bug: T137086
Change-Id: Ifef5c8451a53bf43b10418ace8e6651801480bb2
2016-06-17 13:11:38 +02:00
Jakob Warkotsch 5f6b3c8556 Show a help dialog.
- slide show dialog using OOJS UI
 - setting a user option to only show it once
 - translatable content
 - images of the slides

Bug: T136830
Change-Id: Ia820aecb20aa6b239f1a64dd328683639baf399e
2016-06-16 18:05:10 +02:00
Moriel Schottlender 7b75c1ebf2 Use momentjs to display internationalized timestamps
MediaWiki uses the momentJS module to display standard timestamps;
this means you can avoid calculating the user offset, but also, it
means that all timestamps are internationalized and translated, and
use the standard view that MW uses in its interfaces.

We can store the user's offset in a RevisionSlider variable so we can
refer to it in timestamp construction, as well as manipulate it in
tests without touching any global user options that may affect other
tests.

Bug: T136825
Change-Id: I67d9859b8f33ab8a217128822e246e7ab67f6511
2016-06-03 13:20:35 +00:00
WMDE-Fisch 1a8a4312de Move dependencies to extension.json
Also removed unused dependency.

Bug: T135198
Change-Id: I1ee53ec9d7e123bdca84701b9557aeeeade815ff
2016-06-02 18:16:23 +02:00
Brian Wolff 39d8d9229a Make files not executable
I know it doesn't matter, but it was kind of bothering me.

Change-Id: Iae9f8b17a3fb5ced362dc2da95e67e20db8af5a5
2016-06-02 13:48:09 +00:00
Leszek Manicki a2774984c4 Make JavaScript code and CSS follow the style guide.
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
2016-05-31 14:57:14 +02:00
addshore 91759f25bd Show useful error if either rev is not in our range
Bug: T135119
Change-Id: I48f3316f2285b987d1a7e4c4a622eb1291de6357
2016-05-12 16:44:34 +01:00
addshore f9471bcfbc If the slider fails to load then fail nicely!
If something goes wrong with the initial api rquest the
slider would either load in a broken state or say that
it is loading forever.

Now a message will be displayed to the user as well
as the error logged to the console.

Change-Id: Id763f31432feb7bd0e9ecbbeb2dd40f7ca6acaaf
2016-05-12 09:46:39 +01:00
addshore b1f6a1df56 add events to history
This allows using browser back and forward buttons
once users have started heading between revisions.

This also updates the URL so that the page can be
reloaded at any time and the same state will be held.
(This also removes a commented out block of code that
I think was left for updating the URL)

Change-Id: I4cfe38f76eeb9e090f0a8a42e22e75cf84014d60
2016-05-12 08:36:28 +00:00
addshore 4835195da9 Add basic usage tracking
Change-Id: I4bde95492ef6483cfd4e4f3c29b1ab7eaeccbc10
2016-05-12 08:36:23 +00:00
addshore be036e757c Re add section legend as a module
Change-Id: I6ad89e2b15435ef35cc1ebddde0f92584ffd9ecf
2016-05-10 19:11:59 +01:00
Jakob Warkotsch 980f2ca917 Create Slider module.
* 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
2016-05-10 17:38:46 +01:00
addshore 3eb7e87879 Add data-revid to all slider elements
Change-Id: I1ae5a98d40342cd581dca5a19caaae283472e2da
2016-05-06 14:59:59 +01:00
Jakob Warkotsch 54720944a0 Create Pointer module.
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
2016-05-06 12:37:01 +00:00
jenkins-bot 8140114a53 Merge "Add localizable placeholder message while loading" 2016-05-04 10:14:01 +00:00
jenkins-bot 08e608b81a Merge "Reserve space for RevSlider to load into" 2016-05-04 10:13:58 +00:00
addshore ba4015ed6b Add localizable placeholder message while loading
Change-Id: I762b03c5af8765b90afee81af750880096db6638
2016-05-03 15:35:39 +02:00
addshore 8490d0f040 Reserve space for RevSlider to load into
Bug: T133275
Change-Id: I97283cfe0798a3bacc42fcb8bc067e74ab085ff1
2016-05-03 15:27:27 +02:00
WMDE-Fisch a0f22fd88b Refactored getSection into Revision class and added tests
Change-Id: I6c6fa5194482c25aa3f2285aebfee11cd713285d
2016-05-02 15:21:40 +02:00
WMDE-Fisch a25d94bc53 Changed tick width and container calculation
Addresses bugs with pointer movements and revision ticks shown.
Changes width calulations to fixed tick width.

Bug: T133280
Change-Id: I3585df472906d482d26155966f2e62c4e7bd3458
2016-04-29 11:02:56 +00:00
Jakob Warkotsch 8c6676f939 Create module for Revision type.
This pulls out some of the code around revisions into a decoupled and
tested module.

Change-Id: Ib2a4f96f0e0b9a96ec85d300d97cd52dcaffe89e
2016-04-28 12:38:24 +02:00
WMDE-Fisch 3884f98479 implement centered and calculated slider width
Slider width is now calculated according to number of revs.
Slider is now always shown in the center of the page.
The width of the ticks depends on the number of revisions per page.

Bug: T133281
Change-Id: I460b2bccff35c9dd6a4c2e5b7e847e2c59f882d3
2016-04-26 17:04:13 +02:00
Jakob Warkotsch 4b35b4d294 Fix all complaints jscs had.
Running `node_modules/grunt-cli/bin/grunt test` does now not throw
errors anymore.

Change-Id: I13a37f4b46c2dc35e35a4f8ec31b300e9d414a49
2016-04-22 17:06:21 +02:00
Jakob Warkotsch 23b5b2f112 Initial commit.
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
2016-04-19 16:35:37 +02:00