Dialog windows open conditionally

The `getHtml` values are still ugly. I didn't want to put in too much energy into this at this stage. At least they are here and not in `core.js` any more.