Skip to content

Instantly share code, notes, and snippets.

@CEBracco
Last active November 30, 2023 14:57
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save CEBracco/c960da8bea16b264c8cad25b0686454a to your computer and use it in GitHub Desktop.
Save CEBracco/c960da8bea16b264c8cad25b0686454a to your computer and use it in GitHub Desktop.
// ==UserScript==
// @name QuickLoginButtons
// @namespace http://tampermonkey.net/
// @version 1.4
// @updateURL https://gist.github.com/CEBracco/c960da8bea16b264c8cad25b0686454a/raw/QuickLoginButtons.user.js
// @description Agrega botnoes de login rapido al home de universe
// @author cbracco
// @match *://*.movypark.com
// @match *://*.dat.cespi.unlp.edu.ar
// @match http://163.10.20.80/universe-web/
// @match *://*.gob.ar
// @match *://*.gov.ar
// @match https://semlamatanza.com.ar
// @match https://sem.estacionamientojunin.com.ar
// @match http://localhost:8080/universe-web/
// @match *://*.parxin.com.py/
// @grant none
// @require http://code.jquery.com/jquery-3.3.1.min.js
// @require https://gist.githubusercontent.com/CEBracco/3840b85d881d4a536eaa0c9641dcdec9/raw/waitForKeyElements.js
// ==/UserScript==
(function() {
'use strict';
var password1 = "PASSWORD";
var password2 = "PASSWORD2";
function loginWith(username, password){
$('#username').val(username);
$('#password').val(password);
$('#btn_login').click();
}
function setActions(){
$('.supervisor').click(function(){
loginWith($(this).text(), password1);
});
$('.other').click(function(){
loginWith($(this).text(), password2);
});
}
waitForKeyElements ("#btn_login",function(){
if(window.location.hash == '#/login'){
$('#btn_login')
.after('<hr><div class="btn-group"><button class="btn btn-success btn-sm supervisor" id="admin">admin</button><button class="btn btn-danger btn-sm supervisor" id="supervem">supervem</button><button class="btn btn-warning btn-sm supervisor" id="supervif">supervif</button><button class="btn btn-primary btn-sm other" id="testpdv">testpdv</button></div>');
setActions();
}
});
})();
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment