Usuário:Miguel Couto/twinklewarn.js

Origem: Wikipédia, a enciclopédia livre.

Nota: Depois de publicar, poderá ter de contornar a cache do seu navegador para ver as alterações.

  • Firefox / Safari: Pressione Shift enquanto clica Recarregar, ou pressione Ctrl-F5 ou Ctrl-R (⌘-R no Mac)
  • Google Chrome: Pressione Ctrl-Shift-R (⌘-Shift-R no Mac)
  • Internet Explorer / Edge: Pressione Ctrl enquanto clica Recarregar, ou pressione Ctrl-F5
  • Opera: Pressione Ctrl-F5.
// If TwinkleConfig aint exist.
if( typeof( TwinkleConfig ) == 'undefined' ) {
 TwinkleConfig = {};
}

/**
 TwinkleConfig.showSharedIPNotice may take arguments:
 true: to show shared ip notice if an IP address
 false: to not print the notice
 */
if( typeof( TwinkleConfig.showSharedIPNotice ) == 'undefined' ) {
 TwinkleConfig.showSharedIPNotice = true;
}

/**
 TwinkleConfig.watchWarnings (boolean)
 if true, watch the page which has been dispatched an warning or notice, if false, default applies
 */
if( typeof( TwinkleConfig.watchWarnings ) == 'undefined' ) {
 TwinkleConfig.watchWarnings = true;
}

/**
 TwinkleConfig.summaryAd (string)
 If ad should be added or not to summary, default [[WP:TWINKLE|TWINKLE]]
 */
if( typeof( TwinkleConfig.summaryAd ) == 'undefined' ) {
 TwinkleConfig.summaryAd = " using [[WP:TWINKLE|TW]]";
}

function twinklewarn() {
 if( wgNamespaceNumber == 3 ) {
 mw.util.addPortletLink( 'p-cactions', "javascript:twinklewarn.callback()", "warn", "tw-warn", "Warn/Notify user", "");
 }
}
$(twinklewarn);

twinklewarn.callback = function twinklewarnCallback() {
 var Window = new SimpleWindow( 600, 400 );
 Window.setTitle( "Warn/Notify user" ); 
 var form = new QuickForm( twinklewarn.callback.evaluate );

 var main_select = form.append( {
 type:'field',
 label:'Escolha o tipo de aviso', 
 tooltip:'Choose first the main group you want to issue, then choose an appropriate type to issue.'
 } );

 var main_group = main_select.append( {
 type:'select',
 name:'main_group',
 event:twinklewarn.callback.change_category 
 } );

 main_group.append( { type:'option', label:'Edição de artigos', value:'level1', selected:true } );
 main_group.append( { type:'option', label:'Vandalismos', value:'vandalismos' } );
 main_group.append( { type:'option', label:'Warning (3)', value:'level3' } );
 main_group.append( { type:'option', label:'Final warning (4)', value:'level4' } );
 main_group.append( { type:'option', label:'Only warning (4im)', value:'level4im' } );
 main_group.append( { type:'option', label:'Single issue notices', value:'singlenotice' } );
 main_group.append( { type:'option', label:'Single issue warnings', value:'singlewarn' } );
 if( userIsInGroup( 'sysop' ) ) {
 main_group.append( { type:'option', label:'Blocking', value:'block' } );
 }

 main_select.append( { type:'select', name:'sub_group' } ); //Will be empty to begin with.

 form.append( { 
 type:'input',
 name:'article',
 label:'Artigo em causa',
 value:( QueryString.exists( 'vanarticle' ) ? QueryString.get( 'vanarticle' ) : '' ),
 tooltip:'Se preenchido, o nome do artigo é colocado na predefinição e/ou no sumário'
 } );


 var more = form.append( { type:'field', label:'Preencha a caixa e carregue em \"Submeter\"' } );
 more.append( { type:'textarea', label:'Insira motivo/razão ou mensagem adicional:', name:'reason', tooltip:'Perhaps a reason, or that a more detailed notice must be appended' } );
 more.append( { type:'submit', label:'Submeter' } );
 var result = form.render();
 Window.setContent( result );
 Window.display();
 result.main_group.root = result;

 // We must init the first choice (General Note);
 var evt = document.createEvent( "Event" );
 evt.initEvent( 'change', true, true );
 result.main_group.dispatchEvent( evt );

}

