Commit graph

208 commits

Author SHA1 Message Date
Roan Kattouw
4a286d57f6 Cleaned up HTMLDiff implementation for readability:
* Coding style consistency and indentation
* Removed unneccesary require_once(), the AutoLoader will load the right file automatically
* sizeof -> count, TRUE -> true, FALSE -> false, NULL -> null
* Use Xml:: functions
* Rename TagNode::splitUntill() to splitUntil() and $hasNotDeletedDescendant to $hasNonDeletedDescendant
* Flip TagNode::$blocks, TagToStringFactory::$containerTags and TagToStringFactory::$styleTags
* Merging if's in Node::getParentTree()
* Use a smart foreach() loop rather than two while()s and an if() in TagNode::splitUntil()
* Put all of TextNodeDiffer's members on top rather than scattering them between functions
* Use PHP's double-quoted string coolness rather than sprintf() or concatenation
* Use a smart foreach loop rather than array_keys() and a for() in TagToString::addAttributes()

TODO:
* Use interface messages rather than TagToString::$bundle so they can be translated
* Use constants for magic numbers like 1.35, 1000 and 2000 in calls to WikiDiff3::__construct()
2008-08-18 13:48:44 +00:00
Guy Van den Broeck
3712ab270d Performance improvements to diff algorithms 2008-08-18 00:16:32 +00:00
Alexandre Emsenhuber
e8aadacc7d Fixes for r39406:
* Set missing properties svn:eol-style and svn:mime-type
* Use auto loader if possible
* Added $wgEnableHtmlDiff to DefaultSettings.php (todo: fix description of this setting)
2008-08-15 16:51:46 +00:00
Guy Van den Broeck
89f8141a7f New implementation of wikidiff3 algorithm replacing the previous one and basic HTML diffing support, both integrated with DifferenceEngine 2008-08-15 11:46:46 +00:00
Alexandre Emsenhuber
50042028d5 * Remove useless ?> in Diff.php
* Only load that file when necessary and use full path to include it
* Set missing svn:eol-style property
2008-08-05 21:10:06 +00:00
Guy Van den Broeck
0aabbc97f5 Load Diff.php only when wgExternalDiffEngine is set 2008-08-05 20:10:55 +00:00
Guy Van den Broeck
e45cf2b883 Alternative experimental diff implementation. Enable by setting = 'wikidiff3'. 2008-08-05 19:40:29 +00:00
Aryeh Gregor
650be91fb8 Refactor a bit preparatory to fixing bug 8068: rewrite the robot policy stuff in OutputPage to allow index and follow policy to be set separately. Also now validates input to setRobotPolicy(). And renamed setRobotpolicy to setRobotPolicy, too. If anyone was accessing $mRobotpolicy directly they're out of luck, though. 2008-07-23 19:05:43 +00:00
SQL
6b42aaf59e whitespace to bring function into line with http://www.mediawiki.org/wiki/Manual:Coding_conventions 2008-07-07 05:31:00 +00:00
Alexandre Emsenhuber
1d13d14667 Removed "See diff.doc", it seems that this file never existed 2008-07-05 11:59:58 +00:00
Raimond Spekking
268bc3ca8d * (Bug 13828) Split parameter $1 (combines title and revision numbers) of MediaWiki:Missingarticle into $1 (=title)
and $2 (=revision numbers) for prettier output.
2008-06-05 17:33:31 +00:00
Aaron Schulz
9dd5164e16 Add oldid like r35829, except without random unrelated change 2008-06-04 04:05:47 +00:00
Tim Starling
fb56c365fb Reverted r35829, breaks the suppression of the "next diff" link ("newer edit" on wikipedia) when viewing a diff to the current revision. 2008-06-04 03:31:56 +00:00
Aaron Schulz
ecb9756fa8 Make link to current not be misleading if the diff is outdated (also bug 14395) 2008-06-03 23:51:32 +00:00
Aaron Schulz
96f004dd6a Don't temp users with rollback links to uneditable pages 2008-05-29 21:14:11 +00:00
Tim Starling
079a37ef22 In FlaggedRevs:
* Moved the FlaggedRevs class to its own file
* Removed $wgFlaggedArticle, store an instance inside the Article object instead. Also store a reference in the Title object, since some hooks only have a Title available. 
* Modified all hooks which were previously calling $wgFlaggedArticle directly to go via an instance loader function.
* Merged hook functions for ArticleViewHeader and DiffViewHeader
* Changed the way FlaggedRevs sets the right image version in ImagePage, to avoid a function call on startup
* Some coding style changes, such as consistent variable case, consistent indenting style, meaningful variable names, etc.
* Fixed typo in updateAutoPromote.php
* Removed the $wgFlaggedRevsVisible feature, this doesn't seem to be in keeping with our mission so I couldn't see the point in spending a lot of time fixing its bugs. Revert if necessary.
* Use Xml::encodeJsVar() to transfer data from PHP to JS, don't DIY
* Use OutputPage::addHeadItem() instead of an infinite-lifetime variable to ensure that only one copy of the header item is added. OutputPage objects may come and go.
2008-05-23 09:03:49 +00:00
Alexandre Emsenhuber
087a9f70c5 WARNING: HUGE COMMIT
Doxygen documentation update:
* Changed alls @addtogroup to @ingroup. @addtogroup adds the comment to the group description, but doesn't add the file, class, function, ... to the group like @ingroup does. See for example http://svn.wikimedia.org/doc/group__SpecialPage.html where it's impossible to see related files, classes, ... that should belong to that group.
* Added @file to file description, it seems that it should be explicitely decalred for file descriptions, otherwise doxygen will think that the comment document the first class, variabled, function, ... that is in that file.
* Removed some empty comments
* Removed some ?>

