move form to edit.js, add ports window