Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- // ==UserScript==
- // @name HOL Ignore List
- // @namespace http://www.hardwareonline.dk
- // @description HOL Ignore List functionallity with added filtering of guests.
- // @match http://www.hardwareonline.dk/*
- // @match https://www.hardwareonline.dk/*
- // @require https://code.jquery.com/jquery-latest.min.js
- // @copyright 2014, John Nielsen <nielsen.john@gmail.com> - Tux, modified/extended by Wut with guest filtering
- // ==/UserScript==
- jQuery( document ).ready(function($) {
- var ignoreArray = [], id = '', name = '', item = '', rank = '', newElem = '', guestName = '';
- ignoreArray.push('Brugernavn1');
- ignoreArray.push('Brugernavn2');
- $('.t47-svar').each(function() {
- var item = $(this);
- id = item.find('.t47-svar-top A:first').attr('name');
- name = item.find('A B').text();
- rank = item.find('.bruger').text();
- guestName = item.find('.bolditalic').text();
- if(ignoreArray.indexOf(name) > -1)
- {
- newElem = $('<div/>', {
- text: '#' + id + ': ' + name + ' (' + rank + ')',
- style: 'font-weight: bold; cursor: pointer; color: #15649f;',
- class: 't47-svar'
- }).click(function() { item.toggle(); });
- item.before(newElem);
- item.toggle();
- }
- else if( rank == 'Gæst')
- {
- newElem = $('<div/>', {
- text: '#' + id + ' : ' + guestName + ' (Gæst)' ,
- style: 'font-weight: bold; cursor: pointer; color: #15649f;',
- class: 't47-svar'
- }).click(function() { item.toggle(); });
- item.before(newElem);
- item.toggle();
- }
- });
- });
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement