"use strict"; //! {"require": ["ui"]} terminal.setEcho(false); terminal.setTitle("What Next?"); let gEditEvent = null; function back() { terminal.split([{name: "terminal"}]); if (gEditEvent) { gEditEvent.back(); } } core.register("onWindowMessage", function(event) { if (event.message.ready) { terminal.postMessageToIframe("iframe", {title: gEditEvent.name, contents: gEditEvent.value}); } else if (event.message.index) { back(); } else { gEditEvent.save(event.message.title, event.message.contents).then(back); } }); function editPage(event) { gEditEvent = event; terminal.split([{name: "terminal", type: "vertical"}]); terminal.clear(); terminal.print({iframe: `