FXP CheckMark

try to take over the world!

Bu betiği kurabilmeniz için Tampermonkey, Greasemonkey ya da Violentmonkey gibi bir kullanıcı betiği eklentisini kurmanız gerekmektedir.

Bu betiği kurabilmeniz için Tampermonkey ya da Violentmonkey gibi bir kullanıcı betiği eklentisini kurmanız gerekmektedir.

Bu betiği kurabilmeniz için Tampermonkey ya da Violentmonkey gibi bir kullanıcı betiği eklentisini kurmanız gerekmektedir.

Bu betiği kurabilmeniz için Tampermonkey ya da Userscripts gibi bir kullanıcı betiği eklentisini kurmanız gerekmektedir.

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

Bu komut dosyasını yüklemek için bir kullanıcı komut dosyası yöneticisi uzantısı yüklemeniz gerekecek.

(Zaten bir kullanıcı komut dosyası yöneticim var, kurmama izin verin!)

You will need to install an extension such as Stylus to install this style.

You will need to install an extension such as Stylus to install this style.

You will need to install an extension such as Stylus to install this style.

You will need to install a user style manager extension to install this style.

You will need to install a user style manager extension to install this style.

You will need to install a user style manager extension to install this style.

(Zateb bir user-style yöneticim var, yükleyeyim!)

// ==UserScript==
// @name         FXP CheckMark
// @namespace    http://tampermonkey.net/
// @version      0.3
// @description  try to take over the world!
// @author       You
// @match        https://www.fxp.co.il/forumdisplay.php?*
// @grant        none
// ==/UserScript==

(function() {
    'use strict';
    if(isAdmin()){
        var threads = $("#threads").find('.threadbit');//Looking for the threads div holder ('Threads' ID)
        threads.each(function(){//For each thread that it finds, And appending it the 'Check' mark
            var text = $(this).find('.title').text();
            if(!text.includes("⁦✔️")){
                $(this).append('<span class="check_thread" style="color:green; font-size: 1.4em; position: absolute; right: -20px; top: 15px;">⁦⁦✔️</span>');
            }
        });
    }
})();

$(".check_thread").click(function(){//Whenever this class (The 'Check' mark element) is clicked it will fire the following line
    var title = $(this).parent().find('.title');//Looking for the title class that is attached to the 'Check' mark element
    $(this).remove();//Removing the 'Check' mark after clicking it
    checkThread(title);//Firing this function
});

function checkThread(title){
    var dblEvent = new MouseEvent('dblclick', {//Creating double click event
        'view': window,
        'bubbles': true,
        'cancelable': true
    });
    title.html("[⁦⁦✔️] -- " + title.text());//Changing the current title's text
    title.parent()[0].dispatchEvent(dblEvent);//Firing the double click event to the title

    vB_ThreadTitle_Editor = new vB_AJAX_TitleEdit(title[0]);//Runing the FXP function for sending the data to the server of the title's text
    vB_ThreadTitle_Editor.save(title.text());
    vB_ThreadTitle_Editor.restore();
}

function isAdmin(){
    if($(".threadimod").length > 0 ){//Check if the user is admin in the corrent forum
        return true;
    }else{
        return false;
    }
}