Commit graph

190 commits

Author SHA1 Message Date
MatmaRex
cd5f0d63fa Show change tags on diffs
This adds two very simple queries for every diff page view.

It could be made to only add one (loading tags for both revisions at
once), but it would be a little ugly.

It could even be made to add zero, but this would require either
rewriting and duplicating a lot of code here and constructing
Revisions by hand or making the Revision itself know about its tags.

Bug: 25824
Bug: 49602
Change-Id: Ic2ae58c703db7ceee5de4b320229d8c93810a73b
2013-07-06 23:02:31 +02:00
jenkins-bot
7844c9a058 Merge "DifferenceEngine: Don't display empty header row" 2013-06-26 22:13:06 +00:00
MatmaRex
7599f1a49b DifferenceEngine: Don't display empty header row
This prevents a gap from appearing, and the resulting code will be
slightly cleaner as well.

Shouldn't matter in core, but does matter for extensions displaying
diffs like AbuseFilter.

Change-Id: I9e3e74226a23c0a18db091bc1550b694d9d08118
2013-06-10 19:43:47 +02:00
Marius Hoch
fc5bcf1147 Remove revision patrol links from normal page views
Users want and expect it this way, per bug 49123

Follow up to I1e24733c

Bug: 49123
Change-Id: Ib4d72179e4029f0c089c3147bdf4bd6daac0374e
2013-06-09 03:45:21 +02:00
Marius Hoch
aa0308e3b9 Fix edit patrolling in multi Diffs
In multi diffs we had a "wrong" value for rc_last_oldid
set (not the directly previous revision but the one
selected by the user). Due to that there weren't any
unpatrolled recentchanges rows found. As that is cached
in memcached these rows stay unpatrollable forever.

Bug: 49019
Change-Id: I5d6111032dba7d102e30d85718639697f44c036e
2013-06-02 15:23:09 +02:00
Kevin Israel
e3c3dfba85 Check if API enabled before loading dependent JS modules
Affects whether these modules are loaded:

* mediawiki.searchSuggest ($wgEnableAPI only)
* mediawiki.page.watch.ajax ($wgEnableAPI, $wgEnableWriteAPI,
  'writeapi' right)
* mediawiki.page.patrol.ajax (same as above)

Checking of $wgUseAjax has not been removed where it was
already present, in case some users have set the variable
to false to disable these specific features.

Bug: 30213
Change-Id: If2ec219cfbb94e7c9718c58b9b54a508d0e0c656
2013-05-28 20:30:11 -04:00
Marius Hoch
c451b320e3 Patrol overhaul phase 1: Remove rcid parameters
I've changed the logic in Article::showPatrolFooter to be able
to fetch the recent changes id and to only show the patrol link
in case the change hasn't yet been patrolled.

In case recentchanges patrolling is enabled this will try to
create a patrol link for the revision the user is currently
viewing. If only new page patrolling is enabled it tries to
create a patrol link for the first revision of the page.

Furthermore I've removed the passing around of &rcid parameters
within MediaWiki as those had several issues (some even security
related) and were only a workaround to protect the DB from some
queries, which is no longer needed.

This has already been partly implemented in a different manner in
r45778 but had to be reverted in r46542 due to performance issues.
This version shouldn't cause such issues as I'm only adding one or
two indexed database queries per page view.

I've written this new version of the patch with mostly
performance in mind and even tested the database queries it uses
against the replicated databases of enwiki on the toolserver. I'm
pretty sure this can't be implemented any faster without creating
a new index on the recentchanges table.

As I was on it I've implemented RecentChange::isInRCLifespan which
checks whether the given timestamp is new enough to may have a RC
row. That way we can avoid some DB queries for timestamps which are
older than the max RC age.

Fixes bugs:
(bug 15936) New page's patrol button should always be visible
(bug 35810) ! N pages non-patrol-able
(bug 36641) Patrol page link shows on non-existent revs

Change-Id: I1e24733cafbfdc51b7a5a9a1c1baf948e760fe1a
2013-05-25 12:04:01 +02:00
Timo Tijhof
4bd5471ca3 docs: Remove odd colons after @todo
Most were this way already:
https://doc.wikimedia.org/mediawiki-core/master/php/html/todo.html

Ran a find/replace on the odd ones. Also made them all
lower case.

Change-Id: I70c6a69344ddebc603e9a1c1d87e3cc4f4f4c560
2013-05-15 06:23:40 +00:00
umherirrender
dbd0b590e9 else if -> elseif
Also fixed some spacing while at it
Added some braces for one line statements

