Subversion Repositories SmartDukaan

Rev

Go to most recent revision | Details | Last modification | View Log | RSS feed

Rev Author Line No. Line
24026 tejbeer 1
$(function() {
2
	$('.send-message').live('click', function() {
3
		loadMessagingPanel("main-content");
4
	});
5
 
6
	$('.create-message-button').live('click', function() {
7
		var userIds = $('#fofo-users').val();
8
		console.log("multipleUsers",userIds);
9
 
10
		var messageData ={};
11
		messageData['userIds'] =$('#fofo-users').val();
12
		messageData['messageText']=$('#messageText').val();
13
		console.log(messageData)
14
 
15
		if(confirm("Are you sure you want to send notification!") == true){
16
	doPostAjaxRequestWithJsonHandler(context+"/sendMessage", JSON.stringify(messageData), function(response){
17
	               if (response == 'true') {
18
						    alert("successfully send");
19
					loadMessagingPanel("main-content");
20
					}
21
			});
22
 
23
		return false;	
24
	}
25
 
26
 
27
	});
28
 
29
	});
30
 
31
	function loadMessagingPanel(domId){
32
  	doGetAjaxRequestHandler(context+ "/sendMessagingPanel", function(response){
33
		$('#' + domId).html(response);
34
 
35
	});
36
 
37
}