Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- function withdrawal() {
- function t() {
- $(".tooltip").remove(), $('[data-instance="item"]').tooltip({
- placement: "top"
- }), $("#withdrawal").fadeIn("slow"), $("#withdrawal").find(".inventory_item").sort(function(t, e) {
- return e.dataset.sort - t.dataset.sort
- }).appendTo($("#withdrawal"))
- }
- $('[data-toggle="tooltip"]').tooltip(), t(), $(document).on("click", ".bot-inventory-load", function() {
- var e = $(this).data("bot");
- $(".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", {
- steamid: e
- }, function(i, n) {
- if (i) return error(i);
- 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]));
- n.length ? $("#withdrawal #pot_empty").fadeOut("fast") : $("#withdrawal #pot_empty").fadeIn("slow"), $("#withdrawal").fadeIn("slow"), $("#inventory_attempt").hide(), $(".spinner").hide(), t()
- })
- }), $(document).on("click", "#withdrawal > .inventory_item", function() {
- var t = 9999;
- 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", "Вы не можете взять больше чем на вашем балансе!");
- var e = $(this).clone();
- $(this).remove(), $("#deposit #pot_empty").hide(), $("#deposit").append(e), $(".tooltip").remove()
- }), $(document).on("click", "#deposit > .inventory_item", function() {
- t - parseFloat($(this).find(".item_price span").text())).toFixed(2));
- var e = $(this).clone();
- $(this).remove(), $("#deposit .inventory_item").length || $("#deposit #pot_empty").show(), $("#withdrawal").append(e), t()
- }), $(document).on("click", ".withdrawal", function() {
- if (!$(this).attr("disabled")) {
- $(this).attr("disabled", "disabled");
- var t = [],
- e = "";
- $("#deposit .inventory_item").each(function() {
- t.push($(this).data("assetid")), e = $(this).data("bot")
- }), t.length ? ($("#deposit").hide(), $(".waiting_content").show(), $(".waiting_content .spinner").show(), $(".waiting_content .inventory_attempt").show(), self.socket.emit("withdrawal", {
- botID: e,
- items: t
- }, function(t, e, i) {
- 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"))
- })) : ($(this).removeAttr("disabled"), self.alert("error", "Вы ничего не выбрали!"))
- }
- })
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement