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.
(function (mw) {
"use strict";
// Double-run protection
window.dev = window.dev || {};
window.dev.youtubeThumbnail = window.dev.youtubeThumbnail || {
hasRan: false
};
if (window.dev.youtubeThumbnail.hasRan) return;
window.dev.youtubeThumbnail.hasRan = true;
mw.hook('wikipage.content').add(function($content) {
$content.find(".youtube-thumbnail:not(.loaded)").each(function(_, thumbPlaceholder) {
thumbPlaceholder.classList.add('loaded');
var imgElem = document.createElement("img");
imgElem.src = "https://i.ytimg.com/vi/".concat(thumbPlaceholder.dataset.ytThumbId, "/hq720.jpg");
imgElem.style.maxWidth = "100%";
thumbPlaceholder.appendChild(imgElem);
});
});
})(window.mediaWiki);