Skip to content

Commit

Permalink
Commenting.
Browse files Browse the repository at this point in the history
  • Loading branch information
mchilvers committed May 12, 2024
1 parent ff54017 commit c62d5ce
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 9 deletions.
1 change: 0 additions & 1 deletion src/tools/builder/public/python/builder.py
Expand Up @@ -5,7 +5,6 @@
from pyscript import document
from pyscript.ffi import create_proxy

import invent
from invent.ui import (
App, AVAILABLE_COMPONENTS, Column, Container, create_component, export, Grid, Page,
Row, Widget, from_datastore
Expand Down
15 changes: 7 additions & 8 deletions src/tools/builder/src/views/builder/builder-model.ts
Expand Up @@ -37,8 +37,7 @@ export class BuilderModel extends ViewModelBase {
* Python instance that looks after the Invent application model.
*
* Here, we wait for the Python instance to be available in the global window
* scope as it is only created once PyScript has got an interpreter up and
* running.
* scope as it is created after PyScript has got an interpreter up and running.
*/
// @ts-ignore
while (!window['builder']){
Expand All @@ -47,7 +46,7 @@ export class BuilderModel extends ViewModelBase {

/**
* Now we have the Python-side available, we can pass a reference to this object
* (the JS side) into it.
* (i.e. the JS side) into it.
*/
BuilderUtilities.init(this);

Expand Down Expand Up @@ -118,7 +117,7 @@ export class BuilderModel extends ViewModelBase {

const { type, data } = event.data;

console.log(`BuilderModel.onMessage: type: ${type}:`, data);
console.log(`BuilderModel.onMessage: type: ${type}: `, data);

switch (type){
/**
Expand All @@ -133,7 +132,7 @@ export class BuilderModel extends ViewModelBase {
/**
* The host application wants to save the Invent app that we are currently
* building. We just serialize the app and send it back - it is up to the
* host to decide where it is actually persisted.
* host to decide where it is actually saved.
*/
case "save-request": {
event.source?.postMessage({
Expand Down Expand Up @@ -320,9 +319,9 @@ export class BuilderModel extends ViewModelBase {
*/
public onAddMediaFile(): void {
/**
* Send a message to the host application to prompt the user to add a media
* file. The host will send us an "add-media-response" message if/when a media
* file has been added.
* Send a message to the host application to let it know that the user wants to
* add a media file. The host will send us an "add-media-response" message
* if/when a media file has been added.
*/
window.parent.postMessage({type: "add-media-request"});
}
Expand Down

0 comments on commit c62d5ce

Please sign in to comment.