Advertisement
TuxDK

HOL Ignore List [Tampermonkey]

Jul 24th, 2014
353
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. // ==UserScript==
  2. // @name       HOL Ignore List
  3. // @namespace  http://www.hardwareonline.dk
  4. // @version    0.4
  5. // @description  HOL Ignore List functionallity.
  6. // @match      http://www.hardwareonline.dk/*
  7. // @match      https://www.hardwareonline.dk/*
  8. // @require    https://code.jquery.com/jquery-latest.min.js
  9. // @copyright  2014, John Nielsen <nielsen.john@gmail.com> - Tux
  10. // ==/UserScript==
  11.  
  12. jQuery( document ).ready(function($) {
  13.    
  14.     var ignoreArray = [], id = '', name = '', item = '';  
  15.     ignoreArray.push('Brugernavn1');
  16.     ignoreArray.push('Brugernavn2');
  17.    
  18.     $('.t47-svar').each(function() {
  19.        
  20.         var item = $(this);
  21.         id = item.find('.t47-svar-top A:first').attr('name');
  22.         name = item.find('A B').text();
  23.                
  24.         if(ignoreArray.indexOf(name) > -1)
  25.         {
  26.             var newElem = $('<div/>', {
  27.                 text: '#' + id + ': ' + name + ' - User matched ignore list, message hidden. Click to show/hide.',
  28.                 style: 'font-weight: bold; font-style: italic; cursor: pointer; color: #15649f;',
  29.                 class: 't47-svar'
  30.             }).click(function() { item.toggle(); });
  31.            
  32.             item.before(newElem);
  33.             item.toggle();
  34.         }        
  35.     });
  36. });
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement