[ticket/12982] Refactoring: made JS in adm nice

PHPBB3-12982