Sueetie Activity Popup Notification jQuery Coexistence

A new feature coming in Sueetie v3.3 is Site Activity Popup Notifications.  This keeps everyone informed of the action without having to reload the page to monitor the Site Activity log.  Here’s an example of a Notification Popup.

Everything was jake with the Notification Popups on Sueetie.com until I noticed that a jQuery Media Set app I wrote and inserted into a ScrewTurn Wiki Page wasn’t displaying the images.  This is what it’s supposed to look like. 

The problem was that the Site Notification Script and the Media Set jQuery were fighting over the same PageLoad() CPU time.  I know javascript supports multiple PageLoad() functions in theory, but things aren’t always harmonious on the client side.  PageLoad(), $(document).ready(function() {}, it don’t matter.  We’re not always going to get along. Site Activity Popup Notifications depend on a javascript SetInterval() call in PageLoad() and the Media Set app needed PageLoad() to load its images and add some supporting functions.  First one to reach 500 feet won. 

It’s all good again. The Popup Notification is no longer in conflict with the Media Set app or any other PageLoad() dependent script.  The solution was to redesign the ASPNET Notification Control to render in two sections, a PageLoad() section and the support function section.  A new property called "UsePageLoadSetInterval" was added to determine how the Control will render.  It is set to true by default.

Here’s an example of using the "UsePageLoadSetInterval" property in the Notification Control.

Image

Since the ASPNET Control is no longer rendering the PageLoad() script we’re going to manually add the Notifier’s SetInterval() Code in the Media Set app’s PageLoad() script.

Image

You want to experiment with this yourself, I’m sure.  Don’t worry. Version 3.3 is coming soon!

Article written by

A long time developer, I was an early adopter of Linux in the mid-90's for a few years until I entered corporate environments and worked with Microsoft technologies like ASP, then .NET. In 2008 I released Sueetie, an Online Community Platform built in .NET. In late 2012 I returned to my Linux roots and locked in on Java development. Much of my work is available on GitHub.