Subversion Repositories SmartDukaan

Rev

Rev 3168 | Rev 3234 | Go to most recent revision | Blame | Compare with Previous | Last modification | View Log | RSS feed

$(function() {
        $("a.show-order-details").live('click', function() {
                var orderId = $(this).attr('orderId');
                var userId = $(this).attr('userId');
                loadOrderInfo("bottom-infopane", userId, orderId);
        });

        $("a.show-user-details").live('click', function() {
                var userId = $(this).attr('userId');
                loadUserPane("infopane", userId);
        });
        
        $("a.show-orders").live('click', function() {
                var userId = $(this).attr('userId');
                loadOrderPane("infopane", userId, 0);
        });
        
        $("a.show-cart").live('click', function() {
                var userId = $(this).attr('userId');
                var cartId = $(this).attr('cartId');
                loadCartPane("infopane", userId, cartId);
        });
        
        $("a.show-user-communication").live('click', function() {
                var userId = $(this).attr('userId');
                loadUserCommunicationPane("infopane", userId);
        });

        $("a.show-line-details").live('click', function() {
                var userId = $(this).attr('userId');
                var itemId = $(this).attr('itemId');
                loadLineInfo("bottom-infopane", userId, itemId);
        });

        $("a.show-comm-details").live('click', function() {
                var userId = $(this).attr('userId');
                var commId = $(this).attr('commId');
                loadCommunicationInfo("bottom-infopane", userId, commId);
        });

        $("a.show-tickets").live('click', function() {
                var userId = $(this).attr('userId');
                loadTicketPane("infopane", userId, 0);
        });

        $("a.show-activity").live('click', function() {
                var userId = $(this).attr('userId');
                loadActivityPane("infopane", userId);
        });

        $("a.show-ticket-details").live('click', function() {           
                var ticketId = $(this).attr('ticketId');
                loadTicketInfo("bottom-infopane", ticketId, null);
        });

        $("a.show-activity-details").live('click', function() {
                var activityId = $(this).attr('activityId');
                var userId = $(this).attr('userId');
                loadActivityInfo("bottom-infopane", userId, activityId);
        });

        $("a.create-ticket").live('click', function() {
                var userId = $(this).attr('userId');
                loadTicketCreationForm("infopane", userId);
        });

        $("a.create-activity").live('click', function() {
                var userId   = $(this).attr('userId');
                loadActivityCreationForm("infopane", userId);
        });

        $('#update-ticket-form').live('submit', function() {
                var ticketId = $(this).attr('ticketId');
                updateTicket("infopane", ticketId, $(this).serialize());
                return false;
        });

        $('form#mail-form').live('submit', function() {
                var ticketId = $('#update-ticket-form').attr('ticketId');
                updateTicket("infopane", ticketId, $(this).serialize() + '&' + $('#update-ticket-form').serialize());
                $.colorbox.close();
                return false;
        });

        $('#create-ticket-form').live('submit', function() {
                createTicket("infopane", $(this).serialize());
                return false;
        });

        $('#create-activity-form').live('submit', function() {
                createActivity("infopane", $(this).serialize());
                return false;
        });

        $(".home-page").click(function() {
                goToHomePage();
        });

        $(".my-open-tickets").live('click', function() {
                loadMyOpenTickets('infopane');
        });

        $(".my-tickets").live('click', function() {
                loadMyTickets('infopane');
        });

        $(".unassigned-tickets").live('click', function() {
                loadUnassignedTickets('infopane');
        });

        $(".all-open-tickets").live('click', function() {
                loadAllOpenTickets('infopane');
        });

        $(".all-tickets").live('click', function() {
                loadAllTickets('infopane');
        });

        $("form").ajaxSend( function(evt, request, settings) {
                $("#spinner-div").show();
    });

        $("form").ajaxComplete( function(evt, request, settings) {
                $("#spinner-div").hide();
    });

        $("a").ajaxSend( function(evt, request, settings) {
                $("#spinner-div").show();
    });

        $("a").ajaxComplete( function(evt, request, settings) {
                $("#spinner-div").hide();
    });

        $("select#activity-type").live('change', function() {
                var userId = $(this).attr('userId');
                processActivityTypeChange(userId, $(this).val());
        });
});