Subversion Repositories SmartDukaan

Rev

Rev 9464 | Show entire file | Ignore whitespace | Details | Blame | Last modification | View Log | RSS feed

Rev 9464 Rev 9622
Line 9... Line 9...
9
		}
9
		}
10
		sendProductFeeds($(this).serialize());
10
		sendProductFeeds($(this).serialize());
11
		return false;
11
		return false;
12
	});
12
	});
13
	
13
	
-
 
14
	$('#deleteProductFeedForm').live('submit', function() {
-
 
15
		var cataLogItemId = $("input[name='catalogItemIdDelete']").val();
-
 
16
		if(cataLogItemId==null || cataLogItemId=="")
-
 
17
		{
-
 
18
			alert("Please enter Catalog Item Id");
-
 
19
			$('input[name=catalogItemIdDelete]').focus();
-
 
20
			return false;
-
 
21
		}
-
 
22
		var didConfirm = confirm("Our System entry for product feeds will also be deleted. \nAre you still want to Proceed");
-
 
23
		if(didConfirm==false){
-
 
24
			return false;
-
 
25
		}
-
 
26
		deleteProductFeeds($(this).serialize());
-
 
27
		return false;
-
 
28
	});
-
 
29
	
14
	$('#cataLogItemId').keypress(function(e) {
30
	$('#cataLogItemId').keypress(function(e) {
15
		var a = [];
31
		var a = [];
16
            var k = e.which;
32
            var k = e.which;
17
        
33
        
18
            for (i = 48; i < 58; i++){
34
            for (i = 48; i < 58; i++){
Line 24... Line 40...
24
            if (!(a.indexOf(k)>=0)){
40
            if (!(a.indexOf(k)>=0)){
25
                e.preventDefault();
41
                e.preventDefault();
26
        	}
42
        	}
27
	});
43
	});
28
	
44
	
-
 
45
	$('#catalogItemIdDelete').keypress(function(e) {
-
 
46
		var a = [];
-
 
47
            var k = e.which;
-
 
48
        
-
 
49
            for (i = 48; i < 58; i++){
-
 
50
        		{
-
 
51
                	a.push(i);
-
 
52
        		}
-
 
53
        	}
-
 
54
        
-
 
55
            if (!(a.indexOf(k)>=0)){
-
 
56
                e.preventDefault();
-
 
57
        	}
-
 
58
	});
-
 
59
	
29
	$('#sendProductFeedLink').live('click', function() {
60
	$('#sendProductFeedLink').live('click', function() {
30
		$("div#sendProductFeedDiv").show();
61
		$("div#sendProductFeedDiv").show();
31
		$('#cataLogItemId').val('');
62
		$('#cataLogItemId').val('');
32
		$.colorbox({
63
		$.colorbox({
33
            inline : true,
64
            inline : true,
34
            width : "400px",
65
            width : "400px",
35
            height : "160px",
66
            height : "200px",
36
            href : "div#sendProductFeedDiv",
67
            href : "div#sendProductFeedDiv",
37
            onClosed : function() {
68
            onClosed : function() {
38
                $("div#sendProductFeedDiv").hide();
69
                $("div#sendProductFeedDiv").hide();
39
            }
70
            }
40
		});
71
		});
41
	});
72
	});
42
	
73
	
-
 
74
	$('#deleteProductFeedLink').live('click', function() {
-
 
75
		$("div#deleteProductFeedDiv").show();
-
 
76
		$('#catalogItemIdDelete').val('');
-
 
77
		$.colorbox({
-
 
78
            inline : true,
-
 
79
            width : "400px",
-
 
80
            height : "200px",
-
 
81
            href : "div#deleteProductFeedDiv",
-
 
82
            onClosed : function() {
-
 
83
                $("div#deleteProductFeedDiv").hide();
-
 
84
            }
-
 
85
		});
-
 
86
	});
-
 
87
	
43
});
88
});
44
 
89
 
45
function sendProductFeeds(params) {
90
function sendProductFeeds(params) {
46
	$.ajax({
91
	$.ajax({
47
		type : "POST",
92
		type : "POST",
Line 54... Line 99...
54
		error : function() {
99
		error : function() {
55
			alert("Error in sending products feeds");
100
			alert("Error in sending products feeds");
56
			$.colorbox.close();
101
			$.colorbox.close();
57
		}
102
		}
58
	});
103
	});
-
 
104
}
-
 
105
 
-
 
106
function deleteProductFeeds(params) {
-
 
107
	$.ajax({
-
 
108
		type : "POST",
-
 
109
		url : "/inventory/product-feeds!deleteProductFeeds",
-
 
110
		data : params,
-
 
111
		success : function(response) {
-
 
112
			alert(response);
-
 
113
			$.colorbox.close();
-
 
114
		},
-
 
115
		error : function() {
-
 
116
			alert("Error in deleting products feeds");
-
 
117
			$.colorbox.close();
-
 
118
		}
-
 
119
	});
59
}
120
}
60
121