MediaWiki:Common.js
Note: After publishing, you may have to bypass your browser's cache to see the changes.
- Firefox / Safari: Hold Shift while clicking Reload, or press either Ctrl-F5 or Ctrl-R (⌘-R on a Mac)
- Google Chrome: Press Ctrl-Shift-R (⌘-Shift-R on a Mac)
- Edge: Hold Ctrl while clicking Refresh, or press Ctrl-F5.
$(document).ready(function() {
$('input#searchInput').attr('placeholder', 'Search for Transight Wiki');
});
// Open all external links in a new tab
$(document).ready(function () {
$("a.external").attr("target", "_blank");
});
// Scrolling style
$(document).ready(function () {
$('a[href*="#"]:not([href="#"])').on('click', function (e) {
var targetId = this.hash.slice(1);
var target = document.getElementById(targetId);
if (target) {
e.preventDefault();
$('html, body').animate({
scrollTop: $(target).offset().top
}, 500); // 500ms scroll duration
}
});
});