r77897 MediaWiki - Code Review archive

Repository:MediaWiki
Revision:r77896‎ | r77897 | r77898 >
Date:19:47, 6 December 2010
Author:pdhanda
Status:ok
Tags:
Comment:
Part of fix/workaround to bug 26163. Get the categories and languagelinks as html
Modified paths:
  • /trunk/extensions/FlaggedRevs/client/flaggedrevs.js (modified) (history)

Diff [purge]

Index: trunk/extensions/FlaggedRevs/client/flaggedrevs.js
@@ -189,7 +189,7 @@
190190 var oldRevId = diffUIParams.getElementsByTagName('input')[1].value;
191191 var origContents = contentsDiv.innerHTML;
192192 contentsDiv.innerHTML = "<span class='loading mw-small-spinner spinner'></span><span class='loading' >" + wgRevContents.waiting + "</span>";
193 - var requestArgs = 'action=parse&prop=text&format=xml';
 193+ var requestArgs = 'action=parse&prop=text|categorieshtml|languageshtml&format=xml';
194194 if ( window.wgCurRevisionId == oldRevId && window.wgPageName ) {
195195 requestArgs += '&page=' + encodeURIComponent( window.wgPageName );
196196 } else {
@@ -202,12 +202,22 @@
203203 data : requestArgs,
204204 dataType: "xml",
205205 success : function( result ) {
 206+ contentsDiv.innerHTML = "";
206207 contents = jQuery(result).find("text");
207208 if ( contents && contents.text() ) {
208 - contentsDiv.innerHTML = contents.text();
 209+ contentsDiv.innerHTML += contents.text();
209210 } else {
210211 contentsDiv.innerHTML = wgRevContents.error + " " + origContents;
211212 }
 213+ categoryhtml = jQuery(result).find("categorieshtml");
 214+ if ( categoryhtml && categoryhtml.text() ) {
 215+ contentsDiv.innerHTML += categoryhtml.text();
 216+ }
 217+ languageshtml = jQuery(result).find("languageshtml");
 218+ if ( languageshtml && languageshtml.text() ) {
 219+ contentsDiv.innerHTML += languageshtml.text();
 220+ }
 221+
212222 },
213223 error : function(xmlHttpRequest, textStatus, errThrown) {
214224 contentsDiv.innerHTML = wgRevContents.error + " " + origContents;
@@ -236,5 +246,4 @@
237247 FlaggedRevs.getRevisionContents();
238248 };
239249
240 -//TODO figure out the correct way to do this
241250 window.onload = FlaggedRevs.setJSTriggers;

Follow-up revisions

RevisionCommit summaryAuthorDate
r77930Follow up to r77897. Incrementing version numnerpdhanda23:19, 6 December 2010
r77943Merged r7789 from trunk - Part of fix/workaround to bug 26163. API calls to g...pdhanda01:17, 7 December 2010
r77944Merged r77897 and r77930 from trunk - Part of fix/workaround to bug 26163 ...pdhanda01:21, 7 December 2010
r78346Follow up to r77897. Added some style to language links.pdhanda00:01, 14 December 2010

Past revisions this follows-up on

RevisionCommit summaryAuthorDate
r77516Fixes bug 26163 - Missing categories and iw links on diff pages.pdhanda00:12, 1 December 2010
r77896Part of fix/workaround to bug 26163. API calls to get language links and cat...pdhanda18:31, 6 December 2010

Status & tagging log