pyrocms/pyrocms — pull request #1883 by roypouls (2012-09-20 06:42:55+00:00)
Title: Cleanup Admin JavaScript and maybe an new feature

I cleaned the admin javascript. Also added the module parameter.

I think you should bring the "constants" (APPPATH_URI, SITE_URL, etc.) also to the pyro object. Keep all pyro vars combined. But I think this should be discussed first. Also consider the possibility of an extend function to the pyro object like jquery does. I think this will give javascript devlopers the chance to add functions to PyroCMS.

If I dream on, PyroCMS gets a admin_javascript controller. Where one can send ajax requests to, loading the things they want like Phil did with the rest controller.

Option 2: a javscript module, that loads a javascript.php in the root of another module like an events or plugin file.

I think, if you do this right, ajax request to PyroCMS will be a lot easier, they don't ruin your controller files, and you can built in default validation for an ajax request.

Shoot at my idea!