Utensa:Candalua/vector.js
Ocio: Daspò ver salvà, podaria esare neçesario snetare ła cache dal propio navegadore web par vedare i canbiamenti.
- Firefox / Safari: tegner strucà el boton de łe letare grande Shift e schiciare sora Ricarga, o se nò struca Ctrl-F5 o Ctrl-R (⌘-R so Mac)
- Google Chrome: strucare Ctrl-Shift-R (⌘-Shift-R so on Mac)
- Internet Explorer / Edge: tegner strucà el boton Ctrl e schiciare so Ajorna, o sinò Ctrl-F5
- Opera: Va in tel Menu → Inpostasion (Opera → Prefarense so on Mac) e pò in Privacy & sicuresa → Sneta dati del navegadore → Imajini e file in te ła cache.
/* <pre> */
var customCSSEnabled = true;
$('body').append('<div style="position:fixed; top:0; left:0; z-index: 2000;"><a href="javascript:void()" id="customCSSControl" onclick="toggleCustomCSS()"><img src="//upload.wikimedia.org/wikipedia/commons/thumb/3/33/High-contrast-view-restore.svg/20px-High-contrast-view-restore.svg.png"/></a></div>');
//abilita/disabilita css personalizzato
function toggleCustomCSS() {
if (customCSSEnabled) {
$('link[href*="user=Candalua"]').prop('disabled', true);
customCSSEnabled = false;
}
else {
$('link[href*="user=Candalua"]').prop('disabled', false);
customCSSEnabled = true;
}
}
$('.mw-trackingcategories-name').each(function() {
if ( !$(this).find('span:not(.CategoryTreeEmptyBullet)').text().match(/\d+/g) ) {
$(this).css('text-decoration', 'line-through').css('color', '#C0C0C0');
$(this).find('a').css('color', '#C0C0C0');
}
});
function getLine(n) {
return $('#wpTextbox1').val().split('\n').splice(n-1, 1);
}
function removeLine(n) {
var arr = $('#wpTextbox1').val().split('\n');
arr.splice(n-1, 1);
$('#wpTextbox1').val(arr.join('\n'));
}
function removeLineIfEmpty(n) {
if ($.trim(getLine(n)) === '') {
removeLine(n);
}
}
function removeLinesIfEmpty(from, to) {
for (i = from; i <= to; i++) {
if ($.trim(getLine(i)) === '') {
removeLine(i);
}
}
}
function editLine(n, newText) {
var arr = $('#wpTextbox1').val().split('\n');
arr.splice(n-1, 1, newText);
$('#wpTextbox1').val(arr.join('\n'));
}
function rientra(n) {
var arr = $('#wpTextbox1').val().split('\n');
arr.splice(n-1, 1, ' ' + getLine(n)[0]);
$('#wpTextbox1').val(arr.join('\n'));
}
function capolettera(n) {
var arr = $('#wpTextbox1').val().split('\n');
line = getLine(n)[0];
arr.splice(n-1, 1, '{{x-larger|' + line.substring(0, 1) + '}}' + line.substring(1));
$('#wpTextbox1').val(arr.join('\n'));
}
function cavei() {
$('#wpTextbox1').val($('#wpTextbox1').val()
.replace('<center>', '{{Centra|')
.replace('</center>', '}}')
.replace('<center>', '{{Centra|')
);
capolettera(5);
rientra(6);
rientra(7);
rientra(8);
rientra(11);
rientra(12);
rientra(13);
rientra(16);
rientra(17);
rientra(20);
rientra(21);
removeLineIfEmpty(22);
}
/* </pre> */