Simple image host.
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

script.js 714B

12345678910111213141516171819202122232425262728
  1. $(document).on("ready", function() {
  2. $("#collections .date-created").each(function() {
  3. this.innerHTML = util.dateToString(new Date(this.innerHTML));
  4. });
  5. var collections = [];
  6. $("#collections .collection").each(function() {
  7. collections[this.getAttribute("data-id")] = $(this);
  8. });
  9. $("#collections .delete").on("click", function(evt) {
  10. var id = evt.target.getAttribute("data-id");
  11. var collection = collections[id];
  12. var name = collection.children(".name").html();
  13. if (!confirm("Are you sure you want to delete collection "+name+"?"))
  14. return;
  15. util.api("collection_delete", {
  16. id: id
  17. }, function(err, res) {
  18. if (err)
  19. return util.error(err);
  20. collection.remove();
  21. });
  22. });
  23. });