ez projects / ezjscore / forum / general / mootools?
You need to be logged in to post messages in the forums. New users may register here.
Member since: Posts: 15 |
Friday 16 April 2010 8:37:19 pm Hello,
do you plan to include Mootools JS Framework by default? Thanks |
|
|
Member since: Posts: 171 |
Saturday 17 April 2010 12:52:30 pm No, but feel free to contribute :) Only thing you need is a "server function"* to handle the glue code for ajax calls, and optionally one for selecting remote / locale repository based on ezjscore setting.
* see for instance ezjsc::jqueryio, function jqueryio in: http://svn.projects.ez.no/ezjscor...e/classes/ezjscserverfunctionsjs.php The ezjsc alias for the ezjscServerFunctionsJs class is setup in ezjscore.ini. Suggested project name moojscore / moocore / ezjscore_mootools (but by naming convention, ez prefix should only be used by eZ Systems, even though that is not strictly followed..). -- |
|
Member since: Posts: 15 |
Saturday 17 April 2010 3:12:16 pm Actullay. now i have nxc_mootools extension,wich contains mootools "kernel" and some usefull plugins,wrote by myself. And now it dosent uses jscore at all. But i will try to adopt it for js core, and publish it. Thans for advices and suggestions :)
|
|
Member since: Posts: 15 |
Saturday 17 April 2010 3:30:54 pm By the way, for AJAX calls i`m using http://pastebin.com/TfSKUnWv. This class standardises all AJAX Responses. Example usage in PHP:
<?php $response = new nxcMootoolsAJAXResponse(); $response->setStatus( nxcMootoolsAJAXResponse::STATUS_SUCCESS ); $response->setMessage( 'Some message' ); $response->addError( 'Some error1' ); $response->addError( 'Some error2' ); $response->addError( 'Some error3' ); $response->someVar1 = 'test'; $response->someVar2 = 'test2'; $response->output(); ?> And parsing response in JavaScript: new Request.JSON( { 'url' : someURL, 'method' : 'post', 'onSuccess': function( response ) { if( response.status.toInt() === 1 ) { window.messageStack.showMessage( response.message, 'notice' ); console.log( response.data.someVar1 ); console.log( response.data.someVar2 ); } else { new Hash( response.errors ).each( function( errorMessage ) { window.messageStack.showMessage( errorMessage, 'error' ); } } } } ).send( document.id( 'myFormID' ).toQueryString() ); |
You need to be logged in to post messages in the forums. New users may register here.