User:Raoli/common.js
Jump to navigation
Jump to search
Note: After publishing, you may have to bypass your browser's cache to see the changes.
- Firefox / Safari: Hold Shift while clicking Reload, or press either Ctrl-F5 or Ctrl-R (⌘-R on a Mac)
- Google Chrome: Press Ctrl-Shift-R (⌘-Shift-R on a Mac)
- Edge: Hold Ctrl while clicking Refresh, or press Ctrl-F5.
// Aggiunta automatica personale
importScript("User:Raoli/autoEdit.js")
/*
Questo strumento consente di monitorare i cambiamenti recenti di un wiki in tempo reale.
In tal modo fornisce un sacco di funzioni, come ad esempio Timeframing, filtraggio, Auto-Diff
e molto altro ancora...
*/
// [[File:Krinkle_RTRC.js]]
mw.loader.load('//meta.wikimedia.org/w/index.php?title=User:Krinkle/RTRC.js&action=raw&ctype=text/javascript');
/*** Collegamento diretto a UMTR nel portlet Utente */
$(function(){
mw.util.addPortletLink('p-personal', '//wikidata.org/wiki/User:Krinkle/RTRC',
'♣ UMTR', 't-UMTR', 'Ultime modifiche in tempo reale', 'm', '#pt-userpage');
});
// Pulsanti personali
importScript("User:Raoli/Gadget-PulsantiBase.js")
// HotCatMulti
mw.loader.load('//fr.wikipedia.org/w/index.php?title=Mediawiki:Gadget-HotCatsMulti.js&action=raw&ctype=text/javascript');
// Personalizzazioni al gadget HotCatMulti
function hotcat_SiteCustom(){
hotcat_suggestion_delay = ""
hotcat_text_MultiLinkText = "(+<sup>+</sup>)";
hotcat_text_RecapRemove = "Categorie da cancellare";
hotcat_text_RecapModify = "Categorie da modificare";
hotcat_text_RecapAdd = "Categorie da aggiungere";
hotcat_docURL = "//it.wikiquote.org/wiki/Aiuto:Gadget-HotCatMulti";
hotcat_text_ResumeScript = "[[q:it:Aiuto:Gadget-HotCatMulti|HotCatMulti]] : ";
}
/*
[[File:Krinkle_WhatLeavesHere.js]]
EsconoDaQui : Una pagina speciale per l'estrazione
di tutti i link dalla pagina corrente. Accessibile
dal menù laterale nella sezione "Strumenti"
*/
mw.loader.load('//meta.wikimedia.org/w/index.php?title=User:Krinkle/Tools/WhatLeavesHere.js&action=raw&ctype=text/javascript');
/*
Purga : Abilita una linguetta a fianco della barra di ricerca che dà la possibilità di eliminare la cache della pagina. (solo per Vector)
*/
$( function() {
if ( !$( '#ca-purge' ).length) {
mw.util.addPortletLink(
'p-cactions',
mw.util.getUrl( mw.config.get( 'wgPageName' ) ) + '?action=purge',
mw.config.get( 'skin' ) == 'vector' ? 'Purga' : '*',
'ca-purge',
'Purga la cache di questa pagina',
'*'
);
}
});
/*
Correzione della posizione del link [modifica] all'interno della pagina
*/
$(function(){
try {
if (!(typeof oldEditsectionLinks == 'undefined' || oldEditsectionLinks == false)) return;
var spans = document.getElementsByTagName("span");
for (var s = 0; s < spans.length; ++s) {
var span = spans[s];
if (span.className == "editsection") {
span.style.fontSize = "x-small";
span.style.fontWeight = "normal";
span.style.cssFloat = span.style.styleFloat = "none";
span.parentNode.appendChild(document.createTextNode(" "));
span.parentNode.appendChild(span);
}
}
} catch (e) { /* something went wrong */ }
});
/*
Evidenzia interlink
*/
if( mw.config.get( 'wgNamespaceNumber' ) === 0) {
$( function(){
var $tool = $( 'table.wb-sitelinks' );
$tool.find( '.wb-sitelinks-it, .wb-sitelinks-en' )
.prependTo( $tool.find( 'tbody' ) )
.find( 'td' )
.css( 'background-color', '#CFC' );
} );
}
/*
Contrassegna amministratori
*/
importScript( 'User:NordNordWest/markAdmins.js' );
/*
Autocompilazione
*/
importScript( 'User:Waldir/autoFill.js' );
/*
Anteprima voce
*/
var title = $('.wb-sitelinks-link-en a').text();
title = $('.wb-sitelinks-link-it a').text();
if (title !== '') {
$.getJSON('//it.wikipedia.org/w/api.php?action=query&prop=extracts&exintro&exchars=1000&titles='+title+'&format=json&callback=?', function(data) {
$('#x-articlepreview').append('<h4>Italiano</h4>' + data.query.pages[Object.keys(data.query.pages)[0]].extract);
});
}
if (title !== '') {
$.getJSON('//en.wikipedia.org/w/api.php?action=query&prop=extracts&exintro&exchars=2000&titles='+title+'&format=json&callback=?', function(data) {
$('#x-articlepreview').append('<h4>English</h4>' + data.query.pages[Object.keys(data.query.pages)[0]].extract);
});
}
$('.wb-widget-container').html('<div id="x-articlepreview" style="max-width:35em;margin-left:30px;"><h3>Article preview</h3></div>');