Added following groups:
* ExternalStorage
* JobQueue
* MaintenanceLanguage

One more thing: there are still a lot of warnings when generating the doc.
2008-05-20 17:13:28 +00:00
Brion Vibber
1e23b9f54b Add debug comment to diffs indicating generator backend, node, and time.
May help tracking down the awful bugs we've been seeing more of lately.
2008-04-25 22:52:05 +00:00
Rotem Liss
8e78d4c162 Don't show an undo link in the diff page when one of the revisions is deleted, since the undo page shows an error on such revisions. 2008-04-23 16:46:31 +00:00
Raimond Spekking
63ccbb331a * Move hardcoded text "Diff:..." to new message 'missingarticle-diff'
* Move hardcoded text "oldid=..." to new message 'missingarticle-rev'
* Remove variable $t from message 'noarticletext' as it has no parameter $1
2008-04-22 06:10:01 +00:00
Aaron Schulz
c5403c94c9 valign='top' 2008-04-15 17:57:32 +00:00
Siebrand Mazeland
79d5225c0e * remove end of line whitespace
* remove empty lines at end of file
* remove "?>" where still present
2008-04-14 07:45:50 +00:00
Victor Vasiliev
516be01b35 * Hide (undo) link if user isn't able to edit page 2008-04-12 17:58:58 +00:00
Niklas Laxström
01f530ca0e * Small cleanups 2008-04-06 18:16:38 +00:00
Aaron Schulz
dd724a817b Return '' to avoid vague cryptic error message when a user lacks permissions 2008-03-31 18:01:39 +00:00
Niklas Laxström
79d45992fb * (bug 13466) White space differences not shown in diffs 2008-03-21 11:48:24 +00:00
Aaron Schulz
9107a2d0dd Check permissions before using cache (bug 9432) 2008-03-18 23:36:24 +00:00
Brion Vibber
302f32c6fe Revert r32126 -- breaks type-safety by having a bunch of Revision functions which are supposed to always return strings return booleans sometimes.
Let's not toss in even more scary possibilities, please... predictability is nice!
2008-03-18 23:07:19 +00:00
Aaron Schulz
90163adf71 *Return false when a user cannot see a field of a revision, rather than "", which could actually be valid
*Remove now unneeded perm checks in diffEng
*Fix unsafe cache leak for diffs (bug 9432)
2008-03-18 19:37:03 +00:00
Alexandre Emsenhuber
29dc949221 (bug 12882) Adding a <span class="patrollink"></span> arround "Mark as patrolled" link on diffs 2008-03-14 22:50:09 +00:00
Tim Starling
377561cd1e * Introduced OutputPage::addWikiMsg() and OutputPage::wrapWikiMsg(), to make it easier to avoid double-parsing. Double-parsing introduces differences between the old and new parsers.
* Used the new functions in the relevant places throughout the core. Where this was not possible, used wfMsgNoTrans() to avoid double-parsing.
* Calling wfEscapeWikiText() on a title before passing it to a message is unnecessary and causes bugs. The best idea is to let the message do its own escaping. Removed wfEscapeWikiText() from the caller of addedwatchtext, removedwatchtext, deletedtext, protect-text, nosuchusershort and movepage-moved. Updated all message files to use <nowiki>$1</nowiki> where appropriate in these messages. 
* Removed unnecessary empty message handling from semiprotectedpagewarning
* Removed nonsense warning about the output of wfMsg() not being safe for inclusion in HTML. 
* Changed wfShellExec() to use passthru/ob_get_contents instead of exec(). This avoids corruption of whitespace in the response. 
* Added $wgValidateAllHtml feature, to optionally validate HTML on output. 
* Fixed missing newline in cascadeprotected in MessagesEn.php
* Belatedly updated addedwatchtext to take account of the new "monobook" skin. No unwatch link in the sidebar anymore.
2008-02-18 07:25:35 +00:00
Aaron Schulz
dc46a2e065 Give usertext so that user,timestamp index can be used. Should require less to scan that just the timestamp index. 2008-02-17 20:13:00 +00:00
Brion Vibber
0a04fb1ed5 * (bug 12148) Text highlight wasn't applied to cleanly deleted and added
lines in diff output

