The main interface already has javascript enhancement to use
the API and mw.notify. This patch affects permalinks without
tokens, and opening the link without javascript.
This will match the current behaviour of action=watch.
Bug: T130946
Change-Id: I6be2c07824c17b165e068fc4ac36ab192e12bc9d
ArticleViewCustom, EditPageGetDiffText and EditPageGetPreviewText hooks
now marked as deprecated in 1.21.
TitleIsCssOrJsPage and TitleIsWikitextPage deprecation version dropped
from 1.25 to 1.21 to match other hooks.
Bug: T145728
Bug: T147382
Bug: T147383
Bug: T147384
Bug: T147385
Bug: T147386
Change-Id: I59b6b9f253857eb1040dad879a71e0d8cf141553
Diff is not shown on action=history, so the name was not valid.
This module contains only styles, so let's make it explicit in its name too.
mediawiki.action.history.diff module is temporarily left for
backwards compatibility. It should be removed when no longer used.
This also renames docs/uidesign/mediawiki.action.history.diff.html
to docs/uidesign/mediawiki.diff.html.
Change-Id: I7ecc08417c5f1870ed6f2ca139fd953d68f6ec8e
This is more consistent with LoadBalancer, modern, and inclusive
of master/master mysql, NDB cluster, and MariaDB galera cluster.
The old constant is an alias now.
Change-Id: I0b37299ecb439cc446ffbe8c341365d1eef45849
Deprecated the former. It's only used in 2 extensions (both active),
so we can probably get rid of this within a single release cycle.
Change-Id: I39bef62556f8f0625a5741d54f9f84d15b50610d
The default value (false) was not handled by the recent depreciation warnings
in 037f056, and was triggering the last warning. This removes this warning.
Change-Id: If7fe92d874eb10525a72f6d3a97f00117c79acc1
Now with less fatals and more functionality! At least I sure hope so.
Unlike the first time around (https://gerrit.wikimedia.org/r/206642), the
DifferenceEngineRenderRevisionAddParserOutput and
DifferenceEngineShowEmptyOldContent hooks now only affect things if a
hooked function returns false. Since by default nothing is hooked into
these brand new hooks, the behavior should stay exactly the same as before
this patch and things like bug T139435 shouldn't happen anymore.
These hooks allow things such as:
* adding CSS(/JS) into the OutputPage when viewing diffs
* adding extra HTML content (such as avatars) into diff views
* hiding the bottom "mark as patrolled" link
* altering the parser output that is used by DifferenceEngine
* and more
Example extension using these hooks is wikiHow's
/extensions/wikihow/hooks/, specifically the file DiffHooks.php (but the
hooks are setup in WikihowHooks.php).
Live example of the DiffHooks stuff in action can be found at wikiHow.com,
for example:
http://www.wikihow.com/index.php?title=Set-Your-Homepage&diff=17112892&oldid=15888129
(user avatars, additional CSS, changes to the old/new revision header
texts/links)
Bug: T139526
Change-Id: I10293be4581140c3edf0e4b538b04b31cb6f5730
If wikidiff2 is installed, use it for diffing without requiring
$wgExternalDiffEngine to be set to 'wikidiff2'.
Also add some extra sanity-checking by coercing all non-string values to
false and make sure the custom diff executable passes `is_executable()`.
Change-Id: I32b670ebf613be9f1c034d65d006829a215614da
These hooks allow things such as:
* adding CSS(/JS) into the OutputPage when viewing diffs
* adding extra HTML content (such as avatars) into diff views
* hiding the bottom "mark as patrolled" link
* altering the parser output that is used by DifferenceEngine
* and more
Example extension using these hooks is wikiHow's
/extensions/wikihow/hooks/, specifically the file DiffHooks.php (but the
hooks are setup in WikihowHooks.php).
Live example of the DiffHooks stuff in action can be found at wikiHow.com,
for example:
http://www.wikihow.com/index.php?title=Set-Your-Homepage&diff=17112892&oldid=15888129
(user avatars, additional CSS, changes to the old/new revision header
texts/links)
Change-Id: Icbc987fa4806e7bfc66743375301912b428dc348
Javascript used to look just for the patrollinks class, which
could be set by the user in order to patrol an arbitrary page.
Bug: T103239
Change-Id: I13fcc3ce479c0a4a90a6217c2e5244f051eaf862
Signed-off-by: Chad Horohoe <chadh@wikimedia.org>
E.g. if you have $wgExternalDiffEngine = 'wikidiff2' but after
a PHP update you no longer have the module you still shouldn't attempt
to shell out to some nonexistent wikidiff2.
Bug: T74030
Change-Id: I745cd1cb2e152f4fbb95c8f782d70117f8c844f1
It's been unmaintained for a while and does not support
various languages adequately.
Also, document $wgExternalDiffEngine.
Change-Id: Ia8aeffd79d550fb7a1a7121456940446eea8bd4f
Using IContextSource avoids the use of $wgLang and wfMessage which make
use of global $wgTtle.
Add IContextSource as parameter to ChangeTags::formatSummaryRow to avoid
globals. Define an IContextSource instance in all functions which
reference ChangeTags::formatSummaryRow and pass it in ChangeTags::formatSummaryRow
function call.
Also make the default value of IContextSource $context as null in
parameter, to avoid breaking changes for old callers in extensions.
Document default null value of IContextSource and add a @note to prefer
IContextSource over null value.
Remove trailing whitespace, and make code order according to parameter
order.
Bug: T105648
Change-Id: Ib54a6a96b73f6cd8fcdf8e520db2448a1e811cfa
* Move the main logic from DifferenceEngine::markPatrolledLink() to
DifferenceEngine::getMarkPatrolledLinkInfo(). Returning an array of
information instead of a complete HTML string.
Bug: T101491
Change-Id: Id09ccf60aec9b693d7df648a6dfcde629545f620
Follows-up 9cfb9cb9fb, and b62f0e9156.
Add data-mw="interface" to elements created by the interface
(e.g. not user-generated content) and use this to narrow down
scope of elements eligible for JavaScript binding.
This avoids bugs where e.g. the diff hook triggers on a wiki page about diffs.
This isn't a security issue per-se, but causing odd behaviour.
Also add missing tests for data-ooui filtering (follows-up aa9a52da).
Change-Id: I9a0c86c92d411538bd9e203ec6ae54616fdf49b8
The next revision in the page history isn't necessarily the previous
revision (due to selective undeletions, history merges, etc). This
passes the next revision to HistoryRevisionTools so extensions can check
if needed. Also, it passes the user to this hook and DiffRevisionTools
to avoid use of wgUser or having to retrieve context.
Change-Id: Ibc68f19040eebe3614e07f753f26bbfd376ae28d
These callers don't need to do purges, but can still perfectly
take advantage of this instance over a plain BagOStuff. Namely:
* Replication and snapshot lag awareness
* Preemptive regeneration
* Easy process cache support
The idea is for there to only be one caching class/factory
to use, instead of having rules for picking which one to use.
Change-Id: I8e362df451c0c28731fc853c044c4c4b8e097f01