« Utilisateur:Thibaut120094/deln.js » : différence entre les versions
Contenu supprimé Contenu ajouté
mAucun résumé des modifications |
copie de Utilisateur:0x010C/deln.js |
||
Ligne 3 :
Retire les sauts de lignes parasites et autres machins générés par l'OCR
*/▼
add: function(fonction) {▼
},▼
exec: function() {▼
var namespace = mw.config.get('wgNamespaceNumber');▼
return;▼
}▼
var txt = $('#wpTextbox1').val();▼
}▼
$('#wpTextbox1').val(txt);▼
avec des corrections de 0x010C
if($.inArray(mw.config.get('wgAction'), ['edit', 'submit']) !== -1 ) {▼
▲*/
str = str.replace(/\n/g, "");▼
str = str.replace(/- /g, "");▼
str = str.replace(/¬/g, "");▼
});▼
// Only launch the script when editing non-talk pages
mw.loader.using( [ 'ext.gadget.InsertButton' ] )▼
&& $.inArray( mw.config.get( 'wgNamespaceNumber' ), [ 4, 8 ] ) === -1 )
{
'img_classic' : '//upload.wikimedia.org/wikipedia/commons/0/04/Button_NW.png',▼
'tooltip' : 'Retrait des sauts de ligne parasites',▼
// Remove all useless lines
// Called when the user click the button added bellow
});▼
▲ str = str.replace(/\n/g, "");
▲ str = str.replace(/- /g, "");
▲ str = str.replace(/¬/g, "");
};
// Add a button to the WikiEditor toolbar , in the main section
$( '#wpTextbox1' ).wikiEditor( 'addToToolbar', {
'section': 'main',
'group': 'insert',
'tools': {
'wsDeln': {
type: 'button',
▲
action: {
type: 'callback',
execute: lineRemover
}
}
▲ } );
▲ } );
}
|