Last modified: 2012-04-16 09:16:02 UTC

Wikimedia Bugzilla is closed!

Wikimedia migrated from Bugzilla to Phabricator. Bug reports are handled in Wikimedia Phabricator.
This static website is read-only and for historical purposes. It is not possible to log in and except for displaying bug reports and their history, links might be broken. See T32007, the corresponding Phabricator task for complete and up-to-date bug report information.
Bug 30007 - The function mw.loader.using is not loading modules
The function mw.loader.using is not loading modules
Status: RESOLVED INVALID
Product: MediaWiki
Classification: Unclassified
JavaScript (Other open bugs)
unspecified
All All
: Unprioritized normal (vote)
: ---
Assigned To: Nobody - You can work on this!
:
Depends on:
Blocks:
  Show dependency treegraph
 
Reported: 2011-07-21 21:24 UTC by Helder
Modified: 2012-04-16 09:16 UTC (History)
2 users (show)

See Also:
Web browser: ---
Mobile Platform: ---
Assignee Huggle Beta Tester: ---


Attachments

Description Helder 2011-07-21 21:24:17 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?
Comment 1 Roan Kattouw 2011-07-21 21:26:11 UTC
jquery.colorUtil is not available in MediaWiki 1.17, so that code won't work on the live site.
Comment 2 Helder 2011-07-21 22:08:56 UTC
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

Note You need to log in before you can comment on or make changes to this bug.


Navigation
Links