"MaxSem" changed the status of MediaWiki.r109721 to "ok"
URL: http://www.mediawiki.org/wiki/Special:Code/MediaWiki/109721

Old status:  new
> New status: ok

Commit summary for MediaWiki.r109721:

[ApiSandbox] front-end code clean up
CSS:
* #api-sandbox-output: removing all styling
-- width: 100%; Parent element has padding. Children with width 100% will 
exceed the box and cause scroll bars
-- overflow: scroll; Don't force scroll bars in both directions all the time. 
auto will show them for other one or both directions, when needed.
-- height: use the page scrollbar, instead of a limited height so that users 
can see more of the result on their screen (making optimal use of the window 
height)
* .api-sandbox-label: removing font-family, using <code> instead
-- "font-family: monospace;" shows a very tiny font, should use "font-family: 
Courier" as preference first. Wikis might want to style code information in a 
custom way as well. Applying all that by using <code>

JS:
* Aliasing mw and undefined locally
* Using strict comparison to undefined instead of operating typeof and 
comparing strings
* Moving definitions out of jQuery( domready fn ). No need to postpone all 
those declarations to after document-ready, speed up by putting only dom 
manipulation and invocations inside the domready hook
* Order of definitions
* Coding style and other minor stuff
* Changing interactive states through properties instead of attributes 
(changing attribute disabled, checked, value etc. only change the html document 
element, not the live presentation, need to change properties for that). jQuery 
falls back from .attr() to .prop() for some attributes, but that should not be 
relied on, and is deprecated:
-- - $foo.attr( 'disabled', 'disabled' ); $foo.removeAttr( 'disabled' );
-- + $foo.prop( 'disabled', true ); $foo.prop( 'disabled', false )
* Removing no-oop line that causes exception to be thrown:
-- $examplesContainer.hide();
-- > ReferenceError: $examplesContainer not declared anywhere
* Moving var statements to the top of each scope, so that it becomes clear when 
a variable is re-used (JavaScript has no block scope or loop scope, a second 
var statement for the same variable name in the same scope is simply ignored, 
there were a few for-loops using each others 'i' variable). Also makes it easy 
to re-arrange functions since one doesn't have to pay attention if 'var' is 
already there. Always keep it at the top. JavaScript does this internally at 
runtime if not already.
* Fixing broken line:
-- typeof selected !== 'array'
-- There is no typeof 'array' in JavaScript. Pretty much everything is an 
object (e.g. new Array() etc. literal [] doesn't change that). Using $.isArray 
instead

* Using mw.config.get( 'wgFormattedNamespaces' ) instead of AJAX request to 
ApiQuerySiteinfo (namespace info is available from config on all pages)

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

Reply via email to