VK no reactions

Removes reactions from vk.com

Dovrai installare un'estensione come Tampermonkey, Greasemonkey o Violentmonkey per installare questo script.

You will need to install an extension such as Tampermonkey to install this script.

Dovrai installare un'estensione come Tampermonkey o Violentmonkey per installare questo script.

Dovrai installare un'estensione come Tampermonkey o Userscripts per installare questo script.

Dovrai installare un'estensione come ad esempio Tampermonkey per installare questo script.

Dovrai installare un gestore di script utente per installare questo script.

(Ho già un gestore di script utente, lasciamelo installare!)

Dovrai installare un'estensione come ad esempio Stylus per installare questo stile.

Dovrai installare un'estensione come ad esempio Stylus per installare questo stile.

Dovrai installare un'estensione come ad esempio Stylus per installare questo stile.

Dovrai installare un'estensione per la gestione degli stili utente per installare questo stile.

Dovrai installare un'estensione per la gestione degli stili utente per installare questo stile.

Dovrai installare un'estensione per la gestione degli stili utente per installare questo stile.

(Ho già un gestore di stile utente, lasciamelo installare!)

// ==UserScript==
// @name         VK no reactions
// @name:ru      Вконтакте без реакций
// @namespace    http://tampermonkey.net/
// @version      0.6
// @description  Removes reactions from vk.com
// @description:ru  Убирает реакции с сайта vk.com и возвращает обычные лайки
// @author       dark1103
// @match        https://vk.com/*
// @icon         https://www.google.com/s2/favicons?domain=vk.com
// @grant        none
// @require http://code.jquery.com/jquery-3.4.1.min.js
// @license MIT
// ==/UserScript==


(function() {
    'use strict';

    function modify_likes(){
        $('[data-section-ref="reactions-menu-mount"]').remove();
        $('.post_content:not(.like_fixed)').each(function(){
            $(this).addClass('like_fixed');
            var likes = $(this).find('.ReactionsPreview');
            likes.find('.ReactionsPreview__items').hide();
            var container = $(this).find('.PostButtonReactions');

            var likes_count = $(this).find('.PostBottomActionExtraReactionsPreview');
            var like_icon = $(this).find('._like_button_icon:nth(0)');

            var array = $(likes_count).find('.ReactionsPreview').toArray();

            for(var i = 0;i < array.length;i++){
                array[i].onclick = undefined;
            }

            $(likes_count).insertAfter(like_icon);
            $('._like_button_label').hide();
        });
    }
    modify_likes();

    $('body').on('DOMNodeInserted', '#content', function(e) {
        //console.log(e);
        if(e.target.classList.contains('feed_row') || e.target.classList.contains('post_content')){
            modify_likes();
        }
    });

})();