// This is all the messages that might be dispatched by the code
twinklewarn.messages = {
 level1: {
 "bv-av": { 
 label:"Aviso e boas-vindas (IP)", 
 summary:"Aviso: Vandalismo" 
 },
 "av": { 
 label:"Vandalismo", 
 summary:"Aviso: Vandalismo" 
 },
 "bv-propaganda": { 
 label:"Propaganda", 
 summary:"Aviso: Propaganda em artigo" 
 },
 "não copie": { 
 label:"Cópia de material de outros lugares", 
 summary:"Aviso: Cópia de material" 
 },
 "av-test": { 
 label:"Teste em artigo", 
 summary:"Aviso: Teste em artigo" 
 },
 "av-assinatura": { 
 label:"Assinou artigo", 
 summary:"Aviso: Assinatura em artigo" 
 },
 "av-cat": { 
 label:"Não colocou categoria no artigo", 
 summary:"Aviso: Colocar categoria em artigo" 
 },
 "av-prev": { 
 label:"Salvamento sucessivo em artigo", 
 summary:"Aviso: Salvamento sucessivo" 
 },
 "ortografia": { 
 label:"Ortografia", 
 summary:"Aviso: Mudança da norma ortográfica" 
 },
 "uw-upv1": { 
 label:"User page vandalism", 
 summary:"General note: User page vandalism" 
 },
 "uw-spam1": { 
 label:"Adding spam links", 
 summary:"General note: Adding spam links" 
 },
 "uw-ad1": { 
 label:"Using Wikipedia for advertising or promotion", 
 summary:"General note: Using Wikipedia for advertising or promotion" 
 },
 "uw-npov1": { 
 label:"Not adhering to neutral point of view", 
 summary:"General note: Not adhering to neutral point of view" 
 },
 "uw-unsor1": { 
 label:"Addition of unsourced material without proper citations", 
 summary:"General note: Addition of unsourced material without proper citations" 
 },
 "uw-error1": { 
 label:"Introducing deliberate factual errors", 
 summary:"General note: Introducing deliberate factual errors" 
 },
 "uw-biog1": { 
 label:"Adding unreferenced controversial information about living persons", 
 summary:"General note: Adding unreferenced controversial information about living persons" 
 },
 "uw-defam1": { 
 label:"Defamation not specifically directed", 
 summary:"General note: Defamation not specifically directed" 
 },
 "uw-uncen1": { 
 label:"Censorship of material", 
 summary:"General note: Censorship of material" 
 },
 "uw-mos1": { 
 label:"Manual of style", 
 summary:"General note: Formatting, date, language, etc (Manual of style)" 
 },
 "uw-move1": { 
 label:"Page moves", 
 summary:"General note: Page moves" 
 },
 "uw-chat1": { 
 label:"Using talk page as forum", 
 summary:"General note: Using talk page as forum" 
 },
 "uw-tpv1": { 
 label:"Refactoring others' talk page comments", 
 summary:"General note: Refactoring others' talk page comments" 
 },
 "uw-afd1": { 
 label:"Removing \{\{afd\}\} templates", 
 summary:"General note: Removing \{\{afd\}\} templates" 
 },
 "uw-speedy1": { 
 label:"Removing \{\{speedy deletion\}\} templates", 
 summary:"General note: Removing \{\{speedy deletion\}\} templates" 
 },
 "uw-npa1": { 
 label:"Personal attack directed at a specific editor", 
 summary:"General note: Personal attack directed at a specific editor" 
 },
 "uw-agf1": { 
 label:"Not assuming good faith", 
 summary:"General note: Not assuming good faith" 
 },
 "uw-own1": { 
 label:"Ownership of articles", 
 summary:"General note: Ownership of articles"
 }
 },
 vandalismos: {
 "Usuário:Lijealso/aviso1": { 
 label:"Edições de teste", 
 summary:"Caution: Vandalism" 
 },
 "Usuário:Lijealso/aviso2": { 
 label:"Edições sem sentido", 
 summary:"Aviso: Edições sem sentido" 
 },
 "Usuário:Lijealso/aviso3": { 
 label:"Branqueio", 
 summary:"Aviso: branqueio de páginas" 
 },
 "Usuário:Lijealso/aviso4": { 
 label:"Aviso para parar", 
 summary:"Aviso para parar" 
 },
 "Usuário:Lijealso/aviso5": { 
 label:"Último aviso antes de bloqueio", 
 summary:"Último aviso antes de bloqueio" 
 }
 },
 level3: {
 "uw-vandalism3": { 
 label:"Vandalism", 
 summary:"Warning: Vandalism" 
 },
 "uw-test3": { 
 label:"Editing tests", 
 summary:"Warning: Editing tests" 
 },
 "uw-delete3": { 
 label:"Page blanking, removal of content or templates", 
 summary:"Warning: Page blanking, removal of content or templates" 
 },
 "uw-joke3": { 
 label:"Using improper humor", 
 summary:"Warning: Using improper humor" 
 },
 "uw-create3": { 
 label:"Creating inappropriate pages", 
 summary:"Warning: Creating inappropriate pages" 
 },
 "uw-upload3": { 
 label:"Uploading inappropriate images", 
 summary:"Warning: Uploading inappropriate images" 
 },
 "uw-image3": { 
 label:"Image-related vandalism", 
 summary:"Warning: Image-related vandalism" 
 },
 "uw-upv3": { 
 label:"User page vandalism", 
 summary:"Warning: User page vandalism" 
 },
 "uw-spam3": { 
 label:"Adding spam links", 
 summary:"Warning: Adding spam links" 
 },
 "uw-ad3": { 
 label:"Using Wikipedia for advertising or promotion", 
 summary:"Warning: Using Wikipedia for advertising or promotion" 
 },
 "uw-npov3": { 
 label:"Not adhering to neutral point of view", 
 summary:"Warning: Not adhering to neutral point of view" 
 },
 "uw-unsor3": { 
 label:"Addition of unsourced material without proper citations", 
 summary:"Warning: Addition of unsourced material without proper citations" 
 },
 "uw-error3": { 
 label:"Introducing deliberate factual errors", 
 summary:"Warning: Introducing deliberate factual errors" 
 },
 "uw-biog3": { 
 label:"Adding unreferenced controversial information about living persons", 
 summary:"Warning: Adding unreferenced controversial information about living persons" 
 },
 "uw-defam3": { 
 label:"Defamation not specifically directed", 
 summary:"Warning: Defamation not specifically directed" 
 },
 "uw-uncen3": { 
 label:"Censorship of material", 
 summary:"Warning: Censorship of material" 
 },
 "uw-mos3": { 
 label:"Manual of style", 
 summary:"Warning: Formatting, date, language, etc (Manual of style)" 
 },
 "uw-move3": { 
 label:"Page moves", 
 summary:"Warning: Page moves" 
 },
 "uw-chat3": { 
 label:"Using talk page as forum", 
 summary:"Warning: Using talk page as forum" 
 },
 "uw-tpv3": { 
 label:"Refactoring others' talk page comments", 
 summary:"Warning: Refactoring others' talk page comments" 
 },
 "uw-afd3": { 
 label:"Removing \{\{afd\}\} templates", 
 summary:"Warning: Removing \{\{afd\}\} templates" 
 },
 "uw-speedy3": { 
 label:"Removing \{\{speedy deletion\}\} templates", 
 summary:"Warning: Removing \{\{speedy deletion\}\} templates" 
 },
 "uw-npa3": { 
 label:"Personal attack directed at a specific editor", 
 summary:"Warning: Personal attack directed at a specific editor" 
 },
 "uw-agf3": { 
 label:"Not assuming good faith", 
 summary:"Warning: Not assuming good faith" 
 },
 "uw-own3": { 
 label:"Ownership of articles", 
 summary:"Warning: Ownership of articles"
 }
 },
 level4: {
 "uw-vandalism4": { 
 label:"Vandalism", 
 summary:"Final warning: Vandalism" 
 },
 "uw-delete4": { 
 label:"Page blanking, removal of content or templates", 
 summary:"Final warning: Page blanking, removal of content or templates" 
 },
 "uw-joke4": { 
 label:"Using improper humor", 
 summary:"Final warning: Using improper humor" 
 },
 "uw-create4": { 
 label:"Creating inappropriate pages", 
 summary:"Final warning: Creating inappropriate pages" 
 },
 "uw-upload4": { 
 label:"Uploading inappropriate images", 
 summary:"Final warning: Uploading inappropriate images" 
 },
 "uw-image4": { 
 label:"Image-related vandalism", 
 summary:"Final warning: Image-related vandalism" 
 },
 "uw-spam4": { 
 label:"Adding spam links", 
 summary:"Final warning: Adding spam links" 
 },
 "uw-ad4": { 
 label:"Using Wikipedia for advertising or promotion", 
 summary:"Final warning: Using Wikipedia for advertising or promotion" 
 },
 "uw-npov4": { 
 label:"Not adhering to neutral point of view", 
 summary:"Final warning: Not adhering to neutral point of view" 
 },
 "uw-biog4": { 
 label:"Adding unreferenced controversial information about living persons", 
 summary:"Final warning: Adding unreferenced controversial information about living persons" 
 },
 "uw-defam4": { 
 label:"Defamation not specifically directed", 
 summary:"Final warning: Defamation not specifically directed" 
 },
 "uw-move4": { 
 label:"Page moves", 
 summary:"Final warning: Page moves" 
 },
 "uw-chat4": { 
 label:"Using talk page as forum", 
 summary:"Final warning: Using talk page as forum" 
 },
 "uw-afd4": { 
 label:"Removing \{\{afd\}\} templates", 
 summary:"Final warning: Removing \{\{afd\}\} templates" 
 },
 "uw-speedy4": { 
 label:"Removing \{\{speedy deletion\}\} templates", 
 summary:"Final warning: Removing \{\{speedy deletion\}\} templates" 
 },
 "uw-npa4": { 
 label:"Personal attack directed at a specific editor", 
 summary:"Final warning: Personal attack directed at a specific editor"
 }
 },
 level4im: {
 "uw-vandalism4im": { 
 label:"Vandalism", 
 summary:"Only warning: Vandalism" 
 },
 "uw-delete4im": { 
 label:"Page blanking, removal of content or templates", 
 summary:"Only warning: Page blanking, removal of content or templates" 
 },
 "uw-create4im": { 
 label:"Creating inappropriate pages", 
 summary:"Only warning: Creating inappropriate pages" 
 },
 "uw-upload4im": { 
 label:"Uploading inappropriate images", 
 summary:"Only warning: Uploading inappropriate images" 
 },
 "uw-image4im": { 
 label:"Image-related vandalism", 
 summary:"Only warning: Image-related vandalism" 
 },
 "uw-spam4im": { 
 label:"Adding spam links", 
 summary:"Only warning: Adding spam links" 
 },
 "uw-defam4im": { 
 label:"Defamation not specifically directed", 
 summary:"Only warning: Defamation not specifically directed" 
 },
 "uw-move4im": { 
 label:"Page moves", 
 summary:"Only warning: Page moves" 
 },
 "uw-npa4im": { 
 label:"Personal attack directed at a specific editor", 
 summary:"Only warning: Personal attack directed at a specific editor"
 }
 },
 singlenotice: {
 "uw-2redirect": { 
 label:"Creating double redirects through bad page moves", 
 summary:"Notice: Creating double redirects through bad page moves" 
 },
 "uw-aiv": { 
 label:"Bad AIV report", 
 summary:"Notice: Bad AIV report" 
 },
 "uw-articlesig": { 
 label:"Adding signatures to article space", 
 summary:"Notice: Adding signatures to article space" 
 },
 "uw-autobiography": { 
 label:"Creating autobiographies", 
 summary:"Notice: Creating autobiographies" 
 },
 "uw-badcat": { 
 label:"Adding incorrect categories", 
 summary:"Notice: Adding incorrect categories" 
 },
 "uw-bite": { 
 label:"\"Biting\" newcomers", 
 summary:"Notice: \"Biting\" newcomers" 
 },
 "uw-c&pmove": { 
 label:"Cut and paste moves", 
 summary:"Notice: Cut and paste moves" 
 },
 "uw-coi": { 
 label:"Conflict of Interest", 
 summary:"Notice: Conflict of Interest" 
 },
 "uw-date": { 
 label:"Unnecessarily changing date formats", 
 summary:"Notice: Unnecessarily changing date formats" 
 },
 "uw-editsummary": { 
 label:"Not using edit summary", 
 summary:"Notice: Not using edit summary" 
 },
 "uw-english": { 
 label:"Not communicating in English", 
 summary:"Notice: Not communicating in English" 
 },
 "uw-italicize": { 
 label:"Italicize books, films, albums, magazines, TV series, etc within articles", 
 summary:"Notice: Italicize books, films, albums, magazines, TV series, etc within articles" 
 },
 "uw-lang": { 
 label:"Unnecessarily changing between British and American English", 
 summary:"Notice: Unnecessarily changing between British and American English" 
 },
 "uw-linking": { 
 label:"For excessive addition of redlinks or repeated blue links", 
 summary:"Notice: For excessive addition of redlinks or repeated blue links" 
 },
 "uw-minor": { 
 label:"Incorrect use of minor edits check box", 
 summary:"Notice: Incorrect use of minor edits check box" 
 },
 "uw-preview": { 
 label:"Use preview button to avoid mistakes", 
 summary:"Notice: Use preview button to avoid mistakes" 
 },
 "uw-selfrevert": { 
 label:"Reverting self tests", 
 summary:"Notice: Reverting self tests" 
 },
 "uw-subst": { 
 label:"Remember to subst: templates", 
 summary:"Notice: Remember to subst: templates" 
 },
 "uw-talkinarticle": { 
 label:"Talk in article", 
 summary:"Notice: Talk in article" 
 },
 "uw-tilde": { 
 label:"Not signing posts", 
 summary:"Notice: Not signing posts" 
 },
 "uw-uaa": { 
 label:"Reporting of username to WP:UAA not accepted", 
 summary:"Notice: Reporting of username to WP:UAA not accepted" 
 },
 "uw-warn": { 
 label:"Warning vandals", 
 summary:"Notice: Warning vandals"
 }
 },
 singlewarn: {
 "uw-3rr": { 
 label:"Potentially violating the three revert rule", 
 summary:"Warning: Potentially violating the three revert rule" 
 },
 "uw-attack": { 
 label:"Creating attack pages", 
 summary:"Warning: Creating attack pages" 
 },
 "uw-bv": { 
 label:"Blatant vandalism", 
 summary:"Warning: Blatant vandalism" 
 },
 "uw-canvass": { 
 label:"Canvassing", 
 summary:"Warning: Canvassing" 
 },
 "uw-copyright": { 
 label:"Copyright violation", 
 summary:"Warning: Copyright violation" 
 },
 "uw-copyright-link": { 
 label:"Linking to copyrighted works violation", 
 summary:"Warning: Linking to copyrighted works violation" 
 },
 "uw-hoax": { 
 label:"Creating hoaxes", 
 summary:"Warning: Creating hoaxes" 
 },
 "uw-legal": { 
 label:"Making legal threats", 
 summary:"Warning: Making legal threats" 
 },
 "uw-longterm": { 
 label:"Long term pattern of vandalism", 
 summary:"Warning: Long term pattern of vandalism" 
 },
 "uw-multipleIPs": { 
 label:"Usage of multiple IPs", 
 summary:"Warning: Usage of multiple IPs" 
 },
 "uw-pinfo": { 
 label:"Personal info", 
 summary:"Warning: Personal info" 
 },
 "uw-redirect": { 
 label:"Creating malicious redirects", 
 summary:"Warning: Creating malicious redirects"
 }
 },
 block: {
 "bloqueado": {
 'label':"Block level 1",
 'summary':"You have been temporary blocked"
 },
 "uw-block2": {
 'label':"Block level 2",
 'summary':"You have been blocked"
 },
 "uw-block3": {
 'label':"Block level 3",
 'summary':"You have been indefinetly blocked"
 },
 "uw-ablock": {
 'label':"Anonymous block",
 'summary':"Your IP address has been blocked"
 },
 "uw-sblock": {
 'label':"Spam block",
 'summary':"You have been blocked for spamming"
 },
 "uw-vblock": {
 'label':"Vandalism",
 'summary':"You have been blocked for vandalism"
 },
 "uw-dblock": {
 'label':"Delete block",
 'summary':"You have been blocked for deletion"
 },
 "uw-3block": {
 'label':"3RR block",
 'summary':"You have been blocked for violation of the [[WP:3RR|3RR]] rule"
 },
 "uw-ublock": {
 'label':"Username block",
 'summary':"You have been blocked for violation of the [[WP:U|username policy]]"
 }
 }
};


