"Brion VIBBER" posted a comment on MediaWiki.r105122.
URL: http://www.mediawiki.org/wiki/Special:Code/MediaWiki/105122#c27071

Commit summary for MediaWiki.r105122:

Adding new debugging toolbar

Needs a UI cleanup still, but for the most part is working.

Brion VIBBER's comment:

Damn i shoulda previewed that more closely. ;)

Best practice is to set text and attributes using jQuery methods. Instead of:

  <nowiki>html += '<li><span class="mw-debug-right">' + file.size + '</span> ' 
+ file.name + '</li>';</nowiki>

consider something like:

 <nowiki>$('<li>')
   .append( $('<span class="mw-debug-right"></span>').text(file.size) )
   .append( ' ' + file.name )
   .appendTo($list);</nowiki>

and return elements or a jQuery wrapper directly instead of HTML.

If you need to create HTML source directly, then make liberal use of 
mw.html.escape() or mw.html.element() helper functions (the former is like 
htmlspecialchars(), the latter is like Html::element()).


_______________________________________________
MediaWiki-CodeReview mailing list
[email protected]
https://lists.wikimedia.org/mailman/listinfo/mediawiki-codereview

Reply via email to