Commit graph

189 commits

Author SHA1 Message Date
jenkins-bot a5d4bec8fd Merge "Use href attribute to calculate titles" 2015-04-07 10:04:55 +00:00
wctaiwan 642bdf013e Use href attribute to calculate titles
This is needed for wikis that use LanguageConverter, since the title
attribute is converted to the user's variant, and the canonical title is
needed for the API unless converttitles is specified.

For filtering, instead of comparing linkHref and expectedHref, filter
out links that have other query parameters or aren't in content
namespaces.

Bug: T93605
Change-Id: I5534753307ed5e1d4b27c52c616fd143b2a397e1
2015-04-06 05:55:25 -04:00
jenkins-bot e6d43ccc16 Merge "logger: Add a sampling rate of 10" 2015-04-06 09:21:50 +00:00
jenkins-bot e21d08e0d0 Merge "Implement the new schema for when the popups are disabled" 2015-04-06 09:19:03 +00:00
jenkins-bot 0ff656a892 Merge "Implement the new schema for when the popups are enabled" 2015-04-06 09:18:16 +00:00
jenkins-bot 7fe8f5d45f Merge "Add icon and link to qualtric survey if $wgPopupsSurveyLink is defined" 2015-04-06 09:03:26 +00:00
Prateek Saxena 8fbacb9040 Add icon and link to qualtric survey if $wgPopupsSurveyLink is defined
The link to the survey is added in Ic445732197e6abeba459b40b1416d8a71bc23bd6

Bug: T1005
Change-Id: I24bfd5fd622d1afc4372dbd4bfca3879927b0c17
2015-04-02 15:29:15 +05:30
jenkins-bot 37f1c00629 Merge "renderer.article.getProcessedElements: Stop escaping the title and the extract" 2015-03-27 18:45:54 +00:00
jenkins-bot d478a820a9 Merge "Rename popups.eventLogging to popups.logger" 2015-03-27 13:18:32 +00:00
Prateek Saxena f4dbd455c6 logger: Add a sampling rate of 10
This rate was decided in T88173

Bug: T88167
Change-Id: I22776582c271fa83ba5b98d38dd01775ebbfcef1
2015-03-27 04:35:12 +05:30
Prateek Saxena c39bbc8a68 Implement the new schema for when the popups are disabled
Bug: T88167
Change-Id: If8f1c97379bd37958ec6064242bdebf5fde14b47
2015-03-27 04:34:58 +05:30
se4598 946b4f4926 Do API queries after API_DELAY
Based on the comments this is what it supposed to be.
mw.popups.render.article does the API-queries on init, so do that after
the API_DELAY-timer fired.

Change-Id: Ia235cbe1eb86fc774edda84208d320843401624e
2015-03-26 15:03:38 +01:00
Prateek Saxena 20f2bef272 renderer.article.getProcessedElements: Stop escaping the title and the extract
Both the title and the extract were being html escaped thus producing
string like ' and " when used with .text(). So, we now use
document.createTextNode() for the normal text and .text() with the bolded
one.

Bug: T93720
Change-Id: I6bbc52e427dc636b7b0be1ad4f749d9273ff61b3
2015-03-26 19:28:20 +05:30
jenkins-bot 1572bcf150 Merge "settings: Use .text() instead of .html() for option's label" 2015-03-26 10:34:41 +00:00
Prateek Saxena 2971d90831 Implement the new schema for when the popups are enabled
Bug: T88167
Change-Id: I38c9e474e0ec7da45af8338a458430e5d7427463
2015-03-26 11:42:39 +05:30
Prateek Saxena d49cfb9b65 Rename popups.eventLogging to popups.logger
...and eventLogging.logEvent to logger.log

Change-Id: I9af697a56c2248069a32ac586f5b78b55095460e
2015-03-26 04:56:29 +05:30
Prateek Saxena 3b82fb60d9 settings: Use .text() instead of .html() for option's label
Bug: T88171
Change-Id: I5d4631870f916194901f897839cad4c90c2d8d01
2015-03-24 13:37:05 +05:30
Prateek Saxena 42d0347582 renderer.article: Ignore thumnail if the URL has suspicious characters
If the URL of the thumbnail has suspicious characters like ', " or \
return a <span> instead of trying to render a thumbnail.

