Нужно найти проверку реф ссылки и убрать её [требует правки]

236
12 марта 2018, 01:16

Есть вот такой робот, подскажите пожалуйста, где идёт проверка реф ссылки? без неё он не работает, помогите убрать эту проверку.

$(document).ready(function() {
function z(a, b) {
    for (var c = "1", d = 0; d < b; d++) c += "0";
    c = Number.parseInt(c);
    return Math.round(a * c) / c
}
function S() {
    switch ($("button.start_robot").html()) {
        case "\u0417\u0430\u043f\u0443\u0441\u0442\u0438\u0442\u044c":
            var a = T();
            a ? q.send(JSON.stringify({
                type: "runrobot",
                userId: e("UserData").AccountID,
                parms: a,
                comment: "\u0420\u043e\u0431\u043e\u0442 \u0437\u0430\u043f\u0443\u0449\u0435\u043d"
            })) : u.soundAlert(6);
            break;
        case "\u041e\u0441\u0442\u0430\u043d\u043e\u0432\u0438\u0442\u044c":
            u.soundAlert(6),
                q.send(JSON.stringify({
                    type: "stoprobot",
                    userId: e("UserData").AccountID,
                    comment: "\u0420\u043e\u0431\u043e\u0442 \u043e\u0441\u0442\u0430\u043d\u043e\u0432\u043b\u0435\u043d \u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u0435\u043b\u0435\u043c"
                }))
    }
}
function G() {
    var a = e("ConnectionTab").lasttime;
    if (1E3 > Date.now() - a) return !1;
    l("ConnectionTab", {
        lasttime: Date.now()
    });
    setTimeout(function() {
        G()
    }, 1E3);
    return !0
}
function U(a) {
    $.ajax({
        type: "GET",
        url: "/platform/state",
        success: function(b) {
            a(b)
        }
    })
}
function l(a,
    b) {
    localStorage.setItem(a, JSON.stringify(b))
}
function e(a) {
    a = localStorage.getItem(a);
    return void 0 != a ? JSON.parse(a) : ""
}
function H() {
    "grapf" == $('input[name="expiration"]:checked').val() ? $('td[group="exper_my"]').css("display", "none") : $('td[group="exper_my"]').css("display", "table-cell")
}
function I() {
    "off" != $('input[name="CoefficientMartingale"]:checked').val() ? ($(".Martingeyl_off").css("display", "none"), $('tr[group="Martingeyl"]').css("display", "table-row")) : ($(".Martingeyl_off").css("display", "table-row"),
        $('tr[group="Martingeyl"]').css("display", "none"))
}
function J(a) {
    switch (a) {
        case "trade":
            $('div[group="tarde"]').removeClass("activ");
            $('div[group="tarde"] table').css("display", "table");
            break;
        case "signal":
            $('div[group="tarde"] table').css("display", "none"), $('div[group="tarde"]').addClass("activ")
    }
}
function C() {
    if (!e("ObjStartSetings").running) {
        var a = +$('input[name="stop_at"]').val();
        a > $('input[name="PercentageYield"]').val() ? $('input[name="stop_at"]').val($('input[name="PercentageYield"]').val()) :
            $('input[name="stop_at"]').val(Math.round(a))
    }
}
function D() {
    var a = e("ObjStartSetings");
    "new_order" == $('select[name="martin_type"]').val() ? a.running || ($('input[name="ConcurrentTransactions"]').val(1), $('input[name="ConcurrentTransactions"]').attr("disabled", "disabled"), $('input[name="stoped"').attr("disabled", "disabled"), $('input[name="stop_at"').attr("disabled", "disabled")) : a.running || ($('input[name="ConcurrentTransactions"]').removeAttr("disabled"), $('input[name="stoped"').removeAttr("disabled"),
        $('input[name="stop_at"').removeAttr("disabled"))
}
function n(a) {
    "" == e("TradeLog") && l("TradeLog", []);
    if (void 0 != a) {
        var b = new Date;
        10 > b.getDate() ? day = "0" + b.getDate() : day = b.getDate();
        10 > b.getMonth() + 1 ? month = "0" + (b.getMonth() + 1) : month = b.getMonth() + 1;
        10 > b.getHours() ? hours = "0" + b.getHours() : hours = b.getHours();
        10 > b.getMinutes() ? minutes = "0" + b.getMinutes() : minutes = b.getMinutes();
        10 > b.getSeconds() ? seconds = "0" + b.getSeconds() : seconds = b.getSeconds();
        var c = day + "." + month + " " + hours + ":" + minutes + ":" + seconds;
        b = e("TradeLog");
        b.unshift({
            user: e("UserData").AccountID,
            Date: c,
            Messeges: a
        });
        1E3 < b.length && b.splice(b.length - 1, 1);
        l("TradeLog", b)
    }
    b = e("TradeLog");
    a = "";
    c = e("UserData").AccountID;
    for (var d = 0; d < b.length; d++) c == b[d].user && (a += "<span ><date>" + b[d].Date + "</date>--\x3e" + b[d].Messeges + "</span>");
    $(".div_log").html(a)
}
function V() {
    var a = e("ObjStartSetings");
    if (0 != Object.keys(a).length) {
        var b = a.Activs;
        b = b.split(";");
        for (var c = 0; c < b.length; c++) $('li:contains("' + b[c] + '")').addClass("ui-selected");
        $("select[name=mode_robot] option").removeAttr("selected");
        $("select[name=mode_robot] option[value=" + a.mode_robot + "]").attr("selected", "selected");
        J(a.mode_robot);
        try {
            var d = a.TradeTime.split("/");
            $('input[name="s"]').val(d[0]);
            $('input[name="d"]').val(d[1]);
            $('input[name="expiration"]').removeAttr("checked");
            a.expiration.checked ? $('input[name="expiration"][value="grapf"]').attr("checked", "checked") : ($('input[name="expiration"][value="exper_my"]').attr("checked", "checked"), $('input[name="exper_my"]').val(a.expiration.val / 60));
            H();
            a.stoped.checked ? $('input[name="stoped"]').attr("checked",
                "checked") : $('input[name="stoped"]').removeAttr("checked");
            $('input[name="stop_at"]').val(a.stoped.val);
            C()
        } catch (f) {
            console.log("\u041d\u0430 \u0441\u0435\u0440\u0432\u0435\u0440\u0435 \u0440\u043e\u0431\u043e\u0442\u0430 \u043d\u0435 \u043e\u0431\u043d\u043e\u0432\u043b\u0435\u043d\u044b \u043d\u0430\u0441\u0442\u0440\u043e\u0439\u043a\u0438, \u043e\u0448\u0438\u0431\u043a\u0430 \u0438\u0441\u043f\u0440\u0430\u0432\u0438\u0442\u0441\u044f \u043f\u0440\u0438 \u043f\u0435\u0440\u0432\u043e\u043c \u0437\u0430\u043f\u0443\u0441\u043a\u0435 ")
        }
        a.saund_open ?
            $('input[name="saund_open"]').attr("checked", "checked") : $('input[name="saund_open"]').removeAttr("checked");
        $("select[name=Strategy] option").removeAttr("selected");
        $("select[name=Strategy] option[value=" + a.Strategy + "]").attr("selected", "selected");
        $("input[name=StartingBid]").val(a.StartingBid);
        $("select[name=ExpiryTime] option").removeAttr("selected");
        $("select[name=ExpiryTime] option[value=" + a.ExpiryTime + "]").attr("selected", "selected");
        $("input[name=PercentageYield]").val(a.PercentageYield);
        $("input[name=CoefficientMartingale]").removeAttr("checked");
        switch (a.CoefficientMartingale) {
            case "off":
                $("input[name=CoefficientMartingale][value=off]").attr("checked", "checked");
                break;
            case "avto":
                $("input[name=CoefficientMartingale][value=avto]").attr("checked", "checked");
                1 == a.running ? $('input[name="StepsMartingale"]').val(a.StepsMartingale) : $('input[name="StepsMartingale"]').removeAttr("disabled").val(a.StepsMartingale);
                break;
            default:
                $("input[name=CoefficientMartingale][value=fixet]").attr("checked", "checked"), $("#CoefFix").css("display", "block").val(a.CoefficientMartingale),
                    1 == a.running ? $('input[name="StepsMartingale"]').val(a.StepsMartingale) : $('input[name="StepsMartingale"]').removeAttr("disabled").val(a.StepsMartingale)
        }
        $("select[name=martin_type] option").removeAttr("selected");
        $("select[name=martin_type] option[value=" + a.martin_type + "]").attr("selected", "selected");
        I();
        D();
        $("input[name=ConcurrentTransactions]").val(a.ConcurrentTransactions);
        $("input[name=LimitTransactions]").val(a.LimitTransactions);
        $("input[name=StopLoss]").val(a.StopLoss);
        $("input[name=TakeProfit]").val(a.TakeProfit)
    } else $('li:contains("EURUSD")').addClass("ui-selected")
}
function K() {
    $(".pair_list").selectable({
        disabled: !0
    });
    $(".SettingRobot input,.SettingRobot select").attr("disabled", "disabled");
    $("button.start_robot").html("\u041e\u0441\u0442\u0430\u043d\u043e\u0432\u0438\u0442\u044c")
}
function W(a, b) {
    $("#robot_container").remove();
    $("body").append(HtmlSetingsRobotWindow);
    $("#robot_container").css("height", "600px");
    var c = $("#robot_container"),
        d = e("robotFold"),
        f = e("robotPozition");
    "" == d ? l("robotFold", {
        Fold: !1
    }) : d.Fold && ($("#robot_container").css("transition", "none"),
        $("#robot_container").addClass("Fold"), $("#robot_container .content").css("display", "none"), setTimeout(function() {
            c.css("transition", "linear 0.5s")
        }, 50));
    "" != f && (c.css("transition", "none"), c.css("left", f.left), c.css("top", f.top), setTimeout(function() {
        c.css("transition", "linear 0.5s")
    }, 50));
    $("#robot_container > div.Icon > img").attr("src", icon_top);
    $(".help > p > img").attr("src", help_2);
    $(".help > img").attr("src", help);
    $("#img_dellog").attr("src", img_dellog);
    $("#robot_container").draggable({
        containment: "body",
        scroll: !1,
        start: function(b, a) {
            $(this).css("transition", "linear 0.1s")
        },
        stop: function(b, a) {
            $(this).css("transition", "linear 0.5s")
        },
        handle: ".Title"
    });
    $(".FoldWindow").click(function() {
        1 == $(this).parent().hasClass("Fold") ? ($(this).parent().removeClass("Fold"), setTimeout("$('.content').css('display','block')", 500), l("robotFold", {
            Fold: !1
        })) : ($(this).parent().addClass("Fold"), $(".content").css("display", "none"), l("robotFold", {
            Fold: !0
        }))
    });
    $(".Title").mousemove(function(b) {
        b = $(this).offset();
        l("robotPozition", {
            left: b.left,
            top: b.top
        })
    });
    $(".CloseWindow").click(function() {
        $(this).parent("div").remove()
    });
    $(".pair_list").selectable();
    $(".help").hover(function() {
        $(this).children("p").show(100)
    }, function() {
        $(this).children("p").hide(30)
    });
    switch (r.currency.name) {
        case "usd":
            $('input[name="StartingBid"]').attr("min", 1);
            $('input[name="StartingBid"]').val(1);
            break;
        case "eur":
            $('input[name="StartingBid"]').attr("min", 1), $('input[name="StartingBid"]').val(1)
    }
    $("button.start_robot").mousedown(function() {
        S();
        $(this).addClass("clic");
        var b = $(this);
        setTimeout(function() {
            b.removeClass("clic");
            b = null
        }, 100)
    });
    $("#robot_container .content .SettingRobot .TitleSetting input,#robot_container .content .SettingRobot .TitleSetting select").change(function() {
        var b = $(this);
        switch (b.attr("name")) {
            case "mode_robot":
                J(b.val());
                break;
            case "StartingBid":
                try {
                    if ("" == r.currency.name) throw "\u041e\u0448\u0438\u0431\u043a\u0430 \u043f\u043e\u043b\u0443\u0447\u0435\u043d\u0438\u0435 \u0438\u043d\u0444\u043e\u0440\u043c\u0430\u0446\u0438\u0438 \u043e \u0442\u0438\u043f\u0435 \u0441\u0447\u0435\u0442\u0430";
                    switch (r.currency.name) {
                        case "usd":
                            var a = b.val();
                            b.val(z(a, 2));
                            1 > a ? b.val(1) : b.val(z(a, x));
                            break;
                        case "eur":
                            a = b.val();
                            b.val(z(a, 2));
                            1 > a ? b.val(1) : b.val(z(a, x));
                            break;
                        case "rub":
                            a = b.val(), b.val(Math.round(a)), 30 > a ? b.val(30) : b.val(Math.round(a))
                    }
                } catch (g) {
                    console.log(g), a = b.val(), b.val(Math.round(a)), 30 > a ? b.val(30) : b.val(Math.round(a))
                }
                break;
            case "expiration":
                H();
                break;
            case "exper_my":
                a = b.val();
                b.val(Math.round(a));
                1 > a ? b.val(1) : b.val(Math.round(a));
                break;
            case "PercentageYield":
                a = b.val();
                b.val(Math.round(a));
                0 > a ? b.val(0) : b.val(Math.round(a));
                C();
                break;
            case "CoefficientMartingale":
                a = b.val();
                "fixet" == a ? $("#CoefFix").css("display", "block") : $("#CoefFix").css("display", "none");
                $("input[name=StepsMartingale]").val(3);
                "off" == a ? $('input[name="StepsMartingale"]').attr("disabled", "disabled").val("") : $('input[name="StepsMartingale"]').removeAttr("disabled");
                I();
                D();
                "off" == a && $('input[name="ConcurrentTransactions"]').removeAttr("disabled");
                break;
            case "martin_type":
                b.val();
                D();
                break;
            case "CoefficientMartingaleFix":
                a =
                    b.val();
                0 >= a ? b.val(.1) : b.val(a);
                break;
            case "stop_at":
                C();
                break;
            case "StepsMartingale":
                a = b.val();
                0 > a ? b.val(3) : b.val(Math.round(a));
                break;
            case "ConcurrentTransactions":
                a = b.val();
                1 > a ? b.val(1) : b.val(Math.round(a));
                break;
            case "LimitTransactions":
                a = b.val();
                0 > a ? b.val(0) : b.val(Math.round(a));
                break;
            case "StopLoss":
                a = b.val();
                0 >= a ? b.val("") : b.val(Math.round(a));
                break;
            case "TakeProfit":
                a = b.val(), 0 >= a ? b.val("") : b.val(Math.round(a))
        }
    });
    $("#img_dellog").click(function() {
        localStorage.removeItem("TradeLog");
        n()
    });
    d = "";
    for (f = 0; f < a.length; f++) 0 == f ? selected = "selected" : selected = "", d += '<option value="' + a[f].value + '" ' + selected + ">" + a[f].title + "</option>";
    $('select[name="Strategy"]').html(d);
    "running" == b && K();
    V()
}
function L(a, b) {
    $("#robot_container").remove();
    $("body").append(HtmlErrWindow);
    $("#robot_container").css("height", "200px");
    $("#robot_container > div.Icon > img").attr("src", icon_top);
    $(".help > p > img").attr("src", help_2);
    $(".help > img").attr("src", help);
    $('img[var="img_err"]').attr("src", img_err);
    $("#robot_container").draggable({
        containment: "body",
        scroll: !1,
        start: function(b, a) {
            $(this).css("transition", "linear 0.1s")
        },
        stop: function(b, a) {
            $(this).css("transition", "linear 0.5s")
        },
        handle: ".Title"
    });
    $(".FoldWindow").click(function() {
        1 == $(this).parent().hasClass("Fold") ? ($(this).parent().removeClass("Fold"), setTimeout("$('.content').css('display','block')", 500)) : ($(this).parent().addClass("Fold"), $(".content").css("display", "none"))
    });
    $(".CloseWindow").click(function() {
        $(this).parent("div").remove()
    });
    void 0 != b && $("#errcontent").html(b);
    void 0 != a && $("#robot_container .Title").html(a)
}
function M(a) {
    a ? ("" == e("broken_connection").count && l("broken_connection", {
        count: 0
    }), a = e("broken_connection"), a.count = 0, l("broken_connection", a)) : ("" == e("broken_connection") && l("broken_connection", {
        count: 0
    }), a = e("broken_connection"), a.count++, l("broken_connection", a), 5 < a.count ? (L("\u041e\u0448\u0438\u0431\u043a\u0430 \u0441\u043e\u0435\u0434\u0438\u043d\u0435\u043d\u0438\u044f", '\u0412 \u0445\u043e\u0434\u0435 \u0441\u043e\u0435\u0434\u0438\u043d\u0435\u043d\u0438\u044f \u0441 \u0441\u0435\u0440\u0432\u0435\u0440\u043e\u043c \u043f\u0440\u043e\u0438\u0437\u043e\u0448\u043b\u0430 \u043a\u0440\u0438\u0442\u0438\u0447\u0435\u0441\u043a\u0430\u044f \u043e\u0448\u0438\u0431\u043a\u0430, \u043f\u043e\u0432\u0442\u043e\u0440\u043d\u043e\u0435 \u0441\u043e\u0435\u0434\u0438\u043d\u0435\u043d\u0438\u0435 \u0441\u043e\u0441\u0442\u043e\u0438\u0442\u0441\u044f \u0447\u0435\u0440\u0435\u0437 1 \u043c\u0438\u043d\u0443\u0442\u0443, \u0435\u0441\u043b\u0438 \u043e\u0448\u0438\u0431\u043a\u0430 \u0431\u0443\u0434\u0435\u0442 \u043f\u043e\u0432\u0442\u043e\u0440\u044f\u0442\u044c\u0441\u044f \u043e\u0431\u0440\u0430\u0442\u0438\u0442\u0435\u0441\u044c  \u0432 \u0441\u043b\u0443\u0436\u0431\u0443  <br><a style="color:#0F0" href="https://vk.com/olympexpert" target="_blank">\u0422\u0435\u0445\u043d\u0438\u0447\u0435\u0441\u043a\u043e\u0439 \u043f\u043e\u0434\u0434\u0435\u0440\u0436\u043a\u0438 \u043a\u043b\u0438\u0435\u043d\u0442\u043e\u0432</a>'),
        setTimeout(function() {
            location.reload()
        }, 6E4)) : location.reload())
}
function X(a) {
    var b;
    if (!(b = 3 > N)) {
        var c = $('input[name="s"]').val().split(":");
        b = +c[0];
        var d = +c[1],
            f = $('input[name="d"]').val().split(":");
        c = +f[0];
        var h = +f[1];
        if (0 == b && 0 == c && 0 == d && 0 == h) b = !0;
        else {
            var k = new Date;
            nowh = +k.getHours();
            nowm = +k.getMinutes();
            var g = 0;
            b >= c && (b > c ? g++ : d > h && g++);
            f = new Date(k.getFullYear(), k.getMonth(), k.getDate(), k.getHours(), k.getMinutes(), 0, 0);
            b = new Date(k.getFullYear(), k.getMonth(), k.getDate(), b, d, 0, 0);
            c = new Date(k.getFullYear(),
                k.getMonth(), k.getDate() + g, c, h, 0, 0);
            b = f > b && f < c ? !0 : !1
        }
        b = !b
    }
    if (b) return !1;
    b = e("ObjStartSetings");
    if (b.Strategy != a.Strategy || void 0 == a.initiator && a.TimeFrame != b.ExpiryTime || e("ObjServiceYieldActivs")[a.CurrPair] < b.PercentageYield || 0 == b.Activs.indexOf(a.CurrPair) + 1) return !1;
    if ("signal" == b.mode_robot) return b = "up" == a.Dir ? "\u0441\u0442\u0430\u0432\u043a\u0430 \u0432\u0432\u0435\u0440\u0445" : "\u0441\u0442\u0430\u0432\u043a\u0430 \u0432\u043d\u0438\u0437", console.log(a.Dir + " " + b), void 0 != a.time_close ? (c =
        new Date(1E3 * a.time_close), c = " \u0432\u0440\u0435\u043c\u044f \u044d\u043a\u0441\u043f\u0438\u0440\u0430\u0446\u0438\u0438 \u0434\u043e " + c.getHours() + ":" + c.getMinutes()) : c = " \u042d\u043a\u0441\u043f\u0438\u0440\u0430\u0446\u0438\u044f " + a.TimeFrame + " \u0441\u0435\u043a", n("\u041f\u043e\u0441\u0442\u0443\u043f\u0438\u043b \u0441\u0438\u0433\u043d\u0430\u043b \u043e\u0442 \u0440\u043e\u0431\u043e\u0442\u0430 \u0441 \u0440\u0435\u043a\u043e\u043c\u0435\u043d\u0434\u0430\u0446\u0438\u0435\u0439: " + b +
        " \u043f\u043e \u0430\u043a\u0442\u0438\u0432\u0443 " + a.CurrPair + c), u.noti_window_activ(1, 15, "\u0421\u0438\u0433\u043d\u0430\u043b \u043e\u0442 \u0440\u043e\u0431\u043e\u0442\u0430 ", "\u041f\u043e\u0441\u0442\u0443\u043f\u0438\u043b \u0441\u0438\u0433\u043d\u0430\u043b \u043e\u0442 \u0440\u043e\u0431\u043e\u0442\u0430 \u0441 \u0440\u0435\u043a\u043e\u043c\u0435\u043d\u0434\u0430\u0446\u0438\u0435\u0439: " + b + " \u043f\u043e \u0430\u043a\u0442\u0438\u0432\u0443 " + a.CurrPair + c);
    c = e("Transaction");
    for (f =
        0; f < c.length; f++)
        if (a.CurrPair == c[f].Pair) return !1;
    if (c.length >= b.ConcurrentTransactions) return !1;
    if ("new_order" != b.martin_type) {
        d = b.StartingBid;
        for (f = 0; f < c.length; f++) d += c[f].Amount;
        if (d > b.LimitTransactions) return !1
    }
    c = a.Dir;
    f = b.expiration.checked ? a.TimeFrame : b.expiration.val;
    if ("new_order" == b.martin_type) {
        d = e("allFailure");
        if (d.Lastpair == a.CurrPair) return !1;
        b = 0 != d.Totalloss ? O(d.Amount, d.Totalloss, a.CurrPair) : b.StartingBid
    } else b = b.StartingBid;
    if (E(a.CurrPair, f, b, c, null, void 0 != a.time_close ? a.time_close :
            void 0)) return !0
}
READ ALSO
Слайдер на JavaScript

Слайдер на JavaScript

Подскажите, пожалуйста, что я делаю неправильноМне нужно сделать управляемый цикличный слайдер

243
reduce в digital_root

reduce в digital_root

Ребята, здравствуйтеДелаю задания на codewars, не могу понять, почему последняя итерация reduce возвращает конкатенацию вместо сложения

211
Как сделать вход с помощью LinkedIn?

Как сделать вход с помощью LinkedIn?

Доброго времени суток, на сайте нужно сделать кнопку входа через LinkedInСделал как тут написано

190
задачка из учебника learn.javascript.ru на тему insertBefore и appendChild

задачка из учебника learn.javascript.ru на тему insertBefore и appendChild

Напишите функцию insertAfter(elem, refElem), которая добавит elem после узла refElemкак я понимаю нужно вставить elem после первого дива на странице(между двух...

177