User:ExtorcDev/rmMaster.js: Difference between revisions

Content deleted Content added
ExtorcDev (talk | contribs)
No edit summary
ExtorcDev (talk | contribs)
No edit summary
Line 1:
//<nowiki>
$('.mw-heading').each(function(index){
var $heading = $(this).find('span.mw-headline');
Line 21 ⟶ 22:
if(sectionLog[i].match(/Requested move \d/gm) && sectionLog[i+1].match(/{{requested move.*/g)){
var section = sectionLog[i+1];
section = section + '\n{{subst:' + 'RM bottom}}\n';
var closeMSG = window.prompt("Close Message : ");
var updatedSection = section.replace(/{{requested move.*/g,'{{subst:' + 'RM top|' + closeMSG + '|nac=yes}}');
result = result.replace(sectionLog[i+1], updatedSection);
console.log(result);
Line 48 ⟶ 49:
console.log('Already relisted atleast once');
var prevRelists = section.match(/'''''Relisting.*>/);
var newRelists = prevRelists + '{{subst' + ':relisting}}';
var updatedSection = section.replace(prevRelists, newRelists);
result = result.replace(section, updatedSection);
Line 55 ⟶ 56:
}
else{
var updatedSection = section.replace(section.match(/.UTC./m),'(UTC){{subst' + ':relisting}}');
result = result.replace(section, updatedSection);
console.log(result);
editPage(url, result, 'Relisted');
}
}
Line 121 ⟶ 122:
function queryParams(loc){ return { action: 'query', prop: 'revisions', rvprop: 'content', rvlimit: 1, titles: loc }; }
function editParams(loc, addition, action){ return { action: 'edit', title: loc, text: addition, summary: action + ' Request using [[User:ExtorcDev/rmMaster.js|rmMaster]]' }; }
//</nowiki>