NOTICE: By continued use of this site you understand and agree to the binding Terms of Service and Privacy Policy.
// ==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
// @updateURL https://openuserjs.org/meta/alextzval/Impartida_por_el_titular.meta.js
// @downloadURL https://openuserjs.org/install/alextzval/Impartida_por_el_titular.user.js
// ==/UserScript==
// ==OpenUserJS==
// @author alextzval
// ==/OpenUserJS==
/*
window.onhashchange = function (event) {
var clicked = false;
var horaSesion;
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;
}
}
});
}
}
}
*/
$(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;
}
}
});
}
}
});
});