Index: trunk/extensions/FlaggedRevs/presentation/FlaggedRevsUI.hooks.php |
— | — | @@ -609,19 +609,6 @@ |
610 | 610 | $view->addToDiffView( $diff, $oldRev, $newRev ); |
611 | 611 | return true; |
612 | 612 | } |
613 | | - |
614 | | - /* |
615 | | - * If an article is reviewable, get custom article contents from the FlaggedPageView |
616 | | - */ |
617 | | - public static function onArticleContentOnDiff( $diffEngine, $out ) { |
618 | | - $fa = FlaggedPage::getTitleInstance( $out->getTitle() ); |
619 | | - if ( !$fa->isReviewable() ) { |
620 | | - return true; // nothing to do |
621 | | - } |
622 | | - $view = FlaggedPageView::singleton(); |
623 | | - $view->addCustomContentHtml( $out, $diffEngine->getNewid() ); |
624 | | - return false; |
625 | | - } |
626 | 613 | |
627 | 614 | public static function addRevisionIDField( $editPage, $out ) { |
628 | 615 | $view = FlaggedPageView::singleton(); |
Index: trunk/extensions/FlaggedRevs/presentation/FlaggedPageView.php |
— | — | @@ -1844,19 +1844,4 @@ |
1845 | 1845 | } |
1846 | 1846 | return true; |
1847 | 1847 | } |
1848 | | - |
1849 | | - /* |
1850 | | - * If this is a diff page then replace the article contents with a link |
1851 | | - * to the specific revision. This will be replaced with article content |
1852 | | - * using javascript and an api call. |
1853 | | - */ |
1854 | | - public function addCustomContentHtml( OutputPage $out, $newRevId ) { |
1855 | | - $this->load(); |
1856 | | - if ( $newRevId ) { |
1857 | | - $out->addHTML( "<div id='mw-fr-revisioncontents'><span class='plainlinks'>" ); |
1858 | | - $out->addWikiMsg( 'revcontents-getcontents', |
1859 | | - $this->article->getTitle()->getPrefixedDBKey(), $newRevId ); |
1860 | | - $out->addHTML( "</span></div>" ); |
1861 | | - } |
1862 | | - } |
1863 | 1848 | } |
Index: trunk/extensions/FlaggedRevs/presentation/modules/flaggedrevs.js |
— | — | @@ -197,78 +197,6 @@ |
198 | 198 | } |
199 | 199 | }; |
200 | 200 | |
201 | | - |
202 | | -// Get the revisioncontents div and replace it with actual parsed article contents via an API call |
203 | | -FlaggedRevs.getRevisionContents = function() { |
204 | | - var revContent = mw.config.get( 'wgRevContents' ); |
205 | | - var $frRevContents = $( '#mw-fr-revisioncontents' ); |
206 | | - var $prevLink = $( '#differences-prevlink' ); |
207 | | - var $nextLink = $( '#differences-nextlink' ); |
208 | | - |
209 | | - if ( $frRevContents.size() ) { |
210 | | - var diffUIParams = document.getElementById( 'mw-fr-diff-dataform' ); |
211 | | - var oldRevId = diffUIParams.getElementsByTagName( 'input' )[1].value; |
212 | | - var origContents = $frRevContents.html(); |
213 | | - $frRevContents.html( '<span class="loading mw-small-spinner spinner"></span>' |
214 | | - + '<span class="loading">' + mw.html.escape( revContent.waiting ) + '</span>' ); |
215 | | - var queryParams = { |
216 | | - format: 'json', |
217 | | - action: 'parse', |
218 | | - prop: 'text|categorieshtml|languageshtml|headitems' |
219 | | - }; |
220 | | - if ( mw.config.get( 'wgCurRevisionId' ) == oldRevId |
221 | | - && mw.config.exists( 'wgPageName' ) ) |
222 | | - { |
223 | | - queryParams.page = mw.config.get( 'wgPageName' ); |
224 | | - } else { |
225 | | - queryParams.oldid = oldRevId; |
226 | | - } |
227 | | - |
228 | | - var call = $.ajax({ |
229 | | - url: mw.config.get( 'wgScriptPath' ) + '/api.php', |
230 | | - data: queryParams, |
231 | | - dataType: 'json', |
232 | | - success: function( result ) { |
233 | | - if ( !result || !result.parse ) { |
234 | | - return; |
235 | | - } |
236 | | - // Get data |
237 | | - var parse = result.parse, |
238 | | - text = parse.text, |
239 | | - languageshtml = parse.languageshtml, |
240 | | - categoryhtml = parse.categorieshtml; |
241 | | - // Insert data into page |
242 | | - if ( text && text['*'] ) { |
243 | | - $frRevContents.empty().append( text['*'] ); |
244 | | - } else { |
245 | | - $frRevContents.empty().append( revContent.error + ' ' + origContents ); |
246 | | - } |
247 | | - if ( languageshtml && languageshtml['*'] ) { |
248 | | - $frRevContents.append( '<div class="langlinks" >' + |
249 | | - languageshtml['*'] + '</div>' ); |
250 | | - } |
251 | | - if ( categoryhtml && categoryhtml['*'] ) { |
252 | | - $('#catlinks').replaceWith( $(categoryhtml['*']) ); |
253 | | - } |
254 | | - }, |
255 | | - error: function(xhttp, status, error) { |
256 | | - $frRevContents.html( revContent.error + ' ' + origContents ); |
257 | | - } |
258 | | - }); |
259 | | - } |
260 | | - $prevLink.click( function() { |
261 | | - if ( call ) { |
262 | | - call.abort(); |
263 | | - } |
264 | | - } ); |
265 | | - $nextLink.click( function() { |
266 | | - if ( call ) { |
267 | | - call.abort(); |
268 | | - } |
269 | | - } ); |
270 | | -}; |
271 | | - |
272 | 201 | // Perform some onload (which is when this script is included) events: |
273 | 202 | FlaggedRevs.enableShowhide(); |
274 | 203 | FlaggedRevs.setCheckTrigger(); |
275 | | -FlaggedRevs.getRevisionContents(); |
Index: trunk/extensions/FlaggedRevs/FlaggedRevs.php |
— | — | @@ -517,9 +517,6 @@ |
518 | 518 | # Database schema changes |
519 | 519 | $wgHooks['LoadExtensionSchemaUpdates'][] = 'FlaggedRevsUpdaterHooks::addSchemaUpdates'; |
520 | 520 | |
521 | | -# Performance Don't show content on diff |
522 | | -$wgHooks['ArticleContentOnDiff'][] = 'FlaggedRevsUIHooks::onArticleContentOnDiff'; |
523 | | - |
524 | 521 | # ######## |
525 | 522 | |
526 | 523 | function efSetFlaggedRevsConditionalHooks() { |