User:Joritochip/common.js

var hooks = {}; mw.hook = function(hook) { return { add: function(callback) { if (!(hooks[hook])) { hooks[hook] = []; }			hooks[hook].push(callback); },		fire: function(data) { console.log(hook, data); if (hooks[hook]) { hooks[hook].forEach(function(callback) {					callback(data);				}); }		},		remove: function(callback) {} }; };

importArticles({   type: 'script',    articles: [        'u:dev:MediaWiki:ListSubpages.js',        'u:dev:MediaWiki:Matrix.js',    ] });