Subversion Repositories SmartDukaan

Rev

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

Rev Author Line No. Line
24098 tejbeer 1
$(function() {
24106 tejbeer 2
 
24098 tejbeer 3
	$(".notification-panel").live('click', function() {
4
		loadNotificationfocoPanel("main-content");
5
	});
6
 
24106 tejbeer 7
	$("#submitEditor")
8
			.live(
9
					'click',
10
					function() {
11
						var editorData = CKEDITOR.instances['editor'].getData();
12
						console.log(editorData)
13
						var notificationData = {};
24098 tejbeer 14
 
24106 tejbeer 15
						notificationData['data'] = editorData;
24098 tejbeer 16
 
24106 tejbeer 17
						if (confirm("Are you sure you want to send notification!") == true) {
18
							doPostAjaxRequestWithJsonHandler(context
19
									+ "/notificationData", JSON
20
									.stringify(notificationData), function(
21
									response) {
22
								if (response == 'true') {
23
									alert("successfully send");
24
									loadNotificationfocoPanel("main-content");
25
								}
26
							});
27
 
28
							return false;
29
						}
30
					});
31
});
32
 
33
function loadNotificationfocoPanel(domId) {
34
 
35
	doGetAjaxRequestHandler(context + "/notificationPanel", function(response) {
36
		$('#' + domId).html(response);
37
		CKEDITOR.replace("editor");
38
 
24098 tejbeer 39
	});
40
}
25781 amit.gupta 41
$(document).ready(function() {
42
	messageType = $(this).data("messagetype");
43
	if($(this).hasClass('btn-pressed')) {
44
		messageType="";
45
		$('div.message-filter').find('button').removeClass('btn-pressed').addClass('btn-default');
46
	} else {
47
		$('div.message-filter').find('button').removeClass('btn-pressed').addClass('btn-default');
48
		$(this).addClass('btn-pressed').removeClass('btn-default');
49
	}
50
	notifyTypeChange(messageType);
25760 amit.gupta 51
});
25781 amit.gupta 52
notifyTypeChange("");
25760 amit.gupta 53