Last active
August 29, 2015 14:16
-
-
Save cprecioso/e8589abf9d00794e29c0 to your computer and use it in GitHub Desktop.
PoliREformaT
This file contains 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 Auto login PoliformaT | |
// @namespace | |
// @version 0.1 | |
// @description Auto redirects to login page in PoliformaT when logged out | |
// @author Carlos Precioso | |
// @match https://poliformat.upv.es/portal | |
// @grant none | |
// ==/UserScript== | |
if (document.querySelector("#loginLink1").innerText === "Identificarse") { | |
window.location = "https://www.upv.es/pls/soalu/est_intranet.NI_Indiv?P_IDIOMA=c&P_MODO=alumno&P_CUA=sakai&P_VISTA=MSE" | |
} |
This file contains 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 Polilogin | |
// @namespace | |
// @version 0.1 | |
// @description Restyles PoliformaT login | |
// @author Carlos Precioso | |
// @match https://www.upv.es/pls/soalu/est_intranet.NI_Indiv?P_IDIOMA=c&P_MODO=alumno&P_CUA=sakai&P_VISTA=MSE | |
// @grant none | |
// ==/UserScript== | |
### | |
do ($ = jQuery) -> | |
lookup = 'TRWAGMYFPDXBNJZSQVHLCKE' | |
# Prepare page | |
$("link[rel='stylesheet'], style").remove() | |
$("*[style]").removeAttr "style" | |
$("body *").css | |
"font-size":"1.5em !important" | |
"font-family":"monospace" | |
.hide() | |
$ "form input" | |
.css | |
width: "50%" | |
margin: "10px auto" | |
display: "block" | |
.appendTo "<div></div>" | |
.parent() | |
.css | |
width: "100%" | |
.appendTo "form" | |
$ "input[name='dni']" | |
.css | |
display: "inline-block" | |
width: "calc(100% - 3em)" | |
border: "none" | |
"text-align": "center" | |
outline: "none" | |
.attr "placeholder", "DNI" | |
.appendTo "<div></div>" | |
.parent() | |
.append( $ "<div id='letradni'></div>" | |
.css | |
display: "inline-block" | |
"padding-left": ".5em" | |
) | |
.css | |
width: "50%" | |
margin: "10px auto" | |
display: "block" | |
"text-align": "center" | |
.prependTo "form" | |
.end() | |
.on 'keyup', (e) -> | |
console.dir n = Number(e.target.value + ".") | |
console.log l = lookup.charAt n % 23 | |
$("#letradni").text l | |
.get 0 | |
.type = "text" | |
$ "input[name='clau']" | |
.attr "placeholder", "PIN" | |
.css | |
border: "none" | |
"text-align": "center" | |
outline: "none" | |
$ "form" | |
.appendTo "body" | |
.show() | |
$ "<div></div>" | |
.css | |
background: "url(https://poliformat.upv.es/library/skin/neo-fupv3/images/poli_fotmat.png)" | |
"background-position": "170px 44px" | |
width: "143px" | |
height: "43px" | |
margin: "10px auto" | |
.appendTo "<div></div>" | |
.parent() | |
.css | |
width: "100%" | |
.prependTo "body" | |
This file contains 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
// Generated by CoffeeScript 1.9.0 | |
/* | |
// ==UserScript== | |
// @name Polilogin | |
// @namespace | |
// @version 0.1 | |
// @description Restyles PoliformaT login | |
// @author Carlos Precioso | |
// @match https://www.upv.es/pls/soalu/est_intranet.NI_Indiv?P_IDIOMA=c&P_MODO=alumno&P_CUA=sakai&P_VISTA=MSE | |
// @grant none | |
// ==/UserScript== | |
*/ | |
(function() { | |
(function($) { | |
var lookup; | |
lookup = 'TRWAGMYFPDXBNJZSQVHLCKE'; | |
$("link[rel='stylesheet'], style").remove(); | |
$("*[style]").removeAttr("style"); | |
$("body *").css({ | |
"font-size": "1.5em !important", | |
"font-family": "monospace" | |
}).hide(); | |
$("form input").css({ | |
width: "50%", | |
margin: "10px auto", | |
display: "block" | |
}).appendTo("<div></div>").parent().css({ | |
width: "100%" | |
}).appendTo("form"); | |
$("input[name='dni']").css({ | |
display: "inline-block", | |
width: "calc(100% - 3em)", | |
border: "none", | |
"text-align": "center", | |
outline: "none" | |
}).attr("placeholder", "DNI").appendTo("<div></div>").parent().append($("<div id='letradni'></div>").css({ | |
display: "inline-block", | |
"padding-left": ".5em" | |
})).css({ | |
width: "50%", | |
margin: "10px auto", | |
display: "block", | |
"text-align": "center" | |
}).prependTo("form").end().on('keyup', function(e) { | |
var l, n; | |
console.dir(n = Number(e.target.value + ".")); | |
console.log(l = lookup.charAt(n % 23)); | |
return $("#letradni").text(l); | |
}).get(0).type = "text"; | |
$("input[name='clau']").attr("placeholder", "PIN").css({ | |
border: "none", | |
"text-align": "center", | |
outline: "none" | |
}); | |
$("form").appendTo("body").show(); | |
return $("<div></div>").css({ | |
background: "url(https://poliformat.upv.es/library/skin/neo-fupv3/images/poli_fotmat.png)", | |
"background-position": "170px 44px", | |
width: "143px", | |
height: "43px", | |
margin: "10px auto" | |
}).appendTo("<div></div>").parent().css({ | |
width: "100%" | |
}).prependTo("body"); | |
})(jQuery); | |
}).call(this); |
This file contains 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 PoliformaT favicon and title | |
// @namespace | |
// @version 0.1 | |
// @description Applies a favicon to PoliformaT | |
// @author Carlos Precioso | |
// @match https://poliformat.upv.es/* | |
// @grant none | |
// ==/UserScript== | |
var newLink = document.createElement("link"); | |
newLink.type = "image/x-icon"; | |
newLink.rel = "icon"; | |
newLink.href = "data:image/gif;base64,R0lGODlhLQAtAPUAACwuLC4wLi8xLzY4Nj9BP0dNS0hLSEhMSkpMSlNVU1RXVFBYVl1iYF5kYWlvbHZ+fNQODtgSEtwXF90aGt4dHeEjI+YwMOk7O+pAQO1NTe9bW/Fvb4ePjYmLiYuNi4mPjZafnamurKyurPORkfScnPWsrMDCwNTV1NXW1fbIyP/VwP/p1Onp6erq6u7v7v/p6QAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAACH5BAEAADAALAAAAAAtAC0AAAb+QJhwSCwaj8ikcslsOp/QqHRKrTo3l4pWa8RsKxbNyqqiQM5oiLGSPkc21JUE/a10v/MzaYo5X05RGmcSUxEQE1QZZyNRJGdwUyxnGVElZyVVk416mRCUUJYQmFSaUI4Qe0MbGaytrhkqRKVPjhGpQmxtbbcws06nvLm6aKNCvk2hxUWWEXZIpSYICA4sDAIABCFFwEinzkelIgAAAwbj5x9EtbxEod9G4ecCHSIK4wIsQ9xH3knx4yKGIBj3QN8lJO78eRIijpyLIR7GLTAoqtuZd0X+ISDSsABFdkMSPlsIo6EBjuM2CllnEQJGWSQbCiASEUCDjwgvKvzUEICJB4HjOFBUpk7nSJ7yPIhIcC/fyoNHRIKLOW7AtXMAQBRF1fLlkH8GTjAFgMDENgi2kKhgBWkqUrJCHvLjRIoqXCUkDIF8onHJKUZ136pMIgmCBSobHkmxoDhKCkMRWLxwTOeVkVWtLhgiKWXD5jZrhl0goxl0EWFnLAC2wrq169ewY8ueTbs2lSAAOw=="; | |
document.getElementsByTagName("head")[0].appendChild(newLink); | |
document.title = "PoliformaT" |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment