r109234 MediaWiki - Code Review archive

Repository:MediaWiki
Revision:r109233‎ | r109234 | r109235 >
Date:22:33, 17 January 2012
Author:maxsem
Status:ok
Tags:
Comment:
Hack for compatibility with 1.18
Modified paths:
  • /trunk/extensions/ApiSandbox/ext.apiSandbox.js (modified) (history)

Diff [purge]

Index: trunk/extensions/ApiSandbox/ext.apiSandbox.js
@@ -421,6 +421,12 @@
422422 $examplesContainer.hide(); // just in case
423423 return;
424424 }
 425+ // on 1.18, convert everything into 1.19 format
 426+ if ( info.allexamples.length > 0 && typeof info.allexamples[0] == 'string' ) {
 427+ for ( var i = 0; i < info.allexamples.length; i++ ) {
 428+ info.allexamples[i] = { '*': info.allexamples[i] };
 429+ }
 430+ }
425431 $examplesContent.hide()
426432 .html( '' );
427433 var $list = $( '<ul></ul>' );

Status & tagging log