MediaWiki:Wikia.js: diferència entre les revisions

Mpuj (discussió | contribucions)
crear notificació
 
Mpuj (discussió | contribucions)
Ja no neva...
 
(Hi ha 10 revisions intermèdies que no es mostren del mateix usuari)
Línia 1: Línia 1:
/* Agrega una notificació a Oasis. - Obtingut de Wikidex, per [[w:c:es.pokemon:User:Ciencia Al Poder]] */
/* Etiqueta amb el flag */
window.SkinNotification = {
    (function () {
article: 'El Detectiu Conan Català Wiki:Portal de la Comunitat',
        "use strict";
key: 'NfSkin',
        var userRightsList = {
init: function() {
            "MarcmpujolBot": ["Bot"]
if (!document.cookie || document.cookie.length == 0) return;
        };
var pref = $.cookies.get(SkinNotification.key);
if (pref) return;
        if ($('.masthead-info hgroup').length) {
SkinNotification.render();
            var name = $('.masthead-info h1[itemprop="name"]').text();
},
            if (userRightsList[name] !== undefined) {
render: function() {
                var i;
var tb = $('#WikiaFooter').children('div.toolbar');
                for (i = 0; i < userRightsList[name].length; i++) {
if (!tb.exists()) return;
                    $('.masthead-info hgroup').append('<span class="tag">' + userRightsList[name][i] + '</span>');
var nf = $('#WikiaNotifications');
                }
if (!nf.exists()) {
            }
tb.prepend('<ul id="WikiaNotifications" class="WikiaNotifications"><li></li></ul>');
        }
nf = $('#WikiaNotifications');
    }());
$(document.body).addClass('notifications');
$(document.body).addClass('notifications');
/* Etiqueta per inactius */
}
InactiveUsers = { text: 'Inactiu' };
var sn = $('<div data-type="100"><a class="sprite close-notification"></a>Ajudans a fer créixer la wiki<a href="'+wgServer+wgArticlePath.replace('$1',SkinNotification.article.replace(/\s/g,'_'))+'" title="'+SkinNotification.article+'"></a>!</div>');
importScriptPage('InactiveUsers/code.js', 'dev');
nf.children().eq(0).append(sn);
sn.children().eq(0).click(SkinNotification.dismiss);
},
dismiss: function(e) {
$(e.target).parent().remove();
$.cookies.set(SkinNotification.key,'1');
}
};


function One_Piece_Català_WikiaSkinLoad() {
// **************************************************
var ug = '';
//                    Notícies
if (window.wgUserGroups) {
// **************************************************
ug = wgUserGroups.join(',').toLowerCase();
/* Afegeix en les notícies un header especial - prova */
}
$('body.ns-116 .WikiHeader .wordmark.graphic ').bind('click.capçalera', function(){ window.location.href = 'http://ca.detectiuconan.wikia.com/wiki/Noticia:Índex'; return false; });
if (ug.indexOf('s'+'taf'+'f') == -1 && ug.indexOf('h'+'elp'+'er') == -1) {
$(SkinNotification.init);
$(function(){
$(agregarEnlaceSkin);
  if ( window.wgAction == 'edit' ) {
}
    $(".WikiaMainContent").css("width", "1030px").css("padding", "0px");
}
  }
 
});
One_Piece_Català_WikiaSkinLoad();