Save new project or save new project based on already existed and opened project.
Example of code:
iframeRoomtodo.contentWindow.postMessage(JSON.stringify({action:"save_as"}), "*");
After successful project save, 'project saved' message gonna return from planner with some project data:
<iframe frameborder="0" id="iframe7384d8cb02ad2ef7e696fddf9a5394a7" src="https://n.roomtodo.com/planner?site_key=7384d8cb02ad2ef7e696fddf9a5394a7" style="width: 800px; height: 600px;"></iframe>
<script>
window.addEventListener('message', messageListener);
function messageListener(e) {
try {
var object = JSON.parse(e.data);
if (object.action == 'project_saved') {
console.log("object: ", object.data)
// object.data = { id: 'saved project id', name: "saved project name", hash: 'saved project hash' }
}
} catch ( error ) {}
}
</script>