From 6d6859b844a2eb5ea9dc03a497351bacaf6c4e17 Mon Sep 17 00:00:00 2001 From: Ethanfel Date: Sun, 18 Jan 2026 14:33:20 +0100 Subject: [PATCH] Add js/sharp_tooltips.js --- js/sharp_tooltips.js | 30 ++++++++++++++++++++++++++++++ 1 file changed, 30 insertions(+) create mode 100644 js/sharp_tooltips.js diff --git a/js/sharp_tooltips.js b/js/sharp_tooltips.js new file mode 100644 index 0000000..bc6884c --- /dev/null +++ b/js/sharp_tooltips.js @@ -0,0 +1,30 @@ +import { app } from "../../scripts/app.js"; + +app.registerExtension({ + name: "SharpFrames.Tooltips", + async beforeRegisterNodeDef(nodeType, nodeData, app) { + if (nodeData.name === "SharpFrameSelector") { + + // Define your tooltips here + const tooltips = { + "selection_method": "Strategy:\n'batched' = 1 best frame per time slot (Good for video).\n'best_n' = Top N sharpest frames globally.", + "batch_size": "For 'batched' mode only.\nHow many frames to analyze at once.\nExample: 24fps video + batch 24 = 1 output frame per second.", + "num_frames": "For 'best_n' mode only.\nTotal number of frames you want to keep." + }; + + // Hook into the node creation to apply them + const onNodeCreated = nodeType.prototype.onNodeCreated; + nodeType.prototype.onNodeCreated = function () { + onNodeCreated?.apply(this, arguments); + + if (this.widgets) { + for (const w of this.widgets) { + if (tooltips[w.name]) { + w.tooltip = tooltips[w.name]; + } + } + } + }; + } + }, +}); \ No newline at end of file