Prijeđi na sadržaj

Suradnik:Dalibor Bosits/fb.js

Izvor: Wikipedija

Napomena: Nakon objave možda ćete trebati očistiti međuspremnik svog preglednika kako biste vidjeli promjene.

  • Firefox / Safari: držite Shift i pritisnite Reload, ili pritisnite bilo Ctrl-F5 ili Ctrl-R (⌘-R na Macu)
  • Google Chrome: pritisnite Ctrl-Shift-R (⌘-Shift-R na Macu)
  • Internet Explorer / Edge: držite Ctrl i kliknite Refresh, ili pritisnite Ctrl-F5
  • Opera: pritisnite Ctrl-F5.
/* fb */
var stranica =''; var mot=''; var txt=''; var dodalat=''; var suradnik=''; var temporal='';
var sep="|"; var biblio=false;
var dire="http://hr.wikipedia.org/w/index.php?title=";
var kraj_nsos="edit&drugo=nsos-";
var FBnsos = true;
var FBdrugo = false;
var FBar= true;
var FBsic = true;
var FBnsb = true;
var FBpri1 = true;
var FBpri2 = true;

//All data is here:
for (i=0; i<wgUserGroups.length; i++)
   {  if (wgUserGroups[i] == "sysop") biblio=true; }

for (i=0; i<wgUserGroups.length; i++)
   {  if (wgUserGroups[i] == "autoconfirmed") autoconfirmed=true; }
 
stranica=encodeURI(wgPageName);
if (stranica.match("&"))
{
stranica=stranica.replace("&","%26");
}
dire=dire+stranica+"&action=";
suradnik=stranica.split(":")[1];
 
 
if (stranica=="Posebno:Doprinosi")
{suradnik=location.href.substring(location.href.indexOf('Doprinosi/')+14,location.href.length);}

tmp='';
 
if( wgNamespaceNumber ==  3 )
if (FBsic){tmp+= '[<a href='+dire+'edit&plant=sic>sič</a>] '; }
if( wgNamespaceNumber ==  3 )
if (FBnsos){tmp+= '[<a onclick="mot=prompt(/Članak:/);location.href=dire + kraj_nsos +encodeURI(mot) ;">ns-osnove</a>] ';}
if( wgNamespaceNumber ==  3 )
if (FBpri1){tmp+= '[<a href='+dire+'edit&plant=pri1>p1</a>] '; }
if( wgNamespaceNumber ==  3 )
if (FBpri2){tmp+= '[<a href='+dire+'edit&plant=pri2>p2</a>] '; }
if( wgNamespaceNumber ==  0 || wgNamespaceNumber == 1 )
if (FBnsb){tmp+= '[<a href='+dire+'edit&plant=nsb>nsb</a>] '; }
if (wgNamespaceNumber == 1 || wgNamespaceNumber == 3 || wgNamespaceNumber == 4 || wgNamespaceNumber == 5 )
if (FBar){tmp+= '[<a href='+dire+'edit&plant=fbar>arhiv<a/>] '; }

if (tmp!=''){dodalat = dodalat + 'Dodatno: ' +tmp+'<br>';}
 
$(function ()
{
 
if (document.getElementById('contentSub').innerHTML!='')
{document.getElementById('contentSub').innerHTML+='<br>';}
 
document.getElementById('contentSub').innerHTML = document.getElementById('contentSub').innerHTML+ dodalat;

if (location.href.match("plant=sic")) 
{
	txt=document.getElementById("wpTextbox1").value
	{
		txt='{{subst:' + 'NS-sič1}}--\~\~\~\~';
		document.getElementById ("wpTextbox1").value=txt; 
		document.editform.wpSummary.value = 'sič';
		document.editform.submit();
	} 
}

else if (location.href.match("plant=nsb")) 
{
	txt=document.getElementById("wpTextbox1").value
	if ((txt.match("{destruir")==null) && (txt!=""))
	{
		txt='{{subst:' + 'NSBris}}';
		document.getElementById ("wpTextbox1").value=txt;
		document.editform.wpSummary.value = 'nsb';
		document.editform.wpSave.click();
	}
}

else if (location.href.match("plant=pri1")) 
{
	txt=document.getElementById("wpTextbox1").value
	if ((txt.match("{destruir")==null) && (txt!=""))
	{
		txt= txt+'\n\=\=Prikaži kako će izgledati\=\=\n' + '{{subst:' + 'NS-prikaži1}}--\~\~\~\~';
		document.getElementById ("wpTextbox1").value=txt;
		document.editform.wpSummary.value = 'prikaži kako će izgledati';
		document.editform.wpSave.click();
	}
}
else if (location.href.match("plant=pri2")) 
{
	txt=document.getElementById("wpTextbox1").value
	if ((txt.match("{destruir")==null) && (txt!=""))
	{
		txt=txt+'\n\=\=Prikaži kako će izgledati !\=\=\n' + '{{subst:' + 'NS-prikaži2}}--\~\~\~\~';
		document.getElementById ("wpTextbox1").value=txt;
		document.editform.wpSummary.value = 'prikaži kako će izgledati 2';
		document.editform.wpSave.click();
	}
}
else if (location.href.match("plant=fbar")) 
{
	txt=document.getElementById("wpTextbox1").value
	if ((txt.match("{destruir")==null) && (txt!=""))
	{
		txt='{'+'{ArhivPočetak}'+'}\n\n'+ txt + '\n{'+'{ArhivKraj}'+'}';
		document.getElementById ("wpTextbox1").value=txt;
		document.editform.wpSummary.value = 'Arhiviranje';
		document.editform.wpSave.click();
	}
}
else if (location.href.match("drugo=nsos")) 
{
	txt=document.getElementById("wpTextbox1").value
	if ((txt.match("{destruir")==null) && (txt!=""))
	{
		mot=location.href.substring(location.href.indexOf('nsos-')+5, location.href.length)
		if (mot!=null)
		{
			txt=txt+'\n\=\='+decodeURI(mot)+'\=\='+'\n' + '{{subst:' + 'NS-osnove1|'+decodeURI(mot)+'}}--\~\~\~\~';
			document.getElementById ("wpTextbox1").value=txt;
			document.editform.wpSummary.value = 'ns-osnove: ' + decodeURI(mot) ;
	 		document.editform.submit();
		}
	}
}
});