Bug: T88171
Change-Id: Ide052ea2a7de166599d077a385a6e788bfa63302
2015-03-24 13:31:19 +05:30
jenkins-bot 5bdfbc6802 Merge "renderer.article: Don't apply tall/not-tall classes if the image wasn't shown" 2015-03-16 10:10:10 +00:00
Prateek Saxena 3eaf2829e8 renderer.article: Remove leading spaces before brackets
Bug: T69225
Change-Id: I83f79fa0ebd19bea6ed7ea266cece0778210adb2
2015-03-05 15:32:45 +05:30
Prateek Saxena df0b988eec renderer.article: Bold the title no matter what the trailing characters
Bug: T69229
Change-Id: I833c0dcae98010bc74b6b58ae8035aaac4e6465b
2015-03-05 15:31:42 +05:30
Prateek Saxena a43ef7ca51 Remove the need of .html in article.getProcessedHtml
Instead of replacing all instances of the title in the extract -

  '$1<b>$2</b>$3'

We now put symbolic strings there which we use to split the string
and then make an array of text and <b> elements that get appended
to $contentbox.

Bug: T76378
Change-Id: I02222bbff84532f63cac67af1bf889c328ec6ff2
2015-03-05 15:30:06 +05:30
Prateek Saxena e5880ffd40 renderer.article: Don't apply tall/not-tall classes if the image wasn't shown
Bug: T91433
Change-Id: I4499cc18e140c0bd18ee3731496aa427232922b4
2015-03-05 13:24:35 +05:30
se4598 9974a75b50 Improve mw.popups.selectPopupElements
Use proven technology to create and compare URLs.
This will display popups also on anchored links again.

Change-Id: Ic010ca027017435f666782e709e641cf3bbb8767
2015-03-04 17:21:37 +05:30
se4598 64195b8ff7 fix mw.popups.selectPopupElements
Hotfix for Ie34064860a81c7866b8e8b86858d2e12a8a196f4
Still won't show up popups for anchored links, but dunno if intended. 

Change-Id: I91a15153cb8bcae6d8ef2e5616855e4d45be6d78
2015-02-24 00:14:02 +01:00
jenkins-bot 782d9e37ba Merge "eventLogging: Use generateRandomSessionId" 2015-02-20 11:06:01 +00:00
jenkins-bot fd5cc437a3 Merge "Add a check for the EventLogging library before the logEvent call" 2015-02-20 11:03:32 +00:00
Prateek Saxena 44c57834b1 Disable Navigation Popups on render rather than document load
Bug: T64952
Change-Id: I7985341006d587671077f3dc32dd02e8dfb38972
2015-02-20 11:54:17 +01:00
Prateek Saxena b4cfa5c6d5 Add a check for the EventLogging library before the logEvent call
Bug: T70341
Change-Id: Idae926b1ddce544ab37b95018abc13879f515f71
2015-02-20 11:49:39 +01:00
Prateek Saxena 37442e6457 eventLogging: Use generateRandomSessionId
Bug: T88919
Change-Id: Ib859db7f55358d0cbd9f26b25d9fe96b76e718e9
2015-02-20 11:48:36 +01:00
se4598 45cf9c13e7 core: Better article link detection
Use the getUrl method to check that the <a> actually links
to the article that it has the title of. Only those elements
are returned by selectPopupElements.

Bug: T70039
Bug: T72512
Change-Id: Ie34064860a81c7866b8e8b86858d2e12a8a196f4
2015-02-18 17:02:14 +05:30
jenkins-bot 2fd9ac3569 Merge "Access native a.href property instead of attribute" 2015-02-18 10:33:55 +00:00
jenkins-bot f8e7b47bd9 Merge "core: Add missing leading '.' to oo-ui-buttonedElement-button in IGNORE_CLASSES" 2015-02-18 00:15:18 +00:00
Thiemo Mättig ddab3f9fd7 Access native a.href property instead of attribute
This is a subset of patch Ie340648. If reviewing and merging the much
larger other patch (it does much more things) is a problem, we can
merge this first, rebase the other one and have a much more focussed
discussion.

Change-Id: I4549fb1810c7dd36df8a70983d9508015c2bfadf
2015-02-17 15:03:13 +01:00
Prateek Saxena 7a51668e56 core: Add missing leading '.' to oo-ui-buttonedElement-button in IGNORE_CLASSES
Follows up I418508fad97e81127084150221e10ccec418167a

