New in 0.5 Beta 2 since Beta 1: xajax.inc.php changes: * Modified portions of the code to allow PHP functions registered with xajax to optionally return text or XML data other than a response object that can be handled by a custom response handler function. These kinds of function must be called using xajax.call with a parameter that indicates the function that will handle the response. To use it the allowAllResponseTypes flag must be set to true. * New useUncompressedScripts flag allows you to switch to using the uncompressed * Javascript files easily. * The risk of cross-site scripting attacks via the automatic URI detection has * been dimished through additional protection. xajaxResponse.inc.php changes: * New removeScript and removeCSS methods to unload Javascript or CSS files in the client * New waitForScript and waitForCSS methods to attempt to load Javascript or CSS files and hold off on processing further commands until they're loaded or the queue times out. * New xajaxCall object you can use to assemble Javascript code for xajax.call quickly. Javascript engine: * It's new and it's shiny! Inside of xajax_core, there are ten modules: * xajax is the main module which handles the basic call/request/response lifecycle * xajax.callback allows functions to be called during the response lifecycle * xajax.config stores the run-time configuration of the xajax engine * xajax.css contains functions that manipulate stylesheets * xajax.dom contains functions that manipulate the HTML DOM * xajax.events contains functions that setup run-time DHTML events * xajax.forms contains functions that help you construct HTML forms * xajax.js contains functions that handle Javascript files * responseProcessor contains the default xajax XML response processor (with more to come) * tools contains some miscellaneous utility functions The changes between this engine and the previous one in Beta 1 are simply too numerous to mention, so your best bet is to check out all the tests to see how you can perform various tasks, and of course read the documentation once it goes online. This engine will provide a solid platform for further xajax client-side innovation going forward. ---- New in 0.5 Beta 1 since 0.2.4: Package-wide changes: * All of the PHP files have been moved to xajax_core, so the PHP and Javascript files are now in separate folders. * All tests and examples have been updated to work with the new 0.5 API. * A new file, legacy.inc.php, can be included in your PHP scripts if you want to be able to use the 0.2.4 xajax API. However, it is recommended you update your scripts to the 0.5 API as soon as possible as the legacy API will likely be dropped in a future version of xajax. * A new plugin layer has been implemented for the xajax and xajaxResponse classes. The basis for this is the xajaxPluginManager class which provides for registering and accessing plugins for the different xajax components. * xajax is now licensed under the BSD license rather than the LGPL license. This means you can include xajax and modify it when using it with commercial PHP applications without having to worry about tricky legal issues. xajax Plugin Layer: * xajax now uses plugins to process requests and output Javascript include code. You can subclass the default plugins to alter major xajax functionality or write your own plugins from scratch. * You can use plugins with xajaxResponse, allowing you to output custom commands to the Web client. (Note: this won't be very useful until the a new plugin system is implemented in the xajax Javascript engine.) * Plugin layer documentation forthcoming. xajax.inc.php changes: * The xajax constructor has been simplified to allow only one optional argument (the request URI). * New getGlobalResponse method lets you use the same response in multiple functions. It also makes it easier to set up the response to have the same encoding and entity settings as the xajax parent object. * New getVersion method returns the xajax version. * All of the ___On and ___Off methods have been replaced with a single setFlag (or setFlags) method. For instance, debugOn() would now be setFlag("debug", true). exitAllowedOff() would now be setFlag("exitAllowed", false). * New setTimeout and getTimeout methods for controlling the delay before the client shows an error alert if the xajax Javascript engine failed to load (just set to 0 to suppress any error alert). * Registering functions to use only GET or POST for the HTTP connection is no longer possible. All functions use POST by default, and if for some reason you need to force using GET, you can use the xajax.call syntax on the client-side. * The registerFunction method now provides an optional second argument for specifying a PHP file to include, thereby eliminating the need for the registerExternalFunction method. * New registerCallableObject method registers an object that xajax will check to see if it contains a method with the same name as the incoming xajax function. If it finds one, it will go ahead and call that method as if it had been manually registered with xajax (and in PHP 5, it will _always_ go ahead with the method call if a __call magic method is present). * The registerPreFunction and registerCatchAllFunction methods have been eliminated and replaced with the new registerEvent method. You can register one or more functions or class/object methods to be notified when certain events in the xajax lifecycle are triggered. The "pre function" is now the "beforeProcessing" event. The "catch all function" is now the "onMissingFunction" event. * The canProcessRequests and processRequests methods are now singular (i.e., canProcessRequest and processRequest). * All of the following methods use an xajaxRequestProcessorPlugin subclass (typically xajaxDefaultRequestProcessorPlugin) to perform all neccessary work: * canProcessRequest * getProcessMode * processRequest * All of the following methods use an xajaxIncludePlugin subclass (typically xajaxDefaultIncludePlugin) to perform all necessary work: * printJavascript * getJavascript * getJavascriptConfig * getJavascriptInclude xajaxResponse.inc.php changes: * All method names for adding commands have had their "add" prefixes removed (though of course addEvent and addHandler remain). In other words, addAssign is now just assign, addScript is now just script, etc. In addition, all of the command methods return $this (the xajaxResponse object) to allow for "fluent interface" usage in PHP 5. * Internally all of the commands are stored as array-based data structures and are only converted to XML upon final output. Several new methods allow for adding command data manually and merging commands from other response objects. Much of this functionality is extremely useful for response plugins. * As part of the new xajax plugin layer, response object plugins that were registered with the plugin manager can be accessed either via the plugin method on PHP 4 and 5 (with two different call types) or as properties via the __get magic method in PHP 5. * New includeScriptOnce and includeCSS commands available. * IMPORTANT: you may no longer return the getXML() method output as your return value in registered xajax functions. Please return the response object directly. xajax_uncompressed.js Javascript changes: * The Javascript engine for xajax has been substantially rewritten and is still undergoing major changes. Note that some of the changes are "reversed" when using the xajax legacy PHP class (specifically xajax.call, xajax.loadingFunction, and xajax.doneLoadingFunction work the same as before). * xajax.call now supports only two arguments, the first being the function name to call on the server and the second being a Javascript dictionary-style object you can use to specify parameters, event callbacks, and other options (in a manner reminiscent of Prototype). * xajax.loadingFunction and xajax.doneLoadingFunction have been replaced by xajax.eventFunctions.globalRequestDelay and xajax.eventFunctions.globalRequestComplete (though in most cases it is recommended that you make use of the per-call event callbacks mentioned above). * Instead of expecting options set by the xajax include code such as xajaxRequestUri or xajaxDebug, the Javascript engine now expects an xajaxConfig object to be present in the global namespace with properties such as requestURI and debug. * The xajax Javascript object is now written using brackets syntax ala Prototype and many other modern Javascript libraries.