Commit graph

211 commits

Author SHA1 Message Date
Baha 7c6ccb3d1a Remove dead space
Make sure the popup is displayed right above or below the link.

Bug: T68317
Change-Id: Ib6ba9f1ffc5244842a1535937aa0990eae6943ae
2015-10-14 15:49:39 +05:00
jenkins-bot 486e34fb38 Merge "Move the article renderer in to the renderers property" 2015-10-01 08:50:39 +00:00
Prateek Saxena 1565a1d3c9 Move the article renderer in to the renderers property
To allow multiple renderers (for different types of content)
to be defined.

Change-Id: I50320646e26f36a0a2bc425c82ccc58912840f84
2015-10-01 08:48:00 +00:00
Baha 495014a917 Feature detect SVG support
'document.implementation.hasFeature' has been deprecated and is not
reliable. See
https://dom.spec.whatwg.org/#dom-domimplementation-hasfeature

Bug: T113200
Change-Id: I5901768d8c8642caac31884c5e9ac5b6ac74d035
2015-09-30 22:36:03 +05:00
jenkins-bot 2652cd325a Merge "core.less: Visual refinement & drop shadow" 2015-09-23 22:24:03 +00:00
Brion Vibber d90c492275 Hi-DPI/Retina support for hovercard images
Requires core changeset Ic9cb1654 for $.bracketedDevicePixelRatio()

Bug: T97935
Change-Id: I452b87a90769463328840c6c7e46b583e6148439
2015-09-09 15:40:33 +02:00
Prateek Saxena 6eef4f325b Add jscs and jshint tasks to the Gruntfile
Adds the jscs and jshint packages for development and their tasks in
Grunt. Also fixes all the code convention errors.

Change-Id: If1c9dfdbe22d4912d78b6a51b1292866970a85cc
2015-09-04 13:57:52 +05:30
jenkins-bot b1dd60ccf5 Merge "Use pg.fn.disablePopups to detect and stop NavigationPopups" 2015-08-27 20:17:37 +00:00
Timo Tijhof 41c12d3f9a Remove stray ")" from the "Enable previews" link
Follows-up dd98179a15.

Change-Id: I07b039dae272c9e66f091dd07b6e9b7d20b6d275
2015-08-27 03:06:20 +02:00
Prateek Saxena 1270c240c9 Use pg.fn.disablePopups to detect and stop NavigationPopups
The global disablePopups function from NavigationPopups got scoped to
pg.fn.disabledPopups at some point. We were relying on that function
to both detect and disable the gadget.

Bug: T109912
Change-Id: I3d6de60ca2a387e45675ddb04cdc45b0f967e46a
2015-08-26 16:52:22 +05:30
Prateek Saxena 947f644991 Move all images to resources/images
Change-Id: Iac712668baf8cefedf036c4d479687e3f5da5a46
2015-07-18 22:27:18 +00:00
Prateek Saxena 51884d39e9 renderer.article: Increase exsentences to 5 in the API call
Bug: T93160
Change-Id: Ie61555b845ab2207aa62040f6d5e13b490e53e15
2015-07-08 18:30:45 +05:30
Prateek Saxena d0486550e9 Add maxage, s-maxage and uselang parameters in API call
Bug: T97096
Change-Id: I8b4a21b725d25c704eedf3c29ea139a777327a4c
2015-07-03 04:30:57 +00:00
S Page 6c53f13845 API query improvements
Don't request unused prop=info and its rvprop=watched;
use formatversion=2 instead of indexpageids to simplify processing the
returned query object.

Bug: T103981
Change-Id: I1c0f9b0245a823413f5fed78bc1d0d46ef978cef
2015-06-26 03:57:34 -07:00
S Page 4ac8f1b48b Use actual booleans in API request
Popups' API query request specifies the string 'true' as the value for
some boolean request parameters, but that's functionally identical to
specifying boolean true -- both get encoded as param=true in the HTTP
request.

Change-Id: Icc5f4b8ef6faaffe4a23c964f8cd8c2582d28381
2015-06-26 03:49:55 -07:00
Fomafix 7713e343fe Replace 'jquery.mwExtension' by 'mediawiki.RegExp'
Replace $.escapeRE from 'jquery.mwExtension' by
mw.RegExp.escape from 'mediawiki.RegExp'.

Bug: T103610
Change-Id: I1d23e4c02d92828291b98a52b4e8050fbebc06d9
2015-06-26 07:48:18 +00:00
Prateek Saxena 03f4fa63b2 core: getTitle: Return undefined for non URI links
mw.Uri throws an exception when dealing with -

    href="javascript:void(0);"
    href="mailto:abc@example.com"
    etc.

Using a try…catch to return undefined in this case.

Bug: T95215
Change-Id: I632e9dc0e70a5fddf9f2573572bfc8e7f6232923
2015-04-21 19:19:43 +05:30
jenkins-bot 4438a92585 Merge "Reduce font-size of timestamp text" 2015-04-17 08:11:43 +00:00
jenkins-bot f6b32a7963 Merge "Update font-size and line-height" 2015-04-17 08:11:35 +00:00
Prateek Saxena 503356d33c Reduce font-size of timestamp text
Bug: T96343
Change-Id: I653018e0a653ef8c25a336e73b5ff46eceed119a
2015-04-17 12:50:50 +05:30
Prateek Saxena 4ba7ec87a1 Update font-size and line-height
Bug: T94957
Change-Id: I8f67a5e43bcd0f0de22c03323585414adfa12944
2015-04-11 19:23:57 +05:30
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
Prateek Saxena 5ee43d6b3e core.less: Visual refinement & drop shadow
This what it looks like -
https://phabricator.wikimedia.org/T78641#984753

Bug: T78641
Change-Id: Id59acba49963eb02626444f91b716c53c1bef7b4
2015-03-04 16:45:56 +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