Commit graph

217 commits

Author SHA1 Message Date
jenkins-bot 0fec4def5a Merge "Remove dead space" 2015-10-14 17:35:23 +00:00
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 eaf71a1d4b Merge "ext.popups.renderer.article.js: Use mw.RegExp.escape() for RegExp escaping" 2015-10-14 00:31:07 +00:00
jenkins-bot 68500e7256 Merge "Check renderers' matcher method to find the appropriate renderers for a link" 2015-10-14 00:30:16 +00:00
Prateek Saxena ba919e5d0a settings: Remove navPopEnabled property
This doesn't need to be a property. Its being used exactly once, and
because we try to test for NavigationPopup's availability so soon we
mostly get an incorrect answer.

Moving the condition to the render method instead. Chances of NavPop
being loaded when the settings' screen is being rendered are much
higher.

Bug: T109912
Change-Id: I3723dc1e3e9400b6ed2e0160104c849a25a71881
2015-10-08 00:11:28 +05:30
Fomafix 7ac7a2abd1 ext.popups.renderer.article.js: Use mw.RegExp.escape() for RegExp escaping
mw.RegExp.escape() is already used in ext.popups.core.js and
the dependency to module 'mediawiki.RegExp' is set.

Change-Id: Iaa7ab6902693c787234fd589276fa38ce75b82da
2015-10-02 20:58:26 +00:00
Prateek Saxena 93ef48221e Check renderers' matcher method to find the appropriate renderers for a link
Right now the main renderer always picks the article renderer, no matter
if any other renderers is registered. It will now run the 'matcher'
method in the rendered, and if it returns true, we use that renderer.

Not sure how we'll avoid matchers stepping on each other.

Bug: T69434
Bug: T102921
Change-Id: Ib06812836cdbd3a5bfd54d4bc6147012fb891694
2015-10-01 10:56:15 +02: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