Last active
September 6, 2019 13:36
-
-
Save jeansordes/8690155def101599ac201fa6dc41d17d to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// ==UserScript== | |
// @name L3 Miage Toulouse EDT UT1 Helper | |
// @version 0.1 | |
// @author https://jzs.fr | |
// @match https://ade-production.ut-capitole.fr/* | |
// @grant none | |
// @namespace jzs | |
// ==/UserScript== | |
let g = (q => document.getElementById(q)), | |
myclick = (e => e.querySelector('.x-tree3-node-joint').click()), | |
triggerMouseEvent = (node, eventType) => { | |
var clickEvent = document.createEvent ('MouseEvents'); | |
clickEvent.initEvent (eventType, true, true); | |
node.dispatchEvent (clickEvent); | |
}; | |
var c1 = setInterval(() => { | |
let el = g('Direct Planning Tree_-1'); | |
if (el) { | |
myclick(el); | |
var c2 = setInterval(() => { | |
let el = g('Direct Planning Tree_2028'); | |
if (el) { | |
myclick(el); | |
var c3 = setInterval(() => { | |
let el = g('Direct Planning Tree_2264'); | |
if (el) { | |
triggerMouseEvent(el, "mousedown"); | |
clearInterval(c3) | |
} | |
}, 100) | |
clearInterval(c2); | |
} | |
}, 100) | |
clearInterval(c1); | |
} | |
}, 100) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment