Subversion Repositories SmartDukaan

Rev

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

Rev 26289 Rev 27081
Line 1... Line 1...
1
$(function() {
1
$(function() {
2
	
2
 
3
	$('button.imeiactivationsupload').live('click', function() {
3
	$('button.imeiactivationsupload').live(
-
 
4
			'click',
-
 
5
			function() {
4
		debugger;
6
				debugger;
5
		var fileSelector = $('#imeiactivations')[0];
7
				var fileSelector = $('#imeiactivations')[0];
-
 
8
				if (fileSelector != undefined
6
		if(fileSelector != undefined && fileSelector.files[0] != undefined) {
9
						&& fileSelector.files[0] != undefined) {
7
			if(confirm("Confirm Upload?")) {
10
					if (confirm("Confirm Upload?")) {
8
				doAjaxUploadRequestHandler(context + "/imei/upload", "POST", fileSelector.files[0], function(response){
11
						doAjaxUploadRequestHandler(context + "/imei/upload",
-
 
12
								"POST", fileSelector.files[0], function(
-
 
13
										response) {
9
					if(response) {
14
									if (response) {
10
						alert("Content updated successfully");
15
										alert("Content updated successfully");
-
 
16
									}
-
 
17
								});
11
					}
18
					}
12
				});
-
 
13
			}
-
 
14
		} else {
19
				} else {
15
			alert("Please upload file!");
20
					alert("Please upload file!");
16
		}
21
				}
17
		return false;
22
				return false;
18
	});
-
 
19
	
-
 
20
	
-
 
21
	$(".focused_model").live('click', function() {
-
 
22
		loadModel("main-content");
-
 
23
		
-
 
24
		$("#focused-model-paginated .next").live(
-
 
25
				'click',
-
 
26
				function() {
-
 
27
					loadPaginatedNextItems('/getPaginatedFocusedModel', null,
-
 
28
							'focused-model-paginated', 'focused-model-table',
-
 
29
							'focused-model-container');
-
 
30
 
-
 
31
					$(this).blur();
-
 
32
				});
23
			});
33
 
-
 
34
		$("#focused-model-paginated .previous").live(
-
 
35
				'click',
-
 
36
				function() {
-
 
37
 
-
 
38
					loadPaginatedPreviousItems('/getPaginatedFocusedModel', null,
-
 
39
							'focused-model-paginated', 'focused-model-table',
-
 
40
							'focused-model-container');
-
 
41
 
24
 
-
 
25
	$(".focused_model").live(
-
 
26
			'click',
-
 
27
			function() {
-
 
28
				loadModel("main-content");
-
 
29
 
-
 
30
				$("#focused-model-paginated .next").live(
-
 
31
						'click',
-
 
32
						function() {
-
 
33
							loadPaginatedNextItems('/getPaginatedFocusedModel',
-
 
34
									null, 'focused-model-paginated',
-
 
35
									'focused-model-table',
-
 
36
									'focused-model-container');
-
 
37
 
42
					$(this).blur();
38
							$(this).blur();
43
				});
39
						});
-
 
40
 
-
 
41
				$("#focused-model-paginated .previous").live(
-
 
42
						'click',
-
 
43
						function() {
-
 
44
 
-
 
45
							loadPaginatedPreviousItems(
-
 
46
									'/getPaginatedFocusedModel', null,
-
 
47
									'focused-model-paginated',
-
 
48
									'focused-model-table',
-
 
49
									'focused-model-container');
44
 
50
 
-
 
51
							$(this).blur();
-
 
52
						});
-
 
53
 
45
	});
54
			});
46
 
55
 
47
	$(".add-model").live(
56
	$(".add-model").live(
48
			'click',
57
			'click',
49
			function() {
58
			function() {
50
				var catalogId = itemCatalogId;
59
				var catalogId = itemCatalogId;
51
				var recommended = $('#recommended').val();
60
				var recommended = $('#recommended').val();
52
				var minimumQty = $('#minimumQuantity').val();
61
				var minimumQty = $('#minimumQuantity').val();
-
 
62
				var partnerType = $('#retailerType').val();
53
 
63
 
54
				if (catalogId === null && recommended === ""
64
				if (catalogId === null && recommended === ""
55
						&& minimumQty === "") {
65
						&& minimumQty === "") {
56
					alert("Field can't be empty");
66
					alert("Field can't be empty");
57
					return;
67
					return;
Line 70... Line 80...
70
					return;
80
					return;
71
				}
81
				}
72
				var params = {
82
				var params = {
73
					"catalogId" : catalogId,
83
					"catalogId" : catalogId,
74
					"recommended" : recommended,
84
					"recommended" : recommended,
75
					"minimumQty" : minimumQty
85
					"minimumQty" : minimumQty,
-
 
86
					"partnerType" : partnerType
76
				}
87
				}
77
				if (confirm("Are you sure you want to add item!") == true) {
88
				if (confirm("Are you sure you want to add item!") == true) {
78
					doPostAjaxRequestWithParamsHandler(context
89
					doPostAjaxRequestWithParamsHandler(context
79
							+ "/focusedModel", params, function(response) {
90
							+ "/focusedModel", params, function(response) {
80
						alert("Add Item Successfully");
91
						alert("Add Item Successfully");
Line 86... Line 97...
86
	$(".remove-model")
97
	$(".remove-model")
87
			.live(
98
			.live(
88
					'click',
99
					'click',
89
					function() {
100
					function() {
90
						if (confirm("Are you sure you want to Remove the Item") == true) {
101
						if (confirm("Are you sure you want to Remove the Item") == true) {
91
							catalogId = $(this).data('requestid');
102
							id = $(this).data('requestid');
92
							console.log(catalogId);
103
							console.log(id);
93
							doDeleteAjaxRequestHandler(context
104
							doDeleteAjaxRequestHandler(context
94
									+ "/removeItem?catalogId=" + catalogId,
105
									+ "/removeItem?id=" + id,
95
									function(response) {
106
									function(response) {
96
										if (response == 'true') {
107
										if (response == 'true') {
97
											alert("successfully Removed");
108
											alert("successfully Removed");
98
											loadModel("main-content");
109
											loadModel("main-content");
99
										}
110
										}