Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- // ==UserScript==
- // @name RU-Board WhosOnline mod
- // @author Zloy_Gelud
- // @namespace http://userscripts.org/scripts/show/159445
- // @include http*://forum.ru-board.com/topic.cgi?forum=*
- // @include http*://72.233.112.78/topic.cgi?forum=*
- // @include http*://forum.ru-board.com/forum.cgi?forum=bm*
- // @include http*://72.233.112.78/forum.cgi?forum=bm*
- // @icon http://forum.ru-board.com/favicon.ico
- // @description Highlights users online
- // @require http://ajax.googleapis.com/ajax/libs/jquery/1.9.1/jquery.min.js
- // @version 0.3.3
- // @run-at document-end
- // ==/UserScript==
- $(document).ready(function () {
- $.ajax({
- type: "GET", url: "http://forum.ru-board.com/whosonline.cgi", cache: false,
- success: function (data) {
- var Users = [];
- var html = $.parseHTML(data);
- $('tr.dats td:first-child b a', $(html)).each(function (col) {
- var Moderator = $(this).find('font');
- if (Moderator.length > 0) {
- Users[$(Moderator).html()] = 'mod';
- } else {
- Users[$(this).html()] = 'mem';
- }
- });
- $('a.m b, tr[bgcolor="#FFFFFF"] td:last-child.dats>a', $(document)).each(function (user) {
- var div = $('<div>');
- if (Users[$(this).html()] == 'mod') {
- div.attr({
- style: "width:4px;height:4px;left:4px;top:-1px;background:#cc4f4f;border:1px solid #ff3126;border-radius:100%;position:relative;display:inline-block;box-shadow: 0 0 2px rgba(125,0,0,0.9)",
- title: "Moderator online"
- });
- } else if (Users[$(this).html()] == 'mem') {
- div.attr({
- style: "width:4px;height:4px;left:4px;top:-1px;background:#7AC774;border:1px solid #54B94E;border-radius:100%;position:relative;display:inline-block;box-shadow: 0 0 2px rgba(0,125,0,0.9)",
- title: "User online"
- });
- } else {
- div.attr({
- style: "width:4px;height:4px;left:4px;top:-1px;background:#C0C0C0;border:1px solid #A0A0A0;border-radius:100%;position:relative;display:inline-block;box-shadow: 0 0 2px rgba(51,51,51,0.9)",
- title: "User offline"
- });
- }
- div.appendTo($(this).parent());
- });
- }
- });
- });
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement