@ -4,24 +4,23 @@ $(async function () {
async function CheckCurrentUser ( ) {
if ( ! check_cookie_name ( "steam64" ) ) { return ; }
$ ( "#Header_CurrentUser" ) . html ( ` Получение данных профиля с сервера... ПОДОЖДИ ` ) ;
await fetch ( "https://tf2.pblr-nyk.pro/player_api/v1/current_user" , { credentials : "same-origin" , headers : { 'Cache-Control' : 'no-cache' } } )
. then ( response => response . json ( ) )
. then ( response => {
if ( "error" in response ) {
console . log ( response . error ) ;
} else {
var current_user = document . getElementById ( "Header_CurrentUser" ) ;
var current_ban = document . getElementById ( "Header_CurrentBan" ) ;
var logout = document . getElementById ( "Header_Logout" ) ;
current_user . href = "#" ;
$ ( "#Header_CurrentUser" ) . attr ( "href" , "#" ) ;
if ( response . ban ) {
current_user . innerHTML = ` Привет ${ response . steam_data . nickname } ! У меня хорошие новости! ` ;
current_ban . innerHTML = "У тебя БАН! (нажми чтоб посмотреть его)" ;
$ ( "#Header_CurrentUser" ) . html ( ` Привет ${ response . steam_data . nickname } ! У меня хорошие новости! ` ) ;
$ ( "#Header_CurrentBan" ) . html ( "У тебя БАН! (нажми чтоб посмотреть его)" ) ;
} else {
current_user . innerHTML = ` Привет ${ response . steam_data . nickname } ! ` ;
$ ( "#Header_CurrentUser" ) . html ( ` Привет ${ response . steam_data . nickname } ! ` ) ;
}
logout . innerHTML = ` (нажми чтоб выйти) ` ;
document . getElementById ( "profile_stats" ) . insertAdjacentHTML ( "beforeend" , FillPlayerInfo ( response ) ) ;
$ ( "#Header_Logout" ) . html ( ` (нажми чтоб выйти) ` ) ;
$ ( "#profile_list" ) . remove ( ) ;
$ ( FillPlayerInfo ( response ) ) . appendTo ( "#profile_stats" ) ;
ReconstructVipSection ( response ) ;
}
} )
@ -33,114 +32,8 @@ function check_cookie_name(name) {
else { return false ; }
}
let captcha_error_div = ` <div class="col" id="ModalCaptchaErrorText"><h6 style="color: red;" id="captcha_error">пук</h6></div> `
let ProfileLinkError_div = ` <div class="col" id="ProfileLinkIsNotFull"><h6 style="color: red;" id="profile_error">Долбаеб введи ссылку на профиль!</h6></div> `
console . log ( "puk" ) ;
//buttonCheckProfile
$ ( '#check_captcha_close_button' ) . click ( async function ( ev ) {
ev . preventDefault ( ) ;
$ ( '#CaptchaModalHandler' ) . modal ( 'hide' ) ;
} ) ;
document . getElementById ( "check_profile_submit_button" ) . addEventListener ( "keypress" , async function ( ev ) {
ev . preventDefault ( ) ;
console . log ( ev . key ) ;
return false ;
} ) ;
$ ( '#check_profile_submit_button' ) . click ( async function ( ev ) {
//ev.preventDefault();
console . log ( "check profile button presed" ) ;
if ( document . getElementById ( "ProfileLinkIsNotFull" ) ) {
document . getElementById ( "ProfileLinkIsNotFull" ) . remove ( ) ;
}
if ( ! document . forms [ "formProfileSectionInput" ] . steamurl . value . startsWith ( "https://" ) ) {
document . getElementById ( "formProfileSectionInputHelpText" ) . insertAdjacentHTML ( "beforeend" , ProfileLinkError_div ) ;
//document.getElementById("profile").innerHTML = "Долбаеб введи ссылку на профиль!";
} else {
$ ( '#CaptchaModalHandler' ) . modal ( 'show' ) ;
}
return false ;
} ) ;
async function RefreshCaptcha ( ) {
await fetch ( "https://tf2.pblr-nyk.pro/player_api/v1/captcha" , { method : 'POST' } )
. then ( response => response . json ( ) )
. then ( response => {
console . log ( "captcha id: " + response . id ) ;
// captcha_id = response.id;
// form_captcha.captcha_img.src = "https://tf2.pblr-nyk.pro/player_api/v1/captcha?id=" + response.id;
return response . id ;
} ) ;
}
$ ( document ) . on ( "show.bs.modal" , "#CaptchaModalHandler" , async function ( ) {
console . log ( "setup captcha modal" ) ;
let form_url = document . forms [ "formProfileSectionInput" ] ;
let form_captcha = document . forms [ "formCaptchaHandler" ] ;
let captcha_id ;
const captchaId = await RefreshCaptcha ( ) ;
captcha_id = captchaId ;
form_captcha . captcha_img . src = "https://tf2.pblr-nyk.pro/player_api/v1/captcha?id=" + captchaId ;
$ ( '#check_captcha_submit_button' ) . click ( async function ( ev ) {
//ev.preventDefault();
if ( $ ( '#ModalCaptchaErrorText' ) ) { $ ( '#ModalCaptchaErrorText' ) . remove ( ) ; }
await CheckAndFill ( ev ) ;
return false ;
} ) ;
async function CheckAndFill ( event ) {
if ( form_captcha . captcha . value . length == 0 ) {
if ( ! document . getElementById ( "captcha_error" ) ) {
document . getElementById ( "InvalidCaptchaTextArea" ) . insertAdjacentHTML ( "beforeend" , captcha_error_div ) ;
}
document . getElementById ( "captcha_error" ) . innerHTML = "Капчу введи!" ;
return ;
}
$ ( "#check_captcha_close_button" ) . prop ( "disabled" , true ) ;
$ ( "#check_captcha_submit_button" ) . prop ( "disabled" , true ) ;
if ( document . getElementById ( "current_profile" ) ) {
document . getElementById ( "current_profile" ) . remove ( ) ;
}
console . log ( new Date ( ) ) ;
await fetch ( "https://tf2.pblr-nyk.pro/player_api/v1/player?steam_url=" + form_url . steamurl . value + "&captcha_id=" + captcha_id + "&captcha_code=" + form_captcha . captcha . value )
. then ( response => response . json ( ) )
. then ( response => {
$ ( "#check_captcha_close_button" ) . removeAttr ( "disabled" ) ;
$ ( "#check_captcha_submit_button" ) . removeAttr ( "disabled" ) ;
/////////////////////////////////////////////////////////
if ( "error" in response ) {
console . log ( ` id: ${ captcha_id } error: ${ response } ` ) ;
if ( ! document . getElementById ( "captcha_error" ) ) {
document . getElementById ( "InvalidCaptchaTextArea" ) . insertAdjacentHTML ( "beforeend" , captcha_error_div ) ;
}
if ( response . error == "incorrect captcha" ) {
document . getElementById ( "captcha_error" ) . innerHTML = "Капча невалидна, попробуй снова!" ;
} else {
document . getElementById ( "captcha_error" ) . innerHTML = "Ошибка: " + response . error ;
}
RefreshCaptcha ( ) ;
} else if ( "detail" in response ) {
if ( ! document . getElementById ( "captcha_error" ) ) {
document . getElementById ( "InvalidCaptchaTextArea" ) . insertAdjacentHTML ( "beforeend" , captcha_error_div ) ;
}
document . getElementById ( "captcha_error" ) . innerHTML = "Ошибка: " + response . detail [ 0 ] . msg ;
RefreshCaptcha ( ) ;
} else {
console . log ( response ) ;
document . getElementById ( "profile_stats" ) . insertAdjacentHTML ( "beforeend" , FillPlayerInfo ( response ) ) ;
//ReconstructVipSection(response);
$ ( '#check_captcha_close_button' ) . click ( ) ;
}
form_captcha . captcha . value = '' ;
} ) ;
}
} ) ;
let captcha_error_div = ` <div class="col" id="ModalCaptchaErrorText"><h6 style="color: red;" id="captcha_error">пук</h6></div> ` ;
let ProfileLinkError_div = ` <div class="col" id="ProfileLinkIsNotFull"><h6 style="color: red;" id="profile_error">Долбаеб введи ссылку на профиль!</h6></div> ` ;
function CalculateVipEndDate ( permition ) {
return new Date ( ( permition [ "UNIX_TIMESTAMP(`reg_date`)" ] + permition . amount ) * 1000 ) ;
@ -199,7 +92,7 @@ function FillPlayerInfo(data) {
player_permition_continue = ` (продлить) ` ;
let date = CalculateVipEndDate ( data . permition ) ; // new Date((data.permition["UNIX_TIMESTAMP(`reg_date`)"] + data.permition.amount) * 1000);
player_permition_end_date = date . toLocaleString ( ) ;
document . getElementById ( "Modal_SelectPayMethod_CheckVIP_EndDate" ) . innerHTML = ` До: ${ player_permition_end_date } ` ;
$ ( "# Modal_SelectPayMethod_CheckVIP_EndDate" ) . html ( ` До: ${ player_permition_end_date } ` ) ;
if ( date . getTime ( ) - new Date ( ) . getTime ( ) > 604800000 ) {
player_permition_end_date_color_status = ` current-profile-text-color-normal ` ;
} else if ( date . getTime ( ) - new Date ( ) . getTime ( ) > 259200000 ) {
@ -227,8 +120,8 @@ function FillPlayerInfo(data) {
`
}
document . getElementById ( "Modal_SelectPayMethod_CheckVIP_Status" ) . innerHTML = "(имеется)" ;
document . getElementById ( "Modal_SelectPayMethod_CheckVIP_Status" ) . style += "color: green;" ;
$ ( "# Modal_SelectPayMethod_CheckVIP_Status" ) . html ( "(имеется)" ) ;
$ ( "# Modal_SelectPayMethod_CheckVIP_Status" ) . css ( "color" , "green" ) ;
player_permition_div = `
< div id = "vip_section" >
@ -307,7 +200,7 @@ function FillPlayerInfo(data) {
< p > Наиграно : $ { UNIX2FACTI_TIME ( total_gametime ) } < / p >
< div class = "row" >
< div class = "col justify-content-end" >
< a href = "${data.steamids.community_url}" target = "_blank" > < img class = "img-fluid w-25" src = "site_content/images/logo/steam.png" > < / a >
< a href = "${data.steamids.community_url}" target = "_blank" > < img class = "img-fluid w-25" src = "site_content/images/logo/steam.png" id = "CurrentPlayerURL" > < / a >
< / d i v >
< / d i v >
< / d i v >
@ -351,37 +244,32 @@ function ReconstructVipSection(data) {
$ ( '#Modal_SelectPayMethod_CheckVIP' ) . click ( async function ( ev ) {
ev . preventDefault ( ) ;
await fetch ( "https://tf2.pblr-nyk.pro/player_api/v1/player/permitions?steam_url= " + document . forms [ "formProfileSectionInput" ] . steamurl . value , { credentials : "same-origin" , headers : { 'Cache-Control' : 'no-cache' } } )
await fetch ( "https://tf2.pblr-nyk.pro/player_api/v1/player/permitions" , { credentials : "same-origin" , headers : { 'Cache-Control' : 'no-cache' } } )
. then ( response => response . json ( ) )
. then ( response => {
if ( response . permition ) {
document . getElementById ( "Modal_SelectPayMethod_CheckVIP_Status" ) . innerHTML = "(имеется)" ;
document . getElementById ( "Modal_SelectPayMethod_CheckVIP_Status" ) . style += "color: green;" ;
$ ( "# Modal_SelectPayMethod_CheckVIP_Status" ) . html ( "(имеется)" ) ;
$ ( "# Modal_SelectPayMethod_CheckVIP_Status" ) . css ( "color" , "green" ) ;
if ( response . permition . amount ) {
document . getElementById ( "Modal_SelectPayMethod_CheckVIP_EndDate" ) . innerHTML = ` До: ${ CalculateVipEndDate ( response . permition ) . toLocaleString ( ) } ` ;
$ ( "# Modal_SelectPayMethod_CheckVIP_EndDate" ) . html ( ` До: ${ CalculateVipEndDate ( response . permition ) . toLocaleString ( ) } ` ) ;
} else {
document . getElementById ( "Modal_SelectPayMethod_CheckVIP_EndDate" ) . innerHTML = ` бесконечность не предел ` ;
$ ( "# Modal_SelectPayMethod_CheckVIP_EndDate" ) . html ( ` бесконечность не предел ` ) ;
}
} else {
document . getElementById ( "Modal_SelectPayMethod_CheckVIP_Status" ) . innerHTML = "(отсутствует)" ;
document . getElementById ( "Modal_SelectPayMethod_CheckVIP_Status" ) . style += "color: red;" ;
document . getElementById ( "Modal_SelectPayMethod_CheckVIP_EndDate" ) . innerHTML = ` Время проверки: ${ new Date ( ) . toLocaleString ( ) } ` ;
$ ( "# Modal_SelectPayMethod_CheckVIP_Status" ) . html ( "(отсутствует)" ) ;
$ ( "# Modal_SelectPayMethod_CheckVIP_Status" ) . css ( "color" , "red" ) ;
$ ( "# Modal_SelectPayMethod_CheckVIP_EndDate" ) . html ( ` Время проверки: ${ new Date ( ) . toLocaleString ( ) } ` ) ;
}
} ) ;
} ) ;
//document.getElementById("Section_VIP_check_profile")?document.getElementById("Section_VIP_check_profile").remove():null;
while ( document . getElementById ( "Section_VIP_buttons" ) . firstChild ) {
document . getElementById ( "Section_VIP_buttons" ) . lastChild . remove ( ) ;
}
$ ( "#Section_VIP_buttons" ) . empty ( ) ;
const STEAM_TRADE = "https://steamcommunity.com/tradeoffer/new/?partner=47239992&token=8gNFVl7h" ;
const QIWI_TRADE = "https://qiwi.com/payment/form/99?currency=643&amount=(AMOUNT)&extra%5B%27comment%27%5D=(COMMENT)&extra%5B%27account%27%5D=79207516287&blocked%5B0%5D=sum&blocked%5B1%5D=account&blocked%5B2%5D=comment" ;
//STEAM_0%3A0%3A54354355
//"https://qiwi.com/payment/form/99?currency=643&amount=(AMOUNT)&extra%%5B%%27comment%%27%%5D=(COMMENT)&extra%%5B%%27account%%27%%5D=%%2B79207516287&blocked%%5B0%%5D=account";
document . getElementById ( "Modal_SelectPayMethod_ProfileLink" ) . href = data . steamids . community_url ;
document . getElementById ( "Modal_SelectPayMethod_ProfileName" ) . innerHTML = "Вип будет выдан: " + data . steam_data . nickname ;
$ ( "#Modal_SelectPayMethod_ProfileLink" ) . attr ( "href" , data . steamids . community_url ) ;
$ ( "# Modal_SelectPayMethod_ProfileName" ) . html ( ` Вип будет выдан: ${ data . steam_data . nickname } ` ) ;
let price_array = new Array (
[ "VIP (1 месяц)" , 150 , "1 ключ" , "site_content/images/vip/VIP_1_MOUNTH.jpg" , "month" ] ,
@ -407,65 +295,36 @@ function ReconstructVipSection(data) {
< / d i v >
< / d i v >
`
document . getElementById ( "Section_VIP_buttons" ) . insertAdjacentHTML ( "beforeend" , vip_select ) ;
$ ( vip_select ) . appendTo ( "#Section_VIP_buttons" ) ;
$ ( ` #Section_VIP_buttons_ ${ price_array [ select ] [ 4 ] } ` ) . click ( async function ( ev ) {
ev . preventDefault ( ) ;
document . getElementById ( 'Modal_SelectPayMethod_QIWI_Button' ) . href = QIWI_TRADE . replace ( "(AMOUNT)" , price_array [ select ] [ 1 ] ) . replace ( "(COMMENT)" , data . steamids . steam2 . replace ( ":" , "%3A" ) ) ;
document . getElementById ( 'Modal_SelectPayMethod_QIWI_Value' ) . innerHTML = ` ${ price_array [ select ] [ 1 ] } Рублей ` ;
document . getElementById ( 'Modal_SelectPayMethod_STEAM_Button' ) . href = STEAM_TRADE ;
document . getElementById ( 'Modal_SelectPayMethod_STEAM_Value' ) . innerHTML = price_array [ select ] [ 2 ] ;
$ ( "#Modal_SelectPayMethod_QIWI_Button" ) . attr ( "href" , QIWI_TRADE . replace ( "(AMOUNT)" , price_array [ select ] [ 1 ] ) . replace ( "(COMMENT)" , data . steamids . steam2 . replace ( ":" , "%3A" ) ) ) ;
$ ( "#Modal_SelectPayMethod_QIWI_Value" ) . html ( ` ${ price_array [ select ] [ 1 ] } Рублей ` ) ;
$ ( "#Modal_SelectPayMethod_STEAM_Button" ) . attr ( "href" , STEAM_TRADE ) ;
$ ( "#Modal_SelectPayMethod_STEAM_Value" ) . html ( price_array [ select ] [ 2 ] ) ;
$ ( '#Modal_SelectPayMethod' ) . modal ( 'show' ) ;
return false ;
} ) ;
}
}
/ *
//Section_VIP_buttons
let vip_select_sample = `
< div class = "col" >
< div class = "card" >
< img class = "card-img" src = "site_content/images/vip/VIP_1_MOUNTH.jpg" alt = "Вип на месяц" >
< div class = "card-img-overlay d-flex flex-column" style = "background-image: linear-gradient(to bottom, rgba(0, 0, 0, 0.02), rgba(0, 0, 0, 0.7))" >
< a href = "#" class = "stretched-link" id = "Section_VIP_buttons_month" > < / a >
< div class = "mt-auto" >
< h5 class = "vip-card-text" > VIP ( 1 месяц ) < / h 5 >
< hr class = "vip-card-text" >
< h6 class = "vip-card-text" > 150 Рублей < / h 6 >
< h6 class = "vip-card-text" > 1 Ключ < / h 6 >
< / d i v >
< / d i v >
< / d i v >
< / d i v >
` ;
$ ( '#Section_VIP_buttons_month' ) . click ( async function ( ev ) {
ev . preventDefault ( ) ;
console . log ( "vip button presed" ) ;
document . getElementById ( 'Modal_SelectPayMethod_QIWI_Button' ) . href = QIWI_TRADE ;
document . getElementById ( 'Modal_SelectPayMethod_QIWI_Value' ) . innerHTML = "150 Рублей" ;
document . getElementById ( 'Modal_SelectPayMethod_STEAM_Button' ) . href = STEAM_TRADE ;
document . getElementById ( 'Modal_SelectPayMethod_STEAM_Value' ) . innerHTML = "1 Ключ" ;
$ ( '#Modal_SelectPayMethod' ) . modal ( 'show' ) ;
return false ;
} ) ;
* /
//secret egg
let konami_code = "" ;
let activated = false ;
document . addEventListener ( 'keypress' , ( event ) => {
//$().keypress(function (event) {
//document.addEventListener('keypress', (event) => {
$ ( ":root" ) . keypress ( function ( event ) {
if ( activated ) { return ; }
konami_code += event . key ;
if ( konami_code . length == 6 || event . key == "-" ) {
if ( konami_code == "nigger" ) {
activated = true ;
document . getElementById ( "Tab_About" ) . href = "#SecretEgg" ;
$ ( "#Tab_About" ) . attr ( "href" , "#SecretEgg" ) ;
$ ( '.nav-pills a[href="#SecretEgg"]' ) . tab ( 'show' ) ;
( new Audio ( "site_content/sounds/sunboy-ledi-night-16.mp3" ) ) . play ( ) ;
document . getElementById ( "Nav_MenuButtons" ) . remove ( )
$ ( "#Nav_MenuButtons" ) . remove ( ) ;
ChangeBackgoundImage ( "site_content/images/background/hasbik_dance.jpg" ) ;
//$('Tab_Secret_Egg').click();
}