MediaWiki:Common.js: Difference between revisions
No edit summary |
No edit summary |
||
| Line 1,375: | Line 1,375: | ||
} | } | ||
var | var observer = new MutationObserver(function () { | ||
var section = $('.mf-section-0'); | |||
var authorBlock = section.children('p').filter(function () { | |||
return $(this).find('span[style*="float:right"]').length; | |||
}).first(); | |||
var poemBlock = section.children('.Poem2-Ekatra').first(); | |||
if (authorBlock.length) { | |||
authorBlock.hide(); | |||
} | |||
if (authorBlock.length && poemBlock.length) { | |||
poemBlock.after(authorBlock); | |||
authorBlock.show(); | |||
observer.disconnect(); | |||
console.log('Author block moved'); | console.log('Author block moved'); | ||
} | |||
}); | |||
} | observer.observe(document.body, { | ||
childList: true, | |||
subtree: true | |||
}); | |||
}); | }); | ||