Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- path = "/";
- menuHeader = 0;
- sys_path = "/core/";
- var sName = "Спамер для ВКонтакте";
- var spamer = {
- box: function(type) {
- $("#blackbg, #box").css({
- "display": ((type == "show") ? "block" : "none")
- });
- },
- explode: function(delimiter, string) {
- var emptyArray = {
- 0: ''
- };
- if (arguments.length != 2 || typeof arguments[0] == 'undefined' || typeof arguments[1] == 'undefined') {
- return null;
- }
- if (delimiter === '' || delimiter === false || delimiter === null) {
- return false;
- }
- if (typeof delimiter == 'function' || typeof delimiter == 'object' || typeof string == 'function' || typeof string == 'object') {
- return emptyArray;
- }
- if (delimiter === true) {
- delimiter = '1';
- }
- return string.toString().split(delimiter.toString());
- },
- in_array: function(needle, haystack, strict) {
- var found = false,
- key, strict = !!strict;
- for (key in haystack) {
- if ((strict && haystack[key] === needle) || (!strict && haystack[key] == needle)) {
- found = true;
- break;
- }
- }
- return found;
- },
- saveSettings: function() {
- $(".info_app").hide();
- var text = $("#textSpam").val();
- var attachments = $("#attachmentsSpam").val();
- var publics = $("#publicsSpam").val();
- if (!text && !attachments) {
- $("#textSpam").focus();
- return false;
- }
- if (!publics) {
- $("#publicsSpam").focus();
- return false;
- }
- var arrChecks = spamer.explode(",", checks.getValueCheckbox("botStatus, sc, pu"));
- console.log(arrChecks);
- var bt = spamer.in_array("botStatus", arrChecks) ? 1 : 0;
- var pu = spamer.in_array("pu", arrChecks) ? 1 : 0;
- var sc = spamer.in_array("sc", arrChecks) ? 1 : 0;
- $.post(path + "core/setInfoSpam.php", {
- attachments: attachments,
- text: text,
- proxy: $("#proxy").val(),
- publics: publics,
- bt: bt,
- pu: pu,
- sc: sc
- }, function(data) {
- var res = $.parseJSON(data);
- if (res.error_text) {
- $(".info_app").show().html(res.error_text);
- res.error_code == 3 || res.proxyError ? $(".info_app").attr("msgBig", "true") : $(".info_app").attr("msgBig", "false");
- return false;
- }
- if (res.success_text) {
- spamer.settingsBox(res.success_text + ((res.proxyError) ? res.proxyError : ""), "block", ((res.proxyError) ? "true" : "false"));
- }
- });
- },
- settingsBox: function(msgT, msgBlock, proxyError, proxyErrorText) {
- $.get(path + "core/getInfoSpam.php", function(data) {
- var res = $.parseJSON(data);
- var settings_ = spamer.boxGetStyles(382, 130, "absolute", 0);
- $("#box").css({
- "width": settings_[2],
- "top": settings_[0],
- "left": settings_[1],
- "position": settings_[3]
- });
- $("#box #box_content #title #left").html("Настройки Спама");
- $("#box #box_content #title #right").html("<a onclick=\"spamer.box('hide')\">Закрыть</a>");
- $("#box #box_content #footer").html("<div role=\"saveSettings\" index=\"return\" class=\"blue_button\">Сохранить</div>");
- $("#box #box_content #message").html("<div index=\"pad\"></div><div index=\"registerF\" class=\"info_app\" msgBig=\"" + proxyError + "\" item=\"" + msgBlock + "\">" + msgT + "</div><input value=\"" + res.text + "\" autocomplete=\"off\" type=\"text\" class=\"default\" index=\"defaultR\" id=\"textSpam\" placeholder=\"Введите текст для спама\"><br><input value=\"" + res.attachments + "\" autocomplete=\"off\" type=\"text\" class=\"default\" index=\"defaultR\" id=\"attachmentsSpam\" placeholder=\"Введите прикрепления для спама через запятую\"><br><input value=\"" + res.publics + "\" autocomplete=\"off\" type=\"text\" class=\"default\" index=\"defaultR\" id=\"publicsSpam\" placeholder=\"Введите домены или ID`ы групп через запятую\"><br><div id=\"botStatus\"></div>");
- settings_[4] == 1 ? $("#footer").html("").removeClass("footer") : $("#footer").addClass("footer");
- spamer.box("show");
- var checkeds = "";
- if (res.botStatus == 1) {
- checkeds += "botStatus,";
- }
- if (res.sc == 1) {
- checkeds += "sc,";
- }
- checkeds = checkeds.substr(0, checkeds.length - 1);
- checks.newCheckbox('botStatus', [
- ['botStatus', 'Включить спамер'],
- ['sc', 'Спам по комментариям']
- ], checkeds);
- $("[role=\"saveSettings\"]").click(function() {
- spamer.saveSettings();
- });
- });
- },
- changePBox: function() {
- var settings_ = spamer.boxGetStyles(382, 130, "absolute", 0);
- $("#box").css({
- "width": settings_[2],
- "top": settings_[0],
- "left": settings_[1],
- "position": settings_[3]
- });
- $("#box #box_content #title #left").html("Смена пароля");
- $("#box #box_content #title #right").html("<a onclick=\"spamer.box('hide')\">Закрыть</a>");
- $("#box #box_content #footer").html("<div role=\"changePassword\" index=\"return\" class=\"blue_button\">Продолжить</div>");
- $("#box #box_content #message").html("<div index=\"pad\"></div><div index=\"registerF\" class=\"info_app\"></div><input autocomplete=\"off\" type=\"text\" class=\"default\" index=\"defaultR\" id=\"oldP\" placeholder=\"Введите старый пароль\"><br><input autocomplete=\"off\" type=\"text\" class=\"default\" index=\"defaultR\" id=\"newP\" placeholder=\"Введите новый пароль\"><br><input autocomplete=\"off\" type=\"text\" class=\"default\" index=\"defaultR\" id=\"newP_\" placeholder=\"Подтвердите новый пароль\">");
- settings_[4] == 1 ? $("#footer").html("").removeClass("footer") : $("#footer").addClass("footer");
- spamer.box("show");
- $("[role=\"changePassword\"]").click(function() {
- spamer.changePassword();
- });
- },
- changePassword: function() {
- $(".info_app").hide();
- var oldP = $("#oldP").val();
- var newP = $("#newP").val();
- var newP_ = $("#newP_").val();
- if (!oldP) {
- $("#oldP").focus();
- return;
- }
- if (!newP) {
- $("#newP").focus();
- return;
- }
- if (!newP_ || newP !== newP_) {
- $("#newP_").focus();
- return;
- }
- $.post(path + "core/changePassword.php", {
- oldP: oldP,
- newP: newP,
- newP_: newP_
- }, function(data) {
- var res = $.parseJSON(data);
- if (res.success == 1) {
- $(".info_app").show().html("Ваш пароль был успешно изменен");
- $("#oldP, #newP, #newP_").val("");
- return;
- }
- if (res.error_text) {
- $(".info_app").show().html(res.error_text);
- }
- });
- },
- premInfo: function() {
- $.get(path + "core/premInfo.php", function(data) {
- var res = $.parseJSON(data);
- res.error_code == 1 ? location.reload() : "";
- var settings_ = spamer.boxGetStyles(382, 130, "absolute", 0);
- $("#box").css({
- "width": settings_[2],
- "top": settings_[0],
- "left": settings_[1],
- "position": settings_[3]
- });
- $("#box #box_content #title #left").html("Премиум");
- $("#box #box_content #title #right").html("<a onclick=\"spamer.box('hide')\">Закрыть</a>");
- settings_[4] == 1 ? $("#footer").html("").removeClass("footer") : $("#footer").addClass("footer");
- $("#box #box_content #footer").html("<div onclick=\"spamer.boxPay()\" index=\"return\" class=\"blue_button\">Купить премиум на 30 дней</div>");
- $("#box #box_content #message").html("<div class=\"premInfo\">Премиум позволяет бесплатно использовать наш сервис в полной объеме.<br> <br>Чтобы пользоваться сервисом вы должны приобрести премиум на ваш аккаунт на 30 или более дней. <br> <br> <div class=\"my_settings_account_description_hint\">" + res.date + "</div> </div>");
- spamer.box("show");
- });
- },
- accountDelete: function(uid) {
- if (!uid) return false;
- $(".info_app").hide();
- $.get(path + "core//accounts/delete.php", {
- uid: uid
- }, function(data) {
- var res = $.parseJSON(data);
- res.error_code == 1 ? location.reload() : "";
- if (res.success == 1) {
- spamer.accountsBox();
- }
- if (res.error_text) {
- $(".info_app").show().html(res.error_text);
- return false;
- }
- });
- },
- accountDelete_: function(email, page) {
- if (!email) return false;
- $.get(path + "core/admin/deleteAcc.php", {
- email: email
- }, function(data) {
- var res = $.parseJSON(data);
- res.error_code == 1 ? location.reload() : "";
- if (res.success == 1) {
- spamer.U(page);
- }
- });
- },
- accountsBox: function() {
- $.get(path + "core/accounts/get.php", function(data) {
- var res = $.parseJSON(data);
- res.error_code == 1 ? location.reload() : "";
- var settings_ = spamer.boxGetStyles(382, 130, "absolute", ((res.canAddAccount == 1) ? 0 : 1));
- $("#box").css({
- "width": settings_[2],
- "top": settings_[0],
- "left": settings_[1],
- "position": settings_[3]
- });
- $("#box #box_content #title #left").html("Мои аккаунты");
- $("#box #box_content #title #right").html("<a onclick=\"spamer.box('hide')\">Закрыть</a>");
- $("#box #box_content #footer").html("<div role=\"addAccount\" index=\"return\" class=\"blue_button\">Добавить аккаунт</div>");
- var accounts = "";
- if (res.accounts.length == 0) {
- $("#box #box_content #message").html("<div class=\"noRes\">У вас еще нету аккаунтов</div>").addClass("select-none");
- } else {
- var arrF = [];
- var arrT = [];
- for (var i = 0; i < res.accounts.length; i++) {
- arrF.push(res.accounts[i].uid);
- arrT.push(res.accounts[i].off);
- accounts += "<div class=\"top_user_overflow\"> <div class=\"top_user_avatar\"> <img src=\"" + res.accounts[i].photo + "\"> </div> <div class=\"top_user_info\"> <div class=\"top_user_name\"> <span onclick=\"window.open('http://vk.com/id" + res.accounts[i].uid + "')\"><b>" + res.accounts[i].name + "</b></span><div acc=\"accStatus\" id=\"" + res.accounts[i].uid + "\"></div><span><div onclick=\"spamer.accountDelete(" + res.accounts[i].uid + ")\" class=\"icons_tab iconAccountDel\"></div></span> </div> </div> </div>";
- }
- $("#box #box_content #message").html(accounts).addClass("select-none");
- for (var a = 0; a < arrF.length; a++) {
- checks.newCheckbox(arrF[a], [
- [arrF[a], '']
- ], '');
- }
- var clicks = "";
- for (var c = 0; c < arrF.length; c++) {
- clicks += "#" + arrF[c] + ",";
- }
- for (var tt = 0; tt < arrF.length; tt++) {
- if (arrT[tt] == 1) {
- checks.setActiveCheckbox(arrF[tt], arrF[tt]);
- } else {
- checks.removeActiveCheckbox(arrF[tt], arrF[tt]);
- }
- }
- var clicks = clicks.substr(0, clicks.length - 1);
- $(clicks).click(function(e) {
- var id = e.currentTarget.id;
- $.get(path + "core/accounts/status.php", {
- uid: id,
- status: ((checks.getValueCheckbox(id)) ? 1 : 0)
- }, function(data) {
- var res = $.parseJSON(data);
- })
- });
- }
- settings_[4] == 1 ? $("#footer").html("").removeClass("footer") : $("#footer").addClass("footer");
- if (res.canAddAccount == 1) {
- $("[role=\"addAccount\"]").click(function() {
- var settings_ = spamer.boxGetStyles(382, 130, "absolute", 0);
- $("#box").css({
- "width": settings_[2],
- "top": settings_[0],
- "left": settings_[1],
- "position": settings_[3]
- });
- $("#box #box_content #title #left").html("<div index=\"myAccounts\" id=\"leftTitleBack\">Мои аккаунты</div>");
- $("#box #box_content #title #right").html("<a onclick=\"spamer.box('hide')\">Закрыть</a>");
- settings_[4] == 1 ? $("#footer").html("").removeClass("footer") : $("#footer").addClass("footer");
- $("#box #box_content #footer").html("<div id=\"addAcc\"> <div index=\"addAcc\" class=\"blue_button\">Добавить аккаунт</div> <div index=\"getAccToken\" class=\"blue_button\">Получить access token</div> </div>");
- $("#box #box_content #message").html("<div index=\"pad\"></div><div index=\"registerF\" class=\"info_app\"></div><input autocomplete=\"off\" type=\"text\" class=\"default\" index=\"token\" id=\"token\" placeholder=\"Введите access token\">");
- $("[index=\"myAccounts\"]").click(function() {
- spamer.accountsBox();
- });
- spamer.box("show");
- $("[index=\"getAccToken\"]").click(function() {
- window.open('http://oauth.vk.com/authorize?client_id=3087106&scope=wall,photos,offline,groups,friends,status,offline&redirect_uri=http://api.vk.com/blank.html&display=page&response_type=token')
- });
- $("[index=\"addAcc\"]").click(function() {
- $(".info_app").hide();
- if ($("[index=\"token\"]").val()) {
- $.get(path + "core/accounts/add.php", {
- token: $("[index=\"token\"]").val(),
- cSid_: $("#captcha_key").val(),
- cSid: $("#captcha_sid").val()
- },
- function(data) {
- $("#captcha").remove();
- var res = $.parseJSON(data);
- res.error_code == 1 ? location.reload() : "";
- if (res.success == 1) {
- $(".info_app").show().html("Аккаунт успешно добавлен");
- $("[index=\"token\"]").val("");
- }
- if (res.error_code == 99) {
- $("#box #box_content #message").append("<div id=\"captcha\"><img src=\"" + res.captcha_img + "\" class=\"captcha_img\"><input type=\"hidden\" id=\"captcha_sid\" value=\"" + res.captcha_sid + "\"><input autocomplete=\"off\" type=\"text\" class=\"default\" index=\"token\" id=\"captcha_key\" placeholder=\"Введите код с картинки\"></div>");
- }
- if (res.error_text) {
- $(".info_app").show().html(res.error_text);
- }
- });
- } else {
- $("[index=\"token\"]").focus();
- }
- });
- });
- }
- spamer.box("show");
- });
- },
- logout: function() {
- $.get(path + "core/logout.php", {
- hash: hash
- }, function(data) {
- var res = $.parseJSON(data);
- res.error_code == 1 ? location.reload() : "";
- if (res.success == 1) {
- location.href = path;
- }
- });
- },
- yandexPayCheck: function() {
- $(".info_app").hide();
- $.get(path + "core/pay/yandex/check.php", function(data) {
- var res = $.parseJSON(data);
- res.error_code == 1 ? location.reload() : "";
- if (res.success == 1) {
- $(".info_app").show().html("Вы успешно купили 30 дней премиума");
- return false;
- } else {
- if (res.error_text) {
- $(".info_app").show().html(res.error_text);
- return false;
- }
- }
- });
- },
- boxGetStyles: function(width, top, position, removeFooter) {
- top = top > $(window).height() ? 0 : top;
- var left = ($(window).width() - width) / 2;
- console.log([top, left, width, position, removeFooter]);
- return [top, left, width, position, removeFooter];
- },
- scroll: function(el) {
- if ($(el).scrollTop() > 1) {
- $('#stl_bg').show().css({
- "padding-top": 30
- });
- } else {
- $('#stl_bg').hide();
- }
- },
- settings: function() {
- $("#blackbg").attr({
- "onclick": "spamer.box('hide')"
- });
- $("[index=\"box\"]").html("<div id=\"box\"> <div id=\"box_content\"> <div id=\"title\"> <div id=\"left\"> </div> <div id=\"right\"> </div> </div> <div id=\"message\"> </div> <div class=\"footer\" id=\"footer\"> <div class=\"footer_left\"> </div><div class=\"footer_right\"> </div> </div> </div> </div>");
- $("#header").addClass("select-none");
- $("#stl_bg").html("<nobr id=\"stl_text\">Наверх</nobr>").css({
- "padding-top": 30
- });
- if (email) {
- $("[index=\"profile\"] div").html(email);
- $("[index=\"u\"] div").html(((IA == 1) ? "Пользователи" : ""));
- $("[index=\"a\"] div").html(((IA == 1) ? "Администрирование" : ""));
- $("[index=\"logout\"] div").html("Выйти").attr({
- "hash": hash
- });
- }
- $("[role=\"accounts\"]").click(function() {
- spamer.accountsBox();
- });
- $("[index=\"a\"]").click(function() {
- spamer.A();
- });
- $("[index=\"u\"]").click(function() {
- spamer.U(1);
- });
- $("[role=\"premium\"]").click(function() {
- spamer.premInfo();
- });
- $("[role=\"changePassword\"]").click(function() {
- spamer.changePBox();
- });
- $("[role=\"settings\"]").click(function() {
- spamer.settingsBox("", "");
- });
- $("[index=\"login\"]").click(function() {
- var settings_ = spamer.boxGetStyles(280, 130, "absolute", 0);
- $("#box").css({
- "width": settings_[2],
- "top": settings_[0],
- "left": settings_[1],
- "position": settings_[3]
- });
- $("#box #box_content #title #left").html("Вход на сайт");
- $("#box #box_content #title #right").html("<a onclick=\"spamer.box('hide')\">Закрыть</a>");
- $("#box #box_content #footer").html("<div role=\"login\" index=\"return\" class=\"blue_button\">Продолжить</div>");
- $("#box #box_content #message").html("<div index=\"pad\"></div><div index=\"loginF\" class=\"info_app\"></div><input autocomplete=\"off\" type=\"text\" class=\"default\" index=\"default\" id=\"email\" placeholder=\"Введите Ваш E-mail\"><br><input autocomplete=\"off\" type=\"password\" class=\"default\" index=\"default\" id=\"password\" placeholder=\"Введите Ваш Пароль\">");
- settings_[4] == 1 ? $("#footer").html("").removeClass("footer") : $("#footer").addClass("footer");
- spamer.box("show");
- $("[role=\"login\"]").click(function() {
- spamer.login();
- });
- });
- $("[index=\"logout\"]").click(function() {
- spamer.logout();
- });
- $("#stl_bg").click(function() {
- $("body").animate({
- "scrollTop": "0px"
- }, 250);
- });
- $("[index=\"restore\"]").click(function() {
- $.post(path + "core/restore.php", function(data) {
- var res = $.parseJSON(data);
- var settings_ = spamer.boxGetStyles(500, 130, "absolute", 0);
- $("#box").css({
- "width": settings_[2],
- "top": settings_[0],
- "left": settings_[1],
- "position": settings_[3]
- });
- $("#box #box_content #title #left").html("Восстановление пароля");
- $("#box #box_content #title #right").html("<a onclick=\"spamer.box('hide')\">Закрыть</a>");
- $("#box #box_content #footer").html("<div onclick=\"spamer.restore()\" index=\"return\" class=\"blue_button\">Продолжить</div>");
- $("#box #box_content #message").html("<div index=\"pad\"></div><div index=\"restoreF\" class=\"info_app\"></div><input autocomplete=\"off\" type=\"text\" class=\"default\" index=\"restoreR\" id=\"email\" placeholder=\"Введите E-mail введенный при регистрации\"><br><input autocomplete=\"off\" type=\"hidden\" class=\"default\" index=\"restoreR\" id=\"code\" placeholder=\"Введите код подтверждения\">");
- settings_[4] == 1 ? $("#footer").html("").removeClass("footer") : $("#footer").addClass("footer");
- spamer.box("show");
- if (res.restore == 1) {
- $(".info_app").show().html(res.success_text);
- $("#code").focus();
- $("#code").attr({
- "type": "text"
- });
- $("#email").val(res.email).attr({
- "disabled": "disabled"
- });
- }
- });
- });
- $("[index=\"register\"]").click(function() {
- var settings_ = spamer.boxGetStyles(382, 130, "absolute", 0);
- $("#box").css({
- "width": settings_[2],
- "top": settings_[0],
- "left": settings_[1],
- "position": settings_[3]
- });
- $("#box #box_content #title #left").html("Моментальная регистрация");
- $("#box #box_content #title #right").html("<a onclick=\"spamer.box('hide')\">Закрыть</a>");
- $("#box #box_content #footer").html("<div role=\"register\" index=\"return\" class=\"blue_button\">Продолжить</div>");
- $("#box #box_content #message").html("<div index=\"pad\"></div><div index=\"registerF\" class=\"info_app\"></div><input autocomplete=\"off\" type=\"text\" class=\"default\" index=\"defaultR\" id=\"email\" placeholder=\"Введите E-mail\"><br><input autocomplete=\"off\" type=\"password\" class=\"default\" index=\"defaultR\" id=\"password\" placeholder=\"Введите Пароль\">");
- settings_[4] == 1 ? $("#footer").html("").removeClass("footer") : $("#footer").addClass("footer");
- spamer.box("show");
- $("[role=\"register\"]").click(function() {
- spamer.register();
- });
- });
- },
- U: function(page) {
- $.get(path + "core/admin/getUsers.php", {
- page: page
- }, function(data) {
- var content = data.split("|");
- $("#box #box_content #footer .footer_right").html("");
- var settings_ = spamer.boxGetStyles(458, 130, "absolute", 0);
- $("#box").css({
- "width": settings_[2],
- "top": settings_[0],
- "left": settings_[1],
- "position": settings_[3]
- });
- $("#box #box_content #message").html(content[0]);
- $("#box #box_content #title #left").html("Пользователи — " + content[2] + ", сегодня — " + content[3] + ", вчера — " + content[4]);
- $("#box #box_content #title #right").html("<a href=\"#\" onclick=\"spamer.box('none')\">Закрыть</a>");
- $("#box #box_content #footer").html(content[1]);
- $("#box #box_content #footer .big_tabs").css({
- "margin-left": (458 - $("#box #box_content #footer .big_tabs").width()) / 2
- });
- $("#box #box_content #footer .footer_right").html("");
- });
- spamer.box("show");
- },
- A: function() {
- $("#box #box_content #footer .footer_right").html("");
- var settings_ = spamer.boxGetStyles(458, 130, "absolute", 0);
- $("#box").css({
- "width": settings_[2],
- "top": settings_[0],
- "left": settings_[1],
- "position": settings_[3]
- });
- $("#box #box_content #message").html("<div class=\"boxCon\"><input autocomplete=\"off\" type=\"text\" class=\"default\" index=\"addPremU\" placeholder=\"E-mail пользователя\"><div id=\"banned\"></div></div>");
- $("#box #box_content #title #left").html("Начисление дней премиума");
- $("#box #box_content #title #right").html("<a href=\"#\" onclick=\"spamer.box('none')\">Закрыть</a>");
- $("#box #box_content #footer").html("<div role=\"addPrem\" index=\"return\" class=\"blue_button\">Продолжить</div>");
- $("#box #box_content #footer .footer_right").html("");
- var times = ["5 минут", "30 минут", "1 час", "6 часов", "1 день", "1 неделя", "1 месяц", "6 месяцев", "1 год"];
- var timesBan = [];
- for (i = 0; i < 9; i++) {
- var timesBan_ = times[i];
- var timesBan__ = [i, timesBan_];
- timesBan.push(timesBan__);
- }
- timesBan.push('5 минут');
- select._new('banned', {
- width: 150,
- del_end: 1
- }, timesBan);
- spamer.box("show");
- $("[role=\"addPrem\"]").click(function() {
- $.post(path + "core/addPremTime.php", {
- user: $("[index=\"addPremU\"]").val(),
- time: $("#select_value_banned").val()
- }, function(data) {
- var res = $.parseJSON(data);
- alert(res.success == 1 ? "Время премиума успешно изменено" : res.error_text);
- });
- });
- },
- login: function() {
- $(".info_app").hide();
- var email = $("#email").val();
- var password = $("#password").val();
- if (!email) {
- $("#email").focus();
- return false;
- }
- if (!password) {
- $("#password").focus();
- return false;
- }
- $.get(path + "core/login.php", {
- email: email,
- password: password
- }, function(data) {
- var res = $.parseJSON(data);
- if (res.error_code == 1) {
- location.href = path;
- return false;
- }
- if (res.error_text) {
- $(".info_app").show().html(res.error_text);
- return false;
- }
- if (res.success) {
- location.href = path;
- }
- });
- },
- register: function() {
- $(".info_app").hide();
- var email = $("#email").val();
- var password = $("#password").val();
- if (!email) {
- $("#email").focus();
- return false;
- }
- if (!password) {
- $("#password").focus();
- return false;
- }
- $.get(path + "core/register.php", {
- email: email,
- password: password
- }, function(data) {
- var res = $.parseJSON(data);
- if (res.success) {
- location.href = path;
- }
- if (res.error_code == 1) {
- location.href = path;
- return false;
- }
- if (res.error_text) {
- $(".info_app").show().html(res.error_text);
- return false;
- }
- });
- },
- restore: function() {
- $(".info_app").hide();
- var email = $("#email").val();
- var code = $("#code").val();
- if (!email) {
- $("#email").focus();
- return false;
- }
- $.post(path + "core/restore.php", {
- email: email,
- restoreCode: code
- }, function(data) {
- var res = $.parseJSON(data);
- if (res.success == 1) {
- $(".info_app").show().html(res.success_text);
- return false;
- }
- if (res.success == 2) {
- $("#code").focus();
- $(".info_app").show().html(res.success_text);
- $("#code").attr({
- "type": "text"
- });
- $("#email").attr({
- "disabled": "disabled"
- });
- return false;
- }
- if (res.error_code == 1) {
- location.href = path;
- return false;
- }
- if (res.error_text) {
- $(".info_app").show().html(res.error_text);
- return false;
- }
- });
- },
- in_array: function(needle, haystack, strict) {
- var found = false,
- key, strict = !!strict;
- for (key in haystack) {
- if ((strict && haystack[key] === needle) || (!strict && haystack[key] == needle)) {
- found = true;
- break;
- }
- }
- return found;
- },
- boxPay: function() {
- var settings_ = spamer.boxGetStyles(692, 130, "absolute", 1);
- $("#box").css({
- "width": settings_[2],
- "top": settings_[0],
- "left": settings_[1],
- "position": settings_[3]
- });
- $("#box #box_content #title #left").html("Оплата премиума");
- $("#box #box_content #title #right").html("<a onclick=\"spamer.box('hide')\">Закрыть</a>");
- $("#box #box_content #message").html("<div index=\"pad\"></div><div index=\"registerF\" class=\"info_app\"></div><div id=\"rangeOfPay\"> <div id=\"printPay\"> <div class=\"payCat\" index=\"noAuto\"> <div class=\"payCatLeft\"> <div class=\"webmoney\"></div> </div> <div class=\"payCatRight\"> <div class=\"payCatRightTitle\">WebMoney</div> <div class=\"payCatRightDesc\">WebMoney — это универсальное средство для расчетов в Сети, целая среда финансовых взаимоотношений, которой сегодня пользуются миллионы людей по всему миру.</div> </div> </div><div class=\"payCat\" index=\"noAuto\"> <div class=\"payCatLeft\"><div class=\"qiwi\"></div> </div> <div class=\"payCatRight\"> <div class=\"payCatRightTitle\">Qiwi</div> <div class=\"payCatRightDesc\">Visa QIWI Wallet — это электронный кошелек, основанный на предоплаченном счете Visa. Visa QIWI Wallet предоставляет своим клиентам доступ к универсальным, надежным и безопасным продуктам Visa.</div> </div> </div> <div class=\"payCat\" index=\"yandex\"> <div class=\"payCatLeft\"> <div class=\"yandex\"></div> </div> <div class=\"payCatRight\"> <div class=\"payCatRightTitle\">Яндекс.Деньги</div> <div class=\"payCatRightDesc\">Яндекс.Деньги — доступный и безопасный способ платить за товары и услуги через интернет. На сайте Яндекс.Денег можно оплатить квитанцию, кредит или штраф, перевести или вывести деньги.</div> </div> </div> </div> </div>");
- settings_[4] == 1 ? $("#footer").html("").removeClass("footer") : $("#footer").addClass("footer");
- spamer.box("show");
- $("[index=\"noAuto\"]").click(function() {
- window.open("http://vk.com/im?sel=186551038");
- });
- $("[index=\"yandex\"]").click(function() {
- spamer.buyDoYandex();
- });
- },
- buyDoYandex: function() {
- $.get(path + "core/pay/yandex/create.php", function(data) {
- var res = $.parseJSON(data);
- res.error_code == 1 ? location.reload() : "";
- var settings_ = spamer.boxGetStyles(392, 130, "absolute", 0);
- $("#box").css({
- "width": settings_[2],
- "top": settings_[0],
- "left": settings_[1],
- "position": settings_[3]
- });
- settings_[4] == 1 ? $("#footer").html("").removeClass("footer") : $("#footer").addClass("footer");
- $("#box #box_content #title #left").html("Оплата через Яндекс.Деньги");
- $("#box #box_content #title #right").html("<a onclick=\"spamer.box('hide')\">Закрыть</a>");
- $("#box #box_content #footer").html("<div role=\"yandexPayCountinue\" index=\"return\" class=\"blue_button\">Проверить</div>");
- $("#box #box_content #message").html("<div index=\"pad\"></div><div index=\"registerF\" class=\"info_app\"></div><input autocomplete=\"off\" type=\"text\" class=\"default\" index=\"codePay\" id=\"codePay\" value=\"Примечание к платежу\" disabled> <input autocomplete=\"off\" type=\"text\" class=\"default\" index=\"codePay_\" id=\"codePay_\" value=\"" + res.code + "\" disabled> <input autocomplete=\"off\" type=\"text\" class=\"default\" index=\"codePay\" id=\"pursePay\" value=\"Кошелек для перевода\" disabled> <input autocomplete=\"off\" type=\"text\" class=\"default\" index=\"codePay_\" id=\"codePurse\" value=\"" + res.purse + "\" disabled> <input autocomplete=\"off\" type=\"text\" class=\"default\" index=\"codePay\" id=\"summaPay\" value=\"Сумма платежа\" disabled> <input autocomplete=\"off\" type=\"text\" class=\"default\" index=\"codePay_\" id=\"summaPay_\" value=\"" + res.amount + "\" disabled>");
- $("[role=\"yandexPayCountinue\"]").click(function() {
- spamer.yandexPayCheck();
- });
- });
- },
- menuGet: function(url, x) {
- $(".info_app").hide();
- location.hash = url;
- $("[index=\"loader\"]").css({
- "opacity": "1"
- });
- $(".nav").attr("onclick", "return false");
- setTimeout(function() {
- $.get(path + "core/menu.php", {
- to: url
- }, function(data) {
- var res = $.parseJSON(data);
- res.error_code == 1 ? location.reload() : "";
- if (res.error == 404) {
- console.log("Error 404");
- return false;
- }
- for (var i = 0; i < res.response.length; i++) {
- if (res.response[i].header) {
- var onclick = 'spamer.menuGet("' + res.response[i].m_to + '",""); return false';
- if (res.response[i].index == "active") {
- $(".con_page_block .wk_header").addClass("select-none").html(res.response[i].header);
- if (res.response[i].section == 1) {
- $.get(sys_path + res.response[i].message, function(data) {
- $(".con_page_block .message").html(data);
- });
- } else {
- $(".con_page_block .message").html(res.response[i].message);
- }
- }
- x += "<a num=" + i + " onclick='" + onclick + "' class=\"nav " + res.response[i].m_class + "\" index=" + res.response[i].index + ">" + res.response[i].m_text + "</a>";
- }
- }
- x.replace("undefined", "");
- $("#body_con").addClass("select-none");
- $("#main_menu .cat").addClass("select-none").html(x).css({
- "display": "block"
- });
- $(".message img").attr("onclick", "window.open(this.src)");
- $(".con_page_block .message a").attr("target", "_blank");
- $("[index=\"loader\"]").css({
- "opacity": "0"
- });
- });
- }, 0);
- }
- }
- $(d).ready(function() {
- /*
- var arr = email ? ["about"] : ["about"];
- if (email) {
- ((spamer.in_array(location.hash.substr(1, location.hash.length), arr)) ? "" : location.hash = "#about");
- } else {
- ((spamer.in_array(location.hash.substr(1, location.hash.length), arr)) ? "" : location.hash = "#about");
- }
- spamer.menuGet(location.hash.substr(1, location.hash.length), "");
- */
- if ($(w).width() < 1025) {
- $("#Content").css({
- "padding-left": "250px"
- });
- }
- spamer.settings();
- $("#stl_bg").html("<a href=\"https://metrika.yandex.ru/stat/?id=28400281&from=informer\" target=\"_blank\" rel=\"nofollow\"><img src=\"//bs.yandex.ru/informer/28400281/3_1_FFFFFFFF_EFEFEFFF_0_pageviews\" style=\"width:88px; height:31px; border:0;\" alt=\"Яндекс.Метрика\" title=\"Яндекс.Метрика: данные за сегодня (просмотры, визиты и уникальные посетители)\" onclick=\"try{Ya.Metrika.informer({i:this,id:28400281,lang:'ru'});return false}catch(e){}\"/></a><a style='display:none' href='//www.liveinternet.ru/click' target=_blank><img src='//counter.yadro.ru/hit?t26.6;r" + escape(document.referrer) + ((typeof(screen) == "undefined") ? "" : ";s" + screen.width + "*" + screen.height + "*" + (screen.colorDepth ? screen.colorDepth : screen.pixelDepth)) + ";u" + escape(document.URL) + ";" + Math.random() + "' border=0 width=88 height=15 alt='' title='LiveInternet: показано число посетителей за сегодня'><\/a>");
- });
- var checks = {
- newCheckbox: function(id, params, active) {
- var checkbox_new_id = 'checkbox_' + id;
- checkbox_template = '';
- for (i = 0; i < params.length; i++) {
- var checkbox_id = params[i][0];
- var checkbox_title = params[i][1];
- checkbox_template += '\
- <div id="checkbox_value_' + checkbox_id + '" class="checkbox checkbox_no_active">\
- <div class="checkbox_icon"><div class="checkbox_icon_img checkbox_icon_img_no_active"></div></div>\
- <div class="checkbox_text">' + checkbox_title + '</div>\
- </div>\
- ';
- }
- $('#' + id).html('<div id="' + checkbox_new_id + '">' + checkbox_template + '</div>');
- if (active) {
- var active_ids = active.split(',');
- for (i = 0; i < active_ids.length; i++) {
- checks.setActiveCheckbox(id, active_ids[i]);
- }
- }
- $('#' + checkbox_new_id).find('.checkbox').click(function() {
- if ($(this).find('.checkbox_icon_img').attr('class').indexOf('checkbox_icon_img_active') > -1) {
- $(this).find('.checkbox_icon_img').removeClass('checkbox_icon_img_active').addClass('checkbox_icon_img_no_active');
- $(this).removeClass('checkbox_active').addClass('checkbox_no_active');
- } else {
- $(this).find('.checkbox_icon_img').removeClass('checkbox_icon_img_no_active').addClass('checkbox_icon_img_active');
- $(this).removeClass('checkbox_no_active').addClass('checkbox_active');
- }
- });
- },
- setActiveCheckbox: function(id, val) {
- $('#checkbox_' + id).find('#checkbox_value_' + val).addClass('checkbox_active');
- $('#checkbox_' + id).find('#checkbox_value_' + val).find('.checkbox_icon_img').removeClass('checkbox_icon_img_no_active').addClass('checkbox_icon_img_active');
- },
- removeActiveCheckbox: function(id, val) {
- $('#checkbox_' + id).find('#checkbox_value_' + val).removeClass('checkbox_active');
- $('#checkbox_' + id).find('#checkbox_value_' + val).find('.checkbox_icon_img').removeClass('checkbox_icon_img_active').addClass('checkbox_icon_img_no_active');
- },
- newFunctionCheckbox: function(id, val, fn) {
- if (val) {
- $('#checkbox_' + id).find('#checkbox_value_' + val).click(function() {
- fn();
- });
- } else {
- $('#checkbox_' + id).find('.checkbox').click(function() {
- fn();
- });
- }
- },
- getValueCheckbox: function(id) {
- checkbox_ids = '';
- $('#checkbox_' + id).find('.checkbox_active').each(function() {
- checkbox_ids += $(this).attr('id').toString().substr(15) + ',';
- });
- return checkbox_ids.replace(/,$/, '');
- }
- }
- var select = {
- _new: function(id, obj, list) {
- var active_select = list[list.length - 1];
- template_list = '';
- if (active_select > -1) {
- var length_list = list.length - 1;
- var title_select = list[0][1];
- var value_select = active_select;
- } else {
- var length_list = list.length;
- var title_select = list[0][1];
- var value_select = 0;
- }
- var length_list_r = obj.del_end ? length_list - 1 : length_list;
- for (i = 0; i < length_list_r; i++) {
- var key = list[i][0];
- var value = list[i][1];
- var mousedown = list[i][2] ? list[i][2] : '';
- template_list += '\
- <a class="select_value_' + key + '" href="javascript://" onmousedown="' + mousedown + '"><div>' + value + '</div></a>\
- ';
- }
- template_select = '\
- <div id="select_' + id + '" class="select" style="width: ' + obj.width + 'px;">\
- <div class="title">\
- <div class="select_title_wrap"><div class="select_title">' + title_select + '</div></div>\
- <div class="upnarrow"><div class="upnarrow_wrap"><div class="upnarrow_img"></div></div></div>\
- </div>\
- <div style="width: ' + obj.width + 'px" class="list">\
- <div class="navigate">' + template_list + ' <span class="navigate_append"></span></div>\
- </div>\
- </div>\
- <input value="' + value_select + '" type="hidden" id="select_value_' + id + '">\
- <input type="hidden" id="select_value_h_' + id + '">\
- \
- ';
- $('#' + id).html(template_select);
- // присваиваем title
- var title_value_text = $('#select_' + id).find('.select_value_' + active_select).text();
- select._set_title({
- id: id,
- title: title_value_text ? title_value_text : title_select
- });
- $('#select_' + id).find('.title').click(function() {
- select._get(id, 'opened') ? select._closed(id) : select._show(id);
- value_id = select._get(id, 'value');
- if (value_id && $('#select_' + id).find('.select_value_' + value_id + ' div').text()) {
- $('#select_' + id).find('.select_value_' + value_id + ' div').addClass('active')
- } else {
- $('#select_' + id).find('.select_value_0 div').addClass('active')
- }
- });
- $('#select_' + id).find('.navigate a').click(function() {
- // получаем значение активированного пункта
- var value_select = $(this).attr('class').replace('select_value_', '');
- var value_select_result = value_select;
- // заносим значение в input
- $('#select_value_' + id).val(value_select_result);
- // присваиваем class активному пункту
- $('#select_' + id).find('.navigate a').find('div').removeClass('active');
- $(this).find('div').addClass('active');
- // назначаем title
- $('#select_' + id).find('.title .select_title').text($(this).text());
- // закрываем список
- select._closed(id);
- });
- // сбрасываем активность пунктов при наведении
- $('#select_' + id).find('.navigate a').hover(function() {
- $('#select_' + id).find('div').removeClass('active');
- });
- // проверка на использование
- $('#select_' + id).hover(function() {
- $('#select_value_h_' + id).val(1)
- }, function() {
- $('#select_value_h_' + id).val(0);
- });
- // закрываем, если не используется
- $('body').bind('click', function() {
- if ($('#select_value_h_' + id).val() == 0) {
- select._closed(id);
- }
- });
- // делаем активной правую часть со стрелкой
- $('#select_' + id).find('.title').hover(function() {
- var active_class = 'active';
- $(this).find('.upnarrow_wrap').addClass(active_class);
- }, function() {
- var active_class = 'active';
- $(this).find('.upnarrow_wrap').removeClass(active_class);
- });
- },
- _get: function(id, name) {
- switch (name) {
- case 'opened':
- return $('#select_' + id).attr('class').indexOf('show') > -1 ? 1 : 0;
- case 'value':
- return $('#select_value_' + id).val();
- }
- },
- _set_title: function(obj) {
- $('#select_value_' + obj.id).val(obj.value);
- $('#select_' + obj.id).find('.title .select_title').text(obj.title);
- },
- _show: function(id) {
- $('#select_' + id).addClass('show');
- },
- _closed: function(id) {
- $('#select_' + id).removeClass('show');
- }
- }
- var minSelect = {
- _new: function(id, width, title, text) {
- var template = '\
- <div class="minselect_wrap">\
- <a id="aminselect_' + id + '" href="javascript://">' + title + '</a>\
- <div style="width: ' + width + 'px" id="minselect_' + id + '" class="minselect">\
- <div class="minselect_title_wrap"><div class="minselect_title">' + title + '</div></div>\
- <div class="minselect_content">' + text + '</div>\
- </div>\
- </div>\
- ';
- $('#' + id).html(template);
- $('#aminselect_' + id + ', #minselect_' + id).click(function() {
- $('#minselect_' + id).toggle();
- });
- $('#minselect_' + id).hover(function() {}, function() {
- $('#minselect_' + id).fadeOut(200);
- });
- $('#minselect_' + id).find('.mnav').click(function() {
- setTimeout(function() {
- $('#minselect_' + id).hide();
- }, 10);
- });
- }
- }
- var radiobtn = {
- _new: function(id, obj) {
- var template = '\
- <div class="radiobtn_o">\
- <div class="radiobtn radiobtn_no"></div>\
- <div class="radiobtn_t">' + obj.title + '</div>\
- </div>\
- ';
- $('#' + id).html(template);
- $('.radiobtn_o').click(function() {
- $('.radiobtn_o').find('.radiobtn').removeClass('radiobtn_active').addClass('radiobtn_no');
- $(this).find('.radiobtn').removeClass('radiobtn_no').addClass('radiobtn_active');
- });
- },
- _check: function() {
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement