let $help_window; function show_help() { if ($help_window) { $help_window.focus(); return; } $help_window = open_help_viewer({ title: localize("Paint Help"), root: "help", contentsFile: "help/mspaint.hhc", }).$help_window; $help_window.on("close", ()=> { $help_window = null; }); } // shared code with 98.js.org // (copy-pasted / manually synced for now) function open_help_viewer(options){ const $help_window = $Window({ title: options.title || "Help Topics", icons: { 16: "images/chm-16x16.png", }, resizable: true, }) $help_window.addClass("help-window"); let ignore_one_load = true; let back_length = 0; let forward_length = 0; const $main = $(E("div")).addClass("main"); const $toolbar = $(E("div")).addClass("toolbar"); const add_toolbar_button = (name, sprite_n, action_fn, enabled_fn)=> { const $button = $("