Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- var popup = !1,
- local = 0,
- notifId = 0,
- tabActive = 0,
- msgLoading = 0,
- otp = 0,
- success_login = !1,
- MAIN_UPDATE_TIME = 15E3,
- bCode = {
- usd: 21,
- rur: 22
- };
- $.ajaxSetup({
- type: "POST",
- cache: !1,
- beforeSend: showLoader,
- error: showReqError,
- complete: hideLoader
- });
- $(document).ready(function () {
- "https://btc-e.com" != domain && "http://dev.btc-e.com" != domain && (local = 1);
- loading = "<div class='mcenter'><img src='" + domain + "/images/loading.gif' alt='' class='center' style='padding-top: 60%;'/></div>";
- loadingnorm = "<div class='mcenter'><img src='" + domain + "/images/loading.gif' alt='' class='center' /></div>";
- icLoading = "<img src='" + domain + "/images/loading.gif' alt='loading' class='center' />";
- icLoading2 = "<img src='" + domain + "/images/loading.gif' alt='loading' />";
- icLoadingH =
- "<img src='" + domain + "/images/loadh.gif' alt='loading' class='center' />";
- icLoadingButton = "<img src='" + domain + "/images/loading.gif' alt='loading' style='padding-top: 7px;' class='center' />";
- icOK = "<img src='" + domain + "/images/yes.png' alt='' />";
- icErr = "<img src='" + domain + "/images/no.png' alt='' />";
- 0 < $("#nChatCon").size() && ($("#nChatInput").focus(), $("#nChat").scrollTop(9999999), 1 == auth && pusherStart());
- $("#nChat").scroll(nChatScrollEvent);
- 0 < $("#orders-b-list").size() && 1 == auth && setTimeout(orders_update,
- MAIN_UPDATE_TIME)
- });
- $(window).focus(focusEvent);
- $(window).blur(blurEvent);
- $(document).mousemove(mmEvent);
- $(document).click(clickEvent);
- function focusEvent() {
- tabActive = 1
- }
- function blurEvent() {
- tabActive = 0
- }
- function mmEvent() {
- tabActive = 1
- }
- function clickEvent() {
- popup && $(".popup").hide()
- }
- function showLoader() {
- $("#mainLoader").fadeTo(1, 1);
- $("#loaderFade").fadeTo(1, 0.1)
- }
- function hideLoader() {
- $("#mainLoader").hide();
- $("#loaderFade").hide()
- }
- function showReqError() {
- var a = "\u041e\u0448\u0438\u0431\u043a\u0430 \u043f\u0440\u0438 \u0437\u0430\u043f\u0440\u043e\u0441\u0435. \u041f\u043e\u0436\u0430\u043b\u0443\u0439\u0441\u0442\u0430 \u043f\u043e\u043f\u0440\u043e\u0431\u0443\u0439\u0442\u0435 \u043f\u043e\u0437\u0434\u043d\u0435\u0435.";
- "ru" != locale && (a = "Request error. Please try again later.");
- alert(a)
- }
- function _url(a) {
- return domain + "/ajax/" + a
- }
- function spoiler(a) {
- $(a).next("div").slideToggle("fast")
- }
- function msgLoad(a, b) {
- msgLoading = 1;
- $("#msg-Loading").show();
- $.post(_url("messages"), {
- task: "msg_list",
- dialog_with: a,
- offset: b
- }, function (a) {
- var b = msg_list.scrollTop(),
- e = msg_list.html();
- msg_list.html(a);
- msg_height = msg_list[0].scrollHeight;
- msg_list.html(a + e).scrollTop(msg_height + b);
- setTimeout("msgLoading = 0;", 500);
- $("#msg-Loading").hide()
- })
- }
- function msgDel(a, b) {
- $(b).html(icLoading2);
- $.post(_url("messages"), {
- task: "del",
- id: a
- }, function (c) {
- -1 < c && ($("#msg-" + a).fadeOut("fast"), $(b).html(icOK), $("#mc").html(c), 0 == c && $("#msgbody").html("<h3 class='tcenter' style='margin: 15px;'>\u0421\u043e\u043e\u0431\u0449\u0435\u043d\u0438\u0439 \u043d\u0435\u0442.</h3>"))
- })
- }
- function msgSend(a) {
- var b = $("#to").val(),
- c = $("#text").val();
- showLoader();
- $.post(_url("messages"), {
- task: "send",
- to: b,
- message: c,
- captcha: a
- }, function (a) {
- hideLoader();
- "y" == a.error ? (nPopReady(430, 70), $("#nPopupCon").html(a.errortext)) : "y" == a.captcha ? (nPopReady(180, 145), $("#nPopupCon").html(a.captchatext)) : "n" == a.error && ($("#msgbody").html(a.message), npopHide())
- }, "json")
- }
- function pusherStart() {
- pusher = new Pusher("4e0ebd7a8b66fa3554a4", {
- encrypted: !0
- });
- test = 1 == local ? "test_" : "";
- channel = pusher.subscribe(test + "chat_" + locale);
- channel.bind("msg", nChatPutMsg);
- channel.bind("msg_del", nChatDelMsg)
- }
- function nChatScrollEvent() {
- return nChatScroll(0, 0, !0)
- }
- function nChatScroll(a, b, c) {
- scroll = $("#nChat").scrollTop();
- cur_scroll = scroll + $("#nChat").innerHeight();
- scroll_height = $("#nChat")[0].scrollHeight;
- cur_scroll > scroll_height - 30 - a ? c ? $("#nChatLockIcon").fadeOut(150) : $("#nChat").scrollTop(scroll_height) : c ? $("#nChatLockIcon").fadeIn(150) : 0 < b && $("#nChat").scrollTop(scroll - 26)
- }
- function nChatSendMsg() {
- var a = $("#chat-token").val(),
- b = $("#nChatInput").val();
- if ("" == b) return !1;
- $("#nCiLoading").html(icLoading).fadeIn(50);
- $.ajax({
- url: _url("chat"),
- data: {
- task: "say",
- msg: $("#nChatInput").val(),
- token: a,
- locale: locale
- },
- beforeSend: "",
- success: function (a) {
- 1 == a.error && (nChatError(a.errorText), $("#nChatInput").val(b))
- },
- error: function () {
- nChatError("request error")
- },
- complete: function () {
- $("#nCiLoading").fadeOut()
- },
- dataType: "json"
- });
- $("#nChatInput").val("");
- return !1
- }
- function nChatError(a) {
- $("#nChatErrors").html(a).fadeIn();
- setTimeout('$("#nChatErrors").fadeOut();', 2E3)
- }
- function nChatBan(a) {
- $(a).hide();
- $("#fade").fadeOut();
- $("#nChatBanMenu").fadeOut();
- showLoader();
- $.post(_url("chat"), {
- admtools: "nChatBanUser",
- id: $("#mid").val(),
- ttype: $("#ttype").val(),
- time: $("#time").val(),
- reason: $("#reason").val()
- }, function () {
- hideLoader()
- })
- }
- function nChatBanPopup(a) {
- $("#fade").fadeTo(100, 0.3);
- $("#nChatBanMenu").fadeIn(500);
- $("#cbm").html("<p style='text-align: center; height: 100%; line-height: 200px;'><img src='" + domain + "/images/loading.gif' alt='' /></p>");
- $.post(_url("chat"), {
- admtools: "nBanTable",
- id: a
- }, function (b) {
- $("#cbm").html(b);
- $("#mid").val(a)
- })
- }
- function nChatMenu(a, b, c, d) {
- var e = d.pageX ? d.pageX : d.clientX;
- d = d.pageY ? d.pageY : d.clientY;
- $("#cMenu").css("left", e).css("top", d).fadeIn(150);
- $("#cMenuH").html(b);
- 0 != a ? ($("#cMenuPM").show().html("<a href='" + domain + "/messages/new/" + b + "/' class='profileBtn'>" + $("#cMenuPM-text").html() + "</a>"), $("#cMenuProfile").show().html("<a href='" + domain + "/profile/" + a + "' class='profileBtn'>" + $("#cMenuProfile-text").html() + "</a>")) : ($("#cMenuPM").hide(), $("#cMenuProfile").hide(), $("#cMenuBan").hide());
- $("#cMenuInChat").show().html("<a href='javascript:void(0)' onclick='nInChat(\"" +
- b + "\")' class='profileBtn '>" + $("#cMenuInChat-text").html() + "</a>");
- 0 != a && $("#cMenuBan").show().html("<a href='javascript:void(0)' onclick='nChatBanPopup(" + c + ")' class='profileBtn '>" + $("#cMenuBan-text").html() + "</a>");
- $("#cMenuDel").show().html("<a href='javascript:void(0)' onclick='nChatMdel(" + c + ")' class='profileBtn '>" + $("#cMenuDel-text").html() + "</a>");
- popup = !1;
- setTimeout(function () {
- popup = !0
- }, 1)
- }
- function nInChat(a) {
- $("#nChatInput").val(a + ", ").focus()
- }
- function nChatMdel(a) {
- $.post(_url("chat"), {
- admtools: "nDelMessage",
- id: a
- }, function () {})
- }
- function nChatDelMsg(a) {
- $("#msg" + a).hide()
- }
- function nChatInsert(a) {
- $("#nChatInput").val($("#nChatInput").val() + " " + a).focus();
- $("#nChatSmiles").fadeToggle(50)
- }
- function nChatSmilesToggle() {
- $("#nChatSmiles").fadeToggle(50)
- }
- function nChatPutMsg(a) {
- a = JSON.parse(a);
- u_style = a.login == auth_login ? "color: #193477 !important;" : "color: " + a.usr_clr;
- m_style = a.msg.match(auth_login) ? "font-weight:bold;" : "";
- var b = "<p id='msg" + a.msg_id + "' class='chatmessage' style='" + m_style + "display:none'>" + ("<a title='" + a.date + "' style='" + u_style + " !important; font-weight: bold;' href='javascript:void(0)' onclick='nChatMenu(" + a.uid + ', "' + a.login + '", ' + a.msg_id + ", event)'>" + a.login + "</a>") + ": <span>" + a.msg + "</span></p>";
- $("#nChat").append(b);
- old_msg_size =
- 0;
- 40 < $("#nChat p").length && (old_msg_size = $("#nChat p").first().innerHeight(), $("#nChat p").first().remove());
- $("#msg" + a.msg_id).fadeIn(100);
- console.log(old_msg_size);
- new_msg_size = $("#msg" + a.msg_id).innerHeight();
- nChatScroll(new_msg_size, old_msg_size)
- }
- function reg_check(a, b, c) {
- b = b.value;
- $(document).ready(function () {
- "" != b && ($("#" + a + "-regcheck").html(icLoading), $.post(_url("reg?check=" + a), {
- data: b,
- data2: c
- }, function (b) {
- $("#" + a + "-regcheck").html(b);
- "psw" == a && "" != c && $("#psw2-regcheck").html(b);
- reg_all_check()
- }))
- })
- }
- function reg_input_check(a) {
- if (!(!1 == reg_button_pressed && !1 == a)) {
- var b = [],
- c = $("#reg_login"),
- d = $("#reg_psw1"),
- e = $("#reg_psw2"),
- f = $("#reg_email"),
- h = $("#reg_eula"),
- g = /^[a-z0-9!@#$%^&*(){}:;<>?=+-_~`.,]{6,64}$/i;
- !1 == /^[a-z0-9\-\_\.]{2,}\@([a-z0-9\-\_]{2,}\.)+[a-z0-9]{2,4}$/i.test(f.val()) ? (f.addClass("reg_input_error"), b.push(LOC_REG_ERROR_EMAIL)) : clear_class(f);
- !1 == /^[a-z0-9_]{3,16}$/i.test(c.val()) ? (c.addClass("reg_input_error"), b.push(LOC_REG_ERROR_LOGIN)) : clear_class(c);
- !1 == g.test(d.val()) ? (d.addClass("reg_input_error"),
- b.push(LOC_REG_ERROR_PASSWORD)) : clear_class(d);
- !1 == g.test(e.val()) ? e.addClass("reg_input_error") : clear_class(e);
- d.val() != e.val() ? (d.addClass("reg_input_error"), e.addClass("reg_input_error"), b.push(LOC_REG_ERROR_PASSWORDS_NOT_MATCH)) : "" != d.val() && (clear_class(d), clear_class(e));
- !1 == h.prop("checked") ? ($("#reg_eula_label").addClass("reg_input_error"), b.push(LOC_REG_ERROR_EULA_NOT_CHECKED)) : clear_class(reg_eula_label);
- 0 < b.length ? (reg_button_pressed = !0, $(".reg_error").hide(), $("#reg_error_list").html("").show(),
- $.each(b, function (a, b) {
- $("#reg_error_list").html($("#reg_error_list").html() + "<p>" + b + "</p>")
- })) : 0 == b.length && !1 == a ? $("#reg_error_list").html("").hide() : a && $("#reg_form").submit()
- }
- }
- function eula_ch() {
- 0 == $("#eulach").val() ? $("#eulach").val(1) : $("#eulach").val(0)
- }
- function clear_class(a) {
- $(a).removeClass("reg_input_error")
- }
- function reg_all_check() {
- return !1
- }
- function hide_popups() {
- $(".popup").hide()
- }
- function slider(a) {
- var b = 650 * a - 650,
- c = b + 15;
- $(".ex_button").removeAttr("class");
- $("#ex_but" + a).attr("class", "buttons_selected ex_button");
- $("#sliders").animate({
- left: "-" + c
- }, "slow");
- $("#sliders").animate({
- left: "-" + b
- }, "fast")
- }
- function profile(a, b, c, d) {
- $(document).ready(function () {
- if (0 == $("#profile_uid").length) return !1;
- $("#loading").html(icLoadingH);
- $(".profileBtnHover").attr("class", "profileBtn");
- $(d).attr("class", "profileBtnHover profileBtn");
- "" != window.location.hash && 1 == c && (a = window.location.hash.substr(1));
- $.ajax({
- url: _url("profile"),
- data: {
- task: a,
- data: b
- },
- beforeSend: "",
- success: function (a) {
- $("#profile").html(a);
- $("#loading").html("")
- }
- })
- })
- }
- function npopHide() {
- $(".npop").fadeOut("fast");
- $("#fade").fadeOut("fast")
- }
- function pe_check(a, b, c, d) {
- c = c.value;
- $(document).ready(function () {
- "" != c && ($("#" + b + "-check").html(icLoading2), $.post(_url("reg?check=" + b), {
- data: c,
- data2: d
- }, function (a) {
- $("#" + b + "-check").html(a);
- "psw" == b && "" != d && $("#psw2-check").html(a)
- }))
- })
- }
- function pe_edit(a) {
- $(".profile-edit").hide();
- $("#tab-table td").removeAttr("class").attr("class", "pe-tab");
- $("#tab-table td:last").removeAttr("class");
- $("#" + a + "-tab").addClass("pe-selected-tab");
- $("#" + a).show()
- }
- function pe_passedit() {
- showLoader();
- $.post(_url("profile_edit"), {
- edit: "pass",
- psw: $("#psw").val(),
- psw2: $("#psw2").val(),
- oldpsw: $("#oldpass").val()
- }, function (a) {
- $("#pass-errors").html(a);
- hideLoader()
- })
- }
- function pe_mainedit() {
- showLoader();
- $.post(_url("profile_edit"), {
- edit: "main",
- skype: $("#skp").val(),
- email: $("#email").val(),
- token: $("#token").val()
- }, function (a) {
- $("#main-errors").html(a);
- hideLoader()
- })
- }
- function pe_secedit() {
- var a = $('input[id="s_email"]').prop("checked");
- showLoader();
- $.post(_url("profile_edit"), {
- edit: "security",
- s_email: a
- }, function (a) {
- nPopReady(600, 70);
- $("#nPopupCon").html(a);
- hideLoader()
- })
- }
- function pe_confirm_email() {
- showLoader();
- $.post(_url("profile_edit"), {
- act: "confirm_email"
- }, function (a) {
- nPopReady(430, 85);
- $("#nPopupCon").html(a);
- hideLoader()
- })
- }
- function billing_profile(a, b, c) {
- $("#billing").html(icLoadingButton);
- "" != window.location.hash && 1 == c && (a = window.location.hash.substr(1));
- $.post(_url("billing"), {
- act: a,
- id: b
- }, function (a) {
- $("#billing").html(a);
- window.scrollBy(0, document.body.offsetHeight)
- })
- }
- function trans_history(a, b, c, d, e) {
- showLoader();
- "" != window.location.hash && 1 == e && (act = window.location.hash.substr(1));
- $.post(_url("billing"), {
- act: "history",
- id: a,
- page: b,
- view: c,
- type: d
- }, function (a) {
- hideLoader();
- $("#billing").html(a)
- })
- }
- function switch_pay(a) {
- $(".payform").hide();
- $(".banners-pay").hide();
- $("#pay" + a).show();
- $("#banners" + a).show()
- }
- function unpay() {
- var a = $("#purse").val(),
- b = $("#summ").val();
- $("#unpay").html(loadingnorm);
- $.post(_url("billing"), {
- act: "tryunpay",
- purse: a,
- summ: b
- }, function (a) {
- $("#unpay").html(a)
- })
- }
- function nPopReady(a, b) {
- margin_t = b / 2;
- margin_l = a / 2;
- $("#nPopupCon").css("width", a);
- $("#nPopupCon").css("height", b);
- $("#nPopupCon").css("margin-top", -margin_t);
- $("#nPopupCon").css("margin-left", -margin_l);
- $("#fade").fadeTo(50, 0.7);
- $("#nPopupCon").fadeIn(200)
- }
- function withdraw_coin(a) {
- var b = $("#sum").val(),
- c = $("#address").val(),
- d = $("#token").val();
- sec_ask_otp(1);
- showLoader();
- $.post(_url("coins"), {
- act: "withdraw",
- sum: b,
- address: c,
- coin_id: a,
- token: d,
- otp: otp
- }, function (a) {
- nPopReady(430, 70);
- $("#nPopupCon").html(a);
- hideLoader()
- })
- }
- function withdraw_method_change() {
- var a = $("#type option:selected").val(),
- b = $("#desc" + a);
- a == bCode.usd || a == bCode.rur ? $(".purse_block").hide() : $(".purse_block").show();
- "" == b.html() ? $("#desc_container").hide() : ($("#desc_container").show(), $(".desc").hide(), b.show());
- withdraw_calc()
- }
- function withdraw() {
- var a = $("#sum").val(),
- b = $("#purse").val(),
- c = $("#type option:selected").val(),
- d = $("#token").val();
- sec_ask_otp(1);
- showLoader();
- if (c == bCode.usd || c == bCode.rur) {
- if (c == bCode.usd) var e = 1;
- else c == bCode.rur && (e = 14);
- withdraw_code(e, 1)
- } else $.post(_url("billing"), {
- act: "withdraw_request",
- cur: $("#cur").val(),
- sum: a,
- purse: b,
- type: c,
- token: d,
- otp: otp
- }, function (a) {
- nPopReady(430, 80);
- $("#nPopupCon").html(a);
- hideLoader()
- })
- }
- function withdraw_calc(a) {
- var b = /^[0-9.]{1,}$/i,
- c = $("#type option:selected").val(),
- d = $("#sum"),
- e = $("#wd_sum"),
- f = Number(d.val()),
- h = Number(e.val()),
- g = $("#system_" + c + "_fee").val();
- if (!b.test(f) || !b.test(h)) return a ? d.val("0") : e.val("0"), !1;
- 1 == a ? (sum = 100 * (h / (100 - g)), input = d) : (sum = f - f / 100 * g, input = e);
- 11 == c && (150 < f && 1E4 > f) && (sum = f - 150);
- 53 == c && (100 < f && 1E4 > f) && (sum = f - 100);
- input.val(Math.floor(1E8 * sum) / 1E8)
- }
- function withdraw_code(a, b) {
- var c = $("#sum").val(),
- d = $("#token").val();
- b || sec_ask_otp(1);
- $.post(_url("billing"), {
- act: "withdraw_code",
- sum: c,
- currency: a,
- token: d,
- otp: otp
- }, function (a) {
- nPopReady(490, 90);
- $("#nPopupCon").html(a);
- hideLoader()
- })
- }
- function redeemCode() {
- var a = $("#code").val();
- showLoader();
- $.post(_url("billing"), {
- act: "redeem_code_2",
- code: a
- }, function (a) {
- nPopReady(430, 70);
- $("#nPopupCon").html(a);
- hideLoader()
- })
- }
- function coins_withdraw_calc(a) {
- var b = /^[0-9.]{1,}$/i,
- c = Number($("#sum").val()),
- d = Number($("#wd_sum").val()),
- e = $("#coin_fee").html();
- b.test(d) && 1 == a ? (a = d + e, 0 > a && (a = 0), $("#sum").val(1 * a.toFixed(8))) : b.test(c) && b.test(d) ? (a = c - e, 0 > a && (a = 0), $("#wd_sum").val(1 * a.toFixed(8))) : a ? $("#sum").val("0") : $("#wd_sum").val("0")
- }
- function usd_calc(a, b, c) {
- var d = /^[0-9.]{1,}$/i;
- d.test($("#" + a).val()) ? d.test($("#" + b).val()) ? (a = $("#" + a).val() * $("#" + b).val(), $("#" + c).html(a.toFixed(2))) : $("#" + c).html("0") : $("#" + c).html("0")
- }
- function ex_trade(a, b) {
- "buy" == a && (tr = "b");
- "sell" == a && (tr = "s");
- var c = $("#token").val(),
- d = $("#" + tr + "_btc").val(),
- e = $("#" + tr + "_price").val();
- showLoader();
- $.post(_url("order"), {
- trade: a,
- btc_count: d,
- btc_price: e,
- pair: b,
- token: c
- }, function (a) {
- "n" == a.error ? nPopReady(510, 240) : nPopReady(430, 70);
- $("#nPopupCon").html(a.data);
- hideLoader()
- }, "json")
- }
- function ex_calculate(a, b) {
- "buy" == a && (tr = "b");
- "sell" == a && (tr = "s");
- var c = $("#" + tr + "_btc").val(),
- d = $("#" + tr + "_price").val();
- $("#" + tr + "_loading").html(loadingnorm);
- $.post(_url("order"), {
- calculate: a,
- btc_count: c,
- btc_price: d,
- pair: b
- }, function (a) {
- $("#" + tr + "_all").html(a.all);
- $("#" + tr + "_fee").html(a.fee);
- $("#" + tr + "_comm").html(a.comm);
- "y" == a.error ? $("#" + tr + "_error").show() : $("#" + tr + "_error").hide();
- $("#" + tr + "_loading").html("")
- }, "json")
- }
- function cancel_order(a, b) {
- showLoader();
- $.post(_url("order"), {
- act: "cancel",
- id: a,
- pair: b
- }, function (b) {
- "OK" == b ? ($("#sorder_link_" + a).html("<b>success</b>"), setTimeout(function () {
- $("#sorder_" + a).fadeOut("fast")
- }, 300)) : $("#sorder_link_" + a).html("<b>error (" + b + ")</b>");
- hideLoader()
- })
- }
- function orders_update() {
- var a = $("#pair").val();
- $(".orders-loading").fadeTo(50, 0.3);
- $.ajax({
- url: _url("order"),
- cache: !1,
- type: "POST",
- data: {
- act: "orders_update",
- pair: a
- },
- beforeSend: "",
- success: main_update,
- error: function () {
- setTimeout(orders_update, 2 * MAIN_UPDATE_TIME)
- },
- dataType: "json"
- })
- }
- function main_update(a) {
- var b = $("#orders_1").scrollTop(),
- c = $("#orders_2").scrollTop();
- $("#orders-b-list").html(a.buy);
- $("#orders-s-list").html(a.sell);
- setTimeout("ordersScroll(1, " + b + ")", 10);
- setTimeout("ordersScroll(2, " + c + ")", 10);
- $("#orders-self-list").html(a.self);
- $(".orders-loading").fadeOut();
- 0 < $("#users-online").size() && $("#users-online").html(a.users_online);
- $("#cur1").html(a.auth_cur1);
- $("#cur2").html(a.auth_cur2);
- $("#cur1_full").val(a.auth_cur1_full);
- $("#cur2_full").val(a.auth_cur2_full);
- $(".money_usd").html(a.money_usd);
- $(".money_btc").html(a.money_btc);
- $("#orders-stats").html(a.stats);
- $("#min_price").html(a.min);
- $("#max_price").html(a.max);
- a.mes_count != $("#mes_count").html() && $("#mes_count").html(a.mes_count);
- a.not_count != $("#not_count").html() && $("#not_count").html(a.not_count);
- 0 < a.mes_count && $("#mes_count").attr("style", "font-weight: bold").addClass("red");
- 0 < a.not_count && $("#not_count").attr("style", "font-weight: bold");
- scroll_state = $("#trade_history").scrollTop();
- $("#trade_history").html(a.trade_history).scrollTop(scroll_state);
- "undefined" !== typeof a.notifs && $.each(a.notifs, function (a, b) {
- notify(b.text, b.sound)
- });
- $.each(a.last, last_price_blink);
- setTimeout("$('ul.pairs span').removeAttr('class');", 2E3);
- "undefined" != typeof chart && (chart.clearChart(), data = google.visualization.arrayToDataTable(a.chart_data, !0), chart.draw(data, options));
- setTimeout(orders_update, MAIN_UPDATE_TIME)
- }
- function ordersScroll(a, b) {
- $("#orders_" + a).scrollTop(b)
- }
- function last_price_blink(a, b) {
- last = $("#last" + a);
- change = 1;
- last.html() < b ? (last.attr("class", "greenbg"), icon = "\u2191") : last.html() > b ? (last.attr("class", "redbg"), icon = "\u2193") : change = 0;
- 1 == change && (last.html(b), a == $("#pair").val() && (document.title = "[" + icon + b + "] BTC-E"))
- }
- function all_money(a, b) {
- var c = $("#" + a).html();
- "" == c && (c = $("#" + a).val());
- $("#" + b).val(c)
- }
- function a_calc() {
- var a = $("#cur1_full").val(),
- b = $("#b_price").val();
- 0 < a && 0 < b && (result = a / b - 1E-7);
- $("#b_btc").val(result.toFixed(8))
- }
- function captcha_refresh() {
- $("#captcha-refresh").html(icLoading2);
- $("#captcha").attr("src", domain + "/getcaptcha");
- $("#captcha_input").val("")
- }
- function a_deposit() {
- var a = $("#sum").val(),
- b = $("#text").val(),
- c = $("#uid").val(),
- d = $("#manual_uid").val(),
- e = $("#login").val(),
- f = $("#cur").val(),
- h = $("#type").val(),
- g = $('input[id="notify"]').prop("checked"),
- j = $("#hold").val();
- showLoader();
- $.post(_url("profile"), {
- task: "add_funds",
- task2: "deposit",
- sum: a,
- text: b,
- uid: c,
- manual_uid: d,
- login: e,
- cur: f,
- type: h,
- notify: g,
- hold: j
- }, function (a) {
- hideLoader();
- "ok" == a ? alert("\u0423\u0441\u043f\u0435\u0448\u043d\u043e") : alert("\u0414\u0430\u043d\u043d\u044b\u0435 \u0432\u0432\u0435\u0434\u0435\u043d\u044b \u043d\u0435\u0432\u0435\u0440\u043d\u043e")
- })
- }
- function a_edit() {
- var a = $("#user_email").val(),
- b = $("#user_id").val();
- showLoader();
- $.post(_url("profile"), {
- task: "a_edit",
- save: 1,
- new_email: a,
- data: b
- }, function (a) {
- hideLoader();
- 0 == a.success ? alert(a.error) : alert("\u0443\u0441\u043f\u0435\u0448\u043d\u043e")
- }, "json")
- }
- function orders_history(a) {
- pair = $("#pair option:selected").val();
- status = $("#view option:selected").val();
- type = $("#type option:selected").val();
- $("#loading").html(icLoadingH);
- $.post(_url("orders_history"), {
- pair: pair,
- status: status,
- type: type,
- page: a
- }, function (a) {
- $("#orders_history").html(a);
- $("#loading").html("")
- })
- }
- function set_price(a, b, c) {
- buy_price = $("#b_price");
- buy_amount = $("#b_btc");
- sell_price = $("#s_price");
- sell_amount = $("#s_btc");
- buy_price.val(b);
- sell_price.val(b);
- 1 == a && buy_amount.val(c);
- 2 == a && sell_amount.val(c)
- }
- function api_key_create() {
- var a = $("#key_desc").val();
- showLoader();
- $.post(_url("api_keys"), {
- task: "create",
- desc: a
- }, function () {
- profile("api_keys");
- hideLoader()
- })
- }
- function api_key_delete(a) {
- showLoader();
- $.post(_url("api_keys"), {
- task: "delete",
- id: a
- }, function () {
- profile("api_keys");
- hideLoader()
- })
- }
- function api_key_save(a) {
- var b = $('input[id="k_' + a + '_0"]').prop("checked"),
- c = $('input[id="k_' + a + '_1"]').prop("checked"),
- d = $('input[id="k_' + a + '_2"]').prop("checked"),
- e = $('input[id="k_' + a + '_3"]').prop("checked");
- showLoader();
- $.post(_url("api_keys"), {
- task: "save",
- id: a,
- k0: b,
- k1: c,
- k2: d,
- k3: e
- }, function () {
- hideLoader()
- })
- }
- function autoSend_funds(a, b) {
- 1 == b ? act = "query" : (act = "send", $("#tid" + a).hide(), npopHide());
- showLoader();
- $.post(_url("autosend_funds"), {
- act: act,
- tid: a
- }, function (a) {
- nPopReady(480, 90);
- $("#nPopupCon").html(a);
- hideLoader()
- })
- }
- function lq_deposit() {
- showLoader();
- $.post(_url("liqpay"), {
- amount: $("#lq_amount").val()
- }, function (a) {
- $("#operation_xml").val(a.xml);
- $("#signature").val(a.sign);
- $("#lq_form").submit();
- hideLoader()
- }, "json");
- return !1
- }
- function qiwi_deposit() {
- var a = $("#qiwi_amount").val(),
- b = $("#qiwi_to").val();
- showLoader();
- $.post(_url("qiwi"), {
- amount: a,
- to: b
- }, function (c) {
- !1 == c.error && (location = "http://w.qiwi.ru/setInetBill.do?txn_id=" + c.txn_id + "&from=" + c.from + "&to=" + b + "&summ=" + a + "&com=" + c.com + "&lifetime=72&check_agt=false");
- !0 == c.error && alert(c.errorText);
- hideLoader()
- }, "json")
- }
- function payeer_deposit() {
- var a = $("#m_amount").val(),
- b = $("#m_curr").val();
- showLoader();
- $.post(_url("billing"), {
- act: "get_payeer_sign",
- amount: a,
- currency: b
- }, function (a) {
- a.success ? ($("#m_amount").val(a.data.amount), $("#m_sign").val(a.data.sign), $("#payeer_form").submit()) : alert(a.error);
- hideLoader()
- }, "json")
- }
- function coin_new_address(a) {
- showLoader();
- $.post(_url("coins"), {
- act: "new_address",
- coin_id: a
- }, function (a) {
- hideLoader();
- 0 == a.success ? (nPopReady(510, 80), $("#nPopupCon").html(a.error)) : ($("#coin-address").html(a.new_address), $("#coin-address").fadeTo("slow", 0.1, function () {
- $("#coin-address").fadeTo("slow", 1)
- }))
- }, "json")
- }
- function notifToggleCh(a) {
- !1 == $('input[id="' + a + '0"]').prop("checked") ? ($("#" + a + "1").removeAttr("checked").attr("disabled", "disabled"), $("#" + a + "2").removeAttr("checked").attr("disabled", "disabled")) : ($("#" + a + "1").removeAttr("disabled"), $("#" + a + "2").removeAttr("disabled"))
- }
- function notifSettings() {
- showLoader();
- $.post(_url("notifications"), {
- act: "settings"
- }, function (a) {
- nPopReady(480, 210);
- $("#nPopupCon").html(a);
- hideLoader()
- })
- }
- function notifSaveSettings() {
- var a = $('input[id="c00"]').prop("checked"),
- b = $('input[id="c01"]').prop("checked"),
- c = $('input[id="c02"]').prop("checked"),
- d = $('input[id="c10"]').prop("checked"),
- e = $('input[id="c11"]').prop("checked"),
- f = $('input[id="c12"]').prop("checked"),
- h = $('input[id="c20"]').prop("checked"),
- g = $('input[id="c21"]').prop("checked"),
- j = $('input[id="c22"]').prop("checked"),
- k = $('input[id="c30"]').prop("checked"),
- l = $('input[id="c31"]').prop("checked"),
- m = $('input[id="c32"]').prop("checked"),
- n = $('input[id="c40"]').prop("checked"),
- p = $('input[id="c41"]').prop("checked"),
- q = $('input[id="c42"]').prop("checked");
- showLoader();
- $.post(_url("notifications"), {
- act: "saveSettings",
- c00: a,
- c01: b,
- c02: c,
- c10: d,
- c11: e,
- c12: f,
- c20: h,
- c21: g,
- c22: j,
- c30: k,
- c31: l,
- c32: m,
- c40: n,
- c41: p,
- c42: q
- }, function () {
- npopHide();
- hideLoader()
- })
- }
- function notify(a, b) {
- notifId++;
- 1 == b && $("#audioPM").get(0).play();
- $("#notif-containter").show().append("<div id='notif" + notifId + "' class='notification'><a style='float:right;' href='javascript:void(0)' onclick='$(\"#notif" + notifId + '").fadeOut("slow", function(){$("#notif' + notifId + '").remove();$("#notif-containter").hide();});\'><img src=\'' + domain + "/images/1px.png' class='main-s main-s-close' /></a><div style='height:100%' onclick='window.location=\"" + domain + "/notifications\"'>" + a + "</div></div>");
- $("#notif" + notifId).fadeIn("fast");
- 1 == tabActive && setInterval('$("#notif' + notifId + '").fadeOut("slow", function(){$("#notif' + notifId + '").remove();$("#notif-containter").hide();});', 1E4)
- }
- function notifHide(a) {
- $.post(_url("notifications"), {
- act: "hideNotif",
- id: a
- }, function () {
- 0 == a ? location = domain + "/notifications" : $("#n" + a).hide()
- })
- }
- function sw_act(a, b) {
- showLoader();
- $.post(_url("billing"), {
- act: "sw_act",
- task: a,
- id: b
- }, function (a) {
- nPopReady(430, 80);
- $("#nPopupCon").html(a);
- hideLoader()
- })
- }
- function sec_create_otp_key() {
- showLoader();
- $.post(_url("security_center"), {
- act: "create_OTP_Key",
- token: $("#token").val()
- }, function (a) {
- a.success ? (nPopReady(610, 150), $("#nPopupCon").html(a.data), $("#otp").focus()) : alert(a.error);
- hideLoader()
- }, "json");
- return !1
- }
- function sec_confirm_otp_key() {
- if (!1 == /^[0-9]{6}$/i.test($("#otp").val())) return $("#otp_error").show(), !1;
- showLoader();
- $.post(_url("security_center"), {
- act: "confirm_OTP_Key",
- keyId: $("#keyId").val(),
- otp: $("#otp").val(),
- token: $("#token").val()
- }, function (a) {
- a.success ? (npopHide(), profile("security/2fa")) : $("#otp_error").css({
- "font-weight": "bold"
- }).show().attr("title", a.error);
- hideLoader()
- }, "json")
- }
- function sec_del_otp_key() {
- if (confirmed = confirm(LOC_ARE_YOU_SURE)) sec_ask_otp(0), showLoader(), $.post(_url("security_center"), {
- act: "delete_OTP_Key",
- otp: otp,
- token: $("#token").val()
- }, function (a) {
- a.success ? profile("security/2fa") : alert(a.error);
- hideLoader()
- }, "json")
- }
- function sec_save_otp_key() {
- var a = $('input[id="s0"]').prop("checked"),
- b = $('input[id="s1"]').prop("checked"),
- c = $('input[id="s2"]').prop("checked");
- sec_ask_otp(0);
- showLoader();
- $.post(_url("security_center"), {
- act: "save_OTP_Key",
- s0: a,
- s1: b,
- s2: c,
- otp: otp,
- token: $("#token").val()
- }, function (a) {
- a.success || alert(a.error);
- profile("security/2fa");
- hideLoader()
- }, "json")
- }
- function sec_ask_otp(a) {
- otp = 0 == a && secure_sc || 1 == a && secure_wd ? prompt(LOC_CONFIRM_OTP, defaultText = "") : 0
- }
- function tryLogin() {
- if (success_login) return !0;
- $.ajax({
- url: _url("login"),
- cache: !1,
- type: "POST",
- data: {
- email: $("#email").val(),
- password: $("#password").val(),
- otp: $("#login-otp").val(),
- PoW_nonce: $("#PoW_nonce").val()
- },
- success: userLogin,
- error: function () {
- alert("server error")
- },
- complete: function () {
- hideLoader()
- },
- dataType: "json"
- });
- return !1
- }
- function userLogin(a) {
- a.success ? (a.data.PoW && $("#PoW_working").fadeTo(0, 0.1, function () {
- setTimeout(function () {
- $("#PoW_nonce").val(getPoW(a.data.work.target, a.data.work.data));
- $("#PoW_working").hide()
- }, 30)
- }), setTimeout(function () {
- a.data.otp ? ($("#login_con").hide(), $("#otp_con").fadeIn(100), $("#login-otp").val("").focus()) : (a.data.login_success && (success_login = !0, $("#login").attr("action", window.location.href)), $("#login").submit())
- }, 100)) : (alert(a.error), "-" != $("#login-otp").val() && $("#login-otp").val(""));
- $("#PoW_nonce").val("")
- }
- function getPoW(a, b) {
- var c = 0;
- do hash_hex = md5(md5(b + c)), hash = eval("(0x" + hash_hex + ")"), ++c; while (hash >= a);
- return c
- }
- function comm_replace(a) {~
- a.value.indexOf(",") && (a.value = a.value.replace(",", "."))
- }
- function ac_add_comm_butt() {
- $("#add_comm_butt").hide();
- $("#add_comm_con").fadeIn(300)
- }
- function ac_add_comment() {
- var a = $("#profile_uid").val();
- ac_add_comment_request(a, $("#comment_text").val())
- }
- function ac_add_comment_request(a, b) {
- showLoader();
- $.post(_url("profile"), {
- task: "add_admin_comment",
- uid: a,
- comment_text: b
- }, function (b) {
- b.success ? profile("admin_comments", a) : alert(b.error);
- hideLoader()
- }, "json")
- }
- function pTradeHistory(a) {
- pair = $("#pair option:selected").val();
- $.post(_url("profile"), {
- task: "trade_history",
- ajax: 1,
- pair: pair,
- page: a
- }, function (a) {
- $("#trade_list_con").html(a)
- })
- }
- function a_ban(a, b, c) {
- showLoader();
- $.post(_url("profile"), {
- task: "ban",
- type: a,
- status: b,
- uid: c
- }, function (d) {
- d.success ? (profile("info", c), 1 == b && ((comment = prompt("\u0417\u0430\u0431\u043b\u043e\u043a\u0438\u0440\u043e\u0432\u0430\u043d\u043e. \u0414\u043e\u0431\u0430\u0432\u044c\u0442\u0435 \u043a\u043e\u043c\u043c\u0435\u043d\u0442\u0430\u0440\u0438\u0439:")) ? (1 == a && (prefix = ":ban:"), 2 == a && (prefix = ":withdraw_ban:"), ac_add_comment_request(c, prefix + " " + comment)) : alert("\u043a\u043e\u043c\u043c\u0435\u043d\u0442 \u043d\u0435 \u0434\u043e\u0431\u0430\u0432\u043b\u0435\u043d"))) :
- alert(d.error);
- hideLoader()
- }, "json")
- }
- function meta_open_demo() {
- showLoader();
- $.post(_url("profile"), {
- task: "meta_trader",
- open_demo: 1
- }, function (a) {
- a.success ? (nPopReady(350, 140), $("#nPopupCon").html(a.data)) : alert(a.error);
- hideLoader()
- }, "json")
- };
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement