The script depends on a title being present in title attribute. So
skip links without title attributes (which were getting empty
attributes due to the implementation of removeTooltips) and bail on
trying to open a preview for links without a title.
Bug: 67728
Change-Id: I4cc744bea10af34741681f11e03d77b3d53e3a3b
These links were not ignored due to a typo. This also threw an error,
because these links produced query.interwiki and not in query.pages.
Change-Id: I3b5c5b900209323e3e72b41e3b02e90f1f53b4eb
The title here is not percent-encoded or anything, it's just text.
Calling decodeURI() can cause errors to be thrown if it doesn't happen
to be a valid URI.
Bug: 64236
Change-Id: Iee7c1db0c01cba405f0a2a03b0de58e9edb9a171
Previously we would wait 150ms if the data was cached,
or 50ms + [API request time] if it was not.
Using some promise magic to achieve this without decreasing
performance. The behavior of sendRequest() was changed a bit.
Bug: 64235
Change-Id: Ibe6e1a5f4ac02f538dac686476ac95ba506a1a86
The old version would iterate over all links on the page (try that on
[[Barack Obama]]), the new one should be optimized by the browser and
poly-filled by jQuery if unavailable.
We can't do `:not(.extiw, .image, .new, .internal, [title=""])` –
while some browsers support it, CSS specification doesn't allow
compount selectors inside :not().
Change-Id: I0e4b18752905604ebf1b7f41a9b7ac2edd8b42e0
* Do not escape double-quotes in single-quotes string
* Remove repeated <defs/> tags, one is enough
* Reindent
Change-Id: I6a5b53384b8d5604bee11cb993d040282accf999
Browsers like Safari and IE9 alias <image> tags to <img>
tags and thus don't display hovercards correctly. By creating
the `image` in the svg namespace we solve this problem.
Bug: 62985
Change-Id: Iff92d59ea231d1208eea149cc8c182a5fe87701a
* Consistant whitespace after keywords
* Misc whitespace cleanup as per JS coding guidelines
https://www.mediawiki.org/wiki/Manual:Coding_conventions/JavaScript
* pass mw to IIFE and use the function arguments close to function body
( function ( $, mw ) {
...
}( jQuery, mediaWiki ) )
* Moved prefined moment to .jshintrc. Move browser:true too
Change-Id: If488974e8e5987916bc4043e4e70bb6c60472b30
Prevent popups from showing up when the mouse cursor accidentally
ends up hovering a link after scrolling.
Change-Id: I07a95d9eabdc22a045a97b07f98fb0d632a276c1
- Only text popups
- Portrait popups
- Landscape popups
Had to convert the landscape popup's img into an svg:image
too. 2 new SVG masks were made to take care of the flipped
states.
Change-Id: Ib30bb7f5ff9857f6a470b07db05ab50fb0ca8a5d
* Triangles using the border hack for the white part of the popups
* SVG clipPath on FF and Chrome, using SVG <image>
* Fallback to <img> on browsers with not SVG support
Change-Id: I3b1226051436652edbffe4642176c9a0e405243c