NOTICE: By continued use of this site you understand and agree to the binding Terms of Service and Privacy Policy.
// ==UserScript== // @name Avatar JVC // @namespace HappyDestroy, modifié par Alexandre et Kiwec // @description Montre les avatars en grand // @include http://www.jeuxvideo.com/forums/* // @version 2 // @grant none // ==/UserScript== function main() { if (!RegExp('^http://www.jeuxvideo.com/forums/').test(location)) { return; } $('.back-img-msg div a, .back-img-msg div span').removeAttr('href').removeClass('JvCare').removeAttr('target').css('cursor', 'pointer'); $('.back-img-msg div a, .back-img-msg div span').on('click', onClick); } function onClick() { var myIMG = $(this).children('img').attr('src'); myIMG = myIMG.replace('avatar-md', 'avatar'); myIMG = myIMG.replace('avatars-md', 'avatars'); myIMG = myIMG.replace('avatar-sm', 'avatar'); myIMG = myIMG.replace('avatars-sm', 'avatars'); $('body').append('<div class="overlay-avatar"></div>'); $('body').append('<div class="popup-avatar"><img src="' + myIMG + '" /></div>'); $('.overlay-avatar').css('height', $(document).height()) .css('width', '100%') .css('background-color', 'rgba(0, 0, 0, 0.6)') .css('z-index', '9990') .css('position', 'absolute') .css('top', '0') .css('left', '0'); $('.popup-avatar').css('padding', '20px') .css('background-color', 'white') .css('z-index', '9999') .css('position', 'absolute') .css('top', 'calc(' + $(document).scrollTop() + 'px + 50%)') .css('left', '50%') .css('transform', 'translate(-50%,-50%)'); $('.popup-avatar, .overlay-avatar').on('click', function() { $('.popup-avatar, .overlay-avatar').remove(); }); } main(); addEventListener('instantclick:newpage', main); addEventListener("topiclive:newmessage", function(event) { $("#" + event.id).removeAttr('href').removeClass('JvCare').removeAttr('target').css('cursor', 'pointer'); $("#" + event.id).on("click", onClick); });