பயனர்:Info-farmer/cleanUp.js: திருத்தங்களுக்கு இடையிலான வேறுபாடு

உள்ளடக்கம் நீக்கப்பட்டது உள்ளடக்கம் சேர்க்கப்பட்டது
சி - unwanted
சி - unwanted
வரிசை 4:
@Author [[User:Info-farmer]]
*/
 
/*
if(mw.config.values.wgCanonicalNamespace==="Page"){
வரி 13 ⟶ 14:
}}
*/
 
// <source lang="javascript">
/* global $, mw, importScript, pathoschild */
 
//set some global parameters for selection
var isPageNS = mw.config.get('wgNamespaceNumber') == 104;
var isDNB00 = mw.config.get('wgTitle').match('DNB');
 
 
/*
/**</source>
* TemplateScript adds configurable templates and scripts to the sidebar, and adds an example regex editor.
* @see https://meta.wikimedia.org/wiki/TemplateScript
வரிசை 32:
[
 
// puts {{right}} into footerbox
{
name: 'endword', position: 'replaceதுப்புரவு3',
script: function(editor) {
editor.forField('#wpHeaderTextbox')
.replace(/(<\/div>)/,'{{right|}}$1');
}
},
 
{
name: 'துப்புரவு2',
position: 'cursor',
script: function(editor) {
வரி 62 ⟶ 53:
);
 
// main NS
pathoschild.TemplateScript.add(
[
// adds subst: #tag for <pages>
{ name: 'Pages', template: '<pages index=" " from= to=/>', position: 'cursor'},
 
// adds subst: #tag for <pages> with sections
{ name: 'Pages++', template: '<pages index=" " from= to= fromsection= tosection= />', position: 'cursor'},
 
// adds defaultsort for a subpage
{ name: 'defsortsubpage', template: '{{DEFAULTSORT:{{subst:SUBPAGENAME}}}}', position: 'cursor'},
 
// wikis Chapter -1/+1 to Prev/Next
{
name: 'PrevNext',
position: 'replace',
script: function (editor) {
var oldtitle = mw.config.get('wgTitle');
var prevtitle = parseInt(oldtitle.replace(/^.*\/Chapter (\d+)$/,'$1'))-1;
var headerprevious = '[[../Chapter '+prevtitle+'/]]';
var nexttitle = parseInt(oldtitle.replace(/^.*\/Chapter (\d+)$/,'$1'))+1;
var headernext = '[[../Chapter '+nexttitle+'/]]';
editor.replace(/\| previous \= \n \| next \= /, '| previous \= ' + headerprevious +'\n \| next \= ' + headernext );
}
},
 
// prev and next populated for subpages
{
name: 'pn [[//]]',
position: 'replace',
script: function (editor) {
var prevnextlink = '[[..//]]';
editor.replace(/\| previous \= \n \| next \= /, '| previous \= ' + prevnextlink +'\n \| next \= ' + prevnextlink );
}
},
 
// converts header template to DNB00
{
name: 'DNBset',
position: 'replace',
script: function (editor) {
editor.replace(/\{\{header[^\}]+\}\}\n/, '{{subst:DNBset\n |article= \n |previous= \n |next= \n |volume = \n |contributor = \n |wikipedia = \n |extra_notes= \n |from= \n |to= \n |section= \n}}');
},
enabled: isDNB00
},
 
// converts DNB endash title to a redirect
{
name: 'DNBredirect',
position: 'replace',
editSummary: 'redirect',
script: function (editor) {
editor.replace(/{{header\n \| title\s+?\= ([^–]+?)–([^\n]+?)\n[=\|\w\s\n]*}}/g, '#redirect [[$1-$2]]');
},
enabled: isDNB00
},
 
// add similar template
{
name: 'similar',
position: 'replace',
editSummary: '{{similar}}',
script: function (editor) {
editor.replace(/\{\{header/g, '{{similar|}}\n{{header');
}
},
 
// rm text quality templates
{
name: 'text quality',
position: 'replace',
script: function (editor) {
editor.replace(/\{\{TextQuality\|\d{2,3}%\}\}/, '');
}
},
 
],
{ category:'main', forNamespaces:0 } // common fields
);
 
// user talk NS
"https://ta.wikisource.org/wiki/பயனர்:Info-farmer/cleanUp.js" இலிருந்து மீள்விக்கப்பட்டது