$(function(){

    $("body").delegate("[data-action='ajax-request']", "click", function(event)
    {
        event.preventDefault();

        var url = $(this).attr('href');
        var type = $(this).attr('data-type');
        var box = $(this).attr('data-response');
        var data = $(this).attr('data-object');

        var call = eval($(this).attr('data-callback')) || {};        
        call.success = call.success || new Function();

        $.ajax({
            url: url,
            type: type,
            data: eval(data),
            beforeSend: function() {
                $(box).html("<img class='responsive-image-320' src='img/preloader.gif' width='50' />");
            },
            error: function(jqXHR, textStatus, errorThrown)
            {
                $(box).html("<div class='alert alert-danger'>Ha ocurrido un error inesperado!</div>");
            },
            success: function(data)
            {
                $(box).html(data);
                call.success();
            }
        });
    });    

});

@@ -8,16 +8,2627 @@
 ion()%7B%0A%0A
+    $(%22%5Bdata-role='file-actions'%5D%22).click(function(event)%7B%0A        event.preventDefault();%0A%0A        var url = $(this).attr('href');%0A%0A        $.ajax(%7B%0A            url: url,%0A            data: %7B%7D,%0A            beforeSend: function() %7B%0A                $(%22#file-functions%22).openModal();%0A            %7D,%0A            error: function()%0A            %7B%0A                $(%22#file-functions .modal-content%22).html('Error!');%0A            %7D,%0A            success: function(data)%0A            %7B%0A                $(%22#file-functions .modal-content%22).html(data);%0A            %7D%0A        %7D);%0A    %7D);%0A%0A    $(%22#get-views-from-controller%22).click(function(event) %7B%0A        event.preventDefault();%0A%0A        var url = $(this).attr('href');%0A        var module = $(this).attr('data-module');%0A        var controller = $(this).attr('data-controller');%0A%0A        $.ajax(%7B%0A            url: url,%0A            method: 'post',%0A            data: %7B module: module, controller: controller %7D,%0A            beforeSend: function()%0A            %7B%0A                $(%22#show-views-from-controller%22).openModal();%0A            %7D,%0A            error: function()%0A            %7B%0A                $(%22#show-views-from-controller .modal-content%22).html('Error!');%0A            %7D,%0A            success: function(data)%0A            %7B%0A                $(%22#show-views-from-controller .modal-content%22).html(data);%0A            %7D%0A        %7D);%0A    %7D);%0A%0A    $(%22#save-file-action%22).submit(function(event)%0A    %7B%0A        event.preventDefault();%0A%0A        var url = $(this).attr('action');%0A        var type = $(this).attr('method');%0A        var data = $(this).serializeArray();%0A%0A        $.ajax(%7B%0A            url: url,%0A            type: type,%0A            data: data,%0A            dataType: 'json',%0A            beforeSend: function()%0A            %7B%0A                $(%22#save-file-action-loader%22).show(500);%0A                $(%22#save-file-action-response%22).hide(500)%0A                $(%22#save-file-action-response%22).empty();%0A            %7D,%0A            error: function()%0A            %7B%0A                $(%22#save-file-action-response%22).html(%22%3Cdiv class='card-panel red'%3EError al guardar los cambios!%3C/div%3E%22);%0A            %7D,%0A            success: function(data)%0A            %7B%0A                if (!data.success)%0A                    $(%22#save-file-action-response%22).html(%22%3Cdiv class='card-panel red'%3EError al guardar los cambios!%3C/div%3E%22);%0A            %7D,%0A            complete: function()%0A            %7B%0A                setTimeout(function()%7B%0A                    $(%22#save-file-action-response%22).show();%0A                %7D, 1000)%0A%0A                $(%22#save-file-action-loader%22).hide(500);%0A            %7D%0A        %7D);%0A    %7D);%0A%0A
     $(%22b
@@ -2691,32 +2691,32 @@
 function(event)%0A
-
     %7B%0A        ev
@@ -2983,24 +2983,16 @@
 ) %7C%7C %7B%7D;
-        
 %0A       
@@ -3628,19 +3628,15 @@
 %7D);%0A
+
     %7D);
-    
 %0A%0A%7D)

Add functions to module/Pleets