JVC Live

Charger les nouveaux messages en direct sur JVC

θα χρειαστεί να εγκαταστήσετε μια επέκταση όπως το 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.

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

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

Advertisement:

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.

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

Advertisement:

// ==UserScript==
// @name JVC Live
// @description Charger les nouveaux messages en direct sur JVC
// @author Singles
// @match http://www.jeuxvideo.com/*
// @match http://www.forumjv.com/*
// @run-at document-end
// @require http://ajax.googleapis.com/ajax/libs/jquery/1.9.1/jquery.min.js
// @version 1.1.4
// @grant none
// @noframes
// @namespace https://greasyfork.org/users/785403
// ==/UserScript==

var TL = new TopicLive();
TL.initStatic();

var $mouseX = 0, $mouseY = 0;
var $xp = 0, $yp =0;

$(document).mousemove(function(e){
    $mouseX = e.pageX;
    $mouseY = e.pageY;    
});

var $loop = setInterval(function(){
// change 12 to alter damping higher is slower
$xp += (($mouseX - $xp)/12);
$yp += (($mouseY - $yp)/12);

 $("#preview").css('position',"absolute");
$("#preview").css({left:$xp+20 +'px', top:$yp +'px'});  
}, 30);
   $("body").append("<div id=\"preview\"> </div>")  
   
   
   var currentRequest = null;    

$('#page-topics #forum-main-col a').mouseenter(function (){
  
 $("#preview").show();
 $("#preview").html('<img src="http://image.noelshack.com/fichiers/2016/26/1466991982-squares-1.gif" />');
  
  currentRequest = $.ajax({
url:$(this).attr("href"),
    beforeSend : function()    {           
        if(currentRequest != null) {
            currentRequest.abort();
        }
    },
success: function(response) {
  
   $('#preview').html($(response).find(".bloc-message-forum:first"));
  $(this).removeAttr('title');
    
}
}
        );

}).mouseleave(function(){
  $("#preview").hide();
});


$('[title]').mouseover(function () {
        $this = $(this);
        $this.data('title', $this.attr('title'));
        $this.attr('title', '');
    }).mouseout(function () {
        $this = $(this);
        $this.attr('title', $this.data('title'));
    });