Change-Id: Iebfa2b17091509daabc76248121c7763e2295d20
2013-04-17 16:52:47 +02:00
Chad Horohoe
4be6236352 Remove externaledit/externaldiff preference
Change-Id: Ic3791d188688f556753ab5556a4d9733bbf2e85e
2013-04-11 09:20:36 -04:00
MatmaRex
a8fbbcf98d Remove the "Quickbar" feature and all things related to it
"Quickbar" was a feature of the Standard and CologneBlue skins that
allowed the sidebar to be displayed on left or right side of the page,
floated or fixed, and hidden on diff pages.

Standard was removed (Ia6d73c2d), and CologneBlue doesn't support this
anymore (bug 41246), so all things quickbar can now be safely removed.

* Removed user prefs option + interface
* Removed related messages
* Removed code for this in SkinLegacy
* Removed dead code in DifferenceEngine and Language

Change-Id: I5e6f7d48d6904a052a3a11547d3ebe6161463018
2013-04-07 04:08:05 +02:00
Alexandre Emsenhuber
df5265e14d Fix case of some Title methods
Change-Id: I37ce7fe392f4941c500fa0a88007664501d7e338
2013-03-27 14:36:05 +01:00
Alex Monk
ddee066b41 Fix Ifb93e49b
This commit caused a PHP notice if you tried to use diff=prev with an
oldid which was the first revision of the page.

Change-Id: I4c4ccb9a0c8d82e104723a2e72f1c699e2fc249b
2013-03-13 15:43:27 +00:00
Kaldari
930955762a Adding hooks for thank you notification links
These will allow Echo to add a 'thank' link next to the 'undo' links

Change-Id: Ifb93e49b30bb325ecd17ece9f36bcd83c63a2563
2013-03-12 10:37:39 -07:00
Tyler Anthony Romeo
4dcc7961df Fixed @param tags to conform with Doxygen format.
Doxygen expects parameter types to come before the
parameter name in @param tags. Used a quick regex
to switch everything around where possible. This
only fixes cases where a primitve variable (or a
primitive followed by other types) is the variable
type. Other cases will need to be fixed manually.

Change-Id: Ic59fd20856eb0489d70f3469a56ebce0efb3db13
2013-03-11 13:15:01 -04:00
umherirrender
d63121016d fix some spacing
Added/removed spaces around logical/arithmetic operator
Reduced multiple empty lines to one empty line
Removed wrong tabs before comments at end of line
Removed too many spaces in assigments

Change-Id: I2bba4e72f9b5f88c53324d7b70e6042f1aad8f6b
2013-03-07 17:53:21 +01:00
Reedy
e028051140 Add a handful of missing @return
Change-Id: I21b218e6694600a2d2df4dd0a6b2b5cd2e10f1f9
2013-02-16 17:51:13 +01:00
umherirrender
f97a3a4027 fix some spacing
Change-Id: I670a7baf3ba1e70d18346bb00938d518ba2063bd
2013-02-04 19:59:14 +00:00
Marius Hoch
a53fe6f080 (bug 39397) Only show rollback links if they work
To only show rollback links if they work I had to patch Linker
to have a function (Linker::rollbackData) which can verify
that the editor isn't the only editor of the page. Furthermore
it is checked that the user name or the text of the revision
we might rollback to isn't deleted. Due to the fact that I've
altered the already existing method which showed how many edits
a rollback will revert for that, this wont affect the performance.

Change-Id: I5d1adec993370c39ae8c5c712edd919d456441c6
2013-01-09 17:04:44 +01:00
Siebrand Mazeland
c4e761089c Update docs for DifferenceEngine::getDiff()
Previous docs were incorrect and misleading.

Change-Id: I6403c7c7c3b9803cc7e10cc45999244ff78dc14d
2012-12-05 15:21:58 +01:00
Siebrand Mazeland
a2d605afc3 Add type hint
Change-Id: If529cfbf568a10e8cea184fa229959701268ebcb
2012-12-05 00:38:59 +01:00
Marius Hoch
d1debff476 (bug 7851) Implement mediawiki.page.patrol.ajax
Implement AJAX patrolling with the new mediawiki.page.patrol.ajax
module, which makes use of the API via mediawiki.api.

During the patrol process a spinner (created by jquery.spinner)
shows up and after it a suitable message gets shown via
mediawiki.notify.

