Torn - Less Cluttered Forums

try to take over the world!

ही स्क्रिप्ट इंस्टॉल करण्यासाठी तुम्हाला Tampermonkey, Greasemonkey किंवा Violentmonkey यासारखे एक्स्टेंशन इंस्टॉल करावे लागेल.

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

ही स्क्रिप्ट इंस्टॉल करण्यासाठी तुम्हाला Tampermonkey किंवा Violentmonkey यासारखे एक्स्टेंशन इंस्टॉल करावे लागेल..

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

ही स्क्रिप्ट इंस्टॉल करण्यासाठी तुम्हाला Tampermonkey यासारखे एक्स्टेंशन इंस्टॉल करावे लागेल..

ही स्क्रिप्ट इंस्टॉल करण्यासाठी तुम्हाला एक युझर स्क्रिप्ट व्यवस्थापक एक्स्टेंशन इंस्टॉल करावे लागेल.

(माझ्याकडे आधीच युझर स्क्रिप्ट व्यवस्थापक आहे, मला इंस्टॉल करू द्या!)

ही स्टाईल इंस्टॉल करण्यासाठी तुम्हाला Stylus सारखे एक्स्टेंशन इंस्टॉल करावे लागेल.

ही स्टाईल इंस्टॉल करण्यासाठी तुम्हाला Stylus सारखे एक्स्टेंशन इंस्टॉल करावे लागेल.

ही स्टाईल इंस्टॉल करण्यासाठी तुम्हाला Stylus सारखे एक्स्टेंशन इंस्टॉल करावे लागेल.

ही स्टाईल इंस्टॉल करण्यासाठी तुम्हाला एक युझर स्टाईल व्यवस्थापक इंस्टॉल करावे लागेल.

ही स्टाईल इंस्टॉल करण्यासाठी तुम्हाला एक युझर स्टाईल व्यवस्थापक इंस्टॉल करावे लागेल.

ही स्टाईल इंस्टॉल करण्यासाठी तुम्हाला एक युझर स्टाईल व्यवस्थापक इंस्टॉल करावे लागेल.

(माझ्याकडे आधीच युझर स्टाईल व्यवस्थापक आहे, मला इंस्टॉल करू द्या!)

// ==UserScript==
// @name         Torn - Less Cluttered Forums
// @author       Xiphias[187717]
// @namespace    https://greasyfork.org/users/3898
// @version      1.0
// @include      *torn.com/forums.php*
// @description  try to take over the world!
// @grant        none
// ==/UserScript==

$( document ).ajaxComplete(function( event, xhr, settings ) {
    if ( settings.url.search(/forums.php.*/) === 0) {
        var forum_header = $('.forums-committee');

        var header_rating = forum_header.find('.rating');
        var header_rating_width = header_rating.outerWidth();

        var header_thread_name = forum_header.find('.thread-name');

        var header_thread_name_width = header_thread_name.width();
        header_thread_name.width(header_thread_name_width + header_rating_width);


        // Remove ratings on main forum page
        header_rating.remove();
        $('.threads-list').find('.rating').remove();

        if (settings.data.search('&f=19&') < 0) { // If not bugs forum
            $('.threads-list').find('> li').each(function() {
                var li = $(this);
                var thread_name = li.find('.thread-name');
                var thread_pages = li.find('.thread-pages');
                var new_max_width;
                if (thread_pages.length > 0) { // exists
                    thread_pages.removeClass('left');
                    thread_pages.addClass('right');
                    thread_pages.css('margin-right', '10px');
                    new_max_width = 400 - thread_pages.outerWidth() + 'px';
                } else {
                    new_max_width = '400px';
                }
                thread_name.css('max-width', new_max_width);

            });
        }

        if (settings.data.search('&f=19&') >= 0) { // Is bugs forum
            $('.threads-list').find('> li').each(function() {
                var li = $(this);
                var thread_name = li.find('.thread-name');
                var thread_pages = li.find('.thread-pages');
                var new_max_width;
                if (thread_pages.length > 0) { // exists
                    thread_pages.removeClass('left');
                    thread_pages.addClass('right');
                    thread_pages.css('margin-right', '8px');
                    new_max_width = 300 - thread_pages.outerWidth() + 'px';
                } else {
                    new_max_width = '300px';
                }
                thread_name.css('max-width', new_max_width);

            });
        }



        // remove rating values
        $('.like.forum-button').find('.value').remove();
        $('.dislike.forum-button').find('.value').remove();

        // remove rating dashboard on main forum
        var dashboard_rating = $('.dashboard.rating');
        var karma_rating_text = dashboard_rating.find('.title-black').html();
        if(typeof karma_rating_text !== 'undefined') {
            karma_rating_text = karma_rating_text.replace(/Karma Rating/g, 'Post Count');
            dashboard_rating.find('.title-black').html(karma_rating_text);
            dashboard_rating.find('.rating').remove();
        }

        // change feed
        var feed = $('#feed-threads');
        var fm_list = feed.find('.panel.fm-list');

        fm_list.find('.like-icon').remove();
        fm_list.find('.dislike-icon').remove();

        var feedbacks = fm_list.find('.post-wrap');
        feedbacks.each(function() {
            var feedback_text = $(this).html();

            feedback_text = feedback_text.replace(/(dis)?liked your post/g, 'reacted to your post');
            $(this).html(feedback_text);
        });

        // Popular threads
        var popular_threads = $('#pop-threads');
        if(typeof popular_threads !== 'undefined') {
            popular_threads.find('.like-wrap').remove();
            popular_threads.find('.dislike-wrap').remove();
        }

        var poster_wrap_left = $('.poster-wrap.left');
        poster_wrap_left.find('.karma').remove();

    }
});