Fandom

Community Central

Admin Forum:Completely Styling Admin Comments Part 2

19,001pages on
this wiki
Add New Page
Talk0 Share

Ad blocker interference detected!


Wikia is a free-to-use site that makes money from advertising. We have a modified experience for viewers using ad blockers

Wikia is not accessible if you’ve made further modifications. Remove the custom ad blocker rule(s) and the page will load as expected.

This Forum has been archived

Forums: Admin Central Index Technical Help Completely Styling Admin Comments Part 2
Central's forums are a place for the community to help other members.
To contact staff directly or to report bugs, please use Special:Contact.
Note: This topic has been unedited for 1355 days. It is considered archived - the discussion is over. Do not add to unless it really needs a response.



Hi,

A while back, I came on here and got help with completely styling admin comments, but since, it seems that some things on Wikia have changed, and so I need to update my code. ~ My Wiki ~ Here's what I want. Each admin (in this case there are only 2) should have their replies with an orange background, black font, and an "admin" sticker at the bottom (in this case an image I am hosting elsewhere). Additionally, the avatar next to their replies should be outlined in orange. Below is my complete current code. At the moment, it is working as intended, except that it is not limited to admins in some areas, specifically noticable in the new forum module, but also sometimes on message walls. It needs to be for the 2 admins only.

MediaWiki:Common.js -

/* Highlight Admin Message Wall Comments */
$('.speech-bubble-avatar')
.filter(function () {
    return $(this).has('a[href$="Kyle$calise"]').length;
}).next().css({
    backgroundColor: "orange"
});
 
var admins = ['Kyle$calise', 'Minifede'];
 
(function (admins) {
 
    if (!admins.length) return;
    if ('view' !== ($.getUrlVar('action') || 'view')) return;
 
    var adminsRegex = [];
    for (var i = 0; i < admins.length; i++) {
        adminsRegex.push(admins[i].replace(/[\[\]{}()*+?.,\\^$|#\s-]/g, "\\$&"));
    }
    adminsRegex = adminsRegex.join('|');
 
    function addClassToComments () {
        var regex = new RegExp('^(?:' + adminsRegex + ')$', 'i');
        $('ul.comments li')
        .filter(function () {
            return regex.test(
                $(this).attr('data-user')
            );
        })
        .addClass('admin');
    }
 
    function addClassToWall () {
        var regex = new RegExp('(?:' + adminsRegex + ')$', 'i');
        $('ul.comments li')
        .filter(function () {
            return regex.test(
                $(this).children('.speech-bubble-avatar')
                .children('a').attr('href')
            );
        })
        .addClass('admin');
    }
 
    function addClassToProfilePage () {
        var regex = new RegExp('(?:' + adminsRegex + ')(?:/|$)', 'i');
        if (regex.test(wgTitle)) {
            $(  '#UserProfileMasthead'  ).length) {
            addClassToProfilePage();
        }
    });
 
}(admins));

MediaWiki:Wikia.css - 

/* Mainpage heading styling */
.i18ndoc {
    background-color: #FFF77D;
    border-bottom: 1px solid lightgrey;
    font-family: monospace;
    font-size: 8pt;
    height: 140px;
    overflow: auto;
    padding: 3px;
}
 
 
/* Highlight Admin Comments */
.comments li.admin blockquote {
   background: #FF9900 url("http://kylescalise.tk/images/admin.png") bottom center no-repeat !important;
}
.comments li.admin blockquote {
   padding: 5px;
}
.comments li.admin blockquote {
   font-weight: bold;
}
.comments li.admin blockquote:after {
   border-color: transparent #FF9900 #FF9900 transparent !important;
}
.comments li.admin blockquote div {
   background: transparent !important;
}
.comments li.admin blockquote {
   color:black !important;
}
.comments li.admin blockquote a {
   color:blue !important;
}
.comments li.admin blockquote hr {
   background-color: black !important;
}
.comments li.admin blockquote hr {
   border-color: black !important;
}
.admin img.avatar {
    border: 4px solid orange !important;
}
.admin img.avatar {
    border-radius: 5px !important;
}
.Wall .admin .speech-bubble-avatar img {
    border: 4px solid orange;
}
.Wall ul.comments > li.message.admin > .speech-bubble-message:after {
    border-color: #FF9900 #FF9900 transparent transparent;
    border-width: 12px;
}

Kyle$calise 23:14, December 10, 2012 (UTC)

Hi, I've fixed whatever went wrong with the source tags (probably a rte error) and removed the code that definitely has nothing to do with your problem. I have no idea what .i18ndoc is for, so I've left that in. I would guess your problem lies in the javascript rather than the css, which I'm not any good with I'm afraid Cqm 01:21, 11 Dec 2012 (UTC)
I think .i18ndoc is for inter-language wiki partnering, the "see this article in language: ..." thing.—  Ultimate Supreme talk · wiki I · wiki II  03:24, December 11, 2012 (UTC)
Um. I wrote that code. Didn't I :) Yeah, it looks like it doesn't work with the new forum. Can you either disable the code or make me an admin for a few minutes? --  pecoes  03:54, December 11, 2012 (UTC) 
I thought that username looked familiar. :p I changed your user rights to admin. Thanks again for all your help! xD --Kyle$calise 20:56, December 11, 2012 (UTC)

Also on Fandom

Random Wiki