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.
//Based on VideoIntegrator's JS code, modified for scratch support.
mw.hook('wikipage.content').add(function($content) {
if (!$content) {
return;
}
$content.find('[data-widget-id]:not(.loaded)').each(function() {
var $this = $(this),
id = encodeURIComponent($this.attr('data-widget-id')),
css = {
width: 'inherit',
height: 'inherit'
};
switch($this.attr('class')) {
case 'ScratchEmbeddedProject':
$this.html(
$('<iframe>', {
src: 'https://scratch.mit' + '.edu/projects/' + id +'/embed',
css: css,
frameborder: 0,
scrolling: 'no',
allowfullscreen: true
})
);
break;
case 'TurbowarpEmbeddedProject':
$this.html(
$('<iframe>', {
src: 'https://turbowarp' + '.org/' + id +'/embed?settings-button&addons=pause',
css: css,
frameborder: 0,
scrolling: 'no',
allowfullscreen: true
})
);
break;
case 'PenginmodEmbeddedProject':
$this.html(
$('<iframe>', {
src: 'https://penguinmod' + '.com/' + id +'/embed?settings-button&addons=pause',
css: css,
frameborder: 0,
scrolling: 'no',
allowfullscreen: true
})
);
break;
}
$this.addClass('loaded');
});
});