Skip to content

Instantly share code, notes, and snippets.

@Korayem
Created June 4, 2012 16:12
Show Gist options
  • Save Korayem/fd2dff1750bdd3d93efd to your computer and use it in GitHub Desktop.
Save Korayem/fd2dff1750bdd3d93efd to your computer and use it in GitHub Desktop.
undelete dropbox files - method 2
//From event page
//Example https://www.dropbox.com/events/15112434/168381077
var filesToRestore = [];
jQuery('img.link-img').each(function(){filesToRestore.push(decodeURIComponent(this.title));})
new Ajax.DBRequest("/cmd/restore", {
parameters: {
files: filesToRestore
},
job: true,
progress_text: _("Restoring..."),
onSuccess: function (d) {
Notify.ServerSuccess(c);
Browse.force_reload();
TreeView.schedule_reset()
},
cleanUp: function (d) {}
});
//OOOORRRR: RUN IT FOR EACH FILE
jQuery('img.link-img').each(function(){
new Ajax.DBRequest("/cmd/restore", {
parameters: {
files: decodeURIComponent(this.title)
},
job: true,
progress_text: _("Restoring..."),
onSuccess: function (d) {
Notify.ServerSuccess(c);
Browse.force_reload();
TreeView.schedule_reset()
},
cleanUp: function (d) {}
});
});
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment