Dear Xajax developers
First of all: thank you for a great piece of software. Over the last couple of months I have been integrating xajax into my companys zend-based framework and have created an Xxx_Xajax_Controller and Xxx_Xajax_Crud class with it, which both turned out great and has really speeded up our ajax developement. I have not delved very far into the code itself as there hasn't been a need
, but here is a couple of suggestions. Please correct me if these features already exists.
### Pure js ###
I dont like all that js in the head so it would be nice to have a method that returns pure javascript. ATM. im using this hack that strips out all the html from printJavascript():
/**
* prints out xajax javascript without the tags
*/
public function printJavascript () {
if (@$_GET['pfw'] == 'xajax') {
$js = $this->Xajax->getJavascript();
$js = preg_replace('/<script[^>].*>/Uis', '', $js);
$js = str_replace ('</script>', '', $js);
$js = str_replace ('/* <![CDATA[ */', '', $js);
$js = str_replace ('/* ]]> */', '', $js);
$js .= "xajax.callback.global.onRequest = function() {xajax.$('loading').style.display = 'block';}
xajax.callback.global.beforeResponseProcessing = function() {xajax.$('loading').style.display='none';}";
echo $js;
die();
}
and then I add <script src="/blah/controller.php?pfw=xajax"> in the head.
Maybe you could give printJavascript a parameter like printJavascript(xajax::PURE_JS) or something?
### Output buffer ###
It would be cool if there was a outputBuffer flag to xajax. Could be combined with a $xajax->configure('Debug To', ''theDivWhereIWantToWriteTheDebug'') that would write the buffered data to a div on the page.
### Exceptions ###
Should it be possible to do stuff like:
throw new xajaxException ('The article does not exist', xajax::CRITICAL);
and have xajax catch it and output it to page on a given div?
### Charset ###
We have a couple of sites in latin1. It would look prettier with just _one_ setting instead of:
$this->Xajax->configure('characterEncoding', $charset);
$this->Xajax->setCharEncoding($charset);
$this->Xajax->setFlag('decodeUTF8Input', true);
which seems to be the winning combination. Maybe the middle line is not neccesary come to think of it, but still:)
### Questions ###
1) Have there ever been any thoughts about a mapping between xajax requests and normal non-javascript requests? It seems almost doable to have the pages degrade gracefully. This is something I will be looking at in the time to come.
### return $xajaxResponse(); ###
Thats it, again thx a lot and is looking forward seeing the 0.6 version. Let me you if there is anything I can do to help!
Rune
Last edited by rune_kg (2008-11-02 11:21:29 AM)