Depending on whether we had success or not the link then turns up
again or the brackets completely disappear just like on a normal page view.

On top of adding the module, I've changed the following:
- Added the patrol token to the ResourceLoaderUserTokensModule.
- Registered messages 'markedaspatrollednotify' and
  'markedaspatrollederrornotify'.

Change-Id: I472357566dda0ab572c20e2e4b87508b0f2f4c73
2012-11-13 23:09:38 +01:00
daniel
c2172d45e4 Beware that getContent() may return null
Before the introduction of the content handler, missing content was
signified by getText() returning null instead of a string. null will
work much like an empty string in most contexts, so in many places,
it was not checked explcitely whether the conent was null.

Now, when getContent() returns null, this often caused a fatal error,
because the code would access whatever getContent() returned as an object,
without checking whether it was null (because no such check was performed
previously, when the content was represented as a string).

This check introduces explicite checks for getContent() returning null
in the most essential core classes.

Change-Id: I551a90b0b67b8edc7570ca5d252ecc1de903f097
2012-11-09 19:45:12 +01:00
Niklas Laxström
aeffc7979c Message documentation update for DifferenceEngine
Change-Id: I404cbf07238bbe532432bcb9dd573bdec2a95b5e
2012-10-15 13:51:37 +02:00
daniel
09c607f7b9 Silence warnings about deprecation by ContentHandler.
The introduction of the ContentHandler caused quite a few functions and hooks to
become deprecated. Usage of these has been removed in core, but is still present
in extensions. Extensions should be fixed after ContentHandler has settled in a
bit, but for now we need a way to silence the warnings.

Change-Id: Ia223243222675f778e8f8c32923f956790db0b4f
2012-10-12 14:56:02 +02:00
Liangent
15cd7d64f1 Show redirects correctly on diff pages.
Change-Id: Ic3c2d6cff016a8fecdde511e2d14b30426737c8a
2012-10-11 05:08:19 +00:00
daniel
bb51a58e57 Cleanup of Wikidata branch.
This cleans up several issues raised in comments to I3b2dad3a,
mostly style and merge artifacts.

Change-Id: I99f5e300a671db1353db151cd187ffd2e4478d03
2012-10-08 17:34:47 +02:00
daniel
c546fae8ed merge latest master into Wikidata branch
Change-Id: Id4e0f40c03679c13d8934a6add99b5cd86d0437d
2012-10-08 13:58:54 +02:00
umherirrender
20291cd166 Pass user object to some Revision::getText/Title::userCan calls
Also passed some $wgUser direct (when already there), so it is seen by
someone, that the user should be passed to that method.

Change-Id: Id4d5504a05ea34d80d59262ad3aef28f09c807a6
2012-10-05 16:25:01 +02:00
daniel
7db9491d89 set mediawiki version number
Change-Id: I3479776bd3bb25c4d75d07e62ede2ad989025c5b
2012-10-05 15:03:24 +02:00
daniel
c8c95a52f4 Fix JS and CSS diffs
Change-Id: I8801d49af258141ba97e88e719f87105fdc01a35
2012-10-04 12:11:56 +02:00
daniel
b6b686c13b merged master
Change-Id: I0ef7c7f33a5dc5855f38b20c03ddc5306f38ec66
2012-09-19 12:34:10 +02:00
Alexandre Emsenhuber
be0878fd3a Use WikiPage::makeParserOptions() where possible.
- This is needed to for I90965346 ((bug 37453) Move
  $wgDisable(Lang|Title)Conversion to ParserOptions)
  because that change sets an option based on the Title,
  and I don't want to duplicate that to all ParserOptions
  that need it.
- Refactored ApiParse to have a WikiPage object available
  and changed some part to take advantage of having this
  object available. Also used ApiBase::getTitleOrPageId()
  to reduce code duplication.

Change-Id: Iec98e472af9c43d940f77261367a796b0d7b4b54
2012-08-31 23:16:03 +02:00
daniel
72952a082c merged master some more
Change-Id: I53f349e42336ce0426ea1aff939853b3cd728aeb
2012-08-29 15:37:17 +02:00
daniel
ee007485b8 Merge "cleaned up comments in DifferenceEngine" into Wikidata 2012-08-28 11:42:18 +00:00
Alex Monk
65150ca53e (bug 39680) Convert valign to CSS vertical-align
Also convert align to CSS text-align/float

