Note:

If you want to create a new page for developers, you should create it on the Moodle Developer Resource site.

Getting Started With Moodle Java Script Coding: Difference between revisions

From MoodleDocs
No edit summary
No edit summary
 
(2 intermediate revisions by the same user not shown)
Line 1: Line 1:
{{obsolete}} Please note that much of this documentation is obsolete. A replacement is available in [[YUI]].
{{obsolete}} This page text has been removed because it is obsolete. A replacement is available in [https://docs.moodle.org/dev/Javascript_Modules Javascript Modules].
 
This is meant to be a page for helping beginners to using JS and YUI 2 / 3 in Moodle.
 
==Moodle Settings for Javascript Development==
 
The following settings will ensure that the js loaded by your browser is relatively readable.
 
Make sure that :
 
* your  Development / Debugging / Debug messages is set to "Developer : Extra Debug Moodle Messages ...." - Moodle will then use the debug non-minified and thus more readable YUI 2 and YUI 3 library files.
* You will probably want to change some of the settings at "Home / Site administration / Appearance / AJAX and Javascript" :
** YUI combo loading - you probably want to turn this off so that files are not combined.
** Javascript caching and compressing - turn this off so that your custom JS code is not minified.
** Check the other settings on this page to see that they are as you would expect them to be.
 
==Use Firebug or the Built in Chrome Developer Tools==
 
Once the js code that you load into the browser is a little more readable you can now use the excellent debugging tool built into Chrome, the Firebug extension available for FF or Firebug lite for IE.
 
These tools allow you to set breakpoints in js code examine variable and to use commands in your js such as console.log() which can give you a treeview of the contents of the contents of any object that you send it.
 
==Support for JS in Your PHP Editor==
 
Am not sure if there is the possibility to get context sensitive help or to be able to jump to declaration of classes, methods etc in PHP editors such as Eclipse, Zend IDE etc.
 
==Documentation on the Use of JS in Moodle==
 
* [[:Category:Javascript]] - all js related pages in the docs.
* [[JavaScript guidelines]]
* [[How to create a YUI 3 module]] describes how to create a 'static module' which is also described in the guidelines above and also how to create a more advanced 'YUI 3 Moodle Module'
* There are a couple of interesting FAQ pages :
** [[JavaScript FAQ]]
** [[Javascript and YUI 3 FAQ]]
 
 
[[Category:Javascript]]

Latest revision as of 05:32, 2 December 2016

Warning: This page is no longer in use. The information contained on the page should NOT be seen as relevant or reliable.
This page text has been removed because it is obsolete. A replacement is available in Javascript Modules.