Future major features

 
 
Picture of Petr Škoda
jQuery support for add-ons
Group DevelopersGroup Documentation writersGroup Moodle HQGroup Particularly helpful Moodlers
Hello,

if you are a developer interested in using jQuery in your add-ons please have a look at my proposed solution in MDL-15727 and http://docs.moodle.org/dev/jQuery

Please note this does not mean Moodle is switching from YUI to jQuery.

Petr
 
Average of ratings:Useful (4)
Picture of Andrew Nicols
Re: jQuery support for add-ons
Group DevelopersGroup Moodle HQGroup Particularly helpful MoodlersGroup Testers

I think it's also worth pointing out that YUI is still the recommended way of doing things for add-ons/plugins in Moodle. This is just to provide a consistent way of doing things for those developers who really really really do not want to use YUI for some reason.

Andrew

 
Average of ratings:Useful (2)
Picture of Valery Fremaux
Re: jQuery support for add-ons
Group Particularly helpful Moodlers

Note that many external developpers indeed find YUI (specially YUI3) quite opaque way of programming (including for long time experimented devs big grin, or maybe i'm getting too old for this bulls...t ?). Is there some "essential" documentation that are worth to be read for starting understanding key "way of thinking" in YUI3 for Moodle ?

At this time, i personnaly will continue following integration of "water clear" frameworks such as XHTML plugins and JQuery ajaxisation... till i can penetrate this bush....

Cheers !

 
Average of ratings: -
Picture of Andrew Nicols
Re: jQuery support for add-ons
Group DevelopersGroup Moodle HQGroup Particularly helpful MoodlersGroup Testers

Hi Valery,

Sorry to hear that you find YUI3 so opaque. if you could perhaps indicate which bits you find confusing, we may be able to help further. It took me a little while to get my head around the way in which YUI3 handles things, but once it clicked it made a lot more sense for me and the benefits for Moodle become clearer.

I've been trying to improve the Moodle YUI documentation over the past year or so, but if there's something specific you think we're missing I can put pen to paper and try and clarify things further.

The way in which we now handle YUI (as of Moodle 2.5) is much more similar to the way in which YUI handle YUI and generally the upstream documentation is worth having on tap. The only real things to bear in mind as key differences are:

  • you must write your JS in a YUI module (see the Shifter and Module docs below)
  • our module namespace is moodle-frankenstyle_modname-yuimodulename
  • you must include YUI modules from php using $PAGE->requires->yui_module('moodle-frankenstyle_modname-yuimodulename', 'M.frankenstyle_modname.yuiodulename.initFunction', array(array('a' => 'list', 'of' => 'arguments'));

This is the Moodle-specific documentation:

In terms of upstream documentation, the YUI API is really handy and I find myself delving into it to find and check things daily - http://yuilibrary.com/yui/docs/api/

The YUI user guides (http://yuilibrary.com/yui/docs/guides/) are also very useful, as are the examples which you'll find on the right-hand side in the user guides).

I'd also highly recommend Evan Goer's O'Reilly cookbook. He's provided a three-chapter sample at http://www.goer.org/YUI/ which is also extremely handy.

Hope that this helps, and as I say, if there's anything specific you think we could do with documentation on, I'll try my best to whip something up.

Best wishes and happy New Year,

Andrew

 
Average of ratings:Useful (1)
Picture of Conn Warwicker
Re: jQuery support for add-ons
 

We use jQuery for all our custom blocks that we use here/give out to whoever wants them.

YUI is terrible, limited and the documentation is appalling. jQuery is superior is pretty much every way.

 

 
Average of ratings: -
Picture of Andrew Nicols
Re: jQuery support for add-ons
Group DevelopersGroup Moodle HQGroup Particularly helpful MoodlersGroup Testers

I'm sorry, but I completely disagree on all three accounts.

YUI's documentation is extremely good - I personally much prefer it to jQuery. It is also very well tested against many browsers, and I do not feel that it is limited as a library. jQuery is itself somewhat limited without the presence of it's many optional and differently-versioned libraries.

Andrew

 
Average of ratings: -
Picture of Conn Warwicker
Re: jQuery support for add-ons
 

Well you are welcome to your opinion of course, but I don't agree with any of it.

 
Average of ratings: -