This be yuck
https://github.com/wikimedia/mediawiki-extensions-Translate/search?utf8=✓&q=onclick
onclick html attributes depend on globally scoped javascript functions, which we try to avoid using. Instead, we should be using JS resource loader modules, that find the right elements from the page ready and attach eventlisteners to those elements
protected function getButton( $msg, $source, $target ) { $html = Xml::element( 'input', [ 'type' => 'button', 'value' => wfMessage( $msg )->text(), 'onclick' => Xml::encodeJsCall( 'appendFromSelect', [ $source, $target ] ) ] ); return $html; }
window.appendFromSelect = function ( selectid, targetid ) { }
rewrite, so that the JS setup is no longer in the HTML, but instead in something like $( document ).ready, which finds the thml button and then attaches a click handler calling appendFromSelect (an removing appendFromSelect from the window object).