Ignore:
Timestamp:
Jun 18, 2013, 3:26:17 PM (7 years ago)
Author:
mistic100
Message:

move remove_image.php code to a trigger on init

File:
1 edited

Legend:

Unmodified
Added
Removed
  • extensions/BatchDownloader/template/thumbnails_css_js.tpl

    r23291 r23323  
    1212  jQuery.ajax({ldelim}
    1313    type: "POST",
    14     url: "{$ROOT_URL}{$BATCH_DOWNLOAD_PATH}remove_image.php",
    15     data: {ldelim} "set_id": "{$SET_ID}", "toggle_id": toggle_id }
    16   }).done(function(msg) {ldelim}
    17     if (msg == "false") {ldelim}
    18       $trigger.parent("li").hide("fast", function() {ldelim} $trigger.remove() });
    19       jQuery(".nbImagesSet").html(parseInt(jQuery(".nbImagesSet").html()) -1);
    20      
    21       if (typeof GThumb == "object") GThumb.build();
    22     } else {ldelim}
     14    url: "{$ROOT_URL}index.php",
     15    data: {ldelim}
     16      action: "bd_remove_image",
     17      set_id: "{$SET_ID}",
     18      toggle_id: toggle_id
     19    },
     20    success: function(msg) {ldelim}
     21      if (msg == "ok") {ldelim}
     22        $trigger.parent("li").hide("fast", function() {ldelim} $trigger.remove() });
     23        jQuery(".nbImagesSet").html(parseInt(jQuery(".nbImagesSet").html()) -1);
     24       
     25        if (typeof GThumb == "object") GThumb.build();
     26      } else {ldelim}
     27        $trigger.html('{'Un unknown error occured'|@translate}');
     28      }
     29    },
     30    error: function() {ldelim}
    2331      $trigger.html('{'Un unknown error occured'|@translate}');
    2432    }
Note: See TracChangeset for help on using the changeset viewer.