Fixes #188

Put back the javascript in the dialog controller, because some dialogs still need them.