User "Catrope" posted a comment on MediaWiki.r99200.

Full URL: http://www.mediawiki.org/wiki/Special:Code/MediaWiki/99200#c24287
Commit summary:

MoodBar feedback dashboard: Implement a means to hide individual comments. For 
now, does *not* include actual implementations of the forms to actually show 
and hide individual items, just the logic for when an item is actually hidden

Comment:

<pre>
+               return isset($params['prop']['hidden']) ? 'private' : 'public';
</pre>
This doesn't actually work. You need <code>in_array( 'hidden', $params['prop'] 
)</code> .

<pre>
+               var cont = $item.attr('data-mbccontinue');
</pre>
The whole point of naming the attribute data-mbccontinue was that you could use 
<code>$item.data( 'mbccontinue' )</code> to access it.

<pre>
+                               var $content = 
$j(data.query.moodbarcomments[0].formatted);
</pre>
You need to check that <code>data.query.moodbarcomments[0].formatted</code> and 
all of its ancestors exist before accessing it like that. Otherwise, you'll get 
a JS error when the API serves you an error response where 
<code>data.error</code> is set and <code>data.query</code> is missing.

Also, the AJAX for showing a hidden comment has no spinner and doesn't prevent 
duplicate requests by disabling the link after it's clicked.


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

Reply via email to