// ==UserScript==
// @name HDrezka Improvement
// @name:en HDrezka Improvement
// @name:uk HDrezka Improvement
// @name:ru HDrezka Improvement
// @namespace http://tampermonkey.net/
// @version 1.17
// @description HDrezka Improvement: cleanup, change content width, change player size, remove ads, remove blocks, restyle, subtitles (opensubtitles.com)
// @description:en HDrezka Improvement: cleanup, change content width, change player size, remove ads, remove blocks, restyle, subtitles (opensubtitles.com)
// @description:uk HDrezka Improvement: cleanup, change content width, change player size, remove ads, remove blocks, restyle, subtitles (opensubtitles.com)
// @description:ru HDrezka Improvement: cleanup, change content width, change player size, remove ads, remove blocks, restyle, subtitles (opensubtitles.com)
// @author rub4ek
// @match https://hdrezka.me/*
// @match https://hdrezka.ag/*
// @match https://hdrezka.club/*
// @match https://rezka.ag/*
// @match https://rezkify.com/*
// @match https://kinopub.me/*
// @match http://hdrezka.tv/*
// @match http://hdrezka.co/*
// @match http://hdrezka.ink/*
// @match http://hdrezka.buzz/*
// @match http://hdrezka.loan/*
// @match http://hdrezka.center/*
// @match http://hdrezka.city/*
// @match http://hdrezka.fyi/*
// @match http://hdrezka.run/*
// @match http://hdrezka.today/*
// @match http://hdrezka.win/*
// @match http://hdrezka.tips/*
// @match http://hdrezka.vip/*
// @match http://hdrezka.solutions/*
// @icon https://www.google.com/s2/favicons?domain=rezka.ag
// @grant GM_info
// @grant GM_addStyle
// @grant GM_xmlhttpRequest
// @run-at document-body
// @license MIT
// ==/UserScript==
(function () {
"use strict";
/* ------------------------------------------------- */
/* --------------GLOBAL----------------------------- */
/* ------------------------------------------------- */
let hc = {};
/* ------------------------------------------------- */
/* --------------DEBUG------------------------------ */
/* ------------------------------------------------- */
// unsafeWindow.hc = hc;
/* ------------------------------------------------- */
/* --------------IMAGES----------------------------- */
/* ------------------------------------------------- */
const images = {
arrow: "data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAFoAAABaCAYAAAA4qEECAAAABmJLR0QA/wD/AP+gvaeTAAABa0lEQVR4nO3awUrDQBSF4dMuGhc+uF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LR7iDZZx7O6mlFClRtBgD/Yil8cuU6cuF0dagUuorVMzwADZ3DxzJCM2rBng/09+wGdAdXhH/IyeTj3qKmZrBDTnM6A6mGyerzeMN9WvcxB4mVprHXE3n28DDqOaho3AetRd5w/AA2AIeGNo08WajNd1nVql46KlrW7U+rZOdg1j1ky4KB1eN9W3osSeId7FsA/4idmJ/wAOaNofNLRda1y2OK9M0QcsY3fyy8B+DR+7Le1Xj51xT9Qn3Zhncq3M7tTw9SiGj/G4J+qbIvEzrQTc0fDVDsxb2A6+Bd+OG5FLqJlOj4bPXpRwJiIHv6h0AXdCl4Dzmn67gIca9sYJPJPLmPzUWWeY/hx6F2omMUXlNzhT0XNBX/hW8xG3Qmduc3hWtggs4nYBaomM/S+7rGxMtN0EXo95x/ZikxWhP2TcXmyyIvR9x/buObaXG7bhdh69Nd3ww2IYN0LfSjvw0OhCrVXEEfk7nn4MHxoHiLd6ty/9kMNlLyozTUT+RWV3q2BAJ2oVboXmF74hAigXWekM69EDHEIt1m+ics/wPeqe4W3grbfoBEEQBEEQBEEQ8sBfyQHftJOPyYMAAAAASUVORK5CYII=",
};
/* ------------------------------------------------- */
/* --------------DOCUMENT--------------------------- */
/* ------------------------------------------------- */
function onDocumentStart() {
initSettings();
initPlayer();
initContentSizeTumbler();
initNavbarLinks();
initAutoPlayNext();
initHideAds();
initHidePlayerAds();
initStyleImprovements();
initPlayerCover();
initPlayerExtraControls();
initHideInfo();
initHideComments();
initHideTranslators();
initIMDbRating();
initHotkeys();
initHideRussian();
initPlayerSubtitles();
}
function onDocumentEnd() {}
document.addEventListener("DOMContentLoaded", onDocumentEnd);
onDocumentStart();
/* ------------------------------------------------- */
/* --------------GLOBAL-STYLES---------------------- */
/* ------------------------------------------------- */
GM_addStyle(`
/* css */
/* Hide last episode info */
.b-post__lastepisodeout {
display: none !important;
}
/* Hide support block */
.b-post__support_holder {
display: none !important;
}
.b-post__support_holder_report .append {
display: none !important;
}
/* Hide share label */
.b-post__social_holder_wrapper .share-label {
display: none !important;
}
/* Hide mixedtext */
.b-post__mixedtext {
text-indent: -9999px !important;
padding: 0 !important;
}
/* !css */
`);
/* ------------------------------------------------- */
/* --------------PLAYER----------------------------- */
/* ------------------------------------------------- */
function initPlayer() {
GM_addStyle(`
/* css */
/* Style player */
.b-player {
padding-top: 0;
}
.b-player #cdnplayer-preloader {
height: 100%;
width: 100%;
}
.b-player .b-simple_seasons__list {
padding: 10px;
}
.b-player .b-player__holder_cdn {
height: auto !important;
}
.b-player .b-player__container_cdn {
resize: vertical;
overflow: auto;
width: auto !important;
min-height: 300px !important;
}
/* !css */
`);
hc.player = {};
hc.player.start = start;
hc.player.play = play;
hc.player.pause = pause;
hc.player.stop = stop;
hc.player.next = next;
hc.player.prev = prev;
hc.player.toggle = toggle;
hc.player.enterfullscreen = enterfullscreen;
hc.player.exitfullscreen = exitfullscreen;
hc.player.togglefullscreen = togglefullscreen;
hc.player.poster = poster;
hc.player.resize = resize;
hc.player.mute = mute;
hc.player.vast = vast;
hc.player.seek = seek;
hc.player.adjust = adjust;
hc.player.subtitle = subtitle;
hc.player.season = season;
hc.player.episode = episode;
hc.player.shoudvast = 0;
hc.player.expanded = 0;
hc.player.fullscreen = 0;
setup();
function setup() {
window.addEventListener("message", function (event) {
if (event.data) {
if (event.data.event == "init") {
document.querySelector("#cdnplayer").oncontextmenu = undefined;
}
if (event.data.event == "inited") {
poster("hc-poster");
}
if (
["init", "inited", "new", "start", "started", "ended", "vast_time"].includes(event.data.event)
) {
vast(hc.player.shoudvast);
}
}
});
}
function season() {
const seasonItem = document.querySelector(".b-simple_season__item.active");
if (seasonItem) {
return seasonItem.innerText.split(" ")[1];
}
}
function episode() {
const seasonItem = document.querySelector(".b-simple_episode__item.active");
if (seasonItem) {
return seasonItem.innerText.split(" ")[1];
}
}
function defined() {
return typeof CDNPlayer != "undefined";
}
function start() {
sof.tv.buildCDNPlayer();
vast(hc.player.shoudvast);
play();
}
function vast(value) {
hc.player.shoudvast = value;
if (defined()) {
CDNPlayer.api("update:vast", value);
}
}
function play() {
vast(hc.player.shoudvast);
if (defined()) {
CDNPlayer.api("play");
}
}
function pause() {
if (defined()) {
CDNPlayer.api("pause");
}
}
function stop() {
if (defined()) {
CDNPlayer.api("stop");
}
}
function toggle() {
if (defined()) {
if (!CDNPlayer.api("started")) {
play();
} else {
vast(hc.player.shoudvast);
CDNPlayer.api("toggle");
}
}
}
function enterfullscreen() {
if (defined()) {
CDNPlayer.api("fullscreen");
}
}
function exitfullscreen() {
if (defined()) {
CDNPlayer.api("exitfullscreen");
}
}
function togglefullscreen() {
if (hc.player.fullscreen) {
exitfullscreen() ;
} else {
enterfullscreen();
}
}
function poster(poster) {
if (defined()) {
CDNPlayer.api("poster", poster);
}
}
function mute() {
if (defined()) {
if (!CDNPlayer.api("muted")) {
CDNPlayer.api("mute");
} else {
CDNPlayer.api("unmute");
}
}
}
function sibling(direction) {
const activeEpisode = document.querySelector(".b-simple_episode__item.active");
if (activeEpisode && activeEpisode[direction]) {
activeEpisode[direction].click();
setTimeout(start, 1000);
} else {
const activeSeason = document.querySelector(".b-simple_season__item.active");
if (activeSeason && activeSeason[direction]) {
activeSeason[direction].click();
setTimeout(start, 1000);
}
}
}
function next() {
sibling("nextElementSibling");
}
function prev() {
sibling("previousElementSibling");
}
function seek(seconds) {
if (defined()) {
CDNPlayer.api("seek", seconds);
}
}
function adjust(seconds) {
if (defined()) {
const time = seconds + CDNPlayer.api("time");
const duration = CDNPlayer.api("duration");
if (time < duration) {
seek(time);
} else {
seek(duration - 0.5);
}
}
}
function subtitle(url) {
if (defined()) {
CDNPlayer.api("subtitle", url);
}
}
function calc(initialSize, newWidth, maxHeight) {
let initialWidth = initialSize.width;
let initialHeight = initialSize.height;
let resizedWidth = initialSize.width;
let resizedHeight = initialSize.height;
if (initialHeight > 0 && initialWidth !== newWidth) {
let ratio = initialWidth / initialHeight;
resizedWidth = newWidth;
resizedHeight = newWidth / ratio;
if (resizedHeight > maxHeight) {
resizedHeight = maxHeight;
resizedWidth = maxHeight * ratio;
}
}
return {
width: resizedWidth,
height: resizedHeight,
};
}
function resize() {
const contentMain = document.querySelector(".b-content__main");
if (contentMain && !hc.player.fullscreen && !hc.player.expanded) {
const playerHolder = document.querySelector(".b-player__holder_cdn");
const playerContainer = document.querySelector(".b-player__container_cdn");
if (playerHolder && playerContainer) {
const initial = {
width: playerHolder.offsetWidth,
height: playerHolder.offsetHeight,
};
const resized = calc(initial, contentMain.offsetWidth, window.innerHeight);
if (initial.width !== resized.width) {
playerHolder.style.width = resized.width + "px";
playerContainer.style.height = resized.height + "px";
console.log(
`HDrezka Improvement: cdn player resized ` +
`from ${initial.width}x${initial.height} ` +
`to ${resized.width}x${resized.height}.`
);
}
if (defined()) {
CDNPlayer.api("resize");
}
}
}
}
}
/* ------------------------------------------------- */
/* --------------CONTENT-SIZE----------------------- */
/* ------------------------------------------------- */
function initContentSizeTumbler() {
GM_addStyle(`
/* css */
/* Padding for content */
.glory,
.b-wrapper {
padding-left: 30px !important;
padding-right: 30px !important;
}
.b-footer {
width: auto !important;
}
.b-search__form.focused,
.search-results {
width: calc(100% - 60px);
left: 30px;
}
.b-content__inline_items {
padding-right: 16px;
width: auto;
}
/* Remove extra right padding for content page */
.b-content__columns {
padding-right: 0 !important;
}
/* Remove extra right padding on main content listing */
.b-content__inline_inner_mainprobar {
padding-right: 0 !important;
}
.b-content__inline_inner_mainprobar .b-content__inline_item {
margin-left: 16px !important;
}
/* Active brand fixes */
body.active-brand,
body.active-brand.pp {
padding-top: 0 !important;
}
.active-brand #wrapper {
width: auto !important;
}
/* Style status (HDrezka tracker block) */
.b-post__status_wrapper {
width: auto !important;
margin: 0px 10px 0px 13px !important;
}
/* Style and resize rating block */
.b-post__rating_table {
width: 100% !important;
}
.b-post__rating_table td > * {
float: right !important;
}
.b-post__rating_table .label {
display: none !important;
}
/* Content Size Tumbler */
.hc-tumbler-content-size .hc-tumbler-point:nth-child(1) {
border-width: 8px;
}
.hc-tumbler-content-size .hc-tumbler-point:nth-child(2) {
border-width: 7px;
}
.hc-tumbler-content-size .hc-tumbler-point:nth-child(3) {
border-width: 6px;
}
.hc-tumbler-content-size .hc-tumbler-point:nth-child(4) {
border-width: 5px;
}
/* Content Sizes */
body {
min-width: 960px;
}
body.hc-content-size-wide .glory,
body.hc-content-size-wide .b-newest_slider_wrapper,
body.hc-content-size-wide .b-wrapper {
width: auto !important;
min-width: 960px;
max-width: 1150px;
}
body.hc-content-size-ultrawide .glory,
body.hc-content-size-ultrawide .b-newest_slider_wrapper,
body.hc-content-size-ultrawide .b-wrapper {
width: auto !important;
min-width: 960px;
max-width: 1340px;
}
body.hc-content-size-full .glory,
body.hc-content-size-full .b-newest_slider_wrapper,
body.hc-content-size-full .b-wrapper {
min-width: 960px;
width: auto !important;
}
/* Newest Slider */
body.hc-content-size-wide .b-newest_slider_wrapper,
body.hc-content-size-ultrawide .b-newest_slider_wrapper,
body.hc-content-size-full .b-newest_slider_wrapper {
margin: 0 auto;
padding-left: 30px !important;
padding-right: 30px !important;
margin-bottom: 20px;
}
body.hc-content-size-wide .b-newest_slider_wrapper .cntrl,
body.hc-content-size-ultrawide .b-newest_slider_wrapper .cntrl,
body.hc-content-size-full .b-newest_slider_wrapper .cntrl {
display: none;
}
body.hc-content-size-wide .b-newest_slider_wrapper .b-newest_slider,
body.hc-content-size-ultrawide .b-newest_slider_wrapper .b-newest_slider,
body.hc-content-size-full .b-newest_slider_wrapper .b-newest_slider {
width: 100%;
padding-left: 0;
padding-right: 0;
box-sizing: border-box;
}
body.hc-content-size-wide .b-newest_slider_wrapper .b-newest_slider .b-newest_slider__list,
body.hc-content-size-ultrawide .b-newest_slider_wrapper .b-newest_slider .b-newest_slider__list,
body.hc-content-size-full .b-newest_slider_wrapper .b-newest_slider .b-newest_slider__list {
margin-left: -990px !important;
}
/* !css */
`);
settings();
function settings() {
if (hc.settings) {
hc.settings.createTumblerSetting({
name: "content-size",
label: "Максимальная ширина контента",
classes: [],
options: [
{
class: null,
text: "960 px",
end: function () {
window.removeEventListener("resize", hc.player.resize);
hc.player.resize();
},
},
{
class: "hc-content-size-wide",
text: "1150 px",
end: function () {
window.removeEventListener("resize", hc.player.resize);
window.addEventListener("resize", hc.player.resize);
hc.player.resize();
},
},
{
class: "hc-content-size-ultrawide",
text: "1340 px",
end: function () {
window.removeEventListener("resize", hc.player.resize);
window.addEventListener("resize", hc.player.resize);
hc.player.resize();
},
},
{
class: "hc-content-size-full",
text: "100%",
end: function () {
window.removeEventListener("resize", hc.player.resize);
window.addEventListener("resize", hc.player.resize);
hc.player.resize();
},
},
],
});
}
}
}
/* ------------------------------------------------- */
/* --------------NAVBAR-LINKS----------------------- */
/* ------------------------------------------------- */
function initNavbarLinks() {
GM_addStyle(`
/* css */
/* !css */
`);
settings();
function set(filter) {
function replace(elem) {
let url = new URL(elem.href);
if (filter) {
url.search = new URLSearchParams({ filter: filter }).toString();
} else {
url.search = "";
}
elem.href = url;
}
const navbar = document.querySelector(".b-topnav");
if (navbar) {
navbar.querySelectorAll(".b-topnav__item-link").forEach(replace);
navbar.querySelectorAll(".b-topnav__sub_inner .left a").forEach(replace);
}
}
function settings() {
if (hc.settings) {
hc.settings.createTumblerSetting({
name: "navbar-links",
label: "Ссылки в панели навигации",
classes: [],
options: [
{
class: null,
text: "Выкл",
end: function () {
set(null);
},
},
{
class: "hc-navbar-links-last",
text: "Последние поступления",
end: function () {
set("last");
},
},
{
class: "hc-navbar-links-popular",
text: "Популярные",
end: function () {
set("popular");
},
},
{
class: "hc-navbar-links-soon",
text: "В ожидании",
end: function () {
set("soon");
},
},
{
class: "hc-navbar-links-watching",
text: "Сейчас смотрят",
end: function () {
set("watching");
},
},
],
});
}
}
}
/* ------------------------------------------------- */
/* --------------PLAYER-SUBTITLES------------------- */
/* ------------------------------------------------- */
function initPlayerSubtitles() {
GM_addStyle(`
/* css */
/* Subtitles */
.hc-subtitles-list-wrapper {
position: absolute;
left: 0;
right: 0;
bottom: 100px;
max-height: calc(100% - 200px);
box-sizing: border-box !important;
display: flex;
flex-direction: column;
overflow: hidden;
overflow-y: auto;
z-index: 1;
}
.hc-subtitles-list-container {
height: 100%;
box-sizing: border-box;
overflow: hidden;
overflow-y: auto;
min-height: 100px;
border-radius: 2.3px;
}
.hc-subtitles-error {
padding: 20px;
margin-bottom: 5px;
box-sizing: border-box;
border: 2px solid red;
bottom: 0;
max-height: 100%;
font-size: 12px;
background: rgba(23, 35, 34, .5);
border-radius: 2.3px;
left: 0;
right: 0;
}
.hc-subtitles-list {
bottom: 0;
}
/* Scrollbars */
.hc-subtitles-list-wrapper {
margin: 0 5px 0 10px;
}
.hc-subtitles-list-container {
margin-right: 5px;
}
.hc-subtitles-error {
margin-right: 5px;
}
.hc-subtitles-list-wrapper,
.hc-subtitles-list-wrapper * {
scrollbar-width: thin;
scrollbar-color: rgba(23, 35, 34, .7) rgba(23, 35, 34, .5);
}
.hc-subtitles-list-wrapper::-webkit-scrollbar,
.hc-subtitles-list-wrapper *::-webkit-scrollbar {
width: 20px;
}
.hc-subtitles-list-wrapper::-webkit-scrollbar-track,
.hc-subtitles-list-wrapper *::-webkit-scrollbar-track {
background-color: transparent;
}
.hc-subtitles-list-wrapper::-webkit-scrollbar-thumb,
.hc-subtitles-list-wrapper *::-webkit-scrollbar-thumb {
background-color: rgba(23, 35, 34, .7);
border-radius: 20px;
border: 5px solid transparent;
background-clip: padding-box;
}
/* Subtitles list */
.hc-subtitles-list .hc-subtitles-head {
font-size: 12px;
background: rgba(23, 35, 34, .5);
border-radius: 2.3px;
}
.hc-subtitles-list .hc-subtitles-item {
position: relative;
display: inline-block;
cursor: pointer;
pointer-events: all;
width: 100%;
box-sizing: border-box;
margin-top: 5px;
background: rgba(23, 35, 34, .7);
border-radius: 2.3px;
transition: opacity 0.1s linear 0s, background 0.1s linear 0s, transform 0.1s linear 0s;
font-size: 12px;
}
.hc-subtitles-list .hc-subtitles-item:hover {
background: rgba(0, 173, 239, .7);
}
.hc-subtitles-list .hc-subtitles-item.active {
color: black;
}
.hc-subtitles-list .hc-subtitles-item.active {
background: white;
color: black;
}
.hc-subtitles-list .hc-subtitles-head .hc-subtitles-item-title,
.hc-subtitles-list .hc-subtitles-item .hc-subtitles-item-title {
position: relative;
padding: 7px;
margin-right: 130px;
overflow-wrap: break-word;
}
.hc-subtitles-list .hc-subtitles-head .hc-subtitles-item-lang,
.hc-subtitles-list .hc-subtitles-item .hc-subtitles-item-lang {
position: relative;
padding: 7px;
float: right;
width: 35px;
text-align: center;
}
.hc-subtitles-list .hc-subtitles-head .hc-subtitles-shift,
.hc-subtitles-list .hc-subtitles-item .hc-subtitles-shift {
float: right;
padding: 7px;
width: 40px;
text-align: center;
}
.hc-subtitles-list .hc-subtitles-item .hc-subtitles-shift .hc-subtitles-shift-input {
background: rgba(43, 55, 54, .7);
border: 0;
width: 35px;
color: white;
text-align: center;
margin: -2px 0px;
}
.hc-subtitles-list .hc-subtitles-item .hc-subtitles-shift .hc-subtitles-shift-input::-webkit-outer-spin-button,
.hc-subtitles-list .hc-subtitles-item .hc-subtitles-shift .hc-subtitles-shift-input::-webkit-inner-spin-button {
-webkit-appearance: none;
margin: 0;
}
.hc-subtitles-list .hc-subtitles-item .hc-subtitles-shift .hc-subtitles-shift-input[type=number] {
-moz-appearance: textfield;
}
/* Subtitles loader */
.hc-subtitles-loader {
content: "";
background-size: 48px 48px;
background-repeat: no-repeat;
background-image: url(${images.loader});
display: block;
position: absolute;
top: 50%;
left: 50%;
width: 48px;
height: 48px;
margin-top: -24px;
margin-left: -24px;
animation: spin 1s infinite linear;
filter: invert(100%);
}
/* Subtitles settings */
.hc-setting-opensubtitles-key .hc-setting-text-value {
display: block;
}
.hc-setting-opensubtitles-key .hc-opensubtitles-login,
.hc-setting-opensubtitles-key .hc-opensubtitles-logout {
float: right;
}
body.hs-opensubtitles-logged-in .hc-opensubtitles-login,
body:not(.hs-opensubtitles-logged-in) .hc-opensubtitles-logout {
display: none;
}
.hc-setting-opensubtitles-key .hc-opensubtitles-input {
border: 0;
border-radius: 20px;
background: #222d33;
background-color: #000;
color: #fff;
margin: 4px 0;
width: 70px;
font-size: 12px;
padding: 3px 10px;
margin-left: 10px;
}
body.hc-style.b-theme__template__night .hc-setting-opensubtitles-key .hc-opensubtitles-input {
background-color: #222d33;
}
.hc-setting-opensubtitles-key .hc-opensubtitles-button {
height: 30px;
background-color: #000;
border: #1d92b2;
border-radius: 30px;
font-size: 12px;
color: #fff;
padding: 3px 10px;
margin-left: 10px;
}
.hc-setting-opensubtitles-key .hc-opensubtitles-login .hc-opensubtitles-button {
width: 52px;
}
.hc-setting-opensubtitles-key .hc-opensubtitles-logout .hc-opensubtitles-button {
width: 60px;
}
body.hc-style.b-theme__template__night .hc-setting-opensubtitles-key .hc-opensubtitles-button {
background-color: #222d33;
}
.hc-setting-opensubtitles-error {
float: left;
color: red;
}
/* !css */
`);
hc.subtitles = {};
hc.subtitles.key = "I4RUSehE2lQ5jLgNjteb3gaW31PbJfso";
const HELP_LINK = '<a href="https://www.opensubtitles.com">opensubtitles.com</a>';
const HELP_TOOLTIP =
/* html */
`
<!-- html -->
<span class="hc-tooltip" style="float: right; margin-right: -10px;">
<span class="hc-tooltip-icon">i</span>
<div class="tooltiptext">
<div>Настройка аккаунта</div>
<ol style="list-style: auto; margin-left: 15px;">
<li style="margin-top: 5px;">Перейти на сайт ${HELP_LINK}</li>
<li style="margin-top: 5px;">Зарегистрироваться</li>
<li style="margin-top: 5px;">Подтвердить регистрацию</li>
<li style="margin-top: 5px;">Ввести имя/пароль от созданного аккаунта</li>
</ol>
<div style="margin-top: 5px;">Использование</div>
<ol style="list-style: auto; margin-left: 15px;">
<li style="margin-top: 5px;">Настройка "Дополнительные элементы управления плеером" долна быть включена</li>
<li style="margin-top: 5px;">
Для поиска субтитров нажать кнопку расположенную
в правом нижнем углу плеера
</li>
<li style="margin-top: 5px;">
Выбрать в списке подходящие субтитры
</li>
<li style="margin-top: 5px;">
После нажатия на пункт списка плеер загрузит и отобразит выбрананые субтитры
</li>
<li style="margin-top: 5px;">
При рассинхранизации есть 2 способа синхронизировации видео и субтитров
<ul style="list-style: circle; margin-left: 15px;">
<li style="margin-top: 5px;">В настройках плеера (максимум ±5 секунд)</li>
<li style="margin-top: 5px;">В списке найденых субтитров перед выбором выставить значение в колонке "Сдвиг" (в секундах)</li>
</ul>
</li>
</ol>
<div style="margin-top: 15px;">
<small>
Способы увеличения количества запросов:
<br>
<a href="https://www.opensubtitles.com/en/users/vip">opensubtitles.com/en/users/vip</a>
</small>
</div>
</div>
</div>
<!-- !html -->
`;
settings();
setup();
function settings() {
if (hc.settings) {
const settingWrapper = document.createElement("div");
settingWrapper.classList.add("hc-setting");
settingWrapper.classList.add("hc-setting-opensubtitles-key");
const settingTextBlock = document.createElement("div");
settingTextBlock.classList.add("hc-setting-text-block");
const labelSpan = document.createElement("span");
labelSpan.classList.add("hc-setting-label");
labelSpan.innerHTML = "Cубтитры";
settingTextBlock.appendChild(labelSpan);
const textValueSpan = document.createElement("span");
textValueSpan.classList.add("hc-setting-text-value");
textValueSpan.innerHTML = HELP_LINK;
settingTextBlock.appendChild(textValueSpan);
const profileSpan = document.createElement("span");
profileSpan.classList.add("hc-setting-text-value");
settingTextBlock.appendChild(profileSpan);
const downloadSpan = document.createElement("span");
downloadSpan.classList.add("hc-setting-text-value");
settingTextBlock.appendChild(downloadSpan);
const textErrorSpan = document.createElement("span");
textErrorSpan.classList.add("hc-setting-text-value");
textErrorSpan.classList.add("hc-setting-opensubtitles-error");
const settingLogin = document.createElement("div");
settingLogin.classList.add("hc-opensubtitles-login");
const settingUsernameInput = document.createElement("input");
settingUsernameInput.placeholder = "Username";
settingUsernameInput.type = "text";
settingUsernameInput.classList.add("hc-opensubtitles-input");
const settingPasswordInput = document.createElement("input");
settingPasswordInput.placeholder = "Password";
settingPasswordInput.type = "password";
settingPasswordInput.classList.add("hc-opensubtitles-input");
const settingLoginButton = document.createElement("button");
settingLoginButton.innerText = "Вход";
settingLoginButton.classList.add("hc-opensubtitles-button");
function showError(text) {
textErrorSpan.innerHTML = text;
}
function createRemainingTime(time_utc) {
const diff = (new Date(time_utc) - new Date()) / 1000;
var hours = Math.floor(diff / (60 * 60));
var minutes = "0" + Math.floor((diff % (60 * 60)) / 60);
var seconds = "0" + Math.floor(diff % 60);
return hours + ":" + minutes.slice(minutes.length - 2) + ":" + seconds.slice(seconds.length - 2);
}
var downloadsData = {};
function showDownloadData() {
downloadSpan.innerHTML = "";
if (downloadsData.allowed_downloads) {
let allowed_downloads = downloadsData.allowed_downloads;
downloadSpan.innerHTML += "<p>Разрешено загрузок в день: " + allowed_downloads + "</p>";
}
if (downloadsData.remaining_downloads) {
let remaining_downloads = downloadsData.remaining_downloads;
if (remaining_downloads < 0) {
remaining_downloads = 0;
}
downloadSpan.innerHTML += "<p>Осталось загрузок: " + remaining_downloads + "</p>";
}
if (downloadsData.reset_time_utc) {
let remaining = createRemainingTime(downloadsData.reset_time_utc);
if (remaining[0] === "-") {
setDownloadData({
allowed_downloads: downloadsData.allowed_downloads,
remaining_downloads: null,
reset_time_utc: null,
});
} else {
downloadSpan.innerHTML += "<p>Сброс счетчика через " + remaining + "</p>";
}
}
}
function hideDownloadData() {
downloadSpan.innerHTML = "";
}
function setDownloadData(data) {
downloadsData = data;
}
hc.subtitles.setDownloadData = setDownloadData;
function showUserData(id) {
profileSpan.innerHTML = "Идентификатор пользователя: " + id;
showDownloadData();
}
function hideUserData() {
profileSpan.innerHTML = "";
hideDownloadData();
}
setInterval(function () {
showDownloadData();
}, 1000);
function loadProfile() {
GM_xmlhttpRequest({
method: "GET",
url: "https://api.opensubtitles.com/api/v1/infos/user",
headers: {
"Api-Key": hc.subtitles.key,
Authorization: "Bearer " + hc.settings.getSetting("hs-opensubtitles-key") || "",
"Content-Type": "application/json",
},
onload: function (response) {
if (response.status === 200) {
var responseJSON = JSON.parse(response.responseText);
console.debug(responseJSON);
setDownloadData({
allowed_downloads: responseJSON.data.allowed_downloads,
remaining_downloads: responseJSON.data.remaining_downloads,
reset_time_utc: responseJSON.data.reset_time_utc,
});
showUserData(responseJSON.data.user_id);
} else {
console.debug(response);
logout();
showError(parseOpensubtitlesError(response));
}
},
onerror: function (e) {
console.debug(e);
showError("Something went wrong");
},
});
}
if (hc.settings.getSetting("hs-opensubtitles-key")) {
loadProfile();
}
function login(event) {
event.preventDefault();
textErrorSpan.innerHTML = "";
GM_xmlhttpRequest({
method: "POST",
url: "https://api.opensubtitles.com/api/v1/login",
data: JSON.stringify({
username: settingUsernameInput.value,
password: settingPasswordInput.value,
}),
headers: {
"Api-Key": hc.subtitles.key,
"Content-Type": "application/json",
},
onload: function (response) {
if (response.status === 200) {
var responseJSON = JSON.parse(response.responseText);
console.debug(responseJSON);
hc.settings.setSetting("hs-opensubtitles-key", responseJSON.token);
document.body.classList.add("hs-opensubtitles-logged-in");
loadProfile();
} else {
showError(parseOpensubtitlesError(response));
console.debug(response);
}
},
onerror: function (e) {
showError("Something went wrong");
console.debug(e);
},
});
}
function inputEnter(event) {
if (event.key === "Enter") {
login();
}
}
settingLoginButton.addEventListener("click", login);
settingUsernameInput.addEventListener("keyup", inputEnter);
settingPasswordInput.addEventListener("keyup", inputEnter);
settingLogin.appendChild(settingUsernameInput);
settingLogin.appendChild(settingPasswordInput);
settingLogin.appendChild(settingLoginButton);
settingWrapper.appendChild(settingLogin);
settingWrapper.appendChild(settingTextBlock);
settingWrapper.appendChild(textErrorSpan);
const settingProfile = document.createElement("div");
settingProfile.classList.add("hc-opensubtitles-logout");
const settingLogoutButton = document.createElement("button");
settingLogoutButton.innerText = "Выход";
settingLogoutButton.classList.add("hc-opensubtitles-button");
function logout() {
hc.settings.setSetting("hs-opensubtitles-key", "");
document.body.classList.remove("hs-opensubtitles-logged-in");
setDownloadData({
allowed_downloads: null,
remaining_downloads: null,
reset_time_utc: null,
});
hideUserData();
downloadSpan.innerHTML = "";
textErrorSpan.innerHTML = "";
}
settingLogoutButton.addEventListener("click", function () {
GM_xmlhttpRequest({
method: "DELETE",
url: "https://api.opensubtitles.com/api/v1/logout",
headers: {
"Api-Key": hc.subtitles.key,
Authorization: "Bearer " + hc.settings.getSetting("hs-opensubtitles-key") || "",
},
onload: function (response) {
if (response.status === 200) {
logout();
} else {
console.debug(response);
logout();
}
},
onerror: function (e) {
console.debug(e);
logout();
},
});
});
settingProfile.appendChild(settingLogoutButton);
settingWrapper.appendChild(settingProfile);
const tooltip = document.createElement("div");
tooltip.innerHTML = HELP_TOOLTIP;
settingWrapper.appendChild(tooltip);
hc.settings.addElementSetting(settingWrapper);
}
}
function parseOpensubtitlesError(response) {
try {
const responseJSON = JSON.parse(response.responseText);
if (responseJSON.message) {
return responseJSON.message;
}
if (responseJSON.errors) {
return responseJSON.errors.join("<br>");
}
return responseJSON;
} catch (err) {
return response.responseText;
}
}
function setup() {
if (hc.settings.getSetting("hs-opensubtitles-key")) {
document.body.classList.add("hs-opensubtitles-logged-in");
}
const playerSubtitles = document.createElement("div");
playerSubtitles.classList.add("hc-subtitles-list-wrapper");
playerSubtitles.classList.add("hidden");
const playerSubtitlesError = document.createElement("div");
playerSubtitlesError.classList.add("hc-subtitles-error");
playerSubtitlesError.classList.add("hidden");
playerSubtitles.appendChild(playerSubtitlesError);
const playerSubtitlesListContainer = document.createElement("div");
playerSubtitlesListContainer.classList.add("hc-subtitles-list-container");
playerSubtitles.appendChild(playerSubtitlesListContainer);
const playerSubtitlesList = document.createElement("ul");
playerSubtitlesList.classList.add("hc-subtitles-list");
playerSubtitlesListContainer.appendChild(playerSubtitlesList);
const playerSubtitlesLoader = document.createElement("div");
playerSubtitlesLoader.classList.add("hc-subtitles-loader");
playerSubtitlesLoader.classList.add("hidden");
window.addEventListener("message", function (event) {
if (event.data) {
if (event.data.event == "init") {
const player = document.querySelector("#oframecdnplayer");
if (player) {
player.appendChild(playerSubtitles);
player.appendChild(playerSubtitlesLoader);
}
}
}
});
// Player subtitles actions
function errorSubtitlesShow(innerHTML) {
playerSubtitlesError.classList.remove("hidden");
playerSubtitlesError.innerHTML = innerHTML;
}
function errorSubtitlesHide() {
playerSubtitlesError.classList.add("hidden");
}
function getImdbId(imdbUrl) {
playerSubtitlesLoader.classList.remove("hidden");
return new Promise(function (resolve) {
GM_xmlhttpRequest({
method: "GET",
headers: {
Referer: location.href,
},
url: imdbUrl,
onload: function (response) {
console.debug(response);
if (response.status === 200) {
const pageConstPattern = /<meta property="imdb:pageConst" content="tt.{1,10}"\/>/;
const pageConstHTML = pageConstPattern.exec(response.responseText);
if (pageConstHTML) {
try {
const id = /(content="tt)(.*)(")/.exec(pageConstHTML[0])[2];
resolve(id);
errorSubtitlesHide();
} catch (err) {
console.debug(err);
errorSubtitlesShow("Something went wrong");
}
} else {
errorSubtitlesShow("Something went wrong");
}
} else {
errorSubtitlesShow("Something went wrong");
}
playerSubtitlesLoader.classList.add("hidden");
},
onerror: function (e) {
console.debug(e);
errorSubtitlesShow("Something went wrong");
playerSubtitlesLoader.classList.add("hidden");
},
});
});
}
function searchSubtitles(id, page) {
playerSubtitlesLoader.classList.remove("hidden");
return new Promise(function (resolve) {
GM_xmlhttpRequest({
method: "GET",
url:
"https://api.opensubtitles.com/api/v1/subtitles?" +
new URLSearchParams({
imdb_id: id,
languages: "en,uk,ru",
page: page || 1,
season_number: hc.player.season(),
episode_number: hc.player.episode(),
}).toString(),
headers: {
"Api-Key": hc.subtitles.key,
Authorization: "Bearer " + hc.settings.getSetting("hs-opensubtitles-key") || "",
},
onload: function (response) {
if (response.status === 200) {
var responseJSON = JSON.parse(response.responseText);
console.debug(responseJSON);
if (responseJSON.total_count > 0) {
resolve(responseJSON);
errorSubtitlesHide();
} else {
errorSubtitlesShow("No subtitles found");
}
} else {
console.debug(response);
errorSubtitlesShow(parseOpensubtitlesError(response));
}
playerSubtitlesLoader.classList.add("hidden");
},
onerror: function (e) {
console.debug(e);
errorSubtitlesShow("Something went wrong");
playerSubtitlesLoader.classList.add("hidden");
},
});
});
}
function downloadSubtitles(id, shift) {
playerSubtitlesLoader.classList.remove("hidden");
return new Promise(function (resolve) {
GM_xmlhttpRequest({
method: "POST",
url: "https://api.opensubtitles.com/api/v1/download",
data: JSON.stringify({
file_id: id,
timeshift: shift,
}),
headers: {
"Api-Key": hc.subtitles.key,
Authorization: "Bearer " + hc.settings.getSetting("hs-opensubtitles-key") || "",
"Content-Type": "application/json",
},
onload: function (response) {
if (response.status === 200) {
var responseJSON = JSON.parse(response.responseText);
console.debug(responseJSON);
if (hc.subtitles) {
hc.subtitles.setDownloadData({
allowed_downloads: responseJSON.remaining + responseJSON.requests,
remaining_downloads: responseJSON.remaining,
reset_time_utc: responseJSON.reset_time_utc,
});
}
resolve(responseJSON);
errorSubtitlesHide();
} else {
console.debug(response);
errorSubtitlesShow(parseOpensubtitlesError(response));
}
playerSubtitlesLoader.classList.add("hidden");
},
onerror: function (e) {
console.debug(e);
errorSubtitlesShow("Something went wrong");
playerSubtitlesLoader.classList.add("hidden");
},
});
});
}
function loadSubtitles(responseJSON) {
hc.player.subtitle(decodeURI(responseJSON.link));
}
function headSubtitles() {
const playerSubtitlesItem = document.createElement("li");
playerSubtitlesItem.classList.add("hc-subtitles-head");
const playerSubtitlesItemLang = document.createElement("div");
playerSubtitlesItemLang.classList.add("hc-subtitles-item-lang");
playerSubtitlesItemLang.innerText = "Язык";
playerSubtitlesItem.appendChild(playerSubtitlesItemLang);
const playerSubtitlesShift = document.createElement("div");
playerSubtitlesShift.classList.add("hc-subtitles-shift");
playerSubtitlesShift.innerText = "Сдвиг";
playerSubtitlesItem.appendChild(playerSubtitlesShift);
const playerSubtitlesItemTitle = document.createElement("div");
playerSubtitlesItemTitle.classList.add("hc-subtitles-item-title");
playerSubtitlesItemTitle.innerText = "Название";
playerSubtitlesItem.appendChild(playerSubtitlesItemTitle);
playerSubtitlesList.appendChild(playerSubtitlesItem);
}
function pageSubtitles(responseJSON) {
for (let dataIndex = 0; dataIndex < responseJSON.data.length; dataIndex++) {
const dataItem = responseJSON.data[dataIndex];
for (let fileIndex = 0; fileIndex < dataItem.attributes.files.length; fileIndex++) {
const fileItem = dataItem.attributes.files[fileIndex];
const playerSubtitlesItem = document.createElement("li");
playerSubtitlesItem.classList.add("hc-subtitles-item");
playerSubtitlesItem.addEventListener("click", function (event) {
const target = event.target;
const item = target.closest(".hc-subtitles-item");
const siblings = Array.from(item.parentElement.children);
for (let sib of siblings) {
sib.classList.remove("active");
}
item.classList.add("active");
const shift = item.querySelector(".hc-subtitles-shift-input").value;
downloadSubtitles(fileItem.file_id, shift).then(loadSubtitles).then(closeSubtitles);
});
const playerSubtitlesItemLang = document.createElement("div");
playerSubtitlesItemLang.classList.add("hc-subtitles-item-lang");
playerSubtitlesItemLang.innerText = dataItem.attributes.language;
playerSubtitlesItem.appendChild(playerSubtitlesItemLang);
const playerSubtitlesShift = document.createElement("div");
playerSubtitlesShift.classList.add("hc-subtitles-shift");
playerSubtitlesItem.appendChild(playerSubtitlesShift);
const playerSubtitlesShiftLabel = document.createElement("span");
playerSubtitlesShift.appendChild(playerSubtitlesShiftLabel);
const playerSubtitlesShiftInput = document.createElement("input");
playerSubtitlesShiftInput.classList.add("hc-subtitles-shift-input");
playerSubtitlesShiftInput.type = "number";
playerSubtitlesShiftInput.value = "0";
playerSubtitlesShiftInput.addEventListener("click", function (e) {
e.stopPropagation();
});
playerSubtitlesShift.appendChild(playerSubtitlesShiftInput);
const playerSubtitlesItemTitle = document.createElement("div");
playerSubtitlesItemTitle.classList.add("hc-subtitles-item-title");
playerSubtitlesItemTitle.innerText = fileItem.file_name || dataItem.attributes.release;
playerSubtitlesItem.appendChild(playerSubtitlesItemTitle);
playerSubtitlesList.appendChild(playerSubtitlesItem);
}
}
}
function findSubtitles(url) {
getImdbId(url).then(function (id) {
searchSubtitles(id).then(function (responseJSON) {
headSubtitles();
pageSubtitles(responseJSON);
if (responseJSON.total_pages > 1) {
for (let pageNumber = 2; pageNumber <= responseJSON.total_pages; pageNumber++) {
searchSubtitles(id, pageNumber).then(pageSubtitles);
}
}
});
});
}
var subtitlesOpened = false;
function openSubtitles() {
const imdbLink = document.querySelector(".b-post__info_rates.imdb a");
if (!imdbLink) return;
const playerVideo = document.querySelector("#oframecdnplayer video");
if (!playerVideo) return;
playerSubtitles.classList.remove("hidden");
if (Array.from(playerSubtitlesList.querySelectorAll(".hc-subtitles-item")).length === 0) {
findSubtitles(imdbLink.href);
}
subtitlesOpened = true;
let interval = setInterval(function () {
if (subtitlesOpened) {
document.querySelector("#oframecdnplayer").dispatchEvent(new Event("mousemove"));
} else {
clearInterval(interval);
}
}, 1000);
}
function closeSubtitles() {
const playerVideo = document.querySelector("#oframecdnplayer video");
if (!playerVideo) return;
playerSubtitles.classList.add("hidden");
subtitlesOpened = false;
}
function clearSubtitles() {
playerSubtitlesList.querySelectorAll(".hc-subtitles-item, .hc-subtitles-head").forEach(function (elem) {
elem.remove();
});
closeSubtitles();
}
function toggleSubtitles() {
if (playerSubtitles.classList.contains("hidden")) {
openSubtitles();
} else {
closeSubtitles();
}
}
hc.subtitles.toggle = toggleSubtitles;
hc.subtitles.clear = clearSubtitles;
}
}
/* ------------------------------------------------- */
/* --------------PLAYER-EXTRA-CONTROLS-------------- */
/* ------------------------------------------------- */
function initPlayerExtraControls() {
GM_addStyle(`
/* css */
body.hc-player-full-page {
height: 100%;
overflow: hidden;
}
body.hc-player-full-page .b-player {
display: flex;
flex-direction: column;
position: fixed !important;
top: 0;
bottom: 0;
left: 0;
right: 0;
width: 100% !important;
height: 100% !important;
z-index: 1000;
}
body.hc-player-full-page .b-player__holder_cdn {
width: 100% !important;
height: 100% !important;
}
body.hc-player-full-page .b-player__container_cdn {
width: 100% !important;
height: 100% !important;
}
body.hc-player-full-page .b-post__status_wrapper {
display: none;
}
.hc-player-top-bar {
display: none;
box-sizing: border-box !important;
position: absolute;
width: 100%;
top: 0;
left: 0;
padding: 20px;
background: linear-gradient(
to bottom,
rgba(0, 0, 0, .6) 0%,
rgba(0, 0, 0, .1) 70%,
rgba(0, 0, 0, 0) 100%
);
pointer-events: none;
z-index: 1;
}
.hc-player-top-bar-enabled .hc-player-top-bar {
display: block;
}
.hc-player-top-bar:hover {
display: block !important;
visibility: visible !important;
}
.hc-player-top-bar-title {
display: inline-block;
cursor: pointer;
position: relative;
text-align: left;
line-height: 20px;
font-size: 20px;
font-weight: bold;
pointer-events: all;
padding-left: 10px;
user-select: none;
}
body.hc-player-full-page .hc-player-top-bar-title {
padding-left: 30px;
}
.hc-player-top-bar-origtitle {
display: inline-block;
position: relative;
text-align: left;
line-height: 14px;
font-size: 14px;
pointer-events: all;
padding-left: 10px;
user-select: none;
padding-top: 5px;
opacity: 70%;
}
body.hc-player-full-page .hc-player-top-bar-origtitle {
padding-left: 30px;
}
.hc-player-top-bar-episode {
display: inline-block;
position: relative;
text-align: left;
line-height: 14px;
font-size: 12px;
pointer-events: all;
padding-left: 10px;
user-select: none;
padding-top: 5px;
opacity: 50%;
}
body.hc-player-full-page .hc-player-top-bar-episode {
padding-left: 30px;
}
body.hc-player-full-page .hc-player-top-bar-title:before {
content: '';
position: absolute;
top: 0;
left: 0;
width: 20px;
height: 20px;
margin-right: 10px;
background-size: 20px 20px;
background-repeat: no-repeat;
background-image: url(${images.arrow});
filter: invert(100%) sepia(95%) saturate(21%) hue-rotate(280deg) brightness(106%) contrast(106%);
transform: rotate(-90deg);
}
.hc-player-control {
display: none;
content: '';
position: relative;
float: left;
cursor: pointer;
pointer-events: all;
z-index: 2;
border-radius: 2.3px;
background: rgba(23, 35, 34, .7);
transition: opacity 0.1s linear 0s, background 0.1s linear 0s, transform 0.1s linear 0s;
cursor: point;
}
.hc-player-control:hover {
background: rgba(0, 173, 239, .7);
}
.hc-player-extra-controls-enabled .hc-player-control {
display: block;
}
.hc-player-extra-controls-enabled .hc-player-extra-controls-hidden {
display: none !important;
}
.hc-player-controls-left {
position: absolute;
bottom: 56px;
left: 10px;
}
.hc-player-controls-left .hc-player-control {
margin-right: 10px;
}
.hc-player-controls-right {
position: absolute;
bottom: 56px;
right: 10px;
}
.hc-player-controls-right .hc-player-control {
margin-left: 10px;
}
.hc-player-control-prev,
.hc-player-control-next,
.hc-player-control-replay,
.hc-player-control-forward {
width: 28px;
height: 35px;
}
.hc-player-control-expand,
.hc-player-control-pip,
.hc-player-control-subtitles {
width: 41px;
height: 35px;
}
body:not(.hs-opensubtitles-logged-in) .hc-player-control-subtitles {
display: none;
}
.hc-player-control-icon {
content: '';
position: absolute;
background-repeat: no-repeat;
filter: invert(100%);
}
.hc-player-control-prev-icon {
top: 10px;
left: 7px;
width: 15px;
height: 15px;
background-size: 15px 15px;
background-image: url(${images.next});
transform: rotate(180deg);
}
.hc-player-control-next-icon {
top: 10px;
left: 7px;
width: 15px;
height: 15px;
background-size: 15px 15px;
background-image: url(${images.next});
}
.hc-player-control-replay-icon {
top: 10px;
left: 7px;
width: 15px;
height: 15px;
background-size: 15px 15px;
background-image: url(${images.replay});
}
.hc-player-control-forward-icon {
top: 10px;
left: 7px;
width: 15px;
height: 15px;
background-size: 15px 15px;
background-image: url(${images.forward});
}
.hc-player-control-expand-icon {
top: 8px;
right: 11px;
width: 20px;
height: 20px;
background-size: 20px 20px;
background-image: url(${images.expand});
}
.hc-player-control-pip-icon {
top: 8px;
right: 11px;
width: 20px;
height: 20px;
background-size: 20px 20px;
background-image: url(${images.pip});
}
.hc-player-control-subtitles-icon {
top: 8px;
right: 11px;
width: 20px;
height: 20px;
background-size: 20px 20px;
background-image: url(${images.subtitles});
}
body.hc-player-full-page .hc-player-control-expand-icon {
background-image: url(${images.collapse}) !important;
transform: rotate(-90deg);
}
body.hc-player-full-page .b-footer {
margin-top: 0 !important;
}
.hc-player-control-large-next,
.hc-player-control-large-prev {
position: absolute;
width: 100%;
height: 200%;
top: -50%;
background: #00000000;
border-radius: 50%;
transition: background-color 0.5s ease;
display: none;
}
.hc-player-extra-controls-enabled .hc-player-control-large-next,
.hc-player-extra-controls-enabled .hc-player-control-large-prev {
display: block;
}
.hc-player-control-large-next {
right: -75%;
}
.hc-player-control-large-prev {
left: -75%;
}
.hc-player-control-large-prev.active:before,
.hc-player-control-large-next.active:before {
content: '';
background-repeat: no-repeat;
background-size: 30px 30px;
background-position: center;
height: 100%;
width: 100%;
position: absolute;
filter: invert(100%) sepia(95%) saturate(21%) hue-rotate(280deg) brightness(106%) contrast(106%);
opacity: .5;
}
.hc-player-control-large-prev.active:before {
margin-left: calc(75% / 2);
}
.hc-player-control-large-next.active:before {
margin-left: calc(-75% / 2);
}
.hc-player-control-large-prev.replay:before {
background-image: url(${images.replay});
}
.hc-player-control-large-next.forward:before {
background-image: url(${images.forward});
}
.hc-player-control-large-prev.prev:before {
background-image: url(${images.next});
transform: rotate(180deg);
}
.hc-player-control-large-next.next:before {
background-image: url(${images.next});
}
.hc-player-control-large-prev.active,
.hc-player-control-large-next.active {
background: #00000070;
}
#oframecdnplayer > pjsdiv {
z-index: 1;
}
#oframecdnplayer > pjsdiv[style*="width: 100%; height: 100%;"] {
z-index: 0;
}
/* !css */
`);
setup();
settings();
function setup() {
// Create Player Control function
function createPlayerControl(mainClass, iconClass) {
const playerControlIcon = document.createElement("div");
playerControlIcon.classList.add("hc-player-control-icon");
playerControlIcon.classList.add(iconClass);
const playerControl = document.createElement("div");
playerControl.classList.add("hc-player-control");
playerControl.classList.add(mainClass);
playerControl.appendChild(playerControlIcon);
var mouseon = false;
playerControl.addEventListener("mouseenter", function () {
mouseon = true;
let interval = setInterval(function () {
if (mouseon) {
document.querySelector("#oframecdnplayer").dispatchEvent(new Event("mousemove"));
} else {
clearInterval(interval);
}
}, 1000);
});
playerControl.addEventListener("mouseleave", function () {
mouseon = false;
});
return playerControl;
}
// Player Control Prev
const playerControlPrev = createPlayerControl("hc-player-control-prev", "hc-player-control-prev-icon");
playerControlPrev.addEventListener("click", hc.player.prev);
// Player Control Next
const playerControlNext = createPlayerControl("hc-player-control-next", "hc-player-control-next-icon");
playerControlNext.addEventListener("click", hc.player.next);
// Adjust player time function
let adjusting = false;
function adjust(seconds) {
hc.player.adjust(seconds);
setTimeout(function () {
let interval = setInterval(function () {
if (adjusting) {
hc.player.adjust(seconds);
} else {
clearInterval(interval);
}
}, 30);
}, 1000);
}
// Player Control Replay
const playerControlReplay = createPlayerControl(
"hc-player-control-replay",
"hc-player-control-replay-icon"
);
playerControlReplay.addEventListener("mousedown", function () {
adjusting = true;
adjust(-5);
});
playerControlReplay.addEventListener("mouseup", function () {
adjusting = false;
});
// Player Control Forward
const playerControlForward = createPlayerControl(
"hc-player-control-forward",
"hc-player-control-forward-icon"
);
playerControlForward.addEventListener("mousedown", function () {
adjusting = true;
adjust(5);
});
playerControlForward.addEventListener("mouseup", function () {
adjusting = false;
});
// Player Expand button
var collapsed = false;
function collapse() {
hc.player.expanded = 0;
document.body.classList.remove("hc-player-full-page");
hc.player.resize();
collapsed = true;
}
function expand() {
hc.player.expanded = 1;
document.body.classList.add("hc-player-full-page");
}
function toggle() {
if (hc.player.fullscreen == 0) {
if (hc.player.expanded == 1) {
collapse();
} else if (hc.player.expanded == 0) {
expand();
}
} else if (hc.player.fullscreen == 1) {
hc.player.exitfullscreen();
}
}
const playerControlExpand = createPlayerControl(
"hc-player-control-expand",
"hc-player-control-expand-icon"
);
playerControlExpand.addEventListener("click", toggle);
// Player PIP button
const playerControlPIP = createPlayerControl("hc-player-control-pip", "hc-player-control-pip-icon");
// Player Subtitles button
const playerControlSubtitles = createPlayerControl(
"hc-player-control-subtitles",
"hc-player-control-subtitles-icon"
);
playerControlSubtitles.addEventListener("click", function () {
hc.subtitles.toggle();
});
// Player Controls Left
const playerControlsLeft = document.createElement("div");
playerControlsLeft.classList.add("hc-player-controls-left");
playerControlsLeft.appendChild(playerControlPrev);
playerControlsLeft.appendChild(playerControlNext);
playerControlsLeft.appendChild(playerControlReplay);
playerControlsLeft.appendChild(playerControlForward);
// Player Controls Right
const playerControlsRight = document.createElement("div");
playerControlsRight.classList.add("hc-player-controls-right");
playerControlsRight.appendChild(playerControlSubtitles);
playerControlsRight.appendChild(playerControlPIP);
playerControlsRight.appendChild(playerControlExpand);
// Player Top Bar
const playerTopBarTitleSpan = document.createElement("span");
playerTopBarTitleSpan.classList.add("hc-player-top-bar-title");
playerTopBarTitleSpan.addEventListener("click", toggle);
const playerTopBarTitle = document.createElement("div");
playerTopBarTitle.appendChild(playerTopBarTitleSpan);
const playerTopBarOrigTitleSpan = document.createElement("span");
playerTopBarOrigTitleSpan.classList.add("hc-player-top-bar-origtitle");
const playerTopBarOrigTitle = document.createElement("div");
playerTopBarOrigTitle.appendChild(playerTopBarOrigTitleSpan);
const playerTopBarEpisodeSpan = document.createElement("span");
playerTopBarEpisodeSpan.classList.add("hc-player-top-bar-episode");
const playerTopBarEpisode = document.createElement("div");
playerTopBarEpisode.appendChild(playerTopBarEpisodeSpan);
const playerTopBar = document.createElement("div");
playerTopBar.classList.add("hc-player-top-bar");
playerTopBar.appendChild(playerTopBarTitle);
playerTopBar.appendChild(playerTopBarOrigTitle);
playerTopBar.appendChild(playerTopBarEpisode);
// Large controls
function createControlLarge(className, singleClick, doubleClick, tripleClick, multiClick) {
const playerControlLarge = document.createElement("div");
playerControlLarge.classList.add(className);
var clicks = 0;
var timer,
timeout = 350;
playerControlLarge.addEventListener("click", function (event) {
clearTimeout(timer);
clicks++;
if (clicks < 4) {
timer = setTimeout(function () {
if (clicks == 1) singleClick(event);
else if (clicks == 2) doubleClick(event);
else if (clicks == 3) tripleClick(event);
clicks = 0;
}, timeout);
} else {
multiClick(event);
timer = setTimeout(function () {
clicks = 0;
}, timeout);
}
});
return playerControlLarge;
}
const clickDelay = 500;
const playerControlLargePrev = createControlLarge(
"hc-player-control-large-prev",
function () {
hc.player.toggle();
},
function () {
hc.player.togglefullscreen();
},
function (event) {
event.target.classList.add("active");
event.target.classList.add("prev");
setTimeout(function() {
event.target.classList.remove("active");
event.target.classList.remove("prev");
hc.player.prev();
}, clickDelay);
},
function (event) {
event.target.classList.add("active");
event.target.classList.add("replay");
setTimeout(function() {
event.target.classList.remove("active");
event.target.classList.remove("replay");
hc.player.adjust(-5);
}, clickDelay);
}
);
const playerControlLargeNext = createControlLarge(
"hc-player-control-large-next",
function () {
hc.player.toggle();
},
function () {
hc.player.togglefullscreen();
},
function (event) {
event.target.classList.add("active");
event.target.classList.add("next");
setTimeout(function() {
event.target.classList.remove("active");
event.target.classList.remove("next");
hc.player.next();
}, clickDelay);
},
function (event) {
event.target.classList.add("active");
event.target.classList.add("forward");
setTimeout(function() {
event.target.classList.remove("active");
event.target.classList.remove("forward");
hc.player.adjust(5);
}, clickDelay);
}
);
// Keys
document.addEventListener("keydown", function (e) {
switch (e.code) {
case "Escape":
if (hc.player.fullscreen == 0) {
collapse();
}
hc.player.resize();
break;
}
});
// Player events
function setTitle() {
const postTitle = document.querySelector(".b-post__title h1");
if (postTitle) {
playerTopBarTitleSpan.innerText = postTitle.innerText;
}
}
function setOrigTitle() {
const postOrigTitle = document.querySelector(".b-post__origtitle");
if (postOrigTitle) {
playerTopBarOrigTitleSpan.innerText = postOrigTitle.innerText;
}
}
function setSeasonAndEpisode() {
const season = hc.player.season();
const episode = hc.player.episode();
if (season && episode) {
playerTopBarEpisodeSpan.innerText = "Сезон " + season + " - Серия " + episode;
}
}
function initPIPControl(player) {
playerControlPIP.classList.add("hidden");
Array.from(player.querySelectorAll('pjsdiv[style*="top: 20px;"]')).forEach(function (elem) {
if (!elem) return;
const pip = elem.querySelector('pjsdiv[style*="top: -17.5px; left: -17.5px;"]');
if (!pip) return;
new MutationObserver(function () {
if (elem.style.display === "none") {
playerControlPIP.classList.add("hidden");
elem.classList.remove("hc-player-extra-controls-hidden");
} else {
playerControlPIP.classList.remove("hidden");
elem.classList.add("hc-player-extra-controls-hidden");
}
}).observe(elem, {
attributes: true,
attributeFilter: ["style"],
});
playerControlPIP.addEventListener("click", function () {
pip.click();
});
});
}
window.addEventListener("message", function (event) {
if (event.data) {
if (event.data.event == "init") {
const player = document.querySelector("#oframecdnplayer");
if (player) {
player.appendChild(playerTopBar);
player.appendChild(playerControlsLeft);
player.appendChild(playerControlsRight);
player.appendChild(playerControlLargePrev);
player.appendChild(playerControlLargeNext);
initPIPControl(player);
}
setTitle();
setOrigTitle();
setSeasonAndEpisode();
}
if (event.data.event == "new") {
setSeasonAndEpisode();
hc.subtitles.clear();
}
if (event.data.event == "play") {
if (!collapsed && document.body.classList.contains("hc-player-full-page-enabled")) {
expand();
}
}
if (event.data.event == "ui") {
if (event.data.data == 0) {
playerTopBar.classList.add("hidden");
playerControlsLeft.classList.add("hidden");
playerControlsRight.classList.add("hidden");
}
if (event.data.data == 1) {
playerTopBar.classList.remove("hidden");
playerControlsLeft.classList.remove("hidden");
playerControlsRight.classList.remove("hidden");
}
}
if (event.data.event == "fullscreen") {
document.body.classList.add("hc-player-full-page");
hc.player.fullscreen = 1;
}
if (event.data.event == "exitfullscreen") {
if (hc.player.expanded == 0) {
document.body.classList.remove("hc-player-full-page");
}
hc.player.fullscreen = 0;
hc.player.resize();
}
}
});
}
function settings() {
if (hc.settings) {
hc.settings.createTumblerSetting({
name: "player-top-bar",
label: "Дополнительная панель с заголовком в плеере",
classes: ["hc-on-of-tumbler"],
options: [
{
class: null,
text: "Выкл",
},
{
class: "hc-player-top-bar-enabled",
text: "Вкл",
default: true,
},
],
});
hc.settings.createTumblerSetting({
name: "player-extra-controls",
label: "Дополнительные элементы управления плеером",
classes: ["hc-on-of-tumbler"],
options: [
{
class: null,
text: "Выкл",
},
{
class: "hc-player-extra-controls-enabled",
text: "Вкл",
default: true,
},
],
});
hc.settings.createTumblerSetting({
name: "player-full-page",
label: "Автоматическое разворачивание плеера на всю страницу",
classes: ["hc-on-of-tumbler"],
options: [
{
class: null,
text: "Выкл",
},
{
class: "hc-player-full-page-enabled",
text: "Вкл",
},
],
});
}
}
}
/* ------------------------------------------------- */
/* --------------PLAYER-AUTO-PLAY-NEXT-------------- */
/* ------------------------------------------------- */
function initAutoPlayNext() {
setup();
settings();
function setup() {
window.addEventListener("message", function (event) {
if (event.data && event.data.event == "ended") {
if (document.body.classList.contains("hc-auto-play-next-enabled")) {
hc.player.next();
}
}
if (
event.data &&
event.data.event == "time" &&
event.data.data != 0 &&
event.data.data >= event.data.duration - 1
) {
if (document.body.classList.contains("hc-auto-play-next-disabled")) {
hc.player.stop();
}
}
});
}
function settings() {
if (hc.settings) {
hc.settings.createTumblerSetting({
name: "auto-play-next",
label: "Автопереключение",
classes: [],
options: [
{
class: null,
text: "Как в настройках профиля (серии или выкл)",
},
{
class: "hc-auto-play-next-enabled",
text: "Быстрое переключение (серии и сезоны)",
},
{
class: "hc-auto-play-next-disabled",
text: "Выкл",
},
],
});
}
}
}
/* ------------------------------------------------- */
/* --------------HIDE-ADS--------------------------- */
/* ------------------------------------------------- */
function initHideAds() {
GM_addStyle(`
/* css */
/* Hide some ads containers */
body.hc-hide-ads .b-content__main > .b-post__mixedtext + div[style][id],
body.hc-hide-ads .b-content__main > .b-post__rating_table + div[style][id],
body.hc-hide-ads .b-content__main > div > .b-player > .b-player__network_issues_holder + div[style],
body.hc-hide-ads .b-content__main > div > .b-player > a[target='_blank'],
body.hc-hide-ads .b-content__main + div[id],
body.hc-hide-ads .b-content__inline > .b-content__inline_inner > .b-content__inline_items + div[id],
body.hc-hide-ads .b-wrapper .nopadd,
body.hc-hide-ads .b-seriesupdate__block_list > .b-seriesupdate__block_list_item[data-url=''] {
display: none !important;
}
/* !css */
`);
settings();
function settings() {
if (hc.settings) {
hc.settings.createTumblerSetting({
name: "hide-ads",
label: "Скрытие рекламных блоков",
classes: ["hc-on-of-tumbler"],
options: [
{
class: null,
text: "Выкл",
},
{
class: "hc-hide-ads",
text: "Вкл",
default: true,
},
],
});
}
}
}
/* ------------------------------------------------- */
/* --------------HIDE-PLAYER-ADS-------------------- */
/* ------------------------------------------------- */
function initHidePlayerAds() {
settings();
function settings() {
if (hc.settings) {
hc.settings.createTumblerSetting({
name: "hide-player-ads",
label: "Отключение рекламных роликов в плеере",
classes: ["hc-on-of-tumbler"],
options: [
{
start: function () {
hc.player.vast(1);
},
class: null,
text: "Выкл",
},
{
start: function () {
hc.player.vast(0);
},
class: "hc-player-hide-ads",
text: "Вкл",
default: true,
},
],
});
}
}
}
/* ------------------------------------------------- */
/* --------------STYLE-IMPROVEMENTS----------------- */
/* ------------------------------------------------- */
function initStyleImprovements() {
GM_addStyle(`
/* css */
/* Top Nav */
body.hc-style .b-topnav__sub_inner a {
color: #000 !important;
}
body.hc-style.b-theme__template__night .b-topnav__sub_inner a {
color: #fff !important;
}
/* Сontent item */
body.hc-style .b-content__inline_item .b-content__inline_item-link a,
body.hc-style .b-content__inline_item .b-content__inline_item-link a:visited {
color: #000;
}
body.hc-style.b-theme__template__night .b-content__inline_item .b-content__inline_item-link a,
body.hc-style.b-theme__template__night .b-content__inline_item .b-content__inline_item-link a:visited {
color: #fff;
}
body.hc-style .b-content__inline_item .cat {
position: relative;
top: unset;
bottom: 0;
right: 0;
border-radius: 0;
width: 100%;
}
body.hc-style.b-theme__template__night .b-content__inline_item .cat {
background-color: #060f13 !important;
}
body.hc-style .b-content__inline_item .cat .entity {
display: inline-block !important;
margin-right: -8px;
position: absolute;
left: 0;
right: 0;
overflow: hidden;
text-overflow: ellipsis;
}
body.hc-style .b-content__inline_item:hover .cat .entity,
body.hc-style .b-content__inline_item.active .cat .entity {
display: none !important;
margin-right: -10px;
position: absolute;
left: 0;
right: 0;
overflow: hidden;
text-overflow: ellipsis;
}
body.hc-style .b-content__inline_item .info {
background-color: #222d33;
color: #fff;
border-radius: 0 !important;
box-sizing: border-box;
width: 100%;
margin-bottom: 26px;
}
body.hc-style .b-content__inline_item .trailer {
display: none !important;
left: 0;
}
body.hc-style .b-content__inline_item-cover {
padding: 0;
border: 0;
}
body.hc-style .b-content__inline_item-cover img {
width: 100%;
height: auto;
}
/* Sidelist */
body.hc-style .b-sidelist__holder .b-sidelist {
width: calc(100% + 16px) !important;
display: flex;
}
body.hc-style .b-sidelist__holder .b-sidelist .b-content__inline_item {
width: inherit !important;
}
/* Slider */
body.hc-style.b-theme__template__night .b-newest_slider {
border-color: #fff;
color: #fff;
}
body.hc-style.b-theme__template__night .b-newest_slider .b-newest_slider__title span {
border-color: #fff;
color: #fff;
}
/* Сontent page */
body.hc-style .b-post .b-post__partcontent a,
body.hc-style .b-post__info a,
body.hc-style .b-post__info .persons-list-holder .person-name-item a {
color: #000 !important;
border-color: #000;
}
body.hc-style.b-theme__template__night .b-post .b-post__partcontent a,
body.hc-style.b-theme__template__night .b-post__info a,
body.hc-style.b-theme__template__night .b-post__info .persons-list-holder .person-name-item a {
color: #fff !important;
border-color: #fff;
}
body.hc-style .b-sidecover {
background: none;
border: none;
padding: 0;
overflow: hidden;
border-radius: 4px;
}
body.hc-style .b-post .b-sidetitle,
body.hc-style .b-post .b-post__mtitle {
font-size: 16px;
font-weight: bold;
line-height: 18px;
overflow: hidden;
padding: 10px 18px;
text-overflow: ellipsis;
white-space: nowrap;
}
body.hc-style .b-post .b-post__actions .btn,
body.hc-style .b-post .b-sidetitle,
body.hc-style .b-post .b-post__schedule_block_title,
body.hc-style .b-post .b-post__schedule_more,
body.hc-style .b-post .b-post__mtitle {
background: #ddd;
}
body.hc-style .b-post .b-post__actions .btn,
body.hc-style .b-post .b-sidetitle,
body.hc-style .b-post .b-post__schedule_block_title .title,
body.hc-style .b-post .b-post__schedule_more .title,
body.hc-style .b-post .b-post__mtitle {
color: #000;
}
body.hc-style.b-theme__template__night .b-post .b-post__actions .btn,
body.hc-style.b-theme__template__night .b-post .b-sidetitle,
body.hc-style.b-theme__template__night .b-post .b-post__schedule_block_title,
body.hc-style.b-theme__template__night .b-post .b-post__schedule_more,
body.hc-style.b-theme__template__night .b-post .b-post__mtitle {
background: #192125;
}
body.hc-style.b-theme__template__night .b-post .b-post__actions .btn,
body.hc-style.b-theme__template__night .b-post .b-sidetitle,
body.hc-style.b-theme__template__night .b-post .b-post__schedule_block_title .title,
body.hc-style.b-theme__template__night .b-post .b-post__schedule_more .title,
body.hc-style.b-theme__template__night .b-post .b-post__mtitle {
color: #fff;
}
body.hc-style .b-post .b-post__schedule .b-sidetitle {
display: none;
}
body.hc-style .b-post .b-post__partcontent {
margin-top: 0;
}
body.hc-style .b-post .b-post__actions .btn {
border: 0;
border-radius: 0;
}
body.hc-style .b-post .b-post__social_holder {
background: #1f1f1f;
}
/* Rating stars */
body.hc-style .b-content__bubble_rating .b-rating > .current,
body.hc-style .b-post__rating .b-post__rating_layer_current {
filter: grayscale(100%) !important;
}
body.hc-style.b-theme__template__night .b-content__bubble_rating .b-rating > .current,
body.hc-style.b-theme__template__night .b-post__rating .b-post__rating_layer_current {
filter: grayscale(100%) brightness(200%) !important;
}
body.hc-style .b-content__bubble_rating b {
color: #000;
}
body.hc-style.b-theme__template__night .b-content__bubble_rating b {
color: #fff;
}
body.hc-style .b-post__rating .num {
color: inherit !important;;
}
/* Breadcrumbs */
body.hc-style .b-content__crumbs a {
color: #444;
}
body.hc-style.b-theme__template__night .b-content__crumbs a {
color: #fff;
}
/* Comments */
body.hc-style .b-comment__like_it > i {
display: none;
}
body.hc-style .b-comment__likes_count {
margin: 0 !important;
}
body.hc-style .b-comment__quoteuser,
body.hc-style .b-comment__like_it,
body.hc-style.b-theme__template__night .b-comment__quoteuser,
body.hc-style.b-theme__template__night .b-comment__like_it {
color: #888;
border-color: #888;
}
body.hc-style .b-comment .message > .text {
color: #000;
}
body.hc-style.b-theme__template__night .b-comment .message > .text {
color: #fff;
}
/* Content bubble */
body.hc-style .b-content__bubble_content a {
color: #000;
}
body.hc-style.b-theme__template__night .b-content__bubble_content a {
color: #fff;
}
/* Player translation, season, episode styles */
body.hc-style .b-translators__block {
background: #000;
padding: 5px 10px 0 10px;
}
body.hc-style .b-rgstats__help,
body.hc-style .b-translators__title {
padding-top: 10px;
}
body.hc-style .b-simple_seasons__list,
body.hc-style .b-simple_episodes__list {
margin: 0;
padding: 5px 10px 10px 10px;
}
body.hc-style .b-translator__item,
body.hc-style .b-simple_episode__item,
body.hc-style .b-simple_season__item {
border-radius: 2.3px;
background: rgba(23, 35, 34, .7);
transition: opacity 0.1s linear 0s, background 0.1s linear 0s, transform 0.1s linear 0s;
margin: 5px 5px 0 0;
text-align: center;
// padding: 3px 7px;
}
body.hc-style .b-translator__item:hover,
body.hc-style .b-simple_episode__item:hover,
body.hc-style .b-simple_season__item:hover {
background: rgba(0, 173, 239, .7);
}
body.hc-style .b-translator__item.active,
body.hc-style .b-simple_episode__item.active,
body.hc-style .b-simple_season__item.active {
background: rgba(89, 105, 102, .7) !important;
}
body.hc-style .hc-toggle-translators-button {
margin-top: 10px;
}
/* Misc */
body.hc-style .b-newest_slider__title {
padding-bottom: 20px;
}
/* !css */
`);
settings();
function settings() {
if (hc.settings) {
hc.settings.createTumblerSetting({
name: "styles",
label: "Декоративные изменения",
classes: ["hc-on-of-tumbler"],
options: [
{
class: null,
text: "Выкл",
},
{
class: "hc-style",
text: "Вкл",
default: true,
},
],
});
}
}
}
/* ------------------------------------------------- */
/* --------------PLAYER-COVER----------------------- */
/* ------------------------------------------------- */
function initPlayerCover() {
document.addEventListener("DOMContentLoaded", setup);
settings();
function setup() {
const cover = document.querySelector(".b-sidecover");
if (!cover) return;
const imgURL = cover.querySelector("img").src;
GM_addStyle(`
/* css */
body.hc-player-cover #cdnplayer [style*='hc-poster'] {
background-image:
linear-gradient(
to left,
rgba(0,0,0,1) 0%,
rgba(0,0,0,1) 30%,
rgba(0,0,0,.8) 50%,
rgba(0,0,0,1) 70%,
rgba(0,0,0,1) 100%
),
url('${imgURL}') !important;
background-size: auto 100% !important;
background-position: center !important;
background-repeat: no-repeat !important;
}
/* !css */
`);
}
function settings() {
if (hc.settings) {
hc.settings.createTumblerSetting({
name: "player-cover",
label: "Отображение обложки в плеере",
classes: ["hc-on-of-tumbler"],
options: [
{
class: null,
text: "Выкл",
},
{
class: "hc-player-cover",
text: "Вкл",
default: true,
},
],
});
}
}
}
/* ------------------------------------------------- */
/* --------------HIDE-INFO-------------------------- */
/* ------------------------------------------------- */
function initHideInfo() {
GM_addStyle(`
/* css */
/* Content hide info (button) */
.hc-hide-info-button {
content: '';
width: 25px;
height: 25px;
margin-right: 5px;
background-size: 25px 25px;
background-repeat: no-repeat;
background-image: url(${images.arrow});
cursor: pointer;
}
body.hc-hide-info .hc-hide-info-button {
transform: rotate(180deg);
}
body.hc-hide-info.hc-hide-title .hc-hide-info-button {
margin-top: -15px;
}
/* Content hide info (hidden styles) */
body.hc-hide-info .b-post__origtitle,
body.hc-hide-info .b-post__infotable,
body.hc-hide-info .b-post__description,
body.hc-hide-info .b-post__infolast {
display: none !important;
}
/* Content hide info (night theme) */
body.b-theme__template__night .hc-hide-info-button {
filter: invert(100%) sepia(95%) saturate(21%) hue-rotate(280deg) brightness(106%) contrast(106%);
}
/* !css */
`);
settings();
document.addEventListener("DOMContentLoaded", setup);
function setup() {
const title = document.querySelector(".b-post__title");
if (!title) return;
if (title.querySelector(".hc-hide-info-button")) return;
const button = document.createElement("div");
button.classList.add("pull-right");
button.classList.add("hc-hide-info-button");
button.addEventListener("click", function () {
document.body.classList.toggle("hc-hide-info");
});
title.insertBefore(button, title.firstChild);
}
function settings() {
if (hc.settings) {
hc.settings.createTumblerSetting({
name: "hide-info",
label: "Автоматическое сворачивание описания",
classes: ["hc-on-of-tumbler"],
options: [
{
start: function () {
document.body.classList.remove("hc-hide-info");
},
class: null,
text: "Выкл",
},
{
start: function () {
document.body.classList.add("hc-hide-info");
},
class: "hc-hide-info-enabled",
text: "Вкл",
},
],
});
}
}
}
/* ------------------------------------------------- */
/* --------------HIDE-COMMENTS---------------------- */
/* ------------------------------------------------- */
function initHideComments() {
GM_addStyle(`
/* css */
body.hc-comments-hide #hd-comments-list,
body.hc-comments-hide #hd-comments-navigation {
display: none;
}
.hc-comments-title {
margin-bottom: 13px;
overflow: hidden;
}
.hc-comments-title .title {
font-size: 16px;
font-weight: bold;
line-height: 18px;
overflow: hidden;
padding: 10px 18px;
text-overflow: ellipsis;
white-space: nowrap;
width: 520px;
float: left;
}
.hc-comments-title {
background: #ddd;
}
.hc-comments-title .title {
color: #000;
}
body.b-theme__template__night .hc-comments-title {
background: #192125;
}
body.b-theme__template__night .hc-comments-title .title {
color: #fff;
}
.hc-act {
color: #878586;
cursor: pointer;
float: right;
font-size: 12px;
margin-top: 8px;
margin-right: 18px;
}
.hc-act:hover {
text-decoration: underline;
}
.hc-act-show {
display: none;
}
.hc-act-hide {
display: block;
}
body.hc-comments-hide .hc-act-show {
display: block;
}
body.hc-comments-hide .hc-act-hide {
display: none;
}
body.hc-comments-hide .b-content__crumbs {
margin-top: 30px;
}
/* !css */
`);
settings();
document.addEventListener("DOMContentLoaded", setup);
function setup() {
const commentsList = document.querySelector("#hd-comments-list");
if (!commentsList) return;
const commentsTitle = document.createElement("div");
commentsTitle.classList.add("hc-comments-title");
commentsTitle.addEventListener("click", function () {
document.body.classList.toggle("hc-comments-hide");
});
const title = document.createElement("div");
title.innerText = "Отзывы";
title.classList.add("title");
commentsTitle.appendChild(title);
const actShow = document.createElement("div");
actShow.classList.add("hc-act");
actShow.classList.add("hc-act-show");
actShow.innerText = "развернуть";
commentsTitle.appendChild(actShow);
const actHide = document.createElement("div");
actHide.classList.add("hc-act");
actHide.classList.add("hc-act-hide");
actHide.innerText = "свернуть";
commentsTitle.appendChild(actHide);
commentsList.parentNode.insertBefore(commentsTitle, commentsList);
}
function settings() {
if (hc.settings) {
hc.settings.createTumblerSetting({
name: "comments-hide",
label: "Автоматическое сворачивание отзывов",
classes: ["hc-on-of-tumbler"],
options: [
{
start: function () {
document.body.classList.remove("hc-comments-hide");
},
class: null,
text: "Выкл",
},
{
start: function () {
document.body.classList.add("hc-comments-hide");
},
class: "hc-comments-hide-enabled",
text: "Вкл",
},
],
});
}
}
}
/* ------------------------------------------------- */
/* --------------TRANSLATORS------------------------ */
/* ------------------------------------------------- */
function initHideTranslators() {
GM_addStyle(`
/* css */
/* Content hide translators */
.hc-translators-hide-enabled .b-translator__item.active {
cursor: pointer;
}
.hc-translators-hide-enabled .hc-toggle-translators-button {
content: '';
float: left;
width: 20px;
height: 20px;
margin-right: 3px;
margin-top: 8px;
margin-left: 5px;
background-size: 20px 20px;
background-repeat: no-repeat;
background-image: url(${images.arrow});
filter: invert(100%) sepia(95%) saturate(21%) hue-rotate(280deg) brightness(106%) contrast(106%);
transform: rotate(90deg);
cursor: pointer;
}
.hc-translators-hide-enabled .hc-show-translators .hc-toggle-translators-button {
transform: rotate(-90deg);
}
.hc-translators-hide-enabled .b-translator__item:not(.active):not(.hc-toggle-translators-button) {
display: none;
}
.hc-translators-hide-enabled .b-translators__title {
display: none;
}
.hc-translators-hide-enabled .hc-show-translators .b-translator__item:not(.active):not(.hc-toggle-translators-button) {
display: block;
}
.hc-translators-hide-enabled .hc-show-translators .b-translators__title {
display: block;
}
/* !css */
`);
settings();
document.addEventListener("DOMContentLoaded", setup);
function setup() {
function toggle() {
document.querySelector(".b-translators__block").classList.toggle("hc-show-translators");
}
const translators = document.querySelector(".b-translators__block");
if (!translators) return;
const translatorsList = translators.querySelector(".b-translators__list");
if (!translatorsList) return;
const toggler = document.createElement("li");
toggler.classList.add("hc-toggle-translators-button");
toggler.addEventListener("click", toggle);
translatorsList.appendChild(toggler);
translatorsList.querySelectorAll(".b-translator__item").forEach(function (button) {
button.addEventListener("click", function () {
if (this.classList.contains("active")) {
toggle();
}
});
});
}
function settings() {
if (hc.settings) {
hc.settings.createTumblerSetting({
name: "translators",
label: "Автоматическое сворачивание списка переводов",
classes: ["hc-on-of-tumbler"],
options: [
{
class: null,
text: "Выкл",
},
{
class: "hc-translators-hide-enabled",
text: "Вкл",
},
],
});
}
}
}
/* ------------------------------------------------- */
/* --------------IMDB-RATING------------------------ */
/* ------------------------------------------------- */
function initIMDbRating() {
GM_addStyle(`
/* css */
/* Rating */
.b-content__inline_item-link > .rating {
display: none;
}
body.hc-imdb .b-content__inline_item-link > .rating {
display: block;
}
.b-content__inline_item-link > .rating {
position: relative;
line-height: 15px;
font-size: 11px;
font-weight: normal;
margin-top: 3px;
}
.b-content__inline_item-link > .rating .rating-votes {
font-size: 9px;
}
.b-content__inline_item-link > .rating .rating-value {
margin-left: 29px;
color: #f09a20;
}
.b-content__inline_item-link > .rating:before {
content: '';
position: absolute;
width: 26px;
height: 100%;
background-size: auto 24px;
background-position: center -4px;
background-repeat: no-repeat;
background-image: url(${images.imdb});
/* https://codepen.io/sosuke/pen/Pjoqqp */
filter: invert(66%) sepia(77%) saturate(1448%) hue-rotate(347deg) brightness(99%) contrast(91%);
}
/* !css */
`);
settings();
function setWithExpiry(key, value, ttl) {
const now = new Date();
// `item` is an object which contains the original value
// as well as the time when it's supposed to expire
const item = {
value: value,
expiry: now.getTime() + ttl,
};
localStorage.setItem(key, JSON.stringify(item));
}
function getWithExpiry(key) {
const itemStr = localStorage.getItem(key);
// if the item doesn't exist, return null
if (!itemStr) {
return null;
}
const item = JSON.parse(itemStr);
const now = new Date();
// compare the expiry time of the item with the current time
if (now.getTime() > item.expiry) {
// If the item is expired, delete the item from storage
// and return null
localStorage.removeItem(key);
return null;
}
return item.value;
}
function getRating(id) {
return new Promise(function (resolve) {
console.debug(`HDrezka Improvement IMDB Rating: request quick content for id=${id}.`);
GM_xmlhttpRequest({
method: "POST",
url: "/engine/ajax/quick_content.php",
data: `id=${id}&is_touch=1`,
headers: {
"Content-Type": "application/x-www-form-urlencoded",
},
onload: function (response) {
// One weak ttl in ms
const ttl = 7 * 24 * 60 * 60 * 1000;
if (response.status === 200) {
// Is 200 status code
// Find IMDb block
const ratingHTML = /<span class="imdb">IMDb: <b>.{1,60}\)<\/i><\/span>/.exec(
response.responseText
);
if (ratingHTML) {
// IMDb block found
try {
// Get actual rating
const rating = /(<b>)(.*)(<\/b>)/.exec(ratingHTML[0])[2];
// Get actual votes count
const votes = /(<i>)\((.*)\)(<\/i>)/.exec(ratingHTML[0])[2];
// Save real rating to Storage
// Resolve with real rating
const data = {
rating: rating,
votes: votes,
id: id,
};
setWithExpiry(id, data, ttl);
resolve(data);
console.debug(
`HDrezka Improvement IMDB Rating: request quick content for id=${id} success.`
);
return;
} catch (err) {
console.debug(err);
}
}
// IMDb block not found
// Save empty rating to storage to not make new request in next page load
// Resolve with empty rating
const data = { rating: "", votes: "", id: id };
setWithExpiry(id, data, ttl);
resolve(data);
console.debug(
`HDrezka Improvement IMDB Rating: request quick content for id=${id} success, but no correct data found.`
);
} else {
console.debug(
`HDrezka Improvement IMDB Rating: request quick content for id=${id} failed with ${response.status} status code.`
);
// Isn't 200 status code
// Don't save any rating so it will be requsted again in next page load
// Resolve with null rating
resolve({ rating: null, votes: null, id: id });
}
},
onerror: function () {
console.debug(`HDrezka Improvement IMDB Rating: request quick content for id=${id} failed.`);
// Request failed
// Don't save any rating so it will be requsted again in next page load
// Resolve with null rating
resolve({ rating: null, votes: null, id: id });
},
});
});
}
function showRating(ratingObject) {
if (
ratingObject &&
ratingObject.id !== null &&
ratingObject.rating !== null &&
ratingObject.rating !== ""
) {
// Got rating
// Find related elements to append rating
document
.querySelectorAll(`[data-id="${ratingObject.id}"] .b-content__inline_item-link`)
.forEach(function (contentItemLinkElement) {
// Check rating wasn't already appended
if (contentItemLinkElement && !contentItemLinkElement.querySelector(".rating")) {
// Append rating block
let votesText;
try {
votesText = `${parseInt(parseInt(ratingObject.votes.replace(/\s/g, "")) / 1000)}k`;
} catch (err) {
console.debug(err);
votesText = "";
}
contentItemLinkElement.innerHTML +=
/* html */
`
<!-- html -->
<span class="rating">
<span class="rating-value"><b>${ratingObject.rating}</b></span>
<span> / </span>
<span class="rating-votes">${votesText}</span>
</span>
<!-- !html -->
`;
}
});
}
}
function getAndShowRating(contentItemElement) {
const id = contentItemElement.dataset.id;
const ratingObject = getWithExpiry(id);
if (
ratingObject !== null &&
ratingObject.id != null &&
ratingObject.rating != null &&
ratingObject.votes != null
) {
// Found vaid saved rating in storage
// Show rating from storage
return showRating(ratingObject);
}
// Rating not found in storage
// Request rating and then show
return getRating(id).then(showRating);
}
function settings() {
if (hc.settings) {
hc.settings.createTumblerSetting({
name: "imdb",
label: "Добавление рейтинга IMDb в списке контента",
classes: ["hc-on-of-tumbler"],
options: [
{
class: null,
text: "Выкл",
},
{
end: function () {
document.querySelectorAll(".b-content__inline_item").forEach(getAndShowRating);
},
class: "hc-imdb",
text: "Вкл",
},
],
});
}
}
}
/* ------------------------------------------------- */
/* --------------HOTKEYS---------------------------- */
/* ------------------------------------------------- */
function initHotkeys() {
const HELP_TOOLTIP =
/* html */
`
<!-- html -->
<span class="hc-tooltip" style="float: right;">
<span class="hc-tooltip-icon">i</span>
<div class="tooltiptext">
<div>Список горячих клавиш</div>
<ul style="margin-top: 15px;">
<li style="margin-top: 5px;">ПРОБЕЛ - Плей/Пауза</li>
<li style="margin-top: 5px;">F - Полноэкранный режим</li>
<li style="margin-top: 5px;">N - Следующий эпизод</li>
<li style="margin-top: 5px;">P - Предыдущий эпизод</li>
</ul>
<div style="margin-top: 15px;">
<small>
В отличии от оригинальных работают с
разу полсле загрузки страницы.
В том числе когда плеер не в фокусе
или был не в фокусе на момент перевода
в полноэкранный режим.
</small>
</div>
</div>
</div>
<!-- !html -->
`;
function setup() {
function anyActiveInput() {
const inputs = document.querySelectorAll("input,textarea");
return Array.from(inputs).includes(document.activeElement);
}
document.addEventListener("keyup", function (e) {
if (!anyActiveInput()) {
switch (e.code) {
case "KeyF":
hc.player.enterfullscreen();
e.preventDefault();
break;
}
}
});
document.addEventListener("keydown", function (e) {
if (!anyActiveInput()) {
switch (e.code) {
case "KeyN":
hc.player.next();
e.preventDefault();
break;
case "KeyP":
hc.player.prev();
e.preventDefault();
break;
case "Space":
hc.player.toggle();
e.preventDefault();
break;
}
}
});
}
settings();
function settings() {
if (hc.settings) {
const tumblerSetting = hc.settings.buildTumblerSetting({
name: "hotkeys",
label: `Улучшеные горячие клавиши`,
classes: ["hc-on-of-tumbler"],
options: [
{
class: null,
text: "Выкл",
reload: true,
},
{
end: setup,
class: "hc-hotkeys-enabled",
text: "Вкл",
default: true,
reload: true,
},
],
});
const tooltip = document.createElement("div");
tooltip.innerHTML = HELP_TOOLTIP;
tumblerSetting.appendChild(tooltip);
hc.settings.addElementSetting(tumblerSetting);
}
}
}
/* ------------------------------------------------- */
/* --------------HIDE-RUSSIAN----------------------- */
/* ------------------------------------------------- */
function initHideRussian() {
GM_addStyle(`
/* css */
/* Main */
.hc-hide-russian .hc-russian {
display: none;
}
/* !css */
`);
document.addEventListener("DOMContentLoaded", setup);
settings();
function setup() {
document.querySelectorAll(".b-content__inline_item").forEach(function (elem) {
if (elem.textContent.includes("Россия,") && !elem.classList.contains("hc-russian")) {
elem.classList.add("hc-russian");
const info = elem
.querySelector(".b-content__inline_item-link")
.textContent.replace(/(\r\n|\n|\r)/gm, "")
.trim();
console.debug(`HDrezka Improvement: mark russian ${info}`);
}
});
}
function settings() {
if (hc.settings) {
hc.settings.createTumblerSetting({
name: "hide-russian",
label: "Скрытие контента из страны-агрессора",
classes: ["hc-on-of-tumbler"],
options: [
{
class: null,
text: "Выкл",
},
{
class: "hc-hide-russian",
text: "Вкл",
},
],
});
}
}
}
/* ------------------------------------------------- */
/* --------------SETTINGS--------------------------- */
/* ------------------------------------------------- */
function initSettings() {
GM_addStyle(`
/* css */
/* Settings */
.hc-settings {
position: relative;
}
/* Tumbler */
.hc-tumbler {
width: 38px;
height: 30px;
background-color: #000;
border: #1d92b2;
border-radius: 30px;
display: flex;
justify-content: space-between;
align-items: center;
padding: 0 6px;
cursor: pointer;
position: relative;
user-select: none;
}
.hc-tumbler-point {
border-radius: 50%;
content: '';
display: block;
height: 20px;
width: 20px;
background-color: #999;
background-clip: content-box;
box-sizing: border-box;
border-color: transparent;
border-style: solid;
border-width: 5px;
}
.hc-tumbler > .hc-tumbler-dot {
position: absolute;
height: 20px;
width: 20px;
border-radius: 50%;
background-color: #fff;
transition: transform .5s,background-color .5s;
will-change: transform;
}
body.b-theme__template__night .hc-tumbler {
background: #222d33;
}
/* On-Off Tumbler */
.hc-on-of-tumbler .hc-tumbler-point:nth-child(1) {
background-color: green;
}
.hc-on-of-tumbler .hc-tumbler-point:nth-child(2) {
background-color: indianred;
}
/* Settings */
.hc-settings > ul {
width: 450px;
display: none;
background: #313131;
border-top: 0;
position: absolute;
top: 50px;
left: 0px;
white-space: nowrap;
box-shadow: 0 5px 20px 0px #000;
border-color: #222d33;
border-style: solid;
border-width: 3px 3px 3px 3px;
padding: 5px 0;
}
.hc-settings > ul:before {
content: '';
display: block;
position: absolute;
top: -13px;
left: 20px;
width: 0;
height: 0;
border-left: 10px solid transparent;
border-right: 10px solid transparent;
border-bottom: 10px solid #222d33;
}
.hc-settings > ul:after {
content: '';
display: block;
position: absolute;
top: -9px;
left: 21px;
width: 0;
height: 0;
border-left: 9px solid transparent;
border-right: 9px solid transparent;
border-bottom: 9px solid #313131;
}
body.b-theme__template__night .hc-settings > ul:after {
border-bottom-color: #060f13;
}
body.hc-settings-active .hc-settings > ul {
display: block !important;
}
.hc-settings > ul > li {
color: #777;
font-size: 10px;
font-weight: bold;
margin: 0 !important;
padding: 5px 10px;
min-height: 30px;
}
.hc-settings > ul > li .hc-setting {
display: inline-block;
width: 100%;
}
.hc-settings > ul > li .hc-tumbler {
float: right;
}
.hc-settings .hc-setting-header {
text-align: center;
}
.hc-settings .hc-setting-text-value {
display: block;
opacity: .5;
}
.hc-settings .hc-setting-text-block {
float: left;
position: relative;
padding-top: 5px;
}
body.b-theme__template__night .hc-settings > ul {
background: #060f13;
}
/* Settings tumbler */
.hc-tumbler-settings {
margin-top: 5px;
margin-left: 10px;
}
.hc-tumbler-settings .hc-tumbler-point {
background-size: 15px 15px;
background-repeat: no-repeat;
background-position: center;
border-width: 2px;
}
.hc-tumbler-settings .hc-tumbler-point:nth-child(1) {
background-image: url('${images.settings}');
background-color: transparent !important;
}
.hc-tumbler-settings .hc-tumbler-point:nth-child(2) {
background-image: url('${images.settingsclose}');
background-color: transparent !important;
}
.hc-tumbler-settings-update,
.hc-tumbler-settings-update:hover {
height: 30px;
background: #f4363630;
position: absolute;
left: 0;
margin-left: 30px;
margin-top: 5px;
border-radius: 30px;
color: #b44b44 !important;
line-height: 30px;
padding: 0 20px 0 40px;
cursor: pointer;
text-decoration: none;
}
/* Tooltip */
.hc-tooltip {
position: relative;
display: inline-block;
border-bottom: 1px dotted black;
}
.hc-tooltip .tooltiptext {
background: #313131;
border-top: 0;
position: absolute;
top: -10px;
left: 35px;
white-space: nowrap;
box-shadow: 0 5px 20px 0px #000;
border-color: #222d33;
border-style: solid;
border-width: 3px;
visibility: hidden;
width: 300px;
white-space: normal;
padding: 15px;
position: absolute;
z-index: 3;
}
body.b-theme__template__night .hc-tooltip .tooltiptext {
background: #060f13;
}
.hc-tooltip:hover .tooltiptext {
visibility: visible;
}
.hc-tooltip .tooltiptext:before {
content: '';
display: block;
position: absolute;
left: -13px;
top: 11px;
width: 0;
height: 0;
border-top: 10px solid transparent;
border-bottom: 10px solid transparent;
border-right: 10px solid #222d33;
}
.hc-tooltip .tooltiptext:after {
content: '';
display: block;
position: absolute;
left: -9px;
top: 12px;
width: 0;
height: 0;
border-top: 9px solid transparent;
border-bottom: 9px solid transparent;
border-right: 9px solid #222d33;
}
body.b-theme__template__night .hc-tooltip .tooltiptext:after {
border-right-color: #060f13;
}
.hc-tooltip-icon {
border-radius: 50%;
background: #777;
width: 14px;
height: 14px;
display: inline-block;
text-align: center;
color: #000;
text-transform: lowercase;
cursor: pointer;
font-family: monospace, monospace;
font-size: 13px;
margin: 8px;
}
*/
/* !css */
`);
hc.settings = {};
hc.settings.buildTumblerSetting = buildTumblerSetting;
hc.settings.createTumblerSetting = createTumblerSetting;
hc.settings.addElementSetting = addElementSetting;
hc.settings.setSetting = setSetting;
hc.settings.getSetting = getSetting;
const SETTINGS_NAME = "hc-settings";
const DEFAULT_SETTING = "";
const SCRIPT_HOMEPAGE = "https://gf.qytechs.cn/en/scripts/425494";
setup();
document.addEventListener("DOMContentLoaded", add);
function setSetting(name, value) {
const settingsStr = localStorage.getItem(SETTINGS_NAME);
let settings = settingsStr !== null ? JSON.parse(settingsStr) : {};
settings[name] = value;
localStorage.setItem(SETTINGS_NAME, JSON.stringify(settings));
}
function getSetting(name) {
const settingsStr = localStorage.getItem(SETTINGS_NAME);
const settings = settingsStr !== null ? JSON.parse(settingsStr) : {};
let setting = settings[name];
return setting !== undefined ? setting : null;
}
function setCongigSetting(config, option) {
const value = option.class !== null ? option.class : DEFAULT_SETTING;
setSetting(config.name, value);
}
function getConfigSetting(config) {
return getSetting(config.name);
}
function getDefaultOption(config) {
for (let optionIndex = 0; optionIndex < config.options.length; optionIndex++) {
const tumblerOption = config.options[optionIndex];
if (tumblerOption.default === true) {
return tumblerOption;
}
}
}
function setBodyClass(config, option) {
for (let optionIndex = 0; optionIndex < config.options.length; optionIndex++) {
const tumblerOption = config.options[optionIndex];
if (tumblerOption.class !== null) {
document.body.classList.remove(tumblerOption.class);
}
}
if (option && option.class) {
document.body.classList.add(option.class);
}
}
function getNextOption(config, option) {
let nextOptionIndex;
if (option) {
const currentOptionIndex = config.options.indexOf(option);
if (currentOptionIndex < config.options.length - 1) {
nextOptionIndex = currentOptionIndex + 1;
} else {
nextOptionIndex = 0;
}
} else {
nextOptionIndex = 1;
}
return config.options[nextOptionIndex];
}
function getCurrentOption(config) {
const currentSetting = getConfigSetting(config);
if (currentSetting != null) {
for (let optionIndex = 0; optionIndex < config.options.length; optionIndex++) {
const tumblerOption = config.options[optionIndex];
const optionSetting = tumblerOption.class !== null ? tumblerOption.class : DEFAULT_SETTING;
if (optionSetting === currentSetting) {
return tumblerOption;
}
}
}
const option = getDefaultOption(config);
if (option) {
setCongigSetting(config, option);
return option;
} else {
setCongigSetting(config, { class: DEFAULT_SETTING });
}
}
function rotateSetting(config) {
const currentOption = getCurrentOption(config);
const nextOption = getNextOption(config, currentOption);
setCongigSetting(config, nextOption);
setBodyClass(config, nextOption);
if (nextOption.reload === true) {
document.location.reload();
}
if (nextOption.start) {
nextOption.start();
}
if (nextOption.end) {
nextOption.end();
}
}
function initSetting(config) {
const currentOption = getCurrentOption(config);
setBodyClass(config, currentOption);
if (currentOption && currentOption.start) {
currentOption.start();
}
if (currentOption && currentOption.end) {
document.addEventListener("DOMContentLoaded", currentOption.end);
}
}
var settings;
function add() {
const tophead = document.querySelector(".b-tophead-left");
if (!tophead) return;
tophead.appendChild(settings);
}
function setup() {
settings = buildTumbler({
handler: toggle,
name: "settings",
classes: [],
options: [
{
class: null,
},
{
class: "hc-settings-active",
},
],
});
settings.classList.add("hc-settings");
settings.classList.add("pull-left");
const dropdown = document.createElement("ul");
settings.appendChild(dropdown);
const item = document.createElement("div");
item.classList.add("hc-setting-header");
const name = document.createElement("div");
name.classList.add("hc-setting-label");
name.innerHTML = `<a href="${SCRIPT_HOMEPAGE}">${GM_info.script.name}</a>`;
const feedback = document.createElement("div");
feedback.classList.add("hc-setting-text-value");
feedback.innerHTML = `<a href="${SCRIPT_HOMEPAGE}/feedback">Отзывы и предложения</a>`;
const version = document.createElement("div");
version.classList.add("hc-setting-text-value");
version.innerHTML = `Версия: ${GM_info.script.version}`;
GM_xmlhttpRequest({
method: "GET",
url: SCRIPT_HOMEPAGE,
onload: function (response) {
console.debug(response);
if (response.status === 200) {
const tmpDiv = document.createElement("div");
tmpDiv.innerHTML = response.responseText;
const link = tmpDiv.querySelector(".install-link");
const ver = link.getAttribute("data-script-version");
if (ver != GM_info.script.version) {
let updateURL = new URL(SCRIPT_HOMEPAGE);
updateURL.pathname = link.getAttribute("href");
const updateTumbler = document.createElement("a");
updateTumbler.href = updateURL;
updateTumbler.classList.add("hc-tumbler-settings-update");
updateTumbler.innerText = "Обновить";
settings.insertBefore(updateTumbler, settings.firstChild);
}
}
},
onerror: function (e) {},
});
item.appendChild(name);
item.appendChild(feedback);
item.appendChild(version);
addElementSetting(item);
document.addEventListener("click", close);
}
function toggle(event) {
document.body.classList.toggle("hc-settings-active");
event.stopPropagation();
}
function close(event) {
if (!event.target.closest(".hc-settings")) {
document.body.classList.remove("hc-settings-active");
}
}
function addElementSetting(element) {
const dropdown = settings.querySelector("ul");
const item = document.createElement("li");
item.appendChild(element);
dropdown.appendChild(item);
}
function buildTumbler(config) {
const optionsLength = config.options.length;
const tumblerClassName = "hc-tumbler-" + config.name;
GM_addStyle(`
/* css */
.${tumblerClassName} {
width: ${optionsLength * 15 + optionsLength * 5}px !important;
}
/* !css */
`);
const tumblerWrapper = document.createElement("div");
tumblerWrapper.classList.add("hc-tumbler-wrapper");
const tumbler = document.createElement("div");
tumbler.classList.add("hc-tumbler");
tumbler.classList.add(tumblerClassName);
tumbler.className += " " + config.classes.join(" ");
tumbler.addEventListener("click", config.handler);
for (let optionIndex = 0; optionIndex < optionsLength; optionIndex++) {
const tumblerOption = config.options[optionIndex];
const tumblerPoint = document.createElement("div");
tumblerPoint.classList.add("hc-tumbler-point");
tumbler.appendChild(tumblerPoint);
if (tumblerOption.class !== null) {
// Add dot move style for all points except initial
const enabledClassName = tumblerOption.class;
GM_addStyle(`
/* css */
.${enabledClassName} .${tumblerClassName} .hc-tumbler-dot {
transform: translateX(${optionIndex * 100}%);
}
/* !css */
`);
}
}
const tumblerDot = document.createElement("div");
tumblerDot.classList.add("hc-tumbler-dot");
tumbler.appendChild(tumblerDot);
tumblerWrapper.appendChild(tumbler);
return tumblerWrapper;
}
function buildTumblerSetting(config) {
initSetting(config);
const originalHandler = config.handler;
function handler(event) {
rotateSetting(config);
if (originalHandler) {
originalHandler(event);
}
}
config.handler = handler;
const tumblerWrapper = buildTumbler(config);
tumblerWrapper.classList.add("hc-setting");
const settingClass = "hc-setting-" + config.name;
tumblerWrapper.classList.add(settingClass);
const settingTextBlock = document.createElement("div");
settingTextBlock.classList.add("hc-setting-text-block");
const labelSpan = document.createElement("span");
labelSpan.classList.add("hc-setting-label");
labelSpan.innerHTML = config.label;
settingTextBlock.appendChild(labelSpan);
const optionsLength = config.options.length;
let defaultSelectors = [];
for (let tumblerIndex = 0; tumblerIndex < optionsLength; tumblerIndex++) {
const tumplerOption = config.options[tumblerIndex];
if (tumplerOption.class !== null) {
defaultSelectors.push(`body.${tumplerOption.class} .${settingClass} .hc-setting-text-value-1`);
}
}
for (let optionIndex = 0; optionIndex < optionsLength; optionIndex++) {
const tumplerOption = config.options[optionIndex];
const textValueClass = "hc-setting-text-value-" + (optionIndex + 1);
const textValueSpan = document.createElement("span");
textValueSpan.classList.add("hc-setting-text-value");
textValueSpan.classList.add(textValueClass);
textValueSpan.innerHTML = tumplerOption.text;
settingTextBlock.appendChild(textValueSpan);
if (optionIndex == 0) {
GM_addStyle(`
/* css */
${defaultSelectors.join(",")} {
display: none !important;
}
/* !css */
`);
} else {
const enabledClassName = tumplerOption.class;
GM_addStyle(`
/* css */
body:not(.${enabledClassName}) .${settingClass} .${textValueClass} {
display: none !important;
}
/* !css */
`);
}
}
tumblerWrapper.appendChild(settingTextBlock);
return tumblerWrapper;
}
function createTumblerSetting(config) {
const tumblerSetting = buildTumblerSetting(config);
addElementSetting(tumblerSetting);
}
}
})();