16 lines
371 B
JavaScript
16 lines
371 B
JavaScript
CodeOceanEditorAJAX = {
|
|
ajax: function(options) {
|
|
return $.ajax(_.extend({
|
|
dataType: 'json',
|
|
method: 'POST',
|
|
}, options));
|
|
},
|
|
|
|
ajaxError: function(response) {
|
|
var message = ((response || {}).responseJSON || {}).message || '';
|
|
|
|
$.flash.danger({
|
|
text: message.length > 0 ? message : $('#flash').data('message-failure')
|
|
});
|
|
}
|
|
}; |