Subversion Repositories SmartDukaan

Rev

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

Rev 23419 Rev 23500
Line 96... Line 96...
96
function getSchemesNextItems(start, end){
96
function getSchemesNextItems(start, end){
97
	console.log(start);
97
	console.log(start);
98
	console.log(end);
98
	console.log(end);
99
	console.log(+end + +10);
99
	console.log(+end + +10);
100
	console.log(+start + +10);
100
	console.log(+start + +10);
101
	doAjaxRequestHandler(context+"/getPaginatedSchemes?offset="+end, "GET", function(response){
101
	doGetAjaxRequestHandler(context+"/getPaginatedSchemes?offset="+end, function(response){
102
		var size = $("#schemes-paginated .size").text();
102
		var size = $("#schemes-paginated .size").text();
103
		if((parseInt(end) + 10) > parseInt(size)){
103
		if((parseInt(end) + 10) > parseInt(size)){
104
			console.log("(end + 10) > size == true");
104
			console.log("(end + 10) > size == true");
105
			$( "#schemes-paginated .end" ).text(size);
105
			$( "#schemes-paginated .end" ).text(size);
106
		}else{
106
		}else{
Line 122... Line 122...
122
}
122
}
123
 
123
 
124
 
124
 
125
function getSchemesPreviousItems(start, end, pre){
125
function getSchemesPreviousItems(start, end, pre){
126
	
126
	
127
	doAjaxRequestHandler(context+"/getPaginatedSchemes/?offset="+pre, "GET", function(response){
127
	doGetAjaxRequestHandler(context+"/getPaginatedSchemes/?offset="+pre, function(response){
128
		$( "#schemes-paginated .end" ).text(+end - +10);
128
		$( "#schemes-paginated .end" ).text(+end - +10);
129
		$( "#schemes-paginated .start" ).text(+start - +10);
129
		$( "#schemes-paginated .start" ).text(+start - +10);
130
		$('#schemes-table').html(response);
130
		$('#schemes-table').html(response);
131
		$('#scheme-details-container').html('');
131
		$('#scheme-details-container').html('');
132
		$("#schemes-paginated .next").prop('disabled', false);
132
		$("#schemes-paginated .next").prop('disabled', false);
Line 138... Line 138...
138
	
138
	
139
	
139
	
140
}
140
}
141
 
141
 
142
function loadSchemeDetails(schemeId, domId){
142
function loadSchemeDetails(schemeId, domId){
143
	doAjaxRequestHandler(context+"/getSchemeById?schemeId="+schemeId, "GET", function(response){
143
	doGetAjaxRequestHandler(context+"/getSchemeById?schemeId="+schemeId, function(response){
144
		$('#' + domId).html(response);
144
		$('#' + domId).html(response);
145
		window.dispatchEvent(new Event('resize'));
145
		window.dispatchEvent(new Event('resize'));
146
	});
146
	});
147
}
147
}
148
 
148
 
149
function activeScheme(schemeId, offset, domId){
149
function activeScheme(schemeId, offset, domId){
150
	doAjaxRequestHandler(context+"/activeSchemeById?schemeId="+schemeId
150
	doPutAjaxRequestHandler(context+"/activeSchemeById?schemeId="+schemeId
151
	        +"&offset="+offset, "PUT", function(response){
151
	        +"&offset="+offset, function(response){
152
		$('#' + domId).html(response);
152
		$('#' + domId).html(response);
153
		$('#scheme-details-container').html('');
153
		$('#scheme-details-container').html('');
154
	});
154
	});
155
	
155
	
156
}
156
}
157
 
157
 
158
function expireScheme(schemeId, offset, domId){
158
function expireScheme(schemeId, offset, domId){
159
	doAjaxRequestHandler(context+"/expireSchemeById?schemeId="+schemeId
159
	doPutAjaxRequestHandler(context+"/expireSchemeById?schemeId="+schemeId
160
	        +"&offset="+offset, "PUT", function(response){
160
	        +"&offset="+offset, function(response){
161
		$('#' + domId).html(response);
161
		$('#' + domId).html(response);
162
		$('#scheme-details-container').html('');
162
		$('#scheme-details-container').html('');
163
	});
163
	});
164
}
164
}
165
 
165
 
166
function loadScheme(domId){
166
function loadScheme(domId){
167
	doAjaxRequestHandler(context+"/createScheme", "GET", function(response){
167
	doGetAjaxRequestHandler(context+"/createScheme", function(response){
168
		$('#' + domId).html(response);
168
		$('#' + domId).html(response);
169
	});
169
	});
170
	 
170
	 
171
}
171
}
172
 
172
 
173
function loadTagListingItemsDescriptionByBrand(domId, brand){
173
function loadTagListingItemsDescriptionByBrand(domId, brand){
174
	doAjaxRequestHandler(context+"/getTagListingItemsByBrand?brand="+brand, "GET", function(response){
174
	doGetAjaxRequestHandler(context+"/getTagListingItemsByBrand?brand="+brand, function(response){
175
		$('#' + domId).html(response);
175
		$('#' + domId).html(response);
176
		configureTagListingItemsDescriptionDropDown();
176
		configureTagListingItemsDescriptionDropDown();
177
	});
177
	});
178
	
178
	
179
}
179
}
180
 
180
 
181
function schemes(domId){
181
function schemes(domId){
182
	doAjaxRequestHandler(context+"/getSchemes", "GET", function(response){
182
	doGetAjaxRequestHandler(context+"/getSchemes", function(response){
183
		$('#' + domId).html(response);
183
		$('#' + domId).html(response);
184
	});
184
	});
185
}
185
}
186
 
186
 
187
function loadSchemesDownloadPage(domId){
187
function loadSchemesDownloadPage(domId){
188
	doAjaxRequestHandler(context+"/schemes/downloadPage", "GET", function(response){
188
	doGetAjaxRequestHandler(context+"/schemes/downloadPage", function(response){
189
		$('#' + domId).html(response);
189
		$('#' + domId).html(response);
190
	});
190
	});
191
}
191
}
192
192