From 40e09fe2949d2e3136c74a96fb722aa829caf3f3 Mon Sep 17 00:00:00 2001 From: amfl Date: Tue, 14 Jan 2020 14:29:23 +1300 Subject: [PATCH 1/7] bugfix: Correct reference to websocket room name When inside the onmessage function, `this` no longer refers to the websocket node. It needs to be accessed with `that`, which is where we stored it previously. --- src/nodes/network.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/nodes/network.js b/src/nodes/network.js index 07bd72c12..12d2c52ab 100644 --- a/src/nodes/network.js +++ b/src/nodes/network.js @@ -86,7 +86,7 @@ this._ws.onmessage = function(e) { that.boxcolor = "#AFA"; var data = JSON.parse(e.data); - if (data.room && data.room != this.properties.room) { + if (data.room && data.room != that.properties.room) { return; } if (e.data.type == 1) { From d134ab73f0d1b6cbb89c77f6e01745855a99022b Mon Sep 17 00:00:00 2001 From: amfl Date: Tue, 14 Jan 2020 14:02:32 +1300 Subject: [PATCH 2/7] bugfix: Websocket checks parsed payload data We parse the JSON payload, but then it wasn't being referred to when we were checking the data type, which could lead to looking at the `type` attribute of a string. --- src/nodes/network.js | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/nodes/network.js b/src/nodes/network.js index 12d2c52ab..0deef5c79 100644 --- a/src/nodes/network.js +++ b/src/nodes/network.js @@ -89,7 +89,7 @@ if (data.room && data.room != that.properties.room) { return; } - if (e.data.type == 1) { + if (data.type == 1) { if ( data.data.object_class && LiteGraph[data.data.object_class] @@ -105,7 +105,7 @@ that.triggerSlot(0, data.data); } } else { - that._last_received_data[e.data.channel || 0] = data.data; + that._last_received_data[data.channel || 0] = data.data; } }; this._ws.onerror = function(e) { From f541bb412ed8ec227b0afeed495e5686f009b8dc Mon Sep 17 00:00:00 2001 From: DiegoBM Date: Tue, 24 Mar 2020 23:39:17 +0100 Subject: [PATCH 3/7] Documentation mismatch Some method names didn't match the actual method names, rendering the automatically generated documentation misleading --- src/litegraph.js | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/litegraph.js b/src/litegraph.js index cfa3c7679..05fcf5fb7 100755 --- a/src/litegraph.js +++ b/src/litegraph.js @@ -1477,7 +1477,7 @@ /** * Tell this graph it has a global graph input of this type - * @method addGlobalInput + * @method addInput * @param {String} name * @param {String} type * @param {*} value [optional] @@ -1503,7 +1503,7 @@ /** * Assign a data to the global graph input - * @method setGlobalInputData + * @method setInputData * @param {String} name * @param {*} data */ From d86b463d5ed6df67caba9bd08f75879fefda538b Mon Sep 17 00:00:00 2001 From: Shan M Date: Sat, 28 Mar 2020 10:59:57 +0300 Subject: [PATCH 4/7] fixes type error in function wrapFunctionAsNode --- src/litegraph.d.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/litegraph.d.ts b/src/litegraph.d.ts index 8c2a0e852..ba94e91d6 100644 --- a/src/litegraph.d.ts +++ b/src/litegraph.d.ts @@ -240,7 +240,7 @@ export const LiteGraph: { wrapFunctionAsNode( name: string, func: (...args: any[]) => any, - param_types?: [], + param_types?: string[], return_type?: string, properties?: object ): void; From 9b6ff21e0022a8b6b7e0a5ddb25c556446a6d0a0 Mon Sep 17 00:00:00 2001 From: Shan M Date: Wed, 15 Apr 2020 11:41:43 +0300 Subject: [PATCH 5/7] Fixes type definition for renderInfo() --- src/litegraph.d.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/litegraph.d.ts b/src/litegraph.d.ts index 551601a11..fecd6e201 100644 --- a/src/litegraph.d.ts +++ b/src/litegraph.d.ts @@ -1239,7 +1239,7 @@ export declare class LGraphCanvas { /** draws the front canvas (the one containing all the nodes) */ drawFrontCanvas(): void; /** draws some useful stats in the corner of the canvas */ - renderInfo(): void; + renderInfo(ctx: CanvasRenderingContext2D, x: number, y: nymber): void; /** draws the back canvas (the one containing the background and the connections) */ drawBackCanvas(): void; /** draws the given node inside the canvas */ From 6607593471265e50b004662c4187c9b6c401b576 Mon Sep 17 00:00:00 2001 From: Shan M Date: Wed, 15 Apr 2020 11:45:25 +0300 Subject: [PATCH 6/7] fix typo --- src/litegraph.d.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/litegraph.d.ts b/src/litegraph.d.ts index fecd6e201..70fd06e0a 100644 --- a/src/litegraph.d.ts +++ b/src/litegraph.d.ts @@ -1239,7 +1239,7 @@ export declare class LGraphCanvas { /** draws the front canvas (the one containing all the nodes) */ drawFrontCanvas(): void; /** draws some useful stats in the corner of the canvas */ - renderInfo(ctx: CanvasRenderingContext2D, x: number, y: nymber): void; + renderInfo(ctx: CanvasRenderingContext2D, x: number, y: number): void; /** draws the back canvas (the one containing the background and the connections) */ drawBackCanvas(): void; /** draws the given node inside the canvas */ From df5a0420997c2eeeaee43ccf30ab902f54fe6800 Mon Sep 17 00:00:00 2001 From: Shan M Date: Mon, 20 Apr 2020 16:50:53 +0300 Subject: [PATCH 7/7] nodes attribute in selectNodes function is optional --- src/litegraph.d.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/litegraph.d.ts b/src/litegraph.d.ts index d1161672c..69220a8df 100644 --- a/src/litegraph.d.ts +++ b/src/litegraph.d.ts @@ -1216,7 +1216,7 @@ export declare class LGraphCanvas { /** selects a given node (or adds it to the current selection) */ selectNode(node: LGraphNode, add?: boolean): void; /** selects several nodes (or adds them to the current selection) */ - selectNodes(nodes: LGraphNode[], add?: boolean): void; + selectNodes(nodes?: LGraphNode[], add?: boolean): void; /** removes a node from the current selection */ deselectNode(node: LGraphNode): void; /** removes all nodes from the current selection */