r94449 MediaWiki - Code Review archive

Repository:MediaWiki
Revision:r94448‎ | r94449 | r94450 >
Date:09:39, 14 August 2011
Author:maxsem
Status:ok
Tags:
Comment:
ApiSandbox bug 29934 - Add links to API help urls where available
Modified paths:
  • /trunk/extensions/ApiSandbox/ext.apiSandbox.js (modified) (history)

Diff [purge]

Index: trunk/extensions/ApiSandbox/ext.apiSandbox.js
@@ -193,7 +193,13 @@
194194
195195 function createInputs( info ) {
196196 currentInfo = info;
197 - $help.html( smartEscape( info.description ) );
 197+ var desc = smartEscape( info.description );
 198+ if ( isset( info.helpurls ) && isset( info.helpurls[0] ) && info.helpurls[0] ) {
 199+ desc = desc.replace( /^([^\r\n\.]*)/,
 200+ '<a target="_blank" href="' + mw.html.escape( info.helpurls[0] ) + '">$1</a>'
 201+ );
 202+ }
 203+ $help.html( desc );
198204 var s = '<table class="api-sandbox-options">\n<tbody>';
199205 for ( var i = 0; i < info.parameters.length; i++ ) {
200206 var param = info.parameters[i],

Status & tagging log