-
Notifications
You must be signed in to change notification settings - Fork 0
/
OWHelios.user.js
90 lines (70 loc) · 2.98 KB
/
OWHelios.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
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
// ==UserScript==
// @name OWHelios
// @namespace sboye
// @grant none
// @include *helios.openwide.fr*
// @version 1.3
// ==/UserScript==
(function(){
function addJQuery(callback) {
var script = document.createElement("script");
script.setAttribute("src", "//ajax.googleapis.com/ajax/libs/jquery/1/jquery.min.js");
script.addEventListener('load', function() {
var script = document.createElement("script");
script.textContent = "window.jQ=jQuery.noConflict(true);(" + callback.toString() + ")();";
document.body.appendChild(script);
}, false);
document.body.appendChild(script);
}
// the guts of this userscript
function main() {
/******************************************************
* Vue d'un ticket
******************************************************/
$('.message-panel-content-outer').css('color', '#000');
/******************************************************
* Liste des tickets
******************************************************/
if ($('table.portfolio-tickets').length) {
/******************************************************
* General view
******************************************************/
$('table.portfolio-tickets tr td span').css("color", "#444");
/**************************
* Bouton Reformater
**************************/
var $newdiv1 = $('<div class="float-left field-button"><a class="btn colorinit"><i class="icon-plus-sign" style="background-position: -312px 0;"></i>Décolorer les tickets</a></div>');
$('.main .right-block').prepend($newdiv1);
$('a.colorinit').click(function(elt){
$('table.portfolio-tickets tr td span').css({'color': 'inherit', 'text-decoration': 'inherit', 'font-style': 'inherit'});
});
/**************************
* Mes tickets / Tickets non pris en charge
**************************/
$('table.portfolio-tickets tr td span.info-popup-trigger').each(function(index, elt){
if ($(elt).html() == 'Moi' || $(elt).html() == '-') {
$(elt).closest('tr').find('span').css({'color': '#000'});
}
});
/**************************
* En attente de livraison
**************************/
$('table.portfolio-tickets tr td .tag-item a.tag-link[href*="livrer"]').each(function(index, elt){
$(elt).closest('tr').find('span').css({'font-style': 'italic', 'color': '#8a8a8a'});
});
/**************************
* En attente
**************************/
$('table.portfolio-tickets tr td .tag-item a.tag-link[href*="attente"]').each(function(index, elt){
$(elt).closest('tr').find('span').css({'color': '#595959'});
});
/**************************
* En attente du client
**************************/
$('table.portfolio-tickets tr td img[alt="En attente du client"]').closest('tr').find('span').css({'font-style': 'italic', 'color': '#8a8a8a'});
//$('.content div.information.followable-entity-list:first > a').click();
}
}
// load jQuery and execute the main function
addJQuery(main);
})();