Change-Id: Ia7da2b51b7fdeee443def8cb06c63a422d89f6f1
2012-08-27 21:36:01 +01:00
daniel
a66eb27653 cleaned up comments in DifferenceEngine
Change-Id: I939fa563a66357efb8eae8d8f60bf0ba08cd05eb
2012-08-21 16:26:14 +02:00
daniel
74fe09ed4d Bug 39509: Function for running legacy hooks.
ContentHandler::runLegacyHooks can be used to run hooks that don't
supprot Content objects yet. runLegacyHooks will issue a warning and take
case of serialization/unserialization of the content as appropriate.

Changeset 2: rebased.

Change-Id: I31109061110f87c38bdeebf30d520c8e1241bb29
2012-08-20 22:00:52 +02:00
daniel
0139923580 fixing long lines
Change-Id: Iebcd40a1a37a3a93cc571fa2c2b0a87f53dc97a4
2012-08-20 21:33:07 +02:00
daniel
29719f846b merging latest master
Change-Id: I36b7f2f63ab8c08f8412d521dc68ea45c8b67711
2012-08-20 16:55:28 +02:00
Aaron Schulz
eb183bac87 Revision and WikiPage cleanup with IDBAccessObject interface.
* Replaced WikiPage::DATA_FROM_* constants with IDBAccessObject ones.
* Renamed IDBAccessObject constants a bit for visual consistency.
* Removed AVOID_MASTER parameter and replaced calling instances with READ_NORMAL.
  Instead of getting page_latest from the master and the revision from a
  slave, just get it all from the master in one RTT. Most callers used
  AVOID_MASTER (and now READ_NORMAL), so this case is barely hit anymore.

Change-Id: Ifbefdcd4490094b38e49bbb46c95fdb71b5c9e1a
2012-08-08 16:34:08 +00:00
Alexandre Emsenhuber
d24a4d7f10 Use a better message when a revision is not found.
This comes from
https://translatewiki.net/wiki/Thread:Support/MediaWiki:Missing-article
that asks for a link to the deletion log in the
'missing-article' message.

Instead of simply changing that message I replaced
it with two news messages 'missing-revision' when trying
to view an old revision and 'difference-missing-revision'
when showing a difference. This removes the "lego"
construction of 'missing-article' with 'missingarticle-rev'
and 'missingarticle-diff' submessages.

I had to keep current messages since they are still
used in extensions.

Change-Id: Ibe60c84cfea922a78b3ad22cc48185a109cd617d
2012-08-06 10:53:53 +02:00
daniel
c0b50eb47d merged master
Change-Id: I6afafe971afb3f38fc8f1e66ba409283b8a698f8
2012-08-02 11:01:22 +02:00
Liangent
4cb8033d79 Replace hard coded parentheses
Change-Id: I8ca697a3bdae4f693b626f2d2da15ad28dce937d
2012-07-27 22:57:34 +08:00
daniel
d87135d706 merged master
Change-Id: Iad12ee382d6aeb1fab6fefb611d290b74865ea4b
2012-07-23 22:07:18 +02:00
Alexandre Emsenhuber
026e8534c6 Add a context parameter to Liker::generateRollback() and Linker::buildRollbackLink() and updated callers.
This allows both methods to not always rely on global object, but also to use the local context when possible.

Change-Id: Id10f55ed9b18c889afd8d9937d9f35acb376cce4
2012-07-05 23:10:03 +02:00
Tim Starling
fcd74e5dd3 Merge "Reduced some master queries by adding flags to Revision functions." 2012-06-28 05:11:04 +00:00
Aaron
8288b34eae Reduced some master queries by adding flags to Revision functions.
* The main Revision functions now allow various QoS and locking flags.
* Added tiny DBAO interface add made Revision implement it.
  Since a lot of objects will need (or have) the same functionality.
* Use "self" keyword in Revision class consistently.
* Made Revisison::newFromConds() private.

Change-Id: I3139956999218a2bb44b5c845b8079e33b2328bb
2012-06-27 20:59:20 -07:00
daniel
237ee32ccc allow getParserOutput to be overwritten in DifferenceEngine
Change-Id: I66fbd42c2ada05d5891f2738139b80c0090ecb1b
2012-06-25 13:44:32 +02:00
daniel
4775a690b5 made DifferenceEngine::getRevisionHeader() protected, so we can override it.
Change-Id: Ic429cd0c039c0eb0487e149f9bb79c469b3635b3
2012-06-18 16:57:22 +02:00