Earendil / VelvetGalleryResize

// ==UserScript==
// @name        VelvetGalleryResize
// @namespace   Velvet.hu
// @include     http://galeria.velvet.hu*
// @include     https://galeria.velvet.hu*
// @description Enables zoom with highest resolution on velvet.hu galleries
// @version     1
// @grant       none
// ==/UserScript==

this.Gallery.getBigSize = function() { return this.sizes[0]; }
this.Gallery.bigpic.theresNoBigger=false;
this.Gallery.bigpic.opened=false;
this.Gallery.bigpic.hide = function () {
            Gallery.bigpic.opened=false;
            $('body').removeClass('bigpic');
            $('#bigpic').fadeOut(200);
        }

this.Gallery.bigpic.open = function() {  
            Gallery.bigpic.opened=true;
            $('#bigPicImg').attr('src', this.src);
            $('#bigPicImg').css(
              {'overflow':'auto'},
              {'position' : 'fixed'},
              {'top' : '0px'},
              {'right' : '0px'}
            )             
            $('#bigpic').fadeIn(100, function() {
                $('body').addClass('bigpic');
            });
}

$(window).off("keyup");
$(window).off("keydown");

$(window).keyup(
    function(event) {
        var a;
        if (Gallery.bigpic.opened)
        {
          return;
        }
        switch (event.which) {
        case 39:
        case 75:
            a = $('.nav.next');
            break;
        case 37:
        case 74:
            a = $('.nav.prev');
            break;
        default:
            return;
        }
        if (a.length === 0)
            return;
        if( $('body').hasClass( 'advertActive' ) ) {
            $('body').toggleClass( 'advertActive' );
            return;
        }
        $.browser.opera && $(window).trigger('beforeunload');
        document.cookie = "fromthumb=false";
        window.location.href = a.data('href') || a.attr('href');
    });

this.Gallery.bigpic.theresNoBigger=false;
$(".zoom").removeClass("disabled");
$(".zoom").show();
$("#bigpic").css({overflow: "auto"});
this.Gallery.fitImage();