Subversion Repositories SmartDukaan

Rev

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

$(function() {

        $(".notification-panel").live('click', function() {
                loadNotificationfocoPanel("main-content");
        });

        $("#submitEditor")
                        .live(
                                        'click',
                                        function() {
                                                var editorData = CKEDITOR.instances['editor'].getData();
                                                console.log(editorData)
                                                var notificationData = {};

                                                notificationData['data'] = editorData;

                                                if (confirm("Are you sure you want to send notification!") == true) {
                                                        doPostAjaxRequestWithJsonHandler(context
                                                                        + "/notificationData", JSON
                                                                        .stringify(notificationData), function(
                                                                        response) {
                                                                if (response == 'true') {
                                                                        alert("successfully send");
                                                                        loadNotificationfocoPanel("main-content");
                                                                }
                                                        });

                                                        return false;
                                                }
                                        });
});

function loadNotificationfocoPanel(domId) {

        doGetAjaxRequestHandler(context + "/notificationPanel", function(response) {
                $('#' + domId).html(response);
                CKEDITOR.replace("editor");

        });
}
$(document).ready(function() {
        messageType = $(this).data("messagetype");
        if($(this).hasClass('btn-pressed')) {
                messageType="";
                $('div.message-filter').find('button').removeClass('btn-pressed').addClass('btn-default');
        } else {
                $('div.message-filter').find('button').removeClass('btn-pressed').addClass('btn-default');
                $(this).addClass('btn-pressed').removeClass('btn-default');
        }
        notifyTypeChange(messageType);
});
notifyTypeChange("");