geek85

userscript_PCI_color_v5_maj

Oct 18th, 2011
100
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. // ==UserScript==
  2. // @name           PCInpact V5
  3. // @namespace      http://www.w3.org/1999/xhtml
  4. // @description    mettre les modos en vert et vert clair - mettre mes posts en bleu
  5. // @include        http://v5.pcinpact.com/news/*
  6. // @author         geek85
  7. // ==/UserScript==
  8. (function () {
  9.     var moi=/((geekounet85)|(geek85))/i
  10.     var color_admin="#8F0000";
  11.     var color_admin_quote="#6F0000";
  12.     var color_moi="dodgerblue";
  13.     var admins=/((David_L)|(labdam)|(P-A)|(Vincent_H)|(MarcRees)|(NilSanyas)|(Teuf)|(Titia))/i
  14.  
  15.     var commentaires = document.getElementsByClassName('commentaire');
  16.     var com = null;
  17.     for (var i=0; i<commentaires.length; i++)
  18.     {
  19.         com = commentaires[i];
  20.         {
  21.         admin=com.getElementsByClassName('commentaire_entete_team')
  22.         if (admin.length!=0)
  23.             {
  24.                 admin_content=com.getElementsByClassName('commentaire_content')
  25.                 admin_content[0].style.cssText = 'background-color:'+color_admin+';';
  26.              }
  27.         }
  28.     }
  29.    
  30.     // presque pas commencé, juste essayé d'adapter
  31.     var citation = document.getElementsByClassName('quote_bloc');
  32.     var a = null;
  33.     for (var i=0; i<citation.length; i++)
  34.     {
  35.         a = citation[i].getElementsByTagName('a')[0];
  36.         if (a)
  37.         {
  38.             quote=citation[i].getElementsByClassName('bg_form_commentaires');
  39.             if (a.firstChild.data.search(moi)>0)
  40.             {
  41.                 quote[0].style.cssText = 'background-color:'+color_moi+';';
  42.             }
  43.  
  44.             if (a.firstChild.data.search(admins)>0)
  45.             {
  46.                 quote[0].style.cssText = 'background-color:'+color_admin_quote+';';
  47.             }
  48.  
  49.         }
  50.     }
  51. }
  52. )()
  53.  
Advertisement
Add Comment
Please, Sign In to add comment