Change-Id: Ib3c187feeb8de053416bb3ef131c8f5cfedf0c63
2015-02-17 18:19:11 +05:30
Thiemo Mättig bf4016ecf1 Fix TypeError on <a> with no href
HTML5 allows <a> elements with no href="..." attribute. We do this in
Wikibase/Wikidata in a few places. Hovering these <a> elements causes
TypeErrors.

This is a hotfix. Please see Ie340648 for a much more advanced fix.

Change-Id: Ib20ef8348c964a6ba736d0fc76909fd4d496c11e
2015-02-12 15:37:37 +01:00
jenkins-bot 72362616a2 Merge "settings: Add help dialog" 2015-01-21 16:47:19 +00:00
Prateek Saxena 9c1c62ce05 Fix event logging issues
- Don't prevent the link click event.
- Check with the currentLink element rather than jQuery selectoin.
- Add click handler to images (used to be only extract).
- Stop the 'closePopup' if 'reset' has already been run.

Bug: T86378
Change-Id: I8748ecffe55954425656c5103fa9ddc99b6f3f72
2015-01-13 18:48:02 +05:30
Prateek Saxena f7d5f890b6 Re-position #mwe-popups-svg out of the view port
This <div> had been sitting visible at the bottom of the page
and went unnoticed till it caused problems with the ContentTranslation
extension.

Hiding it using 'display: none;' causes issues with the masking
of the images, thus putting the div out of the view port.

Bug: T76718
Change-Id: I731128c827aa093e0ffab52dc378aea386b0bb3c
2014-12-29 14:44:39 +05:30
jenkins-bot dbd3f6ff2b Merge "Make ':after' triangle larger so that the border of div is covered" 2014-12-03 15:37:00 +00:00
jenkins-bot eb7fb53baa Merge "article: Fix distance between image and text (landscape image & non flipped)" 2014-12-03 15:36:53 +00:00
jenkins-bot 1b6eaddba0 Merge "Reduce max height of text extract" 2014-12-03 15:33:21 +00:00
Prateek Saxena b24e39e9fc Run mw.html.escape on page extract and title
Add test for XSS attack

Bug: T69180
Change-Id: I213169bd9daed979e63f50cf3926f7196eb6181c
2014-12-01 11:23:14 -08:00
Prateek Saxena 9ab483ec6f settings: Add help dialog
Change-Id: I5f4cf435356748a1aceb05fcaf8c8980b8267804
2014-11-26 11:43:01 +05:30
jenkins-bot 895b6dfae0 Merge "Add rule to not show thumnail if its smaller than the card" 2014-11-23 20:07:41 +00:00
Prateek Saxena 77538a1001 Reduce max height of text extract
Currently .mwe-popups-extract keeps some empty space after the last
line. This shifts a little when zooming in causing part of the text
of the next line to be visible. Reducing this to have lesser extra
empty space solves the problem.

Bug: 73551
Change-Id: I968fca23fe2de04cb3f73ba4e7d4f676fbf88536
2014-11-20 14:54:14 +05:30
Prateek Saxena 24a7d02080 article: Fix distance between image and text (landscape image & non flipped)
Change-Id: I4fb6891cd89546b6a55b6952be7e1a6df41fa0b5
2014-11-20 11:46:37 +05:30
Prateek Saxena cbebde39b9 Make ':after' triangle larger so that the border of div is covered
When zooming in the border of the div is visible over the :after
pseudo element.
 - Update top and bottom triangle mixins to include @extra argument
 - Update pseudo elements to use the new mixin and position them
   correctly according the extra size

Bug: 73550
Change-Id: I05b9c74a675c69e407c4c78771504f447da754c5
2014-11-19 11:12:12 +05:30
Prateek Saxena 45172f1f7b Increase z-index of hovercards from 5 to 110
Hovercards is currently at 5 z-index which causes
it to be rendered behind the compact personal bar.
Changing this also effects the border triangles and
masked SVGs, thus incrementing them too.

Bug: 72882
Change-Id: Ib3c889c748a9c919754d8281e68fd0664db7c408
2014-11-12 14:39:47 +05:30
Prateek Saxena 0a7d7573fa Add rule to not show thumnail if its smaller than the card
Added two conditions based on portrait and landscape sizes.

Bug: 73009
Change-Id: I022267430b540be48952f0cfc8dc0cf962cd13d5
2014-11-11 10:23:34 +05:30