Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- var popup = !1,
- IS_PRODUCTION = 1,
- notifId = 0,
- tabActive = 0,
- msgLoading = 0,
- otp = 0,
- success_login = !1,
- MAIN_UPDATE_TIME = 6E4,
- bCode = {
- usd: 21,
- rur: 22,
- eur: 90,
- cnh: 91,
- gbp: 92
- };
- $(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()
- }
- $(document).ready(function() {
- "https://btc-e.com" != domain && "https://btc-e.nz" != domain && "http://dev.btc-e.com" != domain && (IS_PRODUCTION = 0);
- 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), chatRefresh = getCookie("chatRefresh"), void 0 == chatRefresh && (setCookie("chatRefresh", 0, {
- path: "/",
- expires: 31104E3
- }),
- chatRefresh = 0), auth && chatRefresh && pusherChatSub(), AFK_min = 0, setInterval(checkForAFK, 6E4), $("#nChat").scroll(nChatScrollEvent));
- 0 < $("#orders-b-list").size() && 1 == auth && setTimeout(orders_update, MAIN_UPDATE_TIME);
- csrfToken = "";
- auth && (csrfToken = $("#csrf-token").val());
- $.ajaxSetup({
- type: "POST",
- cache: !1,
- beforeSend: showLoader,
- error: showReqError,
- complete: hideLoader,
- data: {
- csrfToken: csrfToken
- }
- })
- });
- function checkForAFK() {
- 1 != auth && 3 != auth && AFK_min++;
- 30 <= AFK_min && 1 == chatRefresh && nChatDisableRefresh()
- }
- document.onmousemove = userActive;
- function userActive() {
- AFK_min = 0
- }
- 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 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,
- token: getCSRFToken()
- }, 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 getCSRFToken() {
- return $("#csrf-token").val()
- }
- function pusherStart() {
- "undefined" == typeof pusher && (pusher = new Pusher("4e0ebd7a8b66fa3554a4", {
- encrypted: !0
- }))
- }
- function pusherEnd() {
- "undefined" != typeof pusher && (pusher.disconnect(), delete pusher)
- }
- function pusherChatChannel() {
- prefix = IS_PRODUCTION ? "chat_" : "test_chat_";
- return prefix + locale
- }
- function pusherChatSub() {
- pusherStart();
- chatChannel = pusher.subscribe(pusherChatChannel());
- chatChannel.bind("msg", nChatPutMsg);
- chatChannel.bind("msg_del", nChatDelMsg)
- }
- function pusherChatUnSub() {
- chatChannel = pusher.unsubscribe(pusherChatChannel())
- }
- function nChatEnableRefresh() {
- pusherChatSub();
- chatRefresh = 1;
- setCookie("chatRefresh", 1, {
- path: "/",
- expires: 31104E3
- });
- $("#nChatRefreshBtn").fadeOut(100)
- }
- function nChatDisableRefresh() {
- pusherEnd();
- chatRefresh = 0;
- setCookie("chatRefresh", 0, {
- path: "/",
- expires: 31104E3
- });
- $("#nChatRefreshBtn").fadeIn(100)
- }
- 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 - b)
- }
- function nChatSay() {
- message = $("#nChatInput").val();
- if ("" == message) return !1;
- $("#nCiLoading").html(icLoading).fadeIn(50);
- 0 == chatRefresh ? (nChatEnableRefresh(), setTimeout('nChatSendMsg("' + message + '")', 1E3)) : nChatSendMsg(message);
- $("#nChatInput").val("");
- return !1
- }
- function nChatSendMsg(a) {
- $("#chat-token").val();
- $.ajax({
- url: _url("chat"),
- data: {
- task: "say",
- msg: a,
- locale: locale
- },
- beforeSend: "",
- success: function(b) {
- 1 == b.error && (nChatError(b.errorText), $("#nChatInput").val(a))
- },
- error: function() {
- nChatError("request error")
- },
- complete: function() {
- $("#nCiLoading").fadeOut()
- },
- dataType: "json"
- })
- }
- 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(a) {
- 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(a) {})
- }
- 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);
- var b = new RegExp("\\b" + auth_login + "\\b", "ig");
- u_style = a.login == auth_login ? "color: #193477 !important;" : "color: " + a.usr_clr;
- m_style = a.msg.match(b) ? "font-weight:bold;" : "";
- 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;
- 512 < $("#nChat p").length && (old_msg_size = $("#nChat p").first().outerHeight(!0), $("#nChat p").first().remove());
- $("#msg" + a.msg_id).fadeIn(100);
- new_msg_size = $("#msg" + a.msg_id).outerHeight(!0);
- nChatScroll(new_msg_size, old_msg_size)
- }
- function nChatPutMsgTest() {
- json = '{"login":"test","date":"now","msg_id":"' + Math.floor(1E5 * Math.random()) + '","msg":"test message test message test message test message test message"}';
- nChatPutMsg(json)
- }
- function parseTimestamp(a) {
- a = new Date(1E3 * a + 144E5);
- var b = a.getUTCDate();
- 10 > b && (b = "0" + b);
- var c = a.getUTCMonth() + 1;
- 10 > c && (c = "0" + c);
- var d = a.getUTCFullYear().toString().substr(2, 2),
- e = a.getUTCHours();
- 10 > e && (e = "0" + e);
- var f = a.getUTCMinutes();
- 10 > f && (f = "0" + f);
- a.getUTCSeconds();
- return b + "." + c + "." + d + " " + e + ":" + f
- }
- tId = 0;
- function mpPutTrades(a) {
- $.each(a, mpPutTrade)
- }
- function mpPutTrade(a, b) {
- color = "Buy" == b.type ? "green" : "red";
- $("#trade_history tr:first").after('<tr id="t' + tId + '"><td>' + parseTimestamp(b.timestamp) + '</td><td style="color:' + color + '"><b>' + b.type + "</b></td><td>" + b.price + " " + mpCur1 + "</td><td>" + b.amount + " " + mpCur0 + "</td><td>" + b.total + " " + mpCur1 + "</td></tr>");
- 1024 <= $("#trade_history tr").size() && $("#trade_history tr").last().remove();
- lBlink("#t" + tId, "#feffcd");
- tId++
- }
- function lBlink(a, b) {
- $(a).css("background", b);
- setTimeout("$('" + a + "').css('background', '');", 1500)
- }
- 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_email"),
- e = $("#reg_eula");
- !1 == /^[a-z0-9\-\_\.\+]{2,}\@([a-z0-9\-\_]{2,}\.)+[a-z0-9]{2,14}$/i.test(d.val()) ? (d.addClass("reg_input_error"), b.push(LOC_REG_ERROR_EMAIL)) : clear_class(d);
- !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 == e.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 getCookie(a) {
- return (a = document.cookie.match(new RegExp("(?:^|; )" + a.replace(/([\.$?*|{}\(\)\[\]\\\/\+^])/g, "\\$1") + "=([^;]*)"))) ? decodeURIComponent(a[1]) : void 0
- }
- function setCookie(a, b, c) {
- c = c || {};
- var d = c.expires;
- if ("number" == typeof d && d) {
- var e = new Date;
- e.setTime(e.getTime() + 1E3 * d);
- d = c.expires = e
- }
- d && d.toUTCString && (c.expires = d.toUTCString());
- b = encodeURIComponent(b);
- a = a + "=" + b;
- for (var f in c) a += "; " + f, b = c[f], !0 !== b && (a += "=" + b);
- document.cookie = a
- }
- 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 login_md5(a) {
- d1 = a.substr(0, 16);
- d2 = a.substr(16, 16);
- return d2 + d1
- }
- 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 + "-con").show()
- }
- function pe_passedit(a) {
- 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(a) {
- 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(a) {
- 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 || a == bCode.eur || a == bCode.cnh || a == bCode.gbp ? $(".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 || c == bCode.eur || c == bCode.cnh || c == bCode.gbp) {
- if (c == bCode.usd) var e = 1;
- else c == bCode.rur ? e = 14 : c == bCode.eur ? e = 15 : c == bCode.cnh ? e = 22 : c == bCode.gbp && (e = 23);
- 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()),
- g = Number(e.val()),
- h = $("#system_" + c + "_fee").val();
- if (!b.test(f) || !b.test(g)) return a ? d.val("0") : e.val("0"), !1;
- 1 == a ? (sum = g / (100 - h) * 100, input = d) : (sum = f - f / 100 * h, input = e);
- 11 == c && 100 < f && 1E4 > f && (sum = f - 100);
- 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(a) {
- a = $("#cur1_full").val();
- var 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?" + Math.random());
- $("#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(),
- g = $("#type").val(),
- h = $('input[id="notify"]').prop("checked"),
- k = $("#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: g,
- notify: h,
- hold: k
- }, 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, d) {
- 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(),
- b = $("#key_ips").val();
- showLoader();
- $.post(_url("api_keys"), {
- task: "create",
- desc: a,
- ips: b
- }, function(a) {
- a.success ? profile("api_keys") : alert(a.error);
- hideLoader()
- }, "json")
- }
- function api_key_delete(a) {
- showLoader();
- $.post(_url("api_keys"), {
- task: "delete",
- id: a
- }, function(a) {
- 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(a) {
- hideLoader()
- })
- }
- function api_key_addpriv(a, b, c) {
- showLoader();
- $.post(_url("profile"), {
- task: "api_keys_admin",
- keyId: a,
- rId: b,
- rValue: c
- }, function(a) {
- profile("api_keys_admin", $("#profile_uid").val());
- hideLoader()
- })
- }
- function api_key_addIP(a) {
- ip = $("#iIP" + a).val();
- showLoader();
- $.post(_url("profile"), {
- task: "api_keys_addIP",
- keyId: a,
- ip: ip
- }, function(a) {
- a.success ? profile("api_keys_admin", $("#profile_uid").val()) : alert(a.error);
- hideLoader()
- }, "json")
- }
- 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 && (document.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();
- $.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)
- }, "json")
- }
- function egopay_deposit() {
- var a = $("#egopay_amount").val(),
- b = $("#egopay_currency").val();
- $.post(_url("billing"), {
- act: "get_egopay_sign",
- amount: a,
- currency: b
- }, function(a) {
- a.success ? ($("#egopay_sign").val(a.data), $("#egopay_form").submit()) : alert(a.error)
- }, "json")
- }
- function mpolo_deposit() {
- var a = $("#mpolo_currency").val(),
- b = $("#mpolo_amount").val(),
- c = $("#mpolo_docId").val();
- $.post(_url("billing"), {
- act: "get_mpolo_sign",
- amount: b,
- docId: c,
- currency: a
- }, function(a) {
- a.success ? ($("#mpolo_sign").val(a.data), $("#mpolo_form").submit()) : alert(a.error)
- }, "json")
- }
- function accpay_deposit(a) {
- var b = $("#_accpay_amount" + a).val(),
- c = $("#accpay_curr" + a).val(),
- d = $("#accpay_ext_id" + a).val();
- phone = "";
- if (6 == a || 7 == a || 29 == a) phone = $("#accpay_phone" + a).val();
- $.post(_url("billing"), {
- act: "get_accpay_sign",
- amount: b,
- currency: c,
- ext_id: d,
- pgi: a,
- phone: phone
- }, function(b) {
- b.success ? ($("#accpay_sign" + a).val(b.data.sign), $("#accpay_amount" + a).val(b.data.amount), $("#accpay_form" + a).submit()) : alert(b.error)
- }, "json")
- }
- function coin_new_address(a) {
- $.post(_url("coins"), {
- act: "new_address",
- coin_id: a
- }, function(a) {
- 0 == a.success ? (nPopReady(510, 80), $("#nPopupCon").html(a.error)) : ($("#coin_addr_qr").attr("src", domain + "/qr?text=" + a.new_address), $("#coin_address").html(a.new_address), $("#coin_address").fadeTo("slow", 0.1, function() {
- $("#coin_address").fadeTo("slow", 1)
- }))
- }, "json")
- }
- function coin_depo_credit(a) {
- $.post(_url("profile"), {
- task: "coin_deposits",
- credit: a
- }, function(a) {
- a.success ? (alert("\u0437\u0430\u0447\u0438\u0441\u043b\u0435\u043d\u043e"), profile("coin_deposits")) : alert(a.error)
- }, "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"),
- g = $('input[id="c20"]').prop("checked"),
- h = $('input[id="c21"]').prop("checked"),
- k = $('input[id="c22"]').prop("checked"),
- l = $('input[id="c30"]').prop("checked"),
- m = $('input[id="c31"]').prop("checked"),
- n = $('input[id="c32"]').prop("checked"),
- p = $('input[id="c40"]').prop("checked"),
- q = $('input[id="c41"]').prop("checked"),
- r = $('input[id="c42"]').prop("checked");
- showLoader();
- $.post(_url("notifications"), {
- act: "saveSettings",
- c00: a,
- c01: b,
- c02: c,
- c10: d,
- c11: e,
- c12: f,
- c20: g,
- c21: h,
- c22: k,
- c30: l,
- c31: m,
- c32: n,
- c40: p,
- c41: q,
- c42: r
- }, function(a) {
- 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(b) {
- 0 == a ? profile("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 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 = eval("(0x" + login_md5(md5(md5(b + c))) + ")"), ++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 a_fdm_change(a, b) {
- "none" == $("#" + a + "_" + b).css("display") ? ($("#" + a + "_" + b).show(), $("#i" + a + "_" + b).hide()) : ($("#" + a + "_" + b).hide(), $("#i" + a + "_" + b).show().focus())
- }
- function a_cwl_save() {
- uid = $("#profile_uid").val();
- var a = {
- task: "coin_limits",
- save: 1,
- uid: uid
- };
- $(".cwl_data").each(function() {
- a[this.name] = this.value
- });
- showLoader();
- $.post(_url("profile"), a, function(a) {
- profile("coin_limits", uid);
- hideLoader()
- }, "json")
- }
- function mt_open_account(a) {
- leverage = $("#mt_leverages_open" + a).val();
- curr = $("#mtCurrency").val();
- $.post(_url("meta_trader"), {
- act: "open_account",
- accType: a,
- leverage: leverage,
- curr: curr
- }, function(a) {
- a.success ? (profile("meta_trader"), nPopReady(350, 160), $("#nPopupCon").html(a.data)) : alert(a.error)
- }, "json")
- }
- function mt_update_balances(a) {
- $.post(_url("meta_trader"), {
- act: "update_balances",
- mt_acc: a
- }, function(a) {
- a.success ? ($.each(a.data.balances, function(a, b) {
- $(".mt_balance" + a).html(b)
- }), $("#usd_balance").html(a.data.usd_balance), $("#mt_update_timestamp").html(a.data.update_time)) : alert(a.error)
- }, "json")
- }
- function mt_change_account(a) {
- a ? (mt_acc = $("#mt_from_acc").val(), $(".mt_balance").hide(), $("#mt_balance_con" + mt_acc).show(), $(".mtFromCurr").html($("#mtAccCurr" + mt_acc).val()), mt_update_balances(mt_acc)) : (mt_acc = $("#mt_to_acc").val(), currName = $("#mtAccCurr" + mt_acc).val(), $(".mtToCurr").html(currName), $("#mtToBalance").html($("#userBal" + currName).val()))
- }
- function mt_move_funds(a) {
- amount_input = $("#" + a + "_amount");
- amount = amount_input.val();
- mt_acc = $("#mt_" + a + "_acc").val();
- $.post(_url("meta_trader"), {
- act: "move_funds",
- where: a,
- mt_acc: mt_acc,
- amount: amount
- }, function(b) {
- b.success ? (amount_input.val(0), mt_update_balances(mt_acc), "from" == a && alert("\u0417\u0430\u044f\u0432\u043a\u0430 \u043f\u0440\u0438\u043d\u044f\u0442\u0430, \u043e\u0436\u0438\u0434\u0430\u0439\u0442\u0435 \u0430\u043a\u0446\u0435\u043f\u0442\u0430")) : alert(b.error)
- }, "json")
- }
- function mt_change_leverage(a) {
- $("#mt_leverage" + a).hide();
- $("#mt_leverage_change_btn" + a).hide();
- $("#mt_leverages" + a).show();
- $("#mt_leverage_save_btn" + a).show()
- }
- function mt_save_leverage(a) {
- leverage = $("#mt_leverages" + a).val();
- $.post(_url("meta_trader"), {
- act: "change_leverage",
- mt_acc: a,
- leverage: leverage
- }, function(b) {
- b.success ? ($("#mt_leverage" + a).html("1:" + leverage), $("#mt_leverages" + a).hide(), $("#mt_leverage_save_btn" + a).hide(), $("#mt_leverage" + a).show(), $("#mt_leverage_change_btn" + a).show()) : alert(b.error)
- }, "json")
- }
- 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 ipw_replace(a) {
- ~a.value.indexOf("\u044e") && (a.value = a.value.replace("\u044e", "."))
- }
- function ipw_add() {
- ip_address = $("#ip_address").val();
- $.post(_url("security_center"), {
- act: "ipw_add",
- ip_address: ip_address
- }, function(a) {
- a.success ? ($("#ip_address").val(""), $("#ipw_noaddr").remove(), $("#ipw_list").append('<tr id="ipw_r' + a.data.id + '" style="display:none"><td>' + ip_address + '</td><td><a href="javascript:void(0)" onclick="ipw_delete(' + a.data.id + ')">' + LOC_DELETE + "</a></td></tr>"), $("#ipw_r" + a.data.id).fadeIn(150)) : alert(a.error)
- }, "json")
- }
- function ipw_delete(a) {
- $.post(_url("security_center"), {
- act: "ipw_delete",
- id: a
- }, function(b) {
- b.success ? $("#ipw_r" + a).fadeOut(150, function() {
- $("#ipw_r" + a).remove();
- 1 >= $("#ipw_list tr").length && $("#ipw_list").append('<tr id="ipw_noaddr"><td colspan="2">' + LOC_IPW_NOADDR + "</td></tr>")
- }) : alert(b.error)
- }, "json")
- }
- function sec_session_close(a) {
- $.post(_url("security_center"), {
- act: "session_close",
- skey: a
- }, function(b) {
- b.success ? (id = -1 == a ? ".skey" : "#skey_" + a, $(id).fadeOut(150, function() {
- $(id).remove()
- })) : alert(b.error)
- }, "json")
- }
- function api_doc_show_content(a) {
- $(".api_doc-content_item").hide();
- $("#api_doc_" + a).show();
- $(".api_doc-nav_item").removeClass("api_doc-content_item-selected");
- $("#api_doc-nav-" + a).addClass("api_doc-content_item-selected")
- };
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement