MediaWiki:Gadget-removeNewline.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.
function removeNewline() {
t = selection();
if (t[1] !== "") {
t[1] = t[1].replace(/\r\n|\r|\n/g, ' ');
scriviBox(t.join(""), "", t[0].length, t[0].length + t[1].length);
}
else {
$('#wpTextbox1').val($('#wpTextbox1').val().replace(/\r\n|\r|\n/g, ' '));
}
}
if ( typeof $ != 'undefined' && typeof $.fn.wikiEditor != 'undefined' ) {$( function() {
$( '#wpTextbox1' ).wikiEditor( 'addToToolbar', {
'section': 'advanced',
'group': 'format',
'tools': {'section': {
label: 'Cava i a capo dal testo selessionà (o in tuto el testo)',
type: 'button',
icon: '//upload.wikimedia.org/wikipedia/commons/6/6a/Remove-newline.png',
action: {type: 'callback',
execute: function(context){removeNewline();} }
}}});});}