Sleazy Fork is available in English.

Fapello.su Image Link Helper

Adds buttons to open images via direct links with vocabulary replacements

Bu betiği kurabilmeniz için Tampermonkey, Greasemonkey ya da Violentmonkey 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 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         Fapello.su Image Link Helper
// @namespace    http://fapello.su
// @version      0.4
// @description  Adds buttons to open images via direct links with vocabulary replacements
// @match        *://fapello.su/*
// @license MIT
// @grant        none
// ==/UserScript==
(function () {
    'use strict';

    // Dictionary for replacing parts of the image URL
    const replacements = {
        '_t': '_o',
        'thumbs2': 'images2',
        '.md': '',
        '.th': '',
        // Add more replacements as needed
    };

    function replaceUrl(url) {
        let newUrl = url;
        for (const [original, replacement] of Object.entries(replacements)) {
            newUrl = newUrl.replace(original, replacement);
        }
        return newUrl;
    }

    // Function to add a button to an image
    function addButtonToImage(image) {
        const modifiedUrl = replaceUrl(image.src);
        const button = document.createElement('a');
        button.href = modifiedUrl;
        button.textContent = 'Source IMG';
        button.style.position = 'absolute';
        button.style.top = '5px';
        button.style.right = '5px';
        button.style.zIndex = '1000';
        button.style.background = 'white';
        button.style.border = '1px solid black';
        button.style.padding = '2px 5px';
        button.style.borderRadius = '5px';
        button.style.textDecoration = 'none';
        button.style.color = 'black';
        button.style.fontSize = '12px';
        button.style.fontWeight = 'bold';
        image.parentNode.style.position = 'relative';
        image.parentNode.appendChild(button);
    }

    // Function to process all images in the #content div
    function processImages() {
        const contentDiv = document.getElementById('content');
        if (contentDiv) {
            const images = contentDiv.querySelectorAll('img');
            images.forEach(addButtonToImage);
        }
    }

    // Observe for new images loaded by lazyload.js
    const observer = new MutationObserver(mutations => {
        mutations.forEach(mutation => {
            if (mutation.addedNodes) {
                mutation.addedNodes.forEach(node => {
                    if (node.tagName === 'IMG') {
                        addButtonToImage(node);
                    }
                });
            }
        });
    });

    // Start observing the #content div for changes
    const contentDiv = document.getElementById('content');
    if (contentDiv) {
        observer.observe(contentDiv, {
            childList: true,
            subtree: true
        });
    }

    // Initial processing of images
    processImages();

    // Re-process images on page scroll
    window.addEventListener('scroll', processImages);
})();