Alert Count

Alert Count 1.4

No permission to download

Bloodcinder

Well-known member
Bloodcinder submitted a new resource:

Alert Count - Show unread alert count in browser tab and (optionally) poll for updates every X seconds.

Alert Count add-on for Xenforo
by Bloodcinder

This add-on displays a counter in the page title (that is, in the browser tab for the page) showing how many unread alerts and conversations the user has, if any. This does not affect server load as it is a purely client-side operation.

Optionally, this add-on will also cause pages to check for updates to these alerts in the background at an interval which can be set in the options. This will increase server load marginally if used...

Read more about this resource...
 
Is this also designed for pulling counts from Showcase? If not I would like to suggest it for an future update.
 
Just replaced my Live update addon with this one (y)

Edit: Sometimes doesn't work for me, because I have defer js addon installed?

Same page, but only 1 tab works:
upload_2014-8-19_15-28-33.webp
 
Last edited:
Good work.

Just to put this out there. I've seen the developer of this add-on and another person comment on the "efficiency" of the code. There's nothing inefficient about the code used in the Live Update add-on. The only thing that makes this more efficient is that it doesn't include the ability to change the favicon, therefore this script is a lot smaller because the library to do that is not included.

If you want favicon changing, there's nothing wrong with Live Update. If you don't, this is just as well coded.
 
With this addon enabled, Taigachat stop working with this error on console:
Screenshot from 2014-08-19 21:08:58.webp Screenshot from 2014-08-19 21:09:20.webp
Again maybe because I have defer js addon.
 
Is this also designed for pulling counts from Showcase? If not I would like to suggest it for an future update.
I'm not familiar with Showcase, but any add-on which places alerts into the normal Alerts menu will be compatible with this one. And from looking at the add-on page for Showcase, I think the answer is yes.

Sometimes doesn't work for me, because I have defer js addon installed?
I'll look into getting that compatible, although I can't guarantee I'll succeed. When you were using Live Update, did you have this same problem?

With this addon enabled, Taigachat stop working with this error on console: ...
Do me a favor. In debug mode, go into the template modification for my add-on (it's called Bloodcinder_AlertCount_Script) and where you see the URI for the JavaScript change it from js/bloodcinder/alertcount/min/update.js to js/bloodcinder/alertcount/update.js to use the full version of the script instead of the minified. See if that fixes it. If not, try disabling the Defer add-on and see if everything plays nicely together. If either of those solutions fixes it, then I can work with it. If not, I'm not sure why the error messages would be occurring, because my add-on doesn't do anything to "undefine" jQuery, and it seems that TaigaChat is unable to find jQuery.

Good work.

Just to put this out there. I've seen the developer of this add-on and another person comment on the "efficiency" of the code. There's nothing inefficient about the code used in the Live Update add-on. The only thing that makes this more efficient is that it doesn't include the ability to change the favicon, therefore this script is a lot smaller because the library to do that is not included.

If you want favicon changing, there's nothing wrong with Live Update. If you don't, this is just as well coded.
I agree, and I'm sorry if you thought my technical details were directed at you. I've used your add-on before, and other than the trivial fact that yours has a bigger library in it, yeah, there's nothing wrong with yours. However, I've seen a couple older, more outdated ones that I felt weren't as efficient, and that's what I was primarily referring to. The only problem I had with your add-on in the source code was outside of the JavaScript. Your controller for your route prefix returns a responseView of a not-existent view, meaning that if you navigate directly to the route prefix it gives an error. Mine returns a responseMessage with a globally cached phrase. I really have no idea if there's any practical difference there, but I felt it was better to ensure that the Ajax polls requested error-free pages.
 
I just disabled Defer JS addon and it works fine now, so this is incompatible with Defer JS addon.
 
I just disabled Defer JS addon and it works fine now, so this is incompatible with Defer JS addon.
Okay. What I'll do later (today? depends on work) is install Defer JS on my own forum and try to get the add-on to be compatible with it. Then I'll attach an experimental update to this thread and let you try it out on yours and see if it also fixes the TaigaChat problem. If that works, I'll update the resource with the changes.

I'm guessing it will only take a minor tweak. Bear with me, please.

Oh, and if you would, please withhold any bad ratings/reviews until I can look at fixing this compatibility issue. I can't necessarily predict how things will interact with add-ons I don't have, but since you've brought it to my attention I'll try my best to get them compatible. And then if I can't you can give me a bad review. ;)
 
I just disabled Defer JS addon and it works fine now, so this is incompatible with Defer JS addon.
By the way, after this no error any more on console regarding your addon but the alert count works sometimes, sometimes not.
Sometimes alert count is display when page load almost finish but then disappear immediately after page load is done.
 
Here's an experimental update for those that have been having problems. I won't update the resource page immediately with this version. I want to see if this version solves anybody's issues first before I do that.

@RoldanLT , I've tested this with Defer JS and I don't have any problems with it. If you still encounter problems, it's not because of Defer JS. It might be because of another add-on or because of something with your server setup. Please let me know if you still encounter problems.

@toodlez , this update might resolve your issues as well, so try it out.

I reorganized the code a bit and changed when certain things are executed. It's a bit more elegant now and should automatically clear up some conflicts with certain other add-ons.

(Attachment removed.)
 
Last edited:
Here's an experimental update for those that have been having problems. I won't update the resource page immediately with this version. I want to see if this version solves anybody's issues first before I do that.

@RoldanLT , I've tested this with Defer JS and I don't have any problems with it. If you still encounter problems, it's not because of Defer JS. It might be because of another add-on or because of something with your server setup. Please let me know if you still encounter problems.

@toodlez , this update might resolve your issues as well, so try it out.

I reorganized the code a bit and changed when certain things are executed. It's a bit more elegant now and should automatically clear up some conflicts with certain other add-ons.

Still not working, sadly
 
@toodlez I looked over the list you sent me of your installed add-ons and I can't find anything that seems to be the culprit. Do you get the normal pop-up bubble alerts (by default red pop-up bubbles that show for the Inbox and Alerts on the nav bar)? Do you have any aggressive caching software running on your server?
 
Worked with @toodlez to get rid of some bugs.

This experimental update should fix incompatibility with certain third-party templates and with the Defer JS add-on.

It partially fixes incompatibility with TaigaChat. However, it's not possible for me to completely make it compatible because TaigaChat also tries to control the page title, even when its options are set so that it is not supposed to do that.

Let's see if this solves some the issues for some people. If so, I'll officially update the resource.

(Attachment removed.)
 
Last edited:
Top Bottom