Advertisement
Guest User

Untitled

a guest
Jun 26th, 2016
109
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 3.80 KB | None | 0 0
  1. function withdrawal() {
  2. function t() {
  3. $(".tooltip").remove(), $('[data-instance="item"]').tooltip({
  4. placement: "top"
  5. }), $("#withdrawal").fadeIn("slow"), $("#withdrawal").find(".inventory_item").sort(function(t, e) {
  6. return e.dataset.sort - t.dataset.sort
  7. }).appendTo($("#withdrawal"))
  8. }
  9. $('[data-toggle="tooltip"]').tooltip(), t(), $(document).on("click", ".bot-inventory-load", function() {
  10. var e = $(this).data("bot");
  11. $(".bot-inventory-load").removeClass("active"), $(this).addClass("active"), $("#credits value").text(0), $("#deposit .inventory_item").remove(), $("#deposit #pot_empty").show(), $("#withdrawal .inventory_item").remove(), $(".spinner").show(), $("#inventory_attempt").show(), self.socket.emit("get-bot-inventory", {
  12. steamid: e
  13. }, function(i, n) {
  14. if (i) return error(i);
  15. for (var s in n) $("#withdrawal").append(self.template($("templates withdrawal-item").html(), [n[s].assetid, e, n[s].price, n[s].market_hash_name, n[s].color, n[s].price, n[s].icon_url]));
  16. n.length ? $("#withdrawal #pot_empty").fadeOut("fast") : $("#withdrawal #pot_empty").fadeIn("slow"), $("#withdrawal").fadeIn("slow"), $("#inventory_attempt").hide(), $(".spinner").hide(), t()
  17. })
  18. }), $(document).on("click", "#withdrawal > .inventory_item", function() {
  19. var t = 9999;
  20. if (t.text((parseFloat(t.text()) + parseFloat($(this).find(".item_price span").text())).toFixed(2)), parseFloat(t.text()) > parseFloat($("#wallet").text())) return t.text((parseFloat(t.text()) - parseFloat($(this).find(".item_price span").text())).toFixed(2)), void self.alert("error", "Вы не можете взять больше чем на вашем балансе!");
  21. var e = $(this).clone();
  22. $(this).remove(), $("#deposit #pot_empty").hide(), $("#deposit").append(e), $(".tooltip").remove()
  23. }), $(document).on("click", "#deposit > .inventory_item", function() {
  24. t - parseFloat($(this).find(".item_price span").text())).toFixed(2));
  25. var e = $(this).clone();
  26. $(this).remove(), $("#deposit .inventory_item").length || $("#deposit #pot_empty").show(), $("#withdrawal").append(e), t()
  27. }), $(document).on("click", ".withdrawal", function() {
  28. if (!$(this).attr("disabled")) {
  29. $(this).attr("disabled", "disabled");
  30. var t = [],
  31. e = "";
  32. $("#deposit .inventory_item").each(function() {
  33. t.push($(this).data("assetid")), e = $(this).data("bot")
  34. }), t.length ? ($("#deposit").hide(), $(".waiting_content").show(), $(".waiting_content .spinner").show(), $(".waiting_content .inventory_attempt").show(), self.socket.emit("withdrawal", {
  35. botID: e,
  36. items: t
  37. }, function(t, e, i) {
  38. return $(".waiting_content .spinner").hide(), $(".waiting_content .inventory_attempt").hide(), t ? ($(".withdrawal").removeAttr("disabled"), $("#deposit").show(), void $(".waiting_content").hide()) : (self.incrementWallet(-parseFloat($("#credits value").text())), $(".steam-inventory").fadeOut(), $(".steam-deposit").fadeOut(), $("#waiting_pot_value value").text($("#credits value").text()), $("#waiting_code").text(e), $("#accept_link").attr("href", $("#accept_link").attr("href") + i), $("#accept_link_steam").attr("href", $("#accept_link_steam").attr("href") + i), $(".waiting_content #pot_empty").fadeIn(), void $(".withdrawal").removeAttr("disabled"))
  39. })) : ($(this).removeAttr("disabled"), self.alert("error", "Вы ничего не выбрали!"))
  40. }
  41. })
  42. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement