MediaWiki:Common.js: Difference between revisions

28.10.2025 Prusac | 18.11.2025

Created page with "Any JavaScript here will be loaded for all users on every page load.: // autofocus na search input document.getElementById('searchInput').focus(); // ne pokazuj mi tekst (placeholder) u search document.getElementById('searchInput').setAttribute("placeholder",""); // promeni naslov 'search' u 'pretraga'. font-size povećavam pošto ga zli dusi smanjuju nakon promene txt document.getElementById('p-search-label').innerHTML = '<label for="searchInput">Pretraga</label..."
 
No edit summary
 
(51 intermediate revisions by the same user not shown)
Line 1: Line 1:
/* Any JavaScript here will be loaded for all users on every page load. */
/* Any JavaScript here will be loaded for all users on every page load. */
/* sakrivanje warnings u konzoli */
/* console.log = function () {} */
/* mw.log.warn = ""; */


// autofocus na search input
document.getElementById('searchInput').focus();
document.getElementById('searchInput').focus();
document.getElementById('searchInput').setAttribute("placeholder","");


// ne pokazuj mi tekst (placeholder) u search
if (document.title === 'Kreiranje novog članka na MelanyWiki - MelanyWiki') {
document.getElementById('searchInput').setAttribute("placeholder","");
document.getElementsByClassName('mw-inputbox-createbox')[0].setAttribute("autocomplete","off");
/*klik iz abstracta za focus inputa 'novi clanak'*/
document.getElementById("precica").addEventListener("click", function(e) {
document.getElementsByClassName('mw-inputbox-createbox')[0].focus();
});
}


// promeni naslov 'search' u 'pretraga'. font-size povećavam pošto ga zli dusi smanjuju nakon promene txt
document.getElementById('footer').insertAdjacentHTML('afterbegin', '<span id="mslogod"><img src="/skins/msoft_k.svg" alt="MelanyWiki" lang="en" width="150" height="38" loading="lazy"></span>');
document.getElementById('p-search-label').innerHTML = '<label for="searchInput">Pretraga</label>';
document.getElementById('p-search-label').setAttribute("style","font-size: 100%");


// menjam 'navigation' u 'navigacija'
if (window.location.hash !== '') {
document.getElementById('p-navigation-label').innerHTML = 'Navigacija';
setTimeout(() => {
  document.getElementById(window.location.hash.substring(1)).scrollIntoView();
}, 200);
}

Latest revision as of 15:25, 18 November 2025

/* Any JavaScript here will be loaded for all users on every page load. */
/* sakrivanje warnings u konzoli */
/* console.log = function () {} */
/* mw.log.warn = ""; */

document.getElementById('searchInput').focus();
document.getElementById('searchInput').setAttribute("placeholder","");

if (document.title === 'Kreiranje novog članka na MelanyWiki - MelanyWiki') {
	document.getElementsByClassName('mw-inputbox-createbox')[0].setAttribute("autocomplete","off");
	/*klik iz abstracta za focus inputa 'novi clanak'*/
	document.getElementById("precica").addEventListener("click", function(e) {
		document.getElementsByClassName('mw-inputbox-createbox')[0].focus();
	});
}

document.getElementById('footer').insertAdjacentHTML('afterbegin', '<span id="mslogod"><img src="/skins/msoft_k.svg" alt="MelanyWiki" lang="en" width="150" height="38" loading="lazy"></span>');

if (window.location.hash !== '') {
	setTimeout(() => {
	  document.getElementById(window.location.hash.substring(1)).scrollIntoView();
	}, 200);
}