alextzval / Impartida por el titular

// ==UserScript==
// @name         Impartida por el titular
// @namespace    ImpartidaGVA
// @version      0.6
// @description  FCT rules
// @license      GPL-3.0-or-later
// @license      MIT
// @author       Docent
// @match        https://docent.edu.gva.es/*
// @grant        none
// ==/UserScript==

// ==OpenUserJS==
// @author alextzval
// ==/OpenUserJS==

$(function() {
    var clicked = false;
	var horaSesion;
    $(document).on('mousemove', function() {
		var hora = $('.imc-dia-hora').html();
		if(hora!=undefined && hora.length>0) {
            //hora = hora.split(' ')[2].split(' ')[0];
            hora = hora.split(' ')[2];
            // si existe hora se puede comparar con la hora de la sesiĆ³n
            if(hora!=undefined) {
                hora = hora.split(' ')[0];
                if(hora!=undefined && hora!=horaSesion) {
                    clicked = false;
                }
            }
		}

        var diaWeb = $('.imc-dia-hora').attr('data-date');
        if(diaWeb != undefined) {
            var hoy = new Date();
            hoy = new Date(hoy.getTime() - (hoy.getTimezoneOffset() * 60000 )).toISOString().split("T")[0];
            
            if(hoy==diaWeb) {
                $('.imc-sessio-impartida-titular-ok').find('input').each(function(){
                    if($(this).prop("checked")==false && clicked==false) {
                        $(this).trigger('click');
						clicked = true;
						
						if(hora!=undefined && hora.length>0) {
							horaSesion = hora;
						}
					}
                });
            }
        }
    });
});