Jump to content

MediaWiki:Gadget-afchelper.js/submissions.js: Difference between revisions

no edit summary
m (1 revision imported)
No edit summary
Line 528: Line 528:
'Enter the content and\\/or code of the template here.',
'Enter the content and\\/or code of the template here.',
'EDIT BELOW THIS LINE',
'EDIT BELOW THIS LINE',
'Metadata: see \\[\\[Wikipedia:Persondata\\]\\].',
'Metadata: see \\[\\[Bharatpedia:Persondata\\]\\].',
'See http://en.wikipedia.org/wiki/Wikipedia:Footnotes on how to create references using\\<ref\\>\\<\\/ref\\> tags, these references will then appear here automatically',
'See http://en.bharatpedia.org.in/wiki/Bharatpedia:Footnotes on how to create references using\\<ref\\>\\<\\/ref\\> tags, these references will then appear here automatically',
'(After listing your sources please cite them using inline citations and place them after the information they cite.|Inline citations added to your article will automatically display here.) ' +
'(After listing your sources please cite them using inline citations and place them after the information they cite.|Inline citations added to your article will automatically display here.) ' +
'(Please see|See) ((https?://)?en.wikipedia.org/wiki/(Wikipedia|WP):REFB|\\[\\[Wikipedia:REFB\\]\\]) for instructions on how to add citations.'
'(Please see|See) ((https?://)?en.bharatpedia.org.in/wiki/(Bharatpedia|WP):REFB|\\[\\[Bharatpedia:REFB\\]\\]) for instructions on how to add citations.'
] );
] );
} else {
} else {
Line 543: Line 543:


// Remove initial request artifact
// Remove initial request artifact
text = text.replace( /== Request review at \[\[WP:AFC\]\] ==/gi, '' );
text = text.replace( /== Request review at \[\[BP:AFC\]\] ==/gi, '' );


// Remove sandbox templates
// Remove sandbox templates
Line 566: Line 566:
// FIXME: Break this out into its own core function? Will it be used elsewhere?
// FIXME: Break this out into its own core function? Will it be used elsewhere?
function convertExternalLinksToWikilinks( text ) {
function convertExternalLinksToWikilinks( text ) {
var linkRegex = /\[{1,2}(?:https?:)?\/\/(?:en.wikipedia.org\/wiki|enwp.org)\/([^\s\|\]\[]+)(?:\s|\|)?((?:\[\[[^\[\]]*\]\]|[^\]\[])*)\]{1,2}/ig,
var linkRegex = /\[{1,2}(?:https?:)?\/\/(?:en.bharatpedia.org.in\/wiki|enwp.org)\/([^\s\|\]\[]+)(?:\s|\|)?((?:\[\[[^\[\]]*\]\]|[^\]\[])*)\]{1,2}/ig,
linkMatch = linkRegex.exec( text ),
linkMatch = linkRegex.exec( text ),
title, displayTitle, newLink;
title, displayTitle, newLink;
Line 1,112: Line 1,112:
*/
*/
function setMessages() {
function setMessages() {
var headerBegin = '== Your submission at [[Wikipedia:Articles for creation|Articles for creation]]: ';
var headerBegin = '== Your submission at [[Bharatpedia:Articles for creation|Articles for creation]]: ';
AFCH.msg.set( {
AFCH.msg.set( {
// $1 = article name
// $1 = article name
Line 1,146: Line 1,146:
'g13-submission': '{{subst:Db-afc-notice|$1}} ~~' + '~~',
'g13-submission': '{{subst:Db-afc-notice|$1}} ~~' + '~~',


'teahouse-invite': '{{subst:Wikipedia:Teahouse/AFC invitation|sign=~~' + '~~}}'
'teahouse-invite': '{{subst:Bharatpedia:Teahouse/AFC invitation|sign=~~' + '~~}}'
} );
} );
}
}
Line 2,031: Line 2,031:


AFCH.actions.movePage( afchPage.rawTitle, data.newTitle,
AFCH.actions.movePage( afchPage.rawTitle, data.newTitle,
'Publishing accepted [[Wikipedia:Articles for creation|Articles for creation]] submission',
'Publishing accepted [[Bharatpedia:Articles for creation|Articles for creation]] submission',
{ movetalk: true } ) // Also move associated talk page if exists (e.g. `Draft_talk:`)
{ movetalk: true } ) // Also move associated talk page if exists (e.g. `Draft_talk:`)
.done( function ( moveData ) {
.done( function ( moveData ) {
Line 2,037: Line 2,037:
newPage = new AFCH.Page( moveData.to ),
newPage = new AFCH.Page( moveData.to ),
talkPage = newPage.getTalkPage(),
talkPage = newPage.getTalkPage(),
recentPage = new AFCH.Page( 'Wikipedia:Articles for creation/recent' );
recentPage = new AFCH.Page( 'Bharatpedia:Articles for creation/recent' );


// ARTICLE
// ARTICLE
Line 2,064: Line 2,064:
newPage.edit( {
newPage.edit( {
contents: newText.get(),
contents: newText.get(),
summary: 'Cleaning up accepted [[Wikipedia:Articles for creation|Articles for creation]] submission'
summary: 'Cleaning up accepted [[Bharatpedia:Articles for creation|Articles for creation]] submission'
} );
} );


Line 2,133: Line 2,133:
talkText = talkTextPrefix + '\n\n' + talkText;
talkText = talkTextPrefix + '\n\n' + talkText;


var summary = 'Placing [[Wikipedia:Articles for creation|Articles for creation]] banner';
var summary = 'Placing [[Bharatpedia:Articles for creation|Articles for creation]] banner';
if ( wikiProjectsToAdd.length > 0 ) {
if ( wikiProjectsToAdd.length > 0 ) {
summary += ', adding ' + wikiProjectsToAdd.length +
summary += ', adding ' + wikiProjectsToAdd.length +
Line 2,157: Line 2,157:
message: AFCH.msg.get( 'accepted-submission',
message: AFCH.msg.get( 'accepted-submission',
{ $1: newPage, $2: data.newAssessment } ),
{ $1: newPage, $2: data.newAssessment } ),
summary: 'Notification: Your [[Wikipedia:Articles for creation|Articles for creation]] submission has been accepted'
summary: 'Notification: Your [[Bharatpedia:Articles for creation|Articles for creation]] submission has been accepted'
} );
} );
} );
} );
Line 2,326: Line 2,326:
var hasTeahouseCat = false,
var hasTeahouseCat = false,
teahouseCategories = [
teahouseCategories = [
'Category:Wikipedians who have received a Teahouse invitation',
'Category:Bharatpedians who have received a Teahouse invitation',
'Category:Wikipedians who have received a Teahouse invitation through AfC'
'Category:Bharatpedians who have received a Teahouse invitation through AfC'
];
];


Line 2,386: Line 2,386:
AFCH.actions.logCSD( {
AFCH.actions.logCSD( {
title: afchPage.rawTitle,
title: afchPage.rawTitle,
reason: declineReason === 'cv' ? '[[WP:G12]] ({{tl|db-copyvio}})' :
reason: declineReason === 'cv' ? '[[BP:G12]] ({{tl|db-copyvio}})' :
'{{tl|db-reason}} ([[WP:AFC|Articles for creation]])',
'{{tl|db-reason}} ([[BP:AFC|Articles for creation]])',
usersNotified: data.notifyUser ? [ submitter ] : []
usersNotified: data.notifyUser ? [ submitter ] : []
} );
} );
Line 2,518: Line 2,518:
afchPage.edit( {
afchPage.edit( {
contents: text.get(),
contents: text.get(),
summary: 'Tagging abandoned [[Wikipedia:Articles for creation|Articles for creation]] draft ' +
summary: 'Tagging abandoned [[Bharatpedia:Articles for creation|Articles for creation]] draft ' +
'for speedy deletion under [[WP:G13|G13]]'
'for speedy deletion under [[BP:G13|G13]]'
} );
} );


Line 2,537: Line 2,537:
message: AFCH.msg.get( 'g13-submission',
message: AFCH.msg.get( 'g13-submission',
{ $1: AFCH.consts.pagename } ),
{ $1: AFCH.consts.pagename } ),
summary: 'Notification: [[WP:G13|G13]] speedy deletion nomination of [[' + AFCH.consts.pagename + ']]'
summary: 'Notification: [[BP:G13|G13]] speedy deletion nomination of [[' + AFCH.consts.pagename + ']]'
} );
} );
} );
} );
Line 2,544: Line 2,544:
AFCH.actions.logCSD( {
AFCH.actions.logCSD( {
title: afchPage.rawTitle,
title: afchPage.rawTitle,
reason: '[[WP:G13]] ({{tl|db-afc}})',
reason: '[[BP:G13]] ({{tl|db-afc}})',
usersNotified: usersToNotify
usersNotified: usersToNotify
} );
} );
Line 2,582: Line 2,582:
afchPage.edit( {
afchPage.edit( {
contents: text.get(),
contents: text.get(),
summary: 'Postponing [[WP:G13|G13]] speedy deletion'
summary: 'Postponing [[BP:G13|G13]] speedy deletion'
} );
} );
}
}