User:PhantomTech/scripts/AFCRHS.js: Difference between revisions

Content deleted Content added
split template strings
split all double braces so that page doesn't show in http://en.wikipedia.org/wiki/Special:WhatLinksHere/Template:WikiProject ' + 'Disambiguation etc. hence on redlinked template reports like Wikipedia:Database reports/Broken WikiProject templates
Line 116:
type: 'div',
name: 'redirectTypeInstructions',
label: 'Enter "none" for none, "to acronym" for {' + '{R' + ' to acronym}}, etc.'
} );
dynamic_area.append( {
Line 170:
redirectType = form.redirectTypes.value;
if ( redirectType !== 'none' ) {
redirectType = '\n{' + '{R ' + redirectType + '}}';
} else {
redirectType = '';
Line 197:
var match = text.match( /(==.*?==\n)((.|\n)*)/ );
 
text = match[ 1 ] + '{' + '{afc-c|' + ( accept ? 'a' : 'd' ) + '}}\n' + match[ 2 ] + '\n:{' + '{su' + 'bst:afc redirect|' + redirectTemplateCode + '|' + comment + '}} ~~' + '~~\n{' + '{afc' + '-c|b}}';
 
page.setPageSection( sectionID );
Line 210:
var targetPageTalkPage = new Morebits.wiki.page( 'Talk:' + target );
targetPageTalkPage.load( function () {
var talkPageText = '{' + '{sub' + 'st:WPAFC/redirect}}';
if ( targetPageTalkPage.getPageText().indexOf("{" + "{Disambig" + "Project}}") > -1 || targetPageTalkPage.getPageText().indexOf("{" + "{ Disambig" + "Project }}") > -1 ) {
talkPageText += '\n{' + '{WikiProject ' + 'Disambiguation|class=redirect}}';
}
var match = targetPageTalkPage.getPageText().match( /\{\{ ?WikiProject (?!Articles for creation)(.*?)(?=\n|\||}})/ig );