Commit graph

10 commits

Author SHA1 Message Date
Jdlrobson 4b53afc983 Don't hit the DB unnecessarily
If $wgRelatedArticlesShowInFooter is false, then we'll still test
whether or not the page is a disambiguation page with the Disambiguator
extension. Unfortunately, DisambiguatorHooks::isDisambiguationPage hits
the DB.

Order the tests in RelatedArticles\FooterHooks::onBeforePageDisplay from
least expensive to most expensive so that the DB is queried only when it
must be.

This version of the patch takes into account namespace.

Bug: T127068
Bug: T144409
Change-Id: Ie6ddaa4e9bd8326c8b84dc400b78e9a4f4d0d78d
2016-08-31 20:13:05 +01:00
Jdlrobson 9e67ef6590 Revert "Don't hit the DB unnecessarily"
We forgot how namespaces work:
Catchable fatal error: Argument 1 passed to RelatedArticles\FooterHooks::isDisambiguationPage() must be an instance of RelatedArticles\Title, Title given in /srv/mediawiki/php-master/extensions/RelatedArticles/includes/FooterHooks.php on line 48

This reverts commit 9ede8913c7.

Change-Id: If0f1481854815c12613771041685c7837a95ec65
2016-08-31 18:57:41 +00:00
Sam Smith 9ede8913c7 Don't hit the DB unnecessarily
If $wgRelatedArticlesShowInFooter is false, then we'll still test
whether or not the page is a disambiguation page with the Disambiguator
extension. Unfortunately, DisambiguatorHooks::isDisambiguationPage hits
the DB.

Order the tests in RelatedArticles\FooterHooks::onBeforePageDisplay from
least expensive to most expensive so that the DB is queried only when it
must be.

Bug: T127068
Change-Id: Ie3e7e410026cf354d831ae3c2134cfc0957eb8db
2016-08-31 09:38:34 +01:00
Baha b486500ba5 Add documentation
Bug: T127068
Change-Id: I5b640f8fe90cb2b07e7e5113e5dff398684c0c68
2016-08-29 15:59:57 -04:00
Sumit Asthana cea66f6cda Disable related articles on disambiguation pages
Uses DisambiguatorHooks to prevent related pages module addition on
disambiguation pages.

Bug: T127068
Change-Id: I166712d7e5df26ad00c725f3e4fe23ec074b3329
2016-08-24 04:12:45 +05:30
Kunal Mehta d8329fdbb1 build: Updating mediawiki/mediawiki-codesniffer to 0.7.1
Also added "composer fix" command.

Change-Id: I3de1f2562898b76b56f5e7aa36b61088331ff52c
2016-05-09 16:59:15 -07:00
Baha cfc73ff5c9 Remove the isElementInViewport function
Use mw.viewport.isElementInViewport instead.

Bug: T124317
Change-Id: I621aa4c21d673d8d431bb38ba094271b570ca93c
2016-04-07 12:23:38 -04:00
Baha f4400ec5c9 Fix RelatedPages placement in Monobook
* Load skin specific styles only in that skin;
* Vector styles are default for all skins unless overwritten;
* Allow monobook styles to inherit from vector styles;
* Do not load visual editor related rules in minerva;
* Remove an unused CSS rule.

Bug: T126149
Change-Id: I1e657de7a45fb4812c42ca7b99624b585dc4b7dd
2016-02-23 14:13:09 -05:00
Sam Smith 040314c504 Configure footer and sidebar placements
Changes:
* Rename $wgRelatedArticlesShowReadMore to $wgRelatedArticlesShowInFooter
* Add $wgRelatedArticlesShowInSidebar, which is truthy by default, and
  short circuit the SkinBuildSidebar and SkinTemplateToolboxEnd hook
  handlers if it is falsy

Bug: T119926
Change-Id: Idf04bf3221ba44d7b898160764fbd6ba83561abb
2015-12-02 11:17:54 +00:00
Sam Smith 9157e303d2 [Hygiene] Reorganise hooks to reflect placements
There are two positions where the list of related articles is rendered:
the sidebar, and the the footer. Move the hook handlers related to
rendering the former to RelatedArticles\SidebarHooks and those related
to rendering the latter to RelatedArticles\FooterHooks.

Change-Id: Idde57905d828e63309bfdc360a3a09e64e291304
2015-12-02 11:10:04 +00:00
Renamed from includes/ReadMoreHooks.php (Browse further)