Live Update

Live Update 4.0.1

No permission to download
First I had to modify the template mod so it does not use the apple touch icon but the favicon, then I had to install Defer JS so it works properly, then I recognized that it prevents opening modal overlays in other add-ons ("Tags" in Link Directory for example). So, I had to decide if the benefit out balances the trouble.
This is probably the best xenforo add on and a must imo
 
Chris, where is this option? :O I can't find it anywhere to change the default for new registration, I don't remember changing it but I want it to be tab_icon so just want to double check.
You don't need to edit files...

Did you try the Live Update Options?

IMG_5571.webp

You it may depend which version you're running.
 
As I say, it depends on which version you're running. It may have been included in the as yet unreleased 4.1.0 beta which some people are using. If that's the case, you won't have it yet.

Divvens specifically references a post that mentions the option and that post is about the 4.1.0 beta so I assume he must have it, hence why I pointed out editing files wasn't necessary.

https://xenforo.com/community/threads/live-update.27873/page-27#post-1039398
 
As I say, it depends on which version you're running. It may have been included in the as yet unreleased 4.1.0 beta which some people are using. If that's the case, you won't have it yet.

Divvens specifically references a post that mentions the option and that post is about the 4.1.0 beta so I assume he must have it, hence why I pointed out editing files wasn't necessary.

https://xenforo.com/community/threads/live-update.27873/page-27#post-1039398
Yes, sorry for the trouble and confusion. I shouls have been more clear. I was looking at User Registration options and not Live Update options, my fault :)

Thank you!
 
Hey Chris,

awesome plugin! :) But I've got a little question about it. Can you disable the blinking on your name on the top bar? Every 2 or 3 seconds a number (I guess the amount of alerts) is blinking behind the name. Many thanks in advance! :)

Greetings from Germany,

Manuel
 
Last edited:
By default XF only has a counter on the Inbox and Alerts tabs, and no blinking happens when the numbers are updated.

This is likely something to do with your style so I'm unable to help with it.
 
It may have been included in the as yet unreleased 4.1.0 beta which some people are using.
I may have a pull request for some functionality to add to 4.1.0 beta coming at some stage.

Basically; the idea is to reduce the amount of polling by separate tabs on modern browsers while still retaining the 'live update' bit :D
 
No immediate plans but you can edit the template and wrap some of the code in a conditional.
 
Thank you for this add-on! One small annoyance is the live update request closes the lightbox if it's open at the time of the request. The console shows "Window resize, close overlay!" but I'm not sure why or how changing the page title or favicon would trigger a window resize?

Running v4.0.1 on XenForo v1.5.10, any help or suggestions would be appreciated :)
 
I can't reproduce this on the current version that's in testing (4.1) but I'm reluctant to believe this could be caused directly by Live Update even on the old version.

