Bunkr Image Viewer

Bunkr-Albums: adding nice image viewer, simple yet great functionality. Try it: double-click for instant full res zoom, mouse wheel scroll to +\- zoom, etc.

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         Bunkr Image Viewer
// @namespace    https://bunkr-albums.io/
// @version      1.0.2
// @description  Bunkr-Albums: adding nice image viewer, simple yet great functionality. Try it: double-click for instant full res zoom, mouse wheel scroll to +\- zoom, etc.
// @author       stasgrin
// @match        https://bunkr.ac/*
// @match        https://bunkr.ci/*
// @match        https://bunkr.si/*
// @match        https://bunkr.black/*
// @match        https://bunkr.ax/*
// @match        https://bunkr.fi/*
// @match        https://bunkr.site/*
// @match        https://bunkr.pk/*
// @match        https://bunkr.ps/*
// @match        https://bunkr.ph/*
// @match        https://bunkr.cr/*
// @icon         https://dash.bunkr.pk/assets/img/icon.svg
// @require      https://cdnjs.cloudflare.com/ajax/libs/jquery/3.7.1/jquery.min.js
// @require      https://cdnjs.cloudflare.com/ajax/libs/socket.io/2.0.4/socket.io.js
// @require      https://cdnjs.cloudflare.com/ajax/libs/viewerjs/1.11.7/viewer.min.js
// @resource     REMOTE_CSS https://cdnjs.cloudflare.com/ajax/libs/viewerjs/1.11.7/viewer.css
// @grant        GM_getResourceText
// @grant        GM_addStyle
// @license      MIT
// ==/UserScript==

const viewerjsCss = GM_getResourceText("REMOTE_CSS");
GM_addStyle(viewerjsCss);

$(window).on('load', function() {
    console.log('Bunkr viewer: started');
    let images = $('body main figure > img');
    if(images){
        // TODO: gallery viewer
        /*    images.each(function(i) {
            try{
                console.log('Bunkr viewer: image found', images[i]);
                const viewer = new Viewer(images[i]);
                images[i].on('click', viewer.show());
            }
            catch(err) {
                console.log('Bunkr viewer: image fetch failed');
            }
        });*/
        try{
            const viewer = new Viewer(images[0],{toolbar: false,navbar:false,title:false});
            images[0].on('click', viewer.show());
        }
        catch(err) {
            console.log('Bunkr viewer: image fetch failed');
        }
    }
    console.log('Bunkr viewer: ended');
});