Sleazy Fork is available in English.

BunkrSorter

Sorts bunkr items by size. Biggest first

Από την 08/06/2023. Δείτε την τελευταία έκδοση.

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

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

θα χρειαστεί να εγκαταστήσετε μια επέκταση όπως το 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         BunkrSorter
// @namespace    https://github.com/runisco
// @version      2.1.2a
// @supportURL   https://github.com/Runisco/BunkrSorter/issues
// @description  Sorts bunkr items by size. Biggest first
// @author       Runisco
// @match        https://bunkr.is/a/*
// @match        https://bunkr.ru/a/*
// @match        https://bunkr.su/a/*
// @match        https://bunkr.la/a/*
// @match        https://bunkrr.su/a/*
// @icon         https://www.google.com/s2/favicons?sz=64&domain=bunkr.is
// @require      https://code.jquery.com/jquery-3.3.1.min.js
// @grant        none
// ==/UserScript==

/* globals $ */

var sortButton = $('<a href="#" class="sort" id="startSort">sort items</a>');
sortButton.insertAfter($('p.subtitle'));
$('#startSort').css({'margin-left':'10px'});
var sortButtonFriends = $('<li><a href="#" class="sort" id="startSortFriends">sort items</a></li>');
sortButtonFriends.insertAfter($('div.friends'))

var debug = false
var debugOnlyOne = false
var identifiedClass = '';
var identifiedContainer = '';

$('#startSort').click(function(){
    if (debug || debugOnlyOne){console.log("old startSort clicked")}
    var items = [];
    $('div.image-container.column').each(function(e){
        let item = []
        let size, sizeMultiplier;
        item.push($(this));

        if (debug || debugOnlyOne){console.log($(this))}
        $(this).remove();

        let sizeInfo = $(this).find('p.file-size').text();
        let sizeSplit = sizeInfo.split(" ");
        size = parseFloat(sizeSplit[0]);
        if (debug || debugOnlyOne) {console.log(sizeInfo + " " + size)}

        let sizeMultiplierDeterminer = sizeSplit[1]
        if (sizeMultiplierDeterminer == "KiB"){
            sizeMultiplier = (1/1024);
        } else if (sizeMultiplierDeterminer == "KB"){
            sizeMultiplier = (1/1024);
        } else if (sizeMultiplierDeterminer == "kB"){
            sizeMultiplier = (1/1024);
        }else if (sizeMultiplierDeterminer == "MiB"){
            sizeMultiplier = 1;
        } else if (sizeMultiplierDeterminer == "MB"){
            sizeMultiplier = 1;
        } else if (sizeMultiplierDeterminer == "GiB"){
            sizeMultiplier = 1024;
        } else if (sizeMultiplierDeterminer == "GB"){
            sizeMultiplier = 1024;
        }
        item.push(size * sizeMultiplier);
        if (debug || debugOnlyOne) {console.log(size + " = " + size * sizeMultiplier)}

        items.push(item);
        $(this).remove();
        debugOnlyOne = false;
    });

    var sortedItems = items.sort(function(a, b) {
        return b[1] - a[1];
    });

    for (let i=0; i < sortedItems.length; i++){
        $('div#table').append(sortedItems[i][0]);
    }
})

$('#startSortFriends').click(function(){
    if (debug || debugOnlyOne){console.log("New startSortFriends clicked")}

    var items = [];

    if ($('div.overflow-hidden').length != 0){
        identifiedClass = 'div.overflow-hidden'
    } else if ($('div.grid-images_box').length != 0) {
        identifiedClass = 'div.grid-images_box'
    }

    if ($('div.grid').length != 0){
        identifiedContainer = 'div.overflow-hidden'
    } else if ($('div.grid-images_box').length != 0) {
        identifiedContainer = 'div.grid-images'
    }


    $(identifiedClass).each(function(e){
        let item = []
        let size, sizeMultiplier;
        item.push($(this));

        if (debug || debugOnlyOne){console.log($(this))}
        $(this).remove();

        let sizeInfo = $(this).find('p:eq(1)').text();
        let sizeSplit = sizeInfo.split(" ");
        size = parseFloat(sizeSplit[0]);
        if (debug || debugOnlyOne) {console.log(sizeInfo + " " + size)}

        let sizeMultiplierDeterminer = sizeSplit[1]
        if (sizeMultiplierDeterminer == "KiB"){
            sizeMultiplier = (1/1024);
        } else if (sizeMultiplierDeterminer == "KB"){
            sizeMultiplier = (1/1024);
        } else if (sizeMultiplierDeterminer == "kB"){
            sizeMultiplier = (1/1024);
        }else if (sizeMultiplierDeterminer == "MiB"){
            sizeMultiplier = 1;
        } else if (sizeMultiplierDeterminer == "MB"){
            sizeMultiplier = 1;
        } else if (sizeMultiplierDeterminer == "GiB"){
            sizeMultiplier = 1024;
        } else if (sizeMultiplierDeterminer == "GB"){
            sizeMultiplier = 1024;
        }
        item.push(size * sizeMultiplier);
        if (debug || debugOnlyOne) {console.log(size + " = " + size * sizeMultiplier)}

        items.push(item);
        $(this).remove();
        debugOnlyOne = false;
    });

    var sortedItems = items.sort(function(a, b) {
        return b[1] - a[1];
    });

    for (let i=0; i < sortedItems.length; i++){
        $(identifiedContainer).append(sortedItems[i][0]);
    }
})