rocketlaunchr / electron-alert Goto Github PK
View Code? Open in Web Editor NEWSweetAlert2 for Electron applications
Home Page: https://electron.guide/electron-alert/
License: MIT License
SweetAlert2 for Electron applications
Home Page: https://electron.guide/electron-alert/
License: MIT License
Hi, I have problem with Toast.
I saw I can call it from Alert promise and this is wonderful, but I don't know why, any Toast appears in top-start (I think) whatever position I give (even without set it).
Which could be the problem?
Using this nice library I got the error in the object at line 373.
I changed the code removing registerAll and adding:
globalShortcut.register(
"CommandOrControl+R",
() => {}
);
globalShortcut.register(
"CommandOrControl+Shift+R",
() => {}
);
Now it seems working...which is the difference?
When firing a toast, the position values are absolute - they're calculated with respect to the desktop.
There should be an option to position them relative to the window bounds instead of desktop bounds.
For instance, these lines could be updated to include
window-top-right
window-top-left
etc.
I don't have time or would have raised a PR.
Hi,
I am trying create undismissable alert, users will not be able to click outside of the alert box, on full screen app. sweet alert do this by allowOutsideClick
to false. I tried with this library, it did not work.
In the firewithFrame, shouldn't it be bwOptions.title ? bwOptions.title
instead of title ? title
. Believe its line 199
bwOptions = Object.assign(bwOptions, {
frame: true,
transparent: false,
thickFrame: true,
closable: true,
title: bwOptions.title ? bwOptions.title : "name" in app ? app.name : app.getName(),
});
Otherwise, what you set in swalOptions as the title won't be transferred to the bwOptions.
It would be good to use this package:
https://github.com/sindresorhus/clean-stack
and also give option to set window title for exceptions.
Hi)
It would be great to use contextIsolation flag to have the ability to use electron v12
electron/electron#23506
(node:8475) electron: The default of contextIsolation is deprecated and will be changing from false to true in a future release of Electron. See https://github.com/electron/electron/issues/23506 for more information
maybe something like alert.style = "* {font-family: sans-serif;}"
then inject this style into the html
const Alert = require('electron-alert')
let swalOptions = {
position: "top",
title: "Correct",
icon: "success",
showConfirmButton: true,
timer: 8000
};
Alert.fireToast(swalOptions);
The above doesn't work in lastest version of electron. It works only on the lower version. Please have a look at it. Thanks
const toastOptions = {
position: 'top-end',
showConfirmButton: false,
timer: 6000,
timerProgressBar: true,
icon: 'info',
title: '<span style="font-size: 1.15rem; font-weight: bold; font-family: "Montserrat" !important; ">Title of Toast</span>',
text: Toast Subtitle,
color: 'white',
iconColor: '#03d8d8',
};
We are setting up the title to include inline styling. Both the font-size and font-weight and are applied but not the font-family.
A declarative, efficient, and flexible JavaScript library for building user interfaces.
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. ๐๐๐
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google โค๏ธ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.