Permalink
Browse files

add wander to index page

  • Loading branch information...
1 parent 0bbf85e commit bc941df03100648efaac3544f89e8100a4d3337a @danieleguido committed Mar 14, 2013
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
View
@@ -111,6 +111,8 @@ oo.api.Builder = function( model ){
this.methods = [ 'get', 'list', 'add', 'remove', 'edit' ];
this.model = model;
+
+
this.get = function( params, callback ){
instance.ajax( 'get', 'get', params, oo.api.urlfactory( oo.urls[ 'get_' + instance.model ], params.id ), callback );
@@ -129,15 +131,20 @@ oo.api.Builder = function( model ){
}
this.ajax = function( http_method, method, params, url, callback ){
- oo.log( '[oo.api.' + instance.model + '.' + method + '] url :', url );
+ oo.log( '[oo.api.' + instance.model + '.' + method + '] url :', url, ", params :",params );
$.ajax( $.extend( oo.api.settings[ http_method ],{
url: url,
data: params,
success:function(result){ oo.log( '[oo.api.' + instance.model + '.' + method + '] result :', result );
- oo.api.process( result, typeof callback == "undefined" ? oo.magic[ instance.model ][ method ]: callback, "id_" + method + "_" + instance.model );
+ oo.api.process( result, typeof callback == "undefined" ? oo.magic[ instance.model ][ method ]: callback, typeof params.auto_id == "undefined"? "id_" + method + "_" + instance.model: params.auto_id );
}}));
}
+ // check urls availability
+ for( i in instance.methods ){
+ oo.log('[oo.api.Builder:' + instance.model +']', 'urls ', instance.methods[i] + '_' + instance.model, ":", typeof oo.urls[ instance.methods[i] + '_' + instance.model ] != "undefined" )
+ }
+
}
Oops, something went wrong.

0 comments on commit bc941df

Please sign in to comment.