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.

θα χρειαστεί να εγκαταστήσετε μια επέκταση όπως το Tampermonkey, το Greasemonkey ή το Violentmonkey για να εγκαταστήσετε αυτόν τον κώδικα.

θα χρειαστεί να εγκαταστήσετε μια επέκταση όπως το Tampermonkey ή το Violentmonkey για να εγκαταστήσετε αυτόν τον κώδικα.

θα χρειαστεί να εγκαταστήσετε μια επέκταση όπως το Tampermonkey ή το Violentmonkey για να εγκαταστήσετε αυτόν τον κώδικα.

θα χρειαστεί να εγκαταστήσετε μια επέκταση όπως το Tampermonkey ή το Userscripts για να εγκαταστήσετε αυτόν τον κώδικα.

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

Θα χρειαστεί να εγκαταστήσετε μια επέκταση διαχείρισης κώδικα χρήστη για να εγκαταστήσετε αυτόν τον κώδικα.

(Έχω ήδη έναν διαχειριστή κώδικα χρήστη, επιτρέψτε μου να τον εγκαταστήσω!)

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.

(Έχω ήδη έναν διαχειριστή στυλ χρήστη, επιτρέψτε μου να τον εγκαταστήσω!)

// ==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');
});