Sample BSV: Notifications

Contains tips for configurators working with Aware IM
Post Reply
hpl123
Posts: 2579
Joined: Fri Feb 01, 2013 1:13 pm
Location: Scandinavia

Sample BSV: Notifications

Post by hpl123 »

Hi all,
Here is a sample BSV implementing custom notifications in an Aware IM app (using the new AWESOME EXEC_SCRIPT action).

The sample shows 2 types or notifications, 1 notification bar and 1 notification shown in the middle of the screen and this is only a sample and you can basically customize it however you want and the sample will be a good starting point. PS: I haven´t looked at the quality of the code i.e. the CSS and JS and not looked to see if it interferes with other Aware IM CSS/JS so test it thoroughly before implementing it in a live app.

Just import the BSV, place in testing mode and log on. Press buttons "Notification bar" and "Notification" in top bar (these execute processes that execute the scripts).

Notification bar:
2.png
2.png (54.77 KiB) Viewed 28744 times
Notification:
3.png
3.png (58.65 KiB) Viewed 28744 times
Enjoy :).
Attachments
Notifications.bsv.zip
(35.82 KiB) Downloaded 935 times
Henrik (V8 Developer Ed. - Windows)
weblike
Posts: 1165
Joined: Sun Dec 02, 2012 12:00 pm
Location: Europe

Re: Sample BSV: Notifications

Post by weblike »

Henrik,
great job
thx for sharing this....
Thx,
George
________________________________
Developer Edition
AwareIM: v8.5, build 2824
OS: Windows Server 2012
DB: MySql 5.6.42
tford
Posts: 4238
Joined: Sat Mar 10, 2007 6:44 pm

Re: Sample BSV: Notifications

Post by tford »

This will be helpful .. thanks Henrik!
Tom - V8.8 build 3137 - MySql / PostGres
hpl123
Posts: 2579
Joined: Fri Feb 01, 2013 1:13 pm
Location: Scandinavia

Re: Sample BSV: Notifications

Post by hpl123 »

Update: Another notificaiton added, this time "inpage" i.e a notification shown inpage (above all else on page) for 5 seconds and then the notification is removed. With this solution you also have 4 different alertboxes with different icons and colors (see the "NotificationInPage" content panel for more info):
3.png
3.png (37.6 KiB) Viewed 28699 times
You need to place the "alertboxes" folder in the AwareIM folder for the icons to show.
Attachments
Notifications2.zip
(40.03 KiB) Downloaded 907 times
Henrik (V8 Developer Ed. - Windows)
hpl123
Posts: 2579
Joined: Fri Feb 01, 2013 1:13 pm
Location: Scandinavia

Re: Sample BSV: Notifications

Post by hpl123 »

hpl123 wrote:Update: Another notificaiton added, this time "inpage" i.e a notification shown inpage (above all else on page) for 5 seconds and then the notification is removed. With this solution you also have 4 different alertboxes with different icons and colors (see the "NotificationInPage" content panel for more info):
3.png
You need to place the "alertboxes" folder in the AwareIM folder for the icons to show.
If the code in the SystemSettings.NotificationInpage (initial value) is empty, here is the code you should use and you can change this code to change alertbox type (see NotificationInPage content panel):

Code: Select all

$( ".append" ).append( '<div id="append" class="alert-box2 success2"><span>success: </span>Write your success message here.</div>' );setTimeout(function(){$("#append").remove();},5000);
Henrik (V8 Developer Ed. - Windows)
eyles
Posts: 62
Joined: Sun Aug 25, 2013 10:50 pm

Re: Sample BSV: Notifications

Post by eyles »

This is super helpful !! amazing work.

Looking into custom notifications and EXEC_SCRIPT

Would it be hard to implement something like this ? http://alertifyjs.com/notifier/success.html
Connor
hpl123
Posts: 2579
Joined: Fri Feb 01, 2013 1:13 pm
Location: Scandinavia

Re: Sample BSV: Notifications

Post by hpl123 »

Yeah, the EXEC_SCRIPT is a gamechanger :). and a lot of new, cool things can now be done.

Regarding alertify, yes, this should be fairly easy to implement as well. Just follow the instructions on the "Get started" page (to include the alertify source files) and then call the function (s) via EXEC_SCRIPT:

Code: Select all

alertify.success('Success notification message.'); 
Henrik (V8 Developer Ed. - Windows)
eyles
Posts: 62
Joined: Sun Aug 25, 2013 10:50 pm

Re: Sample BSV: Notifications

Post by eyles »

Thats what i was missing !! trying to include the source files ! thankyou :D
Connor
PointsWell
Posts: 1457
Joined: Tue Jan 24, 2017 5:51 am
Location: 'Stralya

Re: Sample BSV: Notifications

Post by PointsWell »

Was wondering if you ever got this to work?

I've included the JS and the CSS to the startup.html but I can't get it to call properly
weblike
Posts: 1165
Joined: Sun Dec 02, 2012 12:00 pm
Location: Europe

Re: Sample BSV: Notifications

Post by weblike »

PointsWell wrote:Was wondering if you ever got this to work?

I've included the JS and the CSS to the startup.html but I can't get it to call properly
Hi,

Have you tried to copy the JS&CSS files in the following folders?
c:\AwareIM\Tomcat\webapps\AwareIM\Custom\CSS\your_bsv_name
c:\AwareIM\Tomcat\webapps\AwareIM\Custom\JS\your_bsv_name
Thx,
George
________________________________
Developer Edition
AwareIM: v8.5, build 2824
OS: Windows Server 2012
DB: MySql 5.6.42
PointsWell
Posts: 1457
Joined: Tue Jan 24, 2017 5:51 am
Location: 'Stralya

Re: Sample BSV: Notifications

Post by PointsWell »

weblike wrote:Have you tried to copy the JS&CSS files in the following folders?
it would appear that sctipt and script look very similar on a terminal screen - doh!
Post Reply