Giter VIP home page Giter VIP logo

Comments (5)

azzahrah avatar azzahrah commented on June 5, 2024 1

Below is working for me...

<!DOCTYPE html>
<html lang="en">

<head>
    <title>W3.CSS Template</title>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1">
    <link href="node_modules/@pnotify/core/dist/PNotify.css" rel="stylesheet" type="text/css" />
    <link href="node_modules/@pnotify/mobile/dist/PNotifyMobile.css" rel="stylesheet" type="text/css" />
    <script type="module">
        import * as PNotify from './node_modules/@pnotify/core/dist/PNotify.js';
        import * as PNotifyMobile from './node_modules/@pnotify/mobile/dist/PNotifyMobile.js';
    </script>

     <script type="text/javascript">
        window.addEventListener('DOMContentLoaded', () => {
            PNotify.defaultModules.set(PNotifyMobile, {});
            PNotify.alert({
                text: 'Notice me, senpai!'
            });
        });
    </script>
</head>

<body>
</body>

</html>

if you want another module like Confirm, so you must add link for PnotifyConfirm.css

    <link href="node_modules/@pnotify/confirm/dist/PNotifyConfirm.css" rel="stylesheet" type="text/css" />

also import module inside module area like this:

    <script type="module">
        import * as PNotify from './node_modules/@pnotify/core/dist/PNotify.js';
        import * as PNotifyMobile from './node_modules/@pnotify/mobile/dist/PNotifyMobile.js';
        import * as PNotifyConfirm'./node_modules/@pnotify/confirm/dist/PNotifyConfirm.js';
    </script>

and after export, you can use like this:

  <script type="text/javascript">
        window.addEventListener('DOMContentLoaded', () => {

            PNotify.defaultModules.set(PNotifyMobile, {});
            const notice = PNotify.notice({
                title: 'Confirmation Needed',
                text: 'Are you sure?',
                icon: 'fas fa-question-circle',
                hide: false,
                destroy: true,
                closer: false,
                sticker: false,
                modules: new Map([
                    ...PNotify.defaultModules,
                    [PNotifyConfirm, {
                        confirm: true
                    }]
                ])
            });
            notice.on('pnotify:confirm', () => alert('Ok, cool.'));
            notice.on('pnotify:cancel', () => alert('Oh ok. Chicken, I see.'));
        });
    </script>

for another module like desktop, you can doing like above step... but you must check apropriate file as you expected...

from pnotify.

jamesta696 avatar jamesta696 commented on June 5, 2024

Hi,
Since no devs had answered me I moved on to another library but I'll try this again when I get to the point I need it again.
I appreciate your feedback sir.

from pnotify.

azzahrah avatar azzahrah commented on June 5, 2024

@jamesta696 , can you telme what pnotify alternate?

from pnotify.

samuelsonokoi avatar samuelsonokoi commented on June 5, 2024

This might not be a perfect fix but it takes care of the compile-time errors for my angular application.

node_modules/@pnotify/core/Stack.d.ts you will have to modify line 1 to import { Notice } from './';

replace line 193 to 208 with the code below
swap( one: Notice, theOther: Notice, immediate: boolean, waitAfter: boolean ): Promise<unknown>;

replace line 220 with the following
fire(event: string, detail: {}): void;

In @pnotify/core/index.d.ts file replace line 250 with open(immediate?: boolean): Promise<unknown>; and replace line 261 to 265 with close( immediate?: boolean, timerHide?: boolean, waitAfterward?: boolean ): Promise<unknown>;

This fix worked for "pnotify": "^5.2.0", hopefully the next update will fix these error. Ummmm you might have to redo this again if you reinstall the same package.

from pnotify.

DJDaveMark avatar DJDaveMark commented on June 5, 2024

Today we wanted to update from 3.0.0 to 5.2.0, but we can't because of the same error described above for ES5 Installation.
We used the code described for Vanilla JS (ES5).
We also tried 5.1, 5.0, 4.0.1 ...same error, so I assume we'll have to wait until we port our code to ES2015 (ES6).

from pnotify.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.