Nuclear Potato Monster

    sciter-dialogs

    1.3.2 • Public • Published

    sciter dialogs

    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 16 LTS) and its package manager npm.

    add to your project

    using npm

    • install package npm install sciter-dialogs

    copy source

    • add the src dir to your project

    Add to <script type="module">

    // npm import
    import Dialogs from "node_modules/sciter-dialogs/src/dialogs.js";
    
    // src import
    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

    Install

    npm i sciter-dialogs

    DownloadsWeekly Downloads

    9

    Version

    1.3.2

    License

    MIT

    Unpacked Size

    40.6 kB

    Total Files

    12

    Last publish

    Collaborators

    • 8ctopus