|
@ -162,9 +162,9 @@ $.api = $.fn.api = function(parameters) { |
|
|
|
|
|
|
|
|
// exit conditions reached, missing url parameters
|
|
|
// exit conditions reached, missing url parameters
|
|
|
if( !url ) { |
|
|
if( !url ) { |
|
|
if($module.is('form')) { |
|
|
|
|
|
module.debug('No url or action specified, defaulting to form action'); |
|
|
|
|
|
url = $module.attr('action'); |
|
|
|
|
|
|
|
|
if( module.is.form() ) { |
|
|
|
|
|
url = $module.attr('action') || ''; |
|
|
|
|
|
module.debug('No url or action specified, defaulting to form action', url); |
|
|
} |
|
|
} |
|
|
else { |
|
|
else { |
|
|
module.error(error.missingURL, settings.action); |
|
|
module.error(error.missingURL, settings.action); |
|
@ -212,6 +212,12 @@ $.api = $.fn.api = function(parameters) { |
|
|
disabled: function() { |
|
|
disabled: function() { |
|
|
return ($module.filter(settings.filter).length > 0); |
|
|
return ($module.filter(settings.filter).length > 0); |
|
|
}, |
|
|
}, |
|
|
|
|
|
form: function() { |
|
|
|
|
|
return $module.is('form'); |
|
|
|
|
|
}, |
|
|
|
|
|
input: function() { |
|
|
|
|
|
return $module.is('input'); |
|
|
|
|
|
}, |
|
|
loading: function() { |
|
|
loading: function() { |
|
|
return (module.request && module.request.state() == 'pending'); |
|
|
return (module.request && module.request.state() == 'pending'); |
|
|
} |
|
|
} |
|
@ -508,10 +514,10 @@ $.api = $.fn.api = function(parameters) { |
|
|
data = {} |
|
|
data = {} |
|
|
; |
|
|
; |
|
|
if( !$.isWindow(element) ) { |
|
|
if( !$.isWindow(element) ) { |
|
|
if( $module.is('input') ) { |
|
|
|
|
|
|
|
|
if( module.is.input() ) { |
|
|
data.value = $module.val(); |
|
|
data.value = $module.val(); |
|
|
} |
|
|
} |
|
|
else if( $module.is('form') ) { |
|
|
|
|
|
|
|
|
else if( !module.is.form() ) { |
|
|
|
|
|
|
|
|
} |
|
|
} |
|
|
else { |
|
|
else { |
|
@ -570,7 +576,7 @@ $.api = $.fn.api = function(parameters) { |
|
|
url = settings.api[action]; |
|
|
url = settings.api[action]; |
|
|
module.debug('Found template url', url); |
|
|
module.debug('Found template url', url); |
|
|
} |
|
|
} |
|
|
else { |
|
|
|
|
|
|
|
|
else if( !module.is.form() ) { |
|
|
module.error(error.missingAction, settings.action, settings.api); |
|
|
module.error(error.missingAction, settings.action, settings.api); |
|
|
} |
|
|
} |
|
|
} |
|
|
} |
|
|