MediaWiki:Common.js: Difference between revisions
From MENACE Official Wiki
testing spoiler template |
test ploty implementation |
||
| Line 7: | Line 7: | ||
e.stopPropagation(); | e.stopPropagation(); | ||
}); | }); | ||
}); | |||
mw.hook( 'wikipage.content' ).add( ( $content ) => { | |||
var script = document.createElement('script'); | |||
script.src = 'https://cdn.plot.ly/plotly-latest.min.js'; | |||
script.onLoad = function() { | |||
createAccDmgGraph(); | |||
}; | |||
document.head.appendChild(script); | |||
}); | }); | ||
Revision as of 15:44, 28 February 2026
/* Any JavaScript here will be loaded for all users on every page load. */
/* [[Template:Spoiler]] */
mw.hook('wikipage.content').add(function() {
$('.spoiler-content').off('click').on('click', function(){
$(this).toggleClass('show');
}).find('a').on('click', function(e){
e.stopPropagation();
});
});
mw.hook( 'wikipage.content' ).add( ( $content ) => {
var script = document.createElement('script');
script.src = 'https://cdn.plot.ly/plotly-latest.min.js';
script.onLoad = function() {
createAccDmgGraph();
};
document.head.appendChild(script);
});


