Usuário:Rjclaudio/teste4.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.
//Processo de Páginas para eliminar
//Criado por Rjclaudio (português)

//<pre>
 
//Start

/* Botones funcionando */
 
$(function ()
{
 
if (location.href.match("pe=pefim")) 
{
  var t = f_pe_fim ();
  document.editform.wpTextbox1.value = t ;

  var s = document.editform.wpSummary.value ;
  s = "PE encerrada" ;
  document.editform.wpSummary.value = s ;
  document.editform.submit();
}

else if (location.href.match("pe=pema")) 
{
  var t = document.editform.wpTextbox1.value ;
//  t = t.replace(/\{\{[AA]pagar2\|[^{}\n]*}}/, '') ;
  document.editform.wpTextbox1.value = t ;

  var s = document.editform.wpSummary.value ;
  s = "PE encerrada: manter" ;
  document.editform.wpSummary.value = s ;
  document.editform.submit();
}

else if (location.href.match("pe=pefu")) 
{
	txt=document.getElementById("wpTextbox1").value
	if ((txt.match("{destruir")==null) && (txt!=""))
	{
		mot=location.href.substring(location.href.indexOf('otro-')+5, location.href.length)
		if (mot!=null)
		{
			txt='#Redirecionar[['+decodeURI(mot)+']]';
			document.getElementById ("wpTextbox1").value=txt;
			document.editform.wpSummary.value = 'PE encerrada: fundir';
	 		document.editform.submit();
		}
	}
}

else if (location.href.match("pe=perd")) 
{
	txt=document.getElementById("wpTextbox1").value
	if ((txt.match("{destruir")==null) && (txt!=""))
	{
		mot=location.href.substring(location.href.indexOf('perd-')+5, location.href.length)
		if (mot!=null)
		{
			txt='#Redirecionar [['+decodeURI(mot)+']]';
			document.getElementById ("wpTextbox1").value=txt;
			document.editform.wpSummary.value = 'PE encerrada: redirecionar';
	 		document.editform.submit();
		}
	}
}

 
});

//</pre>

/*
function retira_apagar2 () {
  var ot = document.editform.wpTextbox1.value ;
  var t = ot.replace(/\{\{Apagar2\|[^{}\n]*}}/, '') ;
  document.editform.wpTextbox1.value = t ;
}
*/

function f_pe_fim() {
  var t = document.editform.wpTextbox1.value ;
  t = t.replace (/\{\{NomeaçãoNãoConcluída\|[^{}\n]*}}/, '{{NomeaçãoConcluída}}') ;

  return t;
}