For this to happen, there would be code that explicitly triggers the resize event (that's what is listened for to close open overlays), and there's no such code in the Live Update code. This, therefore, could be something that is happening elsewhere. All that LiveUpdate does is trigger an AJAX request, if some code somewhere is listening for an AJAX request to complete and then triggering the resize event, this could cause it.

In terms of where to go from here, I would recommend first trying it on a completely default, unedited XF default style to see if it can be reproduced there. If it can't, then it could be something in your custom style. If it can, then it could be coming from an add-on or other JS code added. If it's an add-on, you might have to disable each of your add-ons, enabling them one at a time, to see which one introduces the problem.
 
In terms of where to go from here, I would recommend first trying it on a completely default, unedited XF default style to see if it can be reproduced there. If it can't, then it could be something in your custom style. If it can, then it could be coming from an add-on or other JS code added. If it's an add-on, you might have to disable each of your add-ons, enabling them one at a time, to see which one introduces the problem.

You're right, it only happens when I have the xenBlock theme enabled. I will contact them about this issue, thank you!
 
Any idea what this may be from Chris?

Code:
Template Errors: PAGE_CONTAINER
[LIST=1]
[*]in_array() expects parameter 2 to be array, null given in /home/xxxxxx/public_html/library/XenForo/Template/Abstract.php(265) : eval()'d code, line 19906:
19905: ';
19906: if (in_array(('tab_icon'), XenForo_Template_Helper_Core::callHelper('liveupdateoptions', array())))
19907: {
[/LIST]

Only shows when debug is on but would like to get it squared away, not sure what else you may need from me to debug. Also clicking the preferences link in the user panel to bring the overlay up gives a
The server responded with an error. The error message is in the JavaScript console

Which is:
Code:
PHP <div class="baseHtml"><h4>Template Errors: account_preferences</h4><ol>
   <li><i>in_array() expects parameter 2 to be array, null given</i> in /home/xxxxxx/public_html/library/XenForo/Template/Abstract.php(265) : eval()'d code, line 181: <pre>180:                &lt;li&gt;
181:                    &lt;label for=&quot;ctrl_liveupdate_display_option_tab_icon&quot;&gt;&lt;input type=&quot;checkbox&quot; name=&quot;liveupdate_display_option[]&quot; id=&quot;ctrl_liveupdate_display_option_tab_icon&quot; value=&quot;tab_icon&quot; ' . ((in_array(('tab_icon'), XenForo_Template_Helper_Core::callHelper('liveupdateoptions', array()))) ? ' checked=&quot;checked&quot;' : '') . ' /&gt;  ' . 'Tab Icon' . '&lt;/label&gt;
182:                &lt;/li&gt;
</pre></li>
   <li><i>in_array() expects parameter 2 to be array, null given</i> in /home/xxxxxx/public_html/library/XenForo/Template/Abstract.php(265) : eval()'d code, line 185: <pre>184:                &lt;li&gt;
185:                    &lt;label for=&quot;ctrl_liveupdate_display_option_notifications_api&quo[…]

 
I don't think any of that is relevant in the context of the issue that was reported.

Although potentially an issue, it's not one (as you noted) that would be apparent unless debug mode is enabled.

So putting that to one side, the report is that after an AJAX request completes (which just so happens to be a request started by Live Update) something fires a resize event which causes any overlays to close.

As that happens only with your style enabled I wonder if you have any JS code that listens for AJAX (AutoValidator events) to be completed and you then trigger a resize event for some purpose?
 
I don't think any of that is relevant in the context of the issue that was reported.

Although potentially an issue, it's not one (as you noted) that would be apparent unless debug mode is enabled.

So putting that to one side, the report is that after an AJAX request completes (which just so happens to be a request started by Live Update) something fires a resize event which causes any overlays to close.

As that happens only with your style enabled I wonder if you have any JS code that listens for AJAX (AutoValidator events) to be completed and you then trigger a resize event for some purpose?

I'm not sure if you're speaking to me or @Russ who posted those errors...

But if you're speaking to me, I found the problematic code in js/audentio/xenblock/function.js:
Code:
$(document).on('XFAjaxSuccess', function(){
        var activeEle = document.activeElement;
        var resizeAllowed = true;
        if (uix.isSet(activeEle)) {
            var activeEleClass = activeEle.className;
            if (activeEle.tagName === 'IFRAME') {
                resizeAllowed = false; // user tagging in posts
            } else if (uix.isSet(activeEleClass) && activeEleClass !== '') {
                if (activeEleClass.indexOf('AutoComplete') >= 0) {
                    resizeAllowed = false; // XF autocomplete
                } else if (activeEleClass.indexOf('AcSingle') >= 0) {
                    resizeAllowed = false; // XF autocomplete for tagging threads
                } else if (activeEleClass.indexOf('taggingInput') >= 0) {
                    resizeAllowed = false;
                } else if (activeEleClass.indexOf('reply') >= 0) {
                    resizeAllowed = false; // XF post autocomplete after quoting post
                }
            } else if (activeEle.tagName === 'BODY' && activeEle.contentEditable == 'true') {
                resizeAllowed = false; // User tagging in posts
            }
        }

        if (resizeAllowed) {
            window.setTimeout(function(){
                uix.resizeFire()
            }, 0);
        }
}

I have a support ticket open with them about this issue.

Thanks again!
 
Top Bottom