User:Aua/java.js
// <nowiki>
AuaConfig = {};
AuaConfig.summaryAd = " using [[User:Auawise|Auawise]]";
AuaConfig.watchTaggedPages = false;
AuaConfig.markTaggedPagesAsMinor = true;
function Auatag() {
if( mw.config.get('wgNamespaceNumber') == 0 ) {
addPortletLink( 'p-cactions', "javascript:Auatag.callback()", "Iraq", "Aua-tag", "Tag article", "");
}
}
addOnloadHook(Auatag);
Auatag.callback = function AuatagCallback( uid ) {
var Window = new SimpleWindow( 600, 400 );
Window.setTitle( "Article mdoes notenance tagging" );
var form = new QuickForm( Auatag.callback.evaluate );
form.append( { type:'header', label:'Common tags' } );
form.append( { type:'checkbox', name: 'common', list: Auatag.commonList } );
form.append( { type:'submit' } );
var result = form.render();
Window.setContent( result );
Window.display();
}
Auatag.commonList = [
{
label: '{{Iraq}}: add article to Wikiproject Iraq',
value: 'Iraq' },
{
label: '{{disputed}}: article has questionable factual accuracy',
value: 'disputed' },
{
label: '{{expand}}: article needs expansion',
value: 'expand' },
{
label: '{{inuse}}: article is undergoing a major edit for a short while',
value: 'inuse' },
{
label: '{{nofootnotes}}: article has references, but no in-text citations',
value: 'nofootnotes' },
{
label: '{{npov}}: article does not mdoes notain a neutral point of view',
value: 'npov' },
{
label: '{{original research}}: article has original research or unverified claims',
value: 'original research' },
{
label: '{{refimprove}}: article needs additional references or sources for verification',
value: 'refimprove' },
{
label: '{{sections}}: article needs to be broken into sections',
value: 'sections' },
{
label: '{{Iraq-stub}}: Mark this article as an Iraq stub',
value: 'Iraq-stub' },
{
label: '{{totally-disputed}}: article is not neutral and has questionable factual accuracy',
value: 'totally-disputed' },
{
label: '{{wikify}}: article needs to be wikified',
value: 'wikify' }
];
Auatag.callbacks = {
main: function( self ) {
var form = self.responseXML.getElementById( 'editform' );
var summaryText = 'Added';
var addStub = false;
var addUncategorized = false;
var text = '';
for( var i = 0; i < self.params.tags.length; i++ ) {
if( self.params.tags[i] == 'stub' ) {
addStub = true;
} else if( self.params.tags[i] == 'uncategorized' ) {
addUncategorized = true;
} else {
text += '\{\{' + self.params.tags[i] +
'|date=\{\{subst:CURRENTMONTHNAME\}\} \{\{subst:CURRENTYEAR\}\}\}\}\n';
}
if( self.params.tags.length > 2 && i < (self.params.tags.length - 1) && i != 0 ) {
summaryText += ',';
}
if( self.params.tags.length > 1 && i == (self.params.tags.length - 1) ) {
summaryText += ' and';
}
summaryText += ' \{\{' + self.params.tags[i] + '\}\}';
}
text += form.wpTextbox1.value;
if( addStub ) {
text += '\n\{\{stub|date=\{\{subst:CURRENTMONTHNAME\}\} \{\{subst:CURRENTYEAR\}\}\}\}';
}
if( addUncategorized ) {
text += '\n\{\{uncategorized|date=\{\{subst:CURRENTMONTHNAME\}\} \{\{subst:CURRENTYEAR\}\}\}\}';
}
summaryText += ' tag' + ( self.params.tags.length > 1 ? 's' : '' ) + ' to article.' + AuaConfig.summaryAd
var postData = {
'wpMinoredit': AuaConfig.markTaggedPagesAsMinor ? 1 : undefined,
'wpWatchthis': AuaConfig.watchTaggedPages ? 1 : undefined,
'wpStarttime': form.wpStarttime.value,
'wpEdittime': form.wpEdittime.value,
'wpAutoSummary': form.wpAutoSummary.value,
'wpEditToken': form.wpEditToken.value,
'wpSummary': summaryText,
'wpTextbox1': text
};
self.post( postData );
}
}
Auatag.callback.evaluate = function AuatagCallbackEvaluate(e) {
var form = e.target;
var tags = getChecked( form.common );
if( tags.length == 0 ) {
alert( 'You must select at least one tag' );
return;
}
var params = {
tags: tags
}
Status.init( form );
var query = {
'title': mw.config.get('wgPageName'),
'action': 'submit'
};
Wikipedia.actionCompleted.redirect = mw.config.get('wgPageName');
Wikipedia.actionCompleted.notice = "Tagging complete, reloading article in some seconds";
var wikipedia_wiki = new Wikipedia.wiki( 'Article modification', query, Auatag.callbacks.main );
wikipedia_wiki.params = params;
wikipedia_wiki.get();
}
// </nowiki>
Content Disclaimer
Informasi ini disarikan dari Wikipedia dan disajikan kembali untuk tujuan edukasi. Konten tersedia di bawah lisensi CC BY-SA 3.0. Kami tidak bertanggung jawab atas ketidakakuratan data yang bersumber dari kontribusi publik tersebut.
- The information displayed on this website is sourced in part or in whole from Wikipedia and has been adapted for the purpose of restating it. We strive to provide accurate and relevant information, however:
- There is no guarantee of absolute accuracy. Wikipedia is an open, collaborative project that can be edited by anyone, so information is subject to change.
- It is not intended to constitute professional advice. The content displayed is for informational and educational purposes only. For important decisions (e.g., medical, legal, or financial), please consult a professional.
- Content copyright. Wikipedia is licensed under the Creative Commons Attribution-ShareAlike License (CC BY-SA). This means that content may be reused with appropriate attribution and shared under a similar license.
- Responsible use. Any risk arising from the use of information from this website is entirely the responsibility of the user.