Kullanıcı:Vito Genovese/Şablon yardımcısı/SİS.js

Vikipedi, özgür ansiklopedi
Not: Sayfayı kaydettikten sonra değişiklikleri görebilmek için tarayıcınızın önbelleğinizi temizlemeniz gerekir. Google Chrome, Firefox, Microsoft Edge ve Safari: ⇧ Shift tuşuna basılı tutun ve Yeniden Yükle araç çubuğu düğmesine tıklayın. Ayrıntılar ve diğer tarayıcılara yönelik yönergeler için Vikipedi:Önbelleğinizi atlayın sayfasını inceleyin.
// ***************************************************************************************
// ŞABLON YARDIMCISI
// ***************************************************************************************
// [[Vikipedi:Araçlar/Şablon yardımcısı]] - [[VP:ŞY]] - Seçkin içerik oylama kapatma modülü
// ***************************************************************************************
 
// ***************************************************************************************
// BİLGİLER
// ***************************************************************************************
// Taslak.js betiğinin modifiye edilmiş sürümüdür / Modified version of Taslak.js
// For credits please see [[Kullanıcı:Vito Genovese/Şablon yardımcısı/Taslak.js]]
// ***************************************************************************************
// BETİK KODU
// ***************************************************************************************

function şysis() {
	if(şabyarsis.indexOf(wgUserName) != -1 && (
     document.title.indexOf("Vikipedi:Seçkin madde adayları/") != -1 ||
     document.title.indexOf("Vikipedi:Seçkin liste adayları/") != -1 || 
     document.title.indexOf("Vikipedi:Seçkin resim adayları/") != -1 ||
     document.title.indexOf("Vikipedi:Seçkin portal adayları/") != -1 ||
     document.title.indexOf("Vikipedi:Seçkin madde incelemesi/") != -1 ||
     document.title.indexOf("Vikipedi:Seçkin listelikten ihraç adayları/") != -1 ||
     document.title.indexOf("Vikipedi:Seçkin resimlikten ihraç adayları/") != -1 ||
     document.title.indexOf("Vikipedi:Seçkin portallıktan ihraç adayları/") != -1) ) {
                şyAddPortletLink( "javascript:featuredtagtab()", "Kapat", "ca-featuredtagtab", "Seçkin içerik oylamasını kapat", "");
	}
  if(location.href.indexOf("&autoaddfeaturedtag=")!=-1 && document.getElementById('wpTextbox1')!=null &&
    (document.title.indexOf("Vikipedi:Seçkin madde adayları/") != -1 ||
     document.title.indexOf("Vikipedi:Seçkin liste adayları/") != -1 || 
     document.title.indexOf("Vikipedi:Seçkin resim adayları/") != -1 ||
     document.title.indexOf("Vikipedi:Seçkin portal adayları/") != -1 ||
     document.title.indexOf("Vikipedi:Seçkin madde incelemesi/") != -1 ||
     document.title.indexOf("Vikipedi:Seçkin listelikten ihraç adayları/") != -1 ||
     document.title.indexOf("Vikipedi:Seçkin resimlikten ihraç adayları/") != -1 ||
     document.title.indexOf("Vikipedi:Seçkin portallıktan ihraç adayları/") != -1) )
  {
    var x=decodeURIComponent(location.href.split("&autoaddfeaturedtag=")[1]);
    var shortx=x.substr(0,2);
    document.editform.wpTextbox1.value = "{"+"{"+x+"}}--~~"+"~~\n\n" + document.editform.wpTextbox1.value + "\n\n{{" + shortx + "A son}}"
    document.getElementById('wpSummary').value=
      "[[VP:ŞY|Şablon yardımcısı]] kullanılarak oylama kapatılıyor. Karar: "+x;
    document.getElementById('wpPreview').click();
  }
}
window.ŞabyarInit= (window.ŞabyarInit|| []).concat(şysis); //schedule initializer 
 
function featuredtagtab()
{
  var h;
  // 
  var a=['SİS'];
  var i=0;
  h="<div style='color:#000000; background-color:#fff8f8;'>&bull; ";
  while(i<a.length)
  {
    h+="<a href='javascript:featuredtagmenu(\""+a[i]+"\");'>"+a[i]+"</a> &bull; ";
    i++;
  }
  h+="</div><div id='featuredtagmenudiv' style='color:#000000; background-color:#fffff8;'></div>";
  document.getElementById("contentSub").innerHTML=h;
}
 
function featuredtagmenurender(a)
{

if(a.readyState != 4){
document.getElementById('featuredtagmenudiv').innerHTML= "<i>Yükleniyor, lütfen bekleyin...</i>";
return;
}

if(a.responseText.indexOf('<text xml:space="preserve">') ==-1 ){
document.getElementById('featuredtagmenudiv').innerHTML= "<i>Galiba yanlış giden bir şeyler var. Kategoride sorun olabilir mi?</i>";
return;
}

  var s=a.responseText.split('<text xml:space="preserve">')[1].split("</text>")[0];
  s=s.split("&lt;").join("<").split("&gt;").join(">");
  s=s.split("&quot;").join('"').split("&amp;").join('&');
  s=s.split('<a href="/wiki/%C5%9Eablon:');
  var i=s.length;
  while(--i) s[i]=s[i].split('" title').join('\');" title');
  s=s.join('<a temphref="javascript:featuredtagwith(\'');
  s=s.split('<a href=').join('<a style="color:#000000;" notanhref=');
  s=s.split('<a temphref=').join('<a href=');
  document.getElementById('featuredtagmenudiv').innerHTML=s;
}
 
function featuredtagmenu(x)
{
  //Fetch the relevant subpage
  var a = sajax_init_object();
  a.open('GET',mw.config.get('wgServer')+mw.config.get('wgScriptPath')+'/api.php?action=parse&prop=text&text='+
    encodeURIComponent('__NOTOC____NOEDITSECTION__{{Vikipedi:Araçlar/Şablon_yardımcısı/'+
                       x+'}}')+'&format=xml');
  a.onreadystatechange = function(){featuredtagmenurender(a)};
  a.send('');
}
 
function featuredtagwith(x)
{
  if(x==null||x=="") return;
  location.href=mw.config.get('wgServer')+mw.config.get('wgScript')+"?title="+encodeURIComponent(mw.config.get('wgPageName'))+                                  
                "&action=edit&autoaddfeaturedtag="+encodeURIComponent(x);
}
 
// </source>