Subversion Repositories SmartDukaan

Rev

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

Rev 8620 Rev 8639
Line 14... Line 14...
14
.submit { margin-left: 12em; }
14
.submit { margin-left: 12em; }
15
em { font-weight: bold; padding-right: 1em; vertical-align: top; }
15
em { font-weight: bold; padding-right: 1em; vertical-align: top; }
16
ul { padding-left: 13px;}
16
ul { padding-left: 13px;}
17
td{background-color:#B0BED9};
17
td{background-color:#B0BED9};
18
</style>
18
</style>
-
 
19
<style>
-
 
20
.loading-image {
-
 
21
position: fixed;
-
 
22
top: 50%;
-
 
23
left: 50%;
-
 
24
margin-top: -50px;
-
 
25
margin-left: -100px;
-
 
26
z-index: 100;
-
 
27
}
-
 
28
</style>
19
<script type="text/javascript">
29
<script type="text/javascript">
20
		$(function(){
30
		$(function(){
21
jQuery.ajax({
31
jQuery.ajax({
22
        type : "GET",
32
        type : "GET",
23
        url : "/Support/amazon-list!fetchItems?searchText="+"&next=0",
33
        url : "/Support/amazon-list!fetchItems?searchText="+"&next=0",
-
 
34
		beforeSend: function(){
-
 
35
        $('#ajax-spinner').show();
-
 
36
        },
-
 
37
        complete: function(){
-
 
38
        $('#ajax-spinner').hide();
-
 
39
        },
24
        success : function(response) {
40
        success : function(response) {
25
        $('#' + 'amazon-table').html(response);
41
        $('#' + 'amazon-table').html(response);
26
		$(".previous").css("display", "none");
42
		$(".previous").css("display", "none");
27
		var temp = $('.totalValue').text();
43
		var temp = $('.totalValue').text();
28
		$('.total').text(temp);
44
		$('.total').text(temp);
Line 59... Line 75...
59
<script type="text/javascript">
75
<script type="text/javascript">
60
function getNextItems(start,end,searchText){
76
function getNextItems(start,end,searchText){
61
jQuery.ajax({
77
jQuery.ajax({
62
        type : "GET",
78
        type : "GET",
63
        url : "/Support/amazon-list!fetchItems?searchText="+searchText+"&next="+end,
79
        url : "/Support/amazon-list!fetchItems?searchText="+searchText+"&next="+end,
-
 
80
		beforeSend: function(){
-
 
81
        $('#ajax-spinner').show();
-
 
82
        },
-
 
83
        complete: function(){
-
 
84
        $('#ajax-spinner').hide();
-
 
85
        },
64
        success : function(response) {
86
        success : function(response) {
65
			$('.valueEnd').text(+end + +10);
87
			$('.valueEnd').text(+end + +10);
66
			$('.valueStart').text(+start + +10);
88
			$('.valueStart').text(+start + +10);
67
			var last = $('.valueEnd').text();
89
			var last = $('.valueEnd').text();
68
			var temp = $('.total').text();
90
			var temp = $('.total').text();
Line 79... Line 101...
79
}
101
}
80
function getPreviousItems(start,end,pre,searchText){
102
function getPreviousItems(start,end,pre,searchText){
81
jQuery.ajax({
103
jQuery.ajax({
82
        type : "GET",
104
        type : "GET",
83
        url : "/Support/amazon-list!fetchItems?searchText="+searchText+"&next="+pre,
105
        url : "/Support/amazon-list!fetchItems?searchText="+searchText+"&next="+pre,
-
 
106
		beforeSend: function(){
-
 
107
        $('#ajax-spinner').show();
-
 
108
        },
-
 
109
        complete: function(){
-
 
110
        $('#ajax-spinner').hide();
-
 
111
        },
84
        success : function(response) {
112
        success : function(response) {
85
			$('.valueEnd').text(+end - +10);
113
			$('.valueEnd').text(+end - +10);
86
			$('.valueStart').text(+start - +10);
114
			$('.valueStart').text(+start - +10);
87
            $('#' + 'amazon-table').html(response);
115
            $('#' + 'amazon-table').html(response);
88
			$(".next").css("display", "");	
116
			$(".next").css("display", "");	
Line 98... Line 126...
98
    });
126
    });
99
}
127
}
100
function loadSearchInfo(searchText){
128
function loadSearchInfo(searchText){
101
jQuery.ajax({
129
jQuery.ajax({
102
        type : "GET",
130
        type : "GET",
103
        url : "/Support/amazon-list!fetchItems?searchText="+searchText+"&next=0",
131
        url : "/Support/amazon-list!fetchItems?searchText="+searchText+"&next=0",beforeSend: function(){
-
 
132
        $('#ajax-spinner').show();
-
 
133
        },
-
 
134
        complete: function(){
-
 
135
        $('#ajax-spinner').hide();
-
 
136
        },
-
 
137
		beforeSend: function(){
-
 
138
        $('#ajax-spinner').show();
-
 
139
        },
-
 
140
        complete: function(){
-
 
141
        $('#ajax-spinner').hide();
-
 
142
        },
104
        success : function(response) {
143
        success : function(response) {
105
            $('#' + 'amazon-table').html(response);
144
            $('#' + 'amazon-table').html(response);
106
			$('.valueEnd').text(10);
145
			$('.valueEnd').text(10);
107
			$('.valueStart').text(1);
146
			$('.valueStart').text(1);
108
			$(".previous").css("display", "none");
147
			$(".previous").css("display", "none");
Line 130... Line 169...
130
}
169
}
131
function loadItemDetails(getUrl){
170
function loadItemDetails(getUrl){
132
jQuery.ajax({
171
jQuery.ajax({
133
        type : "GET",
172
        type : "GET",
134
        url : getUrl,
173
        url : getUrl,
-
 
174
		beforeSend: function(){
-
 
175
        $('#ajax-spinner').show();
-
 
176
        },
-
 
177
        complete: function(){
-
 
178
        $('#ajax-spinner').hide();
-
 
179
        },
135
        success : function(response) {
180
        success : function(response) {
136
            $('#' + 'item-details').html(response);
181
            $('#' + 'item-details').html(response);
137
        },
182
        },
138
		error : function() {
183
		error : function() {
139
		 	alert("Unable to get Item details.Please try again.");
184
		 	alert("Unable to get Item details.Please try again.");
Line 150... Line 195...
150
    jQuery.ajax({
195
    jQuery.ajax({
151
        url: "/Support/amazon-list!update",
196
        url: "/Support/amazon-list!update",
152
        type: 'POST',
197
        type: 'POST',
153
        data: data,
198
        data: data,
154
        async: false,
199
        async: false,
-
 
200
		beforeSend: function(){
-
 
201
        $('#ajax-spinner').show();
-
 
202
        },
-
 
203
        complete: function(){
-
 
204
        $('#ajax-spinner').hide();
-
 
205
        },
155
        success: function (data) {
206
        success: function (data) {
156
            alert("Changes propagated successfully");
207
            alert("Changes propagated successfully");
157
        },
208
        },
158
		 error : function() {
209
		 error : function() {
159
		 	alert("OOPS!!!Failed to do changes.Try Again.");
210
		 	alert("OOPS!!!Failed to do changes.Try Again.");
Line 180... Line 231...
180
    #sactionmessage()
231
    #sactionmessage()
181
    </div>
232
    </div>
182
    <div style="color:red;">
233
    <div style="color:red;">
183
    #sactionerror()
234
    #sactionerror()
184
    </div>
235
    </div>
-
 
236
		<div id="ajax-spinner" style="display:none;">
-
 
237
		<img src="/Support/images/ajax_loader_blue.gif" class="loading-image">
-
 
238
		</div>
185
	   <div id="amazon-table">
239
	   <div id="amazon-table">
186
	   </div>
240
	   </div>
187
	<br>
241
	<br>
188
        <div class="display" style="float: left;">
242
        <div class="display" style="float: left;">
189
		Showing&nbsp;<span class="valueStart">1</span>&nbsp;to&nbsp;<span class="valueEnd">10</span>&nbsp;of&nbsp;
243
		Showing&nbsp;<span class="valueStart">1</span>&nbsp;to&nbsp;<span class="valueEnd">10</span>&nbsp;of&nbsp;