-
Notifications
You must be signed in to change notification settings - Fork 3
/
grades_edit_view_siscad_tweak.user.js
35 lines (32 loc) · 1.26 KB
/
grades_edit_view_siscad_tweak.user.js
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
// ==UserScript==
// @name SiscadGradesEdit
// @author andvicoso and renanmarks
// @namespace andvicoso_siscad_tweak
// @description Auxilia o lançamento de notas no Siscad - thanks to @RenanMarks
// @version 1.6
// @grant none
// @icon https://siscad-admin.ufms.br/favicon.ico
// @downloadURL https://github.com/andvicoso/siscad_tweak/raw/master/grades_edit_view_siscad_tweak.user.js
// @include https://siscad-admin.ufms.br/titan.php?toSection=5&toAction=edit*
// @require https://ajax.googleapis.com/ajax/libs/jquery/1.7/jquery.min.js
// ==/UserScript==
this.$ = this.jQuery = jQuery.noConflict(true);
var buttonHandler = function () {
var column = $('#notas tbody tr td:nth-child(' + this.value + ') input.inputType');
var notasCSV = prompt('Informe notas separadas por espaços');
notasCSV = notasCSV.split(' ');
column.each(function (i, e) {
$(e).val(notasCSV[i]);
$(e).trigger("blur");
});
};
var cabecalhos = $("td.cabecalho");
cabecalhos.each(function (i, e) {
if (e.id.indexOf("#prova") === -1)
{
return;
}
var text = $(e).text().trim();
$(e).html($('<button style="padding: 0;" type="button" value="' + (i+1) + '" id="csv' + i + '">' + text + '</button>'));
$('#csv' + i).on('click', buttonHandler);
});