Subversion Repositories SmartDukaan

Rev

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

Rev 28566 Rev 29515
Line 8... Line 8...
8
	});
8
	});
9
 
9
 
10
})
10
})
11
 
11
 
12
 
12
 
-
 
13
$(document).on('click', ".web-sctrach-offer", function() {
-
 
14
	loadScratchOffer("main-content");
-
 
15
 
-
 
16
})
-
 
17
 
-
 
18
 
-
 
19
$(document).on('click', "#downloadSctrachTemplate", function() {
-
 
20
 
-
 
21
	window.location.href = context + "/sctrachOffer/downloadTemplate";
-
 
22
});
-
 
23
 
-
 
24
 
-
 
25
$(document).on('click', ".sctrachOfferfileUpload", function() {
-
 
26
 
-
 
27
	console.log("hello");
-
 
28
	if (confirm('Confirm upload ?')) {
-
 
29
		var fileSelector = $(this)[0];
-
 
30
		if (fileSelector != undefined) {
-
 
31
			var url = `${context}/sctrachOffer/upload`;
-
 
32
			console.log(url);
-
 
33
			var file = $("#sctrachOffer")[0].files[0];
-
 
34
			let fileInput = $(this);
-
 
35
			console.log("file" + file);
-
 
36
			console.log("fileInput" + fileInput);
-
 
37
			doAjaxUploadRequestHandler(
-
 
38
				url,
-
 
39
				'POST',
-
 
40
				file, function(response) {
-
 
41
 
-
 
42
					console.log(response)
-
 
43
					alert("successfully uploaded");
-
 
44
 
-
 
45
				});
-
 
46
 
-
 
47
		}
-
 
48
	}
-
 
49
});
-
 
50
 
13
$(document).on('click', "a.prodcut-remove", function() {
51
$(document).on('click', "a.prodcut-remove", function() {
14
	var webProductId = $(this).data("productid");
52
	var webProductId = $(this).data("productid");
15
	var webListingId = $(this).data("id");
53
	var webListingId = $(this).data("id");
16
	if (confirm("Are you sure you want to remove the Item!") == true) {
54
	if (confirm("Are you sure you want to remove the Item!") == true) {
17
 
55
 
Line 148... Line 186...
148
function loadWebListing(domId) {
186
function loadWebListing(domId) {
149
	doAjaxRequestHandler(context + "/web-listing", "GET", function(response) {
187
	doAjaxRequestHandler(context + "/web-listing", "GET", function(response) {
150
		$('#' + domId).html(response);
188
		$('#' + domId).html(response);
151
	});
189
	});
152
}
190
}
-
 
191
 
-
 
192
 
-
 
193
 
-
 
194
function loadScratchOffer(domId) {
-
 
195
 
-
 
196
	doAjaxRequestHandler(context + "/scratchOffer", "GET", function(response) {
-
 
197
		$('#' + domId).html(response);
-
 
198
	});
-
 
199
}
-
 
200
 
153
function addWebListing() {
201
function addWebListing() {
154
	webListingTitle = $("#web-listing-title").val();
202
	webListingTitle = $("#web-listing-title").val();
155
	webListingUrl = $("#web-listing-url").val();
203
	webListingUrl = $("#web-listing-url").val();
156
	webListingRank = $("#web-listing-rank").val();
204
	webListingRank = $("#web-listing-rank").val();
157
	webListingBannerUrl = $("#web-listing-bannerurl").val();
205
	webListingBannerUrl = $("#web-listing-bannerurl").val();