Nota: Após salvar, você pode ter que limpar o cache do seu navegador para ver as alterações.
- Firefox / Safari: Pressione ⇧ Shift enquanto clica em Recarregar, ou pressione Ctrl + F5 ou Ctrl + R (⌘ Cmd + R em um Mac)
- Google Chrome: Pressione Ctrl + ⇧ Shift + R (⌘ Cmd + ⇧ Shift + R em um Mac)
- Internet Explorer: Pressione Ctrl enquanto clica em Recarregar, ou pressione Ctrl + F5
- Opera: Limpe o cache em Ferramentas → Preferências
var config = mw.config.get([
'wgAction',
'wgCanonicalNamespace',
'wgNamespaceNumber',
'wgPageName',
'wgRelevantUserName',
'wgTitle',
'wgUserGroups',
'wgUserName'
]),
nsid = config.wgNamespaceNumber;
//if (nsid == 10000 || nsid == 10002) $('h1#firstHeading').html($('h1#firstHeading').html().replace(': ', ':<span style="margin-left: 6px;">')+'</span>');
$(function() {
$('#p-cactions.vectorMenu .menu ul').append(
$('<li>', {id: 'ca-copytitle'}).append(
$('<a>', {title: 'Segure Ctrl para não incluir o espaço nominal', text: 'Copiar título'})
),
$('<li>', {id: 'ca-editintro'}).append(
$('<a>', {href: '?action=edit§ion=0', title: 'Editar a seção de introdução do artigo', text: 'Editar intro'})
)
);
if (!$('.mw-editsection').length) $('#ca-editintro').remove();
if (config.wgAction == 'edit' && $.inArray(mw.Uri().query.section, ['0','top']) > -1) $('#wpSummary').val('/* top */ ');
$('#ca-copytitle a').click(function(e) {
if (e.ctrlKey) navigator.clipboard.writeText(config.wgTitle);
else if (e.altKey && nsid === 10000) navigator.clipboard.writeText(config.wgPageName.replace(/_/g,' ').replace('Minecraft Dungeons','MCD'));
else if (e.altKey && nsid === 10002) navigator.clipboard.writeText(config.wgPageName.replace(/_/g,' ').replace('Minecraft Earth','MCE'));
else navigator.clipboard.writeText(config.wgPageName.replace(/_/g,' '));
mw.notify('Título copiado.');
});
if (config.wgCanonicalNamespace == 'UserProfile' && config.wgRelevantUserName != config.wgUserName) {
var newpath = document.querySelector('.achievements a').pathname + '/' + config.wgRelevantUserName;
$('.achievements a').attr('href', newpath);
}
// é difícil fazer isso, fandom?
mw.hook('wikipage.diff').add(function() {
$('.mw-diff-movedpara-left').text('↪');
$('.mw-diff-movedpara-right').text('↩');
});
mw.util.addCSS(
'[class^="mw-diff-movedpara-"]::after { content: none }'+
'[class^="mw-diff-movedpara-"], [class^="mw-diff-movedpara-"]:hover { color: inherit }'
);
});
/* agora que eu percebi que eu podia ter feito algo mais eficiente
* guardando, caso eu (ou alguém) ainda precise
if(mw.config.get('wgAction') == 'edit' & wpTextbox1.value === '') {
function redir(target, redirect, position) {
_Char = (target.startsWith('-')||target.endsWith('-')) ? '' : '_';
if(!position || position == 's') {
if(mw.config.get('wgPageName').startsWith(target.replace(/ /g,'_')+_Char)) {
wpTextbox1.value = '#REDIRECIONAMENTO [['+redirect+']]';
wpSave.click();
}
}
if(position == 'e') {
if(mw.config.get('wgPageName').endsWith(_Char+target.replace(/ /g,'_'))) {
wpTextbox1.value = '#REDIRECIONAMENTO [['+redirect+']]';
wpSave.click();
}
}
}
redir('envasada', 'Vaso', 'e');
redir('num vaso', 'Vaso', 'e');
redir('Folhas de', 'Folhas');
redir('Lã', 'Lã');
redir('Degrau de', 'Laje');
redir('Laje de', 'Laje');
redir('Madeira de', 'Madeira');
redir('Muda de', 'Mudas');
redir('Rebento de', 'Mudas');
redir('Muro de', 'Muro');
redir('Placa de pressão', 'Placa de pressão');
redir('Placa de', 'Placa');
redir('Tabuleta de', 'Placa');
redir('Porta de', 'Porta');
redir('Portão de', 'Portão');
redir('Tábuas de', 'Tábuas');
redir('Tapete', 'Tapete');
redir('Terracota', 'Terracota');
redir('infestados', 'Bloco infestado', 'e');
redir('Tijolos de pedra', 'Tijolos de pedra');
redir('Tronco de', 'Tronco');
redir('Toro de', 'Tronco');
redir('Vidraça', 'Vidraça');
redir('Vidro', 'Vidro');
}
// Realce de sintaxe para o editor fonte
// [[mw:User:Remember the dot/Syntax highlighter]]
$(function() {
mw.loader.load('//www.mediawiki.org/w/index.php?title=MediaWiki:Gadget-DotsSyntaxHighlighter.js&action=raw&ctype=text/javascript');
if (mw.config.get('skin') == 'hydradark') {
syntaxHighlighterConfig = {
boldOrItalicColor: '#44466d',
wikilinkColor: '#245477',
externalLinkColor: '#244d49',
headingColor: '#44466d',
listOrIndentColor: '#4d1a19',
signatureColor: '#66331e',
tableColor: '#5e5129',
templateColor: '#5e5129',
parameterColor: '#66331e',
hrColor: '#44466d',
tagColor: '#662946',
commentColor: '#4d1a19',
entityColor: '#474d23',
backgroundColor: 'black',
foregroundColor: 'white'
};
}
syntaxHighlighterConfig.timeout = 50;
}); */
// Reversão ancorada
// Adaptado de https://dev.fandom.com/wiki/AnchoredRollback
(function() {
if (window.AnchoredRollbackLoaded) {
return;
}
window.AnchoredRollbackLoaded = true;
var /*config = mw.config.get([
'wgUserGroups'
]),*/
isBot = config.wgUserGroups.indexOf('bot') !== -1 ||
window.anchoredRollbackBot,
msg = 'revertido';
function click(e) {
var $this = $(this),
href = new mw.Uri($this.attr('href'));
// validate that link is a rollback link for current wiki
if (
href.host !== location.hostname ||
href.query.action !== 'rollback'
) {
return;
}
e.preventDefault();
if (isBot) {
href += '&bot=1';
}
$this.html(
$('<img>', {
src: 'https://slot1-images.wikia.nocookie.net/__cb1595270000885/common/skins/common/images/ajax.gif'
})
);
$.ajax(href.toString(), {
dataType: 'text'
}).done(function() {
$this.css({
'color': 'gray',
'text-decoration': 'line-through'
}).removeAttr('href title').text(msg);
});
}
$(document.body).on('click', '.mw-rollback-link > a[href]', click);
})();