Last modified: 2012-04-16 09:16:02 UTC
On [[mw:ResourceLoader/Default_modules#mediaWiki.loader]] there is the following example: -------------------------------------------------- mw.loader.using( 'jquery.colorUtil', function() { var curColor = 'rgb(70,140,210)'; var newColor = $.colorUtil.getColorBrightness( curColor, +0.2 ); alert( '20% brigher than ' + curColor + ' is ' + newColor ); } ); -------------------------------------------------- if I run it on javascript console of Google Chrome 12.0.742.122, while I am at [[some wiki page]] I get the following error: =============================================================== TypeError: Cannot call method 'getColorBrightness' of undefined =============================================================== Am I missing something or there is a problem with mw.loader.using?
jquery.colorUtil is not available in MediaWiki 1.17, so that code won't work on the live site.
Hmmm... indeed: http://translatewiki.net/w/resources/jquery/jquery.colorUtil.js http://en.wikipedia.org/w/resources/jquery/jquery.colorUtil.js I just compared http://svn.wikimedia.org/viewvc/mediawiki/branches/wmf/1.17wmf1/resources/jquery/ and http://svn.wikimedia.org/viewvc/mediawiki/trunk/phase3/resources/jquery/ and the following modules are only in the later: jquery.byteLength.js jquery.byteLimit.js jquery.colorUtil.js jquery.form.js jquery.getAttrs.js jquery.hoverIntent.js jquery.makeCollapsible.css jquery.makeCollapsible.js jquery.messageBox.css jquery.messageBox.js jquery.mwPrototypes.js jquery.qunit.completenessTest.js jquery.qunit.css jquery.qunit.js jquery.tablesorter.js