User:Retep998/common.js

/* mw.hook('wikipage.content').add(function ($content) { (function  { if (!$content.find('.load-page').length) { console.log('Nothing to add hooks for!'); return; }   console.log('Adding hooks!'); $('#mw-content-text').on('click', '.load-page-button', function {      var $button = $(this).parent;      var $body = $button.closest('.load-page');      new mw.Api.get({ action: 'parse', prop: 'text', page: $body.data('page') }).done(function (data) { console.log('Loaded data!'); $body.html(data.parse.text['*']); mw.hook('wikipage.content').fire($body); }).fail(function (_, error) { console.log('Failed to load data!'); });     console.log('Firing request to load data!');    }); }); });