- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎05-04-2016 07:59 AM
Hi All,
We are using standard javascript(underlined) alert which gives the below pop up message when i click on certain application. Is there any way i can make this pop up message more fancier, it should look good and i want to insert my company's logo in the popup message. I am currently on Eureka version.
for(var j = 0; j< selectedOptions.length; j++){
if(selectedOptions[j].value == '8ed97438d8121a40c64c9be40e87a4b8'){//check for Consultant Pharmacist Package
moveSelectedOptions(selectedIDs, rightBucket, leftBucket); //move the options
alert("Selecting this option will move certain Applications to Right side bucket as a Package.");  //remove none option from right
Solved! Go to Solution.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎05-04-2016 08:54 AM
Here are the steps to install SweetAlerts (just tested it in my developer instance):
- Download SweetAlerts from ServiceNow Share (you'll need to login with your HI credentials / register if you've never used it before)
- The file saved will be called: SweetAlerts-V1.1.XML
- Once you have the XML file, you can import it from any table using the "Import XML" function in list view:
- I did this on "Retrieved Update Sets" since this is where the update set will appear after the import.
- Once the file is imported, you will see a new entry on "Retrieved Update Sets" called "SweetAlerts-V1.2" in a state of "Loaded"
- Preview and Commit the Update Set. It will add 4 new items to your instance:
- Style Sheet (SweetAlert.css)
- Schedule Item (Share Install Logger) -- Marks that you've installed something from share, as to give the original author credit
- UI Script (globalsweetalerts)
- UI Script (SweetAlerts-min)
- I did this on "Retrieved Update Sets" since this is where the update set will appear after the import.
I tested this in a Geneva instance, but have used it in Fuji as well. Since its essentially Javascript hanging out in a UI Script, there shouldn't be any problems with it running in Eureka.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎05-04-2016 11:14 AM
Thanks Mike, it worked.
1 concern: logo which i inserted is very small and hardly visible. where can i control the size of the logo?. i defined the image in the image module.
for(var j = 0; j< selectedOptions.length; j++){
if(selectedOptions[j].value == '8ed97438d8121a40c64c9be40e87a4b8'){//check for Consultant Pharmacist Package
moveSelectedOptions(selectedIDs, rightBucket, leftBucket); //move the options
swal({ title: "",text: "Selecting this option will move certain Applications to Right side bucket as a Package.", imageUrl: "cvslogo.png" });
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎05-05-2016 06:17 AM
Hi Mike, is it possible to increase the size of logo message?
I defined the specific size in the script itself but its not working..
imageUrl: 'cvs_logo.jpg',
imageWidth: 600,
imageHeight: 400,
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎05-05-2016 06:23 AM
Rahul (good morning!),
It looks like you can (I personally haven't done it), but I found in the documentation (from GitHub) that you should be able to pass the following:
imageSize | "80x80" | If imageUrl is set, you can specify imageSize to describes how big you want the icon to be in px. Pass in a string with two values separated by an "x". The first value is the width, the second is the height. |
So, your syntax should probably look like this:
imageUrl: 'cvs_logo.jpg',
imageSize: '600x400',
Give that a try and see if it works.