Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- $('#scan-form').submit(function(event){
- event.preventDefault();
- $.ajax({
- type: 'POST',
- url: 'post',
- dataType: 'json',
- data: {'scan':true},
- success: function(){
- $.ajax({
- url: 'api/periods.json',
- dataType: 'json',
- success: function(d1){
- var start = function(){
- var dtd = $.Deferred();
- $('#scan-interactive').removeClass('disabled');
- for(var key in d1.periods){
- var html = "";
- html += '<tr id="'+d1.periods[key].id+'">';
- html += '<td class="month">'+d1.periods[key].month+'</td>';
- html += '<td class="week">'+d1.periods[key].week+'</td>';
- html += '<td class="days">'+d1.periods[key].days+'</td>';
- html += '<td class="dates">'+d1.periods[key].dates+'</td>';
- html += '<td class="open"></td>';
- html += '<td class="refunded"></td>';
- html += '<td class="closed"></td>';
- html += '<td class="status"></td>';
- html += "</tr>";
- $('#scan-interactive table tbody').append(html);
- (function(key){
- $.ajax({
- type: 'POST',
- url: 'api/count.json',
- dataType: 'json',
- data:{'created_at_min':d1.periods[key].created_at_min,'created_at_max':d1.periods[key].created_at_max},
- success: function(d2){
- $('#'+d1.periods[key].id+" .open").html(d2.open).effect("highlight", {color:'#FBEED5'}, 1000);
- $('#'+d1.periods[key].id+" .closed").html(d2.closed).effect("highlight", {color:'#FBEED5'}, 1000);
- $('#'+d1.periods[key].id+" .refunded").html(d2.refunded).effect("highlight", {color:'#FBEED5'}, 1000);
- request[key] = new Object();
- request[key].id = d1.periods[key].id;
- request[key].status = d2.open == 0;
- request[key].retrieve = d2.closed !== 0;
- request[key].pages = Math.ceil(d2.closed / 250);
- request[key].created_at_min = d1.periods[key].created_at_min;
- request[key].created_at_max = d1.periods[key].created_at_max;
- dtd.resolve();
- },//success: function(d2){
- });//$.ajax({
- })(key);//(function(key){
- }//for(var key in d1.periods){
- return dtd.promise();
- };//var start = function(){
- start.apply(this).pipe(function(){
- console.log('success has been completed');
- });//start.apply(this).pipe(function(){
- },//success: function(d1){
- });//$.ajax({
- },//success: function(){
- });//$.ajax({
- });//$('#scan-form').submit(function(event){
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement