Subversion Repositories SmartDukaan

Rev

Rev 25683 | Rev 25685 | Go to most recent revision | Show entire file | Ignore whitespace | Details | Blame | Last modification | View Log | RSS feed

Rev 25683 Rev 25684
Line 1... Line 1...
1
$(function() {
1
$(function() {
2
	$('.send-notification').live('click', function() {
2
	$('.send-notification').live('click', function() {
-
 
3
		
3
		loadNotificationPanel("main-content");
4
		loadNotificationPanel("main-content");
4
	});
5
	});
5
 
6
 
6
	$('.create-notification-button')
7
	$('.create-notification-button')
7
			.live(
8
			.live(
Line 82... Line 83...
82
						notificationData['messageType'] = $('#messageType')
83
						notificationData['messageType'] = $('#messageType')
83
								.val();
84
								.val();
84
						console.log(notificationData)
85
						console.log(notificationData)
85
 
86
 
86
						if (confirm("Are you sure you want to send notification!") == true) {
87
						if (confirm("Are you sure you want to send notification!") == true) {
87
							doPostAjaxRequestWithJsonHandler(context
88
							doPostAjaxRequestWithJsonHandler(
88
									+ "/sendNotification", JSON
89
									context + "/sendNotification",
89
									.stringify(notificationData), function(
90
									JSON.stringify(notificationData),
90
									response) {
91
									function(response) {
91
								if (response == 'true') {
92
										if (response == 'true') {
92
									alert("successfully send");
93
											alert("successfully send");
93
									loadNotificationPanel("main-content");
94
											loadNotificationPanel("main-content");
-
 
95
											localStorage
-
 
96
													.removeItem("notifyDocument");
94
								}
97
										}
95
							});
98
									});
96
 
99
 
97
							return false;
100
							return false;
98
						}
101
						}
99
 
102
 
100
					});
103
					});
101
 
104
 
102
});
105
});
103
 
106
 
104
function loadNotificationPanel(domId) {
107
function loadNotificationPanel(domId) {
-
 
108
	localStorage
-
 
109
	.removeItem("notifyDocument");
105
	doGetAjaxRequestHandler(context + "/sendNotificationPanel", function(
110
	doGetAjaxRequestHandler(context + "/sendNotificationPanel", function(
106
			response) {
111
			response) {
107
		$('#' + domId).html(response);
112
		$('#' + domId).html(response);
108
 
113
 
109
	});
114
	});