sciter-dialogs

1.4.0 • Public • Published

sciter dialogs

latest version downloads

This project implements modal dialogs for sciter.js.

sciter dialogs screenshot

features

  • works on Windows, Mac and Linux
  • modal dialog with icon
  • fully skinnable
  • translatable using callback
  • any button can open a link in the browser

demo

  • git clone the repository
  • install packages npm install
  • install latest sciter sdk npm run install-sdk
  • start the demo npm run scapp

demo requirements

  • A recent version of Node.js node (tested with 22 LTS) and its package manager npm.

add to your project

You can either add it to your project using npm or by copying the src directory.

using npm

  • install package npm install sciter-dialogs

copy source

  • add the src dir to your project

add to <script type="module">

// if using npm import
import Dialogs from "node_modules/sciter-dialogs/src/dialogs.js";

// if src copied
import Dialogs from "src/dialogs.js";

const value = Dialogs.show("question", "Do you want to update widget?", "yes no cancel");

css skinning

Dialogs.setOptions({
    css: [
        __DIR__ + "src/dialog-win.css",
        __DIR__ + "css/test.css",
    ]
});

translation callback

Dialogs.setOptions({
    callback: dialogCallback,
});

/**
 * Dialog callback
 * @param DOMElement root
 * @return void
 */
function dialogCallback(root)
{
    // get all dialog elements to translate
    root.$$("[data-i18n]").map(function(element) {
        element.textContent += " (i18n)";
    });
}

todo

  • add "don't show again" checkbox
  • add keyboard shortcuts to buttons ̲

known issues

  • in some cases dialog is not modal

Readme

Keywords

Package Sidebar

Install

npm i sciter-dialogs

Weekly Downloads

3

Version

1.4.0

License

MIT

Unpacked Size

32.6 kB

Total Files

11

Last publish

Collaborators

  • 8ctopus