User:MarkTraceur/Notes about OpenStackManager Ajaxification

Some notes about the Ajaxification that User:Ryan_Lane and I have done some work on, for future implementation:

How to add more methods
When you're adding more Ajaxy interfaces, here's the rough pattern you should follow:

Add the API method(s) you need to accomplish the action(s)
Without going too much into details, you'll need to add some API methods. There are multiple existing Api*.php files in the api/ directory in the git repository, and if you're adding a subaction to one of those existing modules, you'll probably only need to add things to the execute function, unless you need to add an optional parameter to the API module. If you're working on a page that doesn't have an API module yet, create the file with the same format as the existing ones.

Add or modify the ResourceLoader module(s) you need to control the interface
Again, big picture: You'll need to either modify or create the ResourceLoader module that represents the thing you want to manage with Ajax. It used to be all under one module, but loading all of the JavaScript on every page doesn't make much sense. It should depend on the mw.openstack module which has the basic CSS and supporting JavaScript.

The module should contain a subclass of mw.OpenStackInterface, and should register any click events to react to users clicking on the existing links in the interface.