Diferencia entre revisiones de «Usuario:Candalua/common.js»

Contenido eliminado Contenido añadido
Candalua (Discusión | contribs.)
Sin resumen de edición
Candalua (Discusión | contribs.)
Sin resumen de edición
Línea 1:
mw.loader.load('//wikisource.org/w/index.php?title=MediaWiki:Compare.js&action=raw&ctype=text/javascript');
mw.loader.load('//wikisource.org/w/index.php?title=MediaWiki:TextSizeModifier.js&action=raw&ctype=text/javascript');
 
 
// FUNCTIONS TO ENLARGE/REDUCE THE FONT
 
self.ws_messages = {
'optlist': 'Display options',
'text_size': 'Text size:',
'enlarge_font': '+',
'reduce_font': '-',
'enlarge_font_tooltip': 'Enlarge the size of the text',
'reduce_font_tooltip': 'Reduce the size of the text'
}
 
 
//default size 100% - range is between 50%-200%
fontSize = 100;
function enlargeFont() {
if (fontSize < 200) {
fontSize += 10;
$(".textBody").css("font-size", fontSize +"%");
}
}
function reduceFont() {
if (fontSize > 50) {
fontSize -= 10;
$(".textBody").css("font-size", fontSize +"%");
}
}
 
 
if (wgNamespaceNumber == 0) {
$(document).ready( function() {
get_optlist();
$('#optlist').append('<li id="text_size"></li>');
$('#text_size').append(ws_msg('text_size'));
$('#text_size').append(' <a href="javascript:void(0)" id="enlarge_font" onclick="enlargeFont()" title="' + ws_msg('enlarge_font_tooltip') + '">' + ws_msg('enlarge_font') + '</a>');
$('#text_size').append(' <a href="javascript:void(0)" id="reduce_font" onclick="reduceFont()" title="' + ws_msg('reduce_font_tooltip') + '">' + ws_msg('reduce_font') + '</a>');
 
//expand as default
$("#p-displayOptions").removeClass('collapsed').addClass('expanded')
$("#p-displayOptions > div.body").show();
});
}