prepare js data structure for editing