I mostly refactored what's there. Instead of replacing parameters in specific links,
I'm going for the parent menues where these links live in and replace them completely.
Thereby I could also merge the edit and ve-edit selectors.
Also adding the footer that includes the link to the mobile view and seemed missing.
Bug: T211557
Change-Id: I263c82e80c675918683340d1bb01291213797f9f
Also use the selector
'.catlinks[data-mw="interface"]'
instead of
'#catlinks'
like in mediawiki.page.preview.js. This prevents selector injection by
the wiki content.
This change allows consuments of the hook 'wikipage.categories' to work
together with RevisionSlider.
Change-Id: I274e3d3b8ac94cc21c7b0878425c9a785a09b964
The selector '#mw-panel' from skin Vector and some other skins is not
stable to use and not available on other skins like Vector-2022.
The update of '#mw-panel' breaks CollapsibleVector: T211557.
Using $( '#t-permalink' ).parent() is also a dirty hack but it probably
works on all skins.
The .parent() also updates siblings like '#t-urlshortener' from
extension UrlShortener.
Also add $( '#ca-delete' ).parent() to update the other portlet links.
Bug: T211557
Change-Id: I084c93e8fe7c7663d9de8a39433a9e92a3827196
The `[data-mw="interface"]` in the selector prevents selector injection
by the wiki content.
The `.length` prevents unneccessary calls with emtpy list.
Change-Id: I434371539355e305d9faf569371ab5a686b2caff
This code was added in 2016 via Iadf7793. The two CSS classes
.mw-revslider-older-diff-column and .mw-revslider-newer-diff-column
became unused only one month later via I317a2fc. Since then all
this is apparently dead code. There are no "top borders" on these
columns any more. Lines still appear in the same position, but as
"border-bottom" on other elements.
It really looks like we just forgot to remove this.
Change-Id: I627628fa44da96ca1f1301d3a879919e4a021e5b
Reintroduces IIFE closures in test files because variables were
declared in the global namespace, and "const" now causes hard errors.
Bug: T339323
Change-Id: I69e9d7a29591137f185f3e5ab02dea590ec4dff6
I'm not sure why it was done like this. It looks like we can skip
both the extra conditional as well as the extra function scope.
Change-Id: I9aebd17bece0b9a573fc1f9697e79b759741751e
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
… 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
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
This is a direct follow up to the change done in I885f8e7. I found the
code very hard to read after the change, and tried to rearrange it a
little bit. This is what I came up with. What the code does is entirely
untouched.
This also rearranges the replaceWith calls so the replacements are done
from top to bottom.
This patch also avoids calling mw.config.set multiple times.
Change-Id: I1cbce8e8aa030d6ba5cd7d19ab26fa363e13474b
`$.fn.replaceWith` removes content from the DOM. Therefore, the
new content object was not being passed on by the hook.
Change-Id: I885f8e789b806a9ae09de1ed31a19a3f9db8144f
Several improvments including documentation, naming and refactoring:
- bundeling of methods setting, redrawing and loading new diffs
- renamed and improved documentation around some methods in that area
- fixed some leftovers from past refactoring not using new methods
Change-Id: Idf1afcd6ce9210951d28655128a47150f6b7a2aa
This patch fixes issues with the RevisonSlider assuming that the higher
revision id belongs to the newer revision. Min/Max methods to decide what
the diff and what the oldid is are removed and the usage of methods is
adjusted accordingly.
Also the test for switchover pointers is removed since this will not work
with the patch.
Bug: T164455
Change-Id: If5d9cbb8ebd872aee376d249942e6881c8edb984
The meaning of first in this context was totally unclear and not
very usefull. It turns out, that the "first" revision is always
the oldest and the last is always the newest revision.
Change-Id: I009438777908a5f4a8833f8f5cb7d3041057741c
Since IE8 support is dropped, remove hint for incompatibility.
Hint for IE9 is kept to keep track of possible issues.
Bug: T123218
Change-Id: I0fd066dbc22f603da733dcfa339e5af3ffbde41f
This now attaches the revisionslider to the
older and new links that are by default in the
diff.
This means when clicking them the revision slider
will use an ajax call to reload the diff (while moving
its own pointes) rather than reloading the whole page
Change-Id: I11fa92828140f980ca8edee27403a4e2a5f5a6a7
Tabs are hooked up to JS events which will break
if they are replaced, just switch out the oldid
in the edit link as that is all that changes.
Change-Id: Iea073f8d435a511ba91cdc0c7bdb9e8f1ec1d4ac
Adding position data-attribute to the pointer elements and always
apply the same value as for the revision bars they are pointing to.
This will allow us to reduce the complexity of browsertests.
Bug: T146276
Change-Id: I6e6db55204b0c45fe94a5173e297a67a7ed38d00
Also add a note to the console about WikEdDiff
& RevisionSlider interaction and the required code
change.
As the code change uses the wikipage.diff hook the code
change will actually have no effect until this patch
is deployed, which includes the removal of the hack
for WikEdDiff.
Bug: T142636
Change-Id: Ie88021abb2325cc6259cf2fb041fbdca4ae9ca89
Depends-On: Ie488021f5d0e314a8ad6c8d1f1f3d936c427d719