twinklewarn.callback.change_category = function twinklewarnCallbackChangeCategory(e) {
 var value = e.target.value;
 var sub_group = e.target.root.sub_group;
 var messages = twinklewarn.messages[ value ];
 sub_group.main_group = value;

 while( sub_group.hasChildNodes() ){
 sub_group.removeChild( sub_group.firstChild );
 }

 for( var i in messages ) {
 var elem = new QuickForm.element( { type:'option', label:messages[i].label, value:i } );
 sub_group.appendChild( elem.render() );
 }

 if( value == 'block' ) {
 var more = new QuickForm.element( {
 type: 'input',
 name: 'block_timer',
 label: 'Tempo de bloqueio: ',
 tooltip: 'Coloque o tempo de bloqueio. Exemplo: 2 horas, 1 dia, 1 semana, infinito'
 } );
 e.target.root.insertBefore( more.render(), e.target.root.lastChild );
 e.target.root.article.disabled = true;
 } else if( e.target.root.block_timer ) {
 e.target.root.removeChild( e.target.root.block_timer.parentNode );
 e.target.root.article.disabled = false;
 }
}

twinklewarn.callback.evaluate = function twinklewarnCallbackEvaluate(e) {

 xmlhttp = sajax_init_object();

 // First, grab all the values provided by the form
 xmlhttp.reason = e.target.reason.value;
 xmlhttp.main_group = e.target.main_group.value;
 xmlhttp.sub_group = e.target.sub_group.value;
 if( xmlhttp.main_group == 'block' ) {
 xmlhttp.block_timer = e.target.block_timer.value;
 }
 xmlhttp.article = e.target.article.value.replace( /^(Image|Category):/i, ':$1:' );

 Status.init( e.target );
 Status.status( 'Downloading the talk page edit form' );

 // Now, grab the edit page!
 xmlhttp.query = { 
 'title': wgPageName, 
 'action': 'submit'
 };

 xmlhttp.overrideMimeType('text/xml');
 xmlhttp.open( 'GET' , mw.config.get('wgServer') + mw.config.get('wgScriptPath') + '/index.php?' + QueryString.create( xmlhttp.query ), true );
 xmlhttp.onload = function() {

 var form = this.responseXML.getElementById( 'editform' );
 var text = form.wpTextbox1.value;

 var history_re = /\<\!\-\-\ Template\:(uw\-.*?)\ \-\-\>.*?(\d{1,2}:\d{1,2}, \d{1,2} \w+ \d{4}) \(UTC\)/g;
 var history = {};
 var latest = { date:new Date( 0 ), type:'' };

 var current;


 while( ( current = history_re.exec( text ) ) != undefined ) {
 var current_date = new Date( current[2] + ' UTC' );
 if( !( current[1] in history ) ||  history[ current[1] ] < current_date ) {
 history[ current[1] ] = current_date;
 }
 if( current_date > latest.date ) {
 latest.date = current_date;
 latest.type = current[1];
 }
 }

 var date = new Date();

 if( this.sub_group in history ) {
 var temp_time = new Date( history[ this.sub_group ] );
 temp_time.setUTCHours( temp_time.getUTCHours() + 24 );

 if( temp_time > date ) {
 Status.warn( "an identical " + this.sub_group + " has been issued in the last 24 hours" );
 if( !confirm( "Will you still add a warning/notice?" ) ) {
 Status.info( 'aborted per user request' );
 return;
 }
 }
 }

 latest.date.setUTCMinutes( latest.date.getUTCMinutes() + 1 ); // after long debate, one minute is max

 if( latest.date > date ) {
 Status.warn( "a " + latest.type + " has been issued in the last minute" );
 if( !confirm( "Will you still add a warning/notice?" ) ) {
 Status.info( 'aborted per user request' );
 return;
 }
 }
 


 var mainheaderRe = /==+\\s*Warnings\\s*==+/;
 var headerRe = new RegExp( "^==+\\s*" + date.getUTCMonthName() + "\\s+" + date.getUTCFullYear() + "\\s*==+", 'm' );

 if( text.length > 0 ) {
 text += "\n";
 }

 if( !headerRe.exec( text ) ) {
 Status.info( 'Will create a new level 2 heading for the date, as none was found for this month' );
 text += "== " + date.getUTCMonthName() + " " + date.getUTCFullYear() + " ==\n";
 }
 if( this.main_group == 'block' ) {
 var time = null;
 if( /te?mp|^\s*$|min/.exec( this.block_timer ) ) {
 time = '';
 } else if( /indef|\*|max/.exec( this.block_timer ) ) {
 time = '|indef=yes';
 } else {
 time = '|' + this.block_timer;
 }

 text += "\{\{subst:" + this.sub_group + time + (this.reason ? '|' + this.reason : '' ) + "\}\}";
 } else {
 text += "\{\{subst:" + this.sub_group + ( this.article ? '|' + this.article + '|subst=subst:' : '' ) + "\}\}" + (this.reason ? " ''" + this.reason + "'' ": ' ' ) + "\~\~\~\~";
 }

 if ( TwinkleConfig.showSharedIPNotice && isIPAddress( wgTitle ) ) {
 Status.info( 'Adding a shared ip notice' );
 switch( QueryString.get( 'type' ) ) {
 case 'vand':
 text +=  "\n:''Se este é um  [[endereço IP]] compartilhado, e você não tiver feito alguma edição [[Wikipedia:Vandalismo|desconstrutiva]], considere [[Wikipedia:Por que se registrar?|criar uma conta]] para si de modo a evitar possíveis avisos irrelevantes.'' ";
 break;
 default:
 text +=  "\n:''Se este é um  [[endereço IP]] compartilhado, e você não tiver feito alguma edição [[Wikipedia:Vandalismo|desconstrutiva]], considere [[Wikipedia:Por que se registrar?|criar uma conta]] para si de modo a evitar possíveis avisos irrelevantes.'' ";
 break;
 }
 }
 var postData = {
 'wpMinoredit': form.wpMinoredit.checked ? 1 : undefined,
 'wpWatchthis': TwinkleConfig.watchWarnings ? 1 : form.wpWatchthis.checked ? 1 : undefined,
 'wpStarttime': form.wpStarttime.value,
 'wpEdittime': form.wpEdittime.value,
 'wpAutoSummary': form.wpAutoSummary.value,
 'wpEditToken': form.wpEditToken.value,
 'wpSummary': twinklewarn.messages[this.main_group][this.sub_group].summary + ( this.article ? ' > relativo a: [[' + this.article + ']]'  : '' ) + '.' + TwinkleConfig.summaryAd,
 'wpTextbox1': text
 };
 var xmlhttp = sajax_init_object();
 xmlhttp.overrideMimeType('text/xml');
 xmlhttp.open( 'POST' , mw.config.get('wgServer') + mw.config.get('wgScriptPath') + '/index.php?' + QueryString.create( this.query ), true);
 xmlhttp.setRequestHeader('Content-type','application/x-www-form-urlencoded');
 xmlhttp.onload = function() { 
 Status.info( 'Done!')
 window.location = mw.config.get('wgServer') + mw.config.get('wgArticlePath').replace( '$1', wgPageName.replace( '_', ' ' ) ); 
 };
 xmlhttp.send( QueryString.create( postData ) );
 }
 xmlhttp.send( null );
}