Note this still has to be replicated in wikidiff2
2007-12-06 21:35:01 +00:00
Daniel Cannon
e041a05707 Minor typo in r27809. Add space before "(edit)" link on old revision in diff. 2007-12-06 08:56:10 +00:00
Brion Vibber
9ecc621a91 Revert r28136; overlong title prefix obscures page title in tabs, window lists, etc 2007-12-04 20:47:52 +00:00
Raimond Spekking
4f148faea5 * Add descriptive <title> to revision difference page
* Move message 'difference' in language files to recentchanges section as it is only used in RecentChanges.php now.
2007-12-04 10:56:29 +00:00
Victor Vasiliev
c1e259c8d7 * Fix rvdiffformat=array
* Fix notice about undefined index in ArrayDiffFormatter
2007-12-01 09:08:02 +00:00
Roan Kattouw
537f7ea5b3 API:
* Adding rvdiffformat parameter to prop=revisions
* Creating formatters for unified (UnifiedDiffFormatter) and array (ArrayDiffFormatter) diffs
2007-11-27 21:36:43 +00:00
Roan Kattouw
d94ca2e5e6 Fixing DiffFormatter so it actually outputs valid diffs. 2007-11-26 18:39:40 +00:00
Aaron Schulz
60255eef1f * Don't cache diffs with deleted content
*Add show/hide links for people with 'deleterevision' rights
* Clean up formatting of diffs with deleted content
2007-11-24 01:40:37 +00:00
Andrew Garrett
2588e553b4 * Fix up RELEASE-NOTES from previous commit (confused commit message with RELEASE-NOTES)
* Fix a bug where css/js pages were displayed normally, and were causing havoc with embedded html in user css/js subpages (a la http://en.wikipedia.org/w/index.php?title=User:AzaToth/differror.js&diff=163690181)
2007-10-11 00:53:45 +00:00
Brion Vibber
9be2c3676a Revert r26281 for the moment. Big patch, changes several existing practices. Will want some public testing and more review before taking it to trunk. 2007-10-01 19:50:25 +00:00
Aaron Schulz
4febfc77c2 *Clean up deletion of revisions and remove some gaps
*Allow blocking of users to hide names
*Implement revision deletion for images/deleted files/deleted revs
*Log deletion set off for now
*Add 'hidden' file dir
*Dissallow merging via undelete (which was inefficient and hard to reverse)
*Use restore points and diffs to special:undelete
*Add a special page to merge pages
*Get changeslist to use tables to avoid ugly formatting
*Add logs into RC for rebuildrecentchanges.php
*Add private logs
*List private logs at specialpages
*Tweak/add some deletion and merge messages
2007-10-01 19:38:28 +00:00
Greg Sabino Mullane
66f12e7209 Don't pass getTimestamp output directly to the db without a wrap. 2007-09-09 18:31:21 +00:00
Tim Starling
3a57f51b05 Fixed the diff cache purge feature:
* Made it work with the anon-only confirmation form. 
* Fixed data flow issue (removed reference to $wgRequest in DifferenceEngine.php)
* Made it actually purge rather than just skip the cache one time
2007-09-07 23:07:07 +00:00
Aryeh Gregor
9f58c7f05a Tweak comment text 2007-09-05 13:48:45 +00:00
Aryeh Gregor
bb2defa8f7 Add comment for r25525 so future devs don't think their predecessors have been smoking something. 2007-09-05 13:43:19 +00:00
Domas Mituzas
213c894a56 be resourceful, instead of creating new indexing bloat, use existing indexes. 2007-09-05 08:11:30 +00:00
Tim Starling
e46376b056 In the diff column headings, Use divs with id attributes instead of <br/>, for easier site/user javascript hacks. Patch by Carl Fürstenberg. 2007-09-02 17:13:03 +00:00
Rob Church
4280f45ccc * (bug 10793) Show patrol links on all eligible diff pages
* Introduce RecentChange::newFromConds() to support the above, and a new index
* Refactored some bits
2007-08-06 03:29:40 +00:00