Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- // ==UserScript==
- // @name PCInpact
- // @namespace http://www.w3.org/1999/xhtml
- // @description Format admin block with green and greenlight and our blocks with blue
- // @include http://v5.pcinpact.com/news/*
- // @match http://v5.pcinpact.com/news/*
- // @author geekounet85 & z3d-web
- // ==/UserScript==
- /**
- * Substitute Colors
- */
- var colors = {
- 'me': 'dodgerblue',
- 'admin': '#8F0000',
- 'admin_quote': '#6F0000'
- };
- var patterns = {
- 'me': /((geekounet85)|(geek85))/i,
- 'admin': /((David_L)|(labdam)|(P-A)|(Vincent_H)|(MarcRees)|(NilSanyas)|(Teuf)|(Titia))/i
- };
- /**
- * Change the background color of the comment if it's moderator.
- */
- var comments = document.getElementsByClassName('commentaire');
- for(var i = 0; i < comments.length; i++)
- {
- if(comments[i].getElementsByClassName('commentaire_entete_team').length) {
- var content = comments[i].getElementsByClassName('commentaire_content');
- if(content.length) {
- content[0].ClassName = 'commentaire_content_team';
- content[0].style.backgroundColor = colors['admin'];
- }
- }
- }
- /**
- * Change the background color of the comment of moderator and me.
- */
- var quotes = document.getElementsByClassName('quote_bloc');
- for(var i = 0; i < quotes.length; i++)
- {
- var link = quotes[i].getElementsByTagName('a')[0];
- if(link) {
- var quote=quotes[i].getElementsByClassName('bg_form_commentaires');
- if(link.firstChild.data.search(patterns['me'])>0) {
- quote[0].style.backgroundColor = colors['me'];
- }
- if(link.firstChild.data.search(patterns['admin'])>0) {
- quote[0].style.backgroundColor = colors['admin_quote'];
- }
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement