Comments (5)
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.
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.
@jamesta696 , can you telme what pnotify alternate?
from pnotify.
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.
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)
- Laravel installation not possible HOT 1
- The alert background color is not revert after the error function call HOT 1
- Integration with Nuxt.js HOT 1
- Does pnotify support HTML tag? HOT 2
- A modalish stack that pushes to the top must use the close maxStrategy - migrated from v4 HOT 1
- Countdown + Bootstrap4 not working
- Potential issue with Desktop permission. Notice may become module controlled after opening. Needs investigation.
- ECS6 Error (Uncaught SyntaxError: The requested module './node_modules/@pnotify/core/dist/PNotify.js' does not provide an export named 'alert') HOT 1
- Pnotify with html tag
- Cannot change default FontAwesome5 icons
- npm run build errors HOT 2
- Why Svelte.... HOT 1
- Temporal fix for compile-time errors on angular apps for "pnotify": "^5.2.0" HOT 2
- Desktop module Make onclick functional
- Bootstrap5 support? HOT 8
- Keep only one dialog
- Doesnt work
- Node install fails on PNotify HOT 1
- End Of Life? HOT 2
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